Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
anis
anis-server
Commits
0f40f1b5
Commit
0f40f1b5
authored
Nov 03, 2020
by
François Agneray
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed phpcs issues
parent
2794b6f3
Changes
15
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
44 additions
and
44 deletions
+44
-44
src/Action/DatasetAction.php
src/Action/DatasetAction.php
+2
-2
src/Action/GroupAction.php
src/Action/GroupAction.php
+1
-1
src/Action/GroupListAction.php
src/Action/GroupListAction.php
+2
-2
src/Action/ProjectAction.php
src/Action/ProjectAction.php
+1
-1
src/Action/SearchAction.php
src/Action/SearchAction.php
+1
-1
src/Entity/Attribute.php
src/Entity/Attribute.php
+1
-1
src/Entity/CriteriaFamily.php
src/Entity/CriteriaFamily.php
+3
-3
src/Entity/Dataset.php
src/Entity/Dataset.php
+23
-23
src/Entity/DatasetFamily.php
src/Entity/DatasetFamily.php
+1
-1
src/Entity/OutputCategory.php
src/Entity/OutputCategory.php
+2
-2
src/Entity/OutputFamily.php
src/Entity/OutputFamily.php
+3
-3
src/Utils/Operator/JsonPostgres.php
src/Utils/Operator/JsonPostgres.php
+1
-1
src/Utils/Operator/OperatorFactory.php
src/Utils/Operator/OperatorFactory.php
+1
-1
tests/Action/AttributeActionTest.php
tests/Action/AttributeActionTest.php
+1
-1
tests/Middleware/CorsMiddlewareTest.php
tests/Middleware/CorsMiddlewareTest.php
+1
-1
No files found.
src/Action/DatasetAction.php
View file @
0f40f1b5
...
...
@@ -48,7 +48,7 @@ final class DatasetAction extends AbstractAction
'Dataset with name '
.
$args
[
'name'
]
.
' is not found'
);
}
if
(
$request
->
getMethod
()
===
GET
)
{
$payload
=
json_encode
(
$dataset
,
JSON_UNESCAPED_SLASHES
);
}
...
...
@@ -85,7 +85,7 @@ final class DatasetAction extends AbstractAction
'Dataset family with id '
.
$parsedBody
[
'id_dataset_family'
]
.
' is not found'
);
}
$this
->
editDataset
(
$dataset
,
$parsedBody
,
$family
);
$payload
=
json_encode
(
$dataset
,
JSON_UNESCAPED_SLASHES
);
}
...
...
src/Action/GroupAction.php
View file @
0f40f1b5
...
...
@@ -99,7 +99,7 @@ final class GroupAction extends AbstractAction
if
(
count
(
$listOfUsersIds
)
<
1
)
{
return
array
();
}
$dql
=
'SELECT u FROM App\Entity\User u WHERE u.id IN ('
.
implode
(
','
,
$listOfUsersIds
)
.
')'
;
$query
=
$this
->
em
->
createQuery
(
$dql
);
return
$query
->
getResult
();
...
...
src/Action/GroupListAction.php
View file @
0f40f1b5
...
...
@@ -91,7 +91,7 @@ final class GroupListAction extends AbstractAction
$in
=
implode
(
','
,
array_map
(
function
(
$u
)
{
return
"'"
.
$u
.
"'"
;
},
$listOfUsersEmails
));
$dql
=
'SELECT u FROM App\Entity\User u WHERE u.email IN ('
.
$in
.
')'
;
$query
=
$this
->
em
->
createQuery
(
$dql
);
return
$query
->
getResult
();
...
...
@@ -102,7 +102,7 @@ final class GroupListAction extends AbstractAction
if
(
count
(
$listOfDatasetsNames
)
<
1
)
{
return
array
();
}
$in
=
implode
(
','
,
array_map
(
function
(
$d
)
{
return
"'"
.
$d
.
"'"
;
},
$listOfDatasetsNames
));
...
...
src/Action/ProjectAction.php
View file @
0f40f1b5
...
...
@@ -55,7 +55,7 @@ final class ProjectAction extends AbstractAction
if
(
$request
->
getMethod
()
===
PUT
)
{
$parsedBody
=
$request
->
getParsedBody
();
// If mandatories empty fields 400
foreach
(
array
(
'label'
,
'description'
,
'link'
,
'manager'
,
'id_database'
)
as
$a
)
{
if
(
$this
->
isEmptyField
(
$a
,
$parsedBody
))
{
...
...
src/Action/SearchAction.php
View file @
0f40f1b5
...
...
@@ -83,7 +83,7 @@ final class SearchAction extends AbstractAction
$connection
=
$this
->
connectionFactory
->
create
(
$dataset
->
getProject
()
->
getDatabase
());
$queryBuilder
=
$connection
->
createQueryBuilder
();
$queryBuilder
->
from
(
$dataset
->
getTableRef
());
$queryParams
=
$request
->
getQueryParams
();
// The parameter "a" is mandatory
...
...
src/Entity/Attribute.php
View file @
0f40f1b5
...
...
@@ -134,7 +134,7 @@ class Attribute implements \JsonSerializable
* @Column(type="string", name="placeholder_min", nullable=true)
*/
protected
$placeholderMin
;
/**
* @var string
*
...
...
src/Entity/CriteriaFamily.php
View file @
0f40f1b5
...
...
@@ -26,7 +26,7 @@ class CriteriaFamily implements \JsonSerializable
* @GeneratedValue
*/
protected
$id
;
/**
* @var string
*
...
...
@@ -58,12 +58,12 @@ class CriteriaFamily implements \JsonSerializable
{
return
$this
->
id
;
}
public
function
getLabel
()
{
return
$this
->
label
;
}
public
function
setLabel
(
$label
)
{
$this
->
label
=
$label
;
...
...
src/Entity/Dataset.php
View file @
0f40f1b5
...
...
@@ -27,42 +27,42 @@ class Dataset implements \JsonSerializable
* @Column(type="string", nullable=false)
*/
protected
$name
;
/**
* @var string
*
* @Column(type="string", name="table_ref", nullable=false)
*/
protected
$tableRef
;
/**
* @var string
*
* @Column(type="string", nullable=false)
*/
protected
$label
;
/**
* @var string
*
* @Column(type="text", nullable=true)
*/
protected
$description
;
/**
* @var int
*
* @Column(type="integer", nullable=false)
*/
protected
$display
;
/**
* @var int
*
* @Column(type="integer", nullable=true)
*/
protected
$count
;
/**
* @var bool
*
...
...
@@ -90,7 +90,7 @@ class Dataset implements \JsonSerializable
* @Column(type="boolean", nullable=false)
*/
protected
$public
;
/**
* @var Anis\Entity\Project
*
...
...
@@ -106,7 +106,7 @@ class Dataset implements \JsonSerializable
* @JoinColumn(name="id_dataset_family", referencedColumnName="id", nullable=false)
*/
protected
$datasetFamily
;
/**
* @var Anis\Entity\Attribute[]
*
...
...
@@ -119,72 +119,72 @@ class Dataset implements \JsonSerializable
$this
->
name
=
$name
;
$this
->
attributes
=
new
ArrayCollection
();
}
public
function
getName
()
{
return
$this
->
name
;
}
public
function
getTableRef
()
{
return
$this
->
tableRef
;
}
public
function
setTableRef
(
$tableRef
)
{
$this
->
tableRef
=
$tableRef
;
}
public
function
getLabel
()
{
return
$this
->
label
;
}
public
function
setLabel
(
$label
)
{
$this
->
label
=
$label
;
}
public
function
getDescription
()
{
return
$this
->
description
;
}
public
function
setDescription
(
$description
)
{
$this
->
description
=
$description
;
}
public
function
getDisplay
()
{
return
$this
->
display
;
}
public
function
setDisplay
(
$display
)
{
$this
->
display
=
$display
;
}
public
function
getCount
()
{
return
$this
->
count
;
}
public
function
setCount
(
$count
)
{
$this
->
count
=
$count
;
}
public
function
getVo
()
{
return
$this
->
vo
;
}
public
function
setVo
(
$vo
)
{
$this
->
vo
=
$vo
;
}
public
function
getDataPath
()
{
return
$this
->
dataPath
;
...
...
@@ -219,7 +219,7 @@ class Dataset implements \JsonSerializable
{
return
$this
->
project
;
}
public
function
setProject
(
$project
)
{
$this
->
project
=
$project
;
...
...
src/Entity/DatasetFamily.php
View file @
0f40f1b5
...
...
@@ -28,7 +28,7 @@ class DatasetFamily implements \JsonSerializable
* @GeneratedValue
*/
protected
$id
;
/**
* @var string
*
...
...
src/Entity/OutputCategory.php
View file @
0f40f1b5
...
...
@@ -48,7 +48,7 @@ class OutputCategory implements \JsonSerializable
* @JoinColumn(name="output_family", referencedColumnName="id", nullable=false)
*/
protected
$outputFamily
;
public
function
getId
()
{
return
$this
->
id
;
...
...
@@ -78,7 +78,7 @@ class OutputCategory implements \JsonSerializable
{
$this
->
outputFamily
=
$outputFamily
;
}
public
function
getOutputFamily
()
{
return
$this
->
outputFamily
;
...
...
src/Entity/OutputFamily.php
View file @
0f40f1b5
...
...
@@ -26,7 +26,7 @@ class OutputFamily implements \JsonSerializable
* @GeneratedValue
*/
protected
$id
;
/**
* @var string
*
...
...
@@ -58,12 +58,12 @@ class OutputFamily implements \JsonSerializable
{
return
$this
->
id
;
}
public
function
getLabel
()
{
return
$this
->
label
;
}
public
function
setLabel
(
$label
)
{
$this
->
label
=
$label
;
...
...
src/Utils/Operator/JsonPostgres.php
View file @
0f40f1b5
...
...
@@ -72,7 +72,7 @@ class JsonPostgres extends Operator
}
else
{
$newValue
=
$this
->
value
;
}
return
$this
->
getSqlValue
(
json_encode
(
$newValue
));
}
}
src/Utils/Operator/OperatorFactory.php
View file @
0f40f1b5
...
...
@@ -100,7 +100,7 @@ class OperatorFactory implements IOperatorFactory
throw
OperatorException
::
operatorBadNumberOfParameters
(
$type
,
1
);
}
return
new
NotLike
(
$expr
,
$column
,
$columnType
,
$parameters
[
0
]);
case
'in'
:
if
(
count
(
$parameters
)
<
1
)
{
throw
OperatorException
::
inBadNumberOfParameters
(
$type
);
...
...
tests/Action/AttributeActionTest.php
View file @
0f40f1b5
...
...
@@ -256,7 +256,7 @@ final class AttributeActionTest extends TestCase
$attribute
->
setSelected
(
true
);
$this
->
entityManager
->
persist
(
$attribute
);
$this
->
entityManager
->
flush
();
return
$attribute
;
}
}
tests/Middleware/CorsMiddlewareTest.php
View file @
0f40f1b5
...
...
@@ -40,7 +40,7 @@ final class CorsMiddlewareTest extends TestCase
(
string
)
$response
->
getHeaderLine
(
'Access-Control-Allow-Headers'
)
);
}
public
function
testCorsHeadersForGetMethod
()
{
$request
=
new
ServerRequest
(
'GET'
,
'/'
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment