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,22 +1,26 @@
<?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.
*/
namespace Chill\PersonBundle\Controller;
use Chill\MainBundle\Pagination\PaginatorFactory;
use Chill\MainBundle\Serializer\Model\Collection;
use Chill\PersonBundle\Entity\SocialWork\SocialAction;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter;
class SocialWorkEvaluationApiController extends AbstractController
{
private PaginatorFactory $paginatorFactory;
/**
* @param PaginatorFactory $paginatorFactory
*/
public function __construct(PaginatorFactory $paginatorFactory)
{
$this->paginatorFactory = $paginatorFactory;
@@ -26,21 +30,21 @@ class SocialWorkEvaluationApiController extends AbstractController
* @Route("/api/1.0/person/social-work/evaluation/by-social-action/{action_id}.json",
* name="chill_person_evaluation_index_by_social_action",
* requirements={
* "_format": "json"
* "_format": "json"
* }
* )
* @ParamConverter("action", options={"id": "action_id"})
* @param SocialAction $action
* @return Response
*/
public function listEvaluationBySocialAction(SocialAction $action): Response
{
$pagination = $this->paginatorFactory->create($action->getEvaluations()->count());
$evaluations = $action->getEvaluations()->slice($pagination->getCurrentPageFirstItemNumber(),
$pagination->getItemsPerPage());
$evaluations = $action->getEvaluations()->slice(
$pagination->getCurrentPageFirstItemNumber(),
$pagination->getItemsPerPage()
);
$collection = new Collection($evaluations, $pagination);
return $this->json($collection, Response::HTTP_OK, [], [ 'groups' => [ 'read' ]]);
return $this->json($collection, Response::HTTP_OK, [], ['groups' => ['read']]);
}
}