From eb32b13bcc63913ab39be5fdc3d76ebdb6b2db28 Mon Sep 17 00:00:00 2001 From: nobohan Date: Tue, 1 Feb 2022 16:49:14 +0100 Subject: [PATCH 01/10] person: rewrite social issue api controller for ordering --- .../Controller/SocialIssueApiController.php | 98 +++++++++++++++---- .../ChillPersonExtension.php | 42 ++++---- .../ChillPersonBundle/config/routes.yaml | 4 + .../config/services/controller.yaml | 4 + 4 files changed, 106 insertions(+), 42 deletions(-) diff --git a/src/Bundle/ChillPersonBundle/Controller/SocialIssueApiController.php b/src/Bundle/ChillPersonBundle/Controller/SocialIssueApiController.php index d154c8e2e..fa2e7bb37 100644 --- a/src/Bundle/ChillPersonBundle/Controller/SocialIssueApiController.php +++ b/src/Bundle/ChillPersonBundle/Controller/SocialIssueApiController.php @@ -14,40 +14,96 @@ namespace Chill\PersonBundle\Controller; use Chill\MainBundle\CRUD\Controller\ApiController; use Chill\MainBundle\Doctrine\ORM\Hydration\FlatHierarchyEntityHydrator; use Chill\MainBundle\Pagination\PaginatorInterface; +use Chill\MainBundle\Serializer\Model\Collection; +use Chill\PersonBundle\Entity\SocialWork\SocialIssue; use DateTimeImmutable; use Doctrine\ORM\Query; +use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; +use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; +use Symfony\Component\Serializer\SerializerInterface; -class SocialIssueApiController extends ApiController +//class SocialIssueApiController extends ApiController +class SocialIssueApiController extends AbstractController { - protected function customizeQuery(string $action, Request $request, $query): void + + private SerializerInterface $serializer; + + public function __construct( + SerializerInterface $serializer + ) { + $this->serializer = $serializer; + } + + // protected function customizeQuery(string $action, Request $request, $query): void + // { + // $query->where( + // $query->expr()->orX( + // $query->expr()->gt('e.desactivationDate', ':now'), + // $query->expr()->isNull('e.desactivationDate') + // ) + // ); + // $query->setParameter('now', new DateTimeImmutable()); + // } + + // protected function getQueryResult(string $action, Request $request, string $_format, int $totalItems, PaginatorInterface $paginator, $query) + // { + // // In order to work, this hydrator only works with + // // entities having the field "children" set up. + // return $query + // ->getQuery() + // ->setHint(Query::HINT_INCLUDE_META_COLUMNS, true) + // ->getResult(FlatHierarchyEntityHydrator::LIST); + // } + + // protected function onPostIndexBuildQuery(string $action, Request $request, string $_format, int $totalItems, PaginatorInterface $paginator, $query): ?Response + // { + // $query + // ->orderBy('GET_JSON_FIELD_BY_KEY(e.title, :locale)', 'ASC') + // ->setParameter(':locale', $request->getLocale()); + + // return null; + // } + + // protected function orderQuery(string $action, $query, Request $request, PaginatorInterface $paginator, $_format) + // { + // $query->addOrderBy('ordering', 'ASC'); + // return $query; + + // } + + /* + * @Route("/api/1.0/person/social-work/social-issue.json", name="social_work_social_issue") + */ + public function indexAction(Request $request): JsonResponse { - $query->where( - $query->expr()->orX( - $query->expr()->gt('e.desactivationDate', ':now'), - $query->expr()->isNull('e.desactivationDate') + $this->denyAccessUnlessGranted('ROLE_USER'); + + $qb = $this->getDoctrine()->getManager()->createQueryBuilder(); + + $qb->select('si')->from(SocialIssue::class, 'si'); + + $qb->where( + $qb->expr()->orX( + $qb->expr()->gt('si.desactivationDate', ':now'), + $qb->expr()->isNull('si.desactivationDate') ) ); - $query->setParameter('now', new DateTimeImmutable()); - } + $qb->setParameter('now', new DateTimeImmutable()); + $qb->addOrderBy('si.ordering', 'ASC'); - protected function getQueryResult(string $action, Request $request, string $_format, int $totalItems, PaginatorInterface $paginator, $query) - { - // In order to work, this hydrator only works with - // entities having the field "children" set up. - return $query - ->getQuery() + $qb->getQuery() ->setHint(Query::HINT_INCLUDE_META_COLUMNS, true) ->getResult(FlatHierarchyEntityHydrator::LIST); - } - protected function onPostIndexBuildQuery(string $action, Request $request, string $_format, int $totalItems, PaginatorInterface $paginator, $query): ?Response - { - $query - ->orderBy('GET_JSON_FIELD_BY_KEY(e.title, :locale)', 'ASC') - ->setParameter(':locale', $request->getLocale()); + $socialIssues = $qb->getQuery()->getResult(); - return null; + return new JsonResponse( + $this->serializer->serialize(['count' => count($socialIssues), 'results' => $socialIssues], 'json', ['groups' => ['read']]), + JsonResponse::HTTP_OK, + [], + true + ); } } diff --git a/src/Bundle/ChillPersonBundle/DependencyInjection/ChillPersonExtension.php b/src/Bundle/ChillPersonBundle/DependencyInjection/ChillPersonExtension.php index 01df460e3..b785ad0ca 100644 --- a/src/Bundle/ChillPersonBundle/DependencyInjection/ChillPersonExtension.php +++ b/src/Bundle/ChillPersonBundle/DependencyInjection/ChillPersonExtension.php @@ -455,27 +455,27 @@ class ChillPersonExtension extends Extension implements PrependExtensionInterfac ], ], ], - [ - 'class' => \Chill\PersonBundle\Entity\SocialWork\SocialIssue::class, - 'name' => 'social_work_social_issue', - 'controller' => \Chill\PersonBundle\Controller\SocialIssueApiController::class, - 'base_path' => '/api/1.0/person/social-work/social-issue', - 'base_role' => 'ROLE_USER', - 'actions' => [ - '_index' => [ - 'methods' => [ - Request::METHOD_GET => true, - Request::METHOD_HEAD => true, - ], - ], - '_entity' => [ - 'methods' => [ - Request::METHOD_GET => true, - Request::METHOD_HEAD => true, - ], - ], - ], - ], + // [ + // 'class' => \Chill\PersonBundle\Entity\SocialWork\SocialIssue::class, + // 'name' => 'social_work_social_issue', + // 'controller' => \Chill\PersonBundle\Controller\SocialIssueApiController::class, + // 'base_path' => '/api/1.0/person/social-work/social-issue', + // 'base_role' => 'ROLE_USER', + // 'actions' => [ + // '_index' => [ + // 'methods' => [ + // Request::METHOD_GET => true, + // Request::METHOD_HEAD => true, + // ], + // ], + // '_entity' => [ + // 'methods' => [ + // Request::METHOD_GET => true, + // Request::METHOD_HEAD => true, + // ], + // ], + // ], + // ], [ 'class' => \Chill\PersonBundle\Entity\Person::class, 'name' => 'person', diff --git a/src/Bundle/ChillPersonBundle/config/routes.yaml b/src/Bundle/ChillPersonBundle/config/routes.yaml index 13d1c1227..c31f502fd 100644 --- a/src/Bundle/ChillPersonBundle/config/routes.yaml +++ b/src/Bundle/ChillPersonBundle/config/routes.yaml @@ -199,3 +199,7 @@ chill_person_social_result_admin: chill_person_controllers: resource: "@ChillPersonBundle/Controller" type: annotation + +social_work_social_issue: + path: "/api/1.0/person/social-work/social-issue.json" + controller: Chill\PersonBundle\Controller\SocialIssueApiController::indexAction \ No newline at end of file diff --git a/src/Bundle/ChillPersonBundle/config/services/controller.yaml b/src/Bundle/ChillPersonBundle/config/services/controller.yaml index f5ead52f7..228ec4d34 100644 --- a/src/Bundle/ChillPersonBundle/config/services/controller.yaml +++ b/src/Bundle/ChillPersonBundle/config/services/controller.yaml @@ -66,3 +66,7 @@ services: Chill\PersonBundle\Controller\RelationshipApiController: autowire: true tags: ['controller.service_arguments'] + + Chill\PersonBundle\Controller\SocialIssueApiController: + autowire: true + autoconfigure: true From 2c94811c8f0b1ff0bd248cb07ee4b7e0196700ed Mon Sep 17 00:00:00 2001 From: nobohan Date: Tue, 1 Feb 2022 17:01:19 +0100 Subject: [PATCH 02/10] person: social issue api controller: add onPostIndexBuildQuery --- .../ChillPersonBundle/Controller/SocialIssueApiController.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Bundle/ChillPersonBundle/Controller/SocialIssueApiController.php b/src/Bundle/ChillPersonBundle/Controller/SocialIssueApiController.php index fa2e7bb37..2b882627c 100644 --- a/src/Bundle/ChillPersonBundle/Controller/SocialIssueApiController.php +++ b/src/Bundle/ChillPersonBundle/Controller/SocialIssueApiController.php @@ -97,6 +97,9 @@ class SocialIssueApiController extends AbstractController ->setHint(Query::HINT_INCLUDE_META_COLUMNS, true) ->getResult(FlatHierarchyEntityHydrator::LIST); + $qb->addOrderBy('GET_JSON_FIELD_BY_KEY(si.title, :locale)', 'ASC') + ->setParameter(':locale', $request->getLocale()); + $socialIssues = $qb->getQuery()->getResult(); return new JsonResponse( From bb93cb23a74699d5dad9278c9fe3b9601ca8c5fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Fri, 11 Feb 2022 12:09:42 +0100 Subject: [PATCH 03/10] fix handling of address --- .../Resources/public/vuejs/OnTheFly/components/Create.vue | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Bundle/ChillMainBundle/Resources/public/vuejs/OnTheFly/components/Create.vue b/src/Bundle/ChillMainBundle/Resources/public/vuejs/OnTheFly/components/Create.vue index 24f69a9fe..35f7cd685 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/vuejs/OnTheFly/components/Create.vue +++ b/src/Bundle/ChillMainBundle/Resources/public/vuejs/OnTheFly/components/Create.vue @@ -74,11 +74,13 @@ export default { case 'thirdparty': let data = this.$refs.castThirdparty.$data.thirdparty; data.name = data.text; - if (data.address !== undefined) { + /* + if (data.address !== undefined && data.address !== null) { data.address = { id: data.address.address_id } } else { data.address = null; } + */ return data; default: From ce1d21308254c59ac7ca025039d2065faefd4a5e Mon Sep 17 00:00:00 2001 From: nobohan Date: Tue, 22 Feb 2022 12:36:04 +0100 Subject: [PATCH 04/10] [person] order social issues: remove custom controller and order only by 'ordering' --- .../Controller/SocialIssueApiController.php | 85 ++++--------------- .../ChillPersonExtension.php | 42 ++++----- .../ChillPersonBundle/config/routes.yaml | 4 - .../config/services/controller.yaml | 3 - 4 files changed, 36 insertions(+), 98 deletions(-) diff --git a/src/Bundle/ChillPersonBundle/Controller/SocialIssueApiController.php b/src/Bundle/ChillPersonBundle/Controller/SocialIssueApiController.php index 2b882627c..ed2b3122c 100644 --- a/src/Bundle/ChillPersonBundle/Controller/SocialIssueApiController.php +++ b/src/Bundle/ChillPersonBundle/Controller/SocialIssueApiController.php @@ -25,7 +25,7 @@ use Symfony\Component\HttpFoundation\Response; use Symfony\Component\Serializer\SerializerInterface; //class SocialIssueApiController extends ApiController -class SocialIssueApiController extends AbstractController +class SocialIssueApiController extends ApiController { private SerializerInterface $serializer; @@ -36,77 +36,22 @@ class SocialIssueApiController extends AbstractController $this->serializer = $serializer; } - // protected function customizeQuery(string $action, Request $request, $query): void - // { - // $query->where( - // $query->expr()->orX( - // $query->expr()->gt('e.desactivationDate', ':now'), - // $query->expr()->isNull('e.desactivationDate') - // ) - // ); - // $query->setParameter('now', new DateTimeImmutable()); - // } - - // protected function getQueryResult(string $action, Request $request, string $_format, int $totalItems, PaginatorInterface $paginator, $query) - // { - // // In order to work, this hydrator only works with - // // entities having the field "children" set up. - // return $query - // ->getQuery() - // ->setHint(Query::HINT_INCLUDE_META_COLUMNS, true) - // ->getResult(FlatHierarchyEntityHydrator::LIST); - // } - - // protected function onPostIndexBuildQuery(string $action, Request $request, string $_format, int $totalItems, PaginatorInterface $paginator, $query): ?Response - // { - // $query - // ->orderBy('GET_JSON_FIELD_BY_KEY(e.title, :locale)', 'ASC') - // ->setParameter(':locale', $request->getLocale()); - - // return null; - // } - - // protected function orderQuery(string $action, $query, Request $request, PaginatorInterface $paginator, $_format) - // { - // $query->addOrderBy('ordering', 'ASC'); - // return $query; - - // } - - /* - * @Route("/api/1.0/person/social-work/social-issue.json", name="social_work_social_issue") - */ - public function indexAction(Request $request): JsonResponse + protected function customizeQuery(string $action, Request $request, $query): void { - $this->denyAccessUnlessGranted('ROLE_USER'); - - $qb = $this->getDoctrine()->getManager()->createQueryBuilder(); - - $qb->select('si')->from(SocialIssue::class, 'si'); - - $qb->where( - $qb->expr()->orX( - $qb->expr()->gt('si.desactivationDate', ':now'), - $qb->expr()->isNull('si.desactivationDate') + $query->where( + $query->expr()->orX( + $query->expr()->gt('e.desactivationDate', ':now'), + $query->expr()->isNull('e.desactivationDate') ) ); - $qb->setParameter('now', new DateTimeImmutable()); - $qb->addOrderBy('si.ordering', 'ASC'); - - $qb->getQuery() - ->setHint(Query::HINT_INCLUDE_META_COLUMNS, true) - ->getResult(FlatHierarchyEntityHydrator::LIST); - - $qb->addOrderBy('GET_JSON_FIELD_BY_KEY(si.title, :locale)', 'ASC') - ->setParameter(':locale', $request->getLocale()); - - $socialIssues = $qb->getQuery()->getResult(); - - return new JsonResponse( - $this->serializer->serialize(['count' => count($socialIssues), 'results' => $socialIssues], 'json', ['groups' => ['read']]), - JsonResponse::HTTP_OK, - [], - true - ); + $query->setParameter('now', new DateTimeImmutable()); } + + protected function orderQuery(string $action, $query, Request $request, PaginatorInterface $paginator, $_format) + { + $query->addOrderBy('ordering', 'ASC'); + return $query; + + } + } diff --git a/src/Bundle/ChillPersonBundle/DependencyInjection/ChillPersonExtension.php b/src/Bundle/ChillPersonBundle/DependencyInjection/ChillPersonExtension.php index b785ad0ca..01df460e3 100644 --- a/src/Bundle/ChillPersonBundle/DependencyInjection/ChillPersonExtension.php +++ b/src/Bundle/ChillPersonBundle/DependencyInjection/ChillPersonExtension.php @@ -455,27 +455,27 @@ class ChillPersonExtension extends Extension implements PrependExtensionInterfac ], ], ], - // [ - // 'class' => \Chill\PersonBundle\Entity\SocialWork\SocialIssue::class, - // 'name' => 'social_work_social_issue', - // 'controller' => \Chill\PersonBundle\Controller\SocialIssueApiController::class, - // 'base_path' => '/api/1.0/person/social-work/social-issue', - // 'base_role' => 'ROLE_USER', - // 'actions' => [ - // '_index' => [ - // 'methods' => [ - // Request::METHOD_GET => true, - // Request::METHOD_HEAD => true, - // ], - // ], - // '_entity' => [ - // 'methods' => [ - // Request::METHOD_GET => true, - // Request::METHOD_HEAD => true, - // ], - // ], - // ], - // ], + [ + 'class' => \Chill\PersonBundle\Entity\SocialWork\SocialIssue::class, + 'name' => 'social_work_social_issue', + 'controller' => \Chill\PersonBundle\Controller\SocialIssueApiController::class, + 'base_path' => '/api/1.0/person/social-work/social-issue', + 'base_role' => 'ROLE_USER', + 'actions' => [ + '_index' => [ + 'methods' => [ + Request::METHOD_GET => true, + Request::METHOD_HEAD => true, + ], + ], + '_entity' => [ + 'methods' => [ + Request::METHOD_GET => true, + Request::METHOD_HEAD => true, + ], + ], + ], + ], [ 'class' => \Chill\PersonBundle\Entity\Person::class, 'name' => 'person', diff --git a/src/Bundle/ChillPersonBundle/config/routes.yaml b/src/Bundle/ChillPersonBundle/config/routes.yaml index c31f502fd..13d1c1227 100644 --- a/src/Bundle/ChillPersonBundle/config/routes.yaml +++ b/src/Bundle/ChillPersonBundle/config/routes.yaml @@ -199,7 +199,3 @@ chill_person_social_result_admin: chill_person_controllers: resource: "@ChillPersonBundle/Controller" type: annotation - -social_work_social_issue: - path: "/api/1.0/person/social-work/social-issue.json" - controller: Chill\PersonBundle\Controller\SocialIssueApiController::indexAction \ No newline at end of file diff --git a/src/Bundle/ChillPersonBundle/config/services/controller.yaml b/src/Bundle/ChillPersonBundle/config/services/controller.yaml index 228ec4d34..f8d1143a4 100644 --- a/src/Bundle/ChillPersonBundle/config/services/controller.yaml +++ b/src/Bundle/ChillPersonBundle/config/services/controller.yaml @@ -67,6 +67,3 @@ services: autowire: true tags: ['controller.service_arguments'] - Chill\PersonBundle\Controller\SocialIssueApiController: - autowire: true - autoconfigure: true From 88059884ec5899ae12f20153a6fc2587e731204a Mon Sep 17 00:00:00 2001 From: nobohan Date: Tue, 22 Feb 2022 12:40:46 +0100 Subject: [PATCH 05/10] fix unused imports --- .../Controller/SocialIssueApiController.php | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/src/Bundle/ChillPersonBundle/Controller/SocialIssueApiController.php b/src/Bundle/ChillPersonBundle/Controller/SocialIssueApiController.php index ed2b3122c..ef3ed0a96 100644 --- a/src/Bundle/ChillPersonBundle/Controller/SocialIssueApiController.php +++ b/src/Bundle/ChillPersonBundle/Controller/SocialIssueApiController.php @@ -12,30 +12,15 @@ declare(strict_types=1); namespace Chill\PersonBundle\Controller; use Chill\MainBundle\CRUD\Controller\ApiController; -use Chill\MainBundle\Doctrine\ORM\Hydration\FlatHierarchyEntityHydrator; use Chill\MainBundle\Pagination\PaginatorInterface; -use Chill\MainBundle\Serializer\Model\Collection; -use Chill\PersonBundle\Entity\SocialWork\SocialIssue; use DateTimeImmutable; -use Doctrine\ORM\Query; -use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; -use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpFoundation\Request; -use Symfony\Component\HttpFoundation\Response; -use Symfony\Component\Serializer\SerializerInterface; + //class SocialIssueApiController extends ApiController class SocialIssueApiController extends ApiController { - private SerializerInterface $serializer; - - public function __construct( - SerializerInterface $serializer - ) { - $this->serializer = $serializer; - } - protected function customizeQuery(string $action, Request $request, $query): void { $query->where( From 736ca2272b5c5a5642a4b3cddc90e9c1644384de Mon Sep 17 00:00:00 2001 From: nobohan Date: Tue, 22 Feb 2022 12:44:40 +0100 Subject: [PATCH 06/10] fix unused imports --- .../ChillPersonBundle/Controller/SocialIssueApiController.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/Bundle/ChillPersonBundle/Controller/SocialIssueApiController.php b/src/Bundle/ChillPersonBundle/Controller/SocialIssueApiController.php index ef3ed0a96..0b9c13bf1 100644 --- a/src/Bundle/ChillPersonBundle/Controller/SocialIssueApiController.php +++ b/src/Bundle/ChillPersonBundle/Controller/SocialIssueApiController.php @@ -16,8 +16,6 @@ use Chill\MainBundle\Pagination\PaginatorInterface; use DateTimeImmutable; use Symfony\Component\HttpFoundation\Request; - -//class SocialIssueApiController extends ApiController class SocialIssueApiController extends ApiController { From d4283a0b94eb829bdf50010451c34232e6cf4f07 Mon Sep 17 00:00:00 2001 From: nobohan Date: Tue, 22 Feb 2022 12:53:47 +0100 Subject: [PATCH 07/10] social issue api controller: correct orderBy query --- .../ChillPersonBundle/Controller/SocialIssueApiController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Bundle/ChillPersonBundle/Controller/SocialIssueApiController.php b/src/Bundle/ChillPersonBundle/Controller/SocialIssueApiController.php index 0b9c13bf1..b3c5998fd 100644 --- a/src/Bundle/ChillPersonBundle/Controller/SocialIssueApiController.php +++ b/src/Bundle/ChillPersonBundle/Controller/SocialIssueApiController.php @@ -32,7 +32,7 @@ class SocialIssueApiController extends ApiController protected function orderQuery(string $action, $query, Request $request, PaginatorInterface $paginator, $_format) { - $query->addOrderBy('ordering', 'ASC'); + $query->addOrderBy('e.ordering', 'ASC'); return $query; } From f0e6bfc6c669424ccb36a3d1d6801306fe9f8231 Mon Sep 17 00:00:00 2001 From: nobohan Date: Tue, 22 Feb 2022 12:57:16 +0100 Subject: [PATCH 08/10] update CHANGELOG --- CHANGELOG.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 48e2ad7dd..f369f792d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ and this project adheres to ## Unreleased +* [person] Order social issues by the field "ordering" (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/388) ## Test releases @@ -33,7 +34,7 @@ and this project adheres to * [Household]: Add end date in HouseholdMember form for 'enfant hors menage' (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/434) * [homepage_widget]: If no sender then display as 'notification automatique' (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/435) * [parcours]: Order social activities and only display most recent three in parcours resumé (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/481) -* [3party]: 3party: redirect to parent when contact (child) is opened in view page +* [3party]: 3party: redirect to parent when contact (child) is opened in view page * [parcours / addresses]: launch an event when a person change address (either through changing household or because the household is associated to a new address). If the person is localising a course, the course location go back to a temporarily address. * Creation of PickCivilityType, and implementation in PersonType and ThirdpartyType From f93282d657aa7f73548b4cb4e5b6d58266b1e779 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Mon, 28 Feb 2022 10:13:00 +0100 Subject: [PATCH 09/10] fix cs --- .../ChillPersonBundle/Controller/SocialIssueApiController.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/Bundle/ChillPersonBundle/Controller/SocialIssueApiController.php b/src/Bundle/ChillPersonBundle/Controller/SocialIssueApiController.php index b3c5998fd..fc11f7f52 100644 --- a/src/Bundle/ChillPersonBundle/Controller/SocialIssueApiController.php +++ b/src/Bundle/ChillPersonBundle/Controller/SocialIssueApiController.php @@ -18,7 +18,6 @@ use Symfony\Component\HttpFoundation\Request; class SocialIssueApiController extends ApiController { - protected function customizeQuery(string $action, Request $request, $query): void { $query->where( @@ -33,8 +32,7 @@ class SocialIssueApiController extends ApiController protected function orderQuery(string $action, $query, Request $request, PaginatorInterface $paginator, $_format) { $query->addOrderBy('e.ordering', 'ASC'); + return $query; - } - } From 8bf179934de6013e3b56d38e440f71a0ec6dee6d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Mon, 28 Feb 2022 11:37:03 +0100 Subject: [PATCH 10/10] update psalm to ignore new error (sorry) --- psalm-baseline.xml | 501 +-------------------------------------------- 1 file changed, 9 insertions(+), 492 deletions(-) diff --git a/psalm-baseline.xml b/psalm-baseline.xml index 33107d40b..392b3026a 100644 --- a/psalm-baseline.xml +++ b/psalm-baseline.xml @@ -1,5 +1,5 @@ - + 'ChillActivityBundle:ActivityReasonCategory' @@ -47,6 +47,11 @@ Activity[]|array + + + AppKernel + + require __DIR__ . '/../../../../../vendor/autoload.php' @@ -164,72 +169,18 @@ type - - - public function setUp() - - - - - public function setUp() - - - - - public function setUp() - - - - - public function setUp() - - - - - public function setUp() - - - - - public function setUp() - - - - - public function setUp() - - - - public function setUp() - \Chill\PersonBundle\Export\Filter\PersonHavingActivityBetweenDateFilter - - - public function setUp() - - - - public function setUp() - Prophecy\Prophet - - - public function setUp() - - - - public function setUp() - type @@ -254,11 +205,6 @@ $asideActivityCategory - - - public function setUp() - - $calculator::getAlias() @@ -288,11 +234,6 @@ 'ChillCalendarBundle:Calendar' - - - public function setUp() - - 'ChillCustomFieldsBundle:CustomFieldsGroup' @@ -397,10 +338,6 @@ - - public function setUp() - public function tearDown() - type type @@ -408,61 +345,6 @@ type - - - public function setUp() - - - - - public function setUp() - - - - - public function setUp() - - - - - public function setUp() - - - - - public function setUp() - - - - - public function setUp() - - - - - public function setUp() - - - - - protected function setUp() - - - - - protected function setUp() - - - - - protected function setUp() - - - - - 'ChillDocStoreBundle:AccompanyingCourseDocument' - - 'ChillDocStoreBundle:DocumentCategory' @@ -470,11 +352,6 @@ 'ChillDocStoreBundle:DocumentCategory' - - - 'ChillDocStoreBundle:PersonDocument' - - \Chill\PersonBundle\Entity\user @@ -570,9 +447,6 @@ type - - public function setUp() - 'ChillEventBundle:Event' 'ChillEventBundle:Event' @@ -588,10 +462,6 @@ - - public function setUp() - public function tearDown() - 'ChillMainBundle:Scope' @@ -891,11 +761,6 @@ OptionsResolverInterface - - - \Symfony\Component\Mailer\Exception\TransportExceptionInterface - - $current @@ -924,11 +789,6 @@ $onlyEnabled - - - AppKernel - - require __DIR__ . '/../../../../../vendor/autoload.php' @@ -1056,158 +916,15 @@ - - public function setUp() - type - - - public function setUp() - - - - - public function setUp() - - - - - protected function tearDown() - public function setUp() - - - - - public function setUp() - public function tearDown() - - - $this->prophet - $this->prophet - $this->prophet - $this->prophet - $this->prophet - $this->prophet - $this->prophet - $this->prophet - $this->prophet - $this->prophet - $this->prophet - $this->prophet - $this->prophet - $this->prophet - $this->prophet - $this->prophet - $this->prophet - $this->prophet - $this->prophet - $this->prophet - $this->prophet - $this->prophet - $this->prophet - $this->prophet - $this->prophet - $this->prophet - $this->prophet - $this->prophet - $this->prophet - $this->prophet - $this->prophet - $this->prophet - $this->prophet - $this->prophet - $this->prophet - $this->prophet - $this->prophet - $this->prophet - $this->prophet - Prophecy\Prophet - - - - - CenterType - - - CenterType - - - - - public function setUp() - - - - - public function setUp() - - - - - public function setUp() - - - - - public function setUp() - - - - public function setUp() - unknown - - - public function setUp() - - - - - public function setUp() - - - - - protected function setUp() - - - - - public function setUp() - - - - - public function setUp() - - - - - public function setUp() - - - - - protected function setUp() - - - - - public function setUp() - - - - - protected function setUp() - - unknown @@ -1412,20 +1129,6 @@ OptionsResolverInterface - - - $qb - $qb - $qb - QueryBuilder - SocialAction - SocialAction - - - $action - $orderBy - - AppKernel @@ -1505,33 +1208,13 @@ - - public function setUp() - public static function setUpBeforeClass() - AccompanyingPeriodRepository stdClass - - - public function setUp() - public static function setUpBeforeClass() - - - - - public function setUp() - - - - public function setUp() - public function tearDown() - public static function setUpBeforeClass() - 'ChillMainBundle:Center' 'ChillPersonBundle:AccompanyingPeriod\ClosingMotive' @@ -1543,40 +1226,19 @@ - - protected function tearDown() - User - - - protected function setUp() - - $this - - public function setUp() - public static function setUpBeforeClass() - 'ChillPersonBundle:Person' - - - public static function tearDownAfterClass() - - - - public function setUp() - public function tearDown() - 'ChillMainBundle:Country' 'ChillPersonBundle:Person' @@ -1586,140 +1248,25 @@ - - public function setUp() - public function tearDown() - 'ChillMainBundle:Country' 'ChillPersonBundle:Person' - - public function setUp() - public function tearDown() - 'ChillPersonBundle:Person' - - public function setUp() - public function tearDown() - 'ChillPersonBundle:Person' - - - public function setUp() - - - - - public function setUp() - - - - - public function setUp() - - $participationL - - getEndDate - - - - - public function setUp() - - - - - public function setUp() - - - - - public function setUp() - - - - - public function setUp() - - - - - public function setUp() - - - - - public function setUp() - - - - - public function setUp() - - - - - public function setUp() - - - - - public function setUp() - - - - - protected function setUp() - - - - - public function setUp() - - - - - protected function setUp() - - - - - protected function setUp() - - - - - protected function setUp() - - - - - protected function setUp() - - - - - protected function setUp() - - - - - protected function setUp() - @@ -1820,20 +1367,13 @@ require __DIR__ . '/../../../../../vendor/autoload.php' - - - public function setUp() - - type - - public function setUp() - public static function setUpBeforeClass() - - + + $client + $client $client $client $client @@ -1865,16 +1405,7 @@ type - - - Exception - - - - public function setUp() - public static function setUpBeforeClass() - type type @@ -1882,10 +1413,6 @@ - - public function setUp() - public function tearDown() - 'ChillCustomFieldsBundle:CustomFieldsGroup' @@ -1958,11 +1485,6 @@ CacheItempPoolInterface - - - protected function setUp() - - $taggedService->getClass()::getKey() @@ -1988,11 +1510,6 @@ $thirdParty - - - protected function setUp() - - $object