cs: Fix code style (safe rules only).

This commit is contained in:
Pol Dellaiera
2021-11-23 14:06:38 +01:00
parent 149d7ce991
commit 8f96a1121d
1223 changed files with 65199 additions and 64625 deletions

View File

@@ -1,4 +1,12 @@
<?php
/**
* Chill is a software for social workers
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
declare(strict_types=1);
namespace Chill\PersonBundle\Controller;
@@ -6,15 +14,17 @@ namespace Chill\PersonBundle\Controller;
use Chill\MainBundle\CRUD\Controller\ApiController;
use Chill\PersonBundle\Entity\Person;
use Chill\PersonBundle\Repository\Relationships\RelationshipRepository;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Validator\Validator\ValidatorInterface;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter;
use function array_values;
class RelationshipApiController extends ApiController
{
private ValidatorInterface $validator;
private RelationshipRepository $repository;
private ValidatorInterface $validator;
public function __construct(ValidatorInterface $validator, RelationshipRepository $repository)
{
$this->validator = $validator;
@@ -22,13 +32,13 @@ class RelationshipApiController extends ApiController
}
/**
* @ParamConverter("person", options={"id" = "person_id"})
* @ParamConverter("person", options={"id": "person_id"})
*/
public function getRelationshipsByPerson(Person $person)
{
//TODO: add permissions? (voter?)
$relationships = $this->repository->findByPerson($person);
return $this->json(\array_values($relationships), Response::HTTP_OK, [], ['groups' => [ 'read']]);
return $this->json(array_values($relationships), Response::HTTP_OK, [], ['groups' => ['read']]);
}
}