Commit 0f40f1b5 authored by François Agneray's avatar François Agneray

Fixed phpcs issues

parent 2794b6f3
......@@ -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);
}
......
......@@ -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();
......
......@@ -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));
......
......@@ -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)) {
......
......@@ -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
......
......@@ -134,7 +134,7 @@ class Attribute implements \JsonSerializable
* @Column(type="string", name="placeholder_min", nullable=true)
*/
protected $placeholderMin;
/**
* @var string
*
......
......@@ -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;
......
......@@ -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;
......
......@@ -28,7 +28,7 @@ class DatasetFamily implements \JsonSerializable
* @GeneratedValue
*/
protected $id;
/**
* @var string
*
......
......@@ -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;
......
......@@ -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;
......
......@@ -72,7 +72,7 @@ class JsonPostgres extends Operator
} else {
$newValue = $this->value;
}
return $this->getSqlValue(json_encode($newValue));
}
}
......@@ -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);
......
......@@ -256,7 +256,7 @@ final class AttributeActionTest extends TestCase
$attribute->setSelected(true);
$this->entityManager->persist($attribute);
$this->entityManager->flush();
return $attribute;
}
}
......@@ -40,7 +40,7 @@ final class CorsMiddlewareTest extends TestCase
(string) $response->getHeaderLine('Access-Control-Allow-Headers')
);
}
public function testCorsHeadersForGetMethod()
{
$request = new ServerRequest('GET', '/');
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment