mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-20 22:53:49 +00:00
cs: Fix code style (safe rules only).
This commit is contained in:
@@ -1,36 +1,40 @@
|
||||
<?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\Serializer\Model\Collection;
|
||||
use Chill\MainBundle\Pagination\PaginatorFactory;
|
||||
use Chill\PersonBundle\Repository\SocialWork\SocialIssueRepository;
|
||||
use Chill\MainBundle\CRUD\Controller\ApiController;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Chill\MainBundle\Pagination\PaginatorFactory;
|
||||
use Chill\MainBundle\Serializer\Model\Collection;
|
||||
use Chill\PersonBundle\Repository\SocialWork\SocialIssueRepository;
|
||||
use Symfony\Component\HttpFoundation\JsonResponse;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
|
||||
class SocialWorkSocialActionApiController extends ApiController
|
||||
{
|
||||
private SocialIssueRepository $socialIssueRepository;
|
||||
|
||||
private PaginatorFactory $paginator;
|
||||
|
||||
/**
|
||||
* @param SocialIssueRepository $socialIssueRepository
|
||||
*/
|
||||
private SocialIssueRepository $socialIssueRepository;
|
||||
|
||||
public function __construct(SocialIssueRepository $socialIssueRepository, PaginatorFactory $paginator)
|
||||
{
|
||||
$this->socialIssueRepository = $socialIssueRepository;
|
||||
$this->paginator = $paginator;
|
||||
}
|
||||
|
||||
|
||||
public function listBySocialIssueApi($id, Request $request)
|
||||
{
|
||||
$socialIssue = $this->socialIssueRepository
|
||||
->find($id);
|
||||
|
||||
if (NULL === $socialIssue) {
|
||||
throw $this->createNotFoundException("socialIssue not found");
|
||||
if (null === $socialIssue) {
|
||||
throw $this->createNotFoundException('socialIssue not found');
|
||||
}
|
||||
|
||||
$socialActions = $socialIssue->getRecursiveSocialActions();
|
||||
@@ -39,9 +43,7 @@ class SocialWorkSocialActionApiController extends ApiController
|
||||
$pagination->setItemsPerPage(count($socialActions));
|
||||
|
||||
$collection = new Collection($socialActions, $pagination);
|
||||
|
||||
|
||||
return $this->json($collection, JsonResponse::HTTP_OK, [], [ "groups" => [ "read" ]]);
|
||||
}
|
||||
|
||||
return $this->json($collection, JsonResponse::HTTP_OK, [], ['groups' => ['read']]);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user