From 0f36b9349ba119858e3fa6f0e6e3396f721e2cf7 Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Mon, 8 Jan 2024 11:25:13 +0100 Subject: [PATCH 01/67] Improve naming for 'at date' in user render component --- src/Bundle/ChillMainBundle/Entity/User.php | 16 ++++++++-------- .../Resources/views/Entity/user.html.twig | 8 ++++---- .../Templating/Entity/UserRender.php | 10 +++++----- 3 files changed, 17 insertions(+), 17 deletions(-) diff --git a/src/Bundle/ChillMainBundle/Entity/User.php b/src/Bundle/ChillMainBundle/Entity/User.php index 23dfe6926..fc58abe82 100644 --- a/src/Bundle/ChillMainBundle/Entity/User.php +++ b/src/Bundle/ChillMainBundle/Entity/User.php @@ -272,13 +272,13 @@ class User implements UserInterface, \Stringable return $this->mainLocation; } - public function getMainScope(\DateTimeImmutable $at = null): ?Scope + public function getMainScope(\DateTime $atDate = null): ?Scope { - $at ??= new \DateTimeImmutable('now'); + $atDate ??= new \DateTimeImmutable('now'); foreach ($this->scopeHistories as $scopeHistory) { - if ($at >= $scopeHistory->getStartDate() && ( - null === $scopeHistory->getEndDate() || $at < $scopeHistory->getEndDate() + if ($atDate >= $scopeHistory->getStartDate() && ( + null === $scopeHistory->getEndDate() || $atDate < $scopeHistory->getEndDate() )) { return $scopeHistory->getScope(); } @@ -324,13 +324,13 @@ class User implements UserInterface, \Stringable return $this->salt; } - public function getUserJob(\DateTimeImmutable $at = null): ?UserJob + public function getUserJob(\DateTime $atDate = null): ?UserJob { - $at ??= new \DateTimeImmutable('now'); + $atDate ??= new \DateTimeImmutable('now'); foreach ($this->jobHistories as $jobHistory) { - if ($at >= $jobHistory->getStartDate() && ( - null === $jobHistory->getEndDate() || $at < $jobHistory->getEndDate() + if ($atDate >= $jobHistory->getStartDate() && ( + null === $jobHistory->getEndDate() || $atDate < $jobHistory->getEndDate() )) { return $jobHistory->getJob(); } diff --git a/src/Bundle/ChillMainBundle/Resources/views/Entity/user.html.twig b/src/Bundle/ChillMainBundle/Resources/views/Entity/user.html.twig index c95308610..84973a096 100644 --- a/src/Bundle/ChillMainBundle/Resources/views/Entity/user.html.twig +++ b/src/Bundle/ChillMainBundle/Resources/views/Entity/user.html.twig @@ -1,10 +1,10 @@ {{- user.label }} - {%- if opts['user_job'] and user.userJob(opts['at']) is not null %} - ({{ user.userJob(opts['at']).label|localize_translatable_string }}) + {%- if opts['user_job'] and user.userJob(opts['at_date']) is not null %} + ({{ user.userJob(opts['at_date']).label|localize_translatable_string }}) {%- endif -%} - {%- if opts['main_scope'] and user.mainScope(opts['at']) is not null %} - ({{ user.mainScope(opts['at']).name|localize_translatable_string }}) + {%- if opts['main_scope'] and user.mainScope(opts['at_date']) is not null %} + ({{ user.mainScope(opts['at_date']).name|localize_translatable_string }}) {%- endif -%} {%- if opts['absence'] and user.isAbsent %} {{ 'absence.A'|trans }} diff --git a/src/Bundle/ChillMainBundle/Templating/Entity/UserRender.php b/src/Bundle/ChillMainBundle/Templating/Entity/UserRender.php index 790996847..b0d944eb8 100644 --- a/src/Bundle/ChillMainBundle/Templating/Entity/UserRender.php +++ b/src/Bundle/ChillMainBundle/Templating/Entity/UserRender.php @@ -24,7 +24,7 @@ class UserRender implements ChillEntityRenderInterface 'main_scope' => true, 'user_job' => true, 'absence' => true, - 'at' => null, + 'at_date' => null, ]; public function __construct(private readonly TranslatableStringHelper $translatableStringHelper, private readonly \Twig\Environment $engine, private readonly TranslatorInterface $translator) {} @@ -45,14 +45,14 @@ class UserRender implements ChillEntityRenderInterface $str = $entity->getLabel(); - if (null !== $entity->getUserJob($opts['at']) && $opts['user_job']) { + if (null !== $entity->getUserJob($opts['at_date']) && $opts['user_job']) { $str .= ' ('.$this->translatableStringHelper - ->localize($entity->getUserJob($opts['at'])->getLabel()).')'; + ->localize($entity->getUserJob($opts['at_date'])->getLabel()).')'; } - if (null !== $entity->getMainScope($opts['at']) && $opts['main_scope']) { + if (null !== $entity->getMainScope($opts['at_date']) && $opts['main_scope']) { $str .= ' ('.$this->translatableStringHelper - ->localize($entity->getMainScope($opts['at'])->getName()).')'; + ->localize($entity->getMainScope($opts['at_date'])->getName()).')'; } if ($entity->isAbsent() && $opts['absence']) { From 6f358ee1a9e17e12443078777bcda3b2fe73a2fe Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Mon, 8 Jan 2024 11:25:33 +0100 Subject: [PATCH 02/67] Implement 'at date' in user render component for activities --- .../Resources/views/Activity/_list_item.html.twig | 2 +- .../Resources/views/Activity/list_recent.html.twig | 2 +- .../ChillActivityBundle/Resources/views/Activity/show.html.twig | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Bundle/ChillActivityBundle/Resources/views/Activity/_list_item.html.twig b/src/Bundle/ChillActivityBundle/Resources/views/Activity/_list_item.html.twig index b3382c3de..13dfa7461 100644 --- a/src/Bundle/ChillActivityBundle/Resources/views/Activity/_list_item.html.twig +++ b/src/Bundle/ChillActivityBundle/Resources/views/Activity/_list_item.html.twig @@ -68,7 +68,7 @@

{{ 'Referrer'|trans }}

- {{ activity.user|chill_entity_render_box }} + {{ activity.user|chill_entity_render_box({'at_date': activity.date}) }}

diff --git a/src/Bundle/ChillActivityBundle/Resources/views/Activity/list_recent.html.twig b/src/Bundle/ChillActivityBundle/Resources/views/Activity/list_recent.html.twig index aa0bbea0c..04ea936d4 100644 --- a/src/Bundle/ChillActivityBundle/Resources/views/Activity/list_recent.html.twig +++ b/src/Bundle/ChillActivityBundle/Resources/views/Activity/list_recent.html.twig @@ -41,7 +41,7 @@ {% if activity.user and t.userVisible %}
  • {{ 'Referrer'|trans ~ ': ' }} - {{ activity.user|chill_entity_render_box }} + {{ activity.user|chill_entity_render_box({'at_date': activity.date}) }}
  • {% endif %} diff --git a/src/Bundle/ChillActivityBundle/Resources/views/Activity/show.html.twig b/src/Bundle/ChillActivityBundle/Resources/views/Activity/show.html.twig index d4beb606a..0330377aa 100644 --- a/src/Bundle/ChillActivityBundle/Resources/views/Activity/show.html.twig +++ b/src/Bundle/ChillActivityBundle/Resources/views/Activity/show.html.twig @@ -37,7 +37,7 @@ {%- if entity.user is not null %}
    {{ 'Referrer'|trans|capitalize }}
    - {{ entity.user|chill_entity_render_box }} + {{ entity.user|chill_entity_render_box({'at_date': entity.date}) }}
    {% endif %} From 0c1a4a5f59ff3bfb9accd5bcbe8fb4b55ba0f813 Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Mon, 8 Jan 2024 12:35:09 +0100 Subject: [PATCH 03/67] Handle DateTime type for activity while DateTimeImmutable is expected --- src/Bundle/ChillMainBundle/Entity/User.php | 4 ++-- .../Templating/Entity/UserRender.php | 13 +++++++++---- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/src/Bundle/ChillMainBundle/Entity/User.php b/src/Bundle/ChillMainBundle/Entity/User.php index fc58abe82..58e0c042a 100644 --- a/src/Bundle/ChillMainBundle/Entity/User.php +++ b/src/Bundle/ChillMainBundle/Entity/User.php @@ -272,7 +272,7 @@ class User implements UserInterface, \Stringable return $this->mainLocation; } - public function getMainScope(\DateTime $atDate = null): ?Scope + public function getMainScope(\DateTimeImmutable $atDate = null): ?Scope { $atDate ??= new \DateTimeImmutable('now'); @@ -324,7 +324,7 @@ class User implements UserInterface, \Stringable return $this->salt; } - public function getUserJob(\DateTime $atDate = null): ?UserJob + public function getUserJob(\DateTimeImmutable $atDate = null): ?UserJob { $atDate ??= new \DateTimeImmutable('now'); diff --git a/src/Bundle/ChillMainBundle/Templating/Entity/UserRender.php b/src/Bundle/ChillMainBundle/Templating/Entity/UserRender.php index b0d944eb8..ca5436efd 100644 --- a/src/Bundle/ChillMainBundle/Templating/Entity/UserRender.php +++ b/src/Bundle/ChillMainBundle/Templating/Entity/UserRender.php @@ -13,6 +13,7 @@ namespace Chill\MainBundle\Templating\Entity; use Chill\MainBundle\Entity\User; use Chill\MainBundle\Templating\TranslatableStringHelper; +use Monolog\DateTimeImmutable; use Symfony\Contracts\Translation\TranslatorInterface; /** @@ -33,6 +34,8 @@ class UserRender implements ChillEntityRenderInterface { $opts = \array_merge(self::DEFAULT_OPTIONS, $options); + $opts['at_date'] = $opts['at_date'] instanceOf \DateTime ? DateTimeImmutable::createFromMutable($opts['at_date']) : $opts['at_date']; + return $this->engine->render('@ChillMain/Entity/user.html.twig', [ 'user' => $entity, 'opts' => $opts, @@ -43,16 +46,18 @@ class UserRender implements ChillEntityRenderInterface { $opts = \array_merge(self::DEFAULT_OPTIONS, $options); + $immutableAtDate = $opts['at_date'] instanceOf \DateTime ? DateTimeImmutable::createFromMutable($opts['at_date']) : $opts['at_date']; + $str = $entity->getLabel(); - if (null !== $entity->getUserJob($opts['at_date']) && $opts['user_job']) { + if (null !== $entity->getUserJob($immutableAtDate) && $opts['user_job']) { $str .= ' ('.$this->translatableStringHelper - ->localize($entity->getUserJob($opts['at_date'])->getLabel()).')'; + ->localize($entity->getUserJob($immutableAtDate)->getLabel()).')'; } - if (null !== $entity->getMainScope($opts['at_date']) && $opts['main_scope']) { + if (null !== $entity->getMainScope($immutableAtDate) && $opts['main_scope']) { $str .= ' ('.$this->translatableStringHelper - ->localize($entity->getMainScope($opts['at_date'])->getName()).')'; + ->localize($entity->getMainScope($immutableAtDate)->getName()).')'; } if ($entity->isAbsent() && $opts['absence']) { From 39a863448cae01aeb5a08f79e6657d8ff5618924 Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Mon, 8 Jan 2024 12:35:41 +0100 Subject: [PATCH 04/67] Implement 'at date' for display of service and user job in calendar entities --- .../Resources/views/Calendar/_list.html.twig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Bundle/ChillCalendarBundle/Resources/views/Calendar/_list.html.twig b/src/Bundle/ChillCalendarBundle/Resources/views/Calendar/_list.html.twig index 9e87af8ef..264836ecb 100644 --- a/src/Bundle/ChillCalendarBundle/Resources/views/Calendar/_list.html.twig +++ b/src/Bundle/ChillCalendarBundle/Resources/views/Calendar/_list.html.twig @@ -55,7 +55,7 @@
      {% if calendar.mainUser is not empty %} - {{ calendar.mainUser|chill_entity_render_box }} + {{ calendar.mainUser|chill_entity_render_box({'at_date': calendar.startDate}) }} {% endif %}
    From 1b1f355123c8a7908ec7f6db4f96d142cccc3f8b Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Mon, 8 Jan 2024 16:37:25 +0100 Subject: [PATCH 05/67] Implement 'at date' for display of service and user job in aside activities entities --- .../src/Resources/views/asideActivity/index.html.twig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Bundle/ChillAsideActivityBundle/src/Resources/views/asideActivity/index.html.twig b/src/Bundle/ChillAsideActivityBundle/src/Resources/views/asideActivity/index.html.twig index 1e2711bfe..0a8648749 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/Resources/views/asideActivity/index.html.twig +++ b/src/Bundle/ChillAsideActivityBundle/src/Resources/views/asideActivity/index.html.twig @@ -49,13 +49,13 @@
  • {{ 'By'|trans }}: - {{ entity.createdBy|chill_entity_render_box }} + {{ entity.createdBy|chill_entity_render_box({'at_date': entity.date}) }}
  • {{ 'For'|trans }}: - {{ entity.agent|chill_entity_render_box }} + {{ entity.agent|chill_entity_render_box({'at_date': entity.date}) }}
  • From 192b161e785963af2403c221d6af02b88ac92869 Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Mon, 8 Jan 2024 16:38:07 +0100 Subject: [PATCH 06/67] Implement 'at date' for display of service and user job in accompanying period work entities (for twig templates) -> vue component still to fix --- .../Entity/AccompanyingPeriod/AccompanyingPeriodWork.php | 2 +- .../Resources/views/AccompanyingCourseWork/_item.html.twig | 4 ++-- .../list_recent_by_accompanying_period.html.twig | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/AccompanyingPeriodWork.php b/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/AccompanyingPeriodWork.php index a35dc3abf..a0c9b91ae 100644 --- a/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/AccompanyingPeriodWork.php +++ b/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/AccompanyingPeriodWork.php @@ -394,7 +394,7 @@ class AccompanyingPeriodWork implements AccompanyingPeriodLinkedWithSocialIssues { $users = $this->referrersHistory ->filter(fn (AccompanyingPeriodWorkReferrerHistory $h) => null === $h->getEndDate()) - ->map(fn (AccompanyingPeriodWorkReferrerHistory $h) => $h->getUser()) + ->map(fn (AccompanyingPeriodWorkReferrerHistory $h) => ['user' => $h->getUser(), 'startDate' => $h->getStartDate()]) ->getValues() ; diff --git a/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/_item.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/_item.html.twig index b53898602..ad3c17783 100644 --- a/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/_item.html.twig +++ b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/_item.html.twig @@ -83,9 +83,9 @@
    {%- if w.referrers|length > 0 -%} - {% for u in w.referrers %} + {% for rh in w.referrers %} - {{ u|chill_entity_render_box }} + {{ rh.user|chill_entity_render_box({'at_date': rh.startDate}) }} {% if not loop.last %}, {% endif %} {% endfor %} diff --git a/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/list_recent_by_accompanying_period.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/list_recent_by_accompanying_period.html.twig index 7ee296cc7..9772641f7 100644 --- a/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/list_recent_by_accompanying_period.html.twig +++ b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/list_recent_by_accompanying_period.html.twig @@ -33,8 +33,8 @@ {% if w.referrers %}
  • {{ 'Referrers'|trans ~ ' : ' }} - {% for u in w.referrers %} - {{ u|chill_entity_render_box }} + {% for rh in w.referrers %} + {{ rh.user|chill_entity_render_box({'at_date': rh.startDate}) }} {% endfor %} {% if w.referrers|length == 0 %} {{ 'Not given'|trans }} From 499009ac43820e24564a0dc5bacc096a373e1260 Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Mon, 8 Jan 2024 16:38:50 +0100 Subject: [PATCH 07/67] Adjust view template for aside activity --- .../src/Resources/views/asideActivity/view.html.twig | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Bundle/ChillAsideActivityBundle/src/Resources/views/asideActivity/view.html.twig b/src/Bundle/ChillAsideActivityBundle/src/Resources/views/asideActivity/view.html.twig index 8fb487d31..4ef237336 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/Resources/views/asideActivity/view.html.twig +++ b/src/Bundle/ChillAsideActivityBundle/src/Resources/views/asideActivity/view.html.twig @@ -18,11 +18,11 @@
    {{ entity.type|chill_entity_render_box }}
    {{ 'Created by'|trans }}
    -
    {{ entity.createdBy }}
    +
    {{ entity.createdBy|chill_entity_render_box({'at_date': entity.date}) }}
    {{ 'Created for'|trans }}
    -
    {{ entity.agent }}
    - +
    {{ entity.agent|chill_entity_render_box({'at_date': entity.date}) }}
    +
    {{ 'Asideactivity location'|trans }}
    {%- if entity.location.name is defined -%}
    {{ entity.location.name }}
    From 653ac1d62b7d54b9aad07ea5e707659fbd498d44 Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Mon, 8 Jan 2024 16:51:06 +0100 Subject: [PATCH 08/67] Implement 'at date' for concerned groups in activity --- .../Resources/views/Activity/concernedGroups.html.twig | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/Bundle/ChillActivityBundle/Resources/views/Activity/concernedGroups.html.twig b/src/Bundle/ChillActivityBundle/Resources/views/Activity/concernedGroups.html.twig index 48eb839d7..76db92d42 100644 --- a/src/Bundle/ChillActivityBundle/Resources/views/Activity/concernedGroups.html.twig +++ b/src/Bundle/ChillActivityBundle/Resources/views/Activity/concernedGroups.html.twig @@ -87,7 +87,8 @@
  • {% if bloc.type == 'user' %} - {{ item|chill_entity_render_box({'render': 'raw', 'addAltNames': false }) }} + hello + {{ item|chill_entity_render_box({'render': 'raw', 'addAltNames': false, 'at_date': entity.date }) }} {% else %} {{ _self.insert_onthefly(bloc.type, item) }} @@ -114,7 +115,7 @@
  • {% if bloc.type == 'user' %} - {{ item|chill_entity_render_box({'render': 'raw', 'addAltNames': false }) }} + {{ item|chill_entity_render_box({'render': 'raw', 'addAltNames': false, 'at_date': entity.date }) }} {% else %} {{ _self.insert_onthefly(bloc.type, item) }} @@ -142,7 +143,7 @@ {% if bloc.type == 'user' %} - {{ item|chill_entity_render_box({'render': 'raw', 'addAltNames': false }) }} + {{ item|chill_entity_render_box({'render': 'raw', 'addAltNames': false, 'at_date': entity.date }) }} {%- if context == 'calendar_accompanyingCourse' or context == 'calendar_person' %} {% set invite = entity.inviteForUser(item) %} {% if invite is not null %} From 8ed5a023e82b812df2495cd2d29e3ed750d486a1 Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Wed, 17 Jan 2024 17:27:54 +0100 Subject: [PATCH 09/67] remove attempt to adjust accompanyingperiod work for display of user job and service at specific date --- .../Entity/AccompanyingPeriod/AccompanyingPeriodWork.php | 5 ++--- .../Resources/views/AccompanyingCourseWork/_item.html.twig | 4 ++-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/AccompanyingPeriodWork.php b/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/AccompanyingPeriodWork.php index a0c9b91ae..cf1922644 100644 --- a/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/AccompanyingPeriodWork.php +++ b/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/AccompanyingPeriodWork.php @@ -394,9 +394,8 @@ class AccompanyingPeriodWork implements AccompanyingPeriodLinkedWithSocialIssues { $users = $this->referrersHistory ->filter(fn (AccompanyingPeriodWorkReferrerHistory $h) => null === $h->getEndDate()) - ->map(fn (AccompanyingPeriodWorkReferrerHistory $h) => ['user' => $h->getUser(), 'startDate' => $h->getStartDate()]) - ->getValues() - ; + ->map(fn (AccompanyingPeriodWorkReferrerHistory $h) => $h->getUser()) + ->getValues(); return new ArrayCollection(array_values($users)); } diff --git a/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/_item.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/_item.html.twig index ad3c17783..e8f6f1171 100644 --- a/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/_item.html.twig +++ b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/_item.html.twig @@ -83,9 +83,9 @@
  • {%- if w.referrers|length > 0 -%} - {% for rh in w.referrers %} + {% for r in w.referrers %} - {{ rh.user|chill_entity_render_box({'at_date': rh.startDate}) }} + {{ r|chill_entity_render_box }} {% if not loop.last %}, {% endif %} {% endfor %} From a4482ad28b2b7453ad6abf378623915b4249e902 Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Tue, 23 Jan 2024 18:13:33 +0100 Subject: [PATCH 10/67] work on userRender test --- .../Templating/Entity/UserRenderTest.php | 65 +++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 src/Bundle/ChillMainBundle/Tests/Templating/Entity/UserRenderTest.php diff --git a/src/Bundle/ChillMainBundle/Tests/Templating/Entity/UserRenderTest.php b/src/Bundle/ChillMainBundle/Tests/Templating/Entity/UserRenderTest.php new file mode 100644 index 000000000..fe0ad7e04 --- /dev/null +++ b/src/Bundle/ChillMainBundle/Tests/Templating/Entity/UserRenderTest.php @@ -0,0 +1,65 @@ +setLabel(['fr' => 'assistant social']); + $scope->setName(['fr' => 'service A']); + $user->setLabel('BOB ISLA'); + $user->setUserJob($userJob); + $user->setMainScope($scope); + + // Change the user job + $userJobTwo = new UserJob(); + $userJobTwo->setLabel(['fr' => 'directrice']); + /* this automatically creates a UserJobHistory. How to set the date manually though? **/ + + // Change the scope + $scopeTwo = new Scope(); + $scopeTwo->setName(['fr' => 'service B']); + /* this automatically creates a UserScopeHistory. How to set the date manually though? **/ + + + // Create renderer + $translatableStringHelper = $this->createMock(TranslatableStringHelperInterface::class); + $engine = $this->createMock(Environment::class); + $translator = $this->createMock(TranslatorInterface::class); + $renderer = new UserRender($translatableStringHelper, $engine, $translator); + + + $options['at_date'] = new \DateTime('2023-11-30 12:00:00'); + $optionsTwo['at_date'] = new \DateTime('2024-01-30 12:00:00'); + + // Check that the user render for the first activity corresponds with the first user job + $expectedStringA = 'BOB ISLA (assistant social) (service A)'; + $this->assertEquals($expectedStringA, $renderer->renderString($user, $options)); + + // Check that the user render for the second activity corresponds with the second user job + $expectedStringB = 'BOB ISLA (directrice) (service B)'; + $this->assertEquals($expectedStringB, $renderer->renderString($user, $optionsTwo)); + + + } + +} From 33187448a0bbcb7679dbe7fc391b02f98a92e89b Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Wed, 24 Jan 2024 19:30:09 +0100 Subject: [PATCH 11/67] update normalizers to take into account referrerHistory logic for accompanying period work --- .../Serializer/Normalizer/UserNormalizer.php | 11 ++-- .../Templating/Entity/UserRender.php | 25 +++++++-- .../AccompanyingPeriodWork.php | 7 ++- ...st_recent_by_accompanying_period.html.twig | 2 +- .../AccompanyingPeriodWorkNormalizer.php | 53 ++++++++++++------- 5 files changed, 69 insertions(+), 29 deletions(-) diff --git a/src/Bundle/ChillMainBundle/Serializer/Normalizer/UserNormalizer.php b/src/Bundle/ChillMainBundle/Serializer/Normalizer/UserNormalizer.php index 55a887001..2e1441614 100644 --- a/src/Bundle/ChillMainBundle/Serializer/Normalizer/UserNormalizer.php +++ b/src/Bundle/ChillMainBundle/Serializer/Normalizer/UserNormalizer.php @@ -19,6 +19,7 @@ use Chill\MainBundle\Entity\User; use Chill\MainBundle\Entity\UserJob; use Chill\MainBundle\Templating\Entity\UserRender; use libphonenumber\PhoneNumber; +use Symfony\Component\Clock\ClockInterface; use Symfony\Component\Serializer\Normalizer\ContextAwareNormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; @@ -27,6 +28,8 @@ class UserNormalizer implements ContextAwareNormalizerInterface, NormalizerAware { use NormalizerAwareTrait; + final public const AT_DATE = 'chill:user:at_date'; + final public const NULL_USER = [ 'type' => 'user', 'id' => '', @@ -38,7 +41,7 @@ class UserNormalizer implements ContextAwareNormalizerInterface, NormalizerAware 'isAbsent' => false, ]; - public function __construct(private readonly UserRender $userRender) {} + public function __construct(private readonly UserRender $userRender, private readonly ClockInterface $clock) {} public function normalize($object, $format = null, array $context = []) { @@ -72,6 +75,8 @@ class UserNormalizer implements ContextAwareNormalizerInterface, NormalizerAware return [...self::NULL_USER, 'phonenumber' => $this->normalizer->normalize(null, $format, $phonenumberContext), 'civility' => $this->normalizer->normalize(null, $format, $civilityContext), 'user_job' => $this->normalizer->normalize(null, $format, $userJobContext), 'main_center' => $this->normalizer->normalize(null, $format, $centerContext), 'main_scope' => $this->normalizer->normalize(null, $format, $scopeContext), 'current_location' => $this->normalizer->normalize(null, $format, $locationContext), 'main_location' => $this->normalizer->normalize(null, $format, $locationContext)]; } + $at = $context[self::AT_DATE] ?? $this->clock->now(); + $data = [ 'type' => 'user', 'id' => $object->getId(), @@ -81,9 +86,9 @@ class UserNormalizer implements ContextAwareNormalizerInterface, NormalizerAware 'label' => $object->getLabel(), 'email' => (string) $object->getEmail(), 'phonenumber' => $this->normalizer->normalize($object->getPhonenumber(), $format, $phonenumberContext), - 'user_job' => $this->normalizer->normalize($object->getUserJob(), $format, $userJobContext), + 'user_job' => $this->normalizer->normalize($object->getUserJob($at), $format, $userJobContext), 'main_center' => $this->normalizer->normalize($object->getMainCenter(), $format, $centerContext), - 'main_scope' => $this->normalizer->normalize($object->getMainScope(), $format, $scopeContext), + 'main_scope' => $this->normalizer->normalize($object->getMainScope($at), $format, $scopeContext), 'isAbsent' => $object->isAbsent(), ]; diff --git a/src/Bundle/ChillMainBundle/Templating/Entity/UserRender.php b/src/Bundle/ChillMainBundle/Templating/Entity/UserRender.php index ca5436efd..45aad79ee 100644 --- a/src/Bundle/ChillMainBundle/Templating/Entity/UserRender.php +++ b/src/Bundle/ChillMainBundle/Templating/Entity/UserRender.php @@ -14,6 +14,7 @@ namespace Chill\MainBundle\Templating\Entity; use Chill\MainBundle\Entity\User; use Chill\MainBundle\Templating\TranslatableStringHelper; use Monolog\DateTimeImmutable; +use Symfony\Component\Clock\ClockInterface; use Symfony\Contracts\Translation\TranslatorInterface; /** @@ -25,16 +26,29 @@ class UserRender implements ChillEntityRenderInterface 'main_scope' => true, 'user_job' => true, 'absence' => true, - 'at_date' => null, + 'at_date' => null, // instanceof DateTimeInterface ]; - public function __construct(private readonly TranslatableStringHelper $translatableStringHelper, private readonly \Twig\Environment $engine, private readonly TranslatorInterface $translator) {} + public function __construct( + private readonly TranslatableStringHelper $translatableStringHelper, + private readonly \Twig\Environment $engine, private readonly TranslatorInterface $translator, + private readonly ClockInterface $clock, + ) {} + /** + * @param $entity + * @param array{main_scope?: bool, user_job?: bool, absence?: bool, at_date?: null|DateTimeImmutable|DateTimeMutable} $options + * @return string + */ public function renderBox($entity, array $options): string { $opts = \array_merge(self::DEFAULT_OPTIONS, $options); - $opts['at_date'] = $opts['at_date'] instanceOf \DateTime ? DateTimeImmutable::createFromMutable($opts['at_date']) : $opts['at_date']; + if (null === $opts['at_date']) { + $opts['at_date'] = $this->clock->now(); + } elseif ($opts['at_date'] instanceof \DateTime) { + $opts['at_date'] = DateTimeImmutable::createFromMutable($opts['at_date']); + } return $this->engine->render('@ChillMain/Entity/user.html.twig', [ 'user' => $entity, @@ -42,6 +56,11 @@ class UserRender implements ChillEntityRenderInterface ]); } + /** + * @param $entity + * @param array{main_scope?: bool, user_job?: bool, absence?: bool, at_date?: null|DateTimeImmutable|DateTimeMutable} $options + * @return string + */ public function renderString($entity, array $options): string { $opts = \array_merge(self::DEFAULT_OPTIONS, $options); diff --git a/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/AccompanyingPeriodWork.php b/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/AccompanyingPeriodWork.php index cf1922644..e69bd4f36 100644 --- a/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/AccompanyingPeriodWork.php +++ b/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/AccompanyingPeriodWork.php @@ -385,10 +385,6 @@ class AccompanyingPeriodWork implements AccompanyingPeriodLinkedWithSocialIssues /** * @return ReadableCollection - * - * @Serializer\Groups({"read", "docgen:read", "read:accompanyingPeriodWork:light"}) - * @Serializer\Groups({"accompanying_period_work:edit"}) - * @Serializer\Groups({"accompanying_period_work:create"}) */ public function getReferrers(): ReadableCollection { @@ -400,6 +396,9 @@ class AccompanyingPeriodWork implements AccompanyingPeriodLinkedWithSocialIssues return new ArrayCollection(array_values($users)); } + /** + * @return Collection + */ public function getReferrersHistory(): Collection { return $this->referrersHistory; diff --git a/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/list_recent_by_accompanying_period.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/list_recent_by_accompanying_period.html.twig index 9772641f7..21552e44c 100644 --- a/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/list_recent_by_accompanying_period.html.twig +++ b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/list_recent_by_accompanying_period.html.twig @@ -34,7 +34,7 @@
  • {{ 'Referrers'|trans ~ ' : ' }} {% for rh in w.referrers %} - {{ rh.user|chill_entity_render_box({'at_date': rh.startDate}) }} + {{ rh|chill_entity_render_box }} {% endfor %} {% if w.referrers|length == 0 %} {{ 'Not given'|trans }} diff --git a/src/Bundle/ChillPersonBundle/Serializer/Normalizer/AccompanyingPeriodWorkNormalizer.php b/src/Bundle/ChillPersonBundle/Serializer/Normalizer/AccompanyingPeriodWorkNormalizer.php index 3f0cd738e..81830cabd 100644 --- a/src/Bundle/ChillPersonBundle/Serializer/Normalizer/AccompanyingPeriodWorkNormalizer.php +++ b/src/Bundle/ChillPersonBundle/Serializer/Normalizer/AccompanyingPeriodWorkNormalizer.php @@ -12,6 +12,7 @@ declare(strict_types=1); namespace Chill\PersonBundle\Serializer\Normalizer; use Chill\MainBundle\Repository\Workflow\EntityWorkflowRepository; +use Chill\MainBundle\Serializer\Normalizer\UserNormalizer; use Chill\MainBundle\Workflow\Helper\MetadataExtractor; use Chill\PersonBundle\Entity\AccompanyingPeriod\AccompanyingPeriodWork; use Chill\PersonBundle\Entity\AccompanyingPeriod\AccompanyingPeriodWorkEvaluation; @@ -51,35 +52,51 @@ class AccompanyingPeriodWorkNormalizer implements ContextAwareNormalizerInterfac $context ); - // then, we add normalization for things which are not into the entity + // add the referrers + $initial['referrers'] = []; - $initial['workflows_availables'] = $this->metadataExtractor->availableWorkflowFor( - AccompanyingPeriodWork::class, - $object->getId() - ); + if ($object instanceof AccompanyingPeriodWork) { + foreach ($object->getReferrersHistory() as $referrerHistory) { + if (null !== $referrerHistory->getEndDate()) { + continue; + } - $initial['workflows_availables_evaluation'] = $this->metadataExtractor->availableWorkflowFor( - AccompanyingPeriodWorkEvaluation::class - ); + $initial['referrers'][] = $this->normalizer->normalize($referrerHistory->getUser(), + $format, [...$context, UserNormalizer::AT_DATE => $referrerHistory->getStartDate()]); + } + } - $initial['workflows_availables_evaluation_documents'] = $this->metadataExtractor->availableWorkflowFor( - AccompanyingPeriodWorkEvaluationDocument::class - ); + if ($format === 'json') { - $workflows = $this->entityWorkflowRepository->findBy([ - 'relatedEntityClass' => AccompanyingPeriodWork::class, - 'relatedEntityId' => $object->getId(), - ]); + // then, we add normalization for things which are not into the entity + $initial['workflows_availables'] = $this->metadataExtractor->availableWorkflowFor( + AccompanyingPeriodWork::class, + $object->getId() + ); - $initial['workflows'] = $this->normalizer->normalize($workflows, 'json', $context); + $initial['workflows_availables_evaluation'] = $this->metadataExtractor->availableWorkflowFor( + AccompanyingPeriodWorkEvaluation::class + ); + + $initial['workflows_availables_evaluation_documents'] = $this->metadataExtractor->availableWorkflowFor( + AccompanyingPeriodWorkEvaluationDocument::class + ); + + $workflows = $this->entityWorkflowRepository->findBy([ + 'relatedEntityClass' => AccompanyingPeriodWork::class, + 'relatedEntityId' => $object->getId(), + ]); + + $initial['workflows'] = $this->normalizer->normalize($workflows, 'json', $context); + } return $initial; } public function supportsNormalization($data, string $format = null, array $context = []): bool { - return 'json' === $format - && $data instanceof AccompanyingPeriodWork + return ('json' === $format || 'docgen' === $format) + && ($data instanceof AccompanyingPeriodWork || ('docgen' === $format && $data === null && ($context['docgen:expects'] ?? null) === AccompanyingPeriodWork::class)) && !\array_key_exists(self::IGNORE_WORK, $context); } } From aa2a398f9e1bfe782692b4f11d837a3582f38ce9 Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Wed, 24 Jan 2024 19:31:04 +0100 Subject: [PATCH 12/67] work on test logic --- .../Tests/Templating/Entity/UserRenderTest.php | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/Bundle/ChillMainBundle/Tests/Templating/Entity/UserRenderTest.php b/src/Bundle/ChillMainBundle/Tests/Templating/Entity/UserRenderTest.php index fe0ad7e04..c7bbca342 100644 --- a/src/Bundle/ChillMainBundle/Tests/Templating/Entity/UserRenderTest.php +++ b/src/Bundle/ChillMainBundle/Tests/Templating/Entity/UserRenderTest.php @@ -27,7 +27,12 @@ class UserRenderTest extends TestCase $userJob->setLabel(['fr' => 'assistant social']); $scope->setName(['fr' => 'service A']); $user->setLabel('BOB ISLA'); - $user->setUserJob($userJob); + $userJobHistory = (new User\UserJobHistory()) + ->setUser($user) + ->setJob($userJob) + //setStartDate + ; + $user->getUserJobHistories()->add($userJobHistory); $user->setMainScope($scope); // Change the user job @@ -45,8 +50,8 @@ class UserRenderTest extends TestCase $translatableStringHelper = $this->createMock(TranslatableStringHelperInterface::class); $engine = $this->createMock(Environment::class); $translator = $this->createMock(TranslatorInterface::class); - $renderer = new UserRender($translatableStringHelper, $engine, $translator); - + $clock = new MockClock(new \DateTimeImmutable('2023-12-15')); + $renderer = new UserRender($translatableStringHelper, $engine, $translator, $clock); $options['at_date'] = new \DateTime('2023-11-30 12:00:00'); $optionsTwo['at_date'] = new \DateTime('2024-01-30 12:00:00'); From 0e3de2ec8af575d71572eab0d1e2626ffb56508c Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Mon, 29 Jan 2024 15:07:27 +0100 Subject: [PATCH 13/67] work on user render test --- .../Tests/Templating/Entity/UserRenderTest.php | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/Bundle/ChillMainBundle/Tests/Templating/Entity/UserRenderTest.php b/src/Bundle/ChillMainBundle/Tests/Templating/Entity/UserRenderTest.php index c7bbca342..21f73d466 100644 --- a/src/Bundle/ChillMainBundle/Tests/Templating/Entity/UserRenderTest.php +++ b/src/Bundle/ChillMainBundle/Tests/Templating/Entity/UserRenderTest.php @@ -16,6 +16,10 @@ use Twig\Environment; class UserRenderTest extends TestCase { + /** + * @throws \DateInvalidTimeZoneException + * @throws \DateMalformedStringException + */ public function renderUserWithJobAndScopeAtCertainDateTest(): void { // Create a user with a certain user job @@ -27,23 +31,27 @@ class UserRenderTest extends TestCase $userJob->setLabel(['fr' => 'assistant social']); $scope->setName(['fr' => 'service A']); $user->setLabel('BOB ISLA'); + $userJobHistory = (new User\UserJobHistory()) ->setUser($user) ->setJob($userJob) //setStartDate ; + + $userScopeHistory = (new User\UserScopeHistory()) + ->setUser($user) + ->setScope($scope) + ; $user->getUserJobHistories()->add($userJobHistory); $user->setMainScope($scope); - // Change the user job +/* // Change the user job $userJobTwo = new UserJob(); $userJobTwo->setLabel(['fr' => 'directrice']); - /* this automatically creates a UserJobHistory. How to set the date manually though? **/ // Change the scope $scopeTwo = new Scope(); - $scopeTwo->setName(['fr' => 'service B']); - /* this automatically creates a UserScopeHistory. How to set the date manually though? **/ + $scopeTwo->setName(['fr' => 'service B']);*/ // Create renderer From bd62202d227c85df5f0114f5dbce03c612f3257d Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Tue, 30 Jan 2024 16:31:29 +0100 Subject: [PATCH 14/67] Implement clockInterface in renderString method --- .../Templating/Entity/UserRender.php | 27 ++++++++++++++----- 1 file changed, 20 insertions(+), 7 deletions(-) diff --git a/src/Bundle/ChillMainBundle/Templating/Entity/UserRender.php b/src/Bundle/ChillMainBundle/Templating/Entity/UserRender.php index 45aad79ee..77b4255cc 100644 --- a/src/Bundle/ChillMainBundle/Templating/Entity/UserRender.php +++ b/src/Bundle/ChillMainBundle/Templating/Entity/UserRender.php @@ -13,9 +13,13 @@ namespace Chill\MainBundle\Templating\Entity; use Chill\MainBundle\Entity\User; use Chill\MainBundle\Templating\TranslatableStringHelper; +use DateTime; use Monolog\DateTimeImmutable; use Symfony\Component\Clock\ClockInterface; use Symfony\Contracts\Translation\TranslatorInterface; +use Twig\Error\LoaderError; +use Twig\Error\RuntimeError; +use Twig\Error\SyntaxError; /** * @implements ChillEntityRenderInterface @@ -37,8 +41,11 @@ class UserRender implements ChillEntityRenderInterface /** * @param $entity - * @param array{main_scope?: bool, user_job?: bool, absence?: bool, at_date?: null|DateTimeImmutable|DateTimeMutable} $options + * @param array{main_scope?: bool, user_job?: bool, absence?: bool, at_date?: null|DateTimeImmutable|DateTime} $options * @return string + * @throws LoaderError + * @throws RuntimeError + * @throws SyntaxError */ public function renderBox($entity, array $options): string { @@ -46,7 +53,7 @@ class UserRender implements ChillEntityRenderInterface if (null === $opts['at_date']) { $opts['at_date'] = $this->clock->now(); - } elseif ($opts['at_date'] instanceof \DateTime) { + } elseif ($opts['at_date'] instanceof DateTime) { $opts['at_date'] = DateTimeImmutable::createFromMutable($opts['at_date']); } @@ -65,18 +72,24 @@ class UserRender implements ChillEntityRenderInterface { $opts = \array_merge(self::DEFAULT_OPTIONS, $options); - $immutableAtDate = $opts['at_date'] instanceOf \DateTime ? DateTimeImmutable::createFromMutable($opts['at_date']) : $opts['at_date']; +// $immutableAtDate = $opts['at_date'] instanceOf DateTime ? DateTimeImmutable::createFromMutable($opts['at_date']) : $opts['at_date']; + + if (null === $opts['at_date']) { + $opts['at_date'] = $this->clock->now(); + } elseif ($opts['at_date'] instanceof DateTime) { + $opts['at_date'] = DateTimeImmutable::createFromMutable($opts['at_date']); + } $str = $entity->getLabel(); - if (null !== $entity->getUserJob($immutableAtDate) && $opts['user_job']) { + if (null !== $entity->getUserJob($opts['at_date']) && $opts['user_job']) { $str .= ' ('.$this->translatableStringHelper - ->localize($entity->getUserJob($immutableAtDate)->getLabel()).')'; + ->localize($entity->getUserJob($opts['at_date'])->getLabel()).')'; } - if (null !== $entity->getMainScope($immutableAtDate) && $opts['main_scope']) { + if (null !== $entity->getMainScope($opts['at_date']) && $opts['main_scope']) { $str .= ' ('.$this->translatableStringHelper - ->localize($entity->getMainScope($immutableAtDate)->getName()).')'; + ->localize($entity->getMainScope($opts['at_date'])->getName()).')'; } if ($entity->isAbsent() && $opts['absence']) { From d7eb1e01da58772ce3ee20f738fef62750bb92cb Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Tue, 30 Jan 2024 17:01:45 +0100 Subject: [PATCH 15/67] Adapt the rendering of user in accompanyingPeriodWork list and item templates --- .../Resources/views/AccompanyingCourseWork/_item.html.twig | 4 ++-- .../list_recent_by_accompanying_period.html.twig | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/_item.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/_item.html.twig index e8f6f1171..6477f4a95 100644 --- a/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/_item.html.twig +++ b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/_item.html.twig @@ -83,9 +83,9 @@
  • {%- if w.referrers|length > 0 -%} - {% for r in w.referrers %} + {% for r in w.referrersHistory %} - {{ r|chill_entity_render_box }} + {{ r.user|chill_entity_render_box({'at_date': r.startDate}) }} {% if not loop.last %}, {% endif %} {% endfor %} diff --git a/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/list_recent_by_accompanying_period.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/list_recent_by_accompanying_period.html.twig index 21552e44c..30bdc44d2 100644 --- a/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/list_recent_by_accompanying_period.html.twig +++ b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/list_recent_by_accompanying_period.html.twig @@ -33,8 +33,8 @@ {% if w.referrers %}
  • {{ 'Referrers'|trans ~ ' : ' }} - {% for rh in w.referrers %} - {{ rh|chill_entity_render_box }} + {% for rh in w.referrersHistory %} + {{ rh.user|chill_entity_render_box({'at_date': rh.startDate}) }} {% endfor %} {% if w.referrers|length == 0 %} {{ 'Not given'|trans }} From 3be8a39a1ac66659d4b6d37bad7f28a7cb94d326 Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Tue, 30 Jan 2024 17:03:24 +0100 Subject: [PATCH 16/67] Add at_date to userRender for rendering the text --- .../ChillMainBundle/Serializer/Normalizer/UserNormalizer.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Bundle/ChillMainBundle/Serializer/Normalizer/UserNormalizer.php b/src/Bundle/ChillMainBundle/Serializer/Normalizer/UserNormalizer.php index 2e1441614..80363871a 100644 --- a/src/Bundle/ChillMainBundle/Serializer/Normalizer/UserNormalizer.php +++ b/src/Bundle/ChillMainBundle/Serializer/Normalizer/UserNormalizer.php @@ -81,7 +81,7 @@ class UserNormalizer implements ContextAwareNormalizerInterface, NormalizerAware 'type' => 'user', 'id' => $object->getId(), 'username' => $object->getUsername(), - 'text' => $this->userRender->renderString($object, []), + 'text' => $this->userRender->renderString($object, ['at_date' => $at]), 'text_without_absent' => $this->userRender->renderString($object, ['absence' => false]), 'label' => $object->getLabel(), 'email' => (string) $object->getEmail(), From a13ada2937b20cecb3e70694ffc99796bf033d77 Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Wed, 7 Feb 2024 07:19:26 +0100 Subject: [PATCH 17/67] work on userRenderTest --- src/Bundle/ChillMainBundle/Entity/User.php | 5 ++ .../Templating/Entity/UserRenderTest.php | 66 +++++++++++-------- 2 files changed, 44 insertions(+), 27 deletions(-) diff --git a/src/Bundle/ChillMainBundle/Entity/User.php b/src/Bundle/ChillMainBundle/Entity/User.php index 58e0c042a..13f9cbd95 100644 --- a/src/Bundle/ChillMainBundle/Entity/User.php +++ b/src/Bundle/ChillMainBundle/Entity/User.php @@ -344,6 +344,11 @@ class User implements UserInterface, \Stringable return $this->jobHistories; } + public function getUserScopeHistories(): Collection + { + return $this->scopeHistories; + } + /** * @return ArrayCollection|UserJobHistory[] */ diff --git a/src/Bundle/ChillMainBundle/Tests/Templating/Entity/UserRenderTest.php b/src/Bundle/ChillMainBundle/Tests/Templating/Entity/UserRenderTest.php index 21f73d466..999421c40 100644 --- a/src/Bundle/ChillMainBundle/Tests/Templating/Entity/UserRenderTest.php +++ b/src/Bundle/ChillMainBundle/Tests/Templating/Entity/UserRenderTest.php @@ -16,52 +16,62 @@ use Twig\Environment; class UserRenderTest extends TestCase { - /** - * @throws \DateInvalidTimeZoneException - * @throws \DateMalformedStringException - */ - public function renderUserWithJobAndScopeAtCertainDateTest(): void + public function testRenderUserWithJobAndScopeAtCertainDate(): void { // Create a user with a certain user job $user = new User(); - $userJob = new UserJob(); - $scope = new Scope(); + $userJobA = new UserJob(); + $scopeA = new Scope(); - $userJob->setLabel(['fr' => 'assistant social']); - $scope->setName(['fr' => 'service A']); + $userJobA->setLabel(['fr' => 'assistant social']); + $scopeA->setName(['fr' => 'service A']); $user->setLabel('BOB ISLA'); - $userJobHistory = (new User\UserJobHistory()) + $userJobB = new UserJob(); + $scopeB = new Scope(); + + $userJobB->setLabel(['fr' => 'directrice']); + $scopeB->setName(['fr' => 'service B']); + + $userJobHistoryA = (new User\UserJobHistory()) ->setUser($user) - ->setJob($userJob) - //setStartDate - ; + ->setJob($userJobA) + ->setStartDate(new \DateTimeImmutable('2023-11-01 12:00:00')) + ->setEndDate(new \DateTimeImmutable('2023-11-30 00:00:00')); - $userScopeHistory = (new User\UserScopeHistory()) + $userScopeHistoryA = (new User\UserScopeHistory()) ->setUser($user) - ->setScope($scope) - ; - $user->getUserJobHistories()->add($userJobHistory); - $user->setMainScope($scope); + ->setScope($scopeA) + ->setStartDate(new \DateTimeImmutable('2023-11-01 12:00:00')) + ->setEndDate(new \DateTimeImmutable('2023-11-30 00:00:00')); -/* // Change the user job - $userJobTwo = new UserJob(); - $userJobTwo->setLabel(['fr' => 'directrice']); + $userJobHistoryB = (new User\UserJobHistory()) + ->setUser($user) + ->setJob($userJobB) + ->setStartDate(new \DateTimeImmutable('2023-12-01 12:00:00')); - // Change the scope - $scopeTwo = new Scope(); - $scopeTwo->setName(['fr' => 'service B']);*/ + $userScopeHistoryB = (new User\UserScopeHistory()) + ->setUser($user) + ->setScope($scopeB) + ->setStartDate(new \DateTimeImmutable('2023-12-01 12:00:00')); + $user->getUserJobHistories()->add($userJobHistoryA); + $user->getUserScopeHistories()->add($userScopeHistoryA); + + $user->getUserJobHistories()->add($userJobHistoryB); + $user->getUserScopeHistories()->add($userScopeHistoryB); // Create renderer $translatableStringHelper = $this->createMock(TranslatableStringHelperInterface::class); $engine = $this->createMock(Environment::class); $translator = $this->createMock(TranslatorInterface::class); - $clock = new MockClock(new \DateTimeImmutable('2023-12-15')); + $clock = new MockClock(new \DateTimeImmutable('2023-12-15 12:00:00')); + $renderer = new UserRender($translatableStringHelper, $engine, $translator, $clock); - $options['at_date'] = new \DateTime('2023-11-30 12:00:00'); + $optionsNoDate['at_date'] = null; + $options['at_date'] = new \DateTime('2023-11-25 12:00:00'); $optionsTwo['at_date'] = new \DateTime('2024-01-30 12:00:00'); // Check that the user render for the first activity corresponds with the first user job @@ -72,7 +82,9 @@ class UserRenderTest extends TestCase $expectedStringB = 'BOB ISLA (directrice) (service B)'; $this->assertEquals($expectedStringB, $renderer->renderString($user, $optionsTwo)); - + // Check that the user renders the job and scope that is active now, when no date is given + $expectedStringC = 'BOB ISLA (directrice) (service B)'; + $this->assertEquals($expectedStringC, $renderer->renderString($user, $optionsNoDate)); } } From f5c7ab6ef0fa1d06f09c68edc027b4e64ddb5375 Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Mon, 12 Feb 2024 09:02:48 +0100 Subject: [PATCH 18/67] add back the annotation to edit accompanying period work for referrers --- .../Entity/AccompanyingPeriod/AccompanyingPeriodWork.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/AccompanyingPeriodWork.php b/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/AccompanyingPeriodWork.php index e69bd4f36..126318908 100644 --- a/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/AccompanyingPeriodWork.php +++ b/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/AccompanyingPeriodWork.php @@ -385,6 +385,7 @@ class AccompanyingPeriodWork implements AccompanyingPeriodLinkedWithSocialIssues /** * @return ReadableCollection + * @Serializer\Groups({"accompanying_period_work:edit"}) */ public function getReferrers(): ReadableCollection { From db6408926b7336398a9f0ffb711ad56daf363fc6 Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Mon, 12 Feb 2024 14:36:41 +0100 Subject: [PATCH 19/67] try to fix userRenderTest: mock not working --- .../Templating/Entity/UserRenderTest.php | 22 ++++++++++++++----- 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/src/Bundle/ChillMainBundle/Tests/Templating/Entity/UserRenderTest.php b/src/Bundle/ChillMainBundle/Tests/Templating/Entity/UserRenderTest.php index 999421c40..574d272e1 100644 --- a/src/Bundle/ChillMainBundle/Tests/Templating/Entity/UserRenderTest.php +++ b/src/Bundle/ChillMainBundle/Tests/Templating/Entity/UserRenderTest.php @@ -2,7 +2,6 @@ namespace Templating\Entity; -use Chill\ActivityBundle\Entity\Activity; use Chill\MainBundle\Entity\Scope; use Chill\MainBundle\Entity\User; use Chill\MainBundle\Entity\UserJob; @@ -10,12 +9,21 @@ use Chill\MainBundle\Templating\Entity\UserRender; use Chill\MainBundle\Templating\TranslatableStringHelper; use Chill\MainBundle\Templating\TranslatableStringHelperInterface; use PHPUnit\Framework\TestCase; +use Prophecy\PhpUnit\ProphecyTrait; +use Symfony\Bundle\FrameworkBundle\Test\WebTestCase; use Symfony\Component\Clock\MockClock; use Symfony\Contracts\Translation\TranslatorInterface; use Twig\Environment; -class UserRenderTest extends TestCase +class UserRenderTest extends WebTestCase { + use ProphecyTrait; + + public function setUp(): void + { + self::bootKernel(); + } + public function testRenderUserWithJobAndScopeAtCertainDate(): void { // Create a user with a certain user job @@ -63,12 +71,14 @@ class UserRenderTest extends TestCase $user->getUserScopeHistories()->add($userScopeHistoryB); // Create renderer - $translatableStringHelper = $this->createMock(TranslatableStringHelperInterface::class); - $engine = $this->createMock(Environment::class); - $translator = $this->createMock(TranslatorInterface::class); + $translatableStringHelperMock = $this->getMockBuilder(TranslatableStringHelperInterface::class) + ->getMock(); + + $engineMock = $this->createMock(Environment::class); + $translatorMock = $this->createMock(TranslatorInterface::class); $clock = new MockClock(new \DateTimeImmutable('2023-12-15 12:00:00')); - $renderer = new UserRender($translatableStringHelper, $engine, $translator, $clock); + $renderer = new UserRender($translatableStringHelperMock, $engineMock, $translatorMock, $clock); $optionsNoDate['at_date'] = null; $options['at_date'] = new \DateTime('2023-11-25 12:00:00'); From 82667a1c0f873288a28637675f905b9758df68d1 Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Mon, 12 Feb 2024 14:37:54 +0100 Subject: [PATCH 20/67] php style fixer --- .../ChillActivityBundle.php | 4 +- .../Controller/ActivityController.php | 7 +- .../ActivityReasonCategoryController.php | 8 +- .../Controller/ActivityReasonController.php | 10 ++- .../EntityListener/ActivityEntityListener.php | 4 +- .../ByActivityTypeAggregator.php | 5 +- .../BySocialActionAggregator.php | 4 +- .../BySocialIssueAggregator.php | 4 +- .../Aggregator/ActivityPresenceAggregator.php | 10 ++- .../Aggregator/ActivityTypeAggregator.php | 6 +- .../Aggregator/ActivityUserAggregator.php | 4 +- .../Aggregator/ActivityUsersAggregator.php | 4 +- .../Aggregator/ActivityUsersJobAggregator.php | 7 +- .../ActivityUsersScopeAggregator.php | 7 +- .../Export/Aggregator/ByCreatorAggregator.php | 4 +- .../Aggregator/ByThirdpartyAggregator.php | 4 +- .../Aggregator/CreatorJobAggregator.php | 7 +- .../Aggregator/CreatorScopeAggregator.php | 7 +- .../Aggregator/LocationTypeAggregator.php | 4 +- .../ActivityReasonAggregator.php | 4 +- .../PersonAggregators/PersonAggregator.php | 4 +- .../Export/Aggregator/PersonsAggregator.php | 4 +- .../Aggregator/SentReceivedAggregator.php | 4 +- .../LinkedToACP/AvgActivityDuration.php | 4 +- .../Export/LinkedToACP/CountActivity.php | 4 +- .../LinkedToACP/CountHouseholdOnActivity.php | 4 +- .../LinkedToACP/CountPersonsOnActivity.php | 4 +- .../Export/LinkedToACP/ListActivity.php | 3 +- .../Export/LinkedToPerson/CountActivity.php | 4 +- .../CountHouseholdOnActivity.php | 4 +- .../LinkedToPerson/StatActivityDuration.php | 4 +- .../Export/Export/ListActivityHelper.php | 7 +- .../Filter/ACPFilters/ActivityTypeFilter.php | 3 +- .../ACPFilters/BySocialActionFilter.php | 4 +- .../Filter/ACPFilters/BySocialIssueFilter.php | 4 +- ...PeriodHavingActivityBetweenDatesFilter.php | 3 +- .../Export/Filter/ActivityDateFilter.php | 4 +- .../Export/Filter/ActivityPresenceFilter.php | 3 +- .../Export/Filter/ActivityTypeFilter.php | 3 +- .../Export/Filter/ActivityUsersFilter.php | 4 +- .../Export/Filter/ByCreatorFilter.php | 4 +- .../Export/Filter/CreatorJobFilter.php | 3 +- .../Export/Filter/CreatorScopeFilter.php | 3 +- .../Export/Filter/EmergencyFilter.php | 4 +- .../Export/Filter/LocationTypeFilter.php | 4 +- .../PersonFilters/ActivityReasonFilter.php | 4 +- .../PersonHavingActivityBetweenDateFilter.php | 3 +- .../Export/Filter/PersonsFilter.php | 4 +- .../Export/Filter/SentReceivedFilter.php | 4 +- .../Export/Filter/UserFilter.php | 4 +- .../Export/Filter/UsersJobFilter.php | 3 +- .../Export/Filter/UsersScopeFilter.php | 3 +- .../ChillActivityBundle/Form/ActivityType.php | 2 +- .../Form/ActivityTypeType.php | 4 +- .../Form/Type/PickActivityReasonType.php | 3 +- ...TranslatableActivityReasonCategoryType.php | 4 +- .../Form/Type/TranslatableActivityType.php | 4 +- .../Menu/AccompanyingCourseMenuBuilder.php | 4 +- .../Menu/AdminMenuBuilder.php | 4 +- .../Menu/PersonMenuBuilder.php | 6 +- .../ActivityNotificationHandler.php | 4 +- .../Repository/ActivityACLAwareRepository.php | 3 +- .../ActivityDocumentACLAwareRepository.php | 11 +-- ...ityDocumentACLAwareRepositoryInterface.php | 4 +- .../Repository/ActivityPresenceRepository.php | 2 +- .../ActivityPresenceRepositoryInterface.php | 2 +- .../Repository/ActivityTypeRepository.php | 2 +- .../Service/DocGenerator/ActivityContext.php | 3 +- ...tActivitiesByAccompanyingPeriodContext.php | 3 +- ...anyingPeriodActivityGenericDocProvider.php | 7 +- .../PersonActivityGenericDocProvider.php | 5 +- ...anyingPeriodActivityGenericDocRenderer.php | 4 +- .../Controller/ActivityControllerTest.php | 2 +- ...sonHavingActivityBetweenDateFilterTest.php | 2 +- .../Type/TranslatableActivityTypeTest.php | 4 +- .../Authorization/ActivityVoterTest.php | 2 +- .../src/ChillAsideActivityBundle.php | 4 +- .../Controller/AsideActivityController.php | 6 +- .../DataFixtures/ORM/LoadAsideActivity.php | 4 +- .../src/Entity/AsideActivity.php | 8 +- .../Aggregator/ByActivityTypeAggregator.php | 3 +- .../Aggregator/ByLocationAggregator.php | 4 +- .../Export/Aggregator/ByUserJobAggregator.php | 7 +- .../Aggregator/ByUserScopeAggregator.php | 7 +- .../Export/AvgAsideActivityDuration.php | 8 +- .../src/Export/Export/CountAsideActivity.php | 8 +- .../src/Export/Export/ListAsideActivity.php | 7 +- .../Export/SumAsideActivityDuration.php | 8 +- .../Export/Filter/ByActivityTypeFilter.php | 3 +- .../src/Export/Filter/ByDateFilter.php | 4 +- .../src/Export/Filter/ByLocationFilter.php | 3 +- .../src/Export/Filter/ByUserFilter.php | 4 +- .../src/Export/Filter/ByUserJobFilter.php | 3 +- .../src/Export/Filter/ByUserScopeFilter.php | 3 +- .../src/Form/AsideActivityCategoryType.php | 4 +- .../Type/PickAsideActivityCategoryType.php | 4 +- .../src/Menu/AdminMenuBuilder.php | 4 +- .../src/Menu/SectionMenuBuilder.php | 4 +- .../AsideActivityCategoryRepository.php | 2 +- .../src/Templating/Entity/CategoryRender.php | 4 +- .../Controller/AbstractElementController.php | 4 +- .../Controller/ElementController.php | 4 +- .../Entity/AbstractElement.php | 4 +- .../ChillBudgetBundle/Form/ChargeType.php | 4 +- .../ChillBudgetBundle/Form/ResourceType.php | 4 +- .../Menu/AdminMenuBuilder.php | 4 +- .../Menu/HouseholdMenuBuilder.php | 4 +- .../Menu/PersonMenuBuilder.php | 4 +- .../Repository/ChargeKindRepository.php | 2 +- .../ChargeKindRepositoryInterface.php | 2 +- .../Repository/ResourceKindRepository.php | 2 +- .../ResourceKindRepositoryInterface.php | 2 +- .../Service/Summary/SummaryBudget.php | 4 +- .../Templating/BudgetElementTypeRender.php | 4 +- .../migrations/Version20221207105407.php | 2 +- .../Controller/CalendarAPIController.php | 4 +- .../Controller/CalendarController.php | 5 +- .../Controller/CalendarDocController.php | 3 +- .../Controller/CalendarRangeAPIController.php | 4 +- .../Controller/InviteApiController.php | 4 +- .../RemoteCalendarConnectAzureController.php | 4 +- .../RemoteCalendarMSGraphSyncController.php | 4 +- .../RemoteCalendarProxyController.php | 4 +- .../DataFixtures/ORM/LoadCalendarRange.php | 4 +- .../Event/ListenToActivityCreate.php | 4 +- .../Exception/UserAbsenceSyncException.php | 2 +- .../Export/Aggregator/AgentAggregator.php | 4 +- .../Aggregator/CancelReasonAggregator.php | 4 +- .../Export/Aggregator/JobAggregator.php | 7 +- .../Export/Aggregator/LocationAggregator.php | 4 +- .../Aggregator/LocationTypeAggregator.php | 4 +- .../Export/Aggregator/ScopeAggregator.php | 7 +- .../Export/Aggregator/UrgencyAggregator.php | 4 +- .../Export/Export/CountCalendars.php | 3 +- .../Export/Export/StatCalendarAvgDuration.php | 4 +- .../Export/Export/StatCalendarSumDuration.php | 4 +- .../Export/Filter/AgentFilter.php | 4 +- .../Export/Filter/BetweenDatesFilter.php | 4 +- .../Export/Filter/CalendarRangeFilter.php | 4 +- .../Export/Filter/JobFilter.php | 3 +- .../Export/Filter/ScopeFilter.php | 3 +- .../ChillCalendarBundle/Form/CalendarType.php | 3 +- .../Menu/AccompanyingCourseMenuBuilder.php | 4 +- .../Menu/PersonMenuBuilder.php | 4 +- .../Menu/UserMenuBuilder.php | 4 +- .../Doctrine/CalendarEntityListener.php | 4 +- .../Doctrine/CalendarRangeEntityListener.php | 4 +- .../CalendarRangeRemoveToRemoteHandler.php | 4 +- .../Handler/CalendarRangeToRemoteHandler.php | 4 +- .../Handler/CalendarRemoveHandler.php | 4 +- .../Handler/CalendarToRemoteHandler.php | 4 +- .../Messenger/Handler/InviteUpdateHandler.php | 4 +- .../MSGraphChangeNotificationHandler.php | 4 +- .../MSGraphChangeNotificationMessage.php | 4 +- .../Connector/MSGraph/AddressConverter.php | 4 +- .../EventsOnUserSubscriptionCreator.php | 4 +- .../Connector/MSGraph/LocationConverter.php | 4 +- .../Connector/MSGraph/MSUserAbsenceReader.php | 5 +- .../MSGraph/MSUserAbsenceReaderInterface.php | 2 +- .../Connector/MSGraph/MSUserAbsenceSync.php | 3 +- .../Connector/MSGraph/MachineHttpClient.php | 4 +- .../Connector/MSGraph/MachineTokenStorage.php | 4 +- .../Connector/MSGraph/MapCalendarToUser.php | 8 +- .../MSGraph/OnBehalfOfUserHttpClient.php | 4 +- .../MSGraph/OnBehalfOfUserTokenStorage.php | 4 +- .../RemoteToLocalSync/CalendarRangeSyncer.php | 4 +- .../RemoteToLocalSync/CalendarSyncer.php | 4 +- .../MSGraphRemoteCalendarConnector.php | 6 +- .../Connector/NullRemoteCalendarConnector.php | 20 +++-- .../RemoteCalendarConnectorInterface.php | 2 +- .../RemoteCalendar/Model/RemoteEvent.php | 3 +- .../Repository/CalendarACLAwareRepository.php | 8 +- .../CalendarACLAwareRepositoryInterface.php | 4 +- .../Repository/CalendarDocRepository.php | 2 +- .../CalendarDocRepositoryInterface.php | 2 +- .../Repository/CalendarRangeRepository.php | 6 +- .../Repository/CalendarRepository.php | 10 +-- .../Repository/InviteRepository.php | 2 +- .../Security/Voter/CalendarDocVoter.php | 4 +- .../Service/DocGenerator/CalendarContext.php | 3 +- .../DocGenerator/CalendarContextInterface.php | 4 +- ...anyingPeriodCalendarGenericDocProvider.php | 7 +- .../PersonCalendarGenericDocProvider.php | 7 +- ...anyingPeriodCalendarGenericDocRenderer.php | 4 +- .../BulkCalendarShortMessageSender.php | 4 +- .../CalendarForShortMessageProvider.php | 4 +- .../DefaultShortMessageForCalendarBuilder.php | 4 +- .../DocGenerator/CalendarContextTest.php | 4 +- .../Command/CreateFieldsOnGroupCommand.php | 2 +- .../Controller/CustomFieldController.php | 6 +- .../CustomFieldsGroupController.php | 20 +++-- .../CustomFields/CustomFieldChoice.php | 7 +- .../CustomFields/CustomFieldDate.php | 3 +- .../CustomFields/CustomFieldLongChoice.php | 3 +- .../CustomFields/CustomFieldNumber.php | 3 +- .../CustomFields/CustomFieldText.php | 3 +- .../CustomFields/CustomFieldTitle.php | 3 +- .../Entity/CustomField.php | 4 +- .../Entity/CustomFieldLongChoice/Option.php | 4 +- .../Entity/CustomFieldsDefaultGroup.php | 2 +- .../Entity/CustomFieldsGroup.php | 2 +- .../Form/CustomFieldType.php | 4 +- .../Form/CustomFieldsGroupType.php | 3 +- .../CustomFieldDataTransformer.php | 4 +- .../CustomFieldsGroupToIdTransformer.php | 4 +- .../Form/Type/CustomFieldsTitleType.php | 4 +- .../Form/Type/LinkedCustomFieldsType.php | 4 +- .../Service/CustomFieldProvider.php | 2 +- .../Service/CustomFieldsHelper.php | 4 +- .../Twig/CustomFieldRenderingTwig.php | 4 +- .../CustomFields/CustomFieldsChoiceTest.php | 2 +- .../CustomFields/CustomFieldsTextTest.php | 2 +- .../Tests/Service/CustomFieldsHelperTest.php | 2 +- .../Context/ContextManager.php | 4 +- .../AdminDocGeneratorTemplateController.php | 4 +- .../DocGeneratorTemplateController.php | 4 +- .../Form/DocGeneratorTemplateType.php | 4 +- .../GeneratorDriver/DriverInterface.php | 2 +- .../Exception/TemplateException.php | 2 +- .../GeneratorDriver/RelatorioDriver.php | 2 +- .../Menu/AdminMenuBuilder.php | 4 +- .../DocGeneratorTemplateRepository.php | 4 +- .../Helper/NormalizeNullValueHelper.php | 6 +- .../Service/Context/BaseContextData.php | 6 +- .../Service/Generator/Generator.php | 10 ++- .../Service/Generator/GeneratorException.php | 2 +- .../Service/Generator/GeneratorInterface.php | 6 +- .../RelatedEntityNotFoundException.php | 2 +- .../Service/Messenger/OnGenerationFails.php | 6 +- .../Messenger/RequestGenerationHandler.php | 4 +- .../Service/Context/BaseContextDataTest.php | 2 +- .../DocumentAccompanyingCourseController.php | 3 +- .../Controller/DocumentCategoryController.php | 6 +- .../Controller/DocumentPersonController.php | 3 +- ...ericDocForAccompanyingPeriodController.php | 3 +- .../Controller/GenericDocForPerson.php | 3 +- .../Controller/StoredObjectApiController.php | 4 +- .../ChillDocStoreBundle/Entity/Document.php | 8 +- .../Entity/DocumentCategory.php | 3 +- .../Entity/PersonDocument.php | 4 +- .../Form/PersonDocumentType.php | 4 +- .../GenericDoc/FetchQuery.php | 3 +- .../GenericDoc/GenericDocDTO.php | 3 +- ...ForAccompanyingPeriodProviderInterface.php | 8 +- .../GenericDocForPersonProviderInterface.php | 8 +- .../GenericDoc/Manager.php | 30 +++---- ...anyingCourseDocumentGenericDocProvider.php | 9 +- .../PersonDocumentGenericDocProvider.php | 13 +-- ...anyingCourseDocumentGenericDocRenderer.php | 3 +- .../Twig/GenericDocExtensionRuntime.php | 3 +- .../ChillDocStoreBundle/Menu/MenuBuilder.php | 4 +- .../AccompanyingCourseDocumentRepository.php | 2 +- .../Repository/DocumentCategoryRepository.php | 2 +- .../PersonDocumentACLAwareRepository.php | 11 +-- ...sonDocumentACLAwareRepositoryInterface.php | 12 +-- .../Repository/PersonDocumentRepository.php | 2 +- .../Repository/StoredObjectRepository.php | 2 +- .../Normalizer/StoredObjectDenormalizer.php | 4 +- .../Service/StoredObjectManager.php | 4 +- .../WopiEditTwigExtensionRuntime.php | 10 ++- .../Tests/GenericDoc/ManagerTest.php | 4 +- ...ngCourseDocumentGenericDocProviderTest.php | 2 +- .../PersonDocumentACLAwareRepositoryTest.php | 8 +- .../Tests/StoredObjectManagerTest.php | 4 +- .../ChillEventBundle/ChillEventBundle.php | 4 +- .../Controller/EventController.php | 12 +-- .../Controller/EventTypeController.php | 10 +-- .../Controller/ParticipationController.php | 20 +++-- .../Controller/RoleController.php | 10 +-- .../Controller/StatusController.php | 10 +-- .../DataFixtures/ORM/LoadParticipation.php | 2 +- src/Bundle/ChillEventBundle/Entity/Event.php | 10 +-- .../ChillEventBundle/Entity/Participation.php | 22 ++--- src/Bundle/ChillEventBundle/Entity/Role.php | 4 +- src/Bundle/ChillEventBundle/Entity/Status.php | 4 +- .../Form/ChoiceLoader/EventChoiceLoader.php | 2 +- .../Form/ParticipationType.php | 4 +- src/Bundle/ChillEventBundle/Form/RoleType.php | 4 +- .../Form/Type/PickEventType.php | 3 +- .../Form/Type/PickRoleType.php | 3 +- .../Form/Type/PickStatusType.php | 4 +- .../ChillEventBundle/Search/EventSearch.php | 3 +- .../Tests/Search/EventSearchTest.php | 2 +- .../Controller/AbstractCRUDController.php | 4 +- .../CRUD/Controller/ApiController.php | 2 +- .../CRUD/Controller/CRUDController.php | 68 ++++++++++----- .../CRUD/Form/CRUDDeleteEntityForm.php | 4 +- .../ChillUserSendRenewPasswordCodeCommand.php | 4 +- .../Command/LoadAndUpdateLanguagesCommand.php | 4 +- .../Command/LoadCountriesCommand.php | 2 +- .../Command/LoadPostalCodesCommand.php | 12 ++- .../Command/SetPasswordCommand.php | 2 +- .../AddressReferenceAPIController.php | 4 +- .../AddressToReferenceMatcherController.php | 4 +- .../Controller/ExportController.php | 24 +++--- ...GeographicalUnitByAddressApiController.php | 4 +- .../Controller/LocationTypeController.php | 4 +- .../Controller/LoginController.php | 4 +- .../Controller/NotificationApiController.php | 4 +- .../Controller/NotificationController.php | 4 +- .../Controller/PermissionApiController.php | 4 +- .../Controller/PermissionsGroupController.php | 5 +- .../Controller/PostalCodeAPIController.php | 4 +- .../Controller/SavedExportController.php | 4 +- .../Controller/ScopeController.php | 8 +- .../Controller/SearchController.php | 6 +- .../Controller/TimelineCenterController.php | 4 +- .../Controller/UserController.php | 18 ++-- .../Controller/UserExportController.php | 3 +- .../UserJobScopeHistoriesController.php | 3 +- .../Controller/UserProfileController.php | 3 +- .../Controller/WorkflowApiController.php | 4 +- .../Controller/WorkflowController.php | 4 +- .../ChillMainBundle/Cron/CronJobInterface.php | 2 +- .../ChillMainBundle/Cron/CronManager.php | 5 +- .../Cron/CronManagerInterface.php | 2 +- .../ORM/LoadAddressReferences.php | 4 +- .../DataFixtures/ORM/LoadCountries.php | 4 +- .../DataFixtures/ORM/LoadLanguages.php | 4 +- .../DataFixtures/ORM/LoadLocationType.php | 4 +- .../DataFixtures/ORM/LoadUsers.php | 4 +- .../ChillMainExtension.php | 14 ++-- .../ChillMainBundle/Doctrine/DQL/Extract.php | 2 +- .../Doctrine/DQL/JsonExtract.php | 2 +- .../ChillMainBundle/Doctrine/DQL/ToChar.php | 2 +- .../Event/TrackCreateUpdateSubscriber.php | 4 +- .../ChillMainBundle/Doctrine/Model/Point.php | 4 +- .../Hydration/FlatHierarchyEntityHydrator.php | 2 +- src/Bundle/ChillMainBundle/Entity/Address.php | 6 +- .../Entity/AddressReference.php | 2 +- .../SimpleGeographicalUnitDTO.php | 3 +- .../Entity/PermissionsGroup.php | 4 +- .../ChillMainBundle/Entity/PostalCode.php | 6 +- .../ChillMainBundle/Entity/RoleScope.php | 4 +- src/Bundle/ChillMainBundle/Entity/User.php | 10 ++- .../Export/ExportFormHelper.php | 3 +- .../ChillMainBundle/Export/ExportManager.php | 8 +- .../Export/Formatter/CSVListFormatter.php | 2 +- .../Formatter/CSVPivotedListFormatter.php | 2 +- .../Formatter/SpreadsheetListFormatter.php | 2 +- .../Export/Helper/DateTimeHelper.php | 4 +- .../Export/Helper/ExportAddressHelper.php | 4 +- .../TranslatableStringExportLabelHelper.php | 4 +- .../Export/Helper/UserHelper.php | 6 +- .../ChillMainBundle/Export/ListInterface.php | 4 +- .../Export/SortExportElement.php | 3 +- .../ChoiceLoader/PostalCodeChoiceLoader.php | 2 +- .../DataMapper/PrivateCommentDataMapper.php | 4 +- .../Form/DataMapper/ScopePickerDataMapper.php | 4 +- .../IdToEntityDataTransformer.php | 2 +- .../Form/Event/CustomizeFormEvent.php | 4 +- .../ChillMainBundle/Form/LocationFormType.php | 4 +- .../Form/Type/AppendScopeChoiceTypeTrait.php | 2 +- .../Form/Type/ComposedGroupCenterType.php | 4 +- .../Form/Type/ComposedRoleScopeType.php | 2 +- .../AddressToIdDataTransformer.php | 4 +- .../DataTransformer/CenterTransformer.php | 4 +- .../EntityToJsonTransformer.php | 4 +- .../MultipleObjectsToIdTransformer.php | 4 +- .../DataTransformer/ObjectToIdTransformer.php | 4 +- .../PostalCodeToIdTransformer.php | 4 +- .../Type/DataTransformer/ScopeTransformer.php | 4 +- .../Form/Type/Export/AggregatorType.php | 4 +- .../Form/Type/Export/ExportType.php | 4 +- .../Form/Type/Export/FilterType.php | 4 +- .../Form/Type/Export/PickCenterType.php | 3 +- .../Form/Type/PickAddressType.php | 4 +- .../Form/Type/PickCenterType.php | 4 +- .../Form/Type/PickCivilityType.php | 4 +- .../Form/Type/PickLocationTypeType.php | 4 +- .../Form/Type/PickPostalCodeType.php | 4 +- .../Form/Type/PickUserDynamicType.php | 4 +- .../Form/Type/PickUserLocationType.php | 4 +- .../Form/Type/PrivateCommentType.php | 4 +- .../Form/Type/ScopePickerType.php | 4 +- .../Form/Type/Select2CountryType.php | 6 +- .../Form/Type/Select2LanguageType.php | 6 +- src/Bundle/ChillMainBundle/Form/UserType.php | 4 +- .../ChillMainBundle/Form/WorkflowStepType.php | 6 +- .../Counter/NotificationByUserCounter.php | 4 +- .../Notification/Email/NotificationMailer.php | 4 +- ...NotificationOnTerminateEventSubscriber.php | 4 +- .../Exception/NotificationHandlerNotFound.php | 4 +- .../ChillMainBundle/Notification/Mailer.php | 6 +- .../NotificationHandlerManager.php | 4 +- .../Notification/NotificationPresence.php | 4 +- .../NotificationTwigExtensionRuntime.php | 4 +- .../Pagination/PageGenerator.php | 4 +- .../ChillMainBundle/Pagination/Paginator.php | 5 +- .../Pagination/PaginatorFactory.php | 7 +- .../PhoneNumberHelperInterface.php | 2 +- .../Phonenumber/PhonenumberHelper.php | 4 +- .../Phonenumber/Templating.php | 4 +- .../ChillMainBundle/Redis/ChillRedis.php | 4 +- .../Repository/AddressReferenceRepository.php | 4 +- .../Repository/AddressRepository.php | 6 +- .../Repository/CenterRepository.php | 4 +- .../Repository/CivilityRepository.php | 2 +- .../CivilityRepositoryInterface.php | 2 +- .../Repository/CountryRepository.php | 6 +- .../Repository/CronJobExecutionRepository.php | 2 +- .../CronJobExecutionRepositoryInterface.php | 2 +- .../GeographicalUnitLayerLayerRepository.php | 2 +- .../Repository/GeographicalUnitRepository.php | 2 +- .../Repository/GroupCenterRepository.php | 4 +- .../Repository/LanguageRepository.php | 4 +- .../LanguageRepositoryInterface.php | 4 +- .../Repository/NotificationRepository.php | 4 +- .../Repository/PermissionsGroupRepository.php | 4 +- .../Repository/PostalCodeRepository.php | 4 +- .../PostalCodeRepositoryInterface.php | 4 +- .../Repository/RegroupmentRepository.php | 4 +- .../Repository/RoleScopeRepository.php | 4 +- .../Repository/SavedExportRepository.php | 4 +- .../SavedExportRepositoryInterface.php | 4 +- .../Repository/ScopeRepository.php | 4 +- .../Repository/ScopeRepositoryInterface.php | 4 +- .../Repository/UserACLAwareRepository.php | 4 +- .../Repository/UserJobRepository.php | 2 +- .../Repository/UserJobRepositoryInterface.php | 2 +- .../Repository/UserRepository.php | 10 +-- .../Repository/UserRepositoryInterface.php | 6 +- .../Workflow/EntityWorkflowRepository.php | 12 +-- .../Workflow/EntityWorkflowStepRepository.php | 4 +- .../MenuBuilder/SectionMenuBuilder.php | 4 +- .../Routing/MenuBuilder/UserMenuBuilder.php | 4 +- .../ChillMainBundle/Routing/MenuComposer.php | 4 +- .../ChillMainBundle/Routing/MenuTwig.php | 8 +- .../Search/Entity/SearchUserApiProvider.php | 4 +- .../ChillMainBundle/Search/Model/Result.php | 3 +- .../Search/ParsingException.php | 4 +- .../ChillMainBundle/Search/SearchApi.php | 4 +- .../Search/SearchApiNoQueryException.php | 2 +- .../Search/SearchApiResult.php | 4 +- .../Search/Utils/SearchExtractionResult.php | 4 +- .../Authorization/AbstractChillVoter.php | 4 +- .../Authorization/AuthorizationHelper.php | 11 +-- .../AuthorizationHelperForCurrentUser.php | 6 +- ...orizationHelperForCurrentUserInterface.php | 2 +- .../AuthorizationHelperInterface.php | 2 +- .../Authorization/ChillVoterInterface.php | 4 +- .../Authorization/DefaultVoterHelper.php | 3 +- .../DefaultVoterHelperFactory.php | 4 +- .../DefaultVoterHelperGenerator.php | 4 +- .../Authorization/EntityWorkflowVoter.php | 4 +- .../WorkflowEntityDeletionVoter.php | 4 +- .../PasswordRecover/PasswordRecoverEvent.php | 3 +- .../PasswordRecover/RecoverPasswordHelper.php | 4 +- .../Resolver/CenterResolverDispatcher.php | 4 +- .../Resolver/CenterResolverManager.php | 4 +- .../Resolver/ResolverTwigExtension.php | 4 +- .../Resolver/ScopeResolverDispatcher.php | 6 +- .../Security/UserProvider/UserProvider.php | 4 +- .../Serializer/Model/Collection.php | 4 +- .../Serializer/Model/Counter.php | 4 +- .../Normalizer/AddressNormalizer.php | 4 +- .../Normalizer/CenterNormalizer.php | 4 +- .../CommentEmbeddableDocGenNormalizer.php | 8 +- .../Serializer/Normalizer/DateNormalizer.php | 4 +- .../DoctrineExistingEntityNormalizer.php | 4 +- .../Normalizer/EntityWorkflowNormalizer.php | 8 +- .../EntityWorkflowStepNormalizer.php | 8 +- .../Normalizer/NotificationNormalizer.php | 8 +- .../Normalizer/PhonenumberNormalizer.php | 4 +- .../PrivateCommentEmbeddableNormalizer.php | 10 ++- .../Serializer/Normalizer/UserNormalizer.php | 4 +- ...ollateAddressWithReferenceOrPostalCode.php | 3 +- ...ddressWithReferenceOrPostalCodeCronJob.php | 5 +- ...eographicalUnitMaterializedViewCronJob.php | 5 +- .../EntityInfo/ViewEntityInfoManager.php | 3 +- .../AddressReferenceBEFromBestAddress.php | 4 +- .../Import/AddressReferenceBaseImporter.php | 10 ++- .../Import/AddressReferenceFromBano.php | 4 +- .../Import/AddressToReferenceMatcher.php | 4 +- .../Import/GeographicalUnitBaseImporter.php | 6 +- .../Import/PostalCodeBEFromBestAddress.php | 4 +- .../Service/Import/PostalCodeBaseImporter.php | 4 +- .../Import/PostalCodeFRFromOpenData.php | 4 +- .../Service/Mailer/ChillMailer.php | 6 +- .../Service/RollingDate/RollingDate.php | 3 +- .../ShortMessage/NullShortMessageSender.php | 4 +- .../Service/ShortMessage/ShortMessage.php | 4 +- .../ShortMessage/ShortMessageHandler.php | 4 +- .../ShortMessage/ShortMessageTransporter.php | 4 +- .../ShortMessageOvh/OvhShortMessageSender.php | 3 +- .../Templating/Entity/AddressRender.php | 4 +- .../Templating/Entity/CommentRender.php | 4 +- .../Templating/Entity/UserRender.php | 21 +++-- .../FilterOrderGetActiveFilterHelper.php | 3 +- .../Templating/Listing/FilterOrderHelper.php | 7 +- .../Listing/FilterOrderHelperBuilder.php | 8 +- .../Listing/FilterOrderHelperFactory.php | 4 +- .../Templating/Listing/Templating.php | 3 +- .../Templating/TranslatableStringTwig.php | 4 +- ...raphicalUnitByAddressApiControllerTest.php | 2 +- .../Cron/CronJobDatabaseInteractionTest.php | 2 +- .../Tests/Cron/CronManagerTest.php | 8 +- .../Tests/Export/ExportManagerTest.php | 36 ++++---- .../Tests/Export/SortExportElementTest.php | 26 ++++-- .../Email/NotificationMailerTest.php | 2 +- .../Tests/Search/SearchProviderTest.php | 2 +- .../Authorization/AuthorizationHelperTest.php | 22 ++--- .../PasswordRecover/TokenManagerTest.php | 4 +- .../Resolver/DefaultScopeResolverTest.php | 8 +- .../Resolver/ScopeResolverDispatcherTest.php | 4 +- .../Normalizer/DateNormalizerTest.php | 2 +- .../Normalizer/PhonenumberNormalizerTest.php | 2 +- .../Normalizer/UserNormalizerTest.php | 6 +- .../Templating/Entity/UserRenderTest.php | 17 +++- .../Timeline/TimelineBuilder.php | 4 +- .../Timeline/TimelineSingleQuery.php | 4 +- .../Util/DateRangeCovering.php | 4 +- .../Validator/RoleScopeScopePresence.php | 4 +- .../Validation/Validator/ValidPhonenumber.php | 4 +- .../Counter/WorkflowByUserCounter.php | 4 +- .../Workflow/EntityWorkflowManager.php | 4 +- ...ntityWorkflowTransitionEventSubscriber.php | 4 +- .../NotificationOnTransition.php | 4 +- .../SendAccessKeyEventSubscriber.php | 4 +- .../Exception/HandlerNotFoundException.php | 4 +- .../Workflow/Helper/MetadataExtractor.php | 6 +- .../WorkflowNotificationHandler.php | 4 +- .../WorkflowTwigExtensionRuntime.php | 4 +- .../EntityWorkflowCreationValidator.php | 4 +- .../migrations/Version20100000000000.php | 4 +- .../migrations/Version20220513151853.php | 4 +- .../PersonAddressMoveEventSubscriber.php | 4 +- .../Events/UserRefEventSubscriber.php | 4 +- .../AccompanyingPeriodStepChangeCronjob.php | 5 +- ...mpanyingPeriodStepChangeMessageHandler.php | 3 +- .../AccompanyingPeriodStepChanger.php | 5 +- .../ChillPersonBundle/Actions/ActionEvent.php | 3 +- .../PersonMoveCenterHistoryHandler.php | 3 +- .../Actions/Remove/PersonMove.php | 3 +- .../Actions/Remove/PersonMoveManager.php | 3 +- .../Config/ConfigPersonAltNamesHelper.php | 3 +- .../AccompanyingCourseApiController.php | 4 +- .../AccompanyingCourseCommentController.php | 4 +- .../AccompanyingCourseController.php | 4 +- .../AccompanyingCourseWorkApiController.php | 4 +- .../AccompanyingCourseWorkController.php | 5 +- ...CourseWorkEvaluationDocumentController.php | 4 +- .../AccompanyingPeriodController.php | 5 +- ...mpanyingPeriodRegulationListController.php | 4 +- ...nyingPeriodWorkEvaluationApiController.php | 4 +- .../Controller/HouseholdApiController.php | 4 +- .../HouseholdCompositionController.php | 3 +- .../Controller/HouseholdController.php | 4 +- .../Controller/HouseholdMemberController.php | 4 +- .../Controller/PersonAddressController.php | 14 ++-- .../Controller/PersonController.php | 7 +- .../Controller/PersonDuplicateController.php | 4 +- .../Controller/PersonResourceController.php | 4 +- .../ReassignAccompanyingPeriodController.php | 6 +- .../Controller/RelationshipApiController.php | 4 +- .../ResidentialAddressController.php | 4 +- .../SocialWork/SocialIssueController.php | 2 +- .../SocialWorkEvaluationApiController.php | 4 +- .../SocialWorkGoalApiController.php | 4 +- .../SocialWorkResultApiController.php | 4 +- .../SocialWorkSocialActionApiController.php | 3 +- .../Controller/TimelinePersonController.php | 4 +- .../UserAccompanyingPeriodController.php | 4 +- .../ORM/LoadAccompanyingPeriodWork.php | 4 +- .../DataFixtures/ORM/LoadCustomFields.php | 7 +- .../DataFixtures/ORM/LoadRelationships.php | 4 +- .../ORM/LoadSocialWorkMetadata.php | 4 +- .../ChillPersonExtension.php | 60 ++++++------- .../Doctrine/DQL/AddressPart.php | 2 +- .../Entity/AccompanyingPeriod.php | 22 ++--- .../AccompanyingPeriodInfo.php | 3 +- .../AccompanyingPeriodWork.php | 3 +- .../AccompanyingPeriodWorkGoal.php | 2 +- .../AccompanyingPeriodWorkReferrerHistory.php | 3 +- .../Entity/AccompanyingPeriod/Resource.php | 4 +- .../Entity/AccompanyingPeriod/UserHistory.php | 3 +- .../ChillPersonBundle/Entity/HasPerson.php | 2 +- .../Entity/Household/Household.php | 24 +++--- .../Entity/Household/HouseholdMember.php | 4 +- .../Household/PersonHouseholdAddress.php | 6 +- .../ChillPersonBundle/Entity/Person.php | 40 ++++----- .../Entity/Person/PersonCenterHistory.php | 3 +- .../Entity/PersonAltName.php | 4 +- .../Entity/PersonNotDuplicate.php | 6 +- .../Entity/SocialWork/SocialAction.php | 8 +- .../Entity/SocialWork/SocialIssue.php | 4 +- .../Event/Person/PersonAddressMoveEvent.php | 4 +- .../AccompanyingPeriodWorkEventListener.php | 4 +- .../AdministrativeLocationAggregator.php | 4 +- .../ClosingDateAggregator.php | 2 +- .../ClosingMotiveAggregator.php | 4 +- .../ConfidentialAggregator.php | 4 +- .../CreatorJobAggregator.php | 10 ++- .../DurationAggregator.php | 4 +- .../EmergencyAggregator.php | 4 +- .../EvaluationAggregator.php | 4 +- .../GeographicalUnitStatAggregator.php | 4 +- .../IntensityAggregator.php | 4 +- .../JobWorkingOnCourseAggregator.php | 9 +- .../OpeningDateAggregator.php | 2 +- .../ReferrerAggregator.php | 4 +- .../ReferrerScopeAggregator.php | 7 +- .../RequestorAggregator.php | 4 +- .../ScopeAggregator.php | 4 +- .../ScopeWorkingOnCourseAggregator.php | 9 +- .../SocialActionAggregator.php | 4 +- .../SocialIssueAggregator.php | 4 +- .../StepAggregator.php | 4 +- .../UserJobAggregator.php | 7 +- .../UserWorkingOnCourseAggregator.php | 5 +- .../EvaluationTypeAggregator.php | 4 +- .../HavingEndDateAggregator.php | 4 +- .../ChildrenNumberAggregator.php | 6 +- .../CompositionAggregator.php | 4 +- .../PersonAggregators/AgeAggregator.php | 3 +- .../ByHouseholdCompositionAggregator.php | 4 +- .../PersonAggregators/CenterAggregator.php | 5 +- .../CountryOfBirthAggregator.php | 4 +- .../PersonAggregators/GenderAggregator.php | 8 +- .../GeographicalUnitAggregator.php | 4 +- .../HouseholdPositionAggregator.php | 4 +- .../MaritalStatusAggregator.php | 4 +- .../NationalityAggregator.php | 4 +- .../PostalCodeAggregator.php | 5 +- .../ActionTypeAggregator.php | 4 +- .../CreatorAggregator.php | 7 +- .../CreatorJobAggregator.php | 7 +- .../CreatorScopeAggregator.php | 7 +- .../CurrentActionAggregator.php | 4 +- .../SocialWorkAggregators/GoalAggregator.php | 4 +- .../GoalResultAggregator.php | 4 +- .../HandlingThirdPartyAggregator.php | 4 +- .../SocialWorkAggregators/JobAggregator.php | 7 +- .../ReferrerAggregator.php | 3 +- .../ResultAggregator.php | 4 +- .../SocialWorkAggregators/ScopeAggregator.php | 7 +- ...rkPersonAssociatedOnAccompanyingPeriod.php | 4 +- ...vgDurationAPWorkPersonAssociatedOnWork.php | 4 +- .../Export/Export/CountEvaluation.php | 4 +- .../Export/Export/ListAccompanyingPeriod.php | 3 +- ...orkAssociatePersonOnAccompanyingPeriod.php | 3 +- ...panyingPeriodWorkAssociatePersonOnWork.php | 3 +- .../Export/Export/ListEvaluation.php | 3 +- .../Export/Export/ListPersonDuplicate.php | 4 +- ...istPersonWithAccompanyingPeriodDetails.php | 3 +- .../ActiveOnDateFilter.php | 4 +- .../ActiveOneDayBetweenDatesFilter.php | 4 +- .../AdministrativeLocationFilter.php | 4 +- .../ClosingMotiveFilter.php | 4 +- .../ConfidentialFilter.php | 4 +- .../CreatorJobFilter.php | 3 +- .../EmergencyFilter.php | 4 +- .../EvaluationFilter.php | 4 +- .../GeographicalUnitStatFilter.php | 4 +- .../HandlingThirdPartyFilter.php | 3 +- .../HasNoReferrerFilter.php | 4 +- .../HasTemporaryLocationFilter.php | 4 +- ...ccompanyingPeriodInfoWithinDatesFilter.php | 3 +- .../IntensityFilter.php | 4 +- .../JobWorkingOnCourseFilter.php | 3 +- .../OpenBetweenDatesFilter.php | 4 +- .../OriginFilter.php | 4 +- .../ReferrerFilter.php | 4 +- .../RequestorFilter.php | 4 +- .../ScopeWorkingOnCourseFilter.php | 3 +- .../SocialActionFilter.php | 3 +- .../StepFilterBetweenDates.php | 4 +- .../StepFilterOnDate.php | 4 +- .../UserJobFilter.php | 3 +- .../UserScopeFilter.php | 3 +- .../UserWorkingOnCourseFilter.php | 3 +- .../EvaluationFilters/ByEndDateFilter.php | 4 +- .../EvaluationFilters/ByStartDateFilter.php | 4 +- .../EvaluationTypeFilter.php | 4 +- .../EvaluationFilters/MaxDateFilter.php | 4 +- .../HouseholdFilters/CompositionFilter.php | 3 +- .../PersonFilters/AddressRefStatusFilter.php | 4 +- .../Export/Filter/PersonFilters/AgeFilter.php | 4 +- .../Filter/PersonFilters/BirthdateFilter.php | 4 +- .../ByHouseholdCompositionFilter.php | 4 +- .../PersonFilters/DeadOrAliveFilter.php | 4 +- .../Filter/PersonFilters/DeathdateFilter.php | 4 +- .../PersonFilters/GeographicalUnitFilter.php | 4 +- .../PersonFilters/MaritalStatusFilter.php | 4 +- .../PersonFilters/NationalityFilter.php | 4 +- .../ResidentialAddressAtThirdpartyFilter.php | 4 +- .../ResidentialAddressAtUserFilter.php | 4 +- .../WithoutHouseholdComposition.php | 4 +- ...yingPeriodWorkEndDateBetweenDateFilter.php | 3 +- ...ngPeriodWorkStartDateBetweenDateFilter.php | 3 +- .../SocialWorkFilters/CreatorJobFilter.php | 3 +- .../SocialWorkFilters/CreatorScopeFilter.php | 3 +- .../Filter/SocialWorkFilters/JobFilter.php | 3 +- .../SocialWorkFilters/ReferrerFilter.php | 4 +- .../Filter/SocialWorkFilters/ScopeFilter.php | 3 +- .../SocialWorkTypeFilter.php | 4 +- .../Export/Helper/LabelPersonHelper.php | 6 +- .../Helper/ListAccompanyingPeriodHelper.php | 3 +- .../Export/Helper/ListPersonHelper.php | 4 +- .../Form/ChoiceLoader/PersonChoiceLoader.php | 2 +- .../Form/ClosingMotiveType.php | 4 +- .../Form/HouseholdCompositionType.php | 4 +- .../Form/PersonResourceType.php | 4 +- .../ChillPersonBundle/Form/PersonType.php | 2 +- .../Form/SocialWork/SocialIssueType.php | 4 +- .../Form/Type/PersonAltNameType.php | 4 +- .../Form/Type/PersonPhoneType.php | 4 +- .../Form/Type/PickPersonDynamicType.php | 4 +- .../Form/Type/PickSocialActionType.php | 4 +- .../Form/Type/PickSocialIssueType.php | 4 +- .../Form/Type/Select2MaritalStatusType.php | 8 +- .../Household/MembersEditor.php | 5 +- .../Household/MembersEditorFactory.php | 6 +- .../Menu/SectionMenuBuilder.php | 4 +- .../AccompanyingPeriodNotificationHandler.php | 4 +- ...kEvaluationDocumentNotificationHandler.php | 4 +- ...ompanyingPeriodWorkNotificationHandler.php | 4 +- .../AccompanyingPeriodPrivacyEvent.php | 4 +- .../Privacy/PrivacyEvent.php | 4 +- .../AccompanyingPeriodInfoRepository.php | 2 +- ...PeriodWorkEvaluationDocumentRepository.php | 2 +- ...mpanyingPeriodWorkEvaluationRepository.php | 2 +- .../AccompanyingPeriodWorkRepository.php | 4 +- .../ClosingMotiveRepository.php | 2 +- .../AccompanyingPeriodACLAwareRepository.php | 11 +-- ...nyingPeriodACLAwareRepositoryInterface.php | 6 +- .../AccompanyingPeriodRepository.php | 4 +- .../Household/HouseholdACLAwareRepository.php | 4 +- .../HouseholdCompositionRepository.php | 4 +- ...ouseholdCompositionRepositoryInterface.php | 4 +- .../HouseholdCompositionTypeRepository.php | 2 +- ...holdCompositionTypeRepositoryInterface.php | 2 +- .../Household/HouseholdRepository.php | 2 +- .../PersonHouseholdAddressRepository.php | 4 +- .../Household/PositionRepository.php | 2 +- .../Repository/MaritalStatusRepository.php | 2 +- .../MaritalStatusRepositoryInterface.php | 2 +- .../Person/PersonCenterHistoryInterface.php | 4 +- .../Person/PersonCenterHistoryRepository.php | 2 +- .../Repository/PersonACLAwareRepository.php | 84 ++++++++++--------- .../PersonACLAwareRepositoryInterface.php | 60 ++++++------- .../Repository/PersonRepository.php | 4 +- .../Repository/PersonResourceRepository.php | 4 +- .../Relationships/RelationRepository.php | 2 +- .../Relationships/RelationshipRepository.php | 2 +- .../ResidentialAddressRepository.php | 4 +- .../SocialWork/EvaluationRepository.php | 4 +- .../EvaluationRepositoryInterface.php | 4 +- .../Repository/SocialWork/GoalRepository.php | 6 +- .../SocialWork/ResultRepository.php | 8 +- .../SocialWork/SocialActionRepository.php | 6 +- .../SocialWork/SocialIssueRepository.php | 4 +- .../ChillPersonBundle/Search/PersonSearch.php | 4 +- .../Search/SearchHouseholdApiProvider.php | 4 +- .../Search/SearchPersonApiProvider.php | 4 +- .../AccompanyingPeriodCommentVoter.php | 4 +- .../AccompanyingPeriodResourceVoter.php | 4 +- ...nyingPeriodWorkEvaluationDocumentVoter.php | 4 +- .../AccompanyingPeriodWorkEvaluationVoter.php | 4 +- .../AccompanyingPeriodDocGenNormalizer.php | 4 +- .../AccompanyingPeriodResourceNormalizer.php | 4 +- .../AccompanyingPeriodWorkDenormalizer.php | 4 +- ...PeriodWorkEvaluationDocumentNormalizer.php | 8 +- ...mpanyingPeriodWorkEvaluationNormalizer.php | 8 +- .../AccompanyingPeriodWorkNormalizer.php | 20 +++-- .../Normalizer/MembersEditorNormalizer.php | 4 +- .../Normalizer/PersonDocGenNormalizer.php | 4 +- .../Normalizer/PersonJsonNormalizer.php | 3 +- .../PersonJsonNormalizerInterface.php | 4 +- .../RelationshipDocGenNormalizer.php | 4 +- .../Normalizer/SocialActionNormalizer.php | 4 +- .../Normalizer/SocialIssueNormalizer.php | 4 +- .../Normalizer/WorkflowNormalizer.php | 8 +- .../OldDraftAccompanyingPeriodRemover.php | 4 +- .../AccompanyingPeriodContext.php | 3 +- .../AccompanyingPeriodWorkContext.php | 4 +- ...ccompanyingPeriodWorkEvaluationContext.php | 4 +- .../PersonContextWithThirdParty.php | 3 +- ...companyingPeriodViewEntityInfoProvider.php | 3 +- ...PeriodWorkEvaluationGenericDocProvider.php | 9 +- ...PeriodWorkEvaluationGenericDocRenderer.php | 3 +- .../Service/Import/SocialWorkMetadata.php | 4 +- .../Import/SocialWorkMetadataInterface.php | 4 +- .../Templating/Entity/ClosingMotiveRender.php | 3 +- .../Templating/Entity/PersonRender.php | 4 +- .../Entity/PersonRenderInterface.php | 4 +- .../Templating/Entity/ResourceKindRender.php | 4 +- .../Templating/Entity/SocialActionRender.php | 4 +- .../Templating/Entity/SocialIssueRender.php | 4 +- .../Events/PersonMoveEventSubscriberTest.php | 8 +- ...cialIssueConsistencyEntityListenerTest.php | 4 +- .../PersonAddressControllerTest.php | 2 +- .../Controller/PersonControllerCreateTest.php | 4 +- .../Controller/PersonControllerUpdateTest.php | 4 +- ...onControllerUpdateWithHiddenFieldsTest.php | 4 +- ...rsonControllerViewWithHiddenFieldsTest.php | 4 +- ...ingPeriodWorkAssociatePersonOnWorkTest.php | 2 +- .../Tests/Household/MembersEditorTest.php | 4 +- ...companyingPeriodACLAwareRepositoryTest.php | 2 +- .../Authorization/PersonVoterTest.php | 2 +- .../Normalizer/PersonDocGenNormalizerTest.php | 22 ++--- .../DocGenerator/PersonContextTest.php | 28 +++---- ...odWorkEvaluationGenericDocProviderTest.php | 6 +- .../AbstractTimelineAccompanyingPeriod.php | 4 +- .../AccompanyingPeriodValidityValidator.php | 4 +- .../LocationValidityValidator.php | 4 +- .../ParticipationOverlapValidator.php | 4 +- .../ResourceDuplicateCheckValidator.php | 4 +- ...HouseholdMembershipSequentialValidator.php | 4 +- .../RelationshipNoDuplicateValidator.php | 4 +- .../Widget/PersonListWidget.php | 4 +- ...dWorkEvaluationDocumentWorkflowHandler.php | 4 +- ...ingPeriodWorkEvaluationWorkflowHandler.php | 4 +- .../AccompanyingPeriodWorkWorkflowHandler.php | 4 +- .../migrations/Version20160422000000.php | 4 +- .../migrations/Version20210419112619.php | 4 +- .../migrations/Version20231121070151.php | 4 +- .../ChillReportBundle/ChillReportBundle.php | 4 +- .../Controller/ReportController.php | 19 +++-- .../ChillReportBundle/Entity/Report.php | 8 +- .../Export/Export/ReportList.php | 4 +- .../Export/Filter/ReportDateFilter.php | 4 +- .../ChillReportBundle/Form/ReportType.php | 2 +- .../ChillReportBundle/Search/ReportSearch.php | 2 +- .../Controller/ReportControllerNextTest.php | 4 +- .../Tests/Controller/ReportControllerTest.php | 12 +-- .../Authorization/ReportVoterTest.php | 8 +- .../Tests/Timeline/TimelineProviderTest.php | 4 +- .../Timeline/TimelineReportProvider.php | 4 +- .../migrations/Version20150622233319.php | 4 +- .../Controller/SingleTaskController.php | 5 +- .../ChillTaskBundle/Entity/AbstractTask.php | 10 +-- .../ChillTaskBundle/Entity/SingleTask.php | 10 +-- .../Entity/Task/AbstractTaskPlaceEvent.php | 2 +- .../Entity/Task/SingleTaskPlaceEvent.php | 2 +- .../ChillTaskBundle/Form/SingleTaskType.php | 4 +- .../Repository/AbstractTaskRepository.php | 4 +- .../Repository/RecurringTaskRepository.php | 4 +- .../SingleTaskAclAwareRepository.php | 28 ++++--- .../SingleTaskAclAwareRepositoryInterface.php | 16 ++-- .../Repository/SingleTaskRepository.php | 4 +- .../Repository/SingleTaskStateRepository.php | 3 +- .../Authorization/AuthorizationEvent.php | 5 +- .../Templating/TaskTwigExtension.php | 2 +- .../Tests/Controller/TaskControllerTest.php | 4 +- .../TaskLifeCycleEventTimelineProvider.php | 4 +- .../Workflow/TaskWorkflowDefinition.php | 4 +- .../Workflow/TaskWorkflowManager.php | 2 +- .../Controller/ThirdPartyController.php | 6 +- .../ChillThirdPartyExtension.php | 12 +-- .../Entity/ThirdParty.php | 10 +-- .../Export/Helper/LabelThirdPartyHelper.php | 4 +- .../Form/ThirdPartyType.php | 2 +- .../Type/PickThirdPartyTypeCategoryType.php | 4 +- .../Form/Type/PickThirdpartyDynamicType.php | 4 +- .../ThirdPartyACLAwareRepository.php | 10 ++- .../Repository/ThirdPartyRepository.php | 4 +- .../Search/ThirdPartyApiSearch.php | 8 +- .../Normalizer/ThirdPartyNormalizer.php | 4 +- .../Templating/Entity/ThirdPartyRender.php | 4 +- .../ChillWopiBundle/src/ChillWopiBundle.php | 4 +- .../ChillWopiBundle/src/Controller/Editor.php | 4 +- .../src/Resources/config/routes/routes.php | 2 +- .../src/Service/Controller/Responder.php | 6 +- .../Service/Controller/ResponderInterface.php | 2 +- .../src/Service/Wopi/AuthorizationManager.php | 4 +- .../Service/Wopi/ChillDocumentLockManager.php | 3 +- .../src/Service/Wopi/ChillWopi.php | 4 +- .../src/Service/Wopi/UserManager.php | 4 +- ...aultDataOnExportFilterAggregatorRector.php | 3 +- .../config/config.php | 2 +- 871 files changed, 2795 insertions(+), 1567 deletions(-) diff --git a/src/Bundle/ChillActivityBundle/ChillActivityBundle.php b/src/Bundle/ChillActivityBundle/ChillActivityBundle.php index a85ddbb75..5f872a7dc 100644 --- a/src/Bundle/ChillActivityBundle/ChillActivityBundle.php +++ b/src/Bundle/ChillActivityBundle/ChillActivityBundle.php @@ -13,4 +13,6 @@ namespace Chill\ActivityBundle; use Symfony\Component\HttpKernel\Bundle\Bundle; -class ChillActivityBundle extends Bundle {} +class ChillActivityBundle extends Bundle +{ +} diff --git a/src/Bundle/ChillActivityBundle/Controller/ActivityController.php b/src/Bundle/ChillActivityBundle/Controller/ActivityController.php index 06489010c..153b87f44 100644 --- a/src/Bundle/ChillActivityBundle/Controller/ActivityController.php +++ b/src/Bundle/ChillActivityBundle/Controller/ActivityController.php @@ -67,7 +67,8 @@ final class ActivityController extends AbstractController private readonly FilterOrderHelperFactoryInterface $filterOrderHelperFactory, private readonly TranslatableStringHelperInterface $translatableStringHelper, private readonly PaginatorFactory $paginatorFactory, - ) {} + ) { + } /** * Deletes a Activity entity. @@ -673,8 +674,8 @@ final class ActivityController extends AbstractController throw $this->createNotFoundException('Accompanying Period not found'); } - // TODO Add permission - // $this->denyAccessUnlessGranted('CHILL_PERSON_SEE', $person); + // TODO Add permission + // $this->denyAccessUnlessGranted('CHILL_PERSON_SEE', $person); } else { throw $this->createNotFoundException('Person or Accompanying Period not found'); } diff --git a/src/Bundle/ChillActivityBundle/Controller/ActivityReasonCategoryController.php b/src/Bundle/ChillActivityBundle/Controller/ActivityReasonCategoryController.php index 6d0b825cc..ce9dc64b3 100644 --- a/src/Bundle/ChillActivityBundle/Controller/ActivityReasonCategoryController.php +++ b/src/Bundle/ChillActivityBundle/Controller/ActivityReasonCategoryController.php @@ -56,7 +56,7 @@ class ActivityReasonCategoryController extends AbstractController { $em = $this->getDoctrine()->getManager(); - $entity = $em->getRepository(\Chill\ActivityBundle\Entity\ActivityReasonCategory::class)->find($id); + $entity = $em->getRepository(ActivityReasonCategory::class)->find($id); if (!$entity) { throw $this->createNotFoundException('Unable to find ActivityReasonCategory entity.'); @@ -79,7 +79,7 @@ class ActivityReasonCategoryController extends AbstractController { $em = $this->getDoctrine()->getManager(); - $entities = $em->getRepository(\Chill\ActivityBundle\Entity\ActivityReasonCategory::class)->findAll(); + $entities = $em->getRepository(ActivityReasonCategory::class)->findAll(); return $this->render('@ChillActivity/ActivityReasonCategory/index.html.twig', [ 'entities' => $entities, @@ -111,7 +111,7 @@ class ActivityReasonCategoryController extends AbstractController { $em = $this->getDoctrine()->getManager(); - $entity = $em->getRepository(\Chill\ActivityBundle\Entity\ActivityReasonCategory::class)->find($id); + $entity = $em->getRepository(ActivityReasonCategory::class)->find($id); if (!$entity) { throw $this->createNotFoundException('Unable to find ActivityReasonCategory entity.'); @@ -131,7 +131,7 @@ class ActivityReasonCategoryController extends AbstractController { $em = $this->getDoctrine()->getManager(); - $entity = $em->getRepository(\Chill\ActivityBundle\Entity\ActivityReasonCategory::class)->find($id); + $entity = $em->getRepository(ActivityReasonCategory::class)->find($id); if (!$entity) { throw $this->createNotFoundException('Unable to find ActivityReasonCategory entity.'); diff --git a/src/Bundle/ChillActivityBundle/Controller/ActivityReasonController.php b/src/Bundle/ChillActivityBundle/Controller/ActivityReasonController.php index 141398cc4..323b27d25 100644 --- a/src/Bundle/ChillActivityBundle/Controller/ActivityReasonController.php +++ b/src/Bundle/ChillActivityBundle/Controller/ActivityReasonController.php @@ -24,7 +24,9 @@ use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; */ class ActivityReasonController extends AbstractController { - public function __construct(private readonly ActivityReasonRepository $activityReasonRepository) {} + public function __construct(private readonly ActivityReasonRepository $activityReasonRepository) + { + } /** * Creates a new ActivityReason entity. @@ -60,7 +62,7 @@ class ActivityReasonController extends AbstractController { $em = $this->getDoctrine()->getManager(); - $entity = $em->getRepository(\Chill\ActivityBundle\Entity\ActivityReason::class)->find($id); + $entity = $em->getRepository(ActivityReason::class)->find($id); if (null === $entity) { throw new NotFoundHttpException('Unable to find ActivityReason entity.'); @@ -115,7 +117,7 @@ class ActivityReasonController extends AbstractController { $em = $this->getDoctrine()->getManager(); - $entity = $em->getRepository(\Chill\ActivityBundle\Entity\ActivityReason::class)->find($id); + $entity = $em->getRepository(ActivityReason::class)->find($id); if (!$entity) { throw $this->createNotFoundException('Unable to find ActivityReason entity.'); @@ -135,7 +137,7 @@ class ActivityReasonController extends AbstractController { $em = $this->getDoctrine()->getManager(); - $entity = $em->getRepository(\Chill\ActivityBundle\Entity\ActivityReason::class)->find($id); + $entity = $em->getRepository(ActivityReason::class)->find($id); if (!$entity) { throw $this->createNotFoundException('Unable to find ActivityReason entity.'); diff --git a/src/Bundle/ChillActivityBundle/EntityListener/ActivityEntityListener.php b/src/Bundle/ChillActivityBundle/EntityListener/ActivityEntityListener.php index 31fac3be8..fd9899c0b 100644 --- a/src/Bundle/ChillActivityBundle/EntityListener/ActivityEntityListener.php +++ b/src/Bundle/ChillActivityBundle/EntityListener/ActivityEntityListener.php @@ -19,7 +19,9 @@ use Doctrine\ORM\EntityManagerInterface; class ActivityEntityListener { - public function __construct(private readonly EntityManagerInterface $em, private readonly AccompanyingPeriodWorkRepository $workRepository) {} + public function __construct(private readonly EntityManagerInterface $em, private readonly AccompanyingPeriodWorkRepository $workRepository) + { + } public function persistActionToCourse(Activity $activity) { diff --git a/src/Bundle/ChillActivityBundle/Export/Aggregator/ACPAggregators/ByActivityTypeAggregator.php b/src/Bundle/ChillActivityBundle/Export/Aggregator/ACPAggregators/ByActivityTypeAggregator.php index cdb66bb77..0f41547d9 100644 --- a/src/Bundle/ChillActivityBundle/Export/Aggregator/ACPAggregators/ByActivityTypeAggregator.php +++ b/src/Bundle/ChillActivityBundle/Export/Aggregator/ACPAggregators/ByActivityTypeAggregator.php @@ -31,7 +31,8 @@ final readonly class ByActivityTypeAggregator implements AggregatorInterface private RollingDateConverterInterface $rollingDateConverter, private ActivityTypeRepositoryInterface $activityTypeRepository, private TranslatableStringHelperInterface $translatableStringHelper, - ) {} + ) { + } public function buildForm(FormBuilderInterface $builder) { @@ -56,7 +57,7 @@ final readonly class ByActivityTypeAggregator implements AggregatorInterface public function getLabels($key, array $values, mixed $data) { - return function (null|int|string $value): string { + return function (int|string|null $value): string { if ('_header' === $value) { return 'export.aggregator.acp.by_activity_type.activity_type'; } diff --git a/src/Bundle/ChillActivityBundle/Export/Aggregator/ACPAggregators/BySocialActionAggregator.php b/src/Bundle/ChillActivityBundle/Export/Aggregator/ACPAggregators/BySocialActionAggregator.php index 9282f92e4..157f4c023 100644 --- a/src/Bundle/ChillActivityBundle/Export/Aggregator/ACPAggregators/BySocialActionAggregator.php +++ b/src/Bundle/ChillActivityBundle/Export/Aggregator/ACPAggregators/BySocialActionAggregator.php @@ -20,7 +20,9 @@ use Symfony\Component\Form\FormBuilderInterface; class BySocialActionAggregator implements AggregatorInterface { - public function __construct(private readonly SocialActionRender $actionRender, private readonly SocialActionRepository $actionRepository) {} + public function __construct(private readonly SocialActionRender $actionRender, private readonly SocialActionRepository $actionRepository) + { + } public function addRole(): ?string { diff --git a/src/Bundle/ChillActivityBundle/Export/Aggregator/ACPAggregators/BySocialIssueAggregator.php b/src/Bundle/ChillActivityBundle/Export/Aggregator/ACPAggregators/BySocialIssueAggregator.php index bbdadf4d6..94f6506d1 100644 --- a/src/Bundle/ChillActivityBundle/Export/Aggregator/ACPAggregators/BySocialIssueAggregator.php +++ b/src/Bundle/ChillActivityBundle/Export/Aggregator/ACPAggregators/BySocialIssueAggregator.php @@ -20,7 +20,9 @@ use Symfony\Component\Form\FormBuilderInterface; class BySocialIssueAggregator implements AggregatorInterface { - public function __construct(private readonly SocialIssueRepository $issueRepository, private readonly SocialIssueRender $issueRender) {} + public function __construct(private readonly SocialIssueRepository $issueRepository, private readonly SocialIssueRender $issueRender) + { + } public function addRole(): ?string { diff --git a/src/Bundle/ChillActivityBundle/Export/Aggregator/ActivityPresenceAggregator.php b/src/Bundle/ChillActivityBundle/Export/Aggregator/ActivityPresenceAggregator.php index 17e16357a..392ff5b19 100644 --- a/src/Bundle/ChillActivityBundle/Export/Aggregator/ActivityPresenceAggregator.php +++ b/src/Bundle/ChillActivityBundle/Export/Aggregator/ActivityPresenceAggregator.php @@ -20,9 +20,13 @@ use Symfony\Component\Form\FormBuilderInterface; final readonly class ActivityPresenceAggregator implements AggregatorInterface { - public function __construct(private ActivityPresenceRepositoryInterface $activityPresenceRepository, private TranslatableStringHelperInterface $translatableStringHelper) {} + public function __construct(private ActivityPresenceRepositoryInterface $activityPresenceRepository, private TranslatableStringHelperInterface $translatableStringHelper) + { + } - public function buildForm(FormBuilderInterface $builder) {} + public function buildForm(FormBuilderInterface $builder) + { + } public function getFormDefaultData(): array { @@ -31,7 +35,7 @@ final readonly class ActivityPresenceAggregator implements AggregatorInterface public function getLabels($key, array $values, mixed $data) { - return function (null|int|string $value): string { + return function (int|string|null $value): string { if ('_header' === $value) { return 'export.aggregator.activity.by_activity_presence.header'; } diff --git a/src/Bundle/ChillActivityBundle/Export/Aggregator/ActivityTypeAggregator.php b/src/Bundle/ChillActivityBundle/Export/Aggregator/ActivityTypeAggregator.php index 2c7891dd6..d433e6a86 100644 --- a/src/Bundle/ChillActivityBundle/Export/Aggregator/ActivityTypeAggregator.php +++ b/src/Bundle/ChillActivityBundle/Export/Aggregator/ActivityTypeAggregator.php @@ -22,7 +22,9 @@ class ActivityTypeAggregator implements AggregatorInterface { final public const KEY = 'activity_type_aggregator'; - public function __construct(protected ActivityTypeRepositoryInterface $activityTypeRepository, protected TranslatableStringHelperInterface $translatableStringHelper) {} + public function __construct(protected ActivityTypeRepositoryInterface $activityTypeRepository, protected TranslatableStringHelperInterface $translatableStringHelper) + { + } public function addRole(): ?string { @@ -56,7 +58,7 @@ class ActivityTypeAggregator implements AggregatorInterface public function getLabels($key, array $values, $data): \Closure { - return function (null|int|string $value): string { + return function (int|string|null $value): string { if ('_header' === $value) { return 'Activity type'; } diff --git a/src/Bundle/ChillActivityBundle/Export/Aggregator/ActivityUserAggregator.php b/src/Bundle/ChillActivityBundle/Export/Aggregator/ActivityUserAggregator.php index 61452af22..46b931243 100644 --- a/src/Bundle/ChillActivityBundle/Export/Aggregator/ActivityUserAggregator.php +++ b/src/Bundle/ChillActivityBundle/Export/Aggregator/ActivityUserAggregator.php @@ -22,7 +22,9 @@ class ActivityUserAggregator implements AggregatorInterface { final public const KEY = 'activity_user_id'; - public function __construct(private readonly UserRepository $userRepository, private readonly UserRender $userRender) {} + public function __construct(private readonly UserRepository $userRepository, private readonly UserRender $userRender) + { + } public function addRole(): ?string { diff --git a/src/Bundle/ChillActivityBundle/Export/Aggregator/ActivityUsersAggregator.php b/src/Bundle/ChillActivityBundle/Export/Aggregator/ActivityUsersAggregator.php index cc4ab9d14..c8ef24332 100644 --- a/src/Bundle/ChillActivityBundle/Export/Aggregator/ActivityUsersAggregator.php +++ b/src/Bundle/ChillActivityBundle/Export/Aggregator/ActivityUsersAggregator.php @@ -20,7 +20,9 @@ use Symfony\Component\Form\FormBuilderInterface; class ActivityUsersAggregator implements AggregatorInterface { - public function __construct(private readonly UserRepositoryInterface $userRepository, private readonly UserRender $userRender) {} + public function __construct(private readonly UserRepositoryInterface $userRepository, private readonly UserRender $userRender) + { + } public function addRole(): ?string { diff --git a/src/Bundle/ChillActivityBundle/Export/Aggregator/ActivityUsersJobAggregator.php b/src/Bundle/ChillActivityBundle/Export/Aggregator/ActivityUsersJobAggregator.php index 3628206ec..591406d59 100644 --- a/src/Bundle/ChillActivityBundle/Export/Aggregator/ActivityUsersJobAggregator.php +++ b/src/Bundle/ChillActivityBundle/Export/Aggregator/ActivityUsersJobAggregator.php @@ -27,7 +27,8 @@ class ActivityUsersJobAggregator implements AggregatorInterface public function __construct( private readonly UserJobRepositoryInterface $userJobRepository, private readonly TranslatableStringHelperInterface $translatableStringHelper - ) {} + ) { + } public function addRole(): ?string { @@ -65,7 +66,9 @@ class ActivityUsersJobAggregator implements AggregatorInterface return Declarations::ACTIVITY; } - public function buildForm(FormBuilderInterface $builder) {} + public function buildForm(FormBuilderInterface $builder) + { + } public function getFormDefaultData(): array { diff --git a/src/Bundle/ChillActivityBundle/Export/Aggregator/ActivityUsersScopeAggregator.php b/src/Bundle/ChillActivityBundle/Export/Aggregator/ActivityUsersScopeAggregator.php index bffce629f..c5d9175b4 100644 --- a/src/Bundle/ChillActivityBundle/Export/Aggregator/ActivityUsersScopeAggregator.php +++ b/src/Bundle/ChillActivityBundle/Export/Aggregator/ActivityUsersScopeAggregator.php @@ -27,7 +27,8 @@ class ActivityUsersScopeAggregator implements AggregatorInterface public function __construct( private readonly ScopeRepositoryInterface $scopeRepository, private readonly TranslatableStringHelperInterface $translatableStringHelper - ) {} + ) { + } public function addRole(): ?string { @@ -65,7 +66,9 @@ class ActivityUsersScopeAggregator implements AggregatorInterface return Declarations::ACTIVITY; } - public function buildForm(FormBuilderInterface $builder) {} + public function buildForm(FormBuilderInterface $builder) + { + } public function getFormDefaultData(): array { diff --git a/src/Bundle/ChillActivityBundle/Export/Aggregator/ByCreatorAggregator.php b/src/Bundle/ChillActivityBundle/Export/Aggregator/ByCreatorAggregator.php index 09bdab89e..4e8ec44b0 100644 --- a/src/Bundle/ChillActivityBundle/Export/Aggregator/ByCreatorAggregator.php +++ b/src/Bundle/ChillActivityBundle/Export/Aggregator/ByCreatorAggregator.php @@ -20,7 +20,9 @@ use Symfony\Component\Form\FormBuilderInterface; class ByCreatorAggregator implements AggregatorInterface { - public function __construct(private readonly UserRepositoryInterface $userRepository, private readonly UserRender $userRender) {} + public function __construct(private readonly UserRepositoryInterface $userRepository, private readonly UserRender $userRender) + { + } public function addRole(): ?string { diff --git a/src/Bundle/ChillActivityBundle/Export/Aggregator/ByThirdpartyAggregator.php b/src/Bundle/ChillActivityBundle/Export/Aggregator/ByThirdpartyAggregator.php index 13224bade..15762a4f0 100644 --- a/src/Bundle/ChillActivityBundle/Export/Aggregator/ByThirdpartyAggregator.php +++ b/src/Bundle/ChillActivityBundle/Export/Aggregator/ByThirdpartyAggregator.php @@ -20,7 +20,9 @@ use Symfony\Component\Form\FormBuilderInterface; class ByThirdpartyAggregator implements AggregatorInterface { - public function __construct(private readonly ThirdPartyRepository $thirdPartyRepository, private readonly ThirdPartyRender $thirdPartyRender) {} + public function __construct(private readonly ThirdPartyRepository $thirdPartyRepository, private readonly ThirdPartyRender $thirdPartyRender) + { + } public function addRole(): ?string { diff --git a/src/Bundle/ChillActivityBundle/Export/Aggregator/CreatorJobAggregator.php b/src/Bundle/ChillActivityBundle/Export/Aggregator/CreatorJobAggregator.php index d57670e7f..98960aec6 100644 --- a/src/Bundle/ChillActivityBundle/Export/Aggregator/CreatorJobAggregator.php +++ b/src/Bundle/ChillActivityBundle/Export/Aggregator/CreatorJobAggregator.php @@ -27,7 +27,8 @@ class CreatorJobAggregator implements AggregatorInterface public function __construct( private readonly UserJobRepositoryInterface $userJobRepository, private readonly TranslatableStringHelper $translatableStringHelper - ) {} + ) { + } public function addRole(): ?string { @@ -65,7 +66,9 @@ class CreatorJobAggregator implements AggregatorInterface return Declarations::ACTIVITY; } - public function buildForm(FormBuilderInterface $builder) {} + public function buildForm(FormBuilderInterface $builder) + { + } public function getFormDefaultData(): array { diff --git a/src/Bundle/ChillActivityBundle/Export/Aggregator/CreatorScopeAggregator.php b/src/Bundle/ChillActivityBundle/Export/Aggregator/CreatorScopeAggregator.php index 6641f0807..f1fb4b2b6 100644 --- a/src/Bundle/ChillActivityBundle/Export/Aggregator/CreatorScopeAggregator.php +++ b/src/Bundle/ChillActivityBundle/Export/Aggregator/CreatorScopeAggregator.php @@ -27,7 +27,8 @@ class CreatorScopeAggregator implements AggregatorInterface public function __construct( private readonly ScopeRepository $scopeRepository, private readonly TranslatableStringHelper $translatableStringHelper - ) {} + ) { + } public function addRole(): ?string { @@ -65,7 +66,9 @@ class CreatorScopeAggregator implements AggregatorInterface return Declarations::ACTIVITY; } - public function buildForm(FormBuilderInterface $builder) {} + public function buildForm(FormBuilderInterface $builder) + { + } public function getFormDefaultData(): array { diff --git a/src/Bundle/ChillActivityBundle/Export/Aggregator/LocationTypeAggregator.php b/src/Bundle/ChillActivityBundle/Export/Aggregator/LocationTypeAggregator.php index da2d74f64..69c8a646c 100644 --- a/src/Bundle/ChillActivityBundle/Export/Aggregator/LocationTypeAggregator.php +++ b/src/Bundle/ChillActivityBundle/Export/Aggregator/LocationTypeAggregator.php @@ -20,7 +20,9 @@ use Symfony\Component\Form\FormBuilderInterface; class LocationTypeAggregator implements AggregatorInterface { - public function __construct(private readonly LocationTypeRepository $locationTypeRepository, private readonly TranslatableStringHelper $translatableStringHelper) {} + public function __construct(private readonly LocationTypeRepository $locationTypeRepository, private readonly TranslatableStringHelper $translatableStringHelper) + { + } public function addRole(): ?string { diff --git a/src/Bundle/ChillActivityBundle/Export/Aggregator/PersonAggregators/ActivityReasonAggregator.php b/src/Bundle/ChillActivityBundle/Export/Aggregator/PersonAggregators/ActivityReasonAggregator.php index f0364bf8e..569c4ca9a 100644 --- a/src/Bundle/ChillActivityBundle/Export/Aggregator/PersonAggregators/ActivityReasonAggregator.php +++ b/src/Bundle/ChillActivityBundle/Export/Aggregator/PersonAggregators/ActivityReasonAggregator.php @@ -25,7 +25,9 @@ use Symfony\Component\Validator\Context\ExecutionContextInterface; class ActivityReasonAggregator implements AggregatorInterface, ExportElementValidatedInterface { - public function __construct(protected ActivityReasonCategoryRepository $activityReasonCategoryRepository, protected ActivityReasonRepository $activityReasonRepository, protected TranslatableStringHelper $translatableStringHelper) {} + public function __construct(protected ActivityReasonCategoryRepository $activityReasonCategoryRepository, protected ActivityReasonRepository $activityReasonRepository, protected TranslatableStringHelper $translatableStringHelper) + { + } public function addRole(): ?string { diff --git a/src/Bundle/ChillActivityBundle/Export/Aggregator/PersonAggregators/PersonAggregator.php b/src/Bundle/ChillActivityBundle/Export/Aggregator/PersonAggregators/PersonAggregator.php index c7a3bd6b5..96c330071 100644 --- a/src/Bundle/ChillActivityBundle/Export/Aggregator/PersonAggregators/PersonAggregator.php +++ b/src/Bundle/ChillActivityBundle/Export/Aggregator/PersonAggregators/PersonAggregator.php @@ -19,7 +19,9 @@ use Symfony\Component\Form\FormBuilderInterface; final readonly class PersonAggregator implements AggregatorInterface { - public function __construct(private LabelPersonHelper $labelPersonHelper) {} + public function __construct(private LabelPersonHelper $labelPersonHelper) + { + } public function buildForm(FormBuilderInterface $builder) { diff --git a/src/Bundle/ChillActivityBundle/Export/Aggregator/PersonsAggregator.php b/src/Bundle/ChillActivityBundle/Export/Aggregator/PersonsAggregator.php index 8459741c5..18ca489e4 100644 --- a/src/Bundle/ChillActivityBundle/Export/Aggregator/PersonsAggregator.php +++ b/src/Bundle/ChillActivityBundle/Export/Aggregator/PersonsAggregator.php @@ -25,7 +25,9 @@ final readonly class PersonsAggregator implements AggregatorInterface { private const PREFIX = 'act_persons_agg'; - public function __construct(private LabelPersonHelper $labelPersonHelper) {} + public function __construct(private LabelPersonHelper $labelPersonHelper) + { + } public function buildForm(FormBuilderInterface $builder) { diff --git a/src/Bundle/ChillActivityBundle/Export/Aggregator/SentReceivedAggregator.php b/src/Bundle/ChillActivityBundle/Export/Aggregator/SentReceivedAggregator.php index 774968544..ec436ef61 100644 --- a/src/Bundle/ChillActivityBundle/Export/Aggregator/SentReceivedAggregator.php +++ b/src/Bundle/ChillActivityBundle/Export/Aggregator/SentReceivedAggregator.php @@ -19,7 +19,9 @@ use Symfony\Contracts\Translation\TranslatorInterface; class SentReceivedAggregator implements AggregatorInterface { - public function __construct(private readonly TranslatorInterface $translator) {} + public function __construct(private readonly TranslatorInterface $translator) + { + } public function addRole(): ?string { diff --git a/src/Bundle/ChillActivityBundle/Export/Export/LinkedToACP/AvgActivityDuration.php b/src/Bundle/ChillActivityBundle/Export/Export/LinkedToACP/AvgActivityDuration.php index d8b204e8c..96fdfa095 100644 --- a/src/Bundle/ChillActivityBundle/Export/Export/LinkedToACP/AvgActivityDuration.php +++ b/src/Bundle/ChillActivityBundle/Export/Export/LinkedToACP/AvgActivityDuration.php @@ -36,7 +36,9 @@ class AvgActivityDuration implements ExportInterface, GroupedExportInterface $this->filterStatsByCenters = $parameterBag->get('chill_main')['acl']['filter_stats_by_center']; } - public function buildForm(FormBuilderInterface $builder) {} + public function buildForm(FormBuilderInterface $builder) + { + } public function getFormDefaultData(): array { diff --git a/src/Bundle/ChillActivityBundle/Export/Export/LinkedToACP/CountActivity.php b/src/Bundle/ChillActivityBundle/Export/Export/LinkedToACP/CountActivity.php index dfd5d966f..6497a232a 100644 --- a/src/Bundle/ChillActivityBundle/Export/Export/LinkedToACP/CountActivity.php +++ b/src/Bundle/ChillActivityBundle/Export/Export/LinkedToACP/CountActivity.php @@ -41,7 +41,9 @@ class CountActivity implements ExportInterface, GroupedExportInterface $this->filterStatsByCenters = $parameterBag->get('chill_main')['acl']['filter_stats_by_center']; } - public function buildForm(FormBuilderInterface $builder) {} + public function buildForm(FormBuilderInterface $builder) + { + } public function getFormDefaultData(): array { diff --git a/src/Bundle/ChillActivityBundle/Export/Export/LinkedToACP/CountHouseholdOnActivity.php b/src/Bundle/ChillActivityBundle/Export/Export/LinkedToACP/CountHouseholdOnActivity.php index 41c05494c..fc22c8edd 100644 --- a/src/Bundle/ChillActivityBundle/Export/Export/LinkedToACP/CountHouseholdOnActivity.php +++ b/src/Bundle/ChillActivityBundle/Export/Export/LinkedToACP/CountHouseholdOnActivity.php @@ -42,7 +42,9 @@ final readonly class CountHouseholdOnActivity implements ExportInterface, Groupe $this->filterStatsByCenters = $parameterBag->get('chill_main')['acl']['filter_stats_by_center']; } - public function buildForm(FormBuilderInterface $builder) {} + public function buildForm(FormBuilderInterface $builder) + { + } public function getFormDefaultData(): array { diff --git a/src/Bundle/ChillActivityBundle/Export/Export/LinkedToACP/CountPersonsOnActivity.php b/src/Bundle/ChillActivityBundle/Export/Export/LinkedToACP/CountPersonsOnActivity.php index c49b9d4ad..26432fc0b 100644 --- a/src/Bundle/ChillActivityBundle/Export/Export/LinkedToACP/CountPersonsOnActivity.php +++ b/src/Bundle/ChillActivityBundle/Export/Export/LinkedToACP/CountPersonsOnActivity.php @@ -41,7 +41,9 @@ class CountPersonsOnActivity implements ExportInterface, GroupedExportInterface $this->filterStatsByCenters = $parameterBag->get('chill_main')['acl']['filter_stats_by_center']; } - public function buildForm(FormBuilderInterface $builder) {} + public function buildForm(FormBuilderInterface $builder) + { + } public function getFormDefaultData(): array { diff --git a/src/Bundle/ChillActivityBundle/Export/Export/LinkedToACP/ListActivity.php b/src/Bundle/ChillActivityBundle/Export/Export/LinkedToACP/ListActivity.php index aab2d7db8..fc9a44889 100644 --- a/src/Bundle/ChillActivityBundle/Export/Export/LinkedToACP/ListActivity.php +++ b/src/Bundle/ChillActivityBundle/Export/Export/LinkedToACP/ListActivity.php @@ -31,7 +31,8 @@ final readonly class ListActivity implements ListInterface, GroupedExportInterfa private EntityManagerInterface $entityManager, private TranslatableStringExportLabelHelper $translatableStringExportLabelHelper, private FilterListAccompanyingPeriodHelperInterface $filterListAccompanyingPeriodHelper, - ) {} + ) { + } public function buildForm(FormBuilderInterface $builder) { diff --git a/src/Bundle/ChillActivityBundle/Export/Export/LinkedToPerson/CountActivity.php b/src/Bundle/ChillActivityBundle/Export/Export/LinkedToPerson/CountActivity.php index e0a95b1f5..7614039b0 100644 --- a/src/Bundle/ChillActivityBundle/Export/Export/LinkedToPerson/CountActivity.php +++ b/src/Bundle/ChillActivityBundle/Export/Export/LinkedToPerson/CountActivity.php @@ -33,7 +33,9 @@ class CountActivity implements ExportInterface, GroupedExportInterface $this->filterStatsByCenters = $parameterBag->get('chill_main')['acl']['filter_stats_by_center']; } - public function buildForm(FormBuilderInterface $builder) {} + public function buildForm(FormBuilderInterface $builder) + { + } public function getFormDefaultData(): array { diff --git a/src/Bundle/ChillActivityBundle/Export/Export/LinkedToPerson/CountHouseholdOnActivity.php b/src/Bundle/ChillActivityBundle/Export/Export/LinkedToPerson/CountHouseholdOnActivity.php index 31111a083..46466d883 100644 --- a/src/Bundle/ChillActivityBundle/Export/Export/LinkedToPerson/CountHouseholdOnActivity.php +++ b/src/Bundle/ChillActivityBundle/Export/Export/LinkedToPerson/CountHouseholdOnActivity.php @@ -34,7 +34,9 @@ final readonly class CountHouseholdOnActivity implements ExportInterface, Groupe $this->filterStatsByCenters = $parameterBag->get('chill_main')['acl']['filter_stats_by_center']; } - public function buildForm(FormBuilderInterface $builder) {} + public function buildForm(FormBuilderInterface $builder) + { + } public function getFormDefaultData(): array { diff --git a/src/Bundle/ChillActivityBundle/Export/Export/LinkedToPerson/StatActivityDuration.php b/src/Bundle/ChillActivityBundle/Export/Export/LinkedToPerson/StatActivityDuration.php index 3cdadac67..491d1c094 100644 --- a/src/Bundle/ChillActivityBundle/Export/Export/LinkedToPerson/StatActivityDuration.php +++ b/src/Bundle/ChillActivityBundle/Export/Export/LinkedToPerson/StatActivityDuration.php @@ -47,7 +47,9 @@ class StatActivityDuration implements ExportInterface, GroupedExportInterface $this->filterStatsByCenters = $parameterBag->get('chill_main')['acl']['filter_stats_by_center']; } - public function buildForm(FormBuilderInterface $builder) {} + public function buildForm(FormBuilderInterface $builder) + { + } public function getFormDefaultData(): array { diff --git a/src/Bundle/ChillActivityBundle/Export/Export/ListActivityHelper.php b/src/Bundle/ChillActivityBundle/Export/Export/ListActivityHelper.php index 75d2c3fd0..73b49e082 100644 --- a/src/Bundle/ChillActivityBundle/Export/Export/ListActivityHelper.php +++ b/src/Bundle/ChillActivityBundle/Export/Export/ListActivityHelper.php @@ -40,7 +40,8 @@ class ListActivityHelper private readonly TranslatableStringHelperInterface $translatableStringHelper, private readonly TranslatableStringExportLabelHelper $translatableStringLabelHelper, private readonly UserHelper $userHelper - ) {} + ) { + } public function addSelect(QueryBuilder $qb): void { @@ -74,7 +75,9 @@ class ListActivityHelper ->addGroupBy('location.id'); } - public function buildForm(FormBuilderInterface $builder) {} + public function buildForm(FormBuilderInterface $builder) + { + } public function getAllowedFormattersTypes() { diff --git a/src/Bundle/ChillActivityBundle/Export/Filter/ACPFilters/ActivityTypeFilter.php b/src/Bundle/ChillActivityBundle/Export/Filter/ACPFilters/ActivityTypeFilter.php index 7c6eb0bb2..89fe2e618 100644 --- a/src/Bundle/ChillActivityBundle/Export/Filter/ACPFilters/ActivityTypeFilter.php +++ b/src/Bundle/ChillActivityBundle/Export/Filter/ACPFilters/ActivityTypeFilter.php @@ -31,7 +31,8 @@ final readonly class ActivityTypeFilter implements FilterInterface private ActivityTypeRepositoryInterface $activityTypeRepository, private TranslatableStringHelperInterface $translatableStringHelper, private RollingDateConverterInterface $rollingDateConverter, - ) {} + ) { + } public function addRole(): ?string { diff --git a/src/Bundle/ChillActivityBundle/Export/Filter/ACPFilters/BySocialActionFilter.php b/src/Bundle/ChillActivityBundle/Export/Filter/ACPFilters/BySocialActionFilter.php index 13349baa5..3eb4e130e 100644 --- a/src/Bundle/ChillActivityBundle/Export/Filter/ACPFilters/BySocialActionFilter.php +++ b/src/Bundle/ChillActivityBundle/Export/Filter/ACPFilters/BySocialActionFilter.php @@ -21,7 +21,9 @@ use Symfony\Component\Form\FormBuilderInterface; class BySocialActionFilter implements FilterInterface { - public function __construct(private readonly SocialActionRender $actionRender) {} + public function __construct(private readonly SocialActionRender $actionRender) + { + } public function addRole(): ?string { diff --git a/src/Bundle/ChillActivityBundle/Export/Filter/ACPFilters/BySocialIssueFilter.php b/src/Bundle/ChillActivityBundle/Export/Filter/ACPFilters/BySocialIssueFilter.php index bef40290e..b482ac156 100644 --- a/src/Bundle/ChillActivityBundle/Export/Filter/ACPFilters/BySocialIssueFilter.php +++ b/src/Bundle/ChillActivityBundle/Export/Filter/ACPFilters/BySocialIssueFilter.php @@ -21,7 +21,9 @@ use Symfony\Component\Form\FormBuilderInterface; class BySocialIssueFilter implements FilterInterface { - public function __construct(private readonly SocialIssueRender $issueRender) {} + public function __construct(private readonly SocialIssueRender $issueRender) + { + } public function addRole(): ?string { diff --git a/src/Bundle/ChillActivityBundle/Export/Filter/ACPFilters/PeriodHavingActivityBetweenDatesFilter.php b/src/Bundle/ChillActivityBundle/Export/Filter/ACPFilters/PeriodHavingActivityBetweenDatesFilter.php index 2d3282ad1..77efa9a8b 100644 --- a/src/Bundle/ChillActivityBundle/Export/Filter/ACPFilters/PeriodHavingActivityBetweenDatesFilter.php +++ b/src/Bundle/ChillActivityBundle/Export/Filter/ACPFilters/PeriodHavingActivityBetweenDatesFilter.php @@ -23,7 +23,8 @@ final readonly class PeriodHavingActivityBetweenDatesFilter implements FilterInt { public function __construct( private RollingDateConverterInterface $rollingDateConverter, - ) {} + ) { + } public function getTitle() { diff --git a/src/Bundle/ChillActivityBundle/Export/Filter/ActivityDateFilter.php b/src/Bundle/ChillActivityBundle/Export/Filter/ActivityDateFilter.php index e3d7796d3..93e70076d 100644 --- a/src/Bundle/ChillActivityBundle/Export/Filter/ActivityDateFilter.php +++ b/src/Bundle/ChillActivityBundle/Export/Filter/ActivityDateFilter.php @@ -23,7 +23,9 @@ use Symfony\Contracts\Translation\TranslatorInterface; class ActivityDateFilter implements FilterInterface { - public function __construct(protected TranslatorInterface $translator, private readonly RollingDateConverterInterface $rollingDateConverter) {} + public function __construct(protected TranslatorInterface $translator, private readonly RollingDateConverterInterface $rollingDateConverter) + { + } public function addRole(): ?string { diff --git a/src/Bundle/ChillActivityBundle/Export/Filter/ActivityPresenceFilter.php b/src/Bundle/ChillActivityBundle/Export/Filter/ActivityPresenceFilter.php index 201b9f810..f1f1a668c 100644 --- a/src/Bundle/ChillActivityBundle/Export/Filter/ActivityPresenceFilter.php +++ b/src/Bundle/ChillActivityBundle/Export/Filter/ActivityPresenceFilter.php @@ -26,7 +26,8 @@ final readonly class ActivityPresenceFilter implements FilterInterface public function __construct( private TranslatableStringHelperInterface $translatableStringHelper, private TranslatorInterface $translator - ) {} + ) { + } public function getTitle() { diff --git a/src/Bundle/ChillActivityBundle/Export/Filter/ActivityTypeFilter.php b/src/Bundle/ChillActivityBundle/Export/Filter/ActivityTypeFilter.php index ae47146df..b59dfa301 100644 --- a/src/Bundle/ChillActivityBundle/Export/Filter/ActivityTypeFilter.php +++ b/src/Bundle/ChillActivityBundle/Export/Filter/ActivityTypeFilter.php @@ -27,7 +27,8 @@ class ActivityTypeFilter implements ExportElementValidatedInterface, FilterInter public function __construct( protected TranslatableStringHelperInterface $translatableStringHelper, protected ActivityTypeRepositoryInterface $activityTypeRepository - ) {} + ) { + } public function addRole(): ?string { diff --git a/src/Bundle/ChillActivityBundle/Export/Filter/ActivityUsersFilter.php b/src/Bundle/ChillActivityBundle/Export/Filter/ActivityUsersFilter.php index 56285c026..313ee7cbc 100644 --- a/src/Bundle/ChillActivityBundle/Export/Filter/ActivityUsersFilter.php +++ b/src/Bundle/ChillActivityBundle/Export/Filter/ActivityUsersFilter.php @@ -20,7 +20,9 @@ use Symfony\Component\Form\FormBuilderInterface; class ActivityUsersFilter implements FilterInterface { - public function __construct(private readonly UserRender $userRender) {} + public function __construct(private readonly UserRender $userRender) + { + } public function addRole(): ?string { diff --git a/src/Bundle/ChillActivityBundle/Export/Filter/ByCreatorFilter.php b/src/Bundle/ChillActivityBundle/Export/Filter/ByCreatorFilter.php index f75c5a817..8cb7db569 100644 --- a/src/Bundle/ChillActivityBundle/Export/Filter/ByCreatorFilter.php +++ b/src/Bundle/ChillActivityBundle/Export/Filter/ByCreatorFilter.php @@ -20,7 +20,9 @@ use Symfony\Component\Form\FormBuilderInterface; class ByCreatorFilter implements FilterInterface { - public function __construct(private readonly UserRender $userRender) {} + public function __construct(private readonly UserRender $userRender) + { + } public function addRole(): ?string { diff --git a/src/Bundle/ChillActivityBundle/Export/Filter/CreatorJobFilter.php b/src/Bundle/ChillActivityBundle/Export/Filter/CreatorJobFilter.php index 4288920e9..6ce340874 100644 --- a/src/Bundle/ChillActivityBundle/Export/Filter/CreatorJobFilter.php +++ b/src/Bundle/ChillActivityBundle/Export/Filter/CreatorJobFilter.php @@ -32,7 +32,8 @@ final readonly class CreatorJobFilter implements FilterInterface private TranslatableStringHelper $translatableStringHelper, private TranslatorInterface $translator, private UserJobRepositoryInterface $userJobRepository, - ) {} + ) { + } public function addRole(): ?string { diff --git a/src/Bundle/ChillActivityBundle/Export/Filter/CreatorScopeFilter.php b/src/Bundle/ChillActivityBundle/Export/Filter/CreatorScopeFilter.php index e5da96554..a6ab07ade 100644 --- a/src/Bundle/ChillActivityBundle/Export/Filter/CreatorScopeFilter.php +++ b/src/Bundle/ChillActivityBundle/Export/Filter/CreatorScopeFilter.php @@ -27,7 +27,8 @@ class CreatorScopeFilter implements FilterInterface public function __construct( private readonly TranslatableStringHelper $translatableStringHelper - ) {} + ) { + } public function addRole(): ?string { diff --git a/src/Bundle/ChillActivityBundle/Export/Filter/EmergencyFilter.php b/src/Bundle/ChillActivityBundle/Export/Filter/EmergencyFilter.php index b74be2552..eca62b79e 100644 --- a/src/Bundle/ChillActivityBundle/Export/Filter/EmergencyFilter.php +++ b/src/Bundle/ChillActivityBundle/Export/Filter/EmergencyFilter.php @@ -28,7 +28,9 @@ class EmergencyFilter implements FilterInterface private const DEFAULT_CHOICE = 'false'; - public function __construct(private readonly TranslatorInterface $translator) {} + public function __construct(private readonly TranslatorInterface $translator) + { + } public function addRole(): ?string { diff --git a/src/Bundle/ChillActivityBundle/Export/Filter/LocationTypeFilter.php b/src/Bundle/ChillActivityBundle/Export/Filter/LocationTypeFilter.php index 771dfca30..144e79913 100644 --- a/src/Bundle/ChillActivityBundle/Export/Filter/LocationTypeFilter.php +++ b/src/Bundle/ChillActivityBundle/Export/Filter/LocationTypeFilter.php @@ -21,7 +21,9 @@ use Symfony\Component\Form\FormBuilderInterface; class LocationTypeFilter implements FilterInterface { - public function __construct(private readonly TranslatableStringHelper $translatableStringHelper) {} + public function __construct(private readonly TranslatableStringHelper $translatableStringHelper) + { + } public function addRole(): ?string { diff --git a/src/Bundle/ChillActivityBundle/Export/Filter/PersonFilters/ActivityReasonFilter.php b/src/Bundle/ChillActivityBundle/Export/Filter/PersonFilters/ActivityReasonFilter.php index b8ce3259f..5e2ee5cbe 100644 --- a/src/Bundle/ChillActivityBundle/Export/Filter/PersonFilters/ActivityReasonFilter.php +++ b/src/Bundle/ChillActivityBundle/Export/Filter/PersonFilters/ActivityReasonFilter.php @@ -26,7 +26,9 @@ use Symfony\Component\Validator\Context\ExecutionContextInterface; class ActivityReasonFilter implements ExportElementValidatedInterface, FilterInterface { - public function __construct(protected TranslatableStringHelper $translatableStringHelper, protected ActivityReasonRepository $activityReasonRepository) {} + public function __construct(protected TranslatableStringHelper $translatableStringHelper, protected ActivityReasonRepository $activityReasonRepository) + { + } public function addRole(): ?string { diff --git a/src/Bundle/ChillActivityBundle/Export/Filter/PersonFilters/PersonHavingActivityBetweenDateFilter.php b/src/Bundle/ChillActivityBundle/Export/Filter/PersonFilters/PersonHavingActivityBetweenDateFilter.php index eb2312c0e..c424bec31 100644 --- a/src/Bundle/ChillActivityBundle/Export/Filter/PersonFilters/PersonHavingActivityBetweenDateFilter.php +++ b/src/Bundle/ChillActivityBundle/Export/Filter/PersonFilters/PersonHavingActivityBetweenDateFilter.php @@ -32,7 +32,8 @@ final readonly class PersonHavingActivityBetweenDateFilter implements ExportElem private TranslatableStringHelper $translatableStringHelper, private ActivityReasonRepository $activityReasonRepository, private RollingDateConverterInterface $rollingDateConverter, - ) {} + ) { + } public function addRole(): ?string { diff --git a/src/Bundle/ChillActivityBundle/Export/Filter/PersonsFilter.php b/src/Bundle/ChillActivityBundle/Export/Filter/PersonsFilter.php index 8bdefeb24..51dd60855 100644 --- a/src/Bundle/ChillActivityBundle/Export/Filter/PersonsFilter.php +++ b/src/Bundle/ChillActivityBundle/Export/Filter/PersonsFilter.php @@ -26,7 +26,9 @@ final readonly class PersonsFilter implements FilterInterface { private const PREFIX = 'act_persons_filter'; - public function __construct(private PersonRenderInterface $personRender) {} + public function __construct(private PersonRenderInterface $personRender) + { + } public function addRole(): ?string { diff --git a/src/Bundle/ChillActivityBundle/Export/Filter/SentReceivedFilter.php b/src/Bundle/ChillActivityBundle/Export/Filter/SentReceivedFilter.php index 3011627e8..6eee28790 100644 --- a/src/Bundle/ChillActivityBundle/Export/Filter/SentReceivedFilter.php +++ b/src/Bundle/ChillActivityBundle/Export/Filter/SentReceivedFilter.php @@ -29,7 +29,9 @@ class SentReceivedFilter implements FilterInterface private const DEFAULT_CHOICE = Activity::SENTRECEIVED_SENT; - public function __construct(private readonly TranslatorInterface $translator) {} + public function __construct(private readonly TranslatorInterface $translator) + { + } public function addRole(): ?string { diff --git a/src/Bundle/ChillActivityBundle/Export/Filter/UserFilter.php b/src/Bundle/ChillActivityBundle/Export/Filter/UserFilter.php index 6e6b745b9..54fb87b81 100644 --- a/src/Bundle/ChillActivityBundle/Export/Filter/UserFilter.php +++ b/src/Bundle/ChillActivityBundle/Export/Filter/UserFilter.php @@ -21,7 +21,9 @@ use Symfony\Component\Form\FormBuilderInterface; class UserFilter implements FilterInterface { - public function __construct(private readonly UserRender $userRender) {} + public function __construct(private readonly UserRender $userRender) + { + } public function addRole(): ?string { diff --git a/src/Bundle/ChillActivityBundle/Export/Filter/UsersJobFilter.php b/src/Bundle/ChillActivityBundle/Export/Filter/UsersJobFilter.php index 23bd4f84c..ae21482fc 100644 --- a/src/Bundle/ChillActivityBundle/Export/Filter/UsersJobFilter.php +++ b/src/Bundle/ChillActivityBundle/Export/Filter/UsersJobFilter.php @@ -28,7 +28,8 @@ class UsersJobFilter implements FilterInterface public function __construct( private readonly TranslatableStringHelperInterface $translatableStringHelper - ) {} + ) { + } public function addRole(): ?string { diff --git a/src/Bundle/ChillActivityBundle/Export/Filter/UsersScopeFilter.php b/src/Bundle/ChillActivityBundle/Export/Filter/UsersScopeFilter.php index 4ce9c845a..61a813dc0 100644 --- a/src/Bundle/ChillActivityBundle/Export/Filter/UsersScopeFilter.php +++ b/src/Bundle/ChillActivityBundle/Export/Filter/UsersScopeFilter.php @@ -30,7 +30,8 @@ class UsersScopeFilter implements FilterInterface public function __construct( private readonly ScopeRepositoryInterface $scopeRepository, private readonly TranslatableStringHelperInterface $translatableStringHelper - ) {} + ) { + } public function addRole(): ?string { diff --git a/src/Bundle/ChillActivityBundle/Form/ActivityType.php b/src/Bundle/ChillActivityBundle/Form/ActivityType.php index 03a21a5b7..4e3b1eb8a 100644 --- a/src/Bundle/ChillActivityBundle/Form/ActivityType.php +++ b/src/Bundle/ChillActivityBundle/Form/ActivityType.php @@ -404,7 +404,7 @@ class ActivityType extends AbstractType ->setAllowedTypes('center', ['null', Center::class, 'array']) ->setAllowedTypes('role', ['string']) ->setAllowedTypes('activityType', \Chill\ActivityBundle\Entity\ActivityType::class) - ->setAllowedTypes('accompanyingPeriod', [\Chill\PersonBundle\Entity\AccompanyingPeriod::class, 'null']); + ->setAllowedTypes('accompanyingPeriod', [AccompanyingPeriod::class, 'null']); } public function getBlockPrefix(): string diff --git a/src/Bundle/ChillActivityBundle/Form/ActivityTypeType.php b/src/Bundle/ChillActivityBundle/Form/ActivityTypeType.php index 8e8ae51f7..b4baa2f54 100644 --- a/src/Bundle/ChillActivityBundle/Form/ActivityTypeType.php +++ b/src/Bundle/ChillActivityBundle/Form/ActivityTypeType.php @@ -25,7 +25,9 @@ use Symfony\Component\OptionsResolver\OptionsResolver; class ActivityTypeType extends AbstractType { - public function __construct(private readonly TranslatableStringHelper $translatableStringHelper) {} + public function __construct(private readonly TranslatableStringHelper $translatableStringHelper) + { + } public function buildForm(FormBuilderInterface $builder, array $options) { diff --git a/src/Bundle/ChillActivityBundle/Form/Type/PickActivityReasonType.php b/src/Bundle/ChillActivityBundle/Form/Type/PickActivityReasonType.php index be1e372f1..009d7b29f 100644 --- a/src/Bundle/ChillActivityBundle/Form/Type/PickActivityReasonType.php +++ b/src/Bundle/ChillActivityBundle/Form/Type/PickActivityReasonType.php @@ -28,7 +28,8 @@ class PickActivityReasonType extends AbstractType private readonly ActivityReasonRepository $activityReasonRepository, private readonly ActivityReasonRender $reasonRender, private readonly TranslatableStringHelperInterface $translatableStringHelper - ) {} + ) { + } public function configureOptions(OptionsResolver $resolver) { diff --git a/src/Bundle/ChillActivityBundle/Form/Type/TranslatableActivityReasonCategoryType.php b/src/Bundle/ChillActivityBundle/Form/Type/TranslatableActivityReasonCategoryType.php index ee1417bfb..d94ac34e1 100644 --- a/src/Bundle/ChillActivityBundle/Form/Type/TranslatableActivityReasonCategoryType.php +++ b/src/Bundle/ChillActivityBundle/Form/Type/TranslatableActivityReasonCategoryType.php @@ -23,7 +23,9 @@ use Symfony\Contracts\Translation\TranslatorInterface; */ class TranslatableActivityReasonCategoryType extends AbstractType { - public function __construct(private readonly TranslatableStringHelperInterface $translatableStringHelper, private readonly TranslatorInterface $translator) {} + public function __construct(private readonly TranslatableStringHelperInterface $translatableStringHelper, private readonly TranslatorInterface $translator) + { + } public function configureOptions(OptionsResolver $resolver) { diff --git a/src/Bundle/ChillActivityBundle/Form/Type/TranslatableActivityType.php b/src/Bundle/ChillActivityBundle/Form/Type/TranslatableActivityType.php index 5c77e500d..e2233f3b1 100644 --- a/src/Bundle/ChillActivityBundle/Form/Type/TranslatableActivityType.php +++ b/src/Bundle/ChillActivityBundle/Form/Type/TranslatableActivityType.php @@ -20,7 +20,9 @@ use Symfony\Component\OptionsResolver\OptionsResolver; class TranslatableActivityType extends AbstractType { - public function __construct(protected TranslatableStringHelperInterface $translatableStringHelper, protected ActivityTypeRepositoryInterface $activityTypeRepository) {} + public function __construct(protected TranslatableStringHelperInterface $translatableStringHelper, protected ActivityTypeRepositoryInterface $activityTypeRepository) + { + } public function configureOptions(OptionsResolver $resolver) { diff --git a/src/Bundle/ChillActivityBundle/Menu/AccompanyingCourseMenuBuilder.php b/src/Bundle/ChillActivityBundle/Menu/AccompanyingCourseMenuBuilder.php index b4990c0e3..bae2b0577 100644 --- a/src/Bundle/ChillActivityBundle/Menu/AccompanyingCourseMenuBuilder.php +++ b/src/Bundle/ChillActivityBundle/Menu/AccompanyingCourseMenuBuilder.php @@ -23,7 +23,9 @@ use Symfony\Contracts\Translation\TranslatorInterface; */ class AccompanyingCourseMenuBuilder implements LocalMenuBuilderInterface { - public function __construct(protected Security $security, protected TranslatorInterface $translator) {} + public function __construct(protected Security $security, protected TranslatorInterface $translator) + { + } public function buildMenu($menuId, MenuItem $menu, array $parameters) { diff --git a/src/Bundle/ChillActivityBundle/Menu/AdminMenuBuilder.php b/src/Bundle/ChillActivityBundle/Menu/AdminMenuBuilder.php index 0afe11cfc..8337a3582 100644 --- a/src/Bundle/ChillActivityBundle/Menu/AdminMenuBuilder.php +++ b/src/Bundle/ChillActivityBundle/Menu/AdminMenuBuilder.php @@ -20,7 +20,9 @@ use Symfony\Component\Security\Core\Security; */ final readonly class AdminMenuBuilder implements LocalMenuBuilderInterface { - public function __construct(private Security $security) {} + public function __construct(private Security $security) + { + } public function buildMenu($menuId, MenuItem $menu, array $parameters) { diff --git a/src/Bundle/ChillActivityBundle/Menu/PersonMenuBuilder.php b/src/Bundle/ChillActivityBundle/Menu/PersonMenuBuilder.php index e76aaf5ee..180247808 100644 --- a/src/Bundle/ChillActivityBundle/Menu/PersonMenuBuilder.php +++ b/src/Bundle/ChillActivityBundle/Menu/PersonMenuBuilder.php @@ -23,11 +23,13 @@ use Symfony\Contracts\Translation\TranslatorInterface; */ final readonly class PersonMenuBuilder implements LocalMenuBuilderInterface { - public function __construct(private AuthorizationCheckerInterface $authorizationChecker, private TranslatorInterface $translator) {} + public function __construct(private AuthorizationCheckerInterface $authorizationChecker, private TranslatorInterface $translator) + { + } public function buildMenu($menuId, MenuItem $menu, array $parameters) { - /** @var \Chill\PersonBundle\Entity\Person $person */ + /** @var Person $person */ $person = $parameters['person']; if ($this->authorizationChecker->isGranted(ActivityVoter::SEE, $person)) { diff --git a/src/Bundle/ChillActivityBundle/Notification/ActivityNotificationHandler.php b/src/Bundle/ChillActivityBundle/Notification/ActivityNotificationHandler.php index 8eb219fd2..55b831d8b 100644 --- a/src/Bundle/ChillActivityBundle/Notification/ActivityNotificationHandler.php +++ b/src/Bundle/ChillActivityBundle/Notification/ActivityNotificationHandler.php @@ -18,7 +18,9 @@ use Chill\MainBundle\Notification\NotificationHandlerInterface; final readonly class ActivityNotificationHandler implements NotificationHandlerInterface { - public function __construct(private ActivityRepository $activityRepository) {} + public function __construct(private ActivityRepository $activityRepository) + { + } public function getTemplate(Notification $notification, array $options = []): string { diff --git a/src/Bundle/ChillActivityBundle/Repository/ActivityACLAwareRepository.php b/src/Bundle/ChillActivityBundle/Repository/ActivityACLAwareRepository.php index 231ad5432..1f50f7d62 100644 --- a/src/Bundle/ChillActivityBundle/Repository/ActivityACLAwareRepository.php +++ b/src/Bundle/ChillActivityBundle/Repository/ActivityACLAwareRepository.php @@ -44,7 +44,8 @@ final readonly class ActivityACLAwareRepository implements ActivityACLAwareRepos private EntityManagerInterface $em, private Security $security, private RequestStack $requestStack, - ) {} + ) { + } /** * @throws NonUniqueResultException diff --git a/src/Bundle/ChillActivityBundle/Repository/ActivityDocumentACLAwareRepository.php b/src/Bundle/ChillActivityBundle/Repository/ActivityDocumentACLAwareRepository.php index 99e75f2da..0623601a5 100644 --- a/src/Bundle/ChillActivityBundle/Repository/ActivityDocumentACLAwareRepository.php +++ b/src/Bundle/ChillActivityBundle/Repository/ActivityDocumentACLAwareRepository.php @@ -33,16 +33,17 @@ final readonly class ActivityDocumentACLAwareRepository implements ActivityDocum private CenterResolverManagerInterface $centerResolverManager, private AuthorizationHelperForCurrentUserInterface $authorizationHelperForCurrentUser, private Security $security - ) {} + ) { + } - public function buildFetchQueryActivityDocumentLinkedToPersonFromPersonContext(Person $person, \DateTimeImmutable $startDate = null, \DateTimeImmutable $endDate = null, string $content = null): FetchQueryInterface + public function buildFetchQueryActivityDocumentLinkedToPersonFromPersonContext(Person $person, ?\DateTimeImmutable $startDate = null, ?\DateTimeImmutable $endDate = null, ?string $content = null): FetchQueryInterface { $query = $this->buildBaseFetchQueryActivityDocumentLinkedToPersonFromPersonContext($person, $startDate, $endDate, $content); return $this->addFetchQueryByPersonACL($query, $person); } - public function buildBaseFetchQueryActivityDocumentLinkedToPersonFromPersonContext(Person $person, \DateTimeImmutable $startDate = null, \DateTimeImmutable $endDate = null, string $content = null): FetchQuery + public function buildBaseFetchQueryActivityDocumentLinkedToPersonFromPersonContext(Person $person, ?\DateTimeImmutable $startDate = null, ?\DateTimeImmutable $endDate = null, ?string $content = null): FetchQuery { $storedObjectMetadata = $this->em->getClassMetadata(StoredObject::class); $activityMetadata = $this->em->getClassMetadata(Activity::class); @@ -71,7 +72,7 @@ final readonly class ActivityDocumentACLAwareRepository implements ActivityDocum return $this->addWhereClauses($query, $startDate, $endDate, $content); } - public function buildFetchQueryActivityDocumentLinkedToAccompanyingPeriodFromPersonContext(Person $person, \DateTimeImmutable $startDate = null, \DateTimeImmutable $endDate = null, string $content = null): FetchQuery + public function buildFetchQueryActivityDocumentLinkedToAccompanyingPeriodFromPersonContext(Person $person, ?\DateTimeImmutable $startDate = null, ?\DateTimeImmutable $endDate = null, ?string $content = null): FetchQuery { $storedObjectMetadata = $this->em->getClassMetadata(StoredObject::class); $activityMetadata = $this->em->getClassMetadata(Activity::class); @@ -122,7 +123,7 @@ final readonly class ActivityDocumentACLAwareRepository implements ActivityDocum return $this->addWhereClauses($query, $startDate, $endDate, $content); } - private function addWhereClauses(FetchQuery $query, \DateTimeImmutable $startDate = null, \DateTimeImmutable $endDate = null, string $content = null): FetchQuery + private function addWhereClauses(FetchQuery $query, ?\DateTimeImmutable $startDate = null, ?\DateTimeImmutable $endDate = null, ?string $content = null): FetchQuery { $storedObjectMetadata = $this->em->getClassMetadata(StoredObject::class); diff --git a/src/Bundle/ChillActivityBundle/Repository/ActivityDocumentACLAwareRepositoryInterface.php b/src/Bundle/ChillActivityBundle/Repository/ActivityDocumentACLAwareRepositoryInterface.php index dcd45c016..79c320ba2 100644 --- a/src/Bundle/ChillActivityBundle/Repository/ActivityDocumentACLAwareRepositoryInterface.php +++ b/src/Bundle/ChillActivityBundle/Repository/ActivityDocumentACLAwareRepositoryInterface.php @@ -25,12 +25,12 @@ interface ActivityDocumentACLAwareRepositoryInterface * * This method must check the rights to see a document: the user must be allowed to see the given activities */ - public function buildFetchQueryActivityDocumentLinkedToPersonFromPersonContext(Person $person, \DateTimeImmutable $startDate = null, \DateTimeImmutable $endDate = null, string $content = null): FetchQueryInterface; + public function buildFetchQueryActivityDocumentLinkedToPersonFromPersonContext(Person $person, ?\DateTimeImmutable $startDate = null, ?\DateTimeImmutable $endDate = null, ?string $content = null): FetchQueryInterface; /** * Return a fetch query for querying document's activities for an activity in accompanying periods, but for a given person. * * This method must check the rights to see a document: the user must be allowed to see the given accompanying periods */ - public function buildFetchQueryActivityDocumentLinkedToAccompanyingPeriodFromPersonContext(Person $person, \DateTimeImmutable $startDate = null, \DateTimeImmutable $endDate = null, string $content = null): FetchQuery; + public function buildFetchQueryActivityDocumentLinkedToAccompanyingPeriodFromPersonContext(Person $person, ?\DateTimeImmutable $startDate = null, ?\DateTimeImmutable $endDate = null, ?string $content = null): FetchQuery; } diff --git a/src/Bundle/ChillActivityBundle/Repository/ActivityPresenceRepository.php b/src/Bundle/ChillActivityBundle/Repository/ActivityPresenceRepository.php index ae3296e7f..3ed96074b 100644 --- a/src/Bundle/ChillActivityBundle/Repository/ActivityPresenceRepository.php +++ b/src/Bundle/ChillActivityBundle/Repository/ActivityPresenceRepository.php @@ -34,7 +34,7 @@ class ActivityPresenceRepository implements ActivityPresenceRepositoryInterface return $this->repository->findAll(); } - public function findBy(array $criteria, array $orderBy = null, int $limit = null, int $offset = null): array + public function findBy(array $criteria, ?array $orderBy = null, ?int $limit = null, ?int $offset = null): array { return $this->findBy($criteria, $orderBy, $limit, $offset); } diff --git a/src/Bundle/ChillActivityBundle/Repository/ActivityPresenceRepositoryInterface.php b/src/Bundle/ChillActivityBundle/Repository/ActivityPresenceRepositoryInterface.php index d2daa1d5d..228d70856 100644 --- a/src/Bundle/ChillActivityBundle/Repository/ActivityPresenceRepositoryInterface.php +++ b/src/Bundle/ChillActivityBundle/Repository/ActivityPresenceRepositoryInterface.php @@ -25,7 +25,7 @@ interface ActivityPresenceRepositoryInterface /** * @return array|ActivityPresence[] */ - public function findBy(array $criteria, array $orderBy = null, int $limit = null, int $offset = null): array; + public function findBy(array $criteria, ?array $orderBy = null, ?int $limit = null, ?int $offset = null): array; public function findOneBy(array $criteria): ?ActivityPresence; diff --git a/src/Bundle/ChillActivityBundle/Repository/ActivityTypeRepository.php b/src/Bundle/ChillActivityBundle/Repository/ActivityTypeRepository.php index 6f7453a74..99adf4fe0 100644 --- a/src/Bundle/ChillActivityBundle/Repository/ActivityTypeRepository.php +++ b/src/Bundle/ChillActivityBundle/Repository/ActivityTypeRepository.php @@ -48,7 +48,7 @@ final class ActivityTypeRepository implements ActivityTypeRepositoryInterface /** * @return array|ActivityType[] */ - public function findBy(array $criteria, array $orderBy = null, int $limit = null, int $offset = null): array + public function findBy(array $criteria, ?array $orderBy = null, ?int $limit = null, ?int $offset = null): array { return $this->repository->findBy($criteria, $orderBy, $limit, $offset); } diff --git a/src/Bundle/ChillActivityBundle/Service/DocGenerator/ActivityContext.php b/src/Bundle/ChillActivityBundle/Service/DocGenerator/ActivityContext.php index 46e466ae1..6c3675011 100644 --- a/src/Bundle/ChillActivityBundle/Service/DocGenerator/ActivityContext.php +++ b/src/Bundle/ChillActivityBundle/Service/DocGenerator/ActivityContext.php @@ -51,7 +51,8 @@ class ActivityContext implements private readonly BaseContextData $baseContextData, private readonly ThirdPartyRender $thirdPartyRender, private readonly ThirdPartyRepository $thirdPartyRepository - ) {} + ) { + } public function adminFormReverseTransform(array $data): array { diff --git a/src/Bundle/ChillActivityBundle/Service/DocGenerator/ListActivitiesByAccompanyingPeriodContext.php b/src/Bundle/ChillActivityBundle/Service/DocGenerator/ListActivitiesByAccompanyingPeriodContext.php index 221d1f4b2..33675754a 100644 --- a/src/Bundle/ChillActivityBundle/Service/DocGenerator/ListActivitiesByAccompanyingPeriodContext.php +++ b/src/Bundle/ChillActivityBundle/Service/DocGenerator/ListActivitiesByAccompanyingPeriodContext.php @@ -56,7 +56,8 @@ class ListActivitiesByAccompanyingPeriodContext implements private readonly ThirdPartyRepository $thirdPartyRepository, private readonly TranslatableStringHelperInterface $translatableStringHelper, private readonly UserRepository $userRepository - ) {} + ) { + } public function adminFormReverseTransform(array $data): array { diff --git a/src/Bundle/ChillActivityBundle/Service/GenericDoc/Providers/AccompanyingPeriodActivityGenericDocProvider.php b/src/Bundle/ChillActivityBundle/Service/GenericDoc/Providers/AccompanyingPeriodActivityGenericDocProvider.php index 2c6c9a691..291ef5832 100644 --- a/src/Bundle/ChillActivityBundle/Service/GenericDoc/Providers/AccompanyingPeriodActivityGenericDocProvider.php +++ b/src/Bundle/ChillActivityBundle/Service/GenericDoc/Providers/AccompanyingPeriodActivityGenericDocProvider.php @@ -34,9 +34,10 @@ final readonly class AccompanyingPeriodActivityGenericDocProvider implements Gen private EntityManagerInterface $em, private Security $security, private ActivityDocumentACLAwareRepositoryInterface $activityDocumentACLAwareRepository, - ) {} + ) { + } - public function buildFetchQueryForAccompanyingPeriod(AccompanyingPeriod $accompanyingPeriod, \DateTimeImmutable $startDate = null, \DateTimeImmutable $endDate = null, string $content = null, string $origin = null): FetchQueryInterface + public function buildFetchQueryForAccompanyingPeriod(AccompanyingPeriod $accompanyingPeriod, ?\DateTimeImmutable $startDate = null, ?\DateTimeImmutable $endDate = null, ?string $content = null, ?string $origin = null): FetchQueryInterface { $storedObjectMetadata = $this->em->getClassMetadata(StoredObject::class); $activityMetadata = $this->em->getClassMetadata(Activity::class); @@ -99,7 +100,7 @@ final readonly class AccompanyingPeriodActivityGenericDocProvider implements Gen return $this->security->isGranted(AccompanyingPeriodVoter::SEE, $person); } - public function buildFetchQueryForPerson(Person $person, \DateTimeImmutable $startDate = null, \DateTimeImmutable $endDate = null, string $content = null, string $origin = null): FetchQueryInterface + public function buildFetchQueryForPerson(Person $person, ?\DateTimeImmutable $startDate = null, ?\DateTimeImmutable $endDate = null, ?string $content = null, ?string $origin = null): FetchQueryInterface { return $this->activityDocumentACLAwareRepository ->buildFetchQueryActivityDocumentLinkedToAccompanyingPeriodFromPersonContext($person, $startDate, $endDate, $content); diff --git a/src/Bundle/ChillActivityBundle/Service/GenericDoc/Providers/PersonActivityGenericDocProvider.php b/src/Bundle/ChillActivityBundle/Service/GenericDoc/Providers/PersonActivityGenericDocProvider.php index b84345375..618775452 100644 --- a/src/Bundle/ChillActivityBundle/Service/GenericDoc/Providers/PersonActivityGenericDocProvider.php +++ b/src/Bundle/ChillActivityBundle/Service/GenericDoc/Providers/PersonActivityGenericDocProvider.php @@ -25,9 +25,10 @@ final readonly class PersonActivityGenericDocProvider implements GenericDocForPe public function __construct( private Security $security, private ActivityDocumentACLAwareRepositoryInterface $personActivityDocumentACLAwareRepository, - ) {} + ) { + } - public function buildFetchQueryForPerson(Person $person, \DateTimeImmutable $startDate = null, \DateTimeImmutable $endDate = null, string $content = null, string $origin = null): FetchQueryInterface + public function buildFetchQueryForPerson(Person $person, ?\DateTimeImmutable $startDate = null, ?\DateTimeImmutable $endDate = null, ?string $content = null, ?string $origin = null): FetchQueryInterface { return $this->personActivityDocumentACLAwareRepository->buildFetchQueryActivityDocumentLinkedToPersonFromPersonContext( $person, diff --git a/src/Bundle/ChillActivityBundle/Service/GenericDoc/Renderers/AccompanyingPeriodActivityGenericDocRenderer.php b/src/Bundle/ChillActivityBundle/Service/GenericDoc/Renderers/AccompanyingPeriodActivityGenericDocRenderer.php index 93649cea8..76f0fc00d 100644 --- a/src/Bundle/ChillActivityBundle/Service/GenericDoc/Renderers/AccompanyingPeriodActivityGenericDocRenderer.php +++ b/src/Bundle/ChillActivityBundle/Service/GenericDoc/Renderers/AccompanyingPeriodActivityGenericDocRenderer.php @@ -20,7 +20,9 @@ use Chill\DocStoreBundle\Repository\StoredObjectRepository; final readonly class AccompanyingPeriodActivityGenericDocRenderer implements GenericDocRendererInterface { - public function __construct(private StoredObjectRepository $objectRepository, private ActivityRepository $activityRepository) {} + public function __construct(private StoredObjectRepository $objectRepository, private ActivityRepository $activityRepository) + { + } public function supports(GenericDocDTO $genericDocDTO, $options = []): bool { diff --git a/src/Bundle/ChillActivityBundle/Tests/Controller/ActivityControllerTest.php b/src/Bundle/ChillActivityBundle/Tests/Controller/ActivityControllerTest.php index 38aa49cdf..31012569a 100644 --- a/src/Bundle/ChillActivityBundle/Tests/Controller/ActivityControllerTest.php +++ b/src/Bundle/ChillActivityBundle/Tests/Controller/ActivityControllerTest.php @@ -310,7 +310,7 @@ final class ActivityControllerTest extends WebTestCase } /** - * @return \Chill\ActivityBundle\Entity\ActivityType + * @return ActivityType */ private function getRandomActivityType() { diff --git a/src/Bundle/ChillActivityBundle/Tests/Export/Filter/PersonHavingActivityBetweenDateFilterTest.php b/src/Bundle/ChillActivityBundle/Tests/Export/Filter/PersonHavingActivityBetweenDateFilterTest.php index a2ea7c158..a9935eea4 100644 --- a/src/Bundle/ChillActivityBundle/Tests/Export/Filter/PersonHavingActivityBetweenDateFilterTest.php +++ b/src/Bundle/ChillActivityBundle/Tests/Export/Filter/PersonHavingActivityBetweenDateFilterTest.php @@ -35,7 +35,7 @@ final class PersonHavingActivityBetweenDateFilterTest extends AbstractFilterTest $this->filter = self::$container->get('chill.activity.export.person_having_an_activity_between_date_filter'); $request = $this->prophesize() - ->willExtend(\Symfony\Component\HttpFoundation\Request::class); + ->willExtend(Request::class); $request->getLocale()->willReturn('fr'); diff --git a/src/Bundle/ChillActivityBundle/Tests/Form/Type/TranslatableActivityTypeTest.php b/src/Bundle/ChillActivityBundle/Tests/Form/Type/TranslatableActivityTypeTest.php index 80779d909..f3163f664 100644 --- a/src/Bundle/ChillActivityBundle/Tests/Form/Type/TranslatableActivityTypeTest.php +++ b/src/Bundle/ChillActivityBundle/Tests/Form/Type/TranslatableActivityTypeTest.php @@ -58,7 +58,7 @@ final class TranslatableActivityTypeTest extends KernelTestCase $this->assertTrue($form->isSynchronized()); $this->assertInstanceOf( - \Chill\ActivityBundle\Entity\ActivityType::class, + ActivityType::class, $form->getData()['type'], 'The data is an instance of Chill\\ActivityBundle\\Entity\\ActivityType' ); @@ -83,7 +83,7 @@ final class TranslatableActivityTypeTest extends KernelTestCase } /** - * @return \Chill\ActivityBundle\Entity\ActivityType + * @return ActivityType */ protected function getRandomType(mixed $active = true) { diff --git a/src/Bundle/ChillActivityBundle/Tests/Security/Authorization/ActivityVoterTest.php b/src/Bundle/ChillActivityBundle/Tests/Security/Authorization/ActivityVoterTest.php index b907363a3..e3ab7b60a 100644 --- a/src/Bundle/ChillActivityBundle/Tests/Security/Authorization/ActivityVoterTest.php +++ b/src/Bundle/ChillActivityBundle/Tests/Security/Authorization/ActivityVoterTest.php @@ -157,7 +157,7 @@ final class ActivityVoterTest extends KernelTestCase * * @return \Symfony\Component\Security\Core\Authentication\Token\TokenInterface */ - protected function prepareToken(User $user = null) + protected function prepareToken(?User $user = null) { $token = $this->prophet->prophesize(); $token diff --git a/src/Bundle/ChillAsideActivityBundle/src/ChillAsideActivityBundle.php b/src/Bundle/ChillAsideActivityBundle/src/ChillAsideActivityBundle.php index b0951e502..6917517b7 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/ChillAsideActivityBundle.php +++ b/src/Bundle/ChillAsideActivityBundle/src/ChillAsideActivityBundle.php @@ -13,4 +13,6 @@ namespace Chill\AsideActivityBundle; use Symfony\Component\HttpKernel\Bundle\Bundle; -class ChillAsideActivityBundle extends Bundle {} +class ChillAsideActivityBundle extends Bundle +{ +} diff --git a/src/Bundle/ChillAsideActivityBundle/src/Controller/AsideActivityController.php b/src/Bundle/ChillAsideActivityBundle/src/Controller/AsideActivityController.php index c29a5a6dc..6bd2affe7 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/Controller/AsideActivityController.php +++ b/src/Bundle/ChillAsideActivityBundle/src/Controller/AsideActivityController.php @@ -20,7 +20,9 @@ use Symfony\Component\HttpFoundation\Request; final class AsideActivityController extends CRUDController { - public function __construct(private readonly AsideActivityCategoryRepository $categoryRepository) {} + public function __construct(private readonly AsideActivityCategoryRepository $categoryRepository) + { + } public function createEntity(string $action, Request $request): object { @@ -47,7 +49,7 @@ final class AsideActivityController extends CRUDController return $asideActivity; } - protected function buildQueryEntities(string $action, Request $request, FilterOrderHelper $filterOrder = null) + protected function buildQueryEntities(string $action, Request $request, ?FilterOrderHelper $filterOrder = null) { $qb = parent::buildQueryEntities($action, $request); diff --git a/src/Bundle/ChillAsideActivityBundle/src/DataFixtures/ORM/LoadAsideActivity.php b/src/Bundle/ChillAsideActivityBundle/src/DataFixtures/ORM/LoadAsideActivity.php index 12c82be00..7bc6b774f 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/DataFixtures/ORM/LoadAsideActivity.php +++ b/src/Bundle/ChillAsideActivityBundle/src/DataFixtures/ORM/LoadAsideActivity.php @@ -20,7 +20,9 @@ use Doctrine\Persistence\ObjectManager; class LoadAsideActivity extends Fixture implements DependentFixtureInterface { - public function __construct(private readonly UserRepository $userRepository) {} + public function __construct(private readonly UserRepository $userRepository) + { + } public function getDependencies(): array { diff --git a/src/Bundle/ChillAsideActivityBundle/src/Entity/AsideActivity.php b/src/Bundle/ChillAsideActivityBundle/src/Entity/AsideActivity.php index 2bb8a985d..f43a0fdfb 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/Entity/AsideActivity.php +++ b/src/Bundle/ChillAsideActivityBundle/src/Entity/AsideActivity.php @@ -32,7 +32,7 @@ class AsideActivity implements TrackCreationInterface, TrackUpdateInterface * * @Assert\NotBlank */ - private \Chill\MainBundle\Entity\User $agent; + private User $agent; /** * @ORM\Column(type="datetime") @@ -44,7 +44,7 @@ class AsideActivity implements TrackCreationInterface, TrackUpdateInterface * * @ORM\JoinColumn(nullable=false) */ - private \Chill\MainBundle\Entity\User $createdBy; + private User $createdBy; /** * @ORM\Column(type="datetime") @@ -82,7 +82,7 @@ class AsideActivity implements TrackCreationInterface, TrackUpdateInterface * * @ORM\JoinColumn(nullable=false) */ - private ?\Chill\AsideActivityBundle\Entity\AsideActivityCategory $type = null; + private ?AsideActivityCategory $type = null; /** * @ORM\Column(type="datetime", nullable=true) @@ -92,7 +92,7 @@ class AsideActivity implements TrackCreationInterface, TrackUpdateInterface /** * @ORM\ManyToOne(targetEntity=User::class) */ - private \Chill\MainBundle\Entity\User $updatedBy; + private User $updatedBy; public function getAgent(): ?User { diff --git a/src/Bundle/ChillAsideActivityBundle/src/Export/Aggregator/ByActivityTypeAggregator.php b/src/Bundle/ChillAsideActivityBundle/src/Export/Aggregator/ByActivityTypeAggregator.php index 4271ae118..43b702f5c 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/Export/Aggregator/ByActivityTypeAggregator.php +++ b/src/Bundle/ChillAsideActivityBundle/src/Export/Aggregator/ByActivityTypeAggregator.php @@ -23,7 +23,8 @@ class ByActivityTypeAggregator implements AggregatorInterface public function __construct( private readonly AsideActivityCategoryRepository $asideActivityCategoryRepository, private readonly TranslatableStringHelper $translatableStringHelper - ) {} + ) { + } public function addRole(): ?string { diff --git a/src/Bundle/ChillAsideActivityBundle/src/Export/Aggregator/ByLocationAggregator.php b/src/Bundle/ChillAsideActivityBundle/src/Export/Aggregator/ByLocationAggregator.php index b5ca1022b..095d20acb 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/Export/Aggregator/ByLocationAggregator.php +++ b/src/Bundle/ChillAsideActivityBundle/src/Export/Aggregator/ByLocationAggregator.php @@ -19,7 +19,9 @@ use Symfony\Component\Form\FormBuilderInterface; class ByLocationAggregator implements AggregatorInterface { - public function __construct(private readonly LocationRepository $locationRepository) {} + public function __construct(private readonly LocationRepository $locationRepository) + { + } public function buildForm(FormBuilderInterface $builder): void { diff --git a/src/Bundle/ChillAsideActivityBundle/src/Export/Aggregator/ByUserJobAggregator.php b/src/Bundle/ChillAsideActivityBundle/src/Export/Aggregator/ByUserJobAggregator.php index c3883b18a..94d946907 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/Export/Aggregator/ByUserJobAggregator.php +++ b/src/Bundle/ChillAsideActivityBundle/src/Export/Aggregator/ByUserJobAggregator.php @@ -27,7 +27,8 @@ class ByUserJobAggregator implements AggregatorInterface public function __construct( private readonly UserJobRepositoryInterface $userJobRepository, private readonly TranslatableStringHelperInterface $translatableStringHelper - ) {} + ) { + } public function addRole(): ?string { @@ -65,7 +66,9 @@ class ByUserJobAggregator implements AggregatorInterface return Declarations::ASIDE_ACTIVITY_TYPE; } - public function buildForm(FormBuilderInterface $builder) {} + public function buildForm(FormBuilderInterface $builder) + { + } public function getFormDefaultData(): array { diff --git a/src/Bundle/ChillAsideActivityBundle/src/Export/Aggregator/ByUserScopeAggregator.php b/src/Bundle/ChillAsideActivityBundle/src/Export/Aggregator/ByUserScopeAggregator.php index a99d2b75f..90e4ee615 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/Export/Aggregator/ByUserScopeAggregator.php +++ b/src/Bundle/ChillAsideActivityBundle/src/Export/Aggregator/ByUserScopeAggregator.php @@ -27,7 +27,8 @@ class ByUserScopeAggregator implements AggregatorInterface public function __construct( private readonly ScopeRepositoryInterface $scopeRepository, private readonly TranslatableStringHelperInterface $translatableStringHelper - ) {} + ) { + } public function addRole(): ?string { @@ -64,7 +65,9 @@ class ByUserScopeAggregator implements AggregatorInterface return Declarations::ASIDE_ACTIVITY_TYPE; } - public function buildForm(FormBuilderInterface $builder) {} + public function buildForm(FormBuilderInterface $builder) + { + } public function getFormDefaultData(): array { diff --git a/src/Bundle/ChillAsideActivityBundle/src/Export/Export/AvgAsideActivityDuration.php b/src/Bundle/ChillAsideActivityBundle/src/Export/Export/AvgAsideActivityDuration.php index 70922b6ae..f4afd9181 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/Export/Export/AvgAsideActivityDuration.php +++ b/src/Bundle/ChillAsideActivityBundle/src/Export/Export/AvgAsideActivityDuration.php @@ -22,9 +22,13 @@ use Symfony\Component\Form\FormBuilderInterface; class AvgAsideActivityDuration implements ExportInterface, GroupedExportInterface { - public function __construct(private readonly AsideActivityRepository $repository) {} + public function __construct(private readonly AsideActivityRepository $repository) + { + } - public function buildForm(FormBuilderInterface $builder) {} + public function buildForm(FormBuilderInterface $builder) + { + } public function getFormDefaultData(): array { diff --git a/src/Bundle/ChillAsideActivityBundle/src/Export/Export/CountAsideActivity.php b/src/Bundle/ChillAsideActivityBundle/src/Export/Export/CountAsideActivity.php index 6d1eed5fe..b8f3101b7 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/Export/Export/CountAsideActivity.php +++ b/src/Bundle/ChillAsideActivityBundle/src/Export/Export/CountAsideActivity.php @@ -22,9 +22,13 @@ use Symfony\Component\Form\FormBuilderInterface; class CountAsideActivity implements ExportInterface, GroupedExportInterface { - public function __construct(private readonly AsideActivityRepository $repository) {} + public function __construct(private readonly AsideActivityRepository $repository) + { + } - public function buildForm(FormBuilderInterface $builder) {} + public function buildForm(FormBuilderInterface $builder) + { + } public function getFormDefaultData(): array { diff --git a/src/Bundle/ChillAsideActivityBundle/src/Export/Export/ListAsideActivity.php b/src/Bundle/ChillAsideActivityBundle/src/Export/Export/ListAsideActivity.php index 33155c62f..37519b559 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/Export/Export/ListAsideActivity.php +++ b/src/Bundle/ChillAsideActivityBundle/src/Export/Export/ListAsideActivity.php @@ -42,9 +42,12 @@ final readonly class ListAsideActivity implements ListInterface, GroupedExportIn private CategoryRender $categoryRender, private LocationRepository $locationRepository, private TranslatableStringHelperInterface $translatableStringHelper - ) {} + ) { + } - public function buildForm(FormBuilderInterface $builder) {} + public function buildForm(FormBuilderInterface $builder) + { + } public function getFormDefaultData(): array { diff --git a/src/Bundle/ChillAsideActivityBundle/src/Export/Export/SumAsideActivityDuration.php b/src/Bundle/ChillAsideActivityBundle/src/Export/Export/SumAsideActivityDuration.php index 0fd318902..872d7305c 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/Export/Export/SumAsideActivityDuration.php +++ b/src/Bundle/ChillAsideActivityBundle/src/Export/Export/SumAsideActivityDuration.php @@ -22,9 +22,13 @@ use Symfony\Component\Form\FormBuilderInterface; class SumAsideActivityDuration implements ExportInterface, GroupedExportInterface { - public function __construct(private readonly AsideActivityRepository $repository) {} + public function __construct(private readonly AsideActivityRepository $repository) + { + } - public function buildForm(FormBuilderInterface $builder) {} + public function buildForm(FormBuilderInterface $builder) + { + } public function getFormDefaultData(): array { diff --git a/src/Bundle/ChillAsideActivityBundle/src/Export/Filter/ByActivityTypeFilter.php b/src/Bundle/ChillAsideActivityBundle/src/Export/Filter/ByActivityTypeFilter.php index 708b12ef1..7c1f4348c 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/Export/Filter/ByActivityTypeFilter.php +++ b/src/Bundle/ChillAsideActivityBundle/src/Export/Filter/ByActivityTypeFilter.php @@ -28,7 +28,8 @@ class ByActivityTypeFilter implements FilterInterface private readonly CategoryRender $categoryRender, private readonly TranslatableStringHelperInterface $translatableStringHelper, private readonly AsideActivityCategoryRepository $asideActivityTypeRepository - ) {} + ) { + } public function addRole(): ?string { diff --git a/src/Bundle/ChillAsideActivityBundle/src/Export/Filter/ByDateFilter.php b/src/Bundle/ChillAsideActivityBundle/src/Export/Filter/ByDateFilter.php index b8d77d942..703190f74 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/Export/Filter/ByDateFilter.php +++ b/src/Bundle/ChillAsideActivityBundle/src/Export/Filter/ByDateFilter.php @@ -22,7 +22,9 @@ use Symfony\Contracts\Translation\TranslatorInterface; class ByDateFilter implements FilterInterface { - public function __construct(private readonly RollingDateConverterInterface $rollingDateConverter, protected TranslatorInterface $translator) {} + public function __construct(private readonly RollingDateConverterInterface $rollingDateConverter, protected TranslatorInterface $translator) + { + } public function addRole(): ?string { diff --git a/src/Bundle/ChillAsideActivityBundle/src/Export/Filter/ByLocationFilter.php b/src/Bundle/ChillAsideActivityBundle/src/Export/Filter/ByLocationFilter.php index 6de002606..20e8c46f8 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/Export/Filter/ByLocationFilter.php +++ b/src/Bundle/ChillAsideActivityBundle/src/Export/Filter/ByLocationFilter.php @@ -25,7 +25,8 @@ final readonly class ByLocationFilter implements FilterInterface { public function __construct( private Security $security - ) {} + ) { + } public function getTitle(): string { diff --git a/src/Bundle/ChillAsideActivityBundle/src/Export/Filter/ByUserFilter.php b/src/Bundle/ChillAsideActivityBundle/src/Export/Filter/ByUserFilter.php index 8dd1a8eac..e39633914 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/Export/Filter/ByUserFilter.php +++ b/src/Bundle/ChillAsideActivityBundle/src/Export/Filter/ByUserFilter.php @@ -20,7 +20,9 @@ use Symfony\Component\Form\FormBuilderInterface; class ByUserFilter implements FilterInterface { - public function __construct(private readonly UserRender $userRender) {} + public function __construct(private readonly UserRender $userRender) + { + } public function addRole(): ?string { diff --git a/src/Bundle/ChillAsideActivityBundle/src/Export/Filter/ByUserJobFilter.php b/src/Bundle/ChillAsideActivityBundle/src/Export/Filter/ByUserJobFilter.php index d7255d9fa..2418f5428 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/Export/Filter/ByUserJobFilter.php +++ b/src/Bundle/ChillAsideActivityBundle/src/Export/Filter/ByUserJobFilter.php @@ -28,7 +28,8 @@ class ByUserJobFilter implements FilterInterface public function __construct( private readonly TranslatableStringHelperInterface $translatableStringHelper - ) {} + ) { + } public function addRole(): ?string { diff --git a/src/Bundle/ChillAsideActivityBundle/src/Export/Filter/ByUserScopeFilter.php b/src/Bundle/ChillAsideActivityBundle/src/Export/Filter/ByUserScopeFilter.php index 8f8d50462..fd0511e33 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/Export/Filter/ByUserScopeFilter.php +++ b/src/Bundle/ChillAsideActivityBundle/src/Export/Filter/ByUserScopeFilter.php @@ -30,7 +30,8 @@ class ByUserScopeFilter implements FilterInterface public function __construct( private readonly ScopeRepositoryInterface $scopeRepository, private readonly TranslatableStringHelperInterface $translatableStringHelper - ) {} + ) { + } public function addRole(): ?string { diff --git a/src/Bundle/ChillAsideActivityBundle/src/Form/AsideActivityCategoryType.php b/src/Bundle/ChillAsideActivityBundle/src/Form/AsideActivityCategoryType.php index 3a69be137..c285f0f9b 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/Form/AsideActivityCategoryType.php +++ b/src/Bundle/ChillAsideActivityBundle/src/Form/AsideActivityCategoryType.php @@ -22,7 +22,9 @@ use Symfony\Component\Form\FormBuilderInterface; final class AsideActivityCategoryType extends AbstractType { - public function __construct(private readonly CategoryRender $categoryRender) {} + public function __construct(private readonly CategoryRender $categoryRender) + { + } public function buildForm(FormBuilderInterface $builder, array $options) { diff --git a/src/Bundle/ChillAsideActivityBundle/src/Form/Type/PickAsideActivityCategoryType.php b/src/Bundle/ChillAsideActivityBundle/src/Form/Type/PickAsideActivityCategoryType.php index 23923fb6c..8341d8595 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/Form/Type/PickAsideActivityCategoryType.php +++ b/src/Bundle/ChillAsideActivityBundle/src/Form/Type/PickAsideActivityCategoryType.php @@ -20,7 +20,9 @@ use Symfony\Component\OptionsResolver\OptionsResolver; final class PickAsideActivityCategoryType extends AbstractType { - public function __construct(private readonly CategoryRender $categoryRender) {} + public function __construct(private readonly CategoryRender $categoryRender) + { + } public function configureOptions(OptionsResolver $resolver) { diff --git a/src/Bundle/ChillAsideActivityBundle/src/Menu/AdminMenuBuilder.php b/src/Bundle/ChillAsideActivityBundle/src/Menu/AdminMenuBuilder.php index 43a37e068..d0a593dab 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/Menu/AdminMenuBuilder.php +++ b/src/Bundle/ChillAsideActivityBundle/src/Menu/AdminMenuBuilder.php @@ -16,7 +16,9 @@ use Symfony\Component\Security\Core\Security; final readonly class AdminMenuBuilder implements \Chill\MainBundle\Routing\LocalMenuBuilderInterface { - public function __construct(private Security $security) {} + public function __construct(private Security $security) + { + } public function buildMenu($menuId, MenuItem $menu, array $parameters) { diff --git a/src/Bundle/ChillAsideActivityBundle/src/Menu/SectionMenuBuilder.php b/src/Bundle/ChillAsideActivityBundle/src/Menu/SectionMenuBuilder.php index a32d52303..0646a8613 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/Menu/SectionMenuBuilder.php +++ b/src/Bundle/ChillAsideActivityBundle/src/Menu/SectionMenuBuilder.php @@ -21,7 +21,9 @@ use Symfony\Contracts\Translation\TranslatorInterface; */ class SectionMenuBuilder implements LocalMenuBuilderInterface { - public function __construct(protected TranslatorInterface $translator, public AuthorizationCheckerInterface $authorizationChecker) {} + public function __construct(protected TranslatorInterface $translator, public AuthorizationCheckerInterface $authorizationChecker) + { + } public function buildMenu($menuId, MenuItem $menu, array $parameters) { diff --git a/src/Bundle/ChillAsideActivityBundle/src/Repository/AsideActivityCategoryRepository.php b/src/Bundle/ChillAsideActivityBundle/src/Repository/AsideActivityCategoryRepository.php index 533e567b4..6735606ce 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/Repository/AsideActivityCategoryRepository.php +++ b/src/Bundle/ChillAsideActivityBundle/src/Repository/AsideActivityCategoryRepository.php @@ -49,7 +49,7 @@ class AsideActivityCategoryRepository implements ObjectRepository * * @return AsideActivityCategory[] */ - public function findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null): array + public function findBy(array $criteria, ?array $orderBy = null, $limit = null, $offset = null): array { return $this->repository->findBy($criteria, $orderBy, $limit, $offset); } diff --git a/src/Bundle/ChillAsideActivityBundle/src/Templating/Entity/CategoryRender.php b/src/Bundle/ChillAsideActivityBundle/src/Templating/Entity/CategoryRender.php index 2598c4e01..db8995087 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/Templating/Entity/CategoryRender.php +++ b/src/Bundle/ChillAsideActivityBundle/src/Templating/Entity/CategoryRender.php @@ -26,7 +26,9 @@ final readonly class CategoryRender implements ChillEntityRenderInterface public const SEPERATOR_KEY = 'default.separator'; - public function __construct(private TranslatableStringHelper $translatableStringHelper, private \Twig\Environment $engine) {} + public function __construct(private TranslatableStringHelper $translatableStringHelper, private \Twig\Environment $engine) + { + } public function buildParents(AsideActivityCategory $asideActivityCategory) { diff --git a/src/Bundle/ChillBudgetBundle/Controller/AbstractElementController.php b/src/Bundle/ChillBudgetBundle/Controller/AbstractElementController.php index 38d4d82f5..5282d6bce 100644 --- a/src/Bundle/ChillBudgetBundle/Controller/AbstractElementController.php +++ b/src/Bundle/ChillBudgetBundle/Controller/AbstractElementController.php @@ -25,7 +25,9 @@ use Symfony\Contracts\Translation\TranslatorInterface; abstract class AbstractElementController extends AbstractController { - public function __construct(protected EntityManagerInterface $em, protected TranslatorInterface $translator, protected LoggerInterface $chillMainLogger) {} + public function __construct(protected EntityManagerInterface $em, protected TranslatorInterface $translator, protected LoggerInterface $chillMainLogger) + { + } /** * Route( diff --git a/src/Bundle/ChillBudgetBundle/Controller/ElementController.php b/src/Bundle/ChillBudgetBundle/Controller/ElementController.php index 26acbf8a5..468576673 100644 --- a/src/Bundle/ChillBudgetBundle/Controller/ElementController.php +++ b/src/Bundle/ChillBudgetBundle/Controller/ElementController.php @@ -21,7 +21,9 @@ use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; class ElementController extends AbstractController { - public function __construct(private readonly CalculatorManager $calculator, private readonly ResourceRepository $resourceRepository, private readonly ChargeRepository $chargeRepository) {} + public function __construct(private readonly CalculatorManager $calculator, private readonly ResourceRepository $resourceRepository, private readonly ChargeRepository $chargeRepository) + { + } /** * @\Symfony\Component\Routing\Annotation\Route("{_locale}/budget/elements/by-person/{id}", name="chill_budget_elements_index") diff --git a/src/Bundle/ChillBudgetBundle/Entity/AbstractElement.php b/src/Bundle/ChillBudgetBundle/Entity/AbstractElement.php index 52a52c99f..85420e670 100644 --- a/src/Bundle/ChillBudgetBundle/Entity/AbstractElement.php +++ b/src/Bundle/ChillBudgetBundle/Entity/AbstractElement.php @@ -132,14 +132,14 @@ abstract class AbstractElement return $this; } - public function setComment(string $comment = null): self + public function setComment(?string $comment = null): self { $this->comment = $comment; return $this; } - public function setEndDate(\DateTimeInterface $endDate = null): self + public function setEndDate(?\DateTimeInterface $endDate = null): self { if ($endDate instanceof \DateTime) { $this->endDate = \DateTimeImmutable::createFromMutable($endDate); diff --git a/src/Bundle/ChillBudgetBundle/Form/ChargeType.php b/src/Bundle/ChillBudgetBundle/Form/ChargeType.php index 2d219b62a..c2f2e4b67 100644 --- a/src/Bundle/ChillBudgetBundle/Form/ChargeType.php +++ b/src/Bundle/ChillBudgetBundle/Form/ChargeType.php @@ -27,7 +27,9 @@ use Symfony\Contracts\Translation\TranslatorInterface; class ChargeType extends AbstractType { - public function __construct(protected TranslatableStringHelperInterface $translatableStringHelper, private readonly ChargeKindRepository $repository, private readonly TranslatorInterface $translator) {} + public function __construct(protected TranslatableStringHelperInterface $translatableStringHelper, private readonly ChargeKindRepository $repository, private readonly TranslatorInterface $translator) + { + } public function buildForm(FormBuilderInterface $builder, array $options) { diff --git a/src/Bundle/ChillBudgetBundle/Form/ResourceType.php b/src/Bundle/ChillBudgetBundle/Form/ResourceType.php index ba93f1080..3896b0dd8 100644 --- a/src/Bundle/ChillBudgetBundle/Form/ResourceType.php +++ b/src/Bundle/ChillBudgetBundle/Form/ResourceType.php @@ -26,7 +26,9 @@ use Symfony\Contracts\Translation\TranslatorInterface; class ResourceType extends AbstractType { - public function __construct(protected TranslatableStringHelperInterface $translatableStringHelper, private readonly ResourceKindRepository $repository, private readonly TranslatorInterface $translator) {} + public function __construct(protected TranslatableStringHelperInterface $translatableStringHelper, private readonly ResourceKindRepository $repository, private readonly TranslatorInterface $translator) + { + } public function buildForm(FormBuilderInterface $builder, array $options) { diff --git a/src/Bundle/ChillBudgetBundle/Menu/AdminMenuBuilder.php b/src/Bundle/ChillBudgetBundle/Menu/AdminMenuBuilder.php index b8b4b617c..805ad865d 100644 --- a/src/Bundle/ChillBudgetBundle/Menu/AdminMenuBuilder.php +++ b/src/Bundle/ChillBudgetBundle/Menu/AdminMenuBuilder.php @@ -17,7 +17,9 @@ use Symfony\Component\Security\Core\Security; final readonly class AdminMenuBuilder implements LocalMenuBuilderInterface { - public function __construct(private Security $security) {} + public function __construct(private Security $security) + { + } public function buildMenu($menuId, MenuItem $menu, array $parameters) { diff --git a/src/Bundle/ChillBudgetBundle/Menu/HouseholdMenuBuilder.php b/src/Bundle/ChillBudgetBundle/Menu/HouseholdMenuBuilder.php index 94583b439..c5d19262d 100644 --- a/src/Bundle/ChillBudgetBundle/Menu/HouseholdMenuBuilder.php +++ b/src/Bundle/ChillBudgetBundle/Menu/HouseholdMenuBuilder.php @@ -20,7 +20,9 @@ use Symfony\Contracts\Translation\TranslatorInterface; class HouseholdMenuBuilder implements LocalMenuBuilderInterface { - public function __construct(protected AuthorizationCheckerInterface $authorizationChecker, protected TranslatorInterface $translator) {} + public function __construct(protected AuthorizationCheckerInterface $authorizationChecker, protected TranslatorInterface $translator) + { + } public function buildMenu($menuId, MenuItem $menu, array $parameters) { diff --git a/src/Bundle/ChillBudgetBundle/Menu/PersonMenuBuilder.php b/src/Bundle/ChillBudgetBundle/Menu/PersonMenuBuilder.php index 25bd6a218..97b10c72b 100644 --- a/src/Bundle/ChillBudgetBundle/Menu/PersonMenuBuilder.php +++ b/src/Bundle/ChillBudgetBundle/Menu/PersonMenuBuilder.php @@ -20,7 +20,9 @@ use Symfony\Contracts\Translation\TranslatorInterface; class PersonMenuBuilder implements LocalMenuBuilderInterface { - public function __construct(protected AuthorizationCheckerInterface $authorizationChecker, protected TranslatorInterface $translator) {} + public function __construct(protected AuthorizationCheckerInterface $authorizationChecker, protected TranslatorInterface $translator) + { + } public function buildMenu($menuId, MenuItem $menu, array $parameters) { diff --git a/src/Bundle/ChillBudgetBundle/Repository/ChargeKindRepository.php b/src/Bundle/ChillBudgetBundle/Repository/ChargeKindRepository.php index 577be07db..a0c23a4ad 100644 --- a/src/Bundle/ChillBudgetBundle/Repository/ChargeKindRepository.php +++ b/src/Bundle/ChillBudgetBundle/Repository/ChargeKindRepository.php @@ -66,7 +66,7 @@ final class ChargeKindRepository implements ChargeKindRepositoryInterface * * @return array */ - public function findBy(array $criteria, array $orderBy = null, int $limit = null, int $offset = null): array + public function findBy(array $criteria, ?array $orderBy = null, ?int $limit = null, ?int $offset = null): array { return $this->repository->findBy($criteria, $orderBy, $limit, $offset); } diff --git a/src/Bundle/ChillBudgetBundle/Repository/ChargeKindRepositoryInterface.php b/src/Bundle/ChillBudgetBundle/Repository/ChargeKindRepositoryInterface.php index 7a930bea8..d9ec3e269 100644 --- a/src/Bundle/ChillBudgetBundle/Repository/ChargeKindRepositoryInterface.php +++ b/src/Bundle/ChillBudgetBundle/Repository/ChargeKindRepositoryInterface.php @@ -36,7 +36,7 @@ interface ChargeKindRepositoryInterface extends ObjectRepository /** * @return array */ - public function findBy(array $criteria, array $orderBy = null, int $limit = null, int $offset = null): array; + public function findBy(array $criteria, ?array $orderBy = null, ?int $limit = null, ?int $offset = null): array; public function findOneBy(array $criteria): ?ChargeKind; diff --git a/src/Bundle/ChillBudgetBundle/Repository/ResourceKindRepository.php b/src/Bundle/ChillBudgetBundle/Repository/ResourceKindRepository.php index e10913195..723f26748 100644 --- a/src/Bundle/ChillBudgetBundle/Repository/ResourceKindRepository.php +++ b/src/Bundle/ChillBudgetBundle/Repository/ResourceKindRepository.php @@ -71,7 +71,7 @@ final class ResourceKindRepository implements ResourceKindRepositoryInterface * * @return list */ - public function findBy(array $criteria, array $orderBy = null, int $limit = null, int $offset = null): array + public function findBy(array $criteria, ?array $orderBy = null, ?int $limit = null, ?int $offset = null): array { return $this->repository->findBy($criteria, $orderBy, $limit, $offset); } diff --git a/src/Bundle/ChillBudgetBundle/Repository/ResourceKindRepositoryInterface.php b/src/Bundle/ChillBudgetBundle/Repository/ResourceKindRepositoryInterface.php index d639d54ee..950487225 100644 --- a/src/Bundle/ChillBudgetBundle/Repository/ResourceKindRepositoryInterface.php +++ b/src/Bundle/ChillBudgetBundle/Repository/ResourceKindRepositoryInterface.php @@ -36,7 +36,7 @@ interface ResourceKindRepositoryInterface extends ObjectRepository /** * @return list */ - public function findBy(array $criteria, array $orderBy = null, int $limit = null, int $offset = null): array; + public function findBy(array $criteria, ?array $orderBy = null, ?int $limit = null, ?int $offset = null): array; public function findOneBy(array $criteria): ?ResourceKind; diff --git a/src/Bundle/ChillBudgetBundle/Service/Summary/SummaryBudget.php b/src/Bundle/ChillBudgetBundle/Service/Summary/SummaryBudget.php index a57f7fb29..acac8a504 100644 --- a/src/Bundle/ChillBudgetBundle/Service/Summary/SummaryBudget.php +++ b/src/Bundle/ChillBudgetBundle/Service/Summary/SummaryBudget.php @@ -34,7 +34,9 @@ final readonly class SummaryBudget implements SummaryBudgetInterface private const QUERY_RESOURCE_BY_PERSON = 'select SUM(amount) AS sum, string_agg(comment, \'|\') AS comment, resource_id AS kind_id FROM chill_budget.resource WHERE person_id = ? AND NOW() BETWEEN startdate AND COALESCE(enddate, \'infinity\'::timestamp) GROUP BY resource_id'; - public function __construct(private EntityManagerInterface $em, private TranslatableStringHelperInterface $translatableStringHelper, private ResourceKindRepositoryInterface $resourceKindRepository, private ChargeKindRepositoryInterface $chargeKindRepository) {} + public function __construct(private EntityManagerInterface $em, private TranslatableStringHelperInterface $translatableStringHelper, private ResourceKindRepositoryInterface $resourceKindRepository, private ChargeKindRepositoryInterface $chargeKindRepository) + { + } public function getSummaryForHousehold(?Household $household): array { diff --git a/src/Bundle/ChillBudgetBundle/Templating/BudgetElementTypeRender.php b/src/Bundle/ChillBudgetBundle/Templating/BudgetElementTypeRender.php index 26871b0f4..c8fa90475 100644 --- a/src/Bundle/ChillBudgetBundle/Templating/BudgetElementTypeRender.php +++ b/src/Bundle/ChillBudgetBundle/Templating/BudgetElementTypeRender.php @@ -21,7 +21,9 @@ use Chill\MainBundle\Templating\TranslatableStringHelperInterface; */ final readonly class BudgetElementTypeRender implements ChillEntityRenderInterface { - public function __construct(private TranslatableStringHelperInterface $translatableStringHelper, private \Twig\Environment $engine) {} + public function __construct(private TranslatableStringHelperInterface $translatableStringHelper, private \Twig\Environment $engine) + { + } public function renderBox($entity, array $options): string { diff --git a/src/Bundle/ChillBudgetBundle/migrations/Version20221207105407.php b/src/Bundle/ChillBudgetBundle/migrations/Version20221207105407.php index 1d2707120..cfe3a0089 100644 --- a/src/Bundle/ChillBudgetBundle/migrations/Version20221207105407.php +++ b/src/Bundle/ChillBudgetBundle/migrations/Version20221207105407.php @@ -32,7 +32,7 @@ final class Version20221207105407 extends AbstractMigration implements Container return 'Use new budget admin entities'; } - public function setContainer(ContainerInterface $container = null) + public function setContainer(?ContainerInterface $container = null) { $this->container = $container; } diff --git a/src/Bundle/ChillCalendarBundle/Controller/CalendarAPIController.php b/src/Bundle/ChillCalendarBundle/Controller/CalendarAPIController.php index 1729c215b..96344103f 100644 --- a/src/Bundle/ChillCalendarBundle/Controller/CalendarAPIController.php +++ b/src/Bundle/ChillCalendarBundle/Controller/CalendarAPIController.php @@ -23,7 +23,9 @@ use Symfony\Component\Routing\Annotation\Route; class CalendarAPIController extends ApiController { - public function __construct(private readonly CalendarRepository $calendarRepository) {} + public function __construct(private readonly CalendarRepository $calendarRepository) + { + } /** * @Route("/api/1.0/calendar/calendar/by-user/{id}.{_format}", diff --git a/src/Bundle/ChillCalendarBundle/Controller/CalendarController.php b/src/Bundle/ChillCalendarBundle/Controller/CalendarController.php index f4694614f..b6eaaf377 100644 --- a/src/Bundle/ChillCalendarBundle/Controller/CalendarController.php +++ b/src/Bundle/ChillCalendarBundle/Controller/CalendarController.php @@ -59,7 +59,8 @@ class CalendarController extends AbstractController private readonly AccompanyingPeriodRepository $accompanyingPeriodRepository, private readonly UserRepositoryInterface $userRepository, private readonly TranslatorInterface $translator - ) {} + ) { + } /** * Delete a calendar item. @@ -406,7 +407,7 @@ class CalendarController extends AbstractController } /** @var Calendar $entity */ - $entity = $em->getRepository(\Chill\CalendarBundle\Entity\Calendar::class)->find($id); + $entity = $em->getRepository(Calendar::class)->find($id); if (null === $entity) { throw $this->createNotFoundException('Unable to find Calendar entity.'); diff --git a/src/Bundle/ChillCalendarBundle/Controller/CalendarDocController.php b/src/Bundle/ChillCalendarBundle/Controller/CalendarDocController.php index d0f5e623d..6bc3245e3 100644 --- a/src/Bundle/ChillCalendarBundle/Controller/CalendarDocController.php +++ b/src/Bundle/ChillCalendarBundle/Controller/CalendarDocController.php @@ -35,7 +35,8 @@ final readonly class CalendarDocController private FormFactoryInterface $formFactory, private Security $security, private UrlGeneratorInterface $urlGenerator, - ) {} + ) { + } /** * @Route("/{_locale}/calendar/calendar-doc/{id}/new", name="chill_calendar_calendardoc_new") diff --git a/src/Bundle/ChillCalendarBundle/Controller/CalendarRangeAPIController.php b/src/Bundle/ChillCalendarBundle/Controller/CalendarRangeAPIController.php index 459d8f6aa..2bdf393f8 100644 --- a/src/Bundle/ChillCalendarBundle/Controller/CalendarRangeAPIController.php +++ b/src/Bundle/ChillCalendarBundle/Controller/CalendarRangeAPIController.php @@ -23,7 +23,9 @@ use Symfony\Component\Routing\Annotation\Route; class CalendarRangeAPIController extends ApiController { - public function __construct(private readonly CalendarRangeRepository $calendarRangeRepository) {} + public function __construct(private readonly CalendarRangeRepository $calendarRangeRepository) + { + } /** * @Route("/api/1.0/calendar/calendar-range-available/{id}.{_format}", diff --git a/src/Bundle/ChillCalendarBundle/Controller/InviteApiController.php b/src/Bundle/ChillCalendarBundle/Controller/InviteApiController.php index 784a6f6ce..16950b29e 100644 --- a/src/Bundle/ChillCalendarBundle/Controller/InviteApiController.php +++ b/src/Bundle/ChillCalendarBundle/Controller/InviteApiController.php @@ -34,7 +34,9 @@ use Symfony\Component\Security\Core\Security; class InviteApiController { - public function __construct(private readonly EntityManagerInterface $entityManager, private readonly MessageBusInterface $messageBus, private readonly Security $security) {} + public function __construct(private readonly EntityManagerInterface $entityManager, private readonly MessageBusInterface $messageBus, private readonly Security $security) + { + } /** * Give an answer to a calendar invite. diff --git a/src/Bundle/ChillCalendarBundle/Controller/RemoteCalendarConnectAzureController.php b/src/Bundle/ChillCalendarBundle/Controller/RemoteCalendarConnectAzureController.php index 75b417e93..a8339137a 100644 --- a/src/Bundle/ChillCalendarBundle/Controller/RemoteCalendarConnectAzureController.php +++ b/src/Bundle/ChillCalendarBundle/Controller/RemoteCalendarConnectAzureController.php @@ -30,7 +30,9 @@ use TheNetworg\OAuth2\Client\Token\AccessToken; class RemoteCalendarConnectAzureController { - public function __construct(private readonly ClientRegistry $clientRegistry, private readonly OnBehalfOfUserTokenStorage $MSGraphTokenStorage) {} + public function __construct(private readonly ClientRegistry $clientRegistry, private readonly OnBehalfOfUserTokenStorage $MSGraphTokenStorage) + { + } /** * @Route("/{_locale}/connect/azure", name="chill_calendar_remote_connect_azure") diff --git a/src/Bundle/ChillCalendarBundle/Controller/RemoteCalendarMSGraphSyncController.php b/src/Bundle/ChillCalendarBundle/Controller/RemoteCalendarMSGraphSyncController.php index e7d423abd..1582a8a2d 100644 --- a/src/Bundle/ChillCalendarBundle/Controller/RemoteCalendarMSGraphSyncController.php +++ b/src/Bundle/ChillCalendarBundle/Controller/RemoteCalendarMSGraphSyncController.php @@ -27,7 +27,9 @@ use Symfony\Component\Routing\Annotation\Route; class RemoteCalendarMSGraphSyncController { - public function __construct(private readonly MessageBusInterface $messageBus) {} + public function __construct(private readonly MessageBusInterface $messageBus) + { + } /** * @Route("/public/incoming-hook/calendar/msgraph/events/{userId}", name="chill_calendar_remote_msgraph_incoming_webhook_events", diff --git a/src/Bundle/ChillCalendarBundle/Controller/RemoteCalendarProxyController.php b/src/Bundle/ChillCalendarBundle/Controller/RemoteCalendarProxyController.php index 673912c0a..eee828884 100644 --- a/src/Bundle/ChillCalendarBundle/Controller/RemoteCalendarProxyController.php +++ b/src/Bundle/ChillCalendarBundle/Controller/RemoteCalendarProxyController.php @@ -34,7 +34,9 @@ use Symfony\Component\Serializer\SerializerInterface; */ class RemoteCalendarProxyController { - public function __construct(private readonly PaginatorFactory $paginatorFactory, private readonly RemoteCalendarConnectorInterface $remoteCalendarConnector, private readonly SerializerInterface $serializer) {} + public function __construct(private readonly PaginatorFactory $paginatorFactory, private readonly RemoteCalendarConnectorInterface $remoteCalendarConnector, private readonly SerializerInterface $serializer) + { + } /** * @Route("api/1.0/calendar/proxy/calendar/by-user/{id}/events") diff --git a/src/Bundle/ChillCalendarBundle/DataFixtures/ORM/LoadCalendarRange.php b/src/Bundle/ChillCalendarBundle/DataFixtures/ORM/LoadCalendarRange.php index f222823bf..71277cd8a 100644 --- a/src/Bundle/ChillCalendarBundle/DataFixtures/ORM/LoadCalendarRange.php +++ b/src/Bundle/ChillCalendarBundle/DataFixtures/ORM/LoadCalendarRange.php @@ -28,7 +28,9 @@ class LoadCalendarRange extends Fixture implements FixtureGroupInterface, Ordere { public static array $references = []; - public function __construct(private readonly UserRepository $userRepository) {} + public function __construct(private readonly UserRepository $userRepository) + { + } public static function getGroups(): array { diff --git a/src/Bundle/ChillCalendarBundle/Event/ListenToActivityCreate.php b/src/Bundle/ChillCalendarBundle/Event/ListenToActivityCreate.php index 82c76eea4..2f263d66a 100644 --- a/src/Bundle/ChillCalendarBundle/Event/ListenToActivityCreate.php +++ b/src/Bundle/ChillCalendarBundle/Event/ListenToActivityCreate.php @@ -17,7 +17,9 @@ use Symfony\Component\HttpFoundation\RequestStack; class ListenToActivityCreate { - public function __construct(private readonly RequestStack $requestStack) {} + public function __construct(private readonly RequestStack $requestStack) + { + } public function postPersist(Activity $activity, LifecycleEventArgs $event): void { diff --git a/src/Bundle/ChillCalendarBundle/Exception/UserAbsenceSyncException.php b/src/Bundle/ChillCalendarBundle/Exception/UserAbsenceSyncException.php index dd2c0b9c2..7466f93a4 100644 --- a/src/Bundle/ChillCalendarBundle/Exception/UserAbsenceSyncException.php +++ b/src/Bundle/ChillCalendarBundle/Exception/UserAbsenceSyncException.php @@ -13,7 +13,7 @@ namespace Chill\CalendarBundle\Exception; class UserAbsenceSyncException extends \LogicException { - public function __construct(string $message = '', int $code = 20_230_706, \Throwable $previous = null) + public function __construct(string $message = '', int $code = 20_230_706, ?\Throwable $previous = null) { parent::__construct($message, $code, $previous); } diff --git a/src/Bundle/ChillCalendarBundle/Export/Aggregator/AgentAggregator.php b/src/Bundle/ChillCalendarBundle/Export/Aggregator/AgentAggregator.php index 5e2091fac..43354207c 100644 --- a/src/Bundle/ChillCalendarBundle/Export/Aggregator/AgentAggregator.php +++ b/src/Bundle/ChillCalendarBundle/Export/Aggregator/AgentAggregator.php @@ -20,7 +20,9 @@ use Symfony\Component\Form\FormBuilderInterface; final readonly class AgentAggregator implements AggregatorInterface { - public function __construct(private UserRepository $userRepository, private UserRender $userRender) {} + public function __construct(private UserRepository $userRepository, private UserRender $userRender) + { + } public function addRole(): ?string { diff --git a/src/Bundle/ChillCalendarBundle/Export/Aggregator/CancelReasonAggregator.php b/src/Bundle/ChillCalendarBundle/Export/Aggregator/CancelReasonAggregator.php index 7c84653d2..7fe83726c 100644 --- a/src/Bundle/ChillCalendarBundle/Export/Aggregator/CancelReasonAggregator.php +++ b/src/Bundle/ChillCalendarBundle/Export/Aggregator/CancelReasonAggregator.php @@ -20,7 +20,9 @@ use Symfony\Component\Form\FormBuilderInterface; class CancelReasonAggregator implements AggregatorInterface { - public function __construct(private readonly CancelReasonRepository $cancelReasonRepository, private readonly TranslatableStringHelper $translatableStringHelper) {} + public function __construct(private readonly CancelReasonRepository $cancelReasonRepository, private readonly TranslatableStringHelper $translatableStringHelper) + { + } public function addRole(): ?string { diff --git a/src/Bundle/ChillCalendarBundle/Export/Aggregator/JobAggregator.php b/src/Bundle/ChillCalendarBundle/Export/Aggregator/JobAggregator.php index 76cbe5cd8..1d1c4dca9 100644 --- a/src/Bundle/ChillCalendarBundle/Export/Aggregator/JobAggregator.php +++ b/src/Bundle/ChillCalendarBundle/Export/Aggregator/JobAggregator.php @@ -27,7 +27,8 @@ final readonly class JobAggregator implements AggregatorInterface public function __construct( private UserJobRepository $jobRepository, private TranslatableStringHelper $translatableStringHelper - ) {} + ) { + } public function addRole(): ?string { @@ -65,7 +66,9 @@ final readonly class JobAggregator implements AggregatorInterface return Declarations::CALENDAR_TYPE; } - public function buildForm(FormBuilderInterface $builder) {} + public function buildForm(FormBuilderInterface $builder) + { + } public function getFormDefaultData(): array { diff --git a/src/Bundle/ChillCalendarBundle/Export/Aggregator/LocationAggregator.php b/src/Bundle/ChillCalendarBundle/Export/Aggregator/LocationAggregator.php index 6481f95b4..aca3e654b 100644 --- a/src/Bundle/ChillCalendarBundle/Export/Aggregator/LocationAggregator.php +++ b/src/Bundle/ChillCalendarBundle/Export/Aggregator/LocationAggregator.php @@ -19,7 +19,9 @@ use Symfony\Component\Form\FormBuilderInterface; final readonly class LocationAggregator implements AggregatorInterface { - public function __construct(private LocationRepository $locationRepository) {} + public function __construct(private LocationRepository $locationRepository) + { + } public function addRole(): ?string { diff --git a/src/Bundle/ChillCalendarBundle/Export/Aggregator/LocationTypeAggregator.php b/src/Bundle/ChillCalendarBundle/Export/Aggregator/LocationTypeAggregator.php index be9406cfa..1f49ff723 100644 --- a/src/Bundle/ChillCalendarBundle/Export/Aggregator/LocationTypeAggregator.php +++ b/src/Bundle/ChillCalendarBundle/Export/Aggregator/LocationTypeAggregator.php @@ -20,7 +20,9 @@ use Symfony\Component\Form\FormBuilderInterface; final readonly class LocationTypeAggregator implements AggregatorInterface { - public function __construct(private LocationTypeRepository $locationTypeRepository, private TranslatableStringHelper $translatableStringHelper) {} + public function __construct(private LocationTypeRepository $locationTypeRepository, private TranslatableStringHelper $translatableStringHelper) + { + } public function addRole(): ?string { diff --git a/src/Bundle/ChillCalendarBundle/Export/Aggregator/ScopeAggregator.php b/src/Bundle/ChillCalendarBundle/Export/Aggregator/ScopeAggregator.php index 4998f6d1f..d298e63a4 100644 --- a/src/Bundle/ChillCalendarBundle/Export/Aggregator/ScopeAggregator.php +++ b/src/Bundle/ChillCalendarBundle/Export/Aggregator/ScopeAggregator.php @@ -27,7 +27,8 @@ final readonly class ScopeAggregator implements AggregatorInterface public function __construct( private ScopeRepository $scopeRepository, private TranslatableStringHelper $translatableStringHelper - ) {} + ) { + } public function addRole(): ?string { @@ -65,7 +66,9 @@ final readonly class ScopeAggregator implements AggregatorInterface return Declarations::CALENDAR_TYPE; } - public function buildForm(FormBuilderInterface $builder) {} + public function buildForm(FormBuilderInterface $builder) + { + } public function getFormDefaultData(): array { diff --git a/src/Bundle/ChillCalendarBundle/Export/Aggregator/UrgencyAggregator.php b/src/Bundle/ChillCalendarBundle/Export/Aggregator/UrgencyAggregator.php index e9213d3cb..47801add3 100644 --- a/src/Bundle/ChillCalendarBundle/Export/Aggregator/UrgencyAggregator.php +++ b/src/Bundle/ChillCalendarBundle/Export/Aggregator/UrgencyAggregator.php @@ -26,7 +26,9 @@ use Symfony\Contracts\Translation\TranslatorInterface; class UrgencyAggregator implements AggregatorInterface { - public function __construct(private readonly TranslatorInterface $translator) {} + public function __construct(private readonly TranslatorInterface $translator) + { + } public function addRole(): ?string { diff --git a/src/Bundle/ChillCalendarBundle/Export/Export/CountCalendars.php b/src/Bundle/ChillCalendarBundle/Export/Export/CountCalendars.php index f643eaa68..9e7c5e367 100644 --- a/src/Bundle/ChillCalendarBundle/Export/Export/CountCalendars.php +++ b/src/Bundle/ChillCalendarBundle/Export/Export/CountCalendars.php @@ -27,7 +27,8 @@ class CountCalendars implements ExportInterface, GroupedExportInterface { public function __construct( private readonly CalendarRepository $calendarRepository, - ) {} + ) { + } public function buildForm(FormBuilderInterface $builder) { diff --git a/src/Bundle/ChillCalendarBundle/Export/Export/StatCalendarAvgDuration.php b/src/Bundle/ChillCalendarBundle/Export/Export/StatCalendarAvgDuration.php index b69185a17..f7f19d1e4 100644 --- a/src/Bundle/ChillCalendarBundle/Export/Export/StatCalendarAvgDuration.php +++ b/src/Bundle/ChillCalendarBundle/Export/Export/StatCalendarAvgDuration.php @@ -24,7 +24,9 @@ use Symfony\Component\Form\FormBuilderInterface; class StatCalendarAvgDuration implements ExportInterface, GroupedExportInterface { - public function __construct(private readonly CalendarRepository $calendarRepository) {} + public function __construct(private readonly CalendarRepository $calendarRepository) + { + } public function buildForm(FormBuilderInterface $builder): void { diff --git a/src/Bundle/ChillCalendarBundle/Export/Export/StatCalendarSumDuration.php b/src/Bundle/ChillCalendarBundle/Export/Export/StatCalendarSumDuration.php index 8ea23014c..e9920444a 100644 --- a/src/Bundle/ChillCalendarBundle/Export/Export/StatCalendarSumDuration.php +++ b/src/Bundle/ChillCalendarBundle/Export/Export/StatCalendarSumDuration.php @@ -24,7 +24,9 @@ use Symfony\Component\Form\FormBuilderInterface; class StatCalendarSumDuration implements ExportInterface, GroupedExportInterface { - public function __construct(private readonly CalendarRepository $calendarRepository) {} + public function __construct(private readonly CalendarRepository $calendarRepository) + { + } public function buildForm(FormBuilderInterface $builder): void { diff --git a/src/Bundle/ChillCalendarBundle/Export/Filter/AgentFilter.php b/src/Bundle/ChillCalendarBundle/Export/Filter/AgentFilter.php index c16c148fc..888ee4363 100644 --- a/src/Bundle/ChillCalendarBundle/Export/Filter/AgentFilter.php +++ b/src/Bundle/ChillCalendarBundle/Export/Filter/AgentFilter.php @@ -22,7 +22,9 @@ use Symfony\Component\Form\FormBuilderInterface; class AgentFilter implements FilterInterface { - public function __construct(private readonly UserRender $userRender) {} + public function __construct(private readonly UserRender $userRender) + { + } public function addRole(): ?string { diff --git a/src/Bundle/ChillCalendarBundle/Export/Filter/BetweenDatesFilter.php b/src/Bundle/ChillCalendarBundle/Export/Filter/BetweenDatesFilter.php index 90a004388..1fe9eadc5 100644 --- a/src/Bundle/ChillCalendarBundle/Export/Filter/BetweenDatesFilter.php +++ b/src/Bundle/ChillCalendarBundle/Export/Filter/BetweenDatesFilter.php @@ -21,7 +21,9 @@ use Symfony\Component\Form\FormBuilderInterface; class BetweenDatesFilter implements FilterInterface { - public function __construct(private readonly RollingDateConverterInterface $rollingDateConverter) {} + public function __construct(private readonly RollingDateConverterInterface $rollingDateConverter) + { + } public function addRole(): ?string { diff --git a/src/Bundle/ChillCalendarBundle/Export/Filter/CalendarRangeFilter.php b/src/Bundle/ChillCalendarBundle/Export/Filter/CalendarRangeFilter.php index 63149509f..e493ce0bf 100644 --- a/src/Bundle/ChillCalendarBundle/Export/Filter/CalendarRangeFilter.php +++ b/src/Bundle/ChillCalendarBundle/Export/Filter/CalendarRangeFilter.php @@ -34,7 +34,9 @@ class CalendarRangeFilter implements FilterInterface private const DEFAULT_CHOICE = 'false'; - public function __construct(private readonly TranslatorInterface $translator) {} + public function __construct(private readonly TranslatorInterface $translator) + { + } public function addRole(): ?string { diff --git a/src/Bundle/ChillCalendarBundle/Export/Filter/JobFilter.php b/src/Bundle/ChillCalendarBundle/Export/Filter/JobFilter.php index c122a298d..6b81a709f 100644 --- a/src/Bundle/ChillCalendarBundle/Export/Filter/JobFilter.php +++ b/src/Bundle/ChillCalendarBundle/Export/Filter/JobFilter.php @@ -27,7 +27,8 @@ final readonly class JobFilter implements FilterInterface public function __construct( private TranslatableStringHelper $translatableStringHelper - ) {} + ) { + } public function addRole(): ?string { diff --git a/src/Bundle/ChillCalendarBundle/Export/Filter/ScopeFilter.php b/src/Bundle/ChillCalendarBundle/Export/Filter/ScopeFilter.php index 93edc1b3a..ef7c14199 100644 --- a/src/Bundle/ChillCalendarBundle/Export/Filter/ScopeFilter.php +++ b/src/Bundle/ChillCalendarBundle/Export/Filter/ScopeFilter.php @@ -29,7 +29,8 @@ class ScopeFilter implements FilterInterface public function __construct( protected TranslatorInterface $translator, private readonly TranslatableStringHelper $translatableStringHelper - ) {} + ) { + } public function addRole(): ?string { diff --git a/src/Bundle/ChillCalendarBundle/Form/CalendarType.php b/src/Bundle/ChillCalendarBundle/Form/CalendarType.php index eec0b3f9f..b83bb992d 100644 --- a/src/Bundle/ChillCalendarBundle/Form/CalendarType.php +++ b/src/Bundle/ChillCalendarBundle/Form/CalendarType.php @@ -38,7 +38,8 @@ class CalendarType extends AbstractType private readonly IdToLocationDataTransformer $idToLocationDataTransformer, private readonly ThirdPartiesToIdDataTransformer $partiesToIdDataTransformer, private readonly IdToCalendarRangeDataTransformer $calendarRangeDataTransformer - ) {} + ) { + } public function buildForm(FormBuilderInterface $builder, array $options) { diff --git a/src/Bundle/ChillCalendarBundle/Menu/AccompanyingCourseMenuBuilder.php b/src/Bundle/ChillCalendarBundle/Menu/AccompanyingCourseMenuBuilder.php index 6dd5bfa52..3997c4dad 100644 --- a/src/Bundle/ChillCalendarBundle/Menu/AccompanyingCourseMenuBuilder.php +++ b/src/Bundle/ChillCalendarBundle/Menu/AccompanyingCourseMenuBuilder.php @@ -19,7 +19,9 @@ use Symfony\Contracts\Translation\TranslatorInterface; class AccompanyingCourseMenuBuilder implements LocalMenuBuilderInterface { - public function __construct(private readonly Security $security, protected TranslatorInterface $translator) {} + public function __construct(private readonly Security $security, protected TranslatorInterface $translator) + { + } public function buildMenu($menuId, MenuItem $menu, array $parameters) { diff --git a/src/Bundle/ChillCalendarBundle/Menu/PersonMenuBuilder.php b/src/Bundle/ChillCalendarBundle/Menu/PersonMenuBuilder.php index e92a72bb7..c7bbc756c 100644 --- a/src/Bundle/ChillCalendarBundle/Menu/PersonMenuBuilder.php +++ b/src/Bundle/ChillCalendarBundle/Menu/PersonMenuBuilder.php @@ -19,7 +19,9 @@ use Symfony\Contracts\Translation\TranslatorInterface; class PersonMenuBuilder implements LocalMenuBuilderInterface { - public function __construct(private readonly Security $security, protected TranslatorInterface $translator) {} + public function __construct(private readonly Security $security, protected TranslatorInterface $translator) + { + } public function buildMenu($menuId, MenuItem $menu, array $parameters) { diff --git a/src/Bundle/ChillCalendarBundle/Menu/UserMenuBuilder.php b/src/Bundle/ChillCalendarBundle/Menu/UserMenuBuilder.php index 3a062f7b8..90b94b08e 100644 --- a/src/Bundle/ChillCalendarBundle/Menu/UserMenuBuilder.php +++ b/src/Bundle/ChillCalendarBundle/Menu/UserMenuBuilder.php @@ -18,7 +18,9 @@ use Symfony\Contracts\Translation\TranslatorInterface; class UserMenuBuilder implements LocalMenuBuilderInterface { - public function __construct(private readonly Security $security, public TranslatorInterface $translator) {} + public function __construct(private readonly Security $security, public TranslatorInterface $translator) + { + } public function buildMenu($menuId, MenuItem $menu, array $parameters) { diff --git a/src/Bundle/ChillCalendarBundle/Messenger/Doctrine/CalendarEntityListener.php b/src/Bundle/ChillCalendarBundle/Messenger/Doctrine/CalendarEntityListener.php index 8f62fdcdb..d0feca3d8 100644 --- a/src/Bundle/ChillCalendarBundle/Messenger/Doctrine/CalendarEntityListener.php +++ b/src/Bundle/ChillCalendarBundle/Messenger/Doctrine/CalendarEntityListener.php @@ -29,7 +29,9 @@ use Symfony\Component\Security\Core\Security; class CalendarEntityListener { - public function __construct(private readonly MessageBusInterface $messageBus, private readonly Security $security) {} + public function __construct(private readonly MessageBusInterface $messageBus, private readonly Security $security) + { + } public function postPersist(Calendar $calendar, PostPersistEventArgs $args): void { diff --git a/src/Bundle/ChillCalendarBundle/Messenger/Doctrine/CalendarRangeEntityListener.php b/src/Bundle/ChillCalendarBundle/Messenger/Doctrine/CalendarRangeEntityListener.php index 8b875bdcb..cc3bf649e 100644 --- a/src/Bundle/ChillCalendarBundle/Messenger/Doctrine/CalendarRangeEntityListener.php +++ b/src/Bundle/ChillCalendarBundle/Messenger/Doctrine/CalendarRangeEntityListener.php @@ -29,7 +29,9 @@ use Symfony\Component\Security\Core\Security; class CalendarRangeEntityListener { - public function __construct(private readonly MessageBusInterface $messageBus, private readonly Security $security) {} + public function __construct(private readonly MessageBusInterface $messageBus, private readonly Security $security) + { + } public function postPersist(CalendarRange $calendarRange, PostPersistEventArgs $eventArgs): void { diff --git a/src/Bundle/ChillCalendarBundle/Messenger/Handler/CalendarRangeRemoveToRemoteHandler.php b/src/Bundle/ChillCalendarBundle/Messenger/Handler/CalendarRangeRemoveToRemoteHandler.php index 7749d503c..c55bd8144 100644 --- a/src/Bundle/ChillCalendarBundle/Messenger/Handler/CalendarRangeRemoveToRemoteHandler.php +++ b/src/Bundle/ChillCalendarBundle/Messenger/Handler/CalendarRangeRemoveToRemoteHandler.php @@ -31,7 +31,9 @@ use Symfony\Component\Messenger\Handler\MessageHandlerInterface; */ class CalendarRangeRemoveToRemoteHandler implements MessageHandlerInterface { - public function __construct(private readonly RemoteCalendarConnectorInterface $remoteCalendarConnector, private readonly UserRepository $userRepository) {} + public function __construct(private readonly RemoteCalendarConnectorInterface $remoteCalendarConnector, private readonly UserRepository $userRepository) + { + } public function __invoke(CalendarRangeRemovedMessage $calendarRangeRemovedMessage) { diff --git a/src/Bundle/ChillCalendarBundle/Messenger/Handler/CalendarRangeToRemoteHandler.php b/src/Bundle/ChillCalendarBundle/Messenger/Handler/CalendarRangeToRemoteHandler.php index c9fd1b939..950ca526d 100644 --- a/src/Bundle/ChillCalendarBundle/Messenger/Handler/CalendarRangeToRemoteHandler.php +++ b/src/Bundle/ChillCalendarBundle/Messenger/Handler/CalendarRangeToRemoteHandler.php @@ -32,7 +32,9 @@ use Symfony\Component\Messenger\Handler\MessageHandlerInterface; */ class CalendarRangeToRemoteHandler implements MessageHandlerInterface { - public function __construct(private readonly CalendarRangeRepository $calendarRangeRepository, private readonly RemoteCalendarConnectorInterface $remoteCalendarConnector, private readonly EntityManagerInterface $entityManager) {} + public function __construct(private readonly CalendarRangeRepository $calendarRangeRepository, private readonly RemoteCalendarConnectorInterface $remoteCalendarConnector, private readonly EntityManagerInterface $entityManager) + { + } public function __invoke(CalendarRangeMessage $calendarRangeMessage): void { diff --git a/src/Bundle/ChillCalendarBundle/Messenger/Handler/CalendarRemoveHandler.php b/src/Bundle/ChillCalendarBundle/Messenger/Handler/CalendarRemoveHandler.php index 73e8a0c37..6838d3147 100644 --- a/src/Bundle/ChillCalendarBundle/Messenger/Handler/CalendarRemoveHandler.php +++ b/src/Bundle/ChillCalendarBundle/Messenger/Handler/CalendarRemoveHandler.php @@ -31,7 +31,9 @@ use Symfony\Component\Messenger\Handler\MessageHandlerInterface; */ class CalendarRemoveHandler implements MessageHandlerInterface { - public function __construct(private readonly RemoteCalendarConnectorInterface $remoteCalendarConnector, private readonly CalendarRangeRepository $calendarRangeRepository, private readonly UserRepositoryInterface $userRepository) {} + public function __construct(private readonly RemoteCalendarConnectorInterface $remoteCalendarConnector, private readonly CalendarRangeRepository $calendarRangeRepository, private readonly UserRepositoryInterface $userRepository) + { + } public function __invoke(CalendarRemovedMessage $message) { diff --git a/src/Bundle/ChillCalendarBundle/Messenger/Handler/CalendarToRemoteHandler.php b/src/Bundle/ChillCalendarBundle/Messenger/Handler/CalendarToRemoteHandler.php index 6a1388d2e..310e8734b 100644 --- a/src/Bundle/ChillCalendarBundle/Messenger/Handler/CalendarToRemoteHandler.php +++ b/src/Bundle/ChillCalendarBundle/Messenger/Handler/CalendarToRemoteHandler.php @@ -37,7 +37,9 @@ use Symfony\Component\Messenger\Handler\MessageHandlerInterface; */ class CalendarToRemoteHandler implements MessageHandlerInterface { - public function __construct(private readonly CalendarRangeRepository $calendarRangeRepository, private readonly CalendarRepository $calendarRepository, private readonly EntityManagerInterface $entityManager, private readonly InviteRepository $inviteRepository, private readonly RemoteCalendarConnectorInterface $calendarConnector, private readonly UserRepository $userRepository) {} + public function __construct(private readonly CalendarRangeRepository $calendarRangeRepository, private readonly CalendarRepository $calendarRepository, private readonly EntityManagerInterface $entityManager, private readonly InviteRepository $inviteRepository, private readonly RemoteCalendarConnectorInterface $calendarConnector, private readonly UserRepository $userRepository) + { + } public function __invoke(CalendarMessage $calendarMessage) { diff --git a/src/Bundle/ChillCalendarBundle/Messenger/Handler/InviteUpdateHandler.php b/src/Bundle/ChillCalendarBundle/Messenger/Handler/InviteUpdateHandler.php index 7ca5f2c12..1d987c19e 100644 --- a/src/Bundle/ChillCalendarBundle/Messenger/Handler/InviteUpdateHandler.php +++ b/src/Bundle/ChillCalendarBundle/Messenger/Handler/InviteUpdateHandler.php @@ -31,7 +31,9 @@ use Symfony\Component\Messenger\Handler\MessageHandlerInterface; */ class InviteUpdateHandler implements MessageHandlerInterface { - public function __construct(private readonly EntityManagerInterface $em, private readonly InviteRepository $inviteRepository, private readonly RemoteCalendarConnectorInterface $remoteCalendarConnector) {} + public function __construct(private readonly EntityManagerInterface $em, private readonly InviteRepository $inviteRepository, private readonly RemoteCalendarConnectorInterface $remoteCalendarConnector) + { + } public function __invoke(InviteUpdateMessage $inviteUpdateMessage): void { diff --git a/src/Bundle/ChillCalendarBundle/Messenger/Handler/MSGraphChangeNotificationHandler.php b/src/Bundle/ChillCalendarBundle/Messenger/Handler/MSGraphChangeNotificationHandler.php index 7a67bee61..26908a6e4 100644 --- a/src/Bundle/ChillCalendarBundle/Messenger/Handler/MSGraphChangeNotificationHandler.php +++ b/src/Bundle/ChillCalendarBundle/Messenger/Handler/MSGraphChangeNotificationHandler.php @@ -36,7 +36,9 @@ use Symfony\Component\Messenger\Handler\MessageHandlerInterface; */ class MSGraphChangeNotificationHandler implements MessageHandlerInterface { - public function __construct(private readonly CalendarRangeRepository $calendarRangeRepository, private readonly CalendarRangeSyncer $calendarRangeSyncer, private readonly CalendarRepository $calendarRepository, private readonly CalendarSyncer $calendarSyncer, private readonly EntityManagerInterface $em, private readonly LoggerInterface $logger, private readonly MapCalendarToUser $mapCalendarToUser, private readonly UserRepository $userRepository) {} + public function __construct(private readonly CalendarRangeRepository $calendarRangeRepository, private readonly CalendarRangeSyncer $calendarRangeSyncer, private readonly CalendarRepository $calendarRepository, private readonly CalendarSyncer $calendarSyncer, private readonly EntityManagerInterface $em, private readonly LoggerInterface $logger, private readonly MapCalendarToUser $mapCalendarToUser, private readonly UserRepository $userRepository) + { + } public function __invoke(MSGraphChangeNotificationMessage $changeNotificationMessage): void { diff --git a/src/Bundle/ChillCalendarBundle/Messenger/Message/MSGraphChangeNotificationMessage.php b/src/Bundle/ChillCalendarBundle/Messenger/Message/MSGraphChangeNotificationMessage.php index 15b8c6733..682369e03 100644 --- a/src/Bundle/ChillCalendarBundle/Messenger/Message/MSGraphChangeNotificationMessage.php +++ b/src/Bundle/ChillCalendarBundle/Messenger/Message/MSGraphChangeNotificationMessage.php @@ -20,7 +20,9 @@ namespace Chill\CalendarBundle\Messenger\Message; class MSGraphChangeNotificationMessage { - public function __construct(private readonly array $content, private readonly int $userId) {} + public function __construct(private readonly array $content, private readonly int $userId) + { + } public function getContent(): array { diff --git a/src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/MSGraph/AddressConverter.php b/src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/MSGraph/AddressConverter.php index 2535e23ca..2764a46e3 100644 --- a/src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/MSGraph/AddressConverter.php +++ b/src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/MSGraph/AddressConverter.php @@ -24,7 +24,9 @@ use Chill\MainBundle\Templating\TranslatableStringHelperInterface; class AddressConverter { - public function __construct(private readonly AddressRender $addressRender, private readonly TranslatableStringHelperInterface $translatableStringHelper) {} + public function __construct(private readonly AddressRender $addressRender, private readonly TranslatableStringHelperInterface $translatableStringHelper) + { + } public function addressToRemote(Address $address): array { diff --git a/src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/MSGraph/EventsOnUserSubscriptionCreator.php b/src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/MSGraph/EventsOnUserSubscriptionCreator.php index 080140d86..f3d764acc 100644 --- a/src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/MSGraph/EventsOnUserSubscriptionCreator.php +++ b/src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/MSGraph/EventsOnUserSubscriptionCreator.php @@ -28,7 +28,9 @@ use Symfony\Contracts\HttpClient\Exception\ClientExceptionInterface; */ class EventsOnUserSubscriptionCreator { - public function __construct(private readonly LoggerInterface $logger, private readonly MachineHttpClient $machineHttpClient, private readonly MapCalendarToUser $mapCalendarToUser, private readonly UrlGeneratorInterface $urlGenerator) {} + public function __construct(private readonly LoggerInterface $logger, private readonly MachineHttpClient $machineHttpClient, private readonly MapCalendarToUser $mapCalendarToUser, private readonly UrlGeneratorInterface $urlGenerator) + { + } /** * @return array{secret: string, id: string, expiration: int} diff --git a/src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/MSGraph/LocationConverter.php b/src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/MSGraph/LocationConverter.php index f14683b9e..cbf97806e 100644 --- a/src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/MSGraph/LocationConverter.php +++ b/src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/MSGraph/LocationConverter.php @@ -22,7 +22,9 @@ use Chill\MainBundle\Entity\Location; class LocationConverter { - public function __construct(private readonly AddressConverter $addressConverter) {} + public function __construct(private readonly AddressConverter $addressConverter) + { + } public function locationToRemote(Location $location): array { diff --git a/src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/MSGraph/MSUserAbsenceReader.php b/src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/MSGraph/MSUserAbsenceReader.php index 37e3e1996..58cd04dfa 100644 --- a/src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/MSGraph/MSUserAbsenceReader.php +++ b/src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/MSGraph/MSUserAbsenceReader.php @@ -27,12 +27,13 @@ final readonly class MSUserAbsenceReader implements MSUserAbsenceReaderInterface private HttpClientInterface $machineHttpClient, private MapCalendarToUser $mapCalendarToUser, private ClockInterface $clock, - ) {} + ) { + } /** * @throw UserAbsenceSyncException when the data cannot be reached or is not valid from microsoft */ - public function isUserAbsent(User $user): null|bool + public function isUserAbsent(User $user): bool|null { $id = $this->mapCalendarToUser->getUserId($user); diff --git a/src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/MSGraph/MSUserAbsenceReaderInterface.php b/src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/MSGraph/MSUserAbsenceReaderInterface.php index f67562e27..a918bb7ea 100644 --- a/src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/MSGraph/MSUserAbsenceReaderInterface.php +++ b/src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/MSGraph/MSUserAbsenceReaderInterface.php @@ -18,5 +18,5 @@ interface MSUserAbsenceReaderInterface /** * @throw UserAbsenceSyncException when the data cannot be reached or is not valid from microsoft */ - public function isUserAbsent(User $user): null|bool; + public function isUserAbsent(User $user): bool|null; } diff --git a/src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/MSGraph/MSUserAbsenceSync.php b/src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/MSGraph/MSUserAbsenceSync.php index 318580ffc..1d7b181f3 100644 --- a/src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/MSGraph/MSUserAbsenceSync.php +++ b/src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/MSGraph/MSUserAbsenceSync.php @@ -21,7 +21,8 @@ readonly class MSUserAbsenceSync private MSUserAbsenceReaderInterface $absenceReader, private ClockInterface $clock, private LoggerInterface $logger, - ) {} + ) { + } public function syncUserAbsence(User $user): void { diff --git a/src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/MSGraph/MachineHttpClient.php b/src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/MSGraph/MachineHttpClient.php index ce490ce3f..f84d04120 100644 --- a/src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/MSGraph/MachineHttpClient.php +++ b/src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/MSGraph/MachineHttpClient.php @@ -29,7 +29,7 @@ class MachineHttpClient implements HttpClientInterface private readonly HttpClientInterface $decoratedClient; - public function __construct(private readonly MachineTokenStorage $machineTokenStorage, HttpClientInterface $decoratedClient = null) + public function __construct(private readonly MachineTokenStorage $machineTokenStorage, ?HttpClientInterface $decoratedClient = null) { $this->decoratedClient = $decoratedClient ?? \Symfony\Component\HttpClient\HttpClient::create(); } @@ -68,7 +68,7 @@ class MachineHttpClient implements HttpClientInterface return $this->decoratedClient->request($method, $url, $options); } - public function stream($responses, float $timeout = null): ResponseStreamInterface + public function stream($responses, ?float $timeout = null): ResponseStreamInterface { return $this->decoratedClient->stream($responses, $timeout); } diff --git a/src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/MSGraph/MachineTokenStorage.php b/src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/MSGraph/MachineTokenStorage.php index f2a0fc096..f5d25caaf 100644 --- a/src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/MSGraph/MachineTokenStorage.php +++ b/src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/MSGraph/MachineTokenStorage.php @@ -29,7 +29,9 @@ class MachineTokenStorage private ?AccessTokenInterface $accessToken = null; - public function __construct(private readonly Azure $azure, private readonly ChillRedis $chillRedis) {} + public function __construct(private readonly Azure $azure, private readonly ChillRedis $chillRedis) + { + } public function getToken(): AccessTokenInterface { diff --git a/src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/MSGraph/MapCalendarToUser.php b/src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/MSGraph/MapCalendarToUser.php index 4b214e6d0..aa3b1c4a4 100644 --- a/src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/MSGraph/MapCalendarToUser.php +++ b/src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/MSGraph/MapCalendarToUser.php @@ -36,7 +36,9 @@ class MapCalendarToUser final public const SECRET_SUBSCRIPTION_EVENT = 'subscription_events_secret'; - public function __construct(private readonly HttpClientInterface $machineHttpClient, private readonly LoggerInterface $logger) {} + public function __construct(private readonly HttpClientInterface $machineHttpClient, private readonly LoggerInterface $logger) + { + } public function getActiveSubscriptionId(User $user): string { @@ -176,8 +178,8 @@ class MapCalendarToUser public function writeSubscriptionMetadata( User $user, int $expiration, - string $id = null, - string $secret = null + ?string $id = null, + ?string $secret = null ): void { $user->setAttributeByDomain(self::METADATA_KEY, self::EXPIRATION_SUBSCRIPTION_EVENT, $expiration); diff --git a/src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/MSGraph/OnBehalfOfUserHttpClient.php b/src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/MSGraph/OnBehalfOfUserHttpClient.php index d969a56b6..02c9ea806 100644 --- a/src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/MSGraph/OnBehalfOfUserHttpClient.php +++ b/src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/MSGraph/OnBehalfOfUserHttpClient.php @@ -29,7 +29,7 @@ class OnBehalfOfUserHttpClient private readonly HttpClientInterface $decoratedClient; - public function __construct(private readonly OnBehalfOfUserTokenStorage $tokenStorage, HttpClientInterface $decoratedClient = null) + public function __construct(private readonly OnBehalfOfUserTokenStorage $tokenStorage, ?HttpClientInterface $decoratedClient = null) { $this->decoratedClient = $decoratedClient ?? \Symfony\Component\HttpClient\HttpClient::create(); } @@ -63,7 +63,7 @@ class OnBehalfOfUserHttpClient return $this->decoratedClient->request($method, $url, $options); } - public function stream($responses, float $timeout = null): ResponseStreamInterface + public function stream($responses, ?float $timeout = null): ResponseStreamInterface { return $this->decoratedClient->stream($responses, $timeout); } diff --git a/src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/MSGraph/OnBehalfOfUserTokenStorage.php b/src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/MSGraph/OnBehalfOfUserTokenStorage.php index d8fff109b..cc5b72b42 100644 --- a/src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/MSGraph/OnBehalfOfUserTokenStorage.php +++ b/src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/MSGraph/OnBehalfOfUserTokenStorage.php @@ -29,7 +29,9 @@ class OnBehalfOfUserTokenStorage { final public const MS_GRAPH_ACCESS_TOKEN = 'msgraph_access_token'; - public function __construct(private readonly Azure $azure, private readonly SessionInterface $session) {} + public function __construct(private readonly Azure $azure, private readonly SessionInterface $session) + { + } public function getToken(): AccessToken { diff --git a/src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/MSGraph/RemoteToLocalSync/CalendarRangeSyncer.php b/src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/MSGraph/RemoteToLocalSync/CalendarRangeSyncer.php index 1dffe198c..0c9621aeb 100644 --- a/src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/MSGraph/RemoteToLocalSync/CalendarRangeSyncer.php +++ b/src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/MSGraph/RemoteToLocalSync/CalendarRangeSyncer.php @@ -32,7 +32,9 @@ class CalendarRangeSyncer /** * @param MachineHttpClient $machineHttpClient */ - public function __construct(private readonly EntityManagerInterface $em, private readonly LoggerInterface $logger, private readonly HttpClientInterface $machineHttpClient) {} + public function __construct(private readonly EntityManagerInterface $em, private readonly LoggerInterface $logger, private readonly HttpClientInterface $machineHttpClient) + { + } public function handleCalendarRangeSync(CalendarRange $calendarRange, array $notification, User $user): void { diff --git a/src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/MSGraph/RemoteToLocalSync/CalendarSyncer.php b/src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/MSGraph/RemoteToLocalSync/CalendarSyncer.php index 9b4daf626..06e0f2b39 100644 --- a/src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/MSGraph/RemoteToLocalSync/CalendarSyncer.php +++ b/src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/MSGraph/RemoteToLocalSync/CalendarSyncer.php @@ -29,7 +29,9 @@ use Symfony\Contracts\HttpClient\HttpClientInterface; class CalendarSyncer { - public function __construct(private readonly LoggerInterface $logger, private readonly HttpClientInterface $machineHttpClient, private readonly UserRepositoryInterface $userRepository) {} + public function __construct(private readonly LoggerInterface $logger, private readonly HttpClientInterface $machineHttpClient, private readonly UserRepositoryInterface $userRepository) + { + } public function handleCalendarSync(Calendar $calendar, array $notification, User $user): void { diff --git a/src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/MSGraphRemoteCalendarConnector.php b/src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/MSGraphRemoteCalendarConnector.php index 768ad2a44..27297f3ac 100644 --- a/src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/MSGraphRemoteCalendarConnector.php +++ b/src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/MSGraphRemoteCalendarConnector.php @@ -41,7 +41,9 @@ class MSGraphRemoteCalendarConnector implements RemoteCalendarConnectorInterface { private array $cacheScheduleTimeForUser = []; - public function __construct(private readonly CalendarRepository $calendarRepository, private readonly CalendarRangeRepository $calendarRangeRepository, private readonly HttpClientInterface $machineHttpClient, private readonly MapCalendarToUser $mapCalendarToUser, private readonly LoggerInterface $logger, private readonly OnBehalfOfUserTokenStorage $tokenStorage, private readonly OnBehalfOfUserHttpClient $userHttpClient, private readonly RemoteEventConverter $remoteEventConverter, private readonly TranslatorInterface $translator, private readonly UrlGeneratorInterface $urlGenerator, private readonly Security $security) {} + public function __construct(private readonly CalendarRepository $calendarRepository, private readonly CalendarRangeRepository $calendarRangeRepository, private readonly HttpClientInterface $machineHttpClient, private readonly MapCalendarToUser $mapCalendarToUser, private readonly LoggerInterface $logger, private readonly OnBehalfOfUserTokenStorage $tokenStorage, private readonly OnBehalfOfUserHttpClient $userHttpClient, private readonly RemoteEventConverter $remoteEventConverter, private readonly TranslatorInterface $translator, private readonly UrlGeneratorInterface $urlGenerator, private readonly Security $security) + { + } public function countEventsForUser(User $user, \DateTimeImmutable $startDate, \DateTimeImmutable $endDate): int { @@ -169,7 +171,7 @@ class MSGraphRemoteCalendarConnector implements RemoteCalendarConnectorInterface } } - public function removeCalendar(string $remoteId, array $remoteAttributes, User $user, CalendarRange $associatedCalendarRange = null): void + public function removeCalendar(string $remoteId, array $remoteAttributes, User $user, ?CalendarRange $associatedCalendarRange = null): void { if ('' === $remoteId) { return; diff --git a/src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/NullRemoteCalendarConnector.php b/src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/NullRemoteCalendarConnector.php index b4e2a5d3a..7da67df0c 100644 --- a/src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/NullRemoteCalendarConnector.php +++ b/src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/NullRemoteCalendarConnector.php @@ -46,13 +46,23 @@ class NullRemoteCalendarConnector implements RemoteCalendarConnectorInterface return []; } - public function removeCalendar(string $remoteId, array $remoteAttributes, User $user, CalendarRange $associatedCalendarRange = null): void {} + public function removeCalendar(string $remoteId, array $remoteAttributes, User $user, ?CalendarRange $associatedCalendarRange = null): void + { + } - public function removeCalendarRange(string $remoteId, array $remoteAttributes, User $user): void {} + public function removeCalendarRange(string $remoteId, array $remoteAttributes, User $user): void + { + } - public function syncCalendar(Calendar $calendar, string $action, ?CalendarRange $previousCalendarRange, ?User $previousMainUser, ?array $oldInvites, ?array $newInvites): void {} + public function syncCalendar(Calendar $calendar, string $action, ?CalendarRange $previousCalendarRange, ?User $previousMainUser, ?array $oldInvites, ?array $newInvites): void + { + } - public function syncCalendarRange(CalendarRange $calendarRange): void {} + public function syncCalendarRange(CalendarRange $calendarRange): void + { + } - public function syncInvite(Invite $invite): void {} + public function syncInvite(Invite $invite): void + { + } } diff --git a/src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/RemoteCalendarConnectorInterface.php b/src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/RemoteCalendarConnectorInterface.php index 53d2c8602..1e3c16845 100644 --- a/src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/RemoteCalendarConnectorInterface.php +++ b/src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/RemoteCalendarConnectorInterface.php @@ -47,7 +47,7 @@ interface RemoteCalendarConnectorInterface */ public function listEventsForUser(User $user, \DateTimeImmutable $startDate, \DateTimeImmutable $endDate, ?int $offset = 0, ?int $limit = 50): array; - public function removeCalendar(string $remoteId, array $remoteAttributes, User $user, CalendarRange $associatedCalendarRange = null): void; + public function removeCalendar(string $remoteId, array $remoteAttributes, User $user, ?CalendarRange $associatedCalendarRange = null): void; public function removeCalendarRange(string $remoteId, array $remoteAttributes, User $user): void; diff --git a/src/Bundle/ChillCalendarBundle/RemoteCalendar/Model/RemoteEvent.php b/src/Bundle/ChillCalendarBundle/RemoteCalendar/Model/RemoteEvent.php index 40d1d1435..0c87ae4eb 100644 --- a/src/Bundle/ChillCalendarBundle/RemoteCalendar/Model/RemoteEvent.php +++ b/src/Bundle/ChillCalendarBundle/RemoteCalendar/Model/RemoteEvent.php @@ -44,5 +44,6 @@ class RemoteEvent * @Serializer\Groups({"read"}) */ public bool $isAllDay = false - ) {} + ) { + } } diff --git a/src/Bundle/ChillCalendarBundle/Repository/CalendarACLAwareRepository.php b/src/Bundle/ChillCalendarBundle/Repository/CalendarACLAwareRepository.php index 8f490f376..a3350a7cd 100644 --- a/src/Bundle/ChillCalendarBundle/Repository/CalendarACLAwareRepository.php +++ b/src/Bundle/ChillCalendarBundle/Repository/CalendarACLAwareRepository.php @@ -28,7 +28,9 @@ use Doctrine\ORM\QueryBuilder; class CalendarACLAwareRepository implements CalendarACLAwareRepositoryInterface { - public function __construct(private readonly AccompanyingPeriodACLAwareRepositoryInterface $accompanyingPeriodACLAwareRepository, private readonly EntityManagerInterface $em) {} + public function __construct(private readonly AccompanyingPeriodACLAwareRepositoryInterface $accompanyingPeriodACLAwareRepository, private readonly EntityManagerInterface $em) + { + } public function buildQueryByAccompanyingPeriod(AccompanyingPeriod $period, ?\DateTimeImmutable $startDate, ?\DateTimeImmutable $endDate): QueryBuilder { @@ -157,7 +159,7 @@ class CalendarACLAwareRepository implements CalendarACLAwareRepositoryInterface /** * @return array|Calendar[] */ - public function findByAccompanyingPeriod(AccompanyingPeriod $period, ?\DateTimeImmutable $startDate, ?\DateTimeImmutable $endDate, ?array $orderBy = [], int $offset = null, int $limit = null): array + public function findByAccompanyingPeriod(AccompanyingPeriod $period, ?\DateTimeImmutable $startDate, ?\DateTimeImmutable $endDate, ?array $orderBy = [], ?int $offset = null, ?int $limit = null): array { $qb = $this->buildQueryByAccompanyingPeriod($period, $startDate, $endDate)->select('c'); @@ -176,7 +178,7 @@ class CalendarACLAwareRepository implements CalendarACLAwareRepositoryInterface return $qb->getQuery()->getResult(); } - public function findByPerson(Person $person, ?\DateTimeImmutable $startDate, ?\DateTimeImmutable $endDate, ?array $orderBy = [], int $offset = null, int $limit = null): array + public function findByPerson(Person $person, ?\DateTimeImmutable $startDate, ?\DateTimeImmutable $endDate, ?array $orderBy = [], ?int $offset = null, ?int $limit = null): array { $qb = $this->buildQueryByPerson($person, $startDate, $endDate) ->select('c'); diff --git a/src/Bundle/ChillCalendarBundle/Repository/CalendarACLAwareRepositoryInterface.php b/src/Bundle/ChillCalendarBundle/Repository/CalendarACLAwareRepositoryInterface.php index f6d1b5c17..78f71229d 100644 --- a/src/Bundle/ChillCalendarBundle/Repository/CalendarACLAwareRepositoryInterface.php +++ b/src/Bundle/ChillCalendarBundle/Repository/CalendarACLAwareRepositoryInterface.php @@ -46,7 +46,7 @@ interface CalendarACLAwareRepositoryInterface /** * @return array|Calendar[] */ - public function findByAccompanyingPeriod(AccompanyingPeriod $period, ?\DateTimeImmutable $startDate, ?\DateTimeImmutable $endDate, ?array $orderBy = [], int $offset = null, int $limit = null): array; + public function findByAccompanyingPeriod(AccompanyingPeriod $period, ?\DateTimeImmutable $startDate, ?\DateTimeImmutable $endDate, ?array $orderBy = [], ?int $offset = null, ?int $limit = null): array; /** * Return all the calendars which are associated with a person, either on @see{Calendar::person} or within. @@ -58,5 +58,5 @@ interface CalendarACLAwareRepositoryInterface * * @return array|Calendar[] */ - public function findByPerson(Person $person, ?\DateTimeImmutable $startDate, ?\DateTimeImmutable $endDate, ?array $orderBy = [], int $offset = null, int $limit = null): array; + public function findByPerson(Person $person, ?\DateTimeImmutable $startDate, ?\DateTimeImmutable $endDate, ?array $orderBy = [], ?int $offset = null, ?int $limit = null): array; } diff --git a/src/Bundle/ChillCalendarBundle/Repository/CalendarDocRepository.php b/src/Bundle/ChillCalendarBundle/Repository/CalendarDocRepository.php index fb71717d0..dd593bf3c 100644 --- a/src/Bundle/ChillCalendarBundle/Repository/CalendarDocRepository.php +++ b/src/Bundle/ChillCalendarBundle/Repository/CalendarDocRepository.php @@ -35,7 +35,7 @@ class CalendarDocRepository implements ObjectRepository, CalendarDocRepositoryIn return $this->repository->findAll(); } - public function findBy(array $criteria, array $orderBy = null, int $limit = null, int $offset = null) + public function findBy(array $criteria, ?array $orderBy = null, ?int $limit = null, ?int $offset = null) { return $this->repository->findBy($criteria, $orderBy, $limit, $offset); } diff --git a/src/Bundle/ChillCalendarBundle/Repository/CalendarDocRepositoryInterface.php b/src/Bundle/ChillCalendarBundle/Repository/CalendarDocRepositoryInterface.php index 6d86fd943..d2b1951df 100644 --- a/src/Bundle/ChillCalendarBundle/Repository/CalendarDocRepositoryInterface.php +++ b/src/Bundle/ChillCalendarBundle/Repository/CalendarDocRepositoryInterface.php @@ -25,7 +25,7 @@ interface CalendarDocRepositoryInterface /** * @return array|CalendarDoc[] */ - public function findBy(array $criteria, array $orderBy = null, int $limit = null, int $offset = null); + public function findBy(array $criteria, ?array $orderBy = null, ?int $limit = null, ?int $offset = null); public function findOneBy(array $criteria): ?CalendarDoc; diff --git a/src/Bundle/ChillCalendarBundle/Repository/CalendarRangeRepository.php b/src/Bundle/ChillCalendarBundle/Repository/CalendarRangeRepository.php index a707ccde9..d6e1ac8a5 100644 --- a/src/Bundle/ChillCalendarBundle/Repository/CalendarRangeRepository.php +++ b/src/Bundle/ChillCalendarBundle/Repository/CalendarRangeRepository.php @@ -52,7 +52,7 @@ class CalendarRangeRepository implements ObjectRepository /** * @return array|CalendarRange[] */ - public function findBy(array $criteria, array $orderBy = null, int $limit = null, int $offset = null) + public function findBy(array $criteria, ?array $orderBy = null, ?int $limit = null, ?int $offset = null) { return $this->repository->findBy($criteria, $orderBy, $limit, $offset); } @@ -64,8 +64,8 @@ class CalendarRangeRepository implements ObjectRepository User $user, \DateTimeImmutable $from, \DateTimeImmutable $to, - int $limit = null, - int $offset = null + ?int $limit = null, + ?int $offset = null ): array { $qb = $this->buildQueryAvailableRangesForUser($user, $from, $to); diff --git a/src/Bundle/ChillCalendarBundle/Repository/CalendarRepository.php b/src/Bundle/ChillCalendarBundle/Repository/CalendarRepository.php index 486493b21..3121854e5 100644 --- a/src/Bundle/ChillCalendarBundle/Repository/CalendarRepository.php +++ b/src/Bundle/ChillCalendarBundle/Repository/CalendarRepository.php @@ -46,7 +46,7 @@ class CalendarRepository implements ObjectRepository ->getSingleScalarResult(); } - public function createQueryBuilder(string $alias, string $indexBy = null): QueryBuilder + public function createQueryBuilder(string $alias, ?string $indexBy = null): QueryBuilder { return $this->repository->createQueryBuilder($alias, $indexBy); } @@ -67,7 +67,7 @@ class CalendarRepository implements ObjectRepository /** * @return array|Calendar[] */ - public function findBy(array $criteria, array $orderBy = null, int $limit = null, int $offset = null): array + public function findBy(array $criteria, ?array $orderBy = null, ?int $limit = null, ?int $offset = null): array { return $this->repository->findBy($criteria, $orderBy, $limit, $offset); } @@ -75,7 +75,7 @@ class CalendarRepository implements ObjectRepository /** * @return array|Calendar[] */ - public function findByAccompanyingPeriod(AccompanyingPeriod $period, array $orderBy = null, int $limit = null, int $offset = null): array + public function findByAccompanyingPeriod(AccompanyingPeriod $period, ?array $orderBy = null, ?int $limit = null, ?int $offset = null): array { return $this->findBy( [ @@ -87,7 +87,7 @@ class CalendarRepository implements ObjectRepository ); } - public function findByNotificationAvailable(\DateTimeImmutable $startDate, \DateTimeImmutable $endDate, int $limit = null, int $offset = null): array + public function findByNotificationAvailable(\DateTimeImmutable $startDate, \DateTimeImmutable $endDate, ?int $limit = null, ?int $offset = null): array { $qb = $this->queryByNotificationAvailable($startDate, $endDate)->select('c'); @@ -105,7 +105,7 @@ class CalendarRepository implements ObjectRepository /** * @return array|Calendar[] */ - public function findByUser(User $user, \DateTimeImmutable $from, \DateTimeImmutable $to, int $limit = null, int $offset = null): array + public function findByUser(User $user, \DateTimeImmutable $from, \DateTimeImmutable $to, ?int $limit = null, ?int $offset = null): array { $qb = $this->buildQueryByUser($user, $from, $to)->select('c'); diff --git a/src/Bundle/ChillCalendarBundle/Repository/InviteRepository.php b/src/Bundle/ChillCalendarBundle/Repository/InviteRepository.php index c6f163aa3..8778330f8 100644 --- a/src/Bundle/ChillCalendarBundle/Repository/InviteRepository.php +++ b/src/Bundle/ChillCalendarBundle/Repository/InviteRepository.php @@ -41,7 +41,7 @@ class InviteRepository implements ObjectRepository /** * @return array|Invite[] */ - public function findBy(array $criteria, array $orderBy = null, int $limit = null, int $offset = null) + public function findBy(array $criteria, ?array $orderBy = null, ?int $limit = null, ?int $offset = null) { return $this->entityRepository->findBy($criteria, $orderBy, $limit, $offset); } diff --git a/src/Bundle/ChillCalendarBundle/Security/Voter/CalendarDocVoter.php b/src/Bundle/ChillCalendarBundle/Security/Voter/CalendarDocVoter.php index a0e653cb1..5eaa85871 100644 --- a/src/Bundle/ChillCalendarBundle/Security/Voter/CalendarDocVoter.php +++ b/src/Bundle/ChillCalendarBundle/Security/Voter/CalendarDocVoter.php @@ -27,7 +27,9 @@ class CalendarDocVoter extends Voter 'CHILL_CALENDAR_DOC_SEE', ]; - public function __construct(private readonly Security $security) {} + public function __construct(private readonly Security $security) + { + } protected function supports($attribute, $subject): bool { diff --git a/src/Bundle/ChillCalendarBundle/Service/DocGenerator/CalendarContext.php b/src/Bundle/ChillCalendarBundle/Service/DocGenerator/CalendarContext.php index 087f5ea86..27cfb05e6 100644 --- a/src/Bundle/ChillCalendarBundle/Service/DocGenerator/CalendarContext.php +++ b/src/Bundle/ChillCalendarBundle/Service/DocGenerator/CalendarContext.php @@ -41,7 +41,8 @@ final readonly class CalendarContext implements CalendarContextInterface private ThirdPartyRender $thirdPartyRender, private ThirdPartyRepository $thirdPartyRepository, private TranslatableStringHelperInterface $translatableStringHelper - ) {} + ) { + } public function adminFormReverseTransform(array $data): array { diff --git a/src/Bundle/ChillCalendarBundle/Service/DocGenerator/CalendarContextInterface.php b/src/Bundle/ChillCalendarBundle/Service/DocGenerator/CalendarContextInterface.php index 09a333f3f..917a0b5fa 100644 --- a/src/Bundle/ChillCalendarBundle/Service/DocGenerator/CalendarContextInterface.php +++ b/src/Bundle/ChillCalendarBundle/Service/DocGenerator/CalendarContextInterface.php @@ -19,4 +19,6 @@ use Chill\DocGeneratorBundle\Context\DocGeneratorContextWithPublicFormInterface; * @extends DocGeneratorContextWithPublicFormInterface * @extends DocGeneratorContextWithAdminFormInterface */ -interface CalendarContextInterface extends DocGeneratorContextWithPublicFormInterface, DocGeneratorContextWithAdminFormInterface {} +interface CalendarContextInterface extends DocGeneratorContextWithPublicFormInterface, DocGeneratorContextWithAdminFormInterface +{ +} diff --git a/src/Bundle/ChillCalendarBundle/Service/GenericDoc/Providers/AccompanyingPeriodCalendarGenericDocProvider.php b/src/Bundle/ChillCalendarBundle/Service/GenericDoc/Providers/AccompanyingPeriodCalendarGenericDocProvider.php index 5e4e7de83..faca60a67 100644 --- a/src/Bundle/ChillCalendarBundle/Service/GenericDoc/Providers/AccompanyingPeriodCalendarGenericDocProvider.php +++ b/src/Bundle/ChillCalendarBundle/Service/GenericDoc/Providers/AccompanyingPeriodCalendarGenericDocProvider.php @@ -38,12 +38,13 @@ final readonly class AccompanyingPeriodCalendarGenericDocProvider implements Gen public function __construct( private Security $security, private EntityManagerInterface $em - ) {} + ) { + } /** * @throws MappingException */ - public function buildFetchQueryForAccompanyingPeriod(AccompanyingPeriod $accompanyingPeriod, \DateTimeImmutable $startDate = null, \DateTimeImmutable $endDate = null, string $content = null, string $origin = null): FetchQueryInterface + public function buildFetchQueryForAccompanyingPeriod(AccompanyingPeriod $accompanyingPeriod, ?\DateTimeImmutable $startDate = null, ?\DateTimeImmutable $endDate = null, ?string $content = null, ?string $origin = null): FetchQueryInterface { $classMetadata = $this->em->getClassMetadata(CalendarDoc::class); $storedObjectMetadata = $this->em->getClassMetadata(StoredObject::class); @@ -90,7 +91,7 @@ final readonly class AccompanyingPeriodCalendarGenericDocProvider implements Gen return $this->security->isGranted(CalendarVoter::SEE, $accompanyingPeriod); } - public function buildFetchQueryForPerson(Person $person, \DateTimeImmutable $startDate = null, \DateTimeImmutable $endDate = null, string $content = null, string $origin = null): FetchQueryInterface + public function buildFetchQueryForPerson(Person $person, ?\DateTimeImmutable $startDate = null, ?\DateTimeImmutable $endDate = null, ?string $content = null, ?string $origin = null): FetchQueryInterface { $classMetadata = $this->em->getClassMetadata(CalendarDoc::class); $storedObjectMetadata = $this->em->getClassMetadata(StoredObject::class); diff --git a/src/Bundle/ChillCalendarBundle/Service/GenericDoc/Providers/PersonCalendarGenericDocProvider.php b/src/Bundle/ChillCalendarBundle/Service/GenericDoc/Providers/PersonCalendarGenericDocProvider.php index 49e890ca0..f088e27ba 100644 --- a/src/Bundle/ChillCalendarBundle/Service/GenericDoc/Providers/PersonCalendarGenericDocProvider.php +++ b/src/Bundle/ChillCalendarBundle/Service/GenericDoc/Providers/PersonCalendarGenericDocProvider.php @@ -37,9 +37,10 @@ final readonly class PersonCalendarGenericDocProvider implements GenericDocForPe public function __construct( private Security $security, private EntityManagerInterface $em - ) {} + ) { + } - private function addWhereClausesToQuery(FetchQuery $query, \DateTimeImmutable $startDate = null, \DateTimeImmutable $endDate = null, string $content = null): FetchQuery + private function addWhereClausesToQuery(FetchQuery $query, ?\DateTimeImmutable $startDate = null, ?\DateTimeImmutable $endDate = null, ?string $content = null): FetchQuery { $storedObjectMetadata = $this->em->getClassMetadata(StoredObject::class); @@ -73,7 +74,7 @@ final readonly class PersonCalendarGenericDocProvider implements GenericDocForPe /** * @throws MappingException */ - public function buildFetchQueryForPerson(Person $person, \DateTimeImmutable $startDate = null, \DateTimeImmutable $endDate = null, string $content = null, string $origin = null): FetchQueryInterface + public function buildFetchQueryForPerson(Person $person, ?\DateTimeImmutable $startDate = null, ?\DateTimeImmutable $endDate = null, ?string $content = null, ?string $origin = null): FetchQueryInterface { $classMetadata = $this->em->getClassMetadata(CalendarDoc::class); $storedObjectMetadata = $this->em->getClassMetadata(StoredObject::class); diff --git a/src/Bundle/ChillCalendarBundle/Service/GenericDoc/Renderers/AccompanyingPeriodCalendarGenericDocRenderer.php b/src/Bundle/ChillCalendarBundle/Service/GenericDoc/Renderers/AccompanyingPeriodCalendarGenericDocRenderer.php index 123afc164..1f4c3a45f 100644 --- a/src/Bundle/ChillCalendarBundle/Service/GenericDoc/Renderers/AccompanyingPeriodCalendarGenericDocRenderer.php +++ b/src/Bundle/ChillCalendarBundle/Service/GenericDoc/Renderers/AccompanyingPeriodCalendarGenericDocRenderer.php @@ -19,7 +19,9 @@ use Chill\DocStoreBundle\GenericDoc\Twig\GenericDocRendererInterface; final readonly class AccompanyingPeriodCalendarGenericDocRenderer implements GenericDocRendererInterface { - public function __construct(private CalendarDocRepository $repository) {} + public function __construct(private CalendarDocRepository $repository) + { + } public function supports(GenericDocDTO $genericDocDTO, $options = []): bool { diff --git a/src/Bundle/ChillCalendarBundle/Service/ShortMessageNotification/BulkCalendarShortMessageSender.php b/src/Bundle/ChillCalendarBundle/Service/ShortMessageNotification/BulkCalendarShortMessageSender.php index 9a4a92a94..b03a023d8 100644 --- a/src/Bundle/ChillCalendarBundle/Service/ShortMessageNotification/BulkCalendarShortMessageSender.php +++ b/src/Bundle/ChillCalendarBundle/Service/ShortMessageNotification/BulkCalendarShortMessageSender.php @@ -25,7 +25,9 @@ use Symfony\Component\Messenger\MessageBusInterface; class BulkCalendarShortMessageSender { - public function __construct(private readonly CalendarForShortMessageProvider $provider, private readonly EntityManagerInterface $em, private readonly LoggerInterface $logger, private readonly MessageBusInterface $messageBus, private readonly ShortMessageForCalendarBuilderInterface $messageForCalendarBuilder) {} + public function __construct(private readonly CalendarForShortMessageProvider $provider, private readonly EntityManagerInterface $em, private readonly LoggerInterface $logger, private readonly MessageBusInterface $messageBus, private readonly ShortMessageForCalendarBuilderInterface $messageForCalendarBuilder) + { + } public function sendBulkMessageToEligibleCalendars() { diff --git a/src/Bundle/ChillCalendarBundle/Service/ShortMessageNotification/CalendarForShortMessageProvider.php b/src/Bundle/ChillCalendarBundle/Service/ShortMessageNotification/CalendarForShortMessageProvider.php index 31b870ed4..85bc74efc 100644 --- a/src/Bundle/ChillCalendarBundle/Service/ShortMessageNotification/CalendarForShortMessageProvider.php +++ b/src/Bundle/ChillCalendarBundle/Service/ShortMessageNotification/CalendarForShortMessageProvider.php @@ -24,7 +24,9 @@ use Doctrine\ORM\EntityManagerInterface; class CalendarForShortMessageProvider { - public function __construct(private readonly CalendarRepository $calendarRepository, private readonly EntityManagerInterface $em, private readonly RangeGeneratorInterface $rangeGenerator) {} + public function __construct(private readonly CalendarRepository $calendarRepository, private readonly EntityManagerInterface $em, private readonly RangeGeneratorInterface $rangeGenerator) + { + } /** * Generate calendars instance. diff --git a/src/Bundle/ChillCalendarBundle/Service/ShortMessageNotification/DefaultShortMessageForCalendarBuilder.php b/src/Bundle/ChillCalendarBundle/Service/ShortMessageNotification/DefaultShortMessageForCalendarBuilder.php index 880c9950f..6c402ffe3 100644 --- a/src/Bundle/ChillCalendarBundle/Service/ShortMessageNotification/DefaultShortMessageForCalendarBuilder.php +++ b/src/Bundle/ChillCalendarBundle/Service/ShortMessageNotification/DefaultShortMessageForCalendarBuilder.php @@ -23,7 +23,9 @@ use Chill\MainBundle\Service\ShortMessage\ShortMessage; class DefaultShortMessageForCalendarBuilder implements ShortMessageForCalendarBuilderInterface { - public function __construct(private readonly \Twig\Environment $engine) {} + public function __construct(private readonly \Twig\Environment $engine) + { + } public function buildMessageForCalendar(Calendar $calendar): array { diff --git a/src/Bundle/ChillCalendarBundle/Tests/Service/DocGenerator/CalendarContextTest.php b/src/Bundle/ChillCalendarBundle/Tests/Service/DocGenerator/CalendarContextTest.php index 506baa98b..4a4b4f7d4 100644 --- a/src/Bundle/ChillCalendarBundle/Tests/Service/DocGenerator/CalendarContextTest.php +++ b/src/Bundle/ChillCalendarBundle/Tests/Service/DocGenerator/CalendarContextTest.php @@ -202,8 +202,8 @@ final class CalendarContextTest extends TestCase } private function buildCalendarContext( - EntityManagerInterface $entityManager = null, - NormalizerInterface $normalizer = null + ?EntityManagerInterface $entityManager = null, + ?NormalizerInterface $normalizer = null ): CalendarContext { $baseContext = $this->prophesize(BaseContextData::class); $baseContext->getData(null)->willReturn(['base_context' => 'data']); diff --git a/src/Bundle/ChillCustomFieldsBundle/Command/CreateFieldsOnGroupCommand.php b/src/Bundle/ChillCustomFieldsBundle/Command/CreateFieldsOnGroupCommand.php index 08425bcf0..de3f0cf5b 100644 --- a/src/Bundle/ChillCustomFieldsBundle/Command/CreateFieldsOnGroupCommand.php +++ b/src/Bundle/ChillCustomFieldsBundle/Command/CreateFieldsOnGroupCommand.php @@ -86,7 +86,7 @@ class CreateFieldsOnGroupCommand extends Command $em = $this->entityManager; $customFieldsGroups = $em - ->getRepository(\Chill\CustomFieldsBundle\Entity\CustomFieldsGroup::class) + ->getRepository(CustomFieldsGroup::class) ->findAll(); if (0 === \count($customFieldsGroups)) { diff --git a/src/Bundle/ChillCustomFieldsBundle/Controller/CustomFieldController.php b/src/Bundle/ChillCustomFieldsBundle/Controller/CustomFieldController.php index 00e377bde..0e0c23ab4 100644 --- a/src/Bundle/ChillCustomFieldsBundle/Controller/CustomFieldController.php +++ b/src/Bundle/ChillCustomFieldsBundle/Controller/CustomFieldController.php @@ -25,7 +25,9 @@ use Symfony\Contracts\Translation\TranslatorInterface; */ class CustomFieldController extends AbstractController { - public function __construct(private readonly TranslatorInterface $translator) {} + public function __construct(private readonly TranslatorInterface $translator) + { + } /** * Creates a new CustomField entity. @@ -121,7 +123,7 @@ class CustomFieldController extends AbstractController { $em = $this->getDoctrine()->getManager(); - $entity = $em->getRepository(\Chill\CustomFieldsBundle\Entity\CustomField::class)->find($id); + $entity = $em->getRepository(CustomField::class)->find($id); if (!$entity) { throw $this->createNotFoundException('Unable to find CustomField entity.'); diff --git a/src/Bundle/ChillCustomFieldsBundle/Controller/CustomFieldsGroupController.php b/src/Bundle/ChillCustomFieldsBundle/Controller/CustomFieldsGroupController.php index a8e77d059..a218e2cd2 100644 --- a/src/Bundle/ChillCustomFieldsBundle/Controller/CustomFieldsGroupController.php +++ b/src/Bundle/ChillCustomFieldsBundle/Controller/CustomFieldsGroupController.php @@ -36,7 +36,9 @@ class CustomFieldsGroupController extends AbstractController /** * CustomFieldsGroupController constructor. */ - public function __construct(private readonly CustomFieldProvider $customFieldProvider, private readonly TranslatorInterface $translator) {} + public function __construct(private readonly CustomFieldProvider $customFieldProvider, private readonly TranslatorInterface $translator) + { + } /** * Creates a new CustomFieldsGroup entity. @@ -78,7 +80,7 @@ class CustomFieldsGroupController extends AbstractController { $em = $this->getDoctrine()->getManager(); - $entity = $em->getRepository(\Chill\CustomFieldsBundle\Entity\CustomFieldsGroup::class)->find($id); + $entity = $em->getRepository(CustomFieldsGroup::class)->find($id); if (!$entity) { throw $this->createNotFoundException('Unable to find CustomFieldsGroup entity.'); @@ -101,7 +103,7 @@ class CustomFieldsGroupController extends AbstractController { $em = $this->getDoctrine()->getManager(); - $cfGroups = $em->getRepository(\Chill\CustomFieldsBundle\Entity\CustomFieldsGroup::class)->findAll(); + $cfGroups = $em->getRepository(CustomFieldsGroup::class)->findAll(); $defaultGroups = $this->getDefaultGroupsId(); $makeDefaultFormViews = []; @@ -133,13 +135,13 @@ class CustomFieldsGroupController extends AbstractController $em = $this->getDoctrine()->getManager(); - $cFGroup = $em->getRepository(\Chill\CustomFieldsBundle\Entity\CustomFieldsGroup::class)->findOneById($cFGroupId); + $cFGroup = $em->getRepository(CustomFieldsGroup::class)->findOneById($cFGroupId); if (!$cFGroup) { throw $this->createNotFoundException('customFieldsGroup not found with '."id {$cFGroupId}"); } - $cFDefaultGroup = $em->getRepository(\Chill\CustomFieldsBundle\Entity\CustomFieldsDefaultGroup::class) + $cFDefaultGroup = $em->getRepository(CustomFieldsDefaultGroup::class) ->findOneByEntity($cFGroup->getEntity()); if ($cFDefaultGroup) { @@ -194,7 +196,7 @@ class CustomFieldsGroupController extends AbstractController { $em = $this->getDoctrine()->getManager(); - $entity = $em->getRepository(\Chill\CustomFieldsBundle\Entity\CustomFieldsGroup::class)->find($id); + $entity = $em->getRepository(CustomFieldsGroup::class)->find($id); if (!$entity) { throw $this->createNotFoundException('Unable to find CustomFieldsGroups entity.'); @@ -238,7 +240,7 @@ class CustomFieldsGroupController extends AbstractController { $em = $this->getDoctrine()->getManager(); - $entity = $em->getRepository(\Chill\CustomFieldsBundle\Entity\CustomFieldsGroup::class)->find($id); + $entity = $em->getRepository(CustomFieldsGroup::class)->find($id); if (!$entity) { throw $this->createNotFoundException('Unable to find CustomFieldsGroup entity.'); @@ -262,7 +264,7 @@ class CustomFieldsGroupController extends AbstractController { $em = $this->getDoctrine()->getManager(); - $entity = $em->getRepository(\Chill\CustomFieldsBundle\Entity\CustomFieldsGroup::class)->find($id); + $entity = $em->getRepository(CustomFieldsGroup::class)->find($id); if (!$entity) { throw $this->createNotFoundException('Unable to find CustomFieldsGroup entity.'); @@ -361,7 +363,7 @@ class CustomFieldsGroupController extends AbstractController * * @return \Symfony\Component\Form\Form */ - private function createMakeDefaultForm(CustomFieldsGroup $group = null) + private function createMakeDefaultForm(?CustomFieldsGroup $group = null) { return $this->createFormBuilder($group, [ 'method' => 'POST', diff --git a/src/Bundle/ChillCustomFieldsBundle/CustomFields/CustomFieldChoice.php b/src/Bundle/ChillCustomFieldsBundle/CustomFields/CustomFieldChoice.php index b69f0d37e..b57b45bc9 100644 --- a/src/Bundle/ChillCustomFieldsBundle/CustomFields/CustomFieldChoice.php +++ b/src/Bundle/ChillCustomFieldsBundle/CustomFields/CustomFieldChoice.php @@ -43,7 +43,8 @@ class CustomFieldChoice extends AbstractCustomField * @var TranslatableStringHelper Helper that find the string in current locale from an array of translation */ private readonly TranslatableStringHelper $translatableStringHelper - ) {} + ) { + } public function allowOtherChoice(CustomField $cf) { @@ -155,7 +156,7 @@ class CustomFieldChoice extends AbstractCustomField return $serialized; } - public function extractOtherValue(CustomField $cf, array $data = null) + public function extractOtherValue(CustomField $cf, ?array $data = null) { return $data['_other']; } @@ -354,7 +355,7 @@ class CustomFieldChoice extends AbstractCustomField * If the value had an 'allow_other' = true option, the returned value * **is not** the content of the _other field, but the `_other` string. */ - private function guessValue(null|array|string $value) + private function guessValue(array|string|null $value) { if (null === $value) { return null; diff --git a/src/Bundle/ChillCustomFieldsBundle/CustomFields/CustomFieldDate.php b/src/Bundle/ChillCustomFieldsBundle/CustomFields/CustomFieldDate.php index dac447930..ecc97fbcc 100644 --- a/src/Bundle/ChillCustomFieldsBundle/CustomFields/CustomFieldDate.php +++ b/src/Bundle/ChillCustomFieldsBundle/CustomFields/CustomFieldDate.php @@ -45,7 +45,8 @@ class CustomFieldDate extends AbstractCustomField public function __construct( private readonly Environment $templating, private readonly TranslatableStringHelper $translatableStringHelper - ) {} + ) { + } public function buildForm(FormBuilderInterface $builder, CustomField $customField) { diff --git a/src/Bundle/ChillCustomFieldsBundle/CustomFields/CustomFieldLongChoice.php b/src/Bundle/ChillCustomFieldsBundle/CustomFields/CustomFieldLongChoice.php index 54d63b978..b524eca5d 100644 --- a/src/Bundle/ChillCustomFieldsBundle/CustomFields/CustomFieldLongChoice.php +++ b/src/Bundle/ChillCustomFieldsBundle/CustomFields/CustomFieldLongChoice.php @@ -28,7 +28,8 @@ class CustomFieldLongChoice extends AbstractCustomField private readonly OptionRepository $optionRepository, private readonly TranslatableStringHelper $translatableStringHelper, private readonly \Twig\Environment $templating, - ) {} + ) { + } public function buildForm(FormBuilderInterface $builder, CustomField $customField) { diff --git a/src/Bundle/ChillCustomFieldsBundle/CustomFields/CustomFieldNumber.php b/src/Bundle/ChillCustomFieldsBundle/CustomFields/CustomFieldNumber.php index e083b9b80..27dfce42c 100644 --- a/src/Bundle/ChillCustomFieldsBundle/CustomFields/CustomFieldNumber.php +++ b/src/Bundle/ChillCustomFieldsBundle/CustomFields/CustomFieldNumber.php @@ -42,7 +42,8 @@ class CustomFieldNumber extends AbstractCustomField public function __construct( private readonly Environment $templating, private readonly TranslatableStringHelper $translatableStringHelper - ) {} + ) { + } public function buildForm(FormBuilderInterface $builder, CustomField $customField) { diff --git a/src/Bundle/ChillCustomFieldsBundle/CustomFields/CustomFieldText.php b/src/Bundle/ChillCustomFieldsBundle/CustomFields/CustomFieldText.php index 17d8e95e7..6e9a3df0e 100644 --- a/src/Bundle/ChillCustomFieldsBundle/CustomFields/CustomFieldText.php +++ b/src/Bundle/ChillCustomFieldsBundle/CustomFields/CustomFieldText.php @@ -29,7 +29,8 @@ class CustomFieldText extends AbstractCustomField public function __construct( private readonly Environment $templating, private readonly TranslatableStringHelper $translatableStringHelper - ) {} + ) { + } /** * Create a form according to the maxLength option. diff --git a/src/Bundle/ChillCustomFieldsBundle/CustomFields/CustomFieldTitle.php b/src/Bundle/ChillCustomFieldsBundle/CustomFields/CustomFieldTitle.php index 302e04350..07a0a0121 100644 --- a/src/Bundle/ChillCustomFieldsBundle/CustomFields/CustomFieldTitle.php +++ b/src/Bundle/ChillCustomFieldsBundle/CustomFields/CustomFieldTitle.php @@ -32,7 +32,8 @@ class CustomFieldTitle extends AbstractCustomField * @var TranslatableStringHelper Helper that find the string in current locale from an array of translation */ private readonly TranslatableStringHelper $translatableStringHelper - ) {} + ) { + } public function buildForm(FormBuilderInterface $builder, CustomField $customField) { diff --git a/src/Bundle/ChillCustomFieldsBundle/Entity/CustomField.php b/src/Bundle/ChillCustomFieldsBundle/Entity/CustomField.php index b75d23e5e..6d1373fb0 100644 --- a/src/Bundle/ChillCustomFieldsBundle/Entity/CustomField.php +++ b/src/Bundle/ChillCustomFieldsBundle/Entity/CustomField.php @@ -38,7 +38,7 @@ class CustomField * targetEntity="Chill\CustomFieldsBundle\Entity\CustomFieldsGroup", * inversedBy="customFields") */ - private ?\Chill\CustomFieldsBundle\Entity\CustomFieldsGroup $customFieldGroup = null; + private ?CustomFieldsGroup $customFieldGroup = null; /** * @ORM\Id @@ -212,7 +212,7 @@ class CustomField * * @return CustomField */ - public function setCustomFieldsGroup(CustomFieldsGroup $customFieldGroup = null) + public function setCustomFieldsGroup(?CustomFieldsGroup $customFieldGroup = null) { $this->customFieldGroup = $customFieldGroup; diff --git a/src/Bundle/ChillCustomFieldsBundle/Entity/CustomFieldLongChoice/Option.php b/src/Bundle/ChillCustomFieldsBundle/Entity/CustomFieldLongChoice/Option.php index b6f371c8e..2d9889066 100644 --- a/src/Bundle/ChillCustomFieldsBundle/Entity/CustomFieldLongChoice/Option.php +++ b/src/Bundle/ChillCustomFieldsBundle/Entity/CustomFieldLongChoice/Option.php @@ -63,7 +63,7 @@ class Option * * @ORM\JoinColumn(nullable=true) */ - private ?\Chill\CustomFieldsBundle\Entity\CustomFieldLongChoice\Option $parent = null; + private ?Option $parent = null; /** * A json representation of text (multilingual). @@ -182,7 +182,7 @@ class Option /** * @return $this */ - public function setParent(Option $parent = null) + public function setParent(?Option $parent = null) { $this->parent = $parent; $this->key = $parent->getKey(); diff --git a/src/Bundle/ChillCustomFieldsBundle/Entity/CustomFieldsDefaultGroup.php b/src/Bundle/ChillCustomFieldsBundle/Entity/CustomFieldsDefaultGroup.php index fbf100a95..cb5f8da7a 100644 --- a/src/Bundle/ChillCustomFieldsBundle/Entity/CustomFieldsDefaultGroup.php +++ b/src/Bundle/ChillCustomFieldsBundle/Entity/CustomFieldsDefaultGroup.php @@ -33,7 +33,7 @@ class CustomFieldsDefaultGroup * * sf4 check: option inversedBy="customFields" return inconsistent error mapping !! */ - private ?\Chill\CustomFieldsBundle\Entity\CustomFieldsGroup $customFieldsGroup = null; + private ?CustomFieldsGroup $customFieldsGroup = null; /** * @ORM\Column(type="string", length=255) diff --git a/src/Bundle/ChillCustomFieldsBundle/Entity/CustomFieldsGroup.php b/src/Bundle/ChillCustomFieldsBundle/Entity/CustomFieldsGroup.php index 9d2be4979..99eb51cce 100644 --- a/src/Bundle/ChillCustomFieldsBundle/Entity/CustomFieldsGroup.php +++ b/src/Bundle/ChillCustomFieldsBundle/Entity/CustomFieldsGroup.php @@ -139,7 +139,7 @@ class CustomFieldsGroup /** * Get name. */ - public function getName(string $language = null): array|string + public function getName(?string $language = null): array|string { // TODO set this in a service, PLUS twig function if (null !== $language) { diff --git a/src/Bundle/ChillCustomFieldsBundle/Form/CustomFieldType.php b/src/Bundle/ChillCustomFieldsBundle/Form/CustomFieldType.php index 23a7ed975..f7ffdc465 100644 --- a/src/Bundle/ChillCustomFieldsBundle/Form/CustomFieldType.php +++ b/src/Bundle/ChillCustomFieldsBundle/Form/CustomFieldType.php @@ -30,7 +30,9 @@ use Symfony\Component\OptionsResolver\OptionsResolver; class CustomFieldType extends AbstractType { - public function __construct(private readonly CustomFieldProvider $customFieldProvider, private readonly ObjectManager $om, private readonly TranslatableStringHelper $translatableStringHelper) {} + public function __construct(private readonly CustomFieldProvider $customFieldProvider, private readonly ObjectManager $om, private readonly TranslatableStringHelper $translatableStringHelper) + { + } public function buildForm(FormBuilderInterface $builder, array $options) { diff --git a/src/Bundle/ChillCustomFieldsBundle/Form/CustomFieldsGroupType.php b/src/Bundle/ChillCustomFieldsBundle/Form/CustomFieldsGroupType.php index 8cf3ea182..5bb16c80d 100644 --- a/src/Bundle/ChillCustomFieldsBundle/Form/CustomFieldsGroupType.php +++ b/src/Bundle/ChillCustomFieldsBundle/Form/CustomFieldsGroupType.php @@ -27,7 +27,8 @@ class CustomFieldsGroupType extends AbstractType private readonly array $customizableEntities, // TODO : add comment about this variable private readonly TranslatorInterface $translator - ) {} + ) { + } // TODO : details about the function public function buildForm(FormBuilderInterface $builder, array $options) diff --git a/src/Bundle/ChillCustomFieldsBundle/Form/DataTransformer/CustomFieldDataTransformer.php b/src/Bundle/ChillCustomFieldsBundle/Form/DataTransformer/CustomFieldDataTransformer.php index ee5f8b386..3091ea66f 100644 --- a/src/Bundle/ChillCustomFieldsBundle/Form/DataTransformer/CustomFieldDataTransformer.php +++ b/src/Bundle/ChillCustomFieldsBundle/Form/DataTransformer/CustomFieldDataTransformer.php @@ -17,7 +17,9 @@ use Symfony\Component\Form\DataTransformerInterface; class CustomFieldDataTransformer implements DataTransformerInterface { - public function __construct(private readonly CustomFieldInterface $customFieldDefinition, private readonly CustomField $customField) {} + public function __construct(private readonly CustomFieldInterface $customFieldDefinition, private readonly CustomField $customField) + { + } public function reverseTransform($value) { diff --git a/src/Bundle/ChillCustomFieldsBundle/Form/DataTransformer/CustomFieldsGroupToIdTransformer.php b/src/Bundle/ChillCustomFieldsBundle/Form/DataTransformer/CustomFieldsGroupToIdTransformer.php index 180ac0a8a..cd33068a9 100644 --- a/src/Bundle/ChillCustomFieldsBundle/Form/DataTransformer/CustomFieldsGroupToIdTransformer.php +++ b/src/Bundle/ChillCustomFieldsBundle/Form/DataTransformer/CustomFieldsGroupToIdTransformer.php @@ -18,7 +18,9 @@ use Symfony\Component\Form\Exception\TransformationFailedException; class CustomFieldsGroupToIdTransformer implements DataTransformerInterface { - public function __construct(private readonly ObjectManager $om) {} + public function __construct(private readonly ObjectManager $om) + { + } /** * Transforms a string (id) to an object (CustomFieldsGroup). diff --git a/src/Bundle/ChillCustomFieldsBundle/Form/Type/CustomFieldsTitleType.php b/src/Bundle/ChillCustomFieldsBundle/Form/Type/CustomFieldsTitleType.php index 5d5377a15..fa462737e 100644 --- a/src/Bundle/ChillCustomFieldsBundle/Form/Type/CustomFieldsTitleType.php +++ b/src/Bundle/ChillCustomFieldsBundle/Form/Type/CustomFieldsTitleType.php @@ -16,7 +16,9 @@ use Symfony\Component\Form\FormBuilderInterface; class CustomFieldsTitleType extends AbstractType { - public function buildForm(FormBuilderInterface $builder, array $options) {} + public function buildForm(FormBuilderInterface $builder, array $options) + { + } public function getBlockPrefix() { diff --git a/src/Bundle/ChillCustomFieldsBundle/Form/Type/LinkedCustomFieldsType.php b/src/Bundle/ChillCustomFieldsBundle/Form/Type/LinkedCustomFieldsType.php index 8f6e896bf..25418e5c4 100644 --- a/src/Bundle/ChillCustomFieldsBundle/Form/Type/LinkedCustomFieldsType.php +++ b/src/Bundle/ChillCustomFieldsBundle/Form/Type/LinkedCustomFieldsType.php @@ -42,7 +42,9 @@ class LinkedCustomFieldsType extends AbstractType */ private array $options = []; - public function __construct(private readonly TranslatableStringHelper $translatableStringHelper) {} + public function __construct(private readonly TranslatableStringHelper $translatableStringHelper) + { + } /** * append Choice on POST_SET_DATA event. diff --git a/src/Bundle/ChillCustomFieldsBundle/Service/CustomFieldProvider.php b/src/Bundle/ChillCustomFieldsBundle/Service/CustomFieldProvider.php index aad28a2b2..fcccf01ed 100644 --- a/src/Bundle/ChillCustomFieldsBundle/Service/CustomFieldProvider.php +++ b/src/Bundle/ChillCustomFieldsBundle/Service/CustomFieldProvider.php @@ -84,7 +84,7 @@ class CustomFieldProvider implements ContainerAwareInterface * * @see \Symfony\Component\DependencyInjection\ContainerAwareInterface::setContainer() */ - public function setContainer(ContainerInterface $container = null) + public function setContainer(?ContainerInterface $container = null) { if (null === $container) { throw new \LogicException('container should not be null'); diff --git a/src/Bundle/ChillCustomFieldsBundle/Service/CustomFieldsHelper.php b/src/Bundle/ChillCustomFieldsBundle/Service/CustomFieldsHelper.php index 320f36544..e684899b4 100644 --- a/src/Bundle/ChillCustomFieldsBundle/Service/CustomFieldsHelper.php +++ b/src/Bundle/ChillCustomFieldsBundle/Service/CustomFieldsHelper.php @@ -29,7 +29,9 @@ class CustomFieldsHelper * @param CustomFieldProvider $provider The customfield provider that * contains all the declared custom fields */ - public function __construct(private readonly EntityManagerInterface $em, private readonly CustomFieldProvider $provider) {} + public function __construct(private readonly EntityManagerInterface $em, private readonly CustomFieldProvider $provider) + { + } public function isEmptyValue(array $fields, CustomField $customField) { diff --git a/src/Bundle/ChillCustomFieldsBundle/Templating/Twig/CustomFieldRenderingTwig.php b/src/Bundle/ChillCustomFieldsBundle/Templating/Twig/CustomFieldRenderingTwig.php index 6d3d889a8..62181de74 100644 --- a/src/Bundle/ChillCustomFieldsBundle/Templating/Twig/CustomFieldRenderingTwig.php +++ b/src/Bundle/ChillCustomFieldsBundle/Templating/Twig/CustomFieldRenderingTwig.php @@ -31,7 +31,9 @@ class CustomFieldRenderingTwig extends AbstractExtension 'label_layout' => '@ChillCustomFields/CustomField/render_label.html.twig', ]; - public function __construct(private readonly CustomFieldsHelper $customFieldsHelper) {} + public function __construct(private readonly CustomFieldsHelper $customFieldsHelper) + { + } /** * (non-PHPdoc). diff --git a/src/Bundle/ChillCustomFieldsBundle/Tests/CustomFields/CustomFieldsChoiceTest.php b/src/Bundle/ChillCustomFieldsBundle/Tests/CustomFields/CustomFieldsChoiceTest.php index 35d9ca3a3..48d4847d6 100644 --- a/src/Bundle/ChillCustomFieldsBundle/Tests/CustomFields/CustomFieldsChoiceTest.php +++ b/src/Bundle/ChillCustomFieldsBundle/Tests/CustomFields/CustomFieldsChoiceTest.php @@ -29,7 +29,7 @@ use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase; final class CustomFieldsChoiceTest extends KernelTestCase { /** - * @var \Chill\CustomFieldsBundle\CustomFields\CustomFieldChoice + * @var CustomFieldChoice */ private $cfChoice; diff --git a/src/Bundle/ChillCustomFieldsBundle/Tests/CustomFields/CustomFieldsTextTest.php b/src/Bundle/ChillCustomFieldsBundle/Tests/CustomFields/CustomFieldsTextTest.php index 87722c1bd..2d1268e71 100644 --- a/src/Bundle/ChillCustomFieldsBundle/Tests/CustomFields/CustomFieldsTextTest.php +++ b/src/Bundle/ChillCustomFieldsBundle/Tests/CustomFields/CustomFieldsTextTest.php @@ -43,7 +43,7 @@ final class CustomFieldsTextTest extends WebTestCase $customField ); $this->assertInstanceOf( - \Chill\CustomFieldsBundle\CustomFields\CustomFieldText::class, + CustomFieldText::class, $customField ); } diff --git a/src/Bundle/ChillCustomFieldsBundle/Tests/Service/CustomFieldsHelperTest.php b/src/Bundle/ChillCustomFieldsBundle/Tests/Service/CustomFieldsHelperTest.php index 310e64b62..6d3abbc66 100644 --- a/src/Bundle/ChillCustomFieldsBundle/Tests/Service/CustomFieldsHelperTest.php +++ b/src/Bundle/ChillCustomFieldsBundle/Tests/Service/CustomFieldsHelperTest.php @@ -25,7 +25,7 @@ final class CustomFieldsHelperTest extends KernelTestCase { private ?object $cfHelper = null; - private \Chill\CustomFieldsBundle\Entity\CustomField $randomCFText; + private CustomField $randomCFText; protected function setUp(): void { diff --git a/src/Bundle/ChillDocGeneratorBundle/Context/ContextManager.php b/src/Bundle/ChillDocGeneratorBundle/Context/ContextManager.php index afcf6fab1..95419e001 100644 --- a/src/Bundle/ChillDocGeneratorBundle/Context/ContextManager.php +++ b/src/Bundle/ChillDocGeneratorBundle/Context/ContextManager.php @@ -19,7 +19,9 @@ final readonly class ContextManager implements ContextManagerInterface /** * @param \Chill\DocGeneratorBundle\Context\DocGeneratorContextInterface[] $contexts */ - public function __construct(private iterable $contexts) {} + public function __construct(private iterable $contexts) + { + } public function getContextByDocGeneratorTemplate(DocGeneratorTemplate $docGeneratorTemplate): DocGeneratorContextInterface { diff --git a/src/Bundle/ChillDocGeneratorBundle/Controller/AdminDocGeneratorTemplateController.php b/src/Bundle/ChillDocGeneratorBundle/Controller/AdminDocGeneratorTemplateController.php index ecb896080..ebce55957 100644 --- a/src/Bundle/ChillDocGeneratorBundle/Controller/AdminDocGeneratorTemplateController.php +++ b/src/Bundle/ChillDocGeneratorBundle/Controller/AdminDocGeneratorTemplateController.php @@ -22,7 +22,9 @@ use Symfony\Component\Routing\Annotation\Route; class AdminDocGeneratorTemplateController extends CRUDController { - public function __construct(private readonly ContextManager $contextManager) {} + public function __construct(private readonly ContextManager $contextManager) + { + } public function generateTemplateParameter(string $action, $entity, Request $request, array $defaultTemplateParameters = []) { diff --git a/src/Bundle/ChillDocGeneratorBundle/Controller/DocGeneratorTemplateController.php b/src/Bundle/ChillDocGeneratorBundle/Controller/DocGeneratorTemplateController.php index c9e1873b2..788ccb59c 100644 --- a/src/Bundle/ChillDocGeneratorBundle/Controller/DocGeneratorTemplateController.php +++ b/src/Bundle/ChillDocGeneratorBundle/Controller/DocGeneratorTemplateController.php @@ -37,7 +37,9 @@ use Symfony\Component\Serializer\Normalizer\AbstractNormalizer; final class DocGeneratorTemplateController extends AbstractController { - public function __construct(private readonly ContextManager $contextManager, private readonly DocGeneratorTemplateRepository $docGeneratorTemplateRepository, private readonly GeneratorInterface $generator, private readonly MessageBusInterface $messageBus, private readonly PaginatorFactory $paginatorFactory, private readonly EntityManagerInterface $entityManager) {} + public function __construct(private readonly ContextManager $contextManager, private readonly DocGeneratorTemplateRepository $docGeneratorTemplateRepository, private readonly GeneratorInterface $generator, private readonly MessageBusInterface $messageBus, private readonly PaginatorFactory $paginatorFactory, private readonly EntityManagerInterface $entityManager) + { + } /** * @Route( diff --git a/src/Bundle/ChillDocGeneratorBundle/Form/DocGeneratorTemplateType.php b/src/Bundle/ChillDocGeneratorBundle/Form/DocGeneratorTemplateType.php index 1b87ef926..8f698cb97 100644 --- a/src/Bundle/ChillDocGeneratorBundle/Form/DocGeneratorTemplateType.php +++ b/src/Bundle/ChillDocGeneratorBundle/Form/DocGeneratorTemplateType.php @@ -24,7 +24,9 @@ use Symfony\Component\OptionsResolver\OptionsResolver; class DocGeneratorTemplateType extends AbstractType { - public function __construct(private readonly ContextManager $contextManager) {} + public function __construct(private readonly ContextManager $contextManager) + { + } public function buildForm(FormBuilderInterface $builder, array $options) { diff --git a/src/Bundle/ChillDocGeneratorBundle/GeneratorDriver/DriverInterface.php b/src/Bundle/ChillDocGeneratorBundle/GeneratorDriver/DriverInterface.php index a408ec8e6..4d802d2ca 100644 --- a/src/Bundle/ChillDocGeneratorBundle/GeneratorDriver/DriverInterface.php +++ b/src/Bundle/ChillDocGeneratorBundle/GeneratorDriver/DriverInterface.php @@ -13,5 +13,5 @@ namespace Chill\DocGeneratorBundle\GeneratorDriver; interface DriverInterface { - public function generateFromString(string $template, string $resourceType, array $data, string $templateName = null): string; + public function generateFromString(string $template, string $resourceType, array $data, ?string $templateName = null): string; } diff --git a/src/Bundle/ChillDocGeneratorBundle/GeneratorDriver/Exception/TemplateException.php b/src/Bundle/ChillDocGeneratorBundle/GeneratorDriver/Exception/TemplateException.php index 9fa6f6654..041133c50 100644 --- a/src/Bundle/ChillDocGeneratorBundle/GeneratorDriver/Exception/TemplateException.php +++ b/src/Bundle/ChillDocGeneratorBundle/GeneratorDriver/Exception/TemplateException.php @@ -17,7 +17,7 @@ namespace Chill\DocGeneratorBundle\GeneratorDriver\Exception; */ class TemplateException extends \RuntimeException { - public function __construct(private readonly array $errors, $code = 0, \Throwable $previous = null) + public function __construct(private readonly array $errors, $code = 0, ?\Throwable $previous = null) { parent::__construct('Error while generating document from template', $code, $previous); } diff --git a/src/Bundle/ChillDocGeneratorBundle/GeneratorDriver/RelatorioDriver.php b/src/Bundle/ChillDocGeneratorBundle/GeneratorDriver/RelatorioDriver.php index 547af44c9..b46ee09b2 100644 --- a/src/Bundle/ChillDocGeneratorBundle/GeneratorDriver/RelatorioDriver.php +++ b/src/Bundle/ChillDocGeneratorBundle/GeneratorDriver/RelatorioDriver.php @@ -33,7 +33,7 @@ final class RelatorioDriver implements DriverInterface $this->url = $parameterBag->get('chill_doc_generator')['driver']['relatorio']['url']; } - public function generateFromString(string $template, string $resourceType, array $data, string $templateName = null): string + public function generateFromString(string $template, string $resourceType, array $data, ?string $templateName = null): string { $form = new FormDataPart( [ diff --git a/src/Bundle/ChillDocGeneratorBundle/Menu/AdminMenuBuilder.php b/src/Bundle/ChillDocGeneratorBundle/Menu/AdminMenuBuilder.php index 8796b8e39..a021e1495 100644 --- a/src/Bundle/ChillDocGeneratorBundle/Menu/AdminMenuBuilder.php +++ b/src/Bundle/ChillDocGeneratorBundle/Menu/AdminMenuBuilder.php @@ -18,7 +18,9 @@ use Symfony\Contracts\Translation\TranslatorInterface; class AdminMenuBuilder implements LocalMenuBuilderInterface { - public function __construct(private readonly TranslatorInterface $translator, private readonly Security $security) {} + public function __construct(private readonly TranslatorInterface $translator, private readonly Security $security) + { + } public function buildMenu($menuId, MenuItem $menu, array $parameters) { diff --git a/src/Bundle/ChillDocGeneratorBundle/Repository/DocGeneratorTemplateRepository.php b/src/Bundle/ChillDocGeneratorBundle/Repository/DocGeneratorTemplateRepository.php index 85486c2ce..0f2771b4e 100644 --- a/src/Bundle/ChillDocGeneratorBundle/Repository/DocGeneratorTemplateRepository.php +++ b/src/Bundle/ChillDocGeneratorBundle/Repository/DocGeneratorTemplateRepository.php @@ -58,7 +58,7 @@ final class DocGeneratorTemplateRepository implements ObjectRepository * * @return DocGeneratorTemplate[] */ - public function findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null): array + public function findBy(array $criteria, ?array $orderBy = null, $limit = null, $offset = null): array { return $this->repository->findBy($criteria, $orderBy, $limit, $offset); } @@ -85,7 +85,7 @@ final class DocGeneratorTemplateRepository implements ObjectRepository ->getResult(); } - public function findOneBy(array $criteria, array $orderBy = null): ?DocGeneratorTemplate + public function findOneBy(array $criteria, ?array $orderBy = null): ?DocGeneratorTemplate { return $this->repository->findOneBy($criteria, $orderBy); } diff --git a/src/Bundle/ChillDocGeneratorBundle/Serializer/Helper/NormalizeNullValueHelper.php b/src/Bundle/ChillDocGeneratorBundle/Serializer/Helper/NormalizeNullValueHelper.php index b429bca87..79cf47be5 100644 --- a/src/Bundle/ChillDocGeneratorBundle/Serializer/Helper/NormalizeNullValueHelper.php +++ b/src/Bundle/ChillDocGeneratorBundle/Serializer/Helper/NormalizeNullValueHelper.php @@ -16,9 +16,11 @@ use Symfony\Component\Serializer\Normalizer\NormalizerInterface; class NormalizeNullValueHelper { - public function __construct(private readonly NormalizerInterface $normalizer, private readonly ?string $discriminatorType = null, private readonly ?string $discriminatorValue = null) {} + public function __construct(private readonly NormalizerInterface $normalizer, private readonly ?string $discriminatorType = null, private readonly ?string $discriminatorValue = null) + { + } - public function normalize(array $attributes, string $format = 'docgen', ?array $context = [], ClassMetadataInterface $classMetadata = null) + public function normalize(array $attributes, string $format = 'docgen', ?array $context = [], ?ClassMetadataInterface $classMetadata = null) { $data = []; $data['isNull'] = true; diff --git a/src/Bundle/ChillDocGeneratorBundle/Service/Context/BaseContextData.php b/src/Bundle/ChillDocGeneratorBundle/Service/Context/BaseContextData.php index 1eada4e52..2773d3816 100644 --- a/src/Bundle/ChillDocGeneratorBundle/Service/Context/BaseContextData.php +++ b/src/Bundle/ChillDocGeneratorBundle/Service/Context/BaseContextData.php @@ -17,9 +17,11 @@ use Symfony\Component\Serializer\Normalizer\NormalizerInterface; class BaseContextData { - public function __construct(private readonly NormalizerInterface $normalizer) {} + public function __construct(private readonly NormalizerInterface $normalizer) + { + } - public function getData(User $user = null): array + public function getData(?User $user = null): array { $data = []; diff --git a/src/Bundle/ChillDocGeneratorBundle/Service/Generator/Generator.php b/src/Bundle/ChillDocGeneratorBundle/Service/Generator/Generator.php index 4918223f5..6c9a6f219 100644 --- a/src/Bundle/ChillDocGeneratorBundle/Service/Generator/Generator.php +++ b/src/Bundle/ChillDocGeneratorBundle/Service/Generator/Generator.php @@ -27,7 +27,9 @@ class Generator implements GeneratorInterface { private const LOG_PREFIX = '[docgen generator] '; - public function __construct(private readonly ContextManagerInterface $contextManager, private readonly DriverInterface $driver, private readonly EntityManagerInterface $entityManager, private readonly LoggerInterface $logger, private readonly StoredObjectManagerInterface $storedObjectManager) {} + public function __construct(private readonly ContextManagerInterface $contextManager, private readonly DriverInterface $driver, private readonly EntityManagerInterface $entityManager, private readonly LoggerInterface $logger, private readonly StoredObjectManagerInterface $storedObjectManager) + { + } /** * @template T of File|null @@ -44,10 +46,10 @@ class Generator implements GeneratorInterface DocGeneratorTemplate $template, int $entityId, array $contextGenerationDataNormalized, - StoredObject $destinationStoredObject = null, + ?StoredObject $destinationStoredObject = null, bool $isTest = false, - File $testFile = null, - User $creator = null + ?File $testFile = null, + ?User $creator = null ): ?string { if ($destinationStoredObject instanceof StoredObject && StoredObject::STATUS_PENDING !== $destinationStoredObject->getStatus()) { $this->logger->info(self::LOG_PREFIX.'Aborting generation of an already generated document'); diff --git a/src/Bundle/ChillDocGeneratorBundle/Service/Generator/GeneratorException.php b/src/Bundle/ChillDocGeneratorBundle/Service/Generator/GeneratorException.php index 2c91942bc..cd7669240 100644 --- a/src/Bundle/ChillDocGeneratorBundle/Service/Generator/GeneratorException.php +++ b/src/Bundle/ChillDocGeneratorBundle/Service/Generator/GeneratorException.php @@ -16,7 +16,7 @@ class GeneratorException extends \RuntimeException /** * @param string[] $errors */ - public function __construct(private readonly array $errors = [], \Throwable $previous = null) + public function __construct(private readonly array $errors = [], ?\Throwable $previous = null) { parent::__construct( 'Could not generate the document', diff --git a/src/Bundle/ChillDocGeneratorBundle/Service/Generator/GeneratorInterface.php b/src/Bundle/ChillDocGeneratorBundle/Service/Generator/GeneratorInterface.php index 64d99f801..c4ff38ac5 100644 --- a/src/Bundle/ChillDocGeneratorBundle/Service/Generator/GeneratorInterface.php +++ b/src/Bundle/ChillDocGeneratorBundle/Service/Generator/GeneratorInterface.php @@ -33,9 +33,9 @@ interface GeneratorInterface DocGeneratorTemplate $template, int $entityId, array $contextGenerationDataNormalized, - StoredObject $destinationStoredObject = null, + ?StoredObject $destinationStoredObject = null, bool $isTest = false, - File $testFile = null, - User $creator = null + ?File $testFile = null, + ?User $creator = null ): ?string; } diff --git a/src/Bundle/ChillDocGeneratorBundle/Service/Generator/RelatedEntityNotFoundException.php b/src/Bundle/ChillDocGeneratorBundle/Service/Generator/RelatedEntityNotFoundException.php index a252755ea..3b1bd6f97 100644 --- a/src/Bundle/ChillDocGeneratorBundle/Service/Generator/RelatedEntityNotFoundException.php +++ b/src/Bundle/ChillDocGeneratorBundle/Service/Generator/RelatedEntityNotFoundException.php @@ -13,7 +13,7 @@ namespace Chill\DocGeneratorBundle\Service\Generator; class RelatedEntityNotFoundException extends \RuntimeException { - public function __construct(string $relatedEntityClass, int $relatedEntityId, \Throwable $previous = null) + public function __construct(string $relatedEntityClass, int $relatedEntityId, ?\Throwable $previous = null) { parent::__construct( sprintf('Related entity not found: %s, %s', $relatedEntityClass, $relatedEntityId), diff --git a/src/Bundle/ChillDocGeneratorBundle/Service/Messenger/OnGenerationFails.php b/src/Bundle/ChillDocGeneratorBundle/Service/Messenger/OnGenerationFails.php index 54889f518..57006cb9d 100644 --- a/src/Bundle/ChillDocGeneratorBundle/Service/Messenger/OnGenerationFails.php +++ b/src/Bundle/ChillDocGeneratorBundle/Service/Messenger/OnGenerationFails.php @@ -28,7 +28,9 @@ final readonly class OnGenerationFails implements EventSubscriberInterface { public const LOG_PREFIX = '[docgen failed] '; - public function __construct(private DocGeneratorTemplateRepository $docGeneratorTemplateRepository, private EntityManagerInterface $entityManager, private LoggerInterface $logger, private MailerInterface $mailer, private StoredObjectRepository $storedObjectRepository, private TranslatorInterface $translator, private UserRepositoryInterface $userRepository) {} + public function __construct(private DocGeneratorTemplateRepository $docGeneratorTemplateRepository, private EntityManagerInterface $entityManager, private LoggerInterface $logger, private MailerInterface $mailer, private StoredObjectRepository $storedObjectRepository, private TranslatorInterface $translator, private UserRepositoryInterface $userRepository) + { + } public static function getSubscribedEvents() { @@ -47,7 +49,7 @@ final readonly class OnGenerationFails implements EventSubscriberInterface return; } - /** @var \Chill\DocGeneratorBundle\Service\Messenger\RequestGenerationMessage $message */ + /** @var RequestGenerationMessage $message */ $message = $event->getEnvelope()->getMessage(); $this->logger->error(self::LOG_PREFIX.'Docgen failed', [ diff --git a/src/Bundle/ChillDocGeneratorBundle/Service/Messenger/RequestGenerationHandler.php b/src/Bundle/ChillDocGeneratorBundle/Service/Messenger/RequestGenerationHandler.php index f6723c617..4ec59d9d4 100644 --- a/src/Bundle/ChillDocGeneratorBundle/Service/Messenger/RequestGenerationHandler.php +++ b/src/Bundle/ChillDocGeneratorBundle/Service/Messenger/RequestGenerationHandler.php @@ -30,7 +30,9 @@ class RequestGenerationHandler implements MessageHandlerInterface private const LOG_PREFIX = '[docgen message handler] '; - public function __construct(private readonly DocGeneratorTemplateRepository $docGeneratorTemplateRepository, private readonly EntityManagerInterface $entityManager, private readonly Generator $generator, private readonly LoggerInterface $logger, private readonly StoredObjectRepository $storedObjectRepository, private readonly UserRepositoryInterface $userRepository) {} + public function __construct(private readonly DocGeneratorTemplateRepository $docGeneratorTemplateRepository, private readonly EntityManagerInterface $entityManager, private readonly Generator $generator, private readonly LoggerInterface $logger, private readonly StoredObjectRepository $storedObjectRepository, private readonly UserRepositoryInterface $userRepository) + { + } public function __invoke(RequestGenerationMessage $message) { diff --git a/src/Bundle/ChillDocGeneratorBundle/tests/Service/Context/BaseContextDataTest.php b/src/Bundle/ChillDocGeneratorBundle/tests/Service/Context/BaseContextDataTest.php index 7ce52dee0..476f7abe4 100644 --- a/src/Bundle/ChillDocGeneratorBundle/tests/Service/Context/BaseContextDataTest.php +++ b/src/Bundle/ChillDocGeneratorBundle/tests/Service/Context/BaseContextDataTest.php @@ -56,7 +56,7 @@ final class BaseContextDataTest extends KernelTestCase } private function buildBaseContext( - NormalizerInterface $normalizer = null + ?NormalizerInterface $normalizer = null ): BaseContextData { return new BaseContextData( $normalizer ?? self::$container->get(NormalizerInterface::class) diff --git a/src/Bundle/ChillDocStoreBundle/Controller/DocumentAccompanyingCourseController.php b/src/Bundle/ChillDocStoreBundle/Controller/DocumentAccompanyingCourseController.php index 44feb5a47..7fe5eca85 100644 --- a/src/Bundle/ChillDocStoreBundle/Controller/DocumentAccompanyingCourseController.php +++ b/src/Bundle/ChillDocStoreBundle/Controller/DocumentAccompanyingCourseController.php @@ -37,7 +37,8 @@ class DocumentAccompanyingCourseController extends AbstractController protected TranslatorInterface $translator, protected EventDispatcherInterface $eventDispatcher, protected AuthorizationHelper $authorizationHelper - ) {} + ) { + } /** * @Route("/{id}/delete", name="chill_docstore_accompanying_course_document_delete") diff --git a/src/Bundle/ChillDocStoreBundle/Controller/DocumentCategoryController.php b/src/Bundle/ChillDocStoreBundle/Controller/DocumentCategoryController.php index fc58dff18..14b38f5d4 100644 --- a/src/Bundle/ChillDocStoreBundle/Controller/DocumentCategoryController.php +++ b/src/Bundle/ChillDocStoreBundle/Controller/DocumentCategoryController.php @@ -32,7 +32,7 @@ class DocumentCategoryController extends AbstractController { $em = $this->getDoctrine()->getManager(); $documentCategory = $em - ->getRepository(\Chill\DocStoreBundle\Entity\DocumentCategory::class) + ->getRepository(DocumentCategory::class) ->findOneBy( ['bundleId' => $bundleId, 'idInsideBundle' => $idInsideBundle] ); @@ -52,7 +52,7 @@ class DocumentCategoryController extends AbstractController { $em = $this->getDoctrine()->getManager(); $documentCategory = $em - ->getRepository(\Chill\DocStoreBundle\Entity\DocumentCategory::class) + ->getRepository(DocumentCategory::class) ->findOneBy( ['bundleId' => $bundleId, 'idInsideBundle' => $idInsideBundle] ); @@ -135,7 +135,7 @@ class DocumentCategoryController extends AbstractController { $em = $this->getDoctrine()->getManager(); $documentCategory = $em - ->getRepository(\Chill\DocStoreBundle\Entity\DocumentCategory::class) + ->getRepository(DocumentCategory::class) ->findOneBy( ['bundleId' => $bundleId, 'idInsideBundle' => $idInsideBundle] ); diff --git a/src/Bundle/ChillDocStoreBundle/Controller/DocumentPersonController.php b/src/Bundle/ChillDocStoreBundle/Controller/DocumentPersonController.php index 73fffa1c4..0f2e9caee 100644 --- a/src/Bundle/ChillDocStoreBundle/Controller/DocumentPersonController.php +++ b/src/Bundle/ChillDocStoreBundle/Controller/DocumentPersonController.php @@ -43,7 +43,8 @@ class DocumentPersonController extends AbstractController protected TranslatorInterface $translator, protected EventDispatcherInterface $eventDispatcher, protected AuthorizationHelper $authorizationHelper - ) {} + ) { + } /** * @Route("/{id}/delete", name="chill_docstore_person_document_delete") diff --git a/src/Bundle/ChillDocStoreBundle/Controller/GenericDocForAccompanyingPeriodController.php b/src/Bundle/ChillDocStoreBundle/Controller/GenericDocForAccompanyingPeriodController.php index e615c3b00..43a3eca2c 100644 --- a/src/Bundle/ChillDocStoreBundle/Controller/GenericDocForAccompanyingPeriodController.php +++ b/src/Bundle/ChillDocStoreBundle/Controller/GenericDocForAccompanyingPeriodController.php @@ -29,7 +29,8 @@ final readonly class GenericDocForAccompanyingPeriodController private PaginatorFactory $paginator, private Security $security, private \Twig\Environment $twig, - ) {} + ) { + } /** * @throws \Doctrine\DBAL\Exception diff --git a/src/Bundle/ChillDocStoreBundle/Controller/GenericDocForPerson.php b/src/Bundle/ChillDocStoreBundle/Controller/GenericDocForPerson.php index f6fecae04..d0d034c7e 100644 --- a/src/Bundle/ChillDocStoreBundle/Controller/GenericDocForPerson.php +++ b/src/Bundle/ChillDocStoreBundle/Controller/GenericDocForPerson.php @@ -29,7 +29,8 @@ final readonly class GenericDocForPerson private PaginatorFactory $paginator, private Security $security, private \Twig\Environment $twig, - ) {} + ) { + } /** * @throws \Doctrine\DBAL\Exception diff --git a/src/Bundle/ChillDocStoreBundle/Controller/StoredObjectApiController.php b/src/Bundle/ChillDocStoreBundle/Controller/StoredObjectApiController.php index 5a4b90474..6bfb05bfc 100644 --- a/src/Bundle/ChillDocStoreBundle/Controller/StoredObjectApiController.php +++ b/src/Bundle/ChillDocStoreBundle/Controller/StoredObjectApiController.php @@ -20,7 +20,9 @@ use Symfony\Component\Security\Core\Security; class StoredObjectApiController { - public function __construct(private readonly Security $security) {} + public function __construct(private readonly Security $security) + { + } /** * @Route("/api/1.0/doc-store/stored-object/{uuid}/is-ready") diff --git a/src/Bundle/ChillDocStoreBundle/Entity/Document.php b/src/Bundle/ChillDocStoreBundle/Entity/Document.php index e4990b1b8..a56b6b800 100644 --- a/src/Bundle/ChillDocStoreBundle/Entity/Document.php +++ b/src/Bundle/ChillDocStoreBundle/Entity/Document.php @@ -37,7 +37,7 @@ class Document implements TrackCreationInterface, TrackUpdateInterface * @ORM\JoinColumn(name="category_id_inside_bundle", referencedColumnName="id_inside_bundle") * }) */ - private ?\Chill\DocStoreBundle\Entity\DocumentCategory $category = null; + private ?DocumentCategory $category = null; /** * @ORM\Column(type="datetime") @@ -61,12 +61,12 @@ class Document implements TrackCreationInterface, TrackUpdateInterface * message="Upload a document" * ) */ - private ?\Chill\DocStoreBundle\Entity\StoredObject $object = null; + private ?StoredObject $object = null; /** * @ORM\ManyToOne(targetEntity="Chill\DocGeneratorBundle\Entity\DocGeneratorTemplate") */ - private ?\Chill\DocGeneratorBundle\Entity\DocGeneratorTemplate $template = null; + private ?DocGeneratorTemplate $template = null; /** * @ORM\Column(type="text") @@ -138,7 +138,7 @@ class Document implements TrackCreationInterface, TrackUpdateInterface return $this; } - public function setObject(StoredObject $object = null) + public function setObject(?StoredObject $object = null) { $this->object = $object; diff --git a/src/Bundle/ChillDocStoreBundle/Entity/DocumentCategory.php b/src/Bundle/ChillDocStoreBundle/Entity/DocumentCategory.php index a6c19584d..b7e056cac 100644 --- a/src/Bundle/ChillDocStoreBundle/Entity/DocumentCategory.php +++ b/src/Bundle/ChillDocStoreBundle/Entity/DocumentCategory.php @@ -53,7 +53,8 @@ class DocumentCategory * @var int The id which is unique inside the bundle */ private $idInsideBundle - ) {} + ) { + } public function getBundleId() // ::class BundleClass (FQDN) { diff --git a/src/Bundle/ChillDocStoreBundle/Entity/PersonDocument.php b/src/Bundle/ChillDocStoreBundle/Entity/PersonDocument.php index 659395034..84056a3b9 100644 --- a/src/Bundle/ChillDocStoreBundle/Entity/PersonDocument.php +++ b/src/Bundle/ChillDocStoreBundle/Entity/PersonDocument.php @@ -41,9 +41,9 @@ class PersonDocument extends Document implements HasCenterInterface, HasScopeInt /** * @ORM\ManyToOne(targetEntity="Chill\MainBundle\Entity\Scope") * - * @var \Chill\MainBundle\Entity\Scope The document's center + * @var Scope The document's center */ - private ?\Chill\MainBundle\Entity\Scope $scope = null; + private ?Scope $scope = null; public function getCenter() { diff --git a/src/Bundle/ChillDocStoreBundle/Form/PersonDocumentType.php b/src/Bundle/ChillDocStoreBundle/Form/PersonDocumentType.php index 0addd53cc..5c0b7d501 100644 --- a/src/Bundle/ChillDocStoreBundle/Form/PersonDocumentType.php +++ b/src/Bundle/ChillDocStoreBundle/Form/PersonDocumentType.php @@ -30,7 +30,9 @@ use Symfony\Component\OptionsResolver\OptionsResolver; class PersonDocumentType extends AbstractType { - public function __construct(private readonly TranslatableStringHelperInterface $translatableStringHelper, private readonly ScopeResolverDispatcher $scopeResolverDispatcher, private readonly ParameterBagInterface $parameterBag, private readonly CenterResolverDispatcher $centerResolverDispatcher) {} + public function __construct(private readonly TranslatableStringHelperInterface $translatableStringHelper, private readonly ScopeResolverDispatcher $scopeResolverDispatcher, private readonly ParameterBagInterface $parameterBag, private readonly CenterResolverDispatcher $centerResolverDispatcher) + { + } public function buildForm(FormBuilderInterface $builder, array $options) { diff --git a/src/Bundle/ChillDocStoreBundle/GenericDoc/FetchQuery.php b/src/Bundle/ChillDocStoreBundle/GenericDoc/FetchQuery.php index 80eeaf372..8adf13b42 100644 --- a/src/Bundle/ChillDocStoreBundle/GenericDoc/FetchQuery.php +++ b/src/Bundle/ChillDocStoreBundle/GenericDoc/FetchQuery.php @@ -54,7 +54,8 @@ class FetchQuery implements FetchQueryInterface private array $selectIdentifierTypes = [], private array $selectDateParams = [], private array $selectDateTypes = [], - ) {} + ) { + } public function addJoinClause(string $sql, array $params = [], array $types = []): int { diff --git a/src/Bundle/ChillDocStoreBundle/GenericDoc/GenericDocDTO.php b/src/Bundle/ChillDocStoreBundle/GenericDoc/GenericDocDTO.php index 7307f0d6a..fe9bf7e4f 100644 --- a/src/Bundle/ChillDocStoreBundle/GenericDoc/GenericDocDTO.php +++ b/src/Bundle/ChillDocStoreBundle/GenericDoc/GenericDocDTO.php @@ -21,7 +21,8 @@ final readonly class GenericDocDTO public array $identifiers, public \DateTimeImmutable $docDate, public AccompanyingPeriod|Person $linked, - ) {} + ) { + } public function getContext(): string { diff --git a/src/Bundle/ChillDocStoreBundle/GenericDoc/GenericDocForAccompanyingPeriodProviderInterface.php b/src/Bundle/ChillDocStoreBundle/GenericDoc/GenericDocForAccompanyingPeriodProviderInterface.php index 9ceec5438..bffa19b53 100644 --- a/src/Bundle/ChillDocStoreBundle/GenericDoc/GenericDocForAccompanyingPeriodProviderInterface.php +++ b/src/Bundle/ChillDocStoreBundle/GenericDoc/GenericDocForAccompanyingPeriodProviderInterface.php @@ -17,10 +17,10 @@ interface GenericDocForAccompanyingPeriodProviderInterface { public function buildFetchQueryForAccompanyingPeriod( AccompanyingPeriod $accompanyingPeriod, - \DateTimeImmutable $startDate = null, - \DateTimeImmutable $endDate = null, - string $content = null, - string $origin = null + ?\DateTimeImmutable $startDate = null, + ?\DateTimeImmutable $endDate = null, + ?string $content = null, + ?string $origin = null ): FetchQueryInterface; /** diff --git a/src/Bundle/ChillDocStoreBundle/GenericDoc/GenericDocForPersonProviderInterface.php b/src/Bundle/ChillDocStoreBundle/GenericDoc/GenericDocForPersonProviderInterface.php index 815459f20..264a1d8f2 100644 --- a/src/Bundle/ChillDocStoreBundle/GenericDoc/GenericDocForPersonProviderInterface.php +++ b/src/Bundle/ChillDocStoreBundle/GenericDoc/GenericDocForPersonProviderInterface.php @@ -17,10 +17,10 @@ interface GenericDocForPersonProviderInterface { public function buildFetchQueryForPerson( Person $person, - \DateTimeImmutable $startDate = null, - \DateTimeImmutable $endDate = null, - string $content = null, - string $origin = null + ?\DateTimeImmutable $startDate = null, + ?\DateTimeImmutable $endDate = null, + ?string $content = null, + ?string $origin = null ): FetchQueryInterface; /** diff --git a/src/Bundle/ChillDocStoreBundle/GenericDoc/Manager.php b/src/Bundle/ChillDocStoreBundle/GenericDoc/Manager.php index bfeddc8dc..a185ce9b6 100644 --- a/src/Bundle/ChillDocStoreBundle/GenericDoc/Manager.php +++ b/src/Bundle/ChillDocStoreBundle/GenericDoc/Manager.php @@ -43,9 +43,9 @@ final readonly class Manager */ public function countDocForAccompanyingPeriod( AccompanyingPeriod $accompanyingPeriod, - \DateTimeImmutable $startDate = null, - \DateTimeImmutable $endDate = null, - string $content = null, + ?\DateTimeImmutable $startDate = null, + ?\DateTimeImmutable $endDate = null, + ?string $content = null, array $places = [] ): int { ['sql' => $sql, 'params' => $params, 'types' => $types] = $this->buildUnionQuery($accompanyingPeriod, $startDate, $endDate, $content, $places); @@ -73,9 +73,9 @@ final readonly class Manager public function countDocForPerson( Person $person, - \DateTimeImmutable $startDate = null, - \DateTimeImmutable $endDate = null, - string $content = null, + ?\DateTimeImmutable $startDate = null, + ?\DateTimeImmutable $endDate = null, + ?string $content = null, array $places = [] ): int { ['sql' => $sql, 'params' => $params, 'types' => $types] = $this->buildUnionQuery($person, $startDate, $endDate, $content, $places); @@ -94,9 +94,9 @@ final readonly class Manager AccompanyingPeriod $accompanyingPeriod, int $offset = 0, int $limit = 20, - \DateTimeImmutable $startDate = null, - \DateTimeImmutable $endDate = null, - string $content = null, + ?\DateTimeImmutable $startDate = null, + ?\DateTimeImmutable $endDate = null, + ?string $content = null, array $places = [] ): iterable { ['sql' => $sql, 'params' => $params, 'types' => $types] = $this->buildUnionQuery($accompanyingPeriod, $startDate, $endDate, $content, $places); @@ -137,9 +137,9 @@ final readonly class Manager Person $person, int $offset = 0, int $limit = 20, - \DateTimeImmutable $startDate = null, - \DateTimeImmutable $endDate = null, - string $content = null, + ?\DateTimeImmutable $startDate = null, + ?\DateTimeImmutable $endDate = null, + ?string $content = null, array $places = [] ): iterable { ['sql' => $sql, 'params' => $params, 'types' => $types] = $this->buildUnionQuery($person, $startDate, $endDate, $content, $places); @@ -183,9 +183,9 @@ final readonly class Manager */ private function buildUnionQuery( AccompanyingPeriod|Person $linked, - \DateTimeImmutable $startDate = null, - \DateTimeImmutable $endDate = null, - string $content = null, + ?\DateTimeImmutable $startDate = null, + ?\DateTimeImmutable $endDate = null, + ?string $content = null, array $places = [], ): array { $queries = []; diff --git a/src/Bundle/ChillDocStoreBundle/GenericDoc/Providers/AccompanyingCourseDocumentGenericDocProvider.php b/src/Bundle/ChillDocStoreBundle/GenericDoc/Providers/AccompanyingCourseDocumentGenericDocProvider.php index 40130e3cc..d45f68a38 100644 --- a/src/Bundle/ChillDocStoreBundle/GenericDoc/Providers/AccompanyingCourseDocumentGenericDocProvider.php +++ b/src/Bundle/ChillDocStoreBundle/GenericDoc/Providers/AccompanyingCourseDocumentGenericDocProvider.php @@ -31,9 +31,10 @@ final readonly class AccompanyingCourseDocumentGenericDocProvider implements Gen public function __construct( private Security $security, private EntityManagerInterface $entityManager, - ) {} + ) { + } - public function buildFetchQueryForAccompanyingPeriod(AccompanyingPeriod $accompanyingPeriod, \DateTimeImmutable $startDate = null, \DateTimeImmutable $endDate = null, string $content = null, string $origin = null): FetchQueryInterface + public function buildFetchQueryForAccompanyingPeriod(AccompanyingPeriod $accompanyingPeriod, ?\DateTimeImmutable $startDate = null, ?\DateTimeImmutable $endDate = null, ?string $content = null, ?string $origin = null): FetchQueryInterface { $classMetadata = $this->entityManager->getClassMetadata(AccompanyingCourseDocument::class); @@ -58,7 +59,7 @@ final readonly class AccompanyingCourseDocumentGenericDocProvider implements Gen return $this->security->isGranted(AccompanyingCourseDocumentVoter::SEE, $accompanyingPeriod); } - public function buildFetchQueryForPerson(Person $person, \DateTimeImmutable $startDate = null, \DateTimeImmutable $endDate = null, string $content = null, string $origin = null): FetchQueryInterface + public function buildFetchQueryForPerson(Person $person, ?\DateTimeImmutable $startDate = null, ?\DateTimeImmutable $endDate = null, ?string $content = null, ?string $origin = null): FetchQueryInterface { $classMetadata = $this->entityManager->getClassMetadata(AccompanyingCourseDocument::class); @@ -107,7 +108,7 @@ final readonly class AccompanyingCourseDocumentGenericDocProvider implements Gen return $this->security->isGranted(AccompanyingPeriodVoter::SEE, $person); } - private function addWhereClause(FetchQuery $query, \DateTimeImmutable $startDate = null, \DateTimeImmutable $endDate = null, string $content = null): FetchQuery + private function addWhereClause(FetchQuery $query, ?\DateTimeImmutable $startDate = null, ?\DateTimeImmutable $endDate = null, ?string $content = null): FetchQuery { $classMetadata = $this->entityManager->getClassMetadata(AccompanyingCourseDocument::class); diff --git a/src/Bundle/ChillDocStoreBundle/GenericDoc/Providers/PersonDocumentGenericDocProvider.php b/src/Bundle/ChillDocStoreBundle/GenericDoc/Providers/PersonDocumentGenericDocProvider.php index 5f4728297..9f4cd4aff 100644 --- a/src/Bundle/ChillDocStoreBundle/GenericDoc/Providers/PersonDocumentGenericDocProvider.php +++ b/src/Bundle/ChillDocStoreBundle/GenericDoc/Providers/PersonDocumentGenericDocProvider.php @@ -27,14 +27,15 @@ final readonly class PersonDocumentGenericDocProvider implements GenericDocForPe public function __construct( private Security $security, private PersonDocumentACLAwareRepositoryInterface $personDocumentACLAwareRepository, - ) {} + ) { + } public function buildFetchQueryForPerson( Person $person, - \DateTimeImmutable $startDate = null, - \DateTimeImmutable $endDate = null, - string $content = null, - string $origin = null + ?\DateTimeImmutable $startDate = null, + ?\DateTimeImmutable $endDate = null, + ?string $content = null, + ?string $origin = null ): FetchQueryInterface { return $this->personDocumentACLAwareRepository->buildFetchQueryForPerson( $person, @@ -49,7 +50,7 @@ final readonly class PersonDocumentGenericDocProvider implements GenericDocForPe return $this->security->isGranted(PersonDocumentVoter::SEE, $person); } - public function buildFetchQueryForAccompanyingPeriod(AccompanyingPeriod $accompanyingPeriod, \DateTimeImmutable $startDate = null, \DateTimeImmutable $endDate = null, string $content = null, string $origin = null): FetchQueryInterface + public function buildFetchQueryForAccompanyingPeriod(AccompanyingPeriod $accompanyingPeriod, ?\DateTimeImmutable $startDate = null, ?\DateTimeImmutable $endDate = null, ?string $content = null, ?string $origin = null): FetchQueryInterface { return $this->personDocumentACLAwareRepository->buildFetchQueryForAccompanyingPeriod($accompanyingPeriod, $startDate, $endDate, $content); } diff --git a/src/Bundle/ChillDocStoreBundle/GenericDoc/Renderer/AccompanyingCourseDocumentGenericDocRenderer.php b/src/Bundle/ChillDocStoreBundle/GenericDoc/Renderer/AccompanyingCourseDocumentGenericDocRenderer.php index 70175ee1b..195b621c9 100644 --- a/src/Bundle/ChillDocStoreBundle/GenericDoc/Renderer/AccompanyingCourseDocumentGenericDocRenderer.php +++ b/src/Bundle/ChillDocStoreBundle/GenericDoc/Renderer/AccompanyingCourseDocumentGenericDocRenderer.php @@ -23,7 +23,8 @@ final readonly class AccompanyingCourseDocumentGenericDocRenderer implements Gen public function __construct( private AccompanyingCourseDocumentRepository $accompanyingCourseDocumentRepository, private PersonDocumentRepository $personDocumentRepository, - ) {} + ) { + } public function supports(GenericDocDTO $genericDocDTO, $options = []): bool { diff --git a/src/Bundle/ChillDocStoreBundle/GenericDoc/Twig/GenericDocExtensionRuntime.php b/src/Bundle/ChillDocStoreBundle/GenericDoc/Twig/GenericDocExtensionRuntime.php index e64838b41..abbaceffb 100644 --- a/src/Bundle/ChillDocStoreBundle/GenericDoc/Twig/GenericDocExtensionRuntime.php +++ b/src/Bundle/ChillDocStoreBundle/GenericDoc/Twig/GenericDocExtensionRuntime.php @@ -25,7 +25,8 @@ final readonly class GenericDocExtensionRuntime implements RuntimeExtensionInter * @var list */ private iterable $renderers, - ) {} + ) { + } /** * @throws RuntimeError diff --git a/src/Bundle/ChillDocStoreBundle/Menu/MenuBuilder.php b/src/Bundle/ChillDocStoreBundle/Menu/MenuBuilder.php index 485c95078..4848d0a5d 100644 --- a/src/Bundle/ChillDocStoreBundle/Menu/MenuBuilder.php +++ b/src/Bundle/ChillDocStoreBundle/Menu/MenuBuilder.php @@ -20,7 +20,9 @@ use Symfony\Contracts\Translation\TranslatorInterface; final readonly class MenuBuilder implements LocalMenuBuilderInterface { - public function __construct(private Security $security, private TranslatorInterface $translator) {} + public function __construct(private Security $security, private TranslatorInterface $translator) + { + } public function buildMenu($menuId, MenuItem $menu, array $parameters) { diff --git a/src/Bundle/ChillDocStoreBundle/Repository/AccompanyingCourseDocumentRepository.php b/src/Bundle/ChillDocStoreBundle/Repository/AccompanyingCourseDocumentRepository.php index 6c6e93fd7..2679993c4 100644 --- a/src/Bundle/ChillDocStoreBundle/Repository/AccompanyingCourseDocumentRepository.php +++ b/src/Bundle/ChillDocStoreBundle/Repository/AccompanyingCourseDocumentRepository.php @@ -55,7 +55,7 @@ class AccompanyingCourseDocumentRepository implements ObjectRepository return $this->repository->findAll(); } - public function findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null) + public function findBy(array $criteria, ?array $orderBy = null, $limit = null, $offset = null) { return $this->repository->findBy($criteria, $orderBy, $limit, $offset); } diff --git a/src/Bundle/ChillDocStoreBundle/Repository/DocumentCategoryRepository.php b/src/Bundle/ChillDocStoreBundle/Repository/DocumentCategoryRepository.php index 166749f71..460418951 100644 --- a/src/Bundle/ChillDocStoreBundle/Repository/DocumentCategoryRepository.php +++ b/src/Bundle/ChillDocStoreBundle/Repository/DocumentCategoryRepository.php @@ -41,7 +41,7 @@ class DocumentCategoryRepository implements ObjectRepository return $this->repository->findAll(); } - public function findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null) + public function findBy(array $criteria, ?array $orderBy = null, $limit = null, $offset = null) { return $this->repository->findBy($criteria, $orderBy, $limit, $offset); } diff --git a/src/Bundle/ChillDocStoreBundle/Repository/PersonDocumentACLAwareRepository.php b/src/Bundle/ChillDocStoreBundle/Repository/PersonDocumentACLAwareRepository.php index 385e8f398..b43605018 100644 --- a/src/Bundle/ChillDocStoreBundle/Repository/PersonDocumentACLAwareRepository.php +++ b/src/Bundle/ChillDocStoreBundle/Repository/PersonDocumentACLAwareRepository.php @@ -34,7 +34,8 @@ final readonly class PersonDocumentACLAwareRepository implements PersonDocumentA private CenterResolverManagerInterface $centerResolverManager, private AuthorizationHelperForCurrentUserInterface $authorizationHelperForCurrentUser, private Security $security, - ) {} + ) { + } public function buildQueryByPerson(Person $person): QueryBuilder { @@ -47,14 +48,14 @@ final readonly class PersonDocumentACLAwareRepository implements PersonDocumentA return $qb; } - public function buildFetchQueryForPerson(Person $person, \DateTimeImmutable $startDate = null, \DateTimeImmutable $endDate = null, string $content = null): FetchQueryInterface + public function buildFetchQueryForPerson(Person $person, ?\DateTimeImmutable $startDate = null, ?\DateTimeImmutable $endDate = null, ?string $content = null): FetchQueryInterface { $query = $this->buildBaseFetchQueryForPerson($person, $startDate, $endDate, $content); return $this->addFetchQueryByPersonACL($query, $person); } - public function buildFetchQueryForAccompanyingPeriod(AccompanyingPeriod $period, \DateTimeImmutable $startDate = null, \DateTimeImmutable $endDate = null, string $content = null): FetchQueryInterface + public function buildFetchQueryForAccompanyingPeriod(AccompanyingPeriod $period, ?\DateTimeImmutable $startDate = null, ?\DateTimeImmutable $endDate = null, ?string $content = null): FetchQueryInterface { $personDocMetadata = $this->em->getClassMetadata(PersonDocument::class); $participationMetadata = $this->em->getClassMetadata(AccompanyingPeriodParticipation::class); @@ -113,7 +114,7 @@ final readonly class PersonDocumentACLAwareRepository implements PersonDocumentA return $this->addFilterClauses($query, $startDate, $endDate, $content); } - public function buildBaseFetchQueryForPerson(Person $person, \DateTimeImmutable $startDate = null, \DateTimeImmutable $endDate = null, string $content = null): FetchQuery + public function buildBaseFetchQueryForPerson(Person $person, ?\DateTimeImmutable $startDate = null, ?\DateTimeImmutable $endDate = null, ?string $content = null): FetchQuery { $personDocMetadata = $this->em->getClassMetadata(PersonDocument::class); @@ -133,7 +134,7 @@ final readonly class PersonDocumentACLAwareRepository implements PersonDocumentA return $this->addFilterClauses($query, $startDate, $endDate, $content); } - private function addFilterClauses(FetchQuery $query, \DateTimeImmutable $startDate = null, \DateTimeImmutable $endDate = null, string $content = null): FetchQuery + private function addFilterClauses(FetchQuery $query, ?\DateTimeImmutable $startDate = null, ?\DateTimeImmutable $endDate = null, ?string $content = null): FetchQuery { $personDocMetadata = $this->em->getClassMetadata(PersonDocument::class); diff --git a/src/Bundle/ChillDocStoreBundle/Repository/PersonDocumentACLAwareRepositoryInterface.php b/src/Bundle/ChillDocStoreBundle/Repository/PersonDocumentACLAwareRepositoryInterface.php index 4bb55ce50..f1bc70812 100644 --- a/src/Bundle/ChillDocStoreBundle/Repository/PersonDocumentACLAwareRepositoryInterface.php +++ b/src/Bundle/ChillDocStoreBundle/Repository/PersonDocumentACLAwareRepositoryInterface.php @@ -29,15 +29,15 @@ interface PersonDocumentACLAwareRepositoryInterface public function buildFetchQueryForPerson( Person $person, - \DateTimeImmutable $startDate = null, - \DateTimeImmutable $endDate = null, - string $content = null + ?\DateTimeImmutable $startDate = null, + ?\DateTimeImmutable $endDate = null, + ?string $content = null ): FetchQueryInterface; public function buildFetchQueryForAccompanyingPeriod( AccompanyingPeriod $period, - \DateTimeImmutable $startDate = null, - \DateTimeImmutable $endDate = null, - string $content = null + ?\DateTimeImmutable $startDate = null, + ?\DateTimeImmutable $endDate = null, + ?string $content = null ): FetchQueryInterface; } diff --git a/src/Bundle/ChillDocStoreBundle/Repository/PersonDocumentRepository.php b/src/Bundle/ChillDocStoreBundle/Repository/PersonDocumentRepository.php index 4dfeb74fe..f880c0d67 100644 --- a/src/Bundle/ChillDocStoreBundle/Repository/PersonDocumentRepository.php +++ b/src/Bundle/ChillDocStoreBundle/Repository/PersonDocumentRepository.php @@ -39,7 +39,7 @@ readonly class PersonDocumentRepository implements ObjectRepository return $this->repository->findAll(); } - public function findBy(array $criteria, array $orderBy = null, int $limit = null, int $offset = null) + public function findBy(array $criteria, ?array $orderBy = null, ?int $limit = null, ?int $offset = null) { return $this->repository->findBy($criteria, $orderBy, $limit, $offset); } diff --git a/src/Bundle/ChillDocStoreBundle/Repository/StoredObjectRepository.php b/src/Bundle/ChillDocStoreBundle/Repository/StoredObjectRepository.php index 92644c97d..d2e715f7e 100644 --- a/src/Bundle/ChillDocStoreBundle/Repository/StoredObjectRepository.php +++ b/src/Bundle/ChillDocStoreBundle/Repository/StoredObjectRepository.php @@ -44,7 +44,7 @@ final class StoredObjectRepository implements ObjectRepository * * @return array */ - public function findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null): array + public function findBy(array $criteria, ?array $orderBy = null, $limit = null, $offset = null): array { return $this->repository->findBy($criteria, $orderBy, $limit, $offset); } diff --git a/src/Bundle/ChillDocStoreBundle/Serializer/Normalizer/StoredObjectDenormalizer.php b/src/Bundle/ChillDocStoreBundle/Serializer/Normalizer/StoredObjectDenormalizer.php index 2c96f7faa..d149e4e9b 100644 --- a/src/Bundle/ChillDocStoreBundle/Serializer/Normalizer/StoredObjectDenormalizer.php +++ b/src/Bundle/ChillDocStoreBundle/Serializer/Normalizer/StoredObjectDenormalizer.php @@ -20,7 +20,9 @@ class StoredObjectDenormalizer implements DenormalizerInterface { use ObjectToPopulateTrait; - public function __construct(private readonly StoredObjectRepository $storedObjectRepository) {} + public function __construct(private readonly StoredObjectRepository $storedObjectRepository) + { + } public function denormalize($data, $type, $format = null, array $context = []) { diff --git a/src/Bundle/ChillDocStoreBundle/Service/StoredObjectManager.php b/src/Bundle/ChillDocStoreBundle/Service/StoredObjectManager.php index 34df98fa2..b55074627 100644 --- a/src/Bundle/ChillDocStoreBundle/Service/StoredObjectManager.php +++ b/src/Bundle/ChillDocStoreBundle/Service/StoredObjectManager.php @@ -27,7 +27,9 @@ final class StoredObjectManager implements StoredObjectManagerInterface private array $inMemory = []; - public function __construct(private readonly HttpClientInterface $client, private readonly TempUrlGeneratorInterface $tempUrlGenerator) {} + public function __construct(private readonly HttpClientInterface $client, private readonly TempUrlGeneratorInterface $tempUrlGenerator) + { + } public function getLastModified(StoredObject $document): \DateTimeInterface { diff --git a/src/Bundle/ChillDocStoreBundle/Templating/WopiEditTwigExtensionRuntime.php b/src/Bundle/ChillDocStoreBundle/Templating/WopiEditTwigExtensionRuntime.php index 5f7a3c7df..f833200c8 100644 --- a/src/Bundle/ChillDocStoreBundle/Templating/WopiEditTwigExtensionRuntime.php +++ b/src/Bundle/ChillDocStoreBundle/Templating/WopiEditTwigExtensionRuntime.php @@ -120,7 +120,9 @@ final readonly class WopiEditTwigExtensionRuntime implements RuntimeExtensionInt private const TEMPLATE_BUTTON_GROUP = '@ChillDocStore/Button/button_group.html.twig'; - public function __construct(private DiscoveryInterface $discovery, private NormalizerInterface $normalizer) {} + public function __construct(private DiscoveryInterface $discovery, private NormalizerInterface $normalizer) + { + } /** * return true if the document is editable. @@ -134,13 +136,13 @@ final readonly class WopiEditTwigExtensionRuntime implements RuntimeExtensionInt } /** - * @param array{small: boolean} $options + * @param array{small: bool} $options * * @throws \Twig\Error\LoaderError * @throws \Twig\Error\RuntimeError * @throws \Twig\Error\SyntaxError */ - public function renderButtonGroup(Environment $environment, StoredObject $document, string $title = null, bool $canEdit = true, array $options = []): string + public function renderButtonGroup(Environment $environment, StoredObject $document, ?string $title = null, bool $canEdit = true, array $options = []): string { return $environment->render(self::TEMPLATE_BUTTON_GROUP, [ 'document' => $document, @@ -151,7 +153,7 @@ final readonly class WopiEditTwigExtensionRuntime implements RuntimeExtensionInt ]); } - public function renderEditButton(Environment $environment, StoredObject $document, array $options = null): string + public function renderEditButton(Environment $environment, StoredObject $document, ?array $options = null): string { return $environment->render(self::TEMPLATE, [ 'document' => $document, diff --git a/src/Bundle/ChillDocStoreBundle/Tests/GenericDoc/ManagerTest.php b/src/Bundle/ChillDocStoreBundle/Tests/GenericDoc/ManagerTest.php index 1b22a4d2e..8d4e67282 100644 --- a/src/Bundle/ChillDocStoreBundle/Tests/GenericDoc/ManagerTest.php +++ b/src/Bundle/ChillDocStoreBundle/Tests/GenericDoc/ManagerTest.php @@ -174,7 +174,7 @@ class ManagerTest extends KernelTestCase final readonly class SimpleGenericDocAccompanyingPeriodProvider implements GenericDocForAccompanyingPeriodProviderInterface { - public function buildFetchQueryForAccompanyingPeriod(AccompanyingPeriod $accompanyingPeriod, \DateTimeImmutable $startDate = null, \DateTimeImmutable $endDate = null, string $content = null, string $origin = null): FetchQueryInterface + public function buildFetchQueryForAccompanyingPeriod(AccompanyingPeriod $accompanyingPeriod, ?\DateTimeImmutable $startDate = null, ?\DateTimeImmutable $endDate = null, ?string $content = null, ?string $origin = null): FetchQueryInterface { $query = new FetchQuery( 'accompanying_course_document_dummy', @@ -196,7 +196,7 @@ final readonly class SimpleGenericDocAccompanyingPeriodProvider implements Gener final readonly class SimpleGenericDocPersonProvider implements GenericDocForPersonProviderInterface { - public function buildFetchQueryForPerson(Person $person, \DateTimeImmutable $startDate = null, \DateTimeImmutable $endDate = null, string $content = null, string $origin = null): FetchQueryInterface + public function buildFetchQueryForPerson(Person $person, ?\DateTimeImmutable $startDate = null, ?\DateTimeImmutable $endDate = null, ?string $content = null, ?string $origin = null): FetchQueryInterface { $query = new FetchQuery( 'dummy_person_doc', diff --git a/src/Bundle/ChillDocStoreBundle/Tests/GenericDoc/Providers/AccompanyingCourseDocumentGenericDocProviderTest.php b/src/Bundle/ChillDocStoreBundle/Tests/GenericDoc/Providers/AccompanyingCourseDocumentGenericDocProviderTest.php index edbe59c13..1250b132c 100644 --- a/src/Bundle/ChillDocStoreBundle/Tests/GenericDoc/Providers/AccompanyingCourseDocumentGenericDocProviderTest.php +++ b/src/Bundle/ChillDocStoreBundle/Tests/GenericDoc/Providers/AccompanyingCourseDocumentGenericDocProviderTest.php @@ -40,7 +40,7 @@ class AccompanyingCourseDocumentGenericDocProviderTest extends KernelTestCase /** * @dataProvider provideSearchArguments */ - public function testWithoutAnyArgument(?\DateTimeImmutable $startDate, ?\DateTimeImmutable $endDate, string $content = null): void + public function testWithoutAnyArgument(?\DateTimeImmutable $startDate, ?\DateTimeImmutable $endDate, ?string $content = null): void { $period = $this->entityManager->createQuery('SELECT a FROM '.AccompanyingPeriod::class.' a') ->setMaxResults(1) diff --git a/src/Bundle/ChillDocStoreBundle/Tests/Repository/PersonDocumentACLAwareRepositoryTest.php b/src/Bundle/ChillDocStoreBundle/Tests/Repository/PersonDocumentACLAwareRepositoryTest.php index 6dfd521a1..d24afe17f 100644 --- a/src/Bundle/ChillDocStoreBundle/Tests/Repository/PersonDocumentACLAwareRepositoryTest.php +++ b/src/Bundle/ChillDocStoreBundle/Tests/Repository/PersonDocumentACLAwareRepositoryTest.php @@ -53,7 +53,7 @@ class PersonDocumentACLAwareRepositoryTest extends KernelTestCase * @throws \Doctrine\ORM\NoResultException * @throws \Doctrine\ORM\NonUniqueResultException */ - public function testBuildFetchQueryForPerson(\DateTimeImmutable $startDate = null, \DateTimeImmutable $endDate = null, string $content = null): void + public function testBuildFetchQueryForPerson(?\DateTimeImmutable $startDate = null, ?\DateTimeImmutable $endDate = null, ?string $content = null): void { $centerManager = $this->prophesize(CenterResolverManagerInterface::class); $centerManager->resolveCenters(Argument::type(Person::class)) @@ -92,9 +92,9 @@ class PersonDocumentACLAwareRepositoryTest extends KernelTestCase */ public function testBuildFetchQueryForAccompanyingPeriod( AccompanyingPeriod $period, - \DateTimeImmutable $startDate = null, - \DateTimeImmutable $endDate = null, - string $content = null + ?\DateTimeImmutable $startDate = null, + ?\DateTimeImmutable $endDate = null, + ?string $content = null ): void { $centerManager = $this->prophesize(CenterResolverManagerInterface::class); $centerManager->resolveCenters(Argument::type(Person::class)) diff --git a/src/Bundle/ChillDocStoreBundle/Tests/StoredObjectManagerTest.php b/src/Bundle/ChillDocStoreBundle/Tests/StoredObjectManagerTest.php index bf659ba9b..bb6971939 100644 --- a/src/Bundle/ChillDocStoreBundle/Tests/StoredObjectManagerTest.php +++ b/src/Bundle/ChillDocStoreBundle/Tests/StoredObjectManagerTest.php @@ -90,7 +90,7 @@ final class StoredObjectManagerTest extends TestCase /** * @dataProvider getDataProvider */ - public function testRead(StoredObject $storedObject, string $encodedContent, string $clearContent, string $exceptionClass = null) + public function testRead(StoredObject $storedObject, string $encodedContent, string $clearContent, ?string $exceptionClass = null) { if (null !== $exceptionClass) { $this->expectException($exceptionClass); @@ -104,7 +104,7 @@ final class StoredObjectManagerTest extends TestCase /** * @dataProvider getDataProvider */ - public function testWrite(StoredObject $storedObject, string $encodedContent, string $clearContent, string $exceptionClass = null) + public function testWrite(StoredObject $storedObject, string $encodedContent, string $clearContent, ?string $exceptionClass = null) { if (null !== $exceptionClass) { $this->expectException($exceptionClass); diff --git a/src/Bundle/ChillEventBundle/ChillEventBundle.php b/src/Bundle/ChillEventBundle/ChillEventBundle.php index 9754f397f..d5a1b43cf 100644 --- a/src/Bundle/ChillEventBundle/ChillEventBundle.php +++ b/src/Bundle/ChillEventBundle/ChillEventBundle.php @@ -13,4 +13,6 @@ namespace Chill\EventBundle; use Symfony\Component\HttpKernel\Bundle\Bundle; -class ChillEventBundle extends Bundle {} +class ChillEventBundle extends Bundle +{ +} diff --git a/src/Bundle/ChillEventBundle/Controller/EventController.php b/src/Bundle/ChillEventBundle/Controller/EventController.php index e6ea264e4..e383c5432 100644 --- a/src/Bundle/ChillEventBundle/Controller/EventController.php +++ b/src/Bundle/ChillEventBundle/Controller/EventController.php @@ -92,7 +92,7 @@ class EventController extends AbstractController public function deleteAction($event_id, Request $request): \Symfony\Component\HttpFoundation\RedirectResponse|\Symfony\Component\HttpFoundation\Response { $em = $this->getDoctrine()->getManager(); - $event = $em->getRepository(\Chill\EventBundle\Entity\Event::class)->findOneBy([ + $event = $em->getRepository(Event::class)->findOneBy([ 'id' => $event_id, ]); @@ -146,7 +146,7 @@ class EventController extends AbstractController { $em = $this->getDoctrine()->getManager(); - $entity = $em->getRepository(\Chill\EventBundle\Entity\Event::class)->find($event_id); + $entity = $em->getRepository(Event::class)->find($event_id); if (!$entity) { throw $this->createNotFoundException('Unable to find Event entity.'); @@ -173,7 +173,7 @@ class EventController extends AbstractController { $em = $this->getDoctrine()->getManager(); - $person = $em->getRepository(\Chill\PersonBundle\Entity\Person::class)->find($person_id); + $person = $em->getRepository(Person::class)->find($person_id); if (null === $person) { throw $this->createNotFoundException('Person not found'); @@ -187,11 +187,11 @@ class EventController extends AbstractController $person->getCenter() ); - $total = $em->getRepository(\Chill\EventBundle\Entity\Participation::class)->countByPerson($person_id); + $total = $em->getRepository(Participation::class)->countByPerson($person_id); $paginator = $this->paginator->create($total); - $participations = $em->getRepository(\Chill\EventBundle\Entity\Participation::class)->findByPersonInCircle( + $participations = $em->getRepository(Participation::class)->findByPersonInCircle( $person_id, $reachablesCircles, $paginator->getCurrentPage()->getFirstItemNumber(), @@ -352,7 +352,7 @@ class EventController extends AbstractController { $em = $this->getDoctrine()->getManager(); - $entity = $em->getRepository(\Chill\EventBundle\Entity\Event::class)->find($event_id); + $entity = $em->getRepository(Event::class)->find($event_id); if (!$entity) { throw $this->createNotFoundException('Unable to find Event entity.'); diff --git a/src/Bundle/ChillEventBundle/Controller/EventTypeController.php b/src/Bundle/ChillEventBundle/Controller/EventTypeController.php index b96fb9cb9..3d9570abb 100644 --- a/src/Bundle/ChillEventBundle/Controller/EventTypeController.php +++ b/src/Bundle/ChillEventBundle/Controller/EventTypeController.php @@ -59,7 +59,7 @@ class EventTypeController extends AbstractController if ($form->isSubmitted() && $form->isValid()) { $em = $this->getDoctrine()->getManager(); - $entity = $em->getRepository(\Chill\EventBundle\Entity\EventType::class)->find($id); + $entity = $em->getRepository(EventType::class)->find($id); if (!$entity) { throw $this->createNotFoundException('Unable to find EventType entity.'); @@ -81,7 +81,7 @@ class EventTypeController extends AbstractController { $em = $this->getDoctrine()->getManager(); - $entity = $em->getRepository(\Chill\EventBundle\Entity\EventType::class)->find($id); + $entity = $em->getRepository(EventType::class)->find($id); if (!$entity) { throw $this->createNotFoundException('Unable to find EventType entity.'); @@ -106,7 +106,7 @@ class EventTypeController extends AbstractController { $em = $this->getDoctrine()->getManager(); - $entities = $em->getRepository(\Chill\EventBundle\Entity\EventType::class)->findAll(); + $entities = $em->getRepository(EventType::class)->findAll(); return $this->render('@ChillEvent/EventType/index.html.twig', [ 'entities' => $entities, @@ -138,7 +138,7 @@ class EventTypeController extends AbstractController { $em = $this->getDoctrine()->getManager(); - $entity = $em->getRepository(\Chill\EventBundle\Entity\EventType::class)->find($id); + $entity = $em->getRepository(EventType::class)->find($id); if (!$entity) { throw $this->createNotFoundException('Unable to find EventType entity.'); @@ -161,7 +161,7 @@ class EventTypeController extends AbstractController { $em = $this->getDoctrine()->getManager(); - $entity = $em->getRepository(\Chill\EventBundle\Entity\EventType::class)->find($id); + $entity = $em->getRepository(EventType::class)->find($id); if (!$entity) { throw $this->createNotFoundException('Unable to find EventType entity.'); diff --git a/src/Bundle/ChillEventBundle/Controller/ParticipationController.php b/src/Bundle/ChillEventBundle/Controller/ParticipationController.php index b80e33d2b..9785c20b0 100644 --- a/src/Bundle/ChillEventBundle/Controller/ParticipationController.php +++ b/src/Bundle/ChillEventBundle/Controller/ParticipationController.php @@ -33,7 +33,9 @@ class ParticipationController extends AbstractController /** * ParticipationController constructor. */ - public function __construct(private readonly LoggerInterface $logger, private readonly TranslatorInterface $translator) {} + public function __construct(private readonly LoggerInterface $logger, private readonly TranslatorInterface $translator) + { + } /** * @\Symfony\Component\Routing\Annotation\Route(path="/{_locale}/event/participation/create", name="chill_event_participation_create") @@ -239,7 +241,7 @@ class ParticipationController extends AbstractController public function deleteAction($participation_id, Request $request): Response|\Symfony\Component\HttpFoundation\RedirectResponse { $em = $this->getDoctrine()->getManager(); - $participation = $em->getRepository(\Chill\EventBundle\Entity\Participation::class)->findOneBy([ + $participation = $em->getRepository(Participation::class)->findOneBy([ 'id' => $participation_id, ]); @@ -319,7 +321,7 @@ class ParticipationController extends AbstractController */ public function editMultipleAction($event_id): Response|\Symfony\Component\HttpFoundation\RedirectResponse { - $event = $this->getDoctrine()->getRepository(\Chill\EventBundle\Entity\Event::class) + $event = $this->getDoctrine()->getRepository(Event::class) ->find($event_id); if (null === $event) { @@ -455,8 +457,8 @@ class ParticipationController extends AbstractController */ public function updateMultipleAction(mixed $event_id, Request $request) { - /** @var \Chill\EventBundle\Entity\Event $event */ - $event = $this->getDoctrine()->getRepository(\Chill\EventBundle\Entity\Event::class) + /** @var Event $event */ + $event = $this->getDoctrine()->getRepository(Event::class) ->find($event_id); if (null === $event) { @@ -498,7 +500,7 @@ class ParticipationController extends AbstractController } /** - * @return \Symfony\Component\Form\FormInterface + * @return FormInterface */ protected function createEditFormMultiple(Collection $participations, Event $event) { @@ -546,7 +548,7 @@ class ParticipationController extends AbstractController Request $request, Participation $participation, bool $multiple = false - ): array|\Chill\EventBundle\Entity\Participation { + ): array|Participation { $em = $this->getDoctrine()->getManager(); if ($em->contains($participation)) { @@ -557,7 +559,7 @@ class ParticipationController extends AbstractController // prevent error: `Argument 2 passed to ::getInt() must be of the type int, null given` if (null !== $event_id) { - $event = $em->getRepository(\Chill\EventBundle\Entity\Event::class) + $event = $em->getRepository(Event::class) ->find($event_id); if (null === $event) { @@ -751,7 +753,7 @@ class ParticipationController extends AbstractController } /** - * @return \Symfony\Component\Form\FormInterface + * @return FormInterface */ private function createDeleteForm($participation_id) { diff --git a/src/Bundle/ChillEventBundle/Controller/RoleController.php b/src/Bundle/ChillEventBundle/Controller/RoleController.php index 1b2ad2b25..8c0b63bc8 100644 --- a/src/Bundle/ChillEventBundle/Controller/RoleController.php +++ b/src/Bundle/ChillEventBundle/Controller/RoleController.php @@ -59,7 +59,7 @@ class RoleController extends AbstractController if ($form->isSubmitted() && $form->isValid()) { $em = $this->getDoctrine()->getManager(); - $entity = $em->getRepository(\Chill\EventBundle\Entity\Role::class)->find($id); + $entity = $em->getRepository(Role::class)->find($id); if (!$entity) { throw $this->createNotFoundException('Unable to find Role entity.'); @@ -81,7 +81,7 @@ class RoleController extends AbstractController { $em = $this->getDoctrine()->getManager(); - $entity = $em->getRepository(\Chill\EventBundle\Entity\Role::class)->find($id); + $entity = $em->getRepository(Role::class)->find($id); if (!$entity) { throw $this->createNotFoundException('Unable to find Role entity.'); @@ -106,7 +106,7 @@ class RoleController extends AbstractController { $em = $this->getDoctrine()->getManager(); - $entities = $em->getRepository(\Chill\EventBundle\Entity\Role::class)->findAll(); + $entities = $em->getRepository(Role::class)->findAll(); return $this->render('@ChillEvent/Role/index.html.twig', [ 'entities' => $entities, @@ -138,7 +138,7 @@ class RoleController extends AbstractController { $em = $this->getDoctrine()->getManager(); - $entity = $em->getRepository(\Chill\EventBundle\Entity\Role::class)->find($id); + $entity = $em->getRepository(Role::class)->find($id); if (!$entity) { throw $this->createNotFoundException('Unable to find Role entity.'); @@ -161,7 +161,7 @@ class RoleController extends AbstractController { $em = $this->getDoctrine()->getManager(); - $entity = $em->getRepository(\Chill\EventBundle\Entity\Role::class)->find($id); + $entity = $em->getRepository(Role::class)->find($id); if (!$entity) { throw $this->createNotFoundException('Unable to find Role entity.'); diff --git a/src/Bundle/ChillEventBundle/Controller/StatusController.php b/src/Bundle/ChillEventBundle/Controller/StatusController.php index 90bb7c1f2..c1b1018cd 100644 --- a/src/Bundle/ChillEventBundle/Controller/StatusController.php +++ b/src/Bundle/ChillEventBundle/Controller/StatusController.php @@ -59,7 +59,7 @@ class StatusController extends AbstractController if ($form->isSubmitted() && $form->isValid()) { $em = $this->getDoctrine()->getManager(); - $entity = $em->getRepository(\Chill\EventBundle\Entity\Status::class)->find($id); + $entity = $em->getRepository(Status::class)->find($id); if (!$entity) { throw $this->createNotFoundException('Unable to find Status entity.'); @@ -81,7 +81,7 @@ class StatusController extends AbstractController { $em = $this->getDoctrine()->getManager(); - $entity = $em->getRepository(\Chill\EventBundle\Entity\Status::class)->find($id); + $entity = $em->getRepository(Status::class)->find($id); if (!$entity) { throw $this->createNotFoundException('Unable to find Status entity.'); @@ -106,7 +106,7 @@ class StatusController extends AbstractController { $em = $this->getDoctrine()->getManager(); - $entities = $em->getRepository(\Chill\EventBundle\Entity\Status::class)->findAll(); + $entities = $em->getRepository(Status::class)->findAll(); return $this->render('@ChillEvent/Status/index.html.twig', [ 'entities' => $entities, @@ -138,7 +138,7 @@ class StatusController extends AbstractController { $em = $this->getDoctrine()->getManager(); - $entity = $em->getRepository(\Chill\EventBundle\Entity\Status::class)->find($id); + $entity = $em->getRepository(Status::class)->find($id); if (!$entity) { throw $this->createNotFoundException('Unable to find Status entity.'); @@ -161,7 +161,7 @@ class StatusController extends AbstractController { $em = $this->getDoctrine()->getManager(); - $entity = $em->getRepository(\Chill\EventBundle\Entity\Status::class)->find($id); + $entity = $em->getRepository(Status::class)->find($id); if (!$entity) { throw $this->createNotFoundException('Unable to find Status entity.'); diff --git a/src/Bundle/ChillEventBundle/DataFixtures/ORM/LoadParticipation.php b/src/Bundle/ChillEventBundle/DataFixtures/ORM/LoadParticipation.php index 71b07a123..db431c858 100644 --- a/src/Bundle/ChillEventBundle/DataFixtures/ORM/LoadParticipation.php +++ b/src/Bundle/ChillEventBundle/DataFixtures/ORM/LoadParticipation.php @@ -73,7 +73,7 @@ class LoadParticipation extends AbstractFixture implements OrderedFixtureInterfa ->findBy(['center' => $center]); $events = $this->createEvents($center, $manager); - /** @var \Chill\PersonBundle\Entity\Person $person */ + /** @var Person $person */ foreach ($people as $person) { $nb = random_int(0, 3); diff --git a/src/Bundle/ChillEventBundle/Entity/Event.php b/src/Bundle/ChillEventBundle/Entity/Event.php index 5ecc97afd..b5d013588 100644 --- a/src/Bundle/ChillEventBundle/Entity/Event.php +++ b/src/Bundle/ChillEventBundle/Entity/Event.php @@ -35,12 +35,12 @@ class Event implements HasCenterInterface, HasScopeInterface /** * @ORM\ManyToOne(targetEntity="Chill\MainBundle\Entity\Center") */ - private ?\Chill\MainBundle\Entity\Center $center = null; + private ?Center $center = null; /** * @ORM\ManyToOne(targetEntity="Chill\MainBundle\Entity\Scope") */ - private ?\Chill\MainBundle\Entity\Scope $circle = null; + private ?Scope $circle = null; /** * @ORM\Column(type="datetime") @@ -59,7 +59,7 @@ class Event implements HasCenterInterface, HasScopeInterface /** * @ORM\ManyToOne(targetEntity="Chill\MainBundle\Entity\User") */ - private ?\Chill\MainBundle\Entity\User $moderator = null; + private ?User $moderator = null; /** * @ORM\Column(type="string", length=150) @@ -78,7 +78,7 @@ class Event implements HasCenterInterface, HasScopeInterface /** * @ORM\ManyToOne(targetEntity="Chill\EventBundle\Entity\EventType") */ - private ?\Chill\EventBundle\Entity\EventType $type = null; + private ?EventType $type = null; /** * Event constructor. @@ -136,7 +136,7 @@ class Event implements HasCenterInterface, HasScopeInterface return $this->id; } - public function getModerator(): null|User + public function getModerator(): User|null { return $this->moderator; } diff --git a/src/Bundle/ChillEventBundle/Entity/Participation.php b/src/Bundle/ChillEventBundle/Entity/Participation.php index 8dda85c99..464feaf30 100644 --- a/src/Bundle/ChillEventBundle/Entity/Participation.php +++ b/src/Bundle/ChillEventBundle/Entity/Participation.php @@ -37,7 +37,7 @@ class Participation implements \ArrayAccess, HasCenterInterface, HasScopeInterfa * targetEntity="Chill\EventBundle\Entity\Event", * inversedBy="participations") */ - private ?\Chill\EventBundle\Entity\Event $event = null; + private ?Event $event = null; /** * @ORM\Id @@ -56,17 +56,17 @@ class Participation implements \ArrayAccess, HasCenterInterface, HasScopeInterfa /** * @ORM\ManyToOne(targetEntity="Chill\PersonBundle\Entity\Person") */ - private ?\Chill\PersonBundle\Entity\Person $person = null; + private ?Person $person = null; /** * @ORM\ManyToOne(targetEntity="Chill\EventBundle\Entity\Role") */ - private ?\Chill\EventBundle\Entity\Role $role = null; + private ?Role $role = null; /** * @ORM\ManyToOne(targetEntity="Chill\EventBundle\Entity\Status") */ - private ?\Chill\EventBundle\Entity\Status $status = null; + private ?Status $status = null; /** * @return Center @@ -83,7 +83,7 @@ class Participation implements \ArrayAccess, HasCenterInterface, HasScopeInterfa /** * Get event. */ - public function getEvent(): null|Event + public function getEvent(): Event|null { return $this->event; } @@ -121,7 +121,7 @@ class Participation implements \ArrayAccess, HasCenterInterface, HasScopeInterfa /** * Get role. */ - public function getRole(): null|Role + public function getRole(): Role|null { return $this->role; } @@ -141,7 +141,7 @@ class Participation implements \ArrayAccess, HasCenterInterface, HasScopeInterfa /** * Get status. */ - public function getStatus(): null|Status + public function getStatus(): Status|null { return $this->status; } @@ -233,7 +233,7 @@ class Participation implements \ArrayAccess, HasCenterInterface, HasScopeInterfa * * @return Participation */ - public function setEvent(Event $event = null) + public function setEvent(?Event $event = null) { if ($this->event !== $event) { $this->update(); @@ -249,7 +249,7 @@ class Participation implements \ArrayAccess, HasCenterInterface, HasScopeInterfa * * @return Participation */ - public function setPerson(Person $person = null) + public function setPerson(?Person $person = null) { if ($person !== $this->person) { $this->update(); @@ -265,7 +265,7 @@ class Participation implements \ArrayAccess, HasCenterInterface, HasScopeInterfa * * @return Participation */ - public function setRole(Role $role = null) + public function setRole(?Role $role = null) { if ($role !== $this->role) { $this->update(); @@ -280,7 +280,7 @@ class Participation implements \ArrayAccess, HasCenterInterface, HasScopeInterfa * * @return Participation */ - public function setStatus(Status $status = null) + public function setStatus(?Status $status = null) { if ($this->status !== $status) { $this->update(); diff --git a/src/Bundle/ChillEventBundle/Entity/Role.php b/src/Bundle/ChillEventBundle/Entity/Role.php index 3d2264d2f..d51fb87e3 100644 --- a/src/Bundle/ChillEventBundle/Entity/Role.php +++ b/src/Bundle/ChillEventBundle/Entity/Role.php @@ -50,7 +50,7 @@ class Role * targetEntity="Chill\EventBundle\Entity\EventType", * inversedBy="roles") */ - private ?\Chill\EventBundle\Entity\EventType $type = null; + private ?EventType $type = null; /** * Get active. @@ -125,7 +125,7 @@ class Role * * @return Role */ - public function setType(EventType $type = null) + public function setType(?EventType $type = null) { $this->type = $type; diff --git a/src/Bundle/ChillEventBundle/Entity/Status.php b/src/Bundle/ChillEventBundle/Entity/Status.php index 22fe8e3ed..59ae93df1 100644 --- a/src/Bundle/ChillEventBundle/Entity/Status.php +++ b/src/Bundle/ChillEventBundle/Entity/Status.php @@ -50,7 +50,7 @@ class Status * targetEntity="Chill\EventBundle\Entity\EventType", * inversedBy="statuses") */ - private ?\Chill\EventBundle\Entity\EventType $type = null; + private ?EventType $type = null; /** * Get active. @@ -125,7 +125,7 @@ class Status * * @return Status */ - public function setType(EventType $type = null) + public function setType(?EventType $type = null) { $this->type = $type; diff --git a/src/Bundle/ChillEventBundle/Form/ChoiceLoader/EventChoiceLoader.php b/src/Bundle/ChillEventBundle/Form/ChoiceLoader/EventChoiceLoader.php index 7507550c2..9aa001170 100644 --- a/src/Bundle/ChillEventBundle/Form/ChoiceLoader/EventChoiceLoader.php +++ b/src/Bundle/ChillEventBundle/Form/ChoiceLoader/EventChoiceLoader.php @@ -41,7 +41,7 @@ class EventChoiceLoader implements ChoiceLoaderInterface */ public function __construct( EntityRepository $eventRepository, - array $centers = null + ?array $centers = null ) { $this->eventRepository = $eventRepository; diff --git a/src/Bundle/ChillEventBundle/Form/ParticipationType.php b/src/Bundle/ChillEventBundle/Form/ParticipationType.php index af1854954..078f2ab9d 100644 --- a/src/Bundle/ChillEventBundle/Form/ParticipationType.php +++ b/src/Bundle/ChillEventBundle/Form/ParticipationType.php @@ -27,7 +27,9 @@ use Symfony\Component\OptionsResolver\OptionsResolver; */ final class ParticipationType extends AbstractType { - public function __construct(private readonly TranslatableStringHelperInterface $translatableStringHelper) {} + public function __construct(private readonly TranslatableStringHelperInterface $translatableStringHelper) + { + } public function buildForm(FormBuilderInterface $builder, array $options) { diff --git a/src/Bundle/ChillEventBundle/Form/RoleType.php b/src/Bundle/ChillEventBundle/Form/RoleType.php index 8b9f27be2..c8d0f5b33 100644 --- a/src/Bundle/ChillEventBundle/Form/RoleType.php +++ b/src/Bundle/ChillEventBundle/Form/RoleType.php @@ -20,7 +20,9 @@ use Symfony\Component\Form\FormBuilderInterface; final class RoleType extends AbstractType { - public function __construct(private readonly TranslatableStringHelperInterface $translatableStringHelper) {} + public function __construct(private readonly TranslatableStringHelperInterface $translatableStringHelper) + { + } public function buildForm(FormBuilderInterface $builder, array $options) { diff --git a/src/Bundle/ChillEventBundle/Form/Type/PickEventType.php b/src/Bundle/ChillEventBundle/Form/Type/PickEventType.php index 2b85a60c8..487c0c3b2 100644 --- a/src/Bundle/ChillEventBundle/Form/Type/PickEventType.php +++ b/src/Bundle/ChillEventBundle/Form/Type/PickEventType.php @@ -43,7 +43,8 @@ final class PickEventType extends AbstractType private readonly UrlGeneratorInterface $urlGenerator, private readonly TranslatorInterface $translator, private readonly Security $security - ) {} + ) { + } public function buildView(\Symfony\Component\Form\FormView $view, \Symfony\Component\Form\FormInterface $form, array $options) { diff --git a/src/Bundle/ChillEventBundle/Form/Type/PickRoleType.php b/src/Bundle/ChillEventBundle/Form/Type/PickRoleType.php index c8d69c119..8d66963e0 100644 --- a/src/Bundle/ChillEventBundle/Form/Type/PickRoleType.php +++ b/src/Bundle/ChillEventBundle/Form/Type/PickRoleType.php @@ -32,7 +32,8 @@ final class PickRoleType extends AbstractType private readonly TranslatableStringHelperInterface $translatableStringHelper, private readonly TranslatorInterface $translator, private readonly RoleRepository $roleRepository - ) {} + ) { + } public function buildForm(FormBuilderInterface $builder, array $options) { diff --git a/src/Bundle/ChillEventBundle/Form/Type/PickStatusType.php b/src/Bundle/ChillEventBundle/Form/Type/PickStatusType.php index 3f4ab3624..be016d6ca 100644 --- a/src/Bundle/ChillEventBundle/Form/Type/PickStatusType.php +++ b/src/Bundle/ChillEventBundle/Form/Type/PickStatusType.php @@ -33,7 +33,9 @@ use Symfony\Contracts\Translation\TranslatorInterface; */ final class PickStatusType extends AbstractType { - public function __construct(protected TranslatableStringHelperInterface $translatableStringHelper, protected TranslatorInterface $translator, protected StatusRepository $statusRepository) {} + public function __construct(protected TranslatableStringHelperInterface $translatableStringHelper, protected TranslatorInterface $translator, protected StatusRepository $statusRepository) + { + } public function buildForm(FormBuilderInterface $builder, array $options) { diff --git a/src/Bundle/ChillEventBundle/Search/EventSearch.php b/src/Bundle/ChillEventBundle/Search/EventSearch.php index 57cb9e9c5..7b77942cd 100644 --- a/src/Bundle/ChillEventBundle/Search/EventSearch.php +++ b/src/Bundle/ChillEventBundle/Search/EventSearch.php @@ -43,7 +43,8 @@ class EventSearch extends AbstractSearch private readonly AuthorizationHelper $authorizationHelper, private readonly \Twig\Environment $templating, private readonly PaginatorFactory $paginatorFactory - ) {} + ) { + } public function getOrder() { diff --git a/src/Bundle/ChillEventBundle/Tests/Search/EventSearchTest.php b/src/Bundle/ChillEventBundle/Tests/Search/EventSearchTest.php index c37566fe7..90c38743b 100644 --- a/src/Bundle/ChillEventBundle/Tests/Search/EventSearchTest.php +++ b/src/Bundle/ChillEventBundle/Tests/Search/EventSearchTest.php @@ -52,7 +52,7 @@ final class EventSearchTest extends WebTestCase /** * The eventSearch service, which is used to search events. * - * @var \Chill\EventBundle\Search\EventSearch + * @var EventSearch */ protected $eventSearch; diff --git a/src/Bundle/ChillMainBundle/CRUD/Controller/AbstractCRUDController.php b/src/Bundle/ChillMainBundle/CRUD/Controller/AbstractCRUDController.php index cfbe52218..f3982d0d5 100644 --- a/src/Bundle/ChillMainBundle/CRUD/Controller/AbstractCRUDController.php +++ b/src/Bundle/ChillMainBundle/CRUD/Controller/AbstractCRUDController.php @@ -141,7 +141,9 @@ abstract class AbstractCRUDController extends AbstractController return new $class(); } - protected function customizeQuery(string $action, Request $request, $query): void {} + protected function customizeQuery(string $action, Request $request, $query): void + { + } protected function getActionConfig(string $action) { diff --git a/src/Bundle/ChillMainBundle/CRUD/Controller/ApiController.php b/src/Bundle/ChillMainBundle/CRUD/Controller/ApiController.php index 345da5bc5..78bdc96d5 100644 --- a/src/Bundle/ChillMainBundle/CRUD/Controller/ApiController.php +++ b/src/Bundle/ChillMainBundle/CRUD/Controller/ApiController.php @@ -175,7 +175,7 @@ class ApiController extends AbstractCRUDController public function indexApi(Request $request, string $_format) { return match ($request->getMethod()) { - Request::METHOD_GET, REQUEST::METHOD_HEAD => $this->indexApiAction('_index', $request, $_format), + Request::METHOD_GET, Request::METHOD_HEAD => $this->indexApiAction('_index', $request, $_format), default => throw $this->createNotFoundException('This method is not supported'), }; } diff --git a/src/Bundle/ChillMainBundle/CRUD/Controller/CRUDController.php b/src/Bundle/ChillMainBundle/CRUD/Controller/CRUDController.php index 39cef87b7..213efba24 100644 --- a/src/Bundle/ChillMainBundle/CRUD/Controller/CRUDController.php +++ b/src/Bundle/ChillMainBundle/CRUD/Controller/CRUDController.php @@ -181,7 +181,7 @@ class CRUDController extends AbstractController /** * Count the number of entities. */ - protected function countEntities(string $action, Request $request, FilterOrderHelper $filterOrder = null): int + protected function countEntities(string $action, Request $request, ?FilterOrderHelper $filterOrder = null): int { return $this->buildQueryEntities($action, $request) ->select('COUNT(e)') @@ -210,7 +210,7 @@ class CRUDController extends AbstractController * It is preferable to override customizeForm instead of overriding * this method. */ - protected function createFormFor(string $action, mixed $entity, string $formClass = null, array $formOptions = []): FormInterface + protected function createFormFor(string $action, mixed $entity, ?string $formClass = null, array $formOptions = []): FormInterface { $formClass ??= $this->getFormClassFor($action); @@ -224,9 +224,13 @@ class CRUDController extends AbstractController /** * Customize the form created by createFormFor. */ - protected function customizeForm(string $action, FormInterface $form) {} + protected function customizeForm(string $action, FormInterface $form) + { + } - protected function customizeQuery(string $action, Request $request, $query): void {} + protected function customizeQuery(string $action, Request $request, $query): void + { + } /** * @param null $formClass @@ -459,7 +463,7 @@ class CRUDController extends AbstractController * * @throws \Symfony\Component\HttpKernel\Exception\NotFoundHttpException */ - protected function formEditAction(string $action, Request $request, mixed $id, string $formClass = null, array $formOptions = []): Response + protected function formEditAction(string $action, Request $request, mixed $id, ?string $formClass = null, array $formOptions = []): Response { $entity = $this->getEntity($action, $id, $request); @@ -656,7 +660,7 @@ class CRUDController extends AbstractController Request $request, int $totalItems, PaginatorInterface $paginator, - FilterOrderHelper $filterOrder = null + ?FilterOrderHelper $filterOrder = null ) { $query = $this->queryEntities($action, $request, $paginator, $filterOrder); @@ -666,7 +670,7 @@ class CRUDController extends AbstractController /** * @return \Chill\MainBundle\Entity\Center[] */ - protected function getReachableCenters(string $role, Scope $scope = null) + protected function getReachableCenters(string $role, ?Scope $scope = null) { return $this->getAuthorizationHelper() ->getReachableCenters($this->getUser(), $role, $scope); @@ -840,7 +844,9 @@ class CRUDController extends AbstractController }; } - protected function onFormValid(string $action, object $entity, FormInterface $form, Request $request) {} + protected function onFormValid(string $action, object $entity, FormInterface $form, Request $request) + { + } protected function onPostCheckACL($action, Request $request, $entity): ?Response { @@ -852,36 +858,58 @@ class CRUDController extends AbstractController return null; } - protected function onPostFlush(string $action, $entity, FormInterface $form, Request $request) {} + protected function onPostFlush(string $action, $entity, FormInterface $form, Request $request) + { + } /** * method used by indexAction. */ - protected function onPostIndexBuildQuery(string $action, Request $request, int $totalItems, PaginatorInterface $paginator, mixed $query) {} + protected function onPostIndexBuildQuery(string $action, Request $request, int $totalItems, PaginatorInterface $paginator, mixed $query) + { + } /** * method used by indexAction. */ - protected function onPostIndexFetchQuery(string $action, Request $request, int $totalItems, PaginatorInterface $paginator, mixed $entities) {} + protected function onPostIndexFetchQuery(string $action, Request $request, int $totalItems, PaginatorInterface $paginator, mixed $entities) + { + } - protected function onPostPersist(string $action, $entity, FormInterface $form, Request $request) {} + protected function onPostPersist(string $action, $entity, FormInterface $form, Request $request) + { + } - protected function onPostRemove(string $action, $entity, FormInterface $form, Request $request) {} + protected function onPostRemove(string $action, $entity, FormInterface $form, Request $request) + { + } - protected function onPreDelete(string $action, Request $request) {} + protected function onPreDelete(string $action, Request $request) + { + } - protected function onPreFlush(string $action, $entity, FormInterface $form, Request $request) {} + protected function onPreFlush(string $action, $entity, FormInterface $form, Request $request) + { + } - protected function onPreIndex(string $action, Request $request) {} + protected function onPreIndex(string $action, Request $request) + { + } /** * method used by indexAction. */ - protected function onPreIndexBuildQuery(string $action, Request $request, int $totalItems, PaginatorInterface $paginator) {} + protected function onPreIndexBuildQuery(string $action, Request $request, int $totalItems, PaginatorInterface $paginator) + { + } - protected function onPrePersist(string $action, $entity, FormInterface $form, Request $request) {} + protected function onPrePersist(string $action, $entity, FormInterface $form, Request $request) + { + } - protected function onPreRemove(string $action, $entity, FormInterface $form, Request $request) {} + protected function onPreRemove(string $action, $entity, FormInterface $form, Request $request) + { + } /** * Add ordering fields in the query build by self::queryEntities. @@ -906,7 +934,7 @@ class CRUDController extends AbstractController * * @return type */ - protected function queryEntities(string $action, Request $request, PaginatorInterface $paginator, FilterOrderHelper $filterOrder = null) + protected function queryEntities(string $action, Request $request, PaginatorInterface $paginator, ?FilterOrderHelper $filterOrder = null) { $query = $this->buildQueryEntities($action, $request) ->setFirstResult($paginator->getCurrentPage()->getFirstItemNumber()) diff --git a/src/Bundle/ChillMainBundle/CRUD/Form/CRUDDeleteEntityForm.php b/src/Bundle/ChillMainBundle/CRUD/Form/CRUDDeleteEntityForm.php index 95f81ae05..3ff3cf134 100644 --- a/src/Bundle/ChillMainBundle/CRUD/Form/CRUDDeleteEntityForm.php +++ b/src/Bundle/ChillMainBundle/CRUD/Form/CRUDDeleteEntityForm.php @@ -16,4 +16,6 @@ use Symfony\Component\Form\AbstractType; /** * Class CRUDDeleteEntityForm. */ -class CRUDDeleteEntityForm extends AbstractType {} +class CRUDDeleteEntityForm extends AbstractType +{ +} diff --git a/src/Bundle/ChillMainBundle/Command/ChillUserSendRenewPasswordCodeCommand.php b/src/Bundle/ChillMainBundle/Command/ChillUserSendRenewPasswordCodeCommand.php index 0c68798f9..da14d85ff 100644 --- a/src/Bundle/ChillMainBundle/Command/ChillUserSendRenewPasswordCodeCommand.php +++ b/src/Bundle/ChillMainBundle/Command/ChillUserSendRenewPasswordCodeCommand.php @@ -57,12 +57,12 @@ class ChillUserSendRenewPasswordCodeCommand extends Command /** * The current input interface. */ - private ?\Symfony\Component\Console\Input\InputInterface $input = null; + private ?InputInterface $input = null; /** * The current output interface. */ - private ?\Symfony\Component\Console\Output\OutputInterface $output = null; + private ?OutputInterface $output = null; public function __construct( LoggerInterface $logger, diff --git a/src/Bundle/ChillMainBundle/Command/LoadAndUpdateLanguagesCommand.php b/src/Bundle/ChillMainBundle/Command/LoadAndUpdateLanguagesCommand.php index e5833e580..860f8c82e 100644 --- a/src/Bundle/ChillMainBundle/Command/LoadAndUpdateLanguagesCommand.php +++ b/src/Bundle/ChillMainBundle/Command/LoadAndUpdateLanguagesCommand.php @@ -83,7 +83,7 @@ class LoadAndUpdateLanguagesCommand extends Command $languages = []; foreach ($chillAvailableLanguages as $avLang) { - $languages[$avLang] = \Symfony\Component\Intl\Languages::getNames(); + $languages[$avLang] = Languages::getNames(); } foreach (Languages::getNames() as $code => $lang) { @@ -105,7 +105,7 @@ class LoadAndUpdateLanguagesCommand extends Command $languageDB = $em->getRepository(Language::class)->find($code); if (null === $languageDB) { - $languageDB = new \Chill\MainBundle\Entity\Language(); + $languageDB = new Language(); $languageDB->setId($code); $em->persist($languageDB); } diff --git a/src/Bundle/ChillMainBundle/Command/LoadCountriesCommand.php b/src/Bundle/ChillMainBundle/Command/LoadCountriesCommand.php index 92106d200..b6a9be75c 100644 --- a/src/Bundle/ChillMainBundle/Command/LoadCountriesCommand.php +++ b/src/Bundle/ChillMainBundle/Command/LoadCountriesCommand.php @@ -40,7 +40,7 @@ class LoadCountriesCommand extends Command $names[$language] = Countries::getName($code, $language); } - $country = new \Chill\MainBundle\Entity\Country(); + $country = new Country(); $country->setName($names)->setCountryCode($code); $countryEntities[] = $country; } diff --git a/src/Bundle/ChillMainBundle/Command/LoadPostalCodesCommand.php b/src/Bundle/ChillMainBundle/Command/LoadPostalCodesCommand.php index b22027499..fe11f8b9f 100644 --- a/src/Bundle/ChillMainBundle/Command/LoadPostalCodesCommand.php +++ b/src/Bundle/ChillMainBundle/Command/LoadPostalCodesCommand.php @@ -194,8 +194,14 @@ class LoadPostalCodesCommand extends Command } } -class ExistingPostalCodeException extends \Exception {} +class ExistingPostalCodeException extends \Exception +{ +} -class CountryCodeNotFoundException extends \Exception {} +class CountryCodeNotFoundException extends \Exception +{ +} -class PostalCodeNotValidException extends \Exception {} +class PostalCodeNotValidException extends \Exception +{ +} diff --git a/src/Bundle/ChillMainBundle/Command/SetPasswordCommand.php b/src/Bundle/ChillMainBundle/Command/SetPasswordCommand.php index c38272d06..a83663ed0 100644 --- a/src/Bundle/ChillMainBundle/Command/SetPasswordCommand.php +++ b/src/Bundle/ChillMainBundle/Command/SetPasswordCommand.php @@ -36,7 +36,7 @@ class SetPasswordCommand extends Command public function _getUser($username) { return $this->entityManager - ->getRepository(\Chill\MainBundle\Entity\User::class) + ->getRepository(User::class) ->findOneBy(['username' => $username]); } diff --git a/src/Bundle/ChillMainBundle/Controller/AddressReferenceAPIController.php b/src/Bundle/ChillMainBundle/Controller/AddressReferenceAPIController.php index b3cf68849..edc58bed5 100644 --- a/src/Bundle/ChillMainBundle/Controller/AddressReferenceAPIController.php +++ b/src/Bundle/ChillMainBundle/Controller/AddressReferenceAPIController.php @@ -26,7 +26,9 @@ use Symfony\Component\Serializer\Normalizer\AbstractNormalizer; final class AddressReferenceAPIController extends ApiController { - public function __construct(private readonly AddressReferenceRepository $addressReferenceRepository, private readonly PaginatorFactory $paginatorFactory) {} + public function __construct(private readonly AddressReferenceRepository $addressReferenceRepository, private readonly PaginatorFactory $paginatorFactory) + { + } /** * @Route("/api/1.0/main/address-reference/by-postal-code/{id}/search.json") diff --git a/src/Bundle/ChillMainBundle/Controller/AddressToReferenceMatcherController.php b/src/Bundle/ChillMainBundle/Controller/AddressToReferenceMatcherController.php index 967ee7b5b..079f4783b 100644 --- a/src/Bundle/ChillMainBundle/Controller/AddressToReferenceMatcherController.php +++ b/src/Bundle/ChillMainBundle/Controller/AddressToReferenceMatcherController.php @@ -23,7 +23,9 @@ use Symfony\Component\Serializer\SerializerInterface; class AddressToReferenceMatcherController { - public function __construct(private readonly Security $security, private readonly EntityManagerInterface $entityManager, private readonly SerializerInterface $serializer) {} + public function __construct(private readonly Security $security, private readonly EntityManagerInterface $entityManager, private readonly SerializerInterface $serializer) + { + } /** * @Route("/api/1.0/main/address/reference-match/{id}/set/reviewed", methods={"POST"}) diff --git a/src/Bundle/ChillMainBundle/Controller/ExportController.php b/src/Bundle/ChillMainBundle/Controller/ExportController.php index d318fcc58..2df7008d6 100644 --- a/src/Bundle/ChillMainBundle/Controller/ExportController.php +++ b/src/Bundle/ChillMainBundle/Controller/ExportController.php @@ -70,7 +70,7 @@ class ExportController extends AbstractController */ public function downloadResultAction(Request $request, mixed $alias) { - /** @var \Chill\MainBundle\Export\ExportManager $exportManager */ + /** @var ExportManager $exportManager */ $exportManager = $this->exportManager; $export = $exportManager->getExport($alias); $key = $request->query->get('key', null); @@ -108,13 +108,13 @@ class ExportController extends AbstractController * * @param string $alias * - * @return \Symfony\Component\HttpFoundation\Response + * @return Response * * @\Symfony\Component\Routing\Annotation\Route(path="/{_locale}/exports/generate/{alias}", name="chill_main_export_generate", methods={"GET"}) */ public function generateAction(Request $request, $alias) { - /** @var \Chill\MainBundle\Export\ExportManager $exportManager */ + /** @var ExportManager $exportManager */ $exportManager = $this->exportManager; $key = $request->query->get('key', null); $savedExport = $this->getSavedExportFromRequest($request); @@ -274,7 +274,7 @@ class ExportController extends AbstractController */ protected function createCreateFormExport(string $alias, string $step, array $data, ?SavedExport $savedExport): FormInterface { - /** @var \Chill\MainBundle\Export\ExportManager $exportManager */ + /** @var ExportManager $exportManager */ $exportManager = $this->exportManager; $isGenerate = str_starts_with($step, 'generate_'); @@ -334,7 +334,7 @@ class ExportController extends AbstractController * When the method is POST, the form is stored if valid, and a redirection * is done to next step. */ - private function exportFormStep(Request $request, DirectExportInterface|ExportInterface $export, string $alias, SavedExport $savedExport = null): Response + private function exportFormStep(Request $request, DirectExportInterface|ExportInterface $export, string $alias, ?SavedExport $savedExport = null): Response { $exportManager = $this->exportManager; @@ -392,7 +392,7 @@ class ExportController extends AbstractController * If the form is posted and valid, store the data in session and * redirect to the next step. */ - private function formatterFormStep(Request $request, DirectExportInterface|ExportInterface $export, string $alias, SavedExport $savedExport = null): Response + private function formatterFormStep(Request $request, DirectExportInterface|ExportInterface $export, string $alias, ?SavedExport $savedExport = null): Response { // check we have data from the previous step (export step) $data = $this->session->get('export_step', null); @@ -444,7 +444,7 @@ class ExportController extends AbstractController * * @param string $alias * - * @return \Symfony\Component\HttpFoundation\RedirectResponse + * @return RedirectResponse */ private function forwardToGenerate(Request $request, DirectExportInterface|ExportInterface $export, $alias, ?SavedExport $savedExport) { @@ -452,7 +452,7 @@ class ExportController extends AbstractController $dataFormatter = $this->session->get('formatter_step_raw', null); $dataExport = $this->session->get('export_step_raw', null); - if (null === $dataFormatter && $export instanceof \Chill\MainBundle\Export\ExportInterface) { + if (null === $dataFormatter && $export instanceof ExportInterface) { return $this->redirectToRoute('chill_main_export_new', [ 'alias' => $alias, 'step' => $this->getNextStep('generate', $export, true), @@ -521,7 +521,7 @@ class ExportController extends AbstractController * * @return Response */ - private function selectCentersStep(Request $request, DirectExportInterface|ExportInterface $export, $alias, SavedExport $savedExport = null) + private function selectCentersStep(Request $request, DirectExportInterface|ExportInterface $export, $alias, ?SavedExport $savedExport = null) { if (!$this->filterStatsByCenters) { return $this->redirectToRoute('chill_main_export_new', [ @@ -531,7 +531,7 @@ class ExportController extends AbstractController ]); } - /** @var \Chill\MainBundle\Export\ExportManager $exportManager */ + /** @var ExportManager $exportManager */ $exportManager = $this->exportManager; $form = $this->createCreateFormExport($alias, 'centers', [], $savedExport); @@ -620,11 +620,11 @@ class ExportController extends AbstractController return 'export'; case 'export': - if ($export instanceof \Chill\MainBundle\Export\ExportInterface) { + if ($export instanceof ExportInterface) { return $reverse ? 'centers' : 'formatter'; } - if ($export instanceof \Chill\MainBundle\Export\DirectExportInterface) { + if ($export instanceof DirectExportInterface) { return $reverse ? 'centers' : 'generate'; } diff --git a/src/Bundle/ChillMainBundle/Controller/GeographicalUnitByAddressApiController.php b/src/Bundle/ChillMainBundle/Controller/GeographicalUnitByAddressApiController.php index 24253de36..a8a9c0610 100644 --- a/src/Bundle/ChillMainBundle/Controller/GeographicalUnitByAddressApiController.php +++ b/src/Bundle/ChillMainBundle/Controller/GeographicalUnitByAddressApiController.php @@ -24,7 +24,9 @@ use Symfony\Component\Serializer\SerializerInterface; class GeographicalUnitByAddressApiController { - public function __construct(private readonly PaginatorFactory $paginatorFactory, private readonly GeographicalUnitRepositoryInterface $geographicalUnitRepository, private readonly Security $security, private readonly SerializerInterface $serializer) {} + public function __construct(private readonly PaginatorFactory $paginatorFactory, private readonly GeographicalUnitRepositoryInterface $geographicalUnitRepository, private readonly Security $security, private readonly SerializerInterface $serializer) + { + } /** * @Route("/api/1.0/main/geographical-unit/by-address/{id}.{_format}", requirements={"_format": "json"}) diff --git a/src/Bundle/ChillMainBundle/Controller/LocationTypeController.php b/src/Bundle/ChillMainBundle/Controller/LocationTypeController.php index 418f49578..bc28f9d12 100644 --- a/src/Bundle/ChillMainBundle/Controller/LocationTypeController.php +++ b/src/Bundle/ChillMainBundle/Controller/LocationTypeController.php @@ -13,4 +13,6 @@ namespace Chill\MainBundle\Controller; use Chill\MainBundle\CRUD\Controller\CRUDController; -class LocationTypeController extends CRUDController {} +class LocationTypeController extends CRUDController +{ +} diff --git a/src/Bundle/ChillMainBundle/Controller/LoginController.php b/src/Bundle/ChillMainBundle/Controller/LoginController.php index df295d0b2..e04f478a8 100644 --- a/src/Bundle/ChillMainBundle/Controller/LoginController.php +++ b/src/Bundle/ChillMainBundle/Controller/LoginController.php @@ -46,5 +46,7 @@ class LoginController extends AbstractController ]); } - public function LoginCheckAction(Request $request) {} + public function LoginCheckAction(Request $request) + { + } } diff --git a/src/Bundle/ChillMainBundle/Controller/NotificationApiController.php b/src/Bundle/ChillMainBundle/Controller/NotificationApiController.php index 16599b9a2..42f0e5469 100644 --- a/src/Bundle/ChillMainBundle/Controller/NotificationApiController.php +++ b/src/Bundle/ChillMainBundle/Controller/NotificationApiController.php @@ -31,7 +31,9 @@ use Symfony\Component\Serializer\SerializerInterface; */ class NotificationApiController { - public function __construct(private readonly EntityManagerInterface $entityManager, private readonly NotificationRepository $notificationRepository, private readonly PaginatorFactory $paginatorFactory, private readonly Security $security, private readonly SerializerInterface $serializer) {} + public function __construct(private readonly EntityManagerInterface $entityManager, private readonly NotificationRepository $notificationRepository, private readonly PaginatorFactory $paginatorFactory, private readonly Security $security, private readonly SerializerInterface $serializer) + { + } /** * @Route("/{id}/mark/read", name="chill_api_main_notification_mark_read", methods={"POST"}) diff --git a/src/Bundle/ChillMainBundle/Controller/NotificationController.php b/src/Bundle/ChillMainBundle/Controller/NotificationController.php index 4131ba714..4d962248c 100644 --- a/src/Bundle/ChillMainBundle/Controller/NotificationController.php +++ b/src/Bundle/ChillMainBundle/Controller/NotificationController.php @@ -41,7 +41,9 @@ use function in_array; */ class NotificationController extends AbstractController { - public function __construct(private readonly EntityManagerInterface $em, private readonly LoggerInterface $chillLogger, private readonly LoggerInterface $logger, private readonly Security $security, private readonly NotificationRepository $notificationRepository, private readonly NotificationHandlerManager $notificationHandlerManager, private readonly PaginatorFactory $paginatorFactory, private readonly TranslatorInterface $translator, private readonly UserRepository $userRepository) {} + public function __construct(private readonly EntityManagerInterface $em, private readonly LoggerInterface $chillLogger, private readonly LoggerInterface $logger, private readonly Security $security, private readonly NotificationRepository $notificationRepository, private readonly NotificationHandlerManager $notificationHandlerManager, private readonly PaginatorFactory $paginatorFactory, private readonly TranslatorInterface $translator, private readonly UserRepository $userRepository) + { + } /** * @Route("/create", name="chill_main_notification_create") diff --git a/src/Bundle/ChillMainBundle/Controller/PermissionApiController.php b/src/Bundle/ChillMainBundle/Controller/PermissionApiController.php index 8b0561635..97b255a85 100644 --- a/src/Bundle/ChillMainBundle/Controller/PermissionApiController.php +++ b/src/Bundle/ChillMainBundle/Controller/PermissionApiController.php @@ -21,7 +21,9 @@ use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; class PermissionApiController extends AbstractController { - public function __construct(private readonly DenormalizerInterface $denormalizer, private readonly Security $security) {} + public function __construct(private readonly DenormalizerInterface $denormalizer, private readonly Security $security) + { + } /** * @Route("/api/1.0/main/permissions/info.json", methods={"POST"}) diff --git a/src/Bundle/ChillMainBundle/Controller/PermissionsGroupController.php b/src/Bundle/ChillMainBundle/Controller/PermissionsGroupController.php index 681046ca1..42d0d6a78 100644 --- a/src/Bundle/ChillMainBundle/Controller/PermissionsGroupController.php +++ b/src/Bundle/ChillMainBundle/Controller/PermissionsGroupController.php @@ -47,7 +47,8 @@ final class PermissionsGroupController extends AbstractController private readonly EntityManagerInterface $em, private readonly PermissionsGroupRepository $permissionsGroupRepository, private readonly RoleScopeRepository $roleScopeRepository, - ) {} + ) { + } /** * @\Symfony\Component\Routing\Annotation\Route(path="/{_locale}/admin/permissionsgroup/{id}/add_link_role_scope", name="admin_permissionsgroup_add_role_scope", methods={"PUT"}) @@ -399,7 +400,7 @@ final class PermissionsGroupController extends AbstractController * get a role scope by his parameters. The role scope is persisted if it * doesn't exist in database. */ - protected function getPersistentRoleScopeBy(string $role, Scope $scope = null): RoleScope + protected function getPersistentRoleScopeBy(string $role, ?Scope $scope = null): RoleScope { $roleScope = $this->roleScopeRepository ->findOneBy(['role' => $role, 'scope' => $scope]); diff --git a/src/Bundle/ChillMainBundle/Controller/PostalCodeAPIController.php b/src/Bundle/ChillMainBundle/Controller/PostalCodeAPIController.php index 2b897130d..e51f74e40 100644 --- a/src/Bundle/ChillMainBundle/Controller/PostalCodeAPIController.php +++ b/src/Bundle/ChillMainBundle/Controller/PostalCodeAPIController.php @@ -26,7 +26,9 @@ use Symfony\Component\Serializer\Normalizer\AbstractNormalizer; final class PostalCodeAPIController extends ApiController { - public function __construct(private readonly CountryRepository $countryRepository, private readonly PostalCodeRepositoryInterface $postalCodeRepository, private readonly PaginatorFactory $paginatorFactory) {} + public function __construct(private readonly CountryRepository $countryRepository, private readonly PostalCodeRepositoryInterface $postalCodeRepository, private readonly PaginatorFactory $paginatorFactory) + { + } /** * @Route("/api/1.0/main/postal-code/search.json") diff --git a/src/Bundle/ChillMainBundle/Controller/SavedExportController.php b/src/Bundle/ChillMainBundle/Controller/SavedExportController.php index 15bfcb9bb..0269ff0f5 100644 --- a/src/Bundle/ChillMainBundle/Controller/SavedExportController.php +++ b/src/Bundle/ChillMainBundle/Controller/SavedExportController.php @@ -34,7 +34,9 @@ use Symfony\Contracts\Translation\TranslatorInterface; class SavedExportController { - public function __construct(private readonly \Twig\Environment $templating, private readonly EntityManagerInterface $entityManager, private readonly ExportManager $exportManager, private readonly FormFactoryInterface $formFactory, private readonly SavedExportRepositoryInterface $savedExportRepository, private readonly Security $security, private readonly SessionInterface $session, private readonly TranslatorInterface $translator, private readonly UrlGeneratorInterface $urlGenerator) {} + public function __construct(private readonly \Twig\Environment $templating, private readonly EntityManagerInterface $entityManager, private readonly ExportManager $exportManager, private readonly FormFactoryInterface $formFactory, private readonly SavedExportRepositoryInterface $savedExportRepository, private readonly Security $security, private readonly SessionInterface $session, private readonly TranslatorInterface $translator, private readonly UrlGeneratorInterface $urlGenerator) + { + } /** * @Route("/{_locale}/exports/saved/{id}/delete", name="chill_main_export_saved_delete") diff --git a/src/Bundle/ChillMainBundle/Controller/ScopeController.php b/src/Bundle/ChillMainBundle/Controller/ScopeController.php index 727796256..3ccf13c07 100644 --- a/src/Bundle/ChillMainBundle/Controller/ScopeController.php +++ b/src/Bundle/ChillMainBundle/Controller/ScopeController.php @@ -56,7 +56,7 @@ class ScopeController extends AbstractController { $em = $this->getDoctrine()->getManager(); - $scope = $em->getRepository(\Chill\MainBundle\Entity\Scope::class)->find($id); + $scope = $em->getRepository(Scope::class)->find($id); if (!$scope) { throw $this->createNotFoundException('Unable to find Scope entity.'); @@ -79,7 +79,7 @@ class ScopeController extends AbstractController { $em = $this->getDoctrine()->getManager(); - $entities = $em->getRepository(\Chill\MainBundle\Entity\Scope::class)->findAll(); + $entities = $em->getRepository(Scope::class)->findAll(); return $this->render('@ChillMain/Scope/index.html.twig', [ 'entities' => $entities, @@ -109,7 +109,7 @@ class ScopeController extends AbstractController { $em = $this->getDoctrine()->getManager(); - $scope = $em->getRepository(\Chill\MainBundle\Entity\Scope::class)->find($id); + $scope = $em->getRepository(Scope::class)->find($id); if (!$scope) { throw $this->createNotFoundException('Unable to find Scope entity.'); @@ -129,7 +129,7 @@ class ScopeController extends AbstractController { $em = $this->getDoctrine()->getManager(); - $scope = $em->getRepository(\Chill\MainBundle\Entity\Scope::class)->find($id); + $scope = $em->getRepository(Scope::class)->find($id); if (!$scope) { throw $this->createNotFoundException('Unable to find Scope entity.'); diff --git a/src/Bundle/ChillMainBundle/Controller/SearchController.php b/src/Bundle/ChillMainBundle/Controller/SearchController.php index 6324561cc..b5d359a53 100644 --- a/src/Bundle/ChillMainBundle/Controller/SearchController.php +++ b/src/Bundle/ChillMainBundle/Controller/SearchController.php @@ -32,7 +32,9 @@ use Symfony\Contracts\Translation\TranslatorInterface; */ class SearchController extends AbstractController { - public function __construct(protected SearchProvider $searchProvider, protected TranslatorInterface $translator, protected PaginatorFactory $paginatorFactory, protected SearchApi $searchApi) {} + public function __construct(protected SearchProvider $searchProvider, protected TranslatorInterface $translator, protected PaginatorFactory $paginatorFactory, protected SearchApi $searchApi) + { + } /** * @\Symfony\Component\Routing\Annotation\Route(path="/{_locale}/search/advanced/{name}", name="chill_main_advanced_search") @@ -45,7 +47,7 @@ class SearchController extends AbstractController /** @var Chill\MainBundle\Search\HasAdvancedSearchFormInterface $variable */ $search = $this->searchProvider ->getHasAdvancedFormByName($name); - } catch (\Chill\MainBundle\Search\UnknowSearchNameException) { + } catch (UnknowSearchNameException) { throw $this->createNotFoundException('no advanced search for '."{$name}"); } diff --git a/src/Bundle/ChillMainBundle/Controller/TimelineCenterController.php b/src/Bundle/ChillMainBundle/Controller/TimelineCenterController.php index ebbd7a360..7999cb697 100644 --- a/src/Bundle/ChillMainBundle/Controller/TimelineCenterController.php +++ b/src/Bundle/ChillMainBundle/Controller/TimelineCenterController.php @@ -20,7 +20,9 @@ use Symfony\Component\Security\Core\Security; class TimelineCenterController extends AbstractController { - public function __construct(protected TimelineBuilder $timelineBuilder, protected PaginatorFactory $paginatorFactory, private readonly Security $security) {} + public function __construct(protected TimelineBuilder $timelineBuilder, protected PaginatorFactory $paginatorFactory, private readonly Security $security) + { + } /** * @Route("/{_locale}/center/timeline", diff --git a/src/Bundle/ChillMainBundle/Controller/UserController.php b/src/Bundle/ChillMainBundle/Controller/UserController.php index 1a25c4ad4..b335b356a 100644 --- a/src/Bundle/ChillMainBundle/Controller/UserController.php +++ b/src/Bundle/ChillMainBundle/Controller/UserController.php @@ -38,7 +38,9 @@ class UserController extends CRUDController { final public const FORM_GROUP_CENTER_COMPOSED = 'composed_groupcenter'; - public function __construct(private readonly LoggerInterface $logger, private readonly ValidatorInterface $validator, private readonly UserPasswordEncoderInterface $passwordEncoder, private readonly UserRepository $userRepository, protected ParameterBagInterface $parameterBag, private readonly TranslatorInterface $translator) {} + public function __construct(private readonly LoggerInterface $logger, private readonly ValidatorInterface $validator, private readonly UserPasswordEncoderInterface $passwordEncoder, private readonly UserRepository $userRepository, protected ParameterBagInterface $parameterBag, private readonly TranslatorInterface $translator) + { + } /** * @Route("/{_locale}/admin/main/user/{uid}/add_link_groupcenter", @@ -48,7 +50,7 @@ class UserController extends CRUDController { $em = $this->getDoctrine()->getManager(); - $user = $em->getRepository(\Chill\MainBundle\Entity\User::class)->find($uid); + $user = $em->getRepository(User::class)->find($uid); if (!$user) { throw $this->createNotFoundException('Unable to find User entity.'); @@ -100,13 +102,13 @@ class UserController extends CRUDController { $em = $this->getDoctrine()->getManager(); - $user = $em->getRepository(\Chill\MainBundle\Entity\User::class)->find($uid); + $user = $em->getRepository(User::class)->find($uid); if (!$user) { throw $this->createNotFoundException('Unable to find User entity.'); } - $groupCenter = $em->getRepository(\Chill\MainBundle\Entity\GroupCenter::class) + $groupCenter = $em->getRepository(GroupCenter::class) ->find($gcid); if (!$groupCenter) { @@ -266,7 +268,7 @@ class UserController extends CRUDController ->build(); } - protected function countEntities(string $action, Request $request, FilterOrderHelper $filterOrder = null): int + protected function countEntities(string $action, Request $request, ?FilterOrderHelper $filterOrder = null): int { if (!$filterOrder instanceof FilterOrderHelper) { return parent::countEntities($action, $request, $filterOrder); @@ -279,7 +281,7 @@ class UserController extends CRUDController return $this->userRepository->countByUsernameOrEmail($filterOrder->getQueryString()); } - protected function createFormFor(string $action, $entity, string $formClass = null, array $formOptions = []): FormInterface + protected function createFormFor(string $action, $entity, ?string $formClass = null, array $formOptions = []): FormInterface { // for "new", add special config if ('new' === $action) { @@ -323,7 +325,7 @@ class UserController extends CRUDController Request $request, int $totalItems, PaginatorInterface $paginator, - FilterOrderHelper $filterOrder = null + ?FilterOrderHelper $filterOrder = null ) { if (0 === $totalItems) { return []; @@ -424,7 +426,7 @@ class UserController extends CRUDController { $em = $this->getDoctrine()->getManager(); - $groupCenterManaged = $em->getRepository(\Chill\MainBundle\Entity\GroupCenter::class) + $groupCenterManaged = $em->getRepository(GroupCenter::class) ->findOneBy([ 'center' => $groupCenter->getCenter(), 'permissionsGroup' => $groupCenter->getPermissionsGroup(), diff --git a/src/Bundle/ChillMainBundle/Controller/UserExportController.php b/src/Bundle/ChillMainBundle/Controller/UserExportController.php index 7f14b5e64..41c2d1a85 100644 --- a/src/Bundle/ChillMainBundle/Controller/UserExportController.php +++ b/src/Bundle/ChillMainBundle/Controller/UserExportController.php @@ -27,7 +27,8 @@ final readonly class UserExportController private UserRepositoryInterface $userRepository, private Security $security, private TranslatorInterface $translator, - ) {} + ) { + } /** * @throws \League\Csv\CannotInsertRecord diff --git a/src/Bundle/ChillMainBundle/Controller/UserJobScopeHistoriesController.php b/src/Bundle/ChillMainBundle/Controller/UserJobScopeHistoriesController.php index 55d7aceb7..144c27688 100644 --- a/src/Bundle/ChillMainBundle/Controller/UserJobScopeHistoriesController.php +++ b/src/Bundle/ChillMainBundle/Controller/UserJobScopeHistoriesController.php @@ -21,7 +21,8 @@ class UserJobScopeHistoriesController extends AbstractController { public function __construct( private readonly Environment $engine, - ) {} + ) { + } /** * @Route("/{_locale}/admin/main/user/{id}/job-scope-history", name="admin_user_job_scope_history") diff --git a/src/Bundle/ChillMainBundle/Controller/UserProfileController.php b/src/Bundle/ChillMainBundle/Controller/UserProfileController.php index 52aba1a48..3b83069bb 100644 --- a/src/Bundle/ChillMainBundle/Controller/UserProfileController.php +++ b/src/Bundle/ChillMainBundle/Controller/UserProfileController.php @@ -24,7 +24,8 @@ class UserProfileController extends AbstractController { public function __construct( private readonly TranslatorInterface $translator, - ) {} + ) { + } /** * User profile that allows editing of phonenumber and visualization of certain data. diff --git a/src/Bundle/ChillMainBundle/Controller/WorkflowApiController.php b/src/Bundle/ChillMainBundle/Controller/WorkflowApiController.php index 4c4d8218c..dd7d642c9 100644 --- a/src/Bundle/ChillMainBundle/Controller/WorkflowApiController.php +++ b/src/Bundle/ChillMainBundle/Controller/WorkflowApiController.php @@ -29,7 +29,9 @@ use Symfony\Component\Serializer\SerializerInterface; class WorkflowApiController { - public function __construct(private readonly EntityManagerInterface $entityManager, private readonly EntityWorkflowRepository $entityWorkflowRepository, private readonly PaginatorFactory $paginatorFactory, private readonly Security $security, private readonly SerializerInterface $serializer) {} + public function __construct(private readonly EntityManagerInterface $entityManager, private readonly EntityWorkflowRepository $entityWorkflowRepository, private readonly PaginatorFactory $paginatorFactory, private readonly Security $security, private readonly SerializerInterface $serializer) + { + } /** * Return a list of workflow which are waiting an action for the user. diff --git a/src/Bundle/ChillMainBundle/Controller/WorkflowController.php b/src/Bundle/ChillMainBundle/Controller/WorkflowController.php index b641ed46a..a88248c1a 100644 --- a/src/Bundle/ChillMainBundle/Controller/WorkflowController.php +++ b/src/Bundle/ChillMainBundle/Controller/WorkflowController.php @@ -38,7 +38,9 @@ use Symfony\Contracts\Translation\TranslatorInterface; class WorkflowController extends AbstractController { - public function __construct(private readonly EntityWorkflowManager $entityWorkflowManager, private readonly EntityWorkflowRepository $entityWorkflowRepository, private readonly ValidatorInterface $validator, private readonly PaginatorFactory $paginatorFactory, private readonly Registry $registry, private readonly EntityManagerInterface $entityManager, private readonly TranslatorInterface $translator, private readonly Security $security) {} + public function __construct(private readonly EntityWorkflowManager $entityWorkflowManager, private readonly EntityWorkflowRepository $entityWorkflowRepository, private readonly ValidatorInterface $validator, private readonly PaginatorFactory $paginatorFactory, private readonly Registry $registry, private readonly EntityManagerInterface $entityManager, private readonly TranslatorInterface $translator, private readonly Security $security) + { + } /** * @Route("/{_locale}/main/workflow/create", name="chill_main_workflow_create") diff --git a/src/Bundle/ChillMainBundle/Cron/CronJobInterface.php b/src/Bundle/ChillMainBundle/Cron/CronJobInterface.php index 41e4b41a8..dcc19f01c 100644 --- a/src/Bundle/ChillMainBundle/Cron/CronJobInterface.php +++ b/src/Bundle/ChillMainBundle/Cron/CronJobInterface.php @@ -28,5 +28,5 @@ interface CronJobInterface * * @return array|null optionally return an array with the same data than the previous execution */ - public function run(array $lastExecutionData): null|array; + public function run(array $lastExecutionData): array|null; } diff --git a/src/Bundle/ChillMainBundle/Cron/CronManager.php b/src/Bundle/ChillMainBundle/Cron/CronManager.php index 3db7d5dc3..14878235d 100644 --- a/src/Bundle/ChillMainBundle/Cron/CronManager.php +++ b/src/Bundle/ChillMainBundle/Cron/CronManager.php @@ -55,9 +55,10 @@ final readonly class CronManager implements CronManagerInterface private EntityManagerInterface $entityManager, private iterable $jobs, private LoggerInterface $logger - ) {} + ) { + } - public function run(string $forceJob = null): void + public function run(?string $forceJob = null): void { if (null !== $forceJob) { $this->runForce($forceJob); diff --git a/src/Bundle/ChillMainBundle/Cron/CronManagerInterface.php b/src/Bundle/ChillMainBundle/Cron/CronManagerInterface.php index 19b151657..d2292d455 100644 --- a/src/Bundle/ChillMainBundle/Cron/CronManagerInterface.php +++ b/src/Bundle/ChillMainBundle/Cron/CronManagerInterface.php @@ -16,5 +16,5 @@ interface CronManagerInterface /** * Execute one job, with a given priority, or the given job (identified by his key). */ - public function run(string $forceJob = null): void; + public function run(?string $forceJob = null): void; } diff --git a/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadAddressReferences.php b/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadAddressReferences.php index f95a3cf66..d04ef29e8 100644 --- a/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadAddressReferences.php +++ b/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadAddressReferences.php @@ -26,7 +26,7 @@ class LoadAddressReferences extends AbstractFixture implements ContainerAwareInt { protected $faker; - private ?\Symfony\Component\DependencyInjection\ContainerInterface $container = null; + private ?ContainerInterface $container = null; public function __construct() { @@ -50,7 +50,7 @@ class LoadAddressReferences extends AbstractFixture implements ContainerAwareInt $manager->flush(); } - public function setContainer(ContainerInterface $container = null) + public function setContainer(?ContainerInterface $container = null) { $this->container = $container; } diff --git a/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadCountries.php b/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadCountries.php index 4f0d24501..3433eebd7 100644 --- a/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadCountries.php +++ b/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadCountries.php @@ -23,7 +23,7 @@ use Symfony\Component\DependencyInjection\ContainerInterface; */ class LoadCountries extends AbstractFixture implements ContainerAwareInterface, OrderedFixtureInterface { - private ?\Symfony\Component\DependencyInjection\ContainerInterface $container = null; + private ?ContainerInterface $container = null; public function getOrder() { @@ -43,7 +43,7 @@ class LoadCountries extends AbstractFixture implements ContainerAwareInterface, $manager->flush(); } - public function setContainer(ContainerInterface $container = null) + public function setContainer(?ContainerInterface $container = null) { $this->container = $container; } diff --git a/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadLanguages.php b/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadLanguages.php index 54025cc2f..c5c03277f 100644 --- a/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadLanguages.php +++ b/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadLanguages.php @@ -27,7 +27,7 @@ class LoadLanguages extends AbstractFixture implements ContainerAwareInterface, private array $ancientToExclude = ['ang', 'egy', 'fro', 'goh', 'grc', 'la', 'non', 'peo', 'pro', 'sga', 'dum', 'enm', 'frm', 'gmh', 'mga', 'akk', 'phn', 'zxx', 'got', 'und', ]; - private ?\Symfony\Component\DependencyInjection\ContainerInterface $container = null; + private ?ContainerInterface $container = null; // The regional version of language are language with _ in the code // This array contains regional code to not exclude @@ -57,7 +57,7 @@ class LoadLanguages extends AbstractFixture implements ContainerAwareInterface, $manager->flush(); } - public function setContainer(ContainerInterface $container = null) + public function setContainer(?ContainerInterface $container = null) { $this->container = $container; } diff --git a/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadLocationType.php b/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadLocationType.php index 946632513..aab896add 100644 --- a/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadLocationType.php +++ b/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadLocationType.php @@ -23,7 +23,7 @@ use Symfony\Component\DependencyInjection\ContainerInterface; */ class LoadLocationType extends AbstractFixture implements ContainerAwareInterface, OrderedFixtureInterface { - private ?\Symfony\Component\DependencyInjection\ContainerInterface $container = null; + private ?ContainerInterface $container = null; public function getOrder() { @@ -65,7 +65,7 @@ class LoadLocationType extends AbstractFixture implements ContainerAwareInterfac $manager->flush(); } - public function setContainer(ContainerInterface $container = null) + public function setContainer(?ContainerInterface $container = null) { $this->container = $container; } diff --git a/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadUsers.php b/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadUsers.php index d22da6b78..8cb335fba 100644 --- a/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadUsers.php +++ b/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadUsers.php @@ -53,7 +53,7 @@ class LoadUsers extends AbstractFixture implements ContainerAwareInterface, Orde ], ]; - private ?\Symfony\Component\DependencyInjection\ContainerInterface $container = null; + private ?ContainerInterface $container = null; public function getOrder() { @@ -92,7 +92,7 @@ class LoadUsers extends AbstractFixture implements ContainerAwareInterface, Orde $manager->flush(); } - public function setContainer(ContainerInterface $container = null) + public function setContainer(?ContainerInterface $container = null) { if (null === $container) { throw new \LogicException('$container should not be null'); diff --git a/src/Bundle/ChillMainBundle/DependencyInjection/ChillMainExtension.php b/src/Bundle/ChillMainBundle/DependencyInjection/ChillMainExtension.php index 2590b549b..b62f1f2d7 100644 --- a/src/Bundle/ChillMainBundle/DependencyInjection/ChillMainExtension.php +++ b/src/Bundle/ChillMainBundle/DependencyInjection/ChillMainExtension.php @@ -261,7 +261,7 @@ class ChillMainExtension extends Extension implements 'ST_X' => STX::class, 'ST_Y' => STY::class, 'GREATEST' => Greatest::class, - 'LEAST' => LEAST::class, + 'LEAST' => Least::class, ], 'datetime_functions' => [ 'EXTRACT' => Extract::class, @@ -570,7 +570,7 @@ class ChillMainExtension extends Extension implements ], ], [ - 'class' => \Chill\MainBundle\Entity\UserJob::class, + 'class' => UserJob::class, 'name' => 'user_job', 'base_path' => '/api/1.0/main/user-job', 'base_role' => 'ROLE_USER', @@ -634,7 +634,7 @@ class ChillMainExtension extends Extension implements ], ], [ - 'class' => \Chill\MainBundle\Entity\Country::class, + 'class' => Country::class, 'name' => 'country', 'base_path' => '/api/1.0/main/country', 'base_role' => 'ROLE_USER', @@ -654,7 +654,7 @@ class ChillMainExtension extends Extension implements ], ], [ - 'class' => \Chill\MainBundle\Entity\User::class, + 'class' => User::class, 'controller' => \Chill\MainBundle\Controller\UserApiController::class, 'name' => 'user', 'base_path' => '/api/1.0/main/user', @@ -696,7 +696,7 @@ class ChillMainExtension extends Extension implements ], ], [ - 'class' => \Chill\MainBundle\Entity\Location::class, + 'class' => Location::class, 'controller' => \Chill\MainBundle\Controller\LocationApiController::class, 'name' => 'location', 'base_path' => '/api/1.0/main/location', @@ -718,7 +718,7 @@ class ChillMainExtension extends Extension implements ], ], [ - 'class' => \Chill\MainBundle\Entity\LocationType::class, + 'class' => LocationType::class, 'controller' => \Chill\MainBundle\Controller\LocationTypeApiController::class, 'name' => 'location_type', 'base_path' => '/api/1.0/main/location-type', @@ -739,7 +739,7 @@ class ChillMainExtension extends Extension implements ], ], [ - 'class' => \Chill\MainBundle\Entity\Civility::class, + 'class' => Civility::class, 'name' => 'civility', 'base_path' => '/api/1.0/main/civility', 'base_role' => 'ROLE_USER', diff --git a/src/Bundle/ChillMainBundle/Doctrine/DQL/Extract.php b/src/Bundle/ChillMainBundle/Doctrine/DQL/Extract.php index 1fb51c15b..93000be9c 100644 --- a/src/Bundle/ChillMainBundle/Doctrine/DQL/Extract.php +++ b/src/Bundle/ChillMainBundle/Doctrine/DQL/Extract.php @@ -29,7 +29,7 @@ class Extract extends FunctionNode { private string $field; - private null|\Doctrine\ORM\Query\AST\Node|string $value = null; + private \Doctrine\ORM\Query\AST\Node|string|null $value = null; // private PathExpression $value; // private FunctionNode $value; // private DateDiffFunction $value; diff --git a/src/Bundle/ChillMainBundle/Doctrine/DQL/JsonExtract.php b/src/Bundle/ChillMainBundle/Doctrine/DQL/JsonExtract.php index 7d93071b7..95d851790 100644 --- a/src/Bundle/ChillMainBundle/Doctrine/DQL/JsonExtract.php +++ b/src/Bundle/ChillMainBundle/Doctrine/DQL/JsonExtract.php @@ -18,7 +18,7 @@ use Doctrine\ORM\Query\SqlWalker; class JsonExtract extends FunctionNode { - private null|\Doctrine\ORM\Query\AST\Node|string $element = null; + private \Doctrine\ORM\Query\AST\Node|string|null $element = null; private ?\Doctrine\ORM\Query\AST\ArithmeticExpression $keyToExtract = null; diff --git a/src/Bundle/ChillMainBundle/Doctrine/DQL/ToChar.php b/src/Bundle/ChillMainBundle/Doctrine/DQL/ToChar.php index a5e73209d..ef150867e 100644 --- a/src/Bundle/ChillMainBundle/Doctrine/DQL/ToChar.php +++ b/src/Bundle/ChillMainBundle/Doctrine/DQL/ToChar.php @@ -23,7 +23,7 @@ class ToChar extends FunctionNode { private ?\Doctrine\ORM\Query\AST\ArithmeticExpression $datetime = null; - private null|\Doctrine\ORM\Query\AST\Node|string $fmt = null; + private \Doctrine\ORM\Query\AST\Node|string|null $fmt = null; public function getSql(SqlWalker $sqlWalker) { diff --git a/src/Bundle/ChillMainBundle/Doctrine/Event/TrackCreateUpdateSubscriber.php b/src/Bundle/ChillMainBundle/Doctrine/Event/TrackCreateUpdateSubscriber.php index e6ac2308a..907997258 100644 --- a/src/Bundle/ChillMainBundle/Doctrine/Event/TrackCreateUpdateSubscriber.php +++ b/src/Bundle/ChillMainBundle/Doctrine/Event/TrackCreateUpdateSubscriber.php @@ -21,7 +21,9 @@ use Symfony\Component\Security\Core\Security; class TrackCreateUpdateSubscriber implements EventSubscriber { - public function __construct(private readonly Security $security) {} + public function __construct(private readonly Security $security) + { + } public function getSubscribedEvents() { diff --git a/src/Bundle/ChillMainBundle/Doctrine/Model/Point.php b/src/Bundle/ChillMainBundle/Doctrine/Model/Point.php index de6af9625..beed15f31 100644 --- a/src/Bundle/ChillMainBundle/Doctrine/Model/Point.php +++ b/src/Bundle/ChillMainBundle/Doctrine/Model/Point.php @@ -15,7 +15,9 @@ class Point implements \JsonSerializable { public static string $SRID = '4326'; - private function __construct(private readonly ?float $lon, private readonly ?float $lat) {} + private function __construct(private readonly ?float $lon, private readonly ?float $lat) + { + } public static function fromArrayGeoJson(array $array): self { diff --git a/src/Bundle/ChillMainBundle/Doctrine/ORM/Hydration/FlatHierarchyEntityHydrator.php b/src/Bundle/ChillMainBundle/Doctrine/ORM/Hydration/FlatHierarchyEntityHydrator.php index 704b95861..110842a2a 100644 --- a/src/Bundle/ChillMainBundle/Doctrine/ORM/Hydration/FlatHierarchyEntityHydrator.php +++ b/src/Bundle/ChillMainBundle/Doctrine/ORM/Hydration/FlatHierarchyEntityHydrator.php @@ -39,7 +39,7 @@ final class FlatHierarchyEntityHydrator extends ObjectHydrator ); } - private function flatListGenerator(array $hashMap, object $parent = null): \Generator + private function flatListGenerator(array $hashMap, ?object $parent = null): \Generator { $parent = null === $parent ? null : spl_object_id($parent); $hashMap += [$parent => []]; diff --git a/src/Bundle/ChillMainBundle/Entity/Address.php b/src/Bundle/ChillMainBundle/Entity/Address.php index 94f66b6d2..f6584fddd 100644 --- a/src/Bundle/ChillMainBundle/Entity/Address.php +++ b/src/Bundle/ChillMainBundle/Entity/Address.php @@ -440,7 +440,7 @@ class Address implements TrackCreationInterface, TrackUpdateInterface return $this->getIsNoAddress(); } - public function setAddressReference(AddressReference $addressReference = null): Address + public function setAddressReference(?AddressReference $addressReference = null): Address { $this->addressReference = $addressReference; @@ -529,7 +529,7 @@ class Address implements TrackCreationInterface, TrackUpdateInterface * * @return Address */ - public function setPostcode(PostalCode $postcode = null) + public function setPostcode(?PostalCode $postcode = null) { $this->postcode = $postcode; @@ -620,7 +620,7 @@ class Address implements TrackCreationInterface, TrackUpdateInterface return $this; } - public function setValidTo(\DateTimeInterface $validTo = null): self + public function setValidTo(?\DateTimeInterface $validTo = null): self { $this->validTo = $validTo; diff --git a/src/Bundle/ChillMainBundle/Entity/AddressReference.php b/src/Bundle/ChillMainBundle/Entity/AddressReference.php index 140028da5..49b510f8c 100644 --- a/src/Bundle/ChillMainBundle/Entity/AddressReference.php +++ b/src/Bundle/ChillMainBundle/Entity/AddressReference.php @@ -219,7 +219,7 @@ class AddressReference * * @return Address */ - public function setPostcode(PostalCode $postcode = null) + public function setPostcode(?PostalCode $postcode = null) { $this->postcode = $postcode; diff --git a/src/Bundle/ChillMainBundle/Entity/GeographicalUnit/SimpleGeographicalUnitDTO.php b/src/Bundle/ChillMainBundle/Entity/GeographicalUnit/SimpleGeographicalUnitDTO.php index 79e28e6f3..a36e798a4 100644 --- a/src/Bundle/ChillMainBundle/Entity/GeographicalUnit/SimpleGeographicalUnitDTO.php +++ b/src/Bundle/ChillMainBundle/Entity/GeographicalUnit/SimpleGeographicalUnitDTO.php @@ -53,5 +53,6 @@ class SimpleGeographicalUnitDTO * @Serializer\Groups({"read"}) */ public int $layerId - ) {} + ) { + } } diff --git a/src/Bundle/ChillMainBundle/Entity/PermissionsGroup.php b/src/Bundle/ChillMainBundle/Entity/PermissionsGroup.php index 501e28a9a..4a28267cd 100644 --- a/src/Bundle/ChillMainBundle/Entity/PermissionsGroup.php +++ b/src/Bundle/ChillMainBundle/Entity/PermissionsGroup.php @@ -73,8 +73,8 @@ class PermissionsGroup */ public function __construct() { - $this->roleScopes = new \Doctrine\Common\Collections\ArrayCollection(); - $this->groupCenters = new \Doctrine\Common\Collections\ArrayCollection(); + $this->roleScopes = new ArrayCollection(); + $this->groupCenters = new ArrayCollection(); } public function addRoleScope(RoleScope $roleScope) diff --git a/src/Bundle/ChillMainBundle/Entity/PostalCode.php b/src/Bundle/ChillMainBundle/Entity/PostalCode.php index 5aba8030c..4d906d6c8 100644 --- a/src/Bundle/ChillMainBundle/Entity/PostalCode.php +++ b/src/Bundle/ChillMainBundle/Entity/PostalCode.php @@ -59,7 +59,7 @@ class PostalCode implements TrackUpdateInterface, TrackCreationInterface * * @groups({"read"}) */ - private ?\Chill\MainBundle\Doctrine\Model\Point $center = null; + private ?Point $center = null; /** * @ORM\Column(type="string", length=100) @@ -73,7 +73,7 @@ class PostalCode implements TrackUpdateInterface, TrackCreationInterface * * @groups({"write", "read"}) */ - private ?\Chill\MainBundle\Entity\Country $country = null; + private ?Country $country = null; /** * @ORM\Column(type="datetime_immutable", nullable=true, options={"default": null}) @@ -210,7 +210,7 @@ class PostalCode implements TrackUpdateInterface, TrackCreationInterface * * @return PostalCode */ - public function setCountry(Country $country = null) + public function setCountry(?Country $country = null) { $this->country = $country; diff --git a/src/Bundle/ChillMainBundle/Entity/RoleScope.php b/src/Bundle/ChillMainBundle/Entity/RoleScope.php index f7dc5fa2f..4777505f5 100644 --- a/src/Bundle/ChillMainBundle/Entity/RoleScope.php +++ b/src/Bundle/ChillMainBundle/Entity/RoleScope.php @@ -78,14 +78,14 @@ class RoleScope return $this->scope; } - public function setRole(string $role = null): self + public function setRole(?string $role = null): self { $this->role = $role; return $this; } - public function setScope(Scope $scope = null): self + public function setScope(?Scope $scope = null): self { $this->scope = $scope; diff --git a/src/Bundle/ChillMainBundle/Entity/User.php b/src/Bundle/ChillMainBundle/Entity/User.php index 13f9cbd95..e4487b4c8 100644 --- a/src/Bundle/ChillMainBundle/Entity/User.php +++ b/src/Bundle/ChillMainBundle/Entity/User.php @@ -188,7 +188,7 @@ class User implements UserInterface, \Stringable } /** - * @return \Chill\MainBundle\Entity\User + * @return User */ public function addGroupCenter(GroupCenter $groupCenter) { @@ -197,7 +197,9 @@ class User implements UserInterface, \Stringable return $this; } - public function eraseCredentials() {} + public function eraseCredentials() + { + } public function getAbsenceStart(): ?\DateTimeImmutable { @@ -272,7 +274,7 @@ class User implements UserInterface, \Stringable return $this->mainLocation; } - public function getMainScope(\DateTimeImmutable $atDate = null): ?Scope + public function getMainScope(?\DateTimeImmutable $atDate = null): ?Scope { $atDate ??= new \DateTimeImmutable('now'); @@ -324,7 +326,7 @@ class User implements UserInterface, \Stringable return $this->salt; } - public function getUserJob(\DateTimeImmutable $atDate = null): ?UserJob + public function getUserJob(?\DateTimeImmutable $atDate = null): ?UserJob { $atDate ??= new \DateTimeImmutable('now'); diff --git a/src/Bundle/ChillMainBundle/Export/ExportFormHelper.php b/src/Bundle/ChillMainBundle/Export/ExportFormHelper.php index 4746b6129..c448077e3 100644 --- a/src/Bundle/ChillMainBundle/Export/ExportFormHelper.php +++ b/src/Bundle/ChillMainBundle/Export/ExportFormHelper.php @@ -26,7 +26,8 @@ final readonly class ExportFormHelper private AuthorizationHelperForCurrentUserInterface $authorizationHelper, private ExportManager $exportManager, private FormFactoryInterface $formFactory, - ) {} + ) { + } public function getDefaultData(string $step, DirectExportInterface|ExportInterface $export, array $options = []): array { diff --git a/src/Bundle/ChillMainBundle/Export/ExportManager.php b/src/Bundle/ChillMainBundle/Export/ExportManager.php index 067cc72e9..159b90b6b 100644 --- a/src/Bundle/ChillMainBundle/Export/ExportManager.php +++ b/src/Bundle/ChillMainBundle/Export/ExportManager.php @@ -89,7 +89,7 @@ class ExportManager * * @return FilterInterface[] a \Generator that contains filters. The key is the filter's alias */ - public function getFiltersApplyingOn(DirectExportInterface|ExportInterface $export, array $centers = null): array + public function getFiltersApplyingOn(DirectExportInterface|ExportInterface $export, ?array $centers = null): array { if ($export instanceof DirectExportInterface) { return []; @@ -116,7 +116,7 @@ class ExportManager * * @return array an array that contains aggregators. The key is the filter's alias */ - public function getAggregatorsApplyingOn(DirectExportInterface|ExportInterface $export, array $centers = null): array + public function getAggregatorsApplyingOn(DirectExportInterface|ExportInterface $export, ?array $centers = null): array { if ($export instanceof ListInterface || $export instanceof DirectExportInterface) { return []; @@ -450,8 +450,8 @@ class ExportManager */ public function isGrantedForElement( DirectExportInterface|ExportInterface|ModifierInterface $element, - DirectExportInterface|ExportInterface $export = null, - array $centers = null + DirectExportInterface|ExportInterface|null $export = null, + ?array $centers = null ): bool { if ($element instanceof ExportInterface || $element instanceof DirectExportInterface) { $role = $element->requiredRole(); diff --git a/src/Bundle/ChillMainBundle/Export/Formatter/CSVListFormatter.php b/src/Bundle/ChillMainBundle/Export/Formatter/CSVListFormatter.php index 97a37d455..853c177b7 100644 --- a/src/Bundle/ChillMainBundle/Export/Formatter/CSVListFormatter.php +++ b/src/Bundle/ChillMainBundle/Export/Formatter/CSVListFormatter.php @@ -100,7 +100,7 @@ class CSVListFormatter implements FormatterInterface * @param array $filtersData an array containing the filters data. The key are the filters id, and the value are the data * @param array $aggregatorsData an array containing the aggregators data. The key are the filters id, and the value are the data * - * @return \Symfony\Component\HttpFoundation\Response The response to be shown + * @return Response The response to be shown */ public function getResponse( $result, diff --git a/src/Bundle/ChillMainBundle/Export/Formatter/CSVPivotedListFormatter.php b/src/Bundle/ChillMainBundle/Export/Formatter/CSVPivotedListFormatter.php index 02b7409bc..8b32714cc 100644 --- a/src/Bundle/ChillMainBundle/Export/Formatter/CSVPivotedListFormatter.php +++ b/src/Bundle/ChillMainBundle/Export/Formatter/CSVPivotedListFormatter.php @@ -99,7 +99,7 @@ class CSVPivotedListFormatter implements FormatterInterface * @param array $filtersData an array containing the filters data. The key are the filters id, and the value are the data * @param array $aggregatorsData an array containing the aggregators data. The key are the filters id, and the value are the data * - * @return \Symfony\Component\HttpFoundation\Response The response to be shown + * @return Response The response to be shown */ public function getResponse( $result, diff --git a/src/Bundle/ChillMainBundle/Export/Formatter/SpreadsheetListFormatter.php b/src/Bundle/ChillMainBundle/Export/Formatter/SpreadsheetListFormatter.php index e91095afd..7284ff70a 100644 --- a/src/Bundle/ChillMainBundle/Export/Formatter/SpreadsheetListFormatter.php +++ b/src/Bundle/ChillMainBundle/Export/Formatter/SpreadsheetListFormatter.php @@ -112,7 +112,7 @@ class SpreadsheetListFormatter implements FormatterInterface * @param array $filtersData an array containing the filters data. The key are the filters id, and the value are the data * @param array $aggregatorsData an array containing the aggregators data. The key are the filters id, and the value are the data * - * @return \Symfony\Component\HttpFoundation\Response The response to be shown + * @return Response The response to be shown */ public function getResponse( $result, diff --git a/src/Bundle/ChillMainBundle/Export/Helper/DateTimeHelper.php b/src/Bundle/ChillMainBundle/Export/Helper/DateTimeHelper.php index 0fad30b4f..3be1af08a 100644 --- a/src/Bundle/ChillMainBundle/Export/Helper/DateTimeHelper.php +++ b/src/Bundle/ChillMainBundle/Export/Helper/DateTimeHelper.php @@ -15,7 +15,9 @@ use Symfony\Contracts\Translation\TranslatorInterface; class DateTimeHelper { - public function __construct(private readonly TranslatorInterface $translator) {} + public function __construct(private readonly TranslatorInterface $translator) + { + } public function getLabel($header): callable { diff --git a/src/Bundle/ChillMainBundle/Export/Helper/ExportAddressHelper.php b/src/Bundle/ChillMainBundle/Export/Helper/ExportAddressHelper.php index 9161316e7..07a4f9f88 100644 --- a/src/Bundle/ChillMainBundle/Export/Helper/ExportAddressHelper.php +++ b/src/Bundle/ChillMainBundle/Export/Helper/ExportAddressHelper.php @@ -79,7 +79,9 @@ class ExportAddressHelper */ private ?array $unitRefsKeysCache = []; - public function __construct(private readonly AddressRender $addressRender, private readonly AddressRepository $addressRepository, private readonly GeographicalUnitLayerRepositoryInterface $geographicalUnitLayerRepository, private readonly TranslatableStringHelperInterface $translatableStringHelper) {} + public function __construct(private readonly AddressRender $addressRender, private readonly AddressRepository $addressRepository, private readonly GeographicalUnitLayerRepositoryInterface $geographicalUnitLayerRepository, private readonly TranslatableStringHelperInterface $translatableStringHelper) + { + } public function addSelectClauses(int $params, QueryBuilder $queryBuilder, $entityName = 'address', $prefix = 'add') { diff --git a/src/Bundle/ChillMainBundle/Export/Helper/TranslatableStringExportLabelHelper.php b/src/Bundle/ChillMainBundle/Export/Helper/TranslatableStringExportLabelHelper.php index 1b561390a..fc19f7466 100644 --- a/src/Bundle/ChillMainBundle/Export/Helper/TranslatableStringExportLabelHelper.php +++ b/src/Bundle/ChillMainBundle/Export/Helper/TranslatableStringExportLabelHelper.php @@ -21,7 +21,9 @@ use Chill\MainBundle\Templating\TranslatableStringHelperInterface; */ class TranslatableStringExportLabelHelper { - public function __construct(private readonly TranslatableStringHelperInterface $translatableStringHelper) {} + public function __construct(private readonly TranslatableStringHelperInterface $translatableStringHelper) + { + } public function getLabel(string $key, array $values, string $header) { diff --git a/src/Bundle/ChillMainBundle/Export/Helper/UserHelper.php b/src/Bundle/ChillMainBundle/Export/Helper/UserHelper.php index 39fb83c57..36b126df9 100644 --- a/src/Bundle/ChillMainBundle/Export/Helper/UserHelper.php +++ b/src/Bundle/ChillMainBundle/Export/Helper/UserHelper.php @@ -16,7 +16,9 @@ use Chill\MainBundle\Templating\Entity\UserRender; class UserHelper { - public function __construct(private readonly UserRender $userRender, private readonly UserRepositoryInterface $userRepository) {} + public function __construct(private readonly UserRender $userRender, private readonly UserRepositoryInterface $userRepository) + { + } /** * Return a callable that will transform a value into a string representing a user. @@ -32,7 +34,7 @@ class UserHelper */ public function getLabel($key, array $values, string $header): callable { - return function (null|int|string $value) use ($header) { + return function (int|string|null $value) use ($header) { if ('_header' === $value) { return $header; } diff --git a/src/Bundle/ChillMainBundle/Export/ListInterface.php b/src/Bundle/ChillMainBundle/Export/ListInterface.php index 9b88525ca..53442f0e7 100644 --- a/src/Bundle/ChillMainBundle/Export/ListInterface.php +++ b/src/Bundle/ChillMainBundle/Export/ListInterface.php @@ -20,4 +20,6 @@ namespace Chill\MainBundle\Export; * * When used, the `ExportManager` will not handle aggregator for this class. */ -interface ListInterface extends ExportInterface {} +interface ListInterface extends ExportInterface +{ +} diff --git a/src/Bundle/ChillMainBundle/Export/SortExportElement.php b/src/Bundle/ChillMainBundle/Export/SortExportElement.php index 6228109ed..0536f6569 100644 --- a/src/Bundle/ChillMainBundle/Export/SortExportElement.php +++ b/src/Bundle/ChillMainBundle/Export/SortExportElement.php @@ -17,7 +17,8 @@ final readonly class SortExportElement { public function __construct( private TranslatorInterface $translator, - ) {} + ) { + } /** * @param array $elements diff --git a/src/Bundle/ChillMainBundle/Form/ChoiceLoader/PostalCodeChoiceLoader.php b/src/Bundle/ChillMainBundle/Form/ChoiceLoader/PostalCodeChoiceLoader.php index 2bc89f97d..d2dd47962 100644 --- a/src/Bundle/ChillMainBundle/Form/ChoiceLoader/PostalCodeChoiceLoader.php +++ b/src/Bundle/ChillMainBundle/Form/ChoiceLoader/PostalCodeChoiceLoader.php @@ -46,7 +46,7 @@ class PostalCodeChoiceLoader implements ChoiceLoaderInterface { return new \Symfony\Component\Form\ChoiceList\ArrayChoiceList( $this->lazyLoadedPostalCodes, - static fn (PostalCode $pc = null) => \call_user_func($value, $pc) + static fn (?PostalCode $pc = null) => \call_user_func($value, $pc) ); } diff --git a/src/Bundle/ChillMainBundle/Form/DataMapper/PrivateCommentDataMapper.php b/src/Bundle/ChillMainBundle/Form/DataMapper/PrivateCommentDataMapper.php index 68fad0a99..10f9c26e3 100644 --- a/src/Bundle/ChillMainBundle/Form/DataMapper/PrivateCommentDataMapper.php +++ b/src/Bundle/ChillMainBundle/Form/DataMapper/PrivateCommentDataMapper.php @@ -19,7 +19,9 @@ use Symfony\Component\Security\Core\Security; final class PrivateCommentDataMapper extends AbstractType implements DataMapperInterface { - public function __construct(private readonly Security $security) {} + public function __construct(private readonly Security $security) + { + } public function mapDataToForms($viewData, $forms) { diff --git a/src/Bundle/ChillMainBundle/Form/DataMapper/ScopePickerDataMapper.php b/src/Bundle/ChillMainBundle/Form/DataMapper/ScopePickerDataMapper.php index cf96292af..267927ff1 100644 --- a/src/Bundle/ChillMainBundle/Form/DataMapper/ScopePickerDataMapper.php +++ b/src/Bundle/ChillMainBundle/Form/DataMapper/ScopePickerDataMapper.php @@ -16,7 +16,9 @@ use Symfony\Component\Form\DataMapperInterface; class ScopePickerDataMapper implements DataMapperInterface { - public function __construct(private readonly ?Scope $scope = null) {} + public function __construct(private readonly ?Scope $scope = null) + { + } public function mapDataToForms($data, $forms) { diff --git a/src/Bundle/ChillMainBundle/Form/DataTransformer/IdToEntityDataTransformer.php b/src/Bundle/ChillMainBundle/Form/DataTransformer/IdToEntityDataTransformer.php index 3532c3d9e..1796f7ed2 100644 --- a/src/Bundle/ChillMainBundle/Form/DataTransformer/IdToEntityDataTransformer.php +++ b/src/Bundle/ChillMainBundle/Form/DataTransformer/IdToEntityDataTransformer.php @@ -35,7 +35,7 @@ class IdToEntityDataTransformer implements DataTransformerInterface public function __construct( private readonly ObjectRepository $repository, private readonly bool $multiple = false, - callable $getId = null + ?callable $getId = null ) { $this->getId = $getId ?? static fn (object $o) => $o->getId(); } diff --git a/src/Bundle/ChillMainBundle/Form/Event/CustomizeFormEvent.php b/src/Bundle/ChillMainBundle/Form/Event/CustomizeFormEvent.php index 42606ebd7..aba5e2bc4 100644 --- a/src/Bundle/ChillMainBundle/Form/Event/CustomizeFormEvent.php +++ b/src/Bundle/ChillMainBundle/Form/Event/CustomizeFormEvent.php @@ -17,7 +17,9 @@ class CustomizeFormEvent extends \Symfony\Contracts\EventDispatcher\Event { final public const NAME = 'chill_main.customize_form'; - public function __construct(protected string $type, protected FormBuilderInterface $builder) {} + public function __construct(protected string $type, protected FormBuilderInterface $builder) + { + } public function getBuilder(): FormBuilderInterface { diff --git a/src/Bundle/ChillMainBundle/Form/LocationFormType.php b/src/Bundle/ChillMainBundle/Form/LocationFormType.php index 7f61cccce..e4748d850 100644 --- a/src/Bundle/ChillMainBundle/Form/LocationFormType.php +++ b/src/Bundle/ChillMainBundle/Form/LocationFormType.php @@ -24,7 +24,9 @@ use Symfony\Component\OptionsResolver\OptionsResolver; final class LocationFormType extends AbstractType { - public function __construct(private readonly TranslatableStringHelper $translatableStringHelper) {} + public function __construct(private readonly TranslatableStringHelper $translatableStringHelper) + { + } public function buildForm(FormBuilderInterface $builder, array $options) { diff --git a/src/Bundle/ChillMainBundle/Form/Type/AppendScopeChoiceTypeTrait.php b/src/Bundle/ChillMainBundle/Form/Type/AppendScopeChoiceTypeTrait.php index fcc4b4ec5..469b9c18e 100644 --- a/src/Bundle/ChillMainBundle/Form/Type/AppendScopeChoiceTypeTrait.php +++ b/src/Bundle/ChillMainBundle/Form/Type/AppendScopeChoiceTypeTrait.php @@ -83,7 +83,7 @@ trait AppendScopeChoiceTypeTrait { $resolver ->setRequired(['center', 'role']) - ->setAllowedTypes('center', \Chill\MainBundle\Entity\Center::class) + ->setAllowedTypes('center', Center::class) ->setAllowedTypes('role', 'string'); } diff --git a/src/Bundle/ChillMainBundle/Form/Type/ComposedGroupCenterType.php b/src/Bundle/ChillMainBundle/Form/Type/ComposedGroupCenterType.php index 48bd37dcc..1f6e08571 100644 --- a/src/Bundle/ChillMainBundle/Form/Type/ComposedGroupCenterType.php +++ b/src/Bundle/ChillMainBundle/Form/Type/ComposedGroupCenterType.php @@ -23,10 +23,10 @@ class ComposedGroupCenterType extends AbstractType public function buildForm(FormBuilderInterface $builder, array $options) { $builder->add('permissionsgroup', EntityType::class, [ - 'class' => \Chill\MainBundle\Entity\PermissionsGroup::class, + 'class' => PermissionsGroup::class, 'choice_label' => static fn (PermissionsGroup $group) => $group->getName(), ])->add('center', EntityType::class, [ - 'class' => \Chill\MainBundle\Entity\Center::class, + 'class' => Center::class, 'choice_label' => static fn (Center $center) => $center->getName(), ]); } diff --git a/src/Bundle/ChillMainBundle/Form/Type/ComposedRoleScopeType.php b/src/Bundle/ChillMainBundle/Form/Type/ComposedRoleScopeType.php index 6b87ed6ef..f4b4da609 100644 --- a/src/Bundle/ChillMainBundle/Form/Type/ComposedRoleScopeType.php +++ b/src/Bundle/ChillMainBundle/Form/Type/ComposedRoleScopeType.php @@ -26,7 +26,7 @@ use Symfony\Component\OptionsResolver\OptionsResolver; */ class ComposedRoleScopeType extends AbstractType { - private readonly \Chill\MainBundle\Security\RoleProvider $roleProvider; + private readonly RoleProvider $roleProvider; /** * @var string[] diff --git a/src/Bundle/ChillMainBundle/Form/Type/DataTransformer/AddressToIdDataTransformer.php b/src/Bundle/ChillMainBundle/Form/Type/DataTransformer/AddressToIdDataTransformer.php index 04094537b..c04a4b158 100644 --- a/src/Bundle/ChillMainBundle/Form/Type/DataTransformer/AddressToIdDataTransformer.php +++ b/src/Bundle/ChillMainBundle/Form/Type/DataTransformer/AddressToIdDataTransformer.php @@ -17,7 +17,9 @@ use Symfony\Component\Form\Exception\TransformationFailedException; final readonly class AddressToIdDataTransformer implements DataTransformerInterface { - public function __construct(private AddressRepository $addressRepository) {} + public function __construct(private AddressRepository $addressRepository) + { + } public function reverseTransform($value) { diff --git a/src/Bundle/ChillMainBundle/Form/Type/DataTransformer/CenterTransformer.php b/src/Bundle/ChillMainBundle/Form/Type/DataTransformer/CenterTransformer.php index d328d38f0..9a8b0a6d7 100644 --- a/src/Bundle/ChillMainBundle/Form/Type/DataTransformer/CenterTransformer.php +++ b/src/Bundle/ChillMainBundle/Form/Type/DataTransformer/CenterTransformer.php @@ -20,7 +20,9 @@ use Symfony\Component\Form\Exception\UnexpectedTypeException; class CenterTransformer implements DataTransformerInterface { - public function __construct(private readonly CenterRepository $centerRepository, private readonly bool $multiple = false) {} + public function __construct(private readonly CenterRepository $centerRepository, private readonly bool $multiple = false) + { + } public function reverseTransform($id) { diff --git a/src/Bundle/ChillMainBundle/Form/Type/DataTransformer/EntityToJsonTransformer.php b/src/Bundle/ChillMainBundle/Form/Type/DataTransformer/EntityToJsonTransformer.php index d193ea2ef..bd54b0c09 100644 --- a/src/Bundle/ChillMainBundle/Form/Type/DataTransformer/EntityToJsonTransformer.php +++ b/src/Bundle/ChillMainBundle/Form/Type/DataTransformer/EntityToJsonTransformer.php @@ -22,7 +22,9 @@ use Symfony\Component\Serializer\SerializerInterface; class EntityToJsonTransformer implements DataTransformerInterface { - public function __construct(private readonly DenormalizerInterface $denormalizer, private readonly SerializerInterface $serializer, private readonly bool $multiple, private readonly string $type) {} + public function __construct(private readonly DenormalizerInterface $denormalizer, private readonly SerializerInterface $serializer, private readonly bool $multiple, private readonly string $type) + { + } public function reverseTransform($value) { diff --git a/src/Bundle/ChillMainBundle/Form/Type/DataTransformer/MultipleObjectsToIdTransformer.php b/src/Bundle/ChillMainBundle/Form/Type/DataTransformer/MultipleObjectsToIdTransformer.php index 808093278..436b72ce3 100644 --- a/src/Bundle/ChillMainBundle/Form/Type/DataTransformer/MultipleObjectsToIdTransformer.php +++ b/src/Bundle/ChillMainBundle/Form/Type/DataTransformer/MultipleObjectsToIdTransformer.php @@ -17,7 +17,9 @@ use Symfony\Component\Form\DataTransformerInterface; class MultipleObjectsToIdTransformer implements DataTransformerInterface { - public function __construct(private readonly EntityManagerInterface $em, private readonly ?string $class = null) {} + public function __construct(private readonly EntityManagerInterface $em, private readonly ?string $class = null) + { + } /** * Transforms a string (id) to an object (item). diff --git a/src/Bundle/ChillMainBundle/Form/Type/DataTransformer/ObjectToIdTransformer.php b/src/Bundle/ChillMainBundle/Form/Type/DataTransformer/ObjectToIdTransformer.php index e56778bf2..ffdee60bd 100644 --- a/src/Bundle/ChillMainBundle/Form/Type/DataTransformer/ObjectToIdTransformer.php +++ b/src/Bundle/ChillMainBundle/Form/Type/DataTransformer/ObjectToIdTransformer.php @@ -17,7 +17,9 @@ use Symfony\Component\Form\Exception\TransformationFailedException; class ObjectToIdTransformer implements DataTransformerInterface { - public function __construct(private readonly EntityManagerInterface $em, private readonly ?string $class = null) {} + public function __construct(private readonly EntityManagerInterface $em, private readonly ?string $class = null) + { + } /** * Transforms a string (id) to an object. diff --git a/src/Bundle/ChillMainBundle/Form/Type/DataTransformer/PostalCodeToIdTransformer.php b/src/Bundle/ChillMainBundle/Form/Type/DataTransformer/PostalCodeToIdTransformer.php index dde8b7b9e..5f9117577 100644 --- a/src/Bundle/ChillMainBundle/Form/Type/DataTransformer/PostalCodeToIdTransformer.php +++ b/src/Bundle/ChillMainBundle/Form/Type/DataTransformer/PostalCodeToIdTransformer.php @@ -18,7 +18,9 @@ use Symfony\Component\Form\Exception\TransformationFailedException; class PostalCodeToIdTransformer implements DataTransformerInterface { - public function __construct(private readonly PostalCodeRepositoryInterface $postalCodeRepository) {} + public function __construct(private readonly PostalCodeRepositoryInterface $postalCodeRepository) + { + } public function reverseTransform($value) { diff --git a/src/Bundle/ChillMainBundle/Form/Type/DataTransformer/ScopeTransformer.php b/src/Bundle/ChillMainBundle/Form/Type/DataTransformer/ScopeTransformer.php index 2779f2cdd..cb5adec47 100644 --- a/src/Bundle/ChillMainBundle/Form/Type/DataTransformer/ScopeTransformer.php +++ b/src/Bundle/ChillMainBundle/Form/Type/DataTransformer/ScopeTransformer.php @@ -18,7 +18,9 @@ use Symfony\Component\Form\Exception\TransformationFailedException; class ScopeTransformer implements DataTransformerInterface { - public function __construct(private readonly EntityManagerInterface $em) {} + public function __construct(private readonly EntityManagerInterface $em) + { + } public function reverseTransform($id) { diff --git a/src/Bundle/ChillMainBundle/Form/Type/Export/AggregatorType.php b/src/Bundle/ChillMainBundle/Form/Type/Export/AggregatorType.php index cfcf4a471..1ea01d5f8 100644 --- a/src/Bundle/ChillMainBundle/Form/Type/Export/AggregatorType.php +++ b/src/Bundle/ChillMainBundle/Form/Type/Export/AggregatorType.php @@ -19,7 +19,9 @@ use Symfony\Component\OptionsResolver\OptionsResolver; class AggregatorType extends AbstractType { - public function __construct() {} + public function __construct() + { + } public function buildForm(FormBuilderInterface $builder, array $options) { diff --git a/src/Bundle/ChillMainBundle/Form/Type/Export/ExportType.php b/src/Bundle/ChillMainBundle/Form/Type/Export/ExportType.php index e5d0887f3..930712084 100644 --- a/src/Bundle/ChillMainBundle/Form/Type/Export/ExportType.php +++ b/src/Bundle/ChillMainBundle/Form/Type/Export/ExportType.php @@ -29,7 +29,9 @@ class ExportType extends AbstractType final public const PICK_FORMATTER_KEY = 'pick_formatter'; - public function __construct(private readonly ExportManager $exportManager, private readonly SortExportElement $sortExportElement) {} + public function __construct(private readonly ExportManager $exportManager, private readonly SortExportElement $sortExportElement) + { + } public function buildForm(FormBuilderInterface $builder, array $options) { diff --git a/src/Bundle/ChillMainBundle/Form/Type/Export/FilterType.php b/src/Bundle/ChillMainBundle/Form/Type/Export/FilterType.php index bcf842e73..8491d8f6a 100644 --- a/src/Bundle/ChillMainBundle/Form/Type/Export/FilterType.php +++ b/src/Bundle/ChillMainBundle/Form/Type/Export/FilterType.php @@ -22,7 +22,9 @@ class FilterType extends AbstractType { final public const ENABLED_FIELD = 'enabled'; - public function __construct() {} + public function __construct() + { + } public function buildForm(FormBuilderInterface $builder, array $options) { diff --git a/src/Bundle/ChillMainBundle/Form/Type/Export/PickCenterType.php b/src/Bundle/ChillMainBundle/Form/Type/Export/PickCenterType.php index a093dda44..01e3ba60a 100644 --- a/src/Bundle/ChillMainBundle/Form/Type/Export/PickCenterType.php +++ b/src/Bundle/ChillMainBundle/Form/Type/Export/PickCenterType.php @@ -33,7 +33,8 @@ final class PickCenterType extends AbstractType private readonly ExportManager $exportManager, private readonly RegroupmentRepository $regroupmentRepository, private readonly AuthorizationHelperForCurrentUserInterface $authorizationHelper - ) {} + ) { + } public function buildForm(FormBuilderInterface $builder, array $options) { diff --git a/src/Bundle/ChillMainBundle/Form/Type/PickAddressType.php b/src/Bundle/ChillMainBundle/Form/Type/PickAddressType.php index 190e09f30..8750ee006 100644 --- a/src/Bundle/ChillMainBundle/Form/Type/PickAddressType.php +++ b/src/Bundle/ChillMainBundle/Form/Type/PickAddressType.php @@ -41,7 +41,9 @@ use Symfony\Contracts\Translation\TranslatorInterface; */ final class PickAddressType extends AbstractType { - public function __construct(private readonly AddressToIdDataTransformer $addressToIdDataTransformer, private readonly TranslatorInterface $translator) {} + public function __construct(private readonly AddressToIdDataTransformer $addressToIdDataTransformer, private readonly TranslatorInterface $translator) + { + } public function buildForm(FormBuilderInterface $builder, array $options) { diff --git a/src/Bundle/ChillMainBundle/Form/Type/PickCenterType.php b/src/Bundle/ChillMainBundle/Form/Type/PickCenterType.php index ba6cc874d..12b170a73 100644 --- a/src/Bundle/ChillMainBundle/Form/Type/PickCenterType.php +++ b/src/Bundle/ChillMainBundle/Form/Type/PickCenterType.php @@ -34,7 +34,9 @@ use function count; */ class PickCenterType extends AbstractType { - public function __construct(protected AuthorizationHelperInterface $authorizationHelper, protected Security $security, protected CenterRepository $centerRepository) {} + public function __construct(protected AuthorizationHelperInterface $authorizationHelper, protected Security $security, protected CenterRepository $centerRepository) + { + } /** * add a data transformer if user can reach only one center. diff --git a/src/Bundle/ChillMainBundle/Form/Type/PickCivilityType.php b/src/Bundle/ChillMainBundle/Form/Type/PickCivilityType.php index f9aa09ce8..abe190de5 100644 --- a/src/Bundle/ChillMainBundle/Form/Type/PickCivilityType.php +++ b/src/Bundle/ChillMainBundle/Form/Type/PickCivilityType.php @@ -21,7 +21,9 @@ use Symfony\Component\OptionsResolver\OptionsResolver; class PickCivilityType extends AbstractType { - public function __construct(private readonly TranslatableStringHelper $translatableStringHelper) {} + public function __construct(private readonly TranslatableStringHelper $translatableStringHelper) + { + } public function configureOptions(OptionsResolver $resolver) { diff --git a/src/Bundle/ChillMainBundle/Form/Type/PickLocationTypeType.php b/src/Bundle/ChillMainBundle/Form/Type/PickLocationTypeType.php index 8aa216da1..7fb50fd4a 100644 --- a/src/Bundle/ChillMainBundle/Form/Type/PickLocationTypeType.php +++ b/src/Bundle/ChillMainBundle/Form/Type/PickLocationTypeType.php @@ -19,7 +19,9 @@ use Symfony\Component\OptionsResolver\OptionsResolver; class PickLocationTypeType extends AbstractType { - public function __construct(private readonly TranslatableStringHelper $translatableStringHelper) {} + public function __construct(private readonly TranslatableStringHelper $translatableStringHelper) + { + } public function configureOptions(OptionsResolver $resolver) { diff --git a/src/Bundle/ChillMainBundle/Form/Type/PickPostalCodeType.php b/src/Bundle/ChillMainBundle/Form/Type/PickPostalCodeType.php index 1a1ed4354..041176905 100644 --- a/src/Bundle/ChillMainBundle/Form/Type/PickPostalCodeType.php +++ b/src/Bundle/ChillMainBundle/Form/Type/PickPostalCodeType.php @@ -21,7 +21,9 @@ use Symfony\Component\OptionsResolver\OptionsResolver; class PickPostalCodeType extends AbstractType { - public function __construct(private readonly PostalCodeToIdTransformer $postalCodeToIdTransformer) {} + public function __construct(private readonly PostalCodeToIdTransformer $postalCodeToIdTransformer) + { + } public function buildForm(FormBuilderInterface $builder, array $options) { diff --git a/src/Bundle/ChillMainBundle/Form/Type/PickUserDynamicType.php b/src/Bundle/ChillMainBundle/Form/Type/PickUserDynamicType.php index 9a4fbdd75..a12042dab 100644 --- a/src/Bundle/ChillMainBundle/Form/Type/PickUserDynamicType.php +++ b/src/Bundle/ChillMainBundle/Form/Type/PickUserDynamicType.php @@ -27,7 +27,9 @@ use Symfony\Component\Serializer\SerializerInterface; */ class PickUserDynamicType extends AbstractType { - public function __construct(private readonly DenormalizerInterface $denormalizer, private readonly SerializerInterface $serializer, private readonly NormalizerInterface $normalizer) {} + public function __construct(private readonly DenormalizerInterface $denormalizer, private readonly SerializerInterface $serializer, private readonly NormalizerInterface $normalizer) + { + } public function buildForm(FormBuilderInterface $builder, array $options) { diff --git a/src/Bundle/ChillMainBundle/Form/Type/PickUserLocationType.php b/src/Bundle/ChillMainBundle/Form/Type/PickUserLocationType.php index 9d1cdb626..bea96b79b 100644 --- a/src/Bundle/ChillMainBundle/Form/Type/PickUserLocationType.php +++ b/src/Bundle/ChillMainBundle/Form/Type/PickUserLocationType.php @@ -20,7 +20,9 @@ use Symfony\Component\OptionsResolver\OptionsResolver; class PickUserLocationType extends AbstractType { - public function __construct(private readonly TranslatableStringHelper $translatableStringHelper, private readonly LocationRepository $locationRepository) {} + public function __construct(private readonly TranslatableStringHelper $translatableStringHelper, private readonly LocationRepository $locationRepository) + { + } public function configureOptions(OptionsResolver $resolver) { diff --git a/src/Bundle/ChillMainBundle/Form/Type/PrivateCommentType.php b/src/Bundle/ChillMainBundle/Form/Type/PrivateCommentType.php index 0d26b5a95..44354922f 100644 --- a/src/Bundle/ChillMainBundle/Form/Type/PrivateCommentType.php +++ b/src/Bundle/ChillMainBundle/Form/Type/PrivateCommentType.php @@ -21,7 +21,9 @@ use Symfony\Component\OptionsResolver\OptionsResolver; class PrivateCommentType extends AbstractType { - public function __construct(protected PrivateCommentDataMapper $dataMapper) {} + public function __construct(protected PrivateCommentDataMapper $dataMapper) + { + } public function buildForm(FormBuilderInterface $builder, array $options) { diff --git a/src/Bundle/ChillMainBundle/Form/Type/ScopePickerType.php b/src/Bundle/ChillMainBundle/Form/Type/ScopePickerType.php index 68ae84549..fd27a9bcb 100644 --- a/src/Bundle/ChillMainBundle/Form/Type/ScopePickerType.php +++ b/src/Bundle/ChillMainBundle/Form/Type/ScopePickerType.php @@ -39,7 +39,9 @@ use Symfony\Component\Security\Core\Security; */ class ScopePickerType extends AbstractType { - public function __construct(private readonly AuthorizationHelperInterface $authorizationHelper, private readonly Security $security, private readonly TranslatableStringHelperInterface $translatableStringHelper) {} + public function __construct(private readonly AuthorizationHelperInterface $authorizationHelper, private readonly Security $security, private readonly TranslatableStringHelperInterface $translatableStringHelper) + { + } public function buildForm(FormBuilderInterface $builder, array $options) { diff --git a/src/Bundle/ChillMainBundle/Form/Type/Select2CountryType.php b/src/Bundle/ChillMainBundle/Form/Type/Select2CountryType.php index 39648c11a..370de1137 100644 --- a/src/Bundle/ChillMainBundle/Form/Type/Select2CountryType.php +++ b/src/Bundle/ChillMainBundle/Form/Type/Select2CountryType.php @@ -26,7 +26,9 @@ use Symfony\Component\OptionsResolver\OptionsResolver; */ class Select2CountryType extends AbstractType { - public function __construct(private readonly RequestStack $requestStack, private readonly ObjectManager $em, protected TranslatableStringHelper $translatableStringHelper, protected ParameterBagInterface $parameterBag) {} + public function __construct(private readonly RequestStack $requestStack, private readonly ObjectManager $em, protected TranslatableStringHelper $translatableStringHelper, protected ParameterBagInterface $parameterBag) + { + } public function buildForm(FormBuilderInterface $builder, array $options) { @@ -56,7 +58,7 @@ class Select2CountryType extends AbstractType asort($choices, \SORT_STRING | \SORT_FLAG_CASE); $resolver->setDefaults([ - 'class' => \Chill\MainBundle\Entity\Country::class, + 'class' => Country::class, 'choices' => array_combine(array_values($choices), array_keys($choices)), 'preferred_choices' => array_combine(array_values($preferredChoices), array_keys($preferredChoices)), ]); diff --git a/src/Bundle/ChillMainBundle/Form/Type/Select2LanguageType.php b/src/Bundle/ChillMainBundle/Form/Type/Select2LanguageType.php index bc25ac638..9d634857a 100644 --- a/src/Bundle/ChillMainBundle/Form/Type/Select2LanguageType.php +++ b/src/Bundle/ChillMainBundle/Form/Type/Select2LanguageType.php @@ -26,7 +26,9 @@ use Symfony\Component\OptionsResolver\OptionsResolver; */ class Select2LanguageType extends AbstractType { - public function __construct(private readonly RequestStack $requestStack, private readonly ObjectManager $em, protected TranslatableStringHelper $translatableStringHelper, protected ParameterBagInterface $parameterBag) {} + public function __construct(private readonly RequestStack $requestStack, private readonly ObjectManager $em, protected TranslatableStringHelper $translatableStringHelper, protected ParameterBagInterface $parameterBag) + { + } public function buildForm(FormBuilderInterface $builder, array $options) { @@ -52,7 +54,7 @@ class Select2LanguageType extends AbstractType asort($choices, \SORT_STRING | \SORT_FLAG_CASE); $resolver->setDefaults([ - 'class' => \Chill\MainBundle\Entity\Language::class, + 'class' => Language::class, 'choices' => array_combine(array_values($choices), array_keys($choices)), 'preferred_choices' => array_combine(array_values($preferredChoices), array_keys($preferredChoices)), ]); diff --git a/src/Bundle/ChillMainBundle/Form/UserType.php b/src/Bundle/ChillMainBundle/Form/UserType.php index 9d62fbc6a..4a6bb8f9a 100644 --- a/src/Bundle/ChillMainBundle/Form/UserType.php +++ b/src/Bundle/ChillMainBundle/Form/UserType.php @@ -36,7 +36,9 @@ use Symfony\Component\Validator\Constraints\Regex; class UserType extends AbstractType { - public function __construct(private readonly TranslatableStringHelper $translatableStringHelper, protected ParameterBagInterface $parameterBag) {} + public function __construct(private readonly TranslatableStringHelper $translatableStringHelper, protected ParameterBagInterface $parameterBag) + { + } public function buildForm(FormBuilderInterface $builder, array $options) { diff --git a/src/Bundle/ChillMainBundle/Form/WorkflowStepType.php b/src/Bundle/ChillMainBundle/Form/WorkflowStepType.php index 208af8522..f0360d4bb 100644 --- a/src/Bundle/ChillMainBundle/Form/WorkflowStepType.php +++ b/src/Bundle/ChillMainBundle/Form/WorkflowStepType.php @@ -34,11 +34,13 @@ use Symfony\Component\Workflow\Transition; class WorkflowStepType extends AbstractType { - public function __construct(private readonly EntityWorkflowManager $entityWorkflowManager, private readonly Registry $registry, private readonly TranslatableStringHelperInterface $translatableStringHelper) {} + public function __construct(private readonly EntityWorkflowManager $entityWorkflowManager, private readonly Registry $registry, private readonly TranslatableStringHelperInterface $translatableStringHelper) + { + } public function buildForm(FormBuilderInterface $builder, array $options) { - /** @var \Chill\MainBundle\Entity\Workflow\EntityWorkflow $entityWorkflow */ + /** @var EntityWorkflow $entityWorkflow */ $entityWorkflow = $options['entity_workflow']; $handler = $this->entityWorkflowManager->getHandler($entityWorkflow); $workflow = $this->registry->get($entityWorkflow, $entityWorkflow->getWorkflowName()); diff --git a/src/Bundle/ChillMainBundle/Notification/Counter/NotificationByUserCounter.php b/src/Bundle/ChillMainBundle/Notification/Counter/NotificationByUserCounter.php index 1b4c2d7df..81a8bb3bb 100644 --- a/src/Bundle/ChillMainBundle/Notification/Counter/NotificationByUserCounter.php +++ b/src/Bundle/ChillMainBundle/Notification/Counter/NotificationByUserCounter.php @@ -23,7 +23,9 @@ use Symfony\Component\Security\Core\User\UserInterface; final readonly class NotificationByUserCounter implements NotificationCounterInterface { - public function __construct(private CacheItemPoolInterface $cacheItemPool, private NotificationRepository $notificationRepository) {} + public function __construct(private CacheItemPoolInterface $cacheItemPool, private NotificationRepository $notificationRepository) + { + } public function addNotification(UserInterface $u): int { diff --git a/src/Bundle/ChillMainBundle/Notification/Email/NotificationMailer.php b/src/Bundle/ChillMainBundle/Notification/Email/NotificationMailer.php index 7b535f1a7..7eba06242 100644 --- a/src/Bundle/ChillMainBundle/Notification/Email/NotificationMailer.php +++ b/src/Bundle/ChillMainBundle/Notification/Email/NotificationMailer.php @@ -24,7 +24,9 @@ use Symfony\Contracts\Translation\TranslatorInterface; class NotificationMailer { - public function __construct(private readonly MailerInterface $mailer, private readonly LoggerInterface $logger, private readonly TranslatorInterface $translator) {} + public function __construct(private readonly MailerInterface $mailer, private readonly LoggerInterface $logger, private readonly TranslatorInterface $translator) + { + } public function postPersistComment(NotificationComment $comment, PostPersistEventArgs $eventArgs): void { diff --git a/src/Bundle/ChillMainBundle/Notification/EventListener/PersistNotificationOnTerminateEventSubscriber.php b/src/Bundle/ChillMainBundle/Notification/EventListener/PersistNotificationOnTerminateEventSubscriber.php index 74c784b4b..fc2cd35ea 100644 --- a/src/Bundle/ChillMainBundle/Notification/EventListener/PersistNotificationOnTerminateEventSubscriber.php +++ b/src/Bundle/ChillMainBundle/Notification/EventListener/PersistNotificationOnTerminateEventSubscriber.php @@ -18,7 +18,9 @@ use Symfony\Component\HttpKernel\Event\TerminateEvent; class PersistNotificationOnTerminateEventSubscriber implements EventSubscriberInterface { - public function __construct(private readonly EntityManagerInterface $em, private readonly NotificationPersisterInterface $persister) {} + public function __construct(private readonly EntityManagerInterface $em, private readonly NotificationPersisterInterface $persister) + { + } public static function getSubscribedEvents() { diff --git a/src/Bundle/ChillMainBundle/Notification/Exception/NotificationHandlerNotFound.php b/src/Bundle/ChillMainBundle/Notification/Exception/NotificationHandlerNotFound.php index b1acff57b..a55104d23 100644 --- a/src/Bundle/ChillMainBundle/Notification/Exception/NotificationHandlerNotFound.php +++ b/src/Bundle/ChillMainBundle/Notification/Exception/NotificationHandlerNotFound.php @@ -11,4 +11,6 @@ declare(strict_types=1); namespace Chill\MainBundle\Notification\Exception; -class NotificationHandlerNotFound extends \RuntimeException {} +class NotificationHandlerNotFound extends \RuntimeException +{ +} diff --git a/src/Bundle/ChillMainBundle/Notification/Mailer.php b/src/Bundle/ChillMainBundle/Notification/Mailer.php index 5dacbc6fa..d62d6bc75 100644 --- a/src/Bundle/ChillMainBundle/Notification/Mailer.php +++ b/src/Bundle/ChillMainBundle/Notification/Mailer.php @@ -34,7 +34,9 @@ class Mailer * * @param mixed[] $routeParameters */ - public function __construct(private readonly MailerInterface $mailer, private readonly LoggerInterface $logger, private readonly Environment $twig, private readonly RouterInterface $router, private readonly TranslatorInterface $translator, protected $routeParameters) {} + public function __construct(private readonly MailerInterface $mailer, private readonly LoggerInterface $logger, private readonly Environment $twig, private readonly RouterInterface $router, private readonly TranslatorInterface $translator, protected $routeParameters) + { + } /** * @return string @@ -72,7 +74,7 @@ class Mailer mixed $recipient, array $subject, array $bodies, - callable $callback = null, + ?callable $callback = null, mixed $force = false ) { $fromEmail = $this->routeParameters['from_email']; diff --git a/src/Bundle/ChillMainBundle/Notification/NotificationHandlerManager.php b/src/Bundle/ChillMainBundle/Notification/NotificationHandlerManager.php index aa6e700bc..04116a434 100644 --- a/src/Bundle/ChillMainBundle/Notification/NotificationHandlerManager.php +++ b/src/Bundle/ChillMainBundle/Notification/NotificationHandlerManager.php @@ -17,7 +17,9 @@ use Doctrine\ORM\EntityManagerInterface; final readonly class NotificationHandlerManager { - public function __construct(private iterable $handlers, private EntityManagerInterface $em) {} + public function __construct(private iterable $handlers, private EntityManagerInterface $em) + { + } /** * @throw NotificationHandlerNotFound if handler is not found diff --git a/src/Bundle/ChillMainBundle/Notification/NotificationPresence.php b/src/Bundle/ChillMainBundle/Notification/NotificationPresence.php index 5c5cb3dcf..9b606d18d 100644 --- a/src/Bundle/ChillMainBundle/Notification/NotificationPresence.php +++ b/src/Bundle/ChillMainBundle/Notification/NotificationPresence.php @@ -23,7 +23,9 @@ class NotificationPresence { private array $cache = []; - public function __construct(private readonly Security $security, private readonly NotificationRepository $notificationRepository) {} + public function __construct(private readonly Security $security, private readonly NotificationRepository $notificationRepository) + { + } /** * @param list $more diff --git a/src/Bundle/ChillMainBundle/Notification/Templating/NotificationTwigExtensionRuntime.php b/src/Bundle/ChillMainBundle/Notification/Templating/NotificationTwigExtensionRuntime.php index a65758f5f..8dd2935dd 100644 --- a/src/Bundle/ChillMainBundle/Notification/Templating/NotificationTwigExtensionRuntime.php +++ b/src/Bundle/ChillMainBundle/Notification/Templating/NotificationTwigExtensionRuntime.php @@ -21,7 +21,9 @@ use Twig\Extension\RuntimeExtensionInterface; class NotificationTwigExtensionRuntime implements RuntimeExtensionInterface { - public function __construct(private readonly FormFactoryInterface $formFactory, private readonly NotificationPresence $notificationPresence, private readonly UrlGeneratorInterface $urlGenerator) {} + public function __construct(private readonly FormFactoryInterface $formFactory, private readonly NotificationPresence $notificationPresence, private readonly UrlGeneratorInterface $urlGenerator) + { + } public function counterNotificationFor(Environment $environment, string $relatedEntityClass, int $relatedEntityId, array $more = [], array $options = []): string { diff --git a/src/Bundle/ChillMainBundle/Pagination/PageGenerator.php b/src/Bundle/ChillMainBundle/Pagination/PageGenerator.php index 4c9cb68fe..b887accaa 100644 --- a/src/Bundle/ChillMainBundle/Pagination/PageGenerator.php +++ b/src/Bundle/ChillMainBundle/Pagination/PageGenerator.php @@ -18,7 +18,9 @@ class PageGenerator implements \Iterator { protected int $current = 1; - public function __construct(protected Paginator $paginator) {} + public function __construct(protected Paginator $paginator) + { + } public function current(): Page { diff --git a/src/Bundle/ChillMainBundle/Pagination/Paginator.php b/src/Bundle/ChillMainBundle/Pagination/Paginator.php index a809bc9f4..072437f09 100644 --- a/src/Bundle/ChillMainBundle/Pagination/Paginator.php +++ b/src/Bundle/ChillMainBundle/Pagination/Paginator.php @@ -57,7 +57,8 @@ class Paginator implements PaginatorInterface * the key in the GET parameter to indicate the number of item per page. */ protected string $itemPerPageKey - ) {} + ) { + } public function count(): int { @@ -137,7 +138,7 @@ class Paginator implements PaginatorInterface } /** - * @return \Chill\MainBundle\Pagination\Page + * @return Page * * @throws \RuntimeException if the next page does not exists */ diff --git a/src/Bundle/ChillMainBundle/Pagination/PaginatorFactory.php b/src/Bundle/ChillMainBundle/Pagination/PaginatorFactory.php index 4bf651280..0daad7283 100644 --- a/src/Bundle/ChillMainBundle/Pagination/PaginatorFactory.php +++ b/src/Bundle/ChillMainBundle/Pagination/PaginatorFactory.php @@ -42,7 +42,8 @@ class PaginatorFactory * the request or inside the paginator. */ private $itemPerPage = 20 - ) {} + ) { + } /** * create a paginator instance. @@ -58,8 +59,8 @@ class PaginatorFactory */ public function create( $totalItems, - string $route = null, - array $routeParameters = null + ?string $route = null, + ?array $routeParameters = null ) { return new Paginator( $totalItems, diff --git a/src/Bundle/ChillMainBundle/Phonenumber/PhoneNumberHelperInterface.php b/src/Bundle/ChillMainBundle/Phonenumber/PhoneNumberHelperInterface.php index bd3eeffe5..c7cf1ddfd 100644 --- a/src/Bundle/ChillMainBundle/Phonenumber/PhoneNumberHelperInterface.php +++ b/src/Bundle/ChillMainBundle/Phonenumber/PhoneNumberHelperInterface.php @@ -22,7 +22,7 @@ use libphonenumber\PhoneNumber; */ interface PhoneNumberHelperInterface { - public function format(PhoneNumber $phoneNumber = null): string; + public function format(?PhoneNumber $phoneNumber = null): string; /** * Get type (mobile, landline, ...) for phone number. diff --git a/src/Bundle/ChillMainBundle/Phonenumber/PhonenumberHelper.php b/src/Bundle/ChillMainBundle/Phonenumber/PhonenumberHelper.php index 462f379cf..d08d393a3 100644 --- a/src/Bundle/ChillMainBundle/Phonenumber/PhonenumberHelper.php +++ b/src/Bundle/ChillMainBundle/Phonenumber/PhonenumberHelper.php @@ -33,7 +33,7 @@ final class PhonenumberHelper implements PhoneNumberHelperInterface private bool $isConfigured = false; - private readonly PhonenumberUtil $phoneNumberUtil; + private readonly PhoneNumberUtil $phoneNumberUtil; private Client $twilioClient; @@ -66,7 +66,7 @@ final class PhonenumberHelper implements PhoneNumberHelperInterface * * @throws NumberParseException */ - public function format(PhoneNumber $phoneNumber = null): string + public function format(?PhoneNumber $phoneNumber = null): string { if (null === $phoneNumber) { return ''; diff --git a/src/Bundle/ChillMainBundle/Phonenumber/Templating.php b/src/Bundle/ChillMainBundle/Phonenumber/Templating.php index 51d57c9e9..69da56eca 100644 --- a/src/Bundle/ChillMainBundle/Phonenumber/Templating.php +++ b/src/Bundle/ChillMainBundle/Phonenumber/Templating.php @@ -16,7 +16,9 @@ use Twig\TwigFilter; class Templating extends AbstractExtension { - public function __construct(protected PhonenumberHelper $phonenumberHelper) {} + public function __construct(protected PhonenumberHelper $phonenumberHelper) + { + } public function formatPhonenumber($phonenumber) { diff --git a/src/Bundle/ChillMainBundle/Redis/ChillRedis.php b/src/Bundle/ChillMainBundle/Redis/ChillRedis.php index b9e454b46..439bb3558 100644 --- a/src/Bundle/ChillMainBundle/Redis/ChillRedis.php +++ b/src/Bundle/ChillMainBundle/Redis/ChillRedis.php @@ -16,4 +16,6 @@ use Redis; /** * Redis client configured by chill main. */ -class ChillRedis extends \Redis {} +class ChillRedis extends \Redis +{ +} diff --git a/src/Bundle/ChillMainBundle/Repository/AddressReferenceRepository.php b/src/Bundle/ChillMainBundle/Repository/AddressReferenceRepository.php index d029226d0..86faf6ea1 100644 --- a/src/Bundle/ChillMainBundle/Repository/AddressReferenceRepository.php +++ b/src/Bundle/ChillMainBundle/Repository/AddressReferenceRepository.php @@ -71,7 +71,7 @@ final class AddressReferenceRepository implements ObjectRepository * * @return AddressReference[] */ - public function findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null): array + public function findBy(array $criteria, ?array $orderBy = null, $limit = null, $offset = null): array { return $this->repository->findBy($criteria, $orderBy, $limit, $offset); } @@ -103,7 +103,7 @@ final class AddressReferenceRepository implements ObjectRepository ->getResult(); } - public function findOneBy(array $criteria, array $orderBy = null): ?AddressReference + public function findOneBy(array $criteria, ?array $orderBy = null): ?AddressReference { return $this->repository->findOneBy($criteria, $orderBy); } diff --git a/src/Bundle/ChillMainBundle/Repository/AddressRepository.php b/src/Bundle/ChillMainBundle/Repository/AddressRepository.php index eee1d5b1f..074b1fc32 100644 --- a/src/Bundle/ChillMainBundle/Repository/AddressRepository.php +++ b/src/Bundle/ChillMainBundle/Repository/AddressRepository.php @@ -26,7 +26,7 @@ final class AddressRepository implements ObjectRepository $this->repository = $entityManager->getRepository(Address::class); } - public function createQueryBuilder(string $alias, string $indexBy = null): QueryBuilder + public function createQueryBuilder(string $alias, ?string $indexBy = null): QueryBuilder { return $this->repository->createQueryBuilder($alias, $indexBy); } @@ -50,12 +50,12 @@ final class AddressRepository implements ObjectRepository * * @return Address[] */ - public function findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null): array + public function findBy(array $criteria, ?array $orderBy = null, $limit = null, $offset = null): array { return $this->repository->findBy($criteria, $orderBy, $limit, $offset); } - public function findOneBy(array $criteria, array $orderBy = null): ?Address + public function findOneBy(array $criteria, ?array $orderBy = null): ?Address { return $this->repository->findOneBy($criteria, $orderBy); } diff --git a/src/Bundle/ChillMainBundle/Repository/CenterRepository.php b/src/Bundle/ChillMainBundle/Repository/CenterRepository.php index 46e87cb10..0b507faa1 100644 --- a/src/Bundle/ChillMainBundle/Repository/CenterRepository.php +++ b/src/Bundle/ChillMainBundle/Repository/CenterRepository.php @@ -51,12 +51,12 @@ final class CenterRepository implements CenterRepositoryInterface * * @return Center[] */ - public function findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null): array + public function findBy(array $criteria, ?array $orderBy = null, $limit = null, $offset = null): array { return $this->repository->findBy($criteria, $orderBy, $limit, $offset); } - public function findOneBy(array $criteria, array $orderBy = null): ?Center + public function findOneBy(array $criteria, ?array $orderBy = null): ?Center { return $this->repository->findOneBy($criteria, $orderBy); } diff --git a/src/Bundle/ChillMainBundle/Repository/CivilityRepository.php b/src/Bundle/ChillMainBundle/Repository/CivilityRepository.php index 9ed4cbf01..982d3dd4c 100644 --- a/src/Bundle/ChillMainBundle/Repository/CivilityRepository.php +++ b/src/Bundle/ChillMainBundle/Repository/CivilityRepository.php @@ -34,7 +34,7 @@ class CivilityRepository implements CivilityRepositoryInterface return $this->repository->findAll(); } - public function findBy(array $criteria, array $orderBy = null, int $limit = null, int $offset = null): array + public function findBy(array $criteria, ?array $orderBy = null, ?int $limit = null, ?int $offset = null): array { return $this->repository->findBy($criteria, $orderBy, $limit, $offset); } diff --git a/src/Bundle/ChillMainBundle/Repository/CivilityRepositoryInterface.php b/src/Bundle/ChillMainBundle/Repository/CivilityRepositoryInterface.php index f838b54e8..5d687ac7e 100644 --- a/src/Bundle/ChillMainBundle/Repository/CivilityRepositoryInterface.php +++ b/src/Bundle/ChillMainBundle/Repository/CivilityRepositoryInterface.php @@ -26,7 +26,7 @@ interface CivilityRepositoryInterface extends ObjectRepository /** * @return array|Civility[] */ - public function findBy(array $criteria, array $orderBy = null, int $limit = null, int $offset = null): array; + public function findBy(array $criteria, ?array $orderBy = null, ?int $limit = null, ?int $offset = null): array; public function findOneBy(array $criteria): ?Civility; diff --git a/src/Bundle/ChillMainBundle/Repository/CountryRepository.php b/src/Bundle/ChillMainBundle/Repository/CountryRepository.php index 000ecb4e1..701019dba 100644 --- a/src/Bundle/ChillMainBundle/Repository/CountryRepository.php +++ b/src/Bundle/ChillMainBundle/Repository/CountryRepository.php @@ -26,7 +26,7 @@ final class CountryRepository implements ObjectRepository $this->repository = $entityManager->getRepository(Country::class); } - public function createQueryBuilder(string $alias, string $indexBy = null): QueryBuilder + public function createQueryBuilder(string $alias, ?string $indexBy = null): QueryBuilder { return $this->repository->createQueryBuilder($alias, $indexBy); } @@ -50,12 +50,12 @@ final class CountryRepository implements ObjectRepository * * @return Country[] */ - public function findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null): array + public function findBy(array $criteria, ?array $orderBy = null, $limit = null, $offset = null): array { return $this->repository->findBy($criteria, $orderBy, $limit, $offset); } - public function findOneBy(array $criteria, array $orderBy = null): ?Country + public function findOneBy(array $criteria, ?array $orderBy = null): ?Country { return $this->repository->findOneBy($criteria, $orderBy); } diff --git a/src/Bundle/ChillMainBundle/Repository/CronJobExecutionRepository.php b/src/Bundle/ChillMainBundle/Repository/CronJobExecutionRepository.php index 8fa4ea8f6..1f369ef4e 100644 --- a/src/Bundle/ChillMainBundle/Repository/CronJobExecutionRepository.php +++ b/src/Bundle/ChillMainBundle/Repository/CronJobExecutionRepository.php @@ -40,7 +40,7 @@ class CronJobExecutionRepository implements CronJobExecutionRepositoryInterface /** * @return array|CronJobExecution[] */ - public function findBy(array $criteria, array $orderBy = null, int $limit = null, int $offset = null): array + public function findBy(array $criteria, ?array $orderBy = null, ?int $limit = null, ?int $offset = null): array { return $this->repository->findBy($criteria, $orderBy, $limit, $offset); } diff --git a/src/Bundle/ChillMainBundle/Repository/CronJobExecutionRepositoryInterface.php b/src/Bundle/ChillMainBundle/Repository/CronJobExecutionRepositoryInterface.php index cef997edd..df894bbfb 100644 --- a/src/Bundle/ChillMainBundle/Repository/CronJobExecutionRepositoryInterface.php +++ b/src/Bundle/ChillMainBundle/Repository/CronJobExecutionRepositoryInterface.php @@ -26,7 +26,7 @@ interface CronJobExecutionRepositoryInterface extends ObjectRepository /** * @return array|CronJobExecution[] */ - public function findBy(array $criteria, array $orderBy = null, int $limit = null, int $offset = null): array; + public function findBy(array $criteria, ?array $orderBy = null, ?int $limit = null, ?int $offset = null): array; public function findOneBy(array $criteria): ?CronJobExecution; diff --git a/src/Bundle/ChillMainBundle/Repository/GeographicalUnitLayerLayerRepository.php b/src/Bundle/ChillMainBundle/Repository/GeographicalUnitLayerLayerRepository.php index 88d92a7dc..11a03c209 100644 --- a/src/Bundle/ChillMainBundle/Repository/GeographicalUnitLayerLayerRepository.php +++ b/src/Bundle/ChillMainBundle/Repository/GeographicalUnitLayerLayerRepository.php @@ -49,7 +49,7 @@ final class GeographicalUnitLayerLayerRepository implements GeographicalUnitLaye /** * @return array|GeographicalUnitLayer[] */ - public function findBy(array $criteria, array $orderBy = null, int $limit = null, int $offset = null): array + public function findBy(array $criteria, ?array $orderBy = null, ?int $limit = null, ?int $offset = null): array { return $this->repository->findBy($criteria, $orderBy, $limit, $offset); } diff --git a/src/Bundle/ChillMainBundle/Repository/GeographicalUnitRepository.php b/src/Bundle/ChillMainBundle/Repository/GeographicalUnitRepository.php index 2bb22b842..608609a11 100644 --- a/src/Bundle/ChillMainBundle/Repository/GeographicalUnitRepository.php +++ b/src/Bundle/ChillMainBundle/Repository/GeographicalUnitRepository.php @@ -86,7 +86,7 @@ final class GeographicalUnitRepository implements GeographicalUnitRepositoryInte ->getResult(); } - public function findBy(array $criteria, array $orderBy = null, int $limit = null, int $offset = null): ?GeographicalUnit + public function findBy(array $criteria, ?array $orderBy = null, ?int $limit = null, ?int $offset = null): ?GeographicalUnit { return $this->repository->findBy($criteria, $orderBy, $limit, $offset); } diff --git a/src/Bundle/ChillMainBundle/Repository/GroupCenterRepository.php b/src/Bundle/ChillMainBundle/Repository/GroupCenterRepository.php index a07087369..2d9ad8c5a 100644 --- a/src/Bundle/ChillMainBundle/Repository/GroupCenterRepository.php +++ b/src/Bundle/ChillMainBundle/Repository/GroupCenterRepository.php @@ -44,12 +44,12 @@ final class GroupCenterRepository implements ObjectRepository * * @return GroupCenter[] */ - public function findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null): array + public function findBy(array $criteria, ?array $orderBy = null, $limit = null, $offset = null): array { return $this->repository->findBy($criteria, $orderBy, $limit, $offset); } - public function findOneBy(array $criteria, array $orderBy = null): ?GroupCenter + public function findOneBy(array $criteria, ?array $orderBy = null): ?GroupCenter { return $this->repository->findOneBy($criteria, $orderBy); } diff --git a/src/Bundle/ChillMainBundle/Repository/LanguageRepository.php b/src/Bundle/ChillMainBundle/Repository/LanguageRepository.php index 1bbf2c168..d8c5d54f8 100644 --- a/src/Bundle/ChillMainBundle/Repository/LanguageRepository.php +++ b/src/Bundle/ChillMainBundle/Repository/LanguageRepository.php @@ -43,12 +43,12 @@ final class LanguageRepository implements LanguageRepositoryInterface * * @return Language[] */ - public function findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null): array + public function findBy(array $criteria, ?array $orderBy = null, $limit = null, $offset = null): array { return $this->repository->findBy($criteria, $orderBy, $limit, $offset); } - public function findOneBy(array $criteria, array $orderBy = null): ?Language + public function findOneBy(array $criteria, ?array $orderBy = null): ?Language { return $this->repository->findOneBy($criteria, $orderBy); } diff --git a/src/Bundle/ChillMainBundle/Repository/LanguageRepositoryInterface.php b/src/Bundle/ChillMainBundle/Repository/LanguageRepositoryInterface.php index ab110fc24..397b264e4 100644 --- a/src/Bundle/ChillMainBundle/Repository/LanguageRepositoryInterface.php +++ b/src/Bundle/ChillMainBundle/Repository/LanguageRepositoryInterface.php @@ -29,9 +29,9 @@ interface LanguageRepositoryInterface extends ObjectRepository * * @return Language[] */ - public function findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null): array; + public function findBy(array $criteria, ?array $orderBy = null, $limit = null, $offset = null): array; - public function findOneBy(array $criteria, array $orderBy = null): ?Language; + public function findOneBy(array $criteria, ?array $orderBy = null): ?Language; public function getClassName(): string; } diff --git a/src/Bundle/ChillMainBundle/Repository/NotificationRepository.php b/src/Bundle/ChillMainBundle/Repository/NotificationRepository.php index bc26981b2..ef7e05240 100644 --- a/src/Bundle/ChillMainBundle/Repository/NotificationRepository.php +++ b/src/Bundle/ChillMainBundle/Repository/NotificationRepository.php @@ -194,7 +194,7 @@ final class NotificationRepository implements ObjectRepository * * @return Notification[] */ - public function findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null): array + public function findBy(array $criteria, ?array $orderBy = null, $limit = null, $offset = null): array { return $this->repository->findBy($criteria, $orderBy, $limit, $offset); } @@ -214,7 +214,7 @@ final class NotificationRepository implements ObjectRepository ->getResult(); } - public function findOneBy(array $criteria, array $orderBy = null): ?Notification + public function findOneBy(array $criteria, ?array $orderBy = null): ?Notification { return $this->repository->findOneBy($criteria, $orderBy); } diff --git a/src/Bundle/ChillMainBundle/Repository/PermissionsGroupRepository.php b/src/Bundle/ChillMainBundle/Repository/PermissionsGroupRepository.php index 59b7c93a4..910d924db 100644 --- a/src/Bundle/ChillMainBundle/Repository/PermissionsGroupRepository.php +++ b/src/Bundle/ChillMainBundle/Repository/PermissionsGroupRepository.php @@ -57,12 +57,12 @@ final class PermissionsGroupRepository implements ObjectRepository * * @return PermissionsGroup[] */ - public function findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null): array + public function findBy(array $criteria, ?array $orderBy = null, $limit = null, $offset = null): array { return $this->repository->findBy($criteria, $orderBy, $limit, $offset); } - public function findOneBy(array $criteria, array $orderBy = null): ?PermissionsGroup + public function findOneBy(array $criteria, ?array $orderBy = null): ?PermissionsGroup { return $this->repository->findOneBy($criteria, $orderBy); } diff --git a/src/Bundle/ChillMainBundle/Repository/PostalCodeRepository.php b/src/Bundle/ChillMainBundle/Repository/PostalCodeRepository.php index 45e10816a..0949f52ba 100644 --- a/src/Bundle/ChillMainBundle/Repository/PostalCodeRepository.php +++ b/src/Bundle/ChillMainBundle/Repository/PostalCodeRepository.php @@ -54,7 +54,7 @@ final class PostalCodeRepository implements PostalCodeRepositoryInterface return $this->repository->findAll(); } - public function findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null): array + public function findBy(array $criteria, ?array $orderBy = null, $limit = null, $offset = null): array { return $this->repository->findBy($criteria, $orderBy, $limit, $offset); } @@ -79,7 +79,7 @@ final class PostalCodeRepository implements PostalCodeRepositoryInterface ->getResult(); } - public function findOneBy(array $criteria, array $orderBy = null): ?PostalCode + public function findOneBy(array $criteria, ?array $orderBy = null): ?PostalCode { return $this->repository->findOneBy($criteria, $orderBy); } diff --git a/src/Bundle/ChillMainBundle/Repository/PostalCodeRepositoryInterface.php b/src/Bundle/ChillMainBundle/Repository/PostalCodeRepositoryInterface.php index 590598cb0..fe3dee195 100644 --- a/src/Bundle/ChillMainBundle/Repository/PostalCodeRepositoryInterface.php +++ b/src/Bundle/ChillMainBundle/Repository/PostalCodeRepositoryInterface.php @@ -32,11 +32,11 @@ interface PostalCodeRepositoryInterface extends ObjectRepository * * @return PostalCode[] */ - public function findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null): array; + public function findBy(array $criteria, ?array $orderBy = null, $limit = null, $offset = null): array; public function findByPattern(string $pattern, ?Country $country, ?int $start = 0, ?int $limit = 50): array; - public function findOneBy(array $criteria, array $orderBy = null): ?PostalCode; + public function findOneBy(array $criteria, ?array $orderBy = null): ?PostalCode; public function getClassName(): string; } diff --git a/src/Bundle/ChillMainBundle/Repository/RegroupmentRepository.php b/src/Bundle/ChillMainBundle/Repository/RegroupmentRepository.php index cd51b7913..e18279944 100644 --- a/src/Bundle/ChillMainBundle/Repository/RegroupmentRepository.php +++ b/src/Bundle/ChillMainBundle/Repository/RegroupmentRepository.php @@ -51,12 +51,12 @@ final class RegroupmentRepository implements ObjectRepository * * @return Regroupment[] */ - public function findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null): array + public function findBy(array $criteria, ?array $orderBy = null, $limit = null, $offset = null): array { return $this->repository->findBy($criteria, $orderBy, $limit, $offset); } - public function findOneBy(array $criteria, array $orderBy = null): ?Regroupment + public function findOneBy(array $criteria, ?array $orderBy = null): ?Regroupment { return $this->repository->findOneBy($criteria, $orderBy); } diff --git a/src/Bundle/ChillMainBundle/Repository/RoleScopeRepository.php b/src/Bundle/ChillMainBundle/Repository/RoleScopeRepository.php index 6ee488ffe..ddf52af5b 100644 --- a/src/Bundle/ChillMainBundle/Repository/RoleScopeRepository.php +++ b/src/Bundle/ChillMainBundle/Repository/RoleScopeRepository.php @@ -44,12 +44,12 @@ final class RoleScopeRepository implements ObjectRepository * * @return RoleScope[] */ - public function findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null): array + public function findBy(array $criteria, ?array $orderBy = null, $limit = null, $offset = null): array { return $this->repository->findBy($criteria, $orderBy, $limit, $offset); } - public function findOneBy(array $criteria, array $orderBy = null): ?RoleScope + public function findOneBy(array $criteria, ?array $orderBy = null): ?RoleScope { return $this->repository->findOneBy($criteria, $orderBy); } diff --git a/src/Bundle/ChillMainBundle/Repository/SavedExportRepository.php b/src/Bundle/ChillMainBundle/Repository/SavedExportRepository.php index 4c0a5035b..702fdf7d6 100644 --- a/src/Bundle/ChillMainBundle/Repository/SavedExportRepository.php +++ b/src/Bundle/ChillMainBundle/Repository/SavedExportRepository.php @@ -42,12 +42,12 @@ class SavedExportRepository implements SavedExportRepositoryInterface return $this->repository->findAll(); } - public function findBy(array $criteria, array $orderBy = null, int $limit = null, int $offset = null): array + public function findBy(array $criteria, ?array $orderBy = null, ?int $limit = null, ?int $offset = null): array { return $this->repository->findBy($criteria, $orderBy, $limit, $offset); } - public function findByUser(User $user, ?array $orderBy = [], int $limit = null, int $offset = null): array + public function findByUser(User $user, ?array $orderBy = [], ?int $limit = null, ?int $offset = null): array { $qb = $this->repository->createQueryBuilder('se'); diff --git a/src/Bundle/ChillMainBundle/Repository/SavedExportRepositoryInterface.php b/src/Bundle/ChillMainBundle/Repository/SavedExportRepositoryInterface.php index 488139846..3b168505f 100644 --- a/src/Bundle/ChillMainBundle/Repository/SavedExportRepositoryInterface.php +++ b/src/Bundle/ChillMainBundle/Repository/SavedExportRepositoryInterface.php @@ -27,12 +27,12 @@ interface SavedExportRepositoryInterface extends ObjectRepository */ public function findAll(): array; - public function findBy(array $criteria, array $orderBy = null, int $limit = null, int $offset = null): array; + public function findBy(array $criteria, ?array $orderBy = null, ?int $limit = null, ?int $offset = null): array; /** * @return array|SavedExport[] */ - public function findByUser(User $user, ?array $orderBy = [], int $limit = null, int $offset = null): array; + public function findByUser(User $user, ?array $orderBy = [], ?int $limit = null, ?int $offset = null): array; public function findOneBy(array $criteria): ?SavedExport; diff --git a/src/Bundle/ChillMainBundle/Repository/ScopeRepository.php b/src/Bundle/ChillMainBundle/Repository/ScopeRepository.php index 21e55954b..ba4ddae9b 100644 --- a/src/Bundle/ChillMainBundle/Repository/ScopeRepository.php +++ b/src/Bundle/ChillMainBundle/Repository/ScopeRepository.php @@ -58,12 +58,12 @@ final class ScopeRepository implements ScopeRepositoryInterface * * @return Scope[] */ - public function findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null): array + public function findBy(array $criteria, ?array $orderBy = null, $limit = null, $offset = null): array { return $this->repository->findBy($criteria, $orderBy, $limit, $offset); } - public function findOneBy(array $criteria, array $orderBy = null): ?Scope + public function findOneBy(array $criteria, ?array $orderBy = null): ?Scope { return $this->repository->findOneBy($criteria, $orderBy); } diff --git a/src/Bundle/ChillMainBundle/Repository/ScopeRepositoryInterface.php b/src/Bundle/ChillMainBundle/Repository/ScopeRepositoryInterface.php index 6c68b08b2..436be847b 100644 --- a/src/Bundle/ChillMainBundle/Repository/ScopeRepositoryInterface.php +++ b/src/Bundle/ChillMainBundle/Repository/ScopeRepositoryInterface.php @@ -37,9 +37,9 @@ interface ScopeRepositoryInterface extends ObjectRepository * * @return Scope[] */ - public function findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null): array; + public function findBy(array $criteria, ?array $orderBy = null, $limit = null, $offset = null): array; - public function findOneBy(array $criteria, array $orderBy = null): ?Scope; + public function findOneBy(array $criteria, ?array $orderBy = null): ?Scope; public function getClassName(): string; } diff --git a/src/Bundle/ChillMainBundle/Repository/UserACLAwareRepository.php b/src/Bundle/ChillMainBundle/Repository/UserACLAwareRepository.php index f14424f6f..5b830ce27 100644 --- a/src/Bundle/ChillMainBundle/Repository/UserACLAwareRepository.php +++ b/src/Bundle/ChillMainBundle/Repository/UserACLAwareRepository.php @@ -19,7 +19,9 @@ use Doctrine\ORM\EntityManagerInterface; class UserACLAwareRepository implements UserACLAwareRepositoryInterface { - public function __construct(private readonly ParentRoleHelper $parentRoleHelper, private readonly EntityManagerInterface $em) {} + public function __construct(private readonly ParentRoleHelper $parentRoleHelper, private readonly EntityManagerInterface $em) + { + } public function findUsersByReachedACL(string $role, $center, $scope = null, bool $onlyEnabled = true): array { diff --git a/src/Bundle/ChillMainBundle/Repository/UserJobRepository.php b/src/Bundle/ChillMainBundle/Repository/UserJobRepository.php index dee7ac9d7..3c92c7f60 100644 --- a/src/Bundle/ChillMainBundle/Repository/UserJobRepository.php +++ b/src/Bundle/ChillMainBundle/Repository/UserJobRepository.php @@ -58,7 +58,7 @@ readonly class UserJobRepository implements UserJobRepositoryInterface * * @return array|object[]|UserJob[] */ - public function findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null) + public function findBy(array $criteria, ?array $orderBy = null, $limit = null, $offset = null) { return $this->repository->findBy($criteria, $orderBy, $limit, $offset); } diff --git a/src/Bundle/ChillMainBundle/Repository/UserJobRepositoryInterface.php b/src/Bundle/ChillMainBundle/Repository/UserJobRepositoryInterface.php index ef7488042..75c2a5671 100644 --- a/src/Bundle/ChillMainBundle/Repository/UserJobRepositoryInterface.php +++ b/src/Bundle/ChillMainBundle/Repository/UserJobRepositoryInterface.php @@ -41,7 +41,7 @@ interface UserJobRepositoryInterface extends ObjectRepository * * @return array|object[]|UserJob[] */ - public function findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null); + public function findBy(array $criteria, ?array $orderBy = null, $limit = null, $offset = null); public function findOneBy(array $criteria): ?UserJob; diff --git a/src/Bundle/ChillMainBundle/Repository/UserRepository.php b/src/Bundle/ChillMainBundle/Repository/UserRepository.php index 3bc24a6ac..dc5a9adfe 100644 --- a/src/Bundle/ChillMainBundle/Repository/UserRepository.php +++ b/src/Bundle/ChillMainBundle/Repository/UserRepository.php @@ -164,7 +164,7 @@ final readonly class UserRepository implements UserRepositoryInterface * * @return User[] */ - public function findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null): array + public function findBy(array $criteria, ?array $orderBy = null, $limit = null, $offset = null): array { return $this->repository->findBy($criteria, $orderBy, $limit, $offset); } @@ -172,7 +172,7 @@ final readonly class UserRepository implements UserRepositoryInterface /** * @return array|User[] */ - public function findByActive(array $orderBy = null, int $limit = null, int $offset = null): array + public function findByActive(?array $orderBy = null, ?int $limit = null, ?int $offset = null): array { return $this->findBy(['enabled' => true], $orderBy, $limit, $offset); } @@ -182,7 +182,7 @@ final readonly class UserRepository implements UserRepositoryInterface * * @return array|User[] */ - public function findByNotHavingAttribute(string $key, int $limit = null, int $offset = null): array + public function findByNotHavingAttribute(string $key, ?int $limit = null, ?int $offset = null): array { $rsm = new ResultSetMappingBuilder($this->entityManager); $rsm->addRootEntityFromClassMetadata(User::class, 'u'); @@ -200,7 +200,7 @@ final readonly class UserRepository implements UserRepositoryInterface return $this->entityManager->createNativeQuery($sql, $rsm)->setParameter(':key', $key)->getResult(); } - public function findByUsernameOrEmail(string $pattern, ?array $orderBy = [], int $limit = null, int $offset = null): array + public function findByUsernameOrEmail(string $pattern, ?array $orderBy = [], ?int $limit = null, ?int $offset = null): array { $qb = $this->queryByUsernameOrEmail($pattern); @@ -221,7 +221,7 @@ final readonly class UserRepository implements UserRepositoryInterface return $qb->getQuery()->getResult(); } - public function findOneBy(array $criteria, array $orderBy = null): ?User + public function findOneBy(array $criteria, ?array $orderBy = null): ?User { return $this->repository->findOneBy($criteria, $orderBy); } diff --git a/src/Bundle/ChillMainBundle/Repository/UserRepositoryInterface.php b/src/Bundle/ChillMainBundle/Repository/UserRepositoryInterface.php index f05da315d..b7a20f315 100644 --- a/src/Bundle/ChillMainBundle/Repository/UserRepositoryInterface.php +++ b/src/Bundle/ChillMainBundle/Repository/UserRepositoryInterface.php @@ -51,16 +51,16 @@ interface UserRepositoryInterface extends ObjectRepository /** * @return array|User[] */ - public function findByActive(array $orderBy = null, int $limit = null, int $offset = null): array; + public function findByActive(?array $orderBy = null, ?int $limit = null, ?int $offset = null): array; /** * Find users which does not have a key on attribute column. * * @return array|User[] */ - public function findByNotHavingAttribute(string $key, int $limit = null, int $offset = null): array; + public function findByNotHavingAttribute(string $key, ?int $limit = null, ?int $offset = null): array; - public function findByUsernameOrEmail(string $pattern, ?array $orderBy = [], int $limit = null, int $offset = null): array; + public function findByUsernameOrEmail(string $pattern, ?array $orderBy = [], ?int $limit = null, ?int $offset = null): array; public function findOneByUsernameOrEmail(string $pattern): ?User; diff --git a/src/Bundle/ChillMainBundle/Repository/Workflow/EntityWorkflowRepository.php b/src/Bundle/ChillMainBundle/Repository/Workflow/EntityWorkflowRepository.php index 234ea258e..66b3ab379 100644 --- a/src/Bundle/ChillMainBundle/Repository/Workflow/EntityWorkflowRepository.php +++ b/src/Bundle/ChillMainBundle/Repository/Workflow/EntityWorkflowRepository.php @@ -105,12 +105,12 @@ class EntityWorkflowRepository implements ObjectRepository * * @return array|EntityWorkflow[] */ - public function findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null): array + public function findBy(array $criteria, ?array $orderBy = null, $limit = null, $offset = null): array { return $this->repository->findBy($criteria, $orderBy, $limit, $offset); } - public function findByCc(User $user, array $orderBy = null, $limit = null, $offset = null): array + public function findByCc(User $user, ?array $orderBy = null, $limit = null, $offset = null): array { $qb = $this->buildQueryByCc($user)->select('ew'); @@ -123,7 +123,7 @@ class EntityWorkflowRepository implements ObjectRepository return $qb->getQuery()->getResult(); } - public function findByDest(User $user, array $orderBy = null, $limit = null, $offset = null): array + public function findByDest(User $user, ?array $orderBy = null, $limit = null, $offset = null): array { $qb = $this->buildQueryByDest($user)->select('ew'); @@ -136,7 +136,7 @@ class EntityWorkflowRepository implements ObjectRepository return $qb->getQuery()->getResult(); } - public function findByPreviousDestWithoutReaction(User $user, array $orderBy = null, $limit = null, $offset = null): array + public function findByPreviousDestWithoutReaction(User $user, ?array $orderBy = null, $limit = null, $offset = null): array { $qb = $this->buildQueryByPreviousDestWithoutReaction($user)->select('ew'); @@ -149,7 +149,7 @@ class EntityWorkflowRepository implements ObjectRepository return $qb->getQuery()->getResult(); } - public function findByPreviousTransitionned(User $user, array $orderBy = null, $limit = null, $offset = null): array + public function findByPreviousTransitionned(User $user, ?array $orderBy = null, $limit = null, $offset = null): array { $qb = $this->buildQueryByPreviousTransitionned($user)->select('ew')->distinct(true); @@ -162,7 +162,7 @@ class EntityWorkflowRepository implements ObjectRepository return $qb->getQuery()->getResult(); } - public function findBySubscriber(User $user, array $orderBy = null, $limit = null, $offset = null): array + public function findBySubscriber(User $user, ?array $orderBy = null, $limit = null, $offset = null): array { $qb = $this->buildQueryBySubscriber($user)->select('ew'); diff --git a/src/Bundle/ChillMainBundle/Repository/Workflow/EntityWorkflowStepRepository.php b/src/Bundle/ChillMainBundle/Repository/Workflow/EntityWorkflowStepRepository.php index d7e5455ba..545ec2873 100644 --- a/src/Bundle/ChillMainBundle/Repository/Workflow/EntityWorkflowStepRepository.php +++ b/src/Bundle/ChillMainBundle/Repository/Workflow/EntityWorkflowStepRepository.php @@ -27,7 +27,7 @@ class EntityWorkflowStepRepository implements ObjectRepository $this->repository = $entityManager->getRepository(EntityWorkflowStep::class); } - public function countUnreadByUser(User $user, array $orderBy = null, $limit = null, $offset = null): int + public function countUnreadByUser(User $user, ?array $orderBy = null, $limit = null, $offset = null): int { $qb = $this->buildQueryByUser($user)->select('count(e)'); @@ -44,7 +44,7 @@ class EntityWorkflowStepRepository implements ObjectRepository return $this->repository->findAll(); } - public function findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null): array + public function findBy(array $criteria, ?array $orderBy = null, $limit = null, $offset = null): array { return $this->repository->findBy($criteria, $orderBy, $limit, $offset); } diff --git a/src/Bundle/ChillMainBundle/Routing/MenuBuilder/SectionMenuBuilder.php b/src/Bundle/ChillMainBundle/Routing/MenuBuilder/SectionMenuBuilder.php index 37c47e1bd..6247cf769 100644 --- a/src/Bundle/ChillMainBundle/Routing/MenuBuilder/SectionMenuBuilder.php +++ b/src/Bundle/ChillMainBundle/Routing/MenuBuilder/SectionMenuBuilder.php @@ -26,7 +26,9 @@ class SectionMenuBuilder implements LocalMenuBuilderInterface /** * SectionMenuBuilder constructor. */ - public function __construct(protected AuthorizationCheckerInterface $authorizationChecker, protected TranslatorInterface $translator, protected ParameterBagInterface $parameterBag) {} + public function __construct(protected AuthorizationCheckerInterface $authorizationChecker, protected TranslatorInterface $translator, protected ParameterBagInterface $parameterBag) + { + } public function buildMenu($menuId, MenuItem $menu, array $parameters) { diff --git a/src/Bundle/ChillMainBundle/Routing/MenuBuilder/UserMenuBuilder.php b/src/Bundle/ChillMainBundle/Routing/MenuBuilder/UserMenuBuilder.php index 3427face3..9775fe474 100644 --- a/src/Bundle/ChillMainBundle/Routing/MenuBuilder/UserMenuBuilder.php +++ b/src/Bundle/ChillMainBundle/Routing/MenuBuilder/UserMenuBuilder.php @@ -22,7 +22,9 @@ use Symfony\Contracts\Translation\TranslatorInterface; class UserMenuBuilder implements LocalMenuBuilderInterface { - public function __construct(private readonly NotificationByUserCounter $notificationByUserCounter, private readonly WorkflowByUserCounter $workflowByUserCounter, private readonly Security $security, private readonly TranslatorInterface $translator, protected ParameterBagInterface $parameterBag, private readonly RequestStack $requestStack) {} + public function __construct(private readonly NotificationByUserCounter $notificationByUserCounter, private readonly WorkflowByUserCounter $workflowByUserCounter, private readonly Security $security, private readonly TranslatorInterface $translator, protected ParameterBagInterface $parameterBag, private readonly RequestStack $requestStack) + { + } public function buildMenu($menuId, \Knp\Menu\MenuItem $menu, array $parameters) { diff --git a/src/Bundle/ChillMainBundle/Routing/MenuComposer.php b/src/Bundle/ChillMainBundle/Routing/MenuComposer.php index e16b10e8f..a1bd1d52f 100644 --- a/src/Bundle/ChillMainBundle/Routing/MenuComposer.php +++ b/src/Bundle/ChillMainBundle/Routing/MenuComposer.php @@ -29,7 +29,9 @@ class MenuComposer private RouteCollection $routeCollection; - public function __construct(private readonly RouterInterface $router, private readonly FactoryInterface $menuFactory, private readonly TranslatorInterface $translator) {} + public function __construct(private readonly RouterInterface $router, private readonly FactoryInterface $menuFactory, private readonly TranslatorInterface $translator) + { + } public function addLocalMenuBuilder(LocalMenuBuilderInterface $menuBuilder, $menuId) { diff --git a/src/Bundle/ChillMainBundle/Routing/MenuTwig.php b/src/Bundle/ChillMainBundle/Routing/MenuTwig.php index 65608ba4d..7431833ab 100644 --- a/src/Bundle/ChillMainBundle/Routing/MenuTwig.php +++ b/src/Bundle/ChillMainBundle/Routing/MenuTwig.php @@ -22,7 +22,7 @@ use Twig\TwigFunction; */ class MenuTwig extends AbstractExtension implements ContainerAwareInterface { - private ?\Symfony\Component\DependencyInjection\ContainerInterface $container = null; + private ?ContainerInterface $container = null; /** * the default parameters for chillMenu. @@ -35,7 +35,9 @@ class MenuTwig extends AbstractExtension implements ContainerAwareInterface 'activeRouteKey' => null, ]; - public function __construct(private readonly MenuComposer $menuComposer) {} + public function __construct(private readonly MenuComposer $menuComposer) + { + } /** * Render a Menu corresponding to $menuId. @@ -85,7 +87,7 @@ class MenuTwig extends AbstractExtension implements ContainerAwareInterface return 'chill_menu'; } - public function setContainer(ContainerInterface $container = null) + public function setContainer(?ContainerInterface $container = null) { $this->container = $container; } diff --git a/src/Bundle/ChillMainBundle/Search/Entity/SearchUserApiProvider.php b/src/Bundle/ChillMainBundle/Search/Entity/SearchUserApiProvider.php index 12568287d..84d7d3786 100644 --- a/src/Bundle/ChillMainBundle/Search/Entity/SearchUserApiProvider.php +++ b/src/Bundle/ChillMainBundle/Search/Entity/SearchUserApiProvider.php @@ -17,7 +17,9 @@ use Chill\MainBundle\Search\SearchApiQuery; class SearchUserApiProvider implements SearchApiInterface { - public function __construct(private readonly UserRepository $userRepository) {} + public function __construct(private readonly UserRepository $userRepository) + { + } public function getResult(string $key, array $metadata, float $pertinence) { diff --git a/src/Bundle/ChillMainBundle/Search/Model/Result.php b/src/Bundle/ChillMainBundle/Search/Model/Result.php index 1866da2f2..8646819d7 100644 --- a/src/Bundle/ChillMainBundle/Search/Model/Result.php +++ b/src/Bundle/ChillMainBundle/Search/Model/Result.php @@ -19,7 +19,8 @@ class Result * mixed an arbitrary result. */ private $result - ) {} + ) { + } public function getRelevance(): float { diff --git a/src/Bundle/ChillMainBundle/Search/ParsingException.php b/src/Bundle/ChillMainBundle/Search/ParsingException.php index 241079925..b70dd81eb 100644 --- a/src/Bundle/ChillMainBundle/Search/ParsingException.php +++ b/src/Bundle/ChillMainBundle/Search/ParsingException.php @@ -11,4 +11,6 @@ declare(strict_types=1); namespace Chill\MainBundle\Search; -class ParsingException extends \Exception {} +class ParsingException extends \Exception +{ +} diff --git a/src/Bundle/ChillMainBundle/Search/SearchApi.php b/src/Bundle/ChillMainBundle/Search/SearchApi.php index 267b90313..b7307c140 100644 --- a/src/Bundle/ChillMainBundle/Search/SearchApi.php +++ b/src/Bundle/ChillMainBundle/Search/SearchApi.php @@ -20,7 +20,9 @@ use Doctrine\ORM\Query\ResultSetMappingBuilder; class SearchApi { - public function __construct(private readonly EntityManagerInterface $em, private readonly iterable $providers, private readonly PaginatorFactory $paginator) {} + public function __construct(private readonly EntityManagerInterface $em, private readonly iterable $providers, private readonly PaginatorFactory $paginator) + { + } public function getResults(string $pattern, array $types, array $parameters): Collection { diff --git a/src/Bundle/ChillMainBundle/Search/SearchApiNoQueryException.php b/src/Bundle/ChillMainBundle/Search/SearchApiNoQueryException.php index b16cec9c5..d7920097c 100644 --- a/src/Bundle/ChillMainBundle/Search/SearchApiNoQueryException.php +++ b/src/Bundle/ChillMainBundle/Search/SearchApiNoQueryException.php @@ -17,7 +17,7 @@ class SearchApiNoQueryException extends \RuntimeException private readonly array $types; - public function __construct(string $pattern = '', array $types = [], private readonly array $parameters = [], $code = 0, \Throwable $previous = null) + public function __construct(string $pattern = '', array $types = [], private readonly array $parameters = [], $code = 0, ?\Throwable $previous = null) { $typesStr = \implode(', ', $types); $message = "No query for this search: pattern : {$pattern}, types: {$typesStr}"; diff --git a/src/Bundle/ChillMainBundle/Search/SearchApiResult.php b/src/Bundle/ChillMainBundle/Search/SearchApiResult.php index 14f448746..4fc1cf928 100644 --- a/src/Bundle/ChillMainBundle/Search/SearchApiResult.php +++ b/src/Bundle/ChillMainBundle/Search/SearchApiResult.php @@ -17,7 +17,9 @@ class SearchApiResult { private mixed $result; - public function __construct(private readonly float $relevance) {} + public function __construct(private readonly float $relevance) + { + } /** * @Serializer\Groups({"read"}) diff --git a/src/Bundle/ChillMainBundle/Search/Utils/SearchExtractionResult.php b/src/Bundle/ChillMainBundle/Search/Utils/SearchExtractionResult.php index b992b00c1..c753013cb 100644 --- a/src/Bundle/ChillMainBundle/Search/Utils/SearchExtractionResult.php +++ b/src/Bundle/ChillMainBundle/Search/Utils/SearchExtractionResult.php @@ -13,7 +13,9 @@ namespace Chill\MainBundle\Search\Utils; class SearchExtractionResult { - public function __construct(private readonly string $filteredSubject, private readonly array $found) {} + public function __construct(private readonly string $filteredSubject, private readonly array $found) + { + } public function getFilteredSubject(): string { diff --git a/src/Bundle/ChillMainBundle/Security/Authorization/AbstractChillVoter.php b/src/Bundle/ChillMainBundle/Security/Authorization/AbstractChillVoter.php index d80020285..352c28be2 100644 --- a/src/Bundle/ChillMainBundle/Security/Authorization/AbstractChillVoter.php +++ b/src/Bundle/ChillMainBundle/Security/Authorization/AbstractChillVoter.php @@ -18,4 +18,6 @@ use Symfony\Component\Security\Core\Authorization\Voter\Voter; * * This abstract Voter provide generic methods to handle object specific to Chill */ -abstract class AbstractChillVoter extends Voter implements ChillVoterInterface {} +abstract class AbstractChillVoter extends Voter implements ChillVoterInterface +{ +} diff --git a/src/Bundle/ChillMainBundle/Security/Authorization/AuthorizationHelper.php b/src/Bundle/ChillMainBundle/Security/Authorization/AuthorizationHelper.php index e37c3171e..48c9b836f 100644 --- a/src/Bundle/ChillMainBundle/Security/Authorization/AuthorizationHelper.php +++ b/src/Bundle/ChillMainBundle/Security/Authorization/AuthorizationHelper.php @@ -34,7 +34,8 @@ class AuthorizationHelper implements AuthorizationHelperInterface private readonly ScopeResolverDispatcher $scopeResolverDispatcher, private readonly UserACLAwareRepositoryInterface $userACLAwareRepository, private readonly ParentRoleHelper $parentRoleHelper - ) {} + ) { + } /** * Filter an array of centers, return only center which are reachable. @@ -60,7 +61,7 @@ class AuthorizationHelper implements AuthorizationHelperInterface * * @return User[] */ - public function findUsersReaching(string $role, array|\Chill\MainBundle\Entity\Center $center, array|\Chill\MainBundle\Entity\Scope $scope = null, bool $onlyEnabled = true): array + public function findUsersReaching(string $role, array|Center $center, array|Scope|null $scope = null, bool $onlyEnabled = true): array { return $this->userACLAwareRepository ->findUsersByReachedACL($role, $center, $scope, $onlyEnabled); @@ -85,7 +86,7 @@ class AuthorizationHelper implements AuthorizationHelperInterface * * @return list
    */ - public function getReachableCenters(UserInterface $user, string $role, Scope $scope = null): array + public function getReachableCenters(UserInterface $user, string $role, ?Scope $scope = null): array { if (!$user instanceof User) { return []; @@ -125,7 +126,7 @@ class AuthorizationHelper implements AuthorizationHelperInterface * * @return Scope[] */ - public function getReachableCircles(UserInterface $user, string $role, array|\Chill\MainBundle\Entity\Center $center) + public function getReachableCircles(UserInterface $user, string $role, array|Center $center) { $scopes = []; @@ -167,7 +168,7 @@ class AuthorizationHelper implements AuthorizationHelperInterface * * @param Center|Center[] $center May be an array of center */ - public function userCanReachCenter(User $user, array|\Chill\MainBundle\Entity\Center $center): bool + public function userCanReachCenter(User $user, array|Center $center): bool { if ($center instanceof \Traversable) { foreach ($center as $c) { diff --git a/src/Bundle/ChillMainBundle/Security/Authorization/AuthorizationHelperForCurrentUser.php b/src/Bundle/ChillMainBundle/Security/Authorization/AuthorizationHelperForCurrentUser.php index e9bb709a8..0a9d837a6 100644 --- a/src/Bundle/ChillMainBundle/Security/Authorization/AuthorizationHelperForCurrentUser.php +++ b/src/Bundle/ChillMainBundle/Security/Authorization/AuthorizationHelperForCurrentUser.php @@ -17,9 +17,11 @@ use Symfony\Component\Security\Core\Security; class AuthorizationHelperForCurrentUser implements AuthorizationHelperForCurrentUserInterface { - public function __construct(private readonly AuthorizationHelperInterface $authorizationHelper, private readonly Security $security) {} + public function __construct(private readonly AuthorizationHelperInterface $authorizationHelper, private readonly Security $security) + { + } - public function getReachableCenters(string $role, Scope $scope = null): array + public function getReachableCenters(string $role, ?Scope $scope = null): array { if (!$this->security->getUser() instanceof User) { return []; diff --git a/src/Bundle/ChillMainBundle/Security/Authorization/AuthorizationHelperForCurrentUserInterface.php b/src/Bundle/ChillMainBundle/Security/Authorization/AuthorizationHelperForCurrentUserInterface.php index 04b34c8e5..d0e0085a5 100644 --- a/src/Bundle/ChillMainBundle/Security/Authorization/AuthorizationHelperForCurrentUserInterface.php +++ b/src/Bundle/ChillMainBundle/Security/Authorization/AuthorizationHelperForCurrentUserInterface.php @@ -22,7 +22,7 @@ interface AuthorizationHelperForCurrentUserInterface * * @return Center[] */ - public function getReachableCenters(string $role, Scope $scope = null): array; + public function getReachableCenters(string $role, ?Scope $scope = null): array; /** * @param list
    |Center $center diff --git a/src/Bundle/ChillMainBundle/Security/Authorization/AuthorizationHelperInterface.php b/src/Bundle/ChillMainBundle/Security/Authorization/AuthorizationHelperInterface.php index 5df54a0d6..cea27f1ad 100644 --- a/src/Bundle/ChillMainBundle/Security/Authorization/AuthorizationHelperInterface.php +++ b/src/Bundle/ChillMainBundle/Security/Authorization/AuthorizationHelperInterface.php @@ -23,7 +23,7 @@ interface AuthorizationHelperInterface * * @return list
    */ - public function getReachableCenters(UserInterface $user, string $role, Scope $scope = null): array; + public function getReachableCenters(UserInterface $user, string $role, ?Scope $scope = null): array; /** * @param Center|array
    $center diff --git a/src/Bundle/ChillMainBundle/Security/Authorization/ChillVoterInterface.php b/src/Bundle/ChillMainBundle/Security/Authorization/ChillVoterInterface.php index f8b0102c7..2ed1856d2 100644 --- a/src/Bundle/ChillMainBundle/Security/Authorization/ChillVoterInterface.php +++ b/src/Bundle/ChillMainBundle/Security/Authorization/ChillVoterInterface.php @@ -14,4 +14,6 @@ namespace Chill\MainBundle\Security\Authorization; /** * Provides methods for compiling voter and build admin role fields. */ -interface ChillVoterInterface {} +interface ChillVoterInterface +{ +} diff --git a/src/Bundle/ChillMainBundle/Security/Authorization/DefaultVoterHelper.php b/src/Bundle/ChillMainBundle/Security/Authorization/DefaultVoterHelper.php index 071388fcf..edfe83256 100644 --- a/src/Bundle/ChillMainBundle/Security/Authorization/DefaultVoterHelper.php +++ b/src/Bundle/ChillMainBundle/Security/Authorization/DefaultVoterHelper.php @@ -18,7 +18,8 @@ final readonly class DefaultVoterHelper implements VoterHelperInterface public function __construct( private AuthorizationHelper $authorizationHelper, private array $configuration - ) {} + ) { + } public function supports($attribute, $subject): bool { diff --git a/src/Bundle/ChillMainBundle/Security/Authorization/DefaultVoterHelperFactory.php b/src/Bundle/ChillMainBundle/Security/Authorization/DefaultVoterHelperFactory.php index 805ba03e5..1f16004b2 100644 --- a/src/Bundle/ChillMainBundle/Security/Authorization/DefaultVoterHelperFactory.php +++ b/src/Bundle/ChillMainBundle/Security/Authorization/DefaultVoterHelperFactory.php @@ -13,7 +13,9 @@ namespace Chill\MainBundle\Security\Authorization; class DefaultVoterHelperFactory implements VoterHelperFactoryInterface { - public function __construct(protected AuthorizationHelper $authorizationHelper) {} + public function __construct(protected AuthorizationHelper $authorizationHelper) + { + } public function generate($context): VoterGeneratorInterface { diff --git a/src/Bundle/ChillMainBundle/Security/Authorization/DefaultVoterHelperGenerator.php b/src/Bundle/ChillMainBundle/Security/Authorization/DefaultVoterHelperGenerator.php index 6a1fe5356..e0183cb7f 100644 --- a/src/Bundle/ChillMainBundle/Security/Authorization/DefaultVoterHelperGenerator.php +++ b/src/Bundle/ChillMainBundle/Security/Authorization/DefaultVoterHelperGenerator.php @@ -15,7 +15,9 @@ final class DefaultVoterHelperGenerator implements VoterGeneratorInterface { private array $configuration = []; - public function __construct(private readonly AuthorizationHelper $authorizationHelper) {} + public function __construct(private readonly AuthorizationHelper $authorizationHelper) + { + } public function addCheckFor(?string $class, array $attributes): self { diff --git a/src/Bundle/ChillMainBundle/Security/Authorization/EntityWorkflowVoter.php b/src/Bundle/ChillMainBundle/Security/Authorization/EntityWorkflowVoter.php index 44766a583..1da50e22e 100644 --- a/src/Bundle/ChillMainBundle/Security/Authorization/EntityWorkflowVoter.php +++ b/src/Bundle/ChillMainBundle/Security/Authorization/EntityWorkflowVoter.php @@ -27,7 +27,9 @@ class EntityWorkflowVoter extends Voter final public const SHOW_ENTITY_LINK = 'CHILL_MAIN_WORKFLOW_LINK_SHOW'; - public function __construct(private readonly EntityWorkflowManager $manager, private readonly Security $security) {} + public function __construct(private readonly EntityWorkflowManager $manager, private readonly Security $security) + { + } protected function supports($attribute, $subject) { diff --git a/src/Bundle/ChillMainBundle/Security/Authorization/WorkflowEntityDeletionVoter.php b/src/Bundle/ChillMainBundle/Security/Authorization/WorkflowEntityDeletionVoter.php index 9718cf013..637516ab9 100644 --- a/src/Bundle/ChillMainBundle/Security/Authorization/WorkflowEntityDeletionVoter.php +++ b/src/Bundle/ChillMainBundle/Security/Authorization/WorkflowEntityDeletionVoter.php @@ -20,7 +20,9 @@ class WorkflowEntityDeletionVoter extends Voter /** * @param \Chill\MainBundle\Workflow\EntityWorkflowHandlerInterface[] $handlers */ - public function __construct(private $handlers, private readonly EntityWorkflowRepository $entityWorkflowRepository) {} + public function __construct(private $handlers, private readonly EntityWorkflowRepository $entityWorkflowRepository) + { + } protected function supports($attribute, $subject) { diff --git a/src/Bundle/ChillMainBundle/Security/PasswordRecover/PasswordRecoverEvent.php b/src/Bundle/ChillMainBundle/Security/PasswordRecover/PasswordRecoverEvent.php index 264b77056..5985d8567 100644 --- a/src/Bundle/ChillMainBundle/Security/PasswordRecover/PasswordRecoverEvent.php +++ b/src/Bundle/ChillMainBundle/Security/PasswordRecover/PasswordRecoverEvent.php @@ -30,7 +30,8 @@ class PasswordRecoverEvent extends \Symfony\Contracts\EventDispatcher\Event private readonly ?User $user = null, private $ip = null, private readonly bool $safelyGenerated = false, - ) {} + ) { + } public function getIp() { diff --git a/src/Bundle/ChillMainBundle/Security/PasswordRecover/RecoverPasswordHelper.php b/src/Bundle/ChillMainBundle/Security/PasswordRecover/RecoverPasswordHelper.php index e868262e2..46712c6a6 100644 --- a/src/Bundle/ChillMainBundle/Security/PasswordRecover/RecoverPasswordHelper.php +++ b/src/Bundle/ChillMainBundle/Security/PasswordRecover/RecoverPasswordHelper.php @@ -20,7 +20,9 @@ class RecoverPasswordHelper { final public const RECOVER_PASSWORD_ROUTE = 'password_recover'; - public function __construct(private readonly TokenManager $tokenManager, private readonly UrlGeneratorInterface $urlGenerator, private readonly MailerInterface $mailer) {} + public function __construct(private readonly TokenManager $tokenManager, private readonly UrlGeneratorInterface $urlGenerator, private readonly MailerInterface $mailer) + { + } /** * @param bool $absolute diff --git a/src/Bundle/ChillMainBundle/Security/Resolver/CenterResolverDispatcher.php b/src/Bundle/ChillMainBundle/Security/Resolver/CenterResolverDispatcher.php index 903b8c5c5..9855477fd 100644 --- a/src/Bundle/ChillMainBundle/Security/Resolver/CenterResolverDispatcher.php +++ b/src/Bundle/ChillMainBundle/Security/Resolver/CenterResolverDispatcher.php @@ -16,7 +16,9 @@ final readonly class CenterResolverDispatcher implements CenterResolverDispatche /** * @param \Chill\MainBundle\Security\Resolver\CenterResolverInterface[] $resolvers */ - public function __construct(private iterable $resolvers = []) {} + public function __construct(private iterable $resolvers = []) + { + } public function resolveCenter($entity, ?array $options = []) { diff --git a/src/Bundle/ChillMainBundle/Security/Resolver/CenterResolverManager.php b/src/Bundle/ChillMainBundle/Security/Resolver/CenterResolverManager.php index f629459b4..2ded14071 100644 --- a/src/Bundle/ChillMainBundle/Security/Resolver/CenterResolverManager.php +++ b/src/Bundle/ChillMainBundle/Security/Resolver/CenterResolverManager.php @@ -18,7 +18,9 @@ final readonly class CenterResolverManager implements CenterResolverManagerInter /** * @param \Chill\MainBundle\Security\Resolver\CenterResolverInterface[] $resolvers */ - public function __construct(private iterable $resolvers = []) {} + public function __construct(private iterable $resolvers = []) + { + } public function resolveCenters($entity, ?array $options = []): array { diff --git a/src/Bundle/ChillMainBundle/Security/Resolver/ResolverTwigExtension.php b/src/Bundle/ChillMainBundle/Security/Resolver/ResolverTwigExtension.php index 032c28a9b..3959cc5a3 100644 --- a/src/Bundle/ChillMainBundle/Security/Resolver/ResolverTwigExtension.php +++ b/src/Bundle/ChillMainBundle/Security/Resolver/ResolverTwigExtension.php @@ -15,7 +15,9 @@ use Twig\TwigFilter; final class ResolverTwigExtension extends \Twig\Extension\AbstractExtension { - public function __construct(private readonly CenterResolverManagerInterface $centerResolverDispatcher, private readonly ScopeResolverDispatcher $scopeResolverDispatcher) {} + public function __construct(private readonly CenterResolverManagerInterface $centerResolverDispatcher, private readonly ScopeResolverDispatcher $scopeResolverDispatcher) + { + } public function getFilters() { diff --git a/src/Bundle/ChillMainBundle/Security/Resolver/ScopeResolverDispatcher.php b/src/Bundle/ChillMainBundle/Security/Resolver/ScopeResolverDispatcher.php index bafadf1a6..a0474bb3f 100644 --- a/src/Bundle/ChillMainBundle/Security/Resolver/ScopeResolverDispatcher.php +++ b/src/Bundle/ChillMainBundle/Security/Resolver/ScopeResolverDispatcher.php @@ -19,7 +19,9 @@ final readonly class ScopeResolverDispatcher /** * @param \Chill\MainBundle\Security\Resolver\ScopeResolverInterface[] $resolvers */ - public function __construct(private iterable $resolvers) {} + public function __construct(private iterable $resolvers) + { + } public function isConcerned($entity, ?array $options = []): bool { @@ -35,7 +37,7 @@ final readonly class ScopeResolverDispatcher /** * @return Scope|iterable|Scope|null */ - public function resolveScope(mixed $entity, ?array $options = []): null|\Chill\MainBundle\Entity\Scope|iterable + public function resolveScope(mixed $entity, ?array $options = []): Scope|iterable|null { foreach ($this->resolvers as $resolver) { if ($resolver->supports($entity, $options)) { diff --git a/src/Bundle/ChillMainBundle/Security/UserProvider/UserProvider.php b/src/Bundle/ChillMainBundle/Security/UserProvider/UserProvider.php index c624c6a99..408128c6f 100644 --- a/src/Bundle/ChillMainBundle/Security/UserProvider/UserProvider.php +++ b/src/Bundle/ChillMainBundle/Security/UserProvider/UserProvider.php @@ -21,7 +21,9 @@ use Symfony\Component\Security\Core\User\UserProviderInterface; class UserProvider implements UserProviderInterface { - public function __construct(protected EntityManagerInterface $em) {} + public function __construct(protected EntityManagerInterface $em) + { + } public function loadUserByUsername($username): UserInterface { diff --git a/src/Bundle/ChillMainBundle/Serializer/Model/Collection.php b/src/Bundle/ChillMainBundle/Serializer/Model/Collection.php index 6349f5d85..9d80eabe9 100644 --- a/src/Bundle/ChillMainBundle/Serializer/Model/Collection.php +++ b/src/Bundle/ChillMainBundle/Serializer/Model/Collection.php @@ -15,7 +15,9 @@ use Chill\MainBundle\Pagination\PaginatorInterface; class Collection { - public function __construct(private $items, private readonly PaginatorInterface $paginator) {} + public function __construct(private $items, private readonly PaginatorInterface $paginator) + { + } public function getItems() { diff --git a/src/Bundle/ChillMainBundle/Serializer/Model/Counter.php b/src/Bundle/ChillMainBundle/Serializer/Model/Counter.php index 476d68568..4ef3fe849 100644 --- a/src/Bundle/ChillMainBundle/Serializer/Model/Counter.php +++ b/src/Bundle/ChillMainBundle/Serializer/Model/Counter.php @@ -13,7 +13,9 @@ namespace Chill\MainBundle\Serializer\Model; class Counter implements \JsonSerializable { - public function __construct(private ?int $counter) {} + public function __construct(private ?int $counter) + { + } public function getCounter(): ?int { diff --git a/src/Bundle/ChillMainBundle/Serializer/Normalizer/AddressNormalizer.php b/src/Bundle/ChillMainBundle/Serializer/Normalizer/AddressNormalizer.php index bbae6bd40..1a5ebe86b 100644 --- a/src/Bundle/ChillMainBundle/Serializer/Normalizer/AddressNormalizer.php +++ b/src/Bundle/ChillMainBundle/Serializer/Normalizer/AddressNormalizer.php @@ -47,7 +47,9 @@ class AddressNormalizer implements ContextAwareNormalizerInterface, NormalizerAw 'confidential', ]; - public function __construct(private readonly AddressRender $addressRender) {} + public function __construct(private readonly AddressRender $addressRender) + { + } /** * @param Address $address diff --git a/src/Bundle/ChillMainBundle/Serializer/Normalizer/CenterNormalizer.php b/src/Bundle/ChillMainBundle/Serializer/Normalizer/CenterNormalizer.php index 7c41bcb8a..8e937ee66 100644 --- a/src/Bundle/ChillMainBundle/Serializer/Normalizer/CenterNormalizer.php +++ b/src/Bundle/ChillMainBundle/Serializer/Normalizer/CenterNormalizer.php @@ -20,7 +20,9 @@ use Symfony\Component\Serializer\Normalizer\NormalizerInterface; class CenterNormalizer implements DenormalizerInterface, NormalizerInterface { - public function __construct(private readonly CenterRepository $repository) {} + public function __construct(private readonly CenterRepository $repository) + { + } public function denormalize($data, $type, $format = null, array $context = []) { diff --git a/src/Bundle/ChillMainBundle/Serializer/Normalizer/CommentEmbeddableDocGenNormalizer.php b/src/Bundle/ChillMainBundle/Serializer/Normalizer/CommentEmbeddableDocGenNormalizer.php index 41cf94e1b..4cf80ccd7 100644 --- a/src/Bundle/ChillMainBundle/Serializer/Normalizer/CommentEmbeddableDocGenNormalizer.php +++ b/src/Bundle/ChillMainBundle/Serializer/Normalizer/CommentEmbeddableDocGenNormalizer.php @@ -23,14 +23,16 @@ class CommentEmbeddableDocGenNormalizer implements ContextAwareNormalizerInterfa { use NormalizerAwareTrait; - public function __construct(private readonly UserRepository $userRepository) {} + public function __construct(private readonly UserRepository $userRepository) + { + } /** * @param CommentEmbeddable $object * * @throws ExceptionInterface */ - public function normalize($object, string $format = null, array $context = []): array + public function normalize($object, ?string $format = null, array $context = []): array { if (null === $object || $object->isEmpty()) { return [ @@ -63,7 +65,7 @@ class CommentEmbeddableDocGenNormalizer implements ContextAwareNormalizerInterfa ]; } - public function supportsNormalization($data, string $format = null, array $context = []): bool + public function supportsNormalization($data, ?string $format = null, array $context = []): bool { if ('docgen' !== $format) { return false; diff --git a/src/Bundle/ChillMainBundle/Serializer/Normalizer/DateNormalizer.php b/src/Bundle/ChillMainBundle/Serializer/Normalizer/DateNormalizer.php index 9ee8bf158..69e7744e4 100644 --- a/src/Bundle/ChillMainBundle/Serializer/Normalizer/DateNormalizer.php +++ b/src/Bundle/ChillMainBundle/Serializer/Normalizer/DateNormalizer.php @@ -20,7 +20,9 @@ use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; class DateNormalizer implements ContextAwareNormalizerInterface, DenormalizerInterface { - public function __construct(private readonly RequestStack $requestStack, private readonly ParameterBagInterface $parameterBag) {} + public function __construct(private readonly RequestStack $requestStack, private readonly ParameterBagInterface $parameterBag) + { + } public function denormalize($data, $type, $format = null, array $context = []) { diff --git a/src/Bundle/ChillMainBundle/Serializer/Normalizer/DoctrineExistingEntityNormalizer.php b/src/Bundle/ChillMainBundle/Serializer/Normalizer/DoctrineExistingEntityNormalizer.php index ed34a45be..b90f587bb 100644 --- a/src/Bundle/ChillMainBundle/Serializer/Normalizer/DoctrineExistingEntityNormalizer.php +++ b/src/Bundle/ChillMainBundle/Serializer/Normalizer/DoctrineExistingEntityNormalizer.php @@ -19,7 +19,9 @@ use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; class DoctrineExistingEntityNormalizer implements DenormalizerInterface { - public function __construct(private readonly EntityManagerInterface $em, private readonly ClassMetadataFactoryInterface $serializerMetadataFactory) {} + public function __construct(private readonly EntityManagerInterface $em, private readonly ClassMetadataFactoryInterface $serializerMetadataFactory) + { + } public function denormalize($data, $type, $format = null, array $context = []) { diff --git a/src/Bundle/ChillMainBundle/Serializer/Normalizer/EntityWorkflowNormalizer.php b/src/Bundle/ChillMainBundle/Serializer/Normalizer/EntityWorkflowNormalizer.php index c4284a526..83e84f7a0 100644 --- a/src/Bundle/ChillMainBundle/Serializer/Normalizer/EntityWorkflowNormalizer.php +++ b/src/Bundle/ChillMainBundle/Serializer/Normalizer/EntityWorkflowNormalizer.php @@ -23,14 +23,16 @@ class EntityWorkflowNormalizer implements NormalizerInterface, NormalizerAwareIn { use NormalizerAwareTrait; - public function __construct(private readonly EntityWorkflowManager $entityWorkflowManager, private readonly MetadataExtractor $metadataExtractor, private readonly Registry $registry) {} + public function __construct(private readonly EntityWorkflowManager $entityWorkflowManager, private readonly MetadataExtractor $metadataExtractor, private readonly Registry $registry) + { + } /** * @param EntityWorkflow $object * * @return array */ - public function normalize($object, string $format = null, array $context = []) + public function normalize($object, ?string $format = null, array $context = []) { $workflow = $this->registry->get($object, $object->getWorkflowName()); $handler = $this->entityWorkflowManager->getHandler($object); @@ -48,7 +50,7 @@ class EntityWorkflowNormalizer implements NormalizerInterface, NormalizerAwareIn ]; } - public function supportsNormalization($data, string $format = null): bool + public function supportsNormalization($data, ?string $format = null): bool { return $data instanceof EntityWorkflow && 'json' === $format; } diff --git a/src/Bundle/ChillMainBundle/Serializer/Normalizer/EntityWorkflowStepNormalizer.php b/src/Bundle/ChillMainBundle/Serializer/Normalizer/EntityWorkflowStepNormalizer.php index 1edc6e74c..46dbd00cc 100644 --- a/src/Bundle/ChillMainBundle/Serializer/Normalizer/EntityWorkflowStepNormalizer.php +++ b/src/Bundle/ChillMainBundle/Serializer/Normalizer/EntityWorkflowStepNormalizer.php @@ -21,12 +21,14 @@ class EntityWorkflowStepNormalizer implements NormalizerAwareInterface, Normaliz { use NormalizerAwareTrait; - public function __construct(private readonly MetadataExtractor $metadataExtractor) {} + public function __construct(private readonly MetadataExtractor $metadataExtractor) + { + } /** * @param EntityWorkflowStep $object */ - public function normalize($object, string $format = null, array $context = []): array + public function normalize($object, ?string $format = null, array $context = []): array { $data = [ 'type' => 'entity_workflow_step', @@ -75,7 +77,7 @@ class EntityWorkflowStepNormalizer implements NormalizerAwareInterface, Normaliz return $data; } - public function supportsNormalization($data, string $format = null): bool + public function supportsNormalization($data, ?string $format = null): bool { return $data instanceof EntityWorkflowStep && 'json' === $format; } diff --git a/src/Bundle/ChillMainBundle/Serializer/Normalizer/NotificationNormalizer.php b/src/Bundle/ChillMainBundle/Serializer/Normalizer/NotificationNormalizer.php index 3195f9aab..70cd9a838 100644 --- a/src/Bundle/ChillMainBundle/Serializer/Normalizer/NotificationNormalizer.php +++ b/src/Bundle/ChillMainBundle/Serializer/Normalizer/NotificationNormalizer.php @@ -23,14 +23,16 @@ class NotificationNormalizer implements NormalizerAwareInterface, NormalizerInte { use NormalizerAwareTrait; - public function __construct(private readonly NotificationHandlerManager $notificationHandlerManager, private readonly EntityManagerInterface $entityManager, private readonly Security $security) {} + public function __construct(private readonly NotificationHandlerManager $notificationHandlerManager, private readonly EntityManagerInterface $entityManager, private readonly Security $security) + { + } /** * @param Notification $object * * @return array|\ArrayObject|bool|float|int|string|void|null */ - public function normalize($object, string $format = null, array $context = []) + public function normalize($object, ?string $format = null, array $context = []) { $entity = $this->entityManager ->getRepository($object->getRelatedEntityClass()) @@ -51,7 +53,7 @@ class NotificationNormalizer implements NormalizerAwareInterface, NormalizerInte ]; } - public function supportsNormalization($data, string $format = null) + public function supportsNormalization($data, ?string $format = null) { return $data instanceof Notification && 'json' === $format; } diff --git a/src/Bundle/ChillMainBundle/Serializer/Normalizer/PhonenumberNormalizer.php b/src/Bundle/ChillMainBundle/Serializer/Normalizer/PhonenumberNormalizer.php index 583c8a75b..28d7c623d 100644 --- a/src/Bundle/ChillMainBundle/Serializer/Normalizer/PhonenumberNormalizer.php +++ b/src/Bundle/ChillMainBundle/Serializer/Normalizer/PhonenumberNormalizer.php @@ -50,7 +50,7 @@ class PhonenumberNormalizer implements ContextAwareNormalizerInterface, Denormal } } - public function normalize($object, string $format = null, array $context = []): string + public function normalize($object, ?string $format = null, array $context = []): string { if ('docgen' === $format && null === $object) { return ''; @@ -64,7 +64,7 @@ class PhonenumberNormalizer implements ContextAwareNormalizerInterface, Denormal return 'libphonenumber\PhoneNumber' === $type; } - public function supportsNormalization($data, string $format = null, array $context = []): bool + public function supportsNormalization($data, ?string $format = null, array $context = []): bool { if ($data instanceof PhoneNumber && 'json' === $format) { return true; diff --git a/src/Bundle/ChillMainBundle/Serializer/Normalizer/PrivateCommentEmbeddableNormalizer.php b/src/Bundle/ChillMainBundle/Serializer/Normalizer/PrivateCommentEmbeddableNormalizer.php index 565fa34fc..1d7ee43ce 100644 --- a/src/Bundle/ChillMainBundle/Serializer/Normalizer/PrivateCommentEmbeddableNormalizer.php +++ b/src/Bundle/ChillMainBundle/Serializer/Normalizer/PrivateCommentEmbeddableNormalizer.php @@ -18,9 +18,11 @@ use Symfony\Component\Serializer\Normalizer\NormalizerInterface; class PrivateCommentEmbeddableNormalizer implements NormalizerInterface, DenormalizerInterface { - public function __construct(private readonly Security $security) {} + public function __construct(private readonly Security $security) + { + } - public function denormalize($data, string $type, string $format = null, array $context = []): PrivateCommentEmbeddable + public function denormalize($data, string $type, ?string $format = null, array $context = []): PrivateCommentEmbeddable { $comment = new PrivateCommentEmbeddable(); @@ -38,12 +40,12 @@ class PrivateCommentEmbeddableNormalizer implements NormalizerInterface, Denorma return $object->getCommentForUser($this->security->getUser()); } - public function supportsDenormalization($data, string $type, string $format = null): bool + public function supportsDenormalization($data, string $type, ?string $format = null): bool { return PrivateCommentEmbeddable::class === $type; } - public function supportsNormalization($data, string $format = null): bool + public function supportsNormalization($data, ?string $format = null): bool { return $data instanceof PrivateCommentEmbeddable; } diff --git a/src/Bundle/ChillMainBundle/Serializer/Normalizer/UserNormalizer.php b/src/Bundle/ChillMainBundle/Serializer/Normalizer/UserNormalizer.php index 80363871a..99e76c5ff 100644 --- a/src/Bundle/ChillMainBundle/Serializer/Normalizer/UserNormalizer.php +++ b/src/Bundle/ChillMainBundle/Serializer/Normalizer/UserNormalizer.php @@ -41,7 +41,9 @@ class UserNormalizer implements ContextAwareNormalizerInterface, NormalizerAware 'isAbsent' => false, ]; - public function __construct(private readonly UserRender $userRender, private readonly ClockInterface $clock) {} + public function __construct(private readonly UserRender $userRender, private readonly ClockInterface $clock) + { + } public function normalize($object, $format = null, array $context = []) { diff --git a/src/Bundle/ChillMainBundle/Service/AddressGeographicalUnit/CollateAddressWithReferenceOrPostalCode.php b/src/Bundle/ChillMainBundle/Service/AddressGeographicalUnit/CollateAddressWithReferenceOrPostalCode.php index a4589b836..80174053a 100644 --- a/src/Bundle/ChillMainBundle/Service/AddressGeographicalUnit/CollateAddressWithReferenceOrPostalCode.php +++ b/src/Bundle/ChillMainBundle/Service/AddressGeographicalUnit/CollateAddressWithReferenceOrPostalCode.php @@ -100,7 +100,8 @@ final readonly class CollateAddressWithReferenceOrPostalCode implements CollateA public function __construct( private Connection $connection, private LoggerInterface $logger, - ) {} + ) { + } /** * @throws \Throwable diff --git a/src/Bundle/ChillMainBundle/Service/AddressGeographicalUnit/CollateAddressWithReferenceOrPostalCodeCronJob.php b/src/Bundle/ChillMainBundle/Service/AddressGeographicalUnit/CollateAddressWithReferenceOrPostalCodeCronJob.php index ed055a3c3..0267b126d 100644 --- a/src/Bundle/ChillMainBundle/Service/AddressGeographicalUnit/CollateAddressWithReferenceOrPostalCodeCronJob.php +++ b/src/Bundle/ChillMainBundle/Service/AddressGeographicalUnit/CollateAddressWithReferenceOrPostalCodeCronJob.php @@ -22,7 +22,8 @@ final readonly class CollateAddressWithReferenceOrPostalCodeCronJob implements C public function __construct( private ClockInterface $clock, private CollateAddressWithReferenceOrPostalCodeInterface $collateAddressWithReferenceOrPostalCode, - ) {} + ) { + } public function canRun(?CronJobExecution $cronJobExecution): bool { @@ -40,7 +41,7 @@ final readonly class CollateAddressWithReferenceOrPostalCodeCronJob implements C return 'collate-address'; } - public function run(array $lastExecutionData): null|array + public function run(array $lastExecutionData): array|null { $maxId = ($this->collateAddressWithReferenceOrPostalCode)($lastExecutionData[self::LAST_MAX_ID] ?? 0); diff --git a/src/Bundle/ChillMainBundle/Service/AddressGeographicalUnit/RefreshAddressToGeographicalUnitMaterializedViewCronJob.php b/src/Bundle/ChillMainBundle/Service/AddressGeographicalUnit/RefreshAddressToGeographicalUnitMaterializedViewCronJob.php index 06eb2104d..46c79a250 100644 --- a/src/Bundle/ChillMainBundle/Service/AddressGeographicalUnit/RefreshAddressToGeographicalUnitMaterializedViewCronJob.php +++ b/src/Bundle/ChillMainBundle/Service/AddressGeographicalUnit/RefreshAddressToGeographicalUnitMaterializedViewCronJob.php @@ -21,7 +21,8 @@ final readonly class RefreshAddressToGeographicalUnitMaterializedViewCronJob imp public function __construct( private Connection $connection, private ClockInterface $clock, - ) {} + ) { + } public function canRun(?CronJobExecution $cronJobExecution): bool { @@ -45,7 +46,7 @@ final readonly class RefreshAddressToGeographicalUnitMaterializedViewCronJob imp return 'refresh-materialized-view-address-to-geog-units'; } - public function run(array $lastExecutionData): null|array + public function run(array $lastExecutionData): array|null { $this->connection->executeQuery('REFRESH MATERIALIZED VIEW view_chill_main_address_geographical_unit'); diff --git a/src/Bundle/ChillMainBundle/Service/EntityInfo/ViewEntityInfoManager.php b/src/Bundle/ChillMainBundle/Service/EntityInfo/ViewEntityInfoManager.php index b545d3979..3484fe288 100644 --- a/src/Bundle/ChillMainBundle/Service/EntityInfo/ViewEntityInfoManager.php +++ b/src/Bundle/ChillMainBundle/Service/EntityInfo/ViewEntityInfoManager.php @@ -23,7 +23,8 @@ class ViewEntityInfoManager private readonly iterable $vienEntityInfoProviders, private readonly Connection $connection, private readonly LoggerInterface $logger, - ) {} + ) { + } public function synchronizeOnDB(): void { diff --git a/src/Bundle/ChillMainBundle/Service/Import/AddressReferenceBEFromBestAddress.php b/src/Bundle/ChillMainBundle/Service/Import/AddressReferenceBEFromBestAddress.php index 25749aa89..681d49747 100644 --- a/src/Bundle/ChillMainBundle/Service/Import/AddressReferenceBEFromBestAddress.php +++ b/src/Bundle/ChillMainBundle/Service/Import/AddressReferenceBEFromBestAddress.php @@ -20,7 +20,9 @@ class AddressReferenceBEFromBestAddress { private const RELEASE = 'https://gitea.champs-libres.be/api/v1/repos/Chill-project/belgian-bestaddresses-transform/releases/tags/v1.0.0'; - public function __construct(private readonly HttpClientInterface $client, private readonly AddressReferenceBaseImporter $baseImporter, private readonly AddressToReferenceMatcher $addressToReferenceMatcher) {} + public function __construct(private readonly HttpClientInterface $client, private readonly AddressReferenceBaseImporter $baseImporter, private readonly AddressToReferenceMatcher $addressToReferenceMatcher) + { + } public function import(string $lang, array $lists): void { diff --git a/src/Bundle/ChillMainBundle/Service/Import/AddressReferenceBaseImporter.php b/src/Bundle/ChillMainBundle/Service/Import/AddressReferenceBaseImporter.php index bc656ebc5..9407bd600 100644 --- a/src/Bundle/ChillMainBundle/Service/Import/AddressReferenceBaseImporter.php +++ b/src/Bundle/ChillMainBundle/Service/Import/AddressReferenceBaseImporter.php @@ -45,7 +45,9 @@ final class AddressReferenceBaseImporter private array $waitingForInsert = []; - public function __construct(private readonly Connection $defaultConnection, private readonly LoggerInterface $logger) {} + public function __construct(private readonly Connection $defaultConnection, private readonly LoggerInterface $logger) + { + } public function finalize(): void { @@ -66,9 +68,9 @@ final class AddressReferenceBaseImporter string $street, string $streetNumber, string $source, - float $lat = null, - float $lon = null, - int $srid = null + ?float $lat = null, + ?float $lon = null, + ?int $srid = null ): void { if (!$this->isInitialized) { $this->initialize($source); diff --git a/src/Bundle/ChillMainBundle/Service/Import/AddressReferenceFromBano.php b/src/Bundle/ChillMainBundle/Service/Import/AddressReferenceFromBano.php index fd17f2cd2..a8b910424 100644 --- a/src/Bundle/ChillMainBundle/Service/Import/AddressReferenceFromBano.php +++ b/src/Bundle/ChillMainBundle/Service/Import/AddressReferenceFromBano.php @@ -17,7 +17,9 @@ use Symfony\Contracts\HttpClient\HttpClientInterface; class AddressReferenceFromBano { - public function __construct(private readonly HttpClientInterface $client, private readonly AddressReferenceBaseImporter $baseImporter, private readonly AddressToReferenceMatcher $addressToReferenceMatcher) {} + public function __construct(private readonly HttpClientInterface $client, private readonly AddressReferenceBaseImporter $baseImporter, private readonly AddressToReferenceMatcher $addressToReferenceMatcher) + { + } public function import(string $departementNo): void { diff --git a/src/Bundle/ChillMainBundle/Service/Import/AddressToReferenceMatcher.php b/src/Bundle/ChillMainBundle/Service/Import/AddressToReferenceMatcher.php index 6a7bff632..32e8f0984 100644 --- a/src/Bundle/ChillMainBundle/Service/Import/AddressToReferenceMatcher.php +++ b/src/Bundle/ChillMainBundle/Service/Import/AddressToReferenceMatcher.php @@ -64,7 +64,9 @@ final readonly class AddressToReferenceMatcher '{{ reviewed }}' => Address::ADDR_REFERENCE_STATUS_REVIEWED, ]; - public function __construct(private Connection $connection, private LoggerInterface $logger) {} + public function __construct(private Connection $connection, private LoggerInterface $logger) + { + } public function checkAddressesMatchingReferences(): void { diff --git a/src/Bundle/ChillMainBundle/Service/Import/GeographicalUnitBaseImporter.php b/src/Bundle/ChillMainBundle/Service/Import/GeographicalUnitBaseImporter.php index b76d6f096..6b6885ff2 100644 --- a/src/Bundle/ChillMainBundle/Service/Import/GeographicalUnitBaseImporter.php +++ b/src/Bundle/ChillMainBundle/Service/Import/GeographicalUnitBaseImporter.php @@ -43,7 +43,9 @@ final class GeographicalUnitBaseImporter private array $waitingForInsert = []; - public function __construct(private readonly Connection $defaultConnection, private readonly LoggerInterface $logger) {} + public function __construct(private readonly Connection $defaultConnection, private readonly LoggerInterface $logger) + { + } public function finalize(): void { @@ -64,7 +66,7 @@ final class GeographicalUnitBaseImporter string $unitName, string $unitKey, string $geomAsWKT, - int $srid = null + ?int $srid = null ): void { $this->initialize(); diff --git a/src/Bundle/ChillMainBundle/Service/Import/PostalCodeBEFromBestAddress.php b/src/Bundle/ChillMainBundle/Service/Import/PostalCodeBEFromBestAddress.php index a95ba1abc..2ac71abb7 100644 --- a/src/Bundle/ChillMainBundle/Service/Import/PostalCodeBEFromBestAddress.php +++ b/src/Bundle/ChillMainBundle/Service/Import/PostalCodeBEFromBestAddress.php @@ -20,7 +20,9 @@ class PostalCodeBEFromBestAddress { private const RELEASE = 'https://gitea.champs-libres.be/api/v1/repos/Chill-project/belgian-bestaddresses-transform/releases/tags/v1.0.0'; - public function __construct(private readonly PostalCodeBaseImporter $baseImporter, private readonly HttpClientInterface $client, private readonly LoggerInterface $logger) {} + public function __construct(private readonly PostalCodeBaseImporter $baseImporter, private readonly HttpClientInterface $client, private readonly LoggerInterface $logger) + { + } public function import(string $lang = 'fr'): void { diff --git a/src/Bundle/ChillMainBundle/Service/Import/PostalCodeBaseImporter.php b/src/Bundle/ChillMainBundle/Service/Import/PostalCodeBaseImporter.php index a0fc5a5db..5f7f52d72 100644 --- a/src/Bundle/ChillMainBundle/Service/Import/PostalCodeBaseImporter.php +++ b/src/Bundle/ChillMainBundle/Service/Import/PostalCodeBaseImporter.php @@ -54,7 +54,9 @@ class PostalCodeBaseImporter private array $waitingForInsert = []; - public function __construct(private readonly Connection $defaultConnection) {} + public function __construct(private readonly Connection $defaultConnection) + { + } public function finalize(): void { diff --git a/src/Bundle/ChillMainBundle/Service/Import/PostalCodeFRFromOpenData.php b/src/Bundle/ChillMainBundle/Service/Import/PostalCodeFRFromOpenData.php index a7998af44..e5934af3b 100644 --- a/src/Bundle/ChillMainBundle/Service/Import/PostalCodeFRFromOpenData.php +++ b/src/Bundle/ChillMainBundle/Service/Import/PostalCodeFRFromOpenData.php @@ -25,7 +25,9 @@ class PostalCodeFRFromOpenData { private const CSV = 'https://datanova.laposte.fr/data-fair/api/v1/datasets/laposte-hexasmal/data-files/019HexaSmal.csv'; - public function __construct(private readonly PostalCodeBaseImporter $baseImporter, private readonly HttpClientInterface $client, private readonly LoggerInterface $logger) {} + public function __construct(private readonly PostalCodeBaseImporter $baseImporter, private readonly HttpClientInterface $client, private readonly LoggerInterface $logger) + { + } public function import(): void { diff --git a/src/Bundle/ChillMainBundle/Service/Mailer/ChillMailer.php b/src/Bundle/ChillMainBundle/Service/Mailer/ChillMailer.php index 4f2e88c08..0d5d6b2d8 100644 --- a/src/Bundle/ChillMainBundle/Service/Mailer/ChillMailer.php +++ b/src/Bundle/ChillMainBundle/Service/Mailer/ChillMailer.php @@ -22,9 +22,11 @@ class ChillMailer implements MailerInterface { private string $prefix = '[Chill] '; - public function __construct(private readonly MailerInterface $initial, private readonly LoggerInterface $chillLogger) {} + public function __construct(private readonly MailerInterface $initial, private readonly LoggerInterface $chillLogger) + { + } - public function send(RawMessage $message, Envelope $envelope = null): void + public function send(RawMessage $message, ?Envelope $envelope = null): void { if ($message instanceof Email) { $message->subject($this->prefix.$message->getSubject()); diff --git a/src/Bundle/ChillMainBundle/Service/RollingDate/RollingDate.php b/src/Bundle/ChillMainBundle/Service/RollingDate/RollingDate.php index 445b35cb0..942310da4 100644 --- a/src/Bundle/ChillMainBundle/Service/RollingDate/RollingDate.php +++ b/src/Bundle/ChillMainBundle/Service/RollingDate/RollingDate.php @@ -69,7 +69,8 @@ class RollingDate private readonly string $roll, private readonly ?\DateTimeImmutable $fixedDate = null, private readonly \DateTimeImmutable $pivotDate = new \DateTimeImmutable('now') - ) {} + ) { + } public function getFixedDate(): ?\DateTimeImmutable { diff --git a/src/Bundle/ChillMainBundle/Service/ShortMessage/NullShortMessageSender.php b/src/Bundle/ChillMainBundle/Service/ShortMessage/NullShortMessageSender.php index 16bc87790..82dea7bc6 100644 --- a/src/Bundle/ChillMainBundle/Service/ShortMessage/NullShortMessageSender.php +++ b/src/Bundle/ChillMainBundle/Service/ShortMessage/NullShortMessageSender.php @@ -20,5 +20,7 @@ namespace Chill\MainBundle\Service\ShortMessage; class NullShortMessageSender implements ShortMessageSenderInterface { - public function send(ShortMessage $shortMessage): void {} + public function send(ShortMessage $shortMessage): void + { + } } diff --git a/src/Bundle/ChillMainBundle/Service/ShortMessage/ShortMessage.php b/src/Bundle/ChillMainBundle/Service/ShortMessage/ShortMessage.php index a2a5b6ed4..e028cf3c4 100644 --- a/src/Bundle/ChillMainBundle/Service/ShortMessage/ShortMessage.php +++ b/src/Bundle/ChillMainBundle/Service/ShortMessage/ShortMessage.php @@ -26,7 +26,9 @@ class ShortMessage final public const PRIORITY_MEDIUM = 'medium'; - public function __construct(private string $content, private PhoneNumber $phoneNumber, private string $priority = 'low') {} + public function __construct(private string $content, private PhoneNumber $phoneNumber, private string $priority = 'low') + { + } public function getContent(): string { diff --git a/src/Bundle/ChillMainBundle/Service/ShortMessage/ShortMessageHandler.php b/src/Bundle/ChillMainBundle/Service/ShortMessage/ShortMessageHandler.php index 344ff3c17..55490b2eb 100644 --- a/src/Bundle/ChillMainBundle/Service/ShortMessage/ShortMessageHandler.php +++ b/src/Bundle/ChillMainBundle/Service/ShortMessage/ShortMessageHandler.php @@ -25,7 +25,9 @@ use Symfony\Component\Messenger\Handler\MessageHandlerInterface; */ class ShortMessageHandler implements MessageHandlerInterface { - public function __construct(private readonly ShortMessageTransporterInterface $messageTransporter) {} + public function __construct(private readonly ShortMessageTransporterInterface $messageTransporter) + { + } public function __invoke(ShortMessage $message): void { diff --git a/src/Bundle/ChillMainBundle/Service/ShortMessage/ShortMessageTransporter.php b/src/Bundle/ChillMainBundle/Service/ShortMessage/ShortMessageTransporter.php index bbe4f0575..76e45acbd 100644 --- a/src/Bundle/ChillMainBundle/Service/ShortMessage/ShortMessageTransporter.php +++ b/src/Bundle/ChillMainBundle/Service/ShortMessage/ShortMessageTransporter.php @@ -20,7 +20,9 @@ namespace Chill\MainBundle\Service\ShortMessage; class ShortMessageTransporter implements ShortMessageTransporterInterface { - public function __construct(private readonly ShortMessageSenderInterface $sender) {} + public function __construct(private readonly ShortMessageSenderInterface $sender) + { + } public function send(ShortMessage $shortMessage): void { diff --git a/src/Bundle/ChillMainBundle/Service/ShortMessageOvh/OvhShortMessageSender.php b/src/Bundle/ChillMainBundle/Service/ShortMessageOvh/OvhShortMessageSender.php index d81123c9a..bf43d76d4 100644 --- a/src/Bundle/ChillMainBundle/Service/ShortMessageOvh/OvhShortMessageSender.php +++ b/src/Bundle/ChillMainBundle/Service/ShortMessageOvh/OvhShortMessageSender.php @@ -36,7 +36,8 @@ class OvhShortMessageSender implements ShortMessageSenderInterface // for DI, must remains as third argument private readonly LoggerInterface $logger, private readonly PhoneNumberUtil $phoneNumberUtil - ) {} + ) { + } public function send(ShortMessage $shortMessage): void { diff --git a/src/Bundle/ChillMainBundle/Templating/Entity/AddressRender.php b/src/Bundle/ChillMainBundle/Templating/Entity/AddressRender.php index f59b1cd66..8a4d99f82 100644 --- a/src/Bundle/ChillMainBundle/Templating/Entity/AddressRender.php +++ b/src/Bundle/ChillMainBundle/Templating/Entity/AddressRender.php @@ -30,7 +30,9 @@ class AddressRender implements ChillEntityRenderInterface 'extended_infos' => false, ]; - public function __construct(private readonly \Twig\Environment $templating, private readonly TranslatableStringHelperInterface $translatableStringHelper) {} + public function __construct(private readonly \Twig\Environment $templating, private readonly TranslatableStringHelperInterface $translatableStringHelper) + { + } public function renderBox($addr, array $options): string { diff --git a/src/Bundle/ChillMainBundle/Templating/Entity/CommentRender.php b/src/Bundle/ChillMainBundle/Templating/Entity/CommentRender.php index a4d0f48e6..80536c528 100644 --- a/src/Bundle/ChillMainBundle/Templating/Entity/CommentRender.php +++ b/src/Bundle/ChillMainBundle/Templating/Entity/CommentRender.php @@ -21,7 +21,9 @@ class CommentRender implements ChillEntityRenderInterface { use BoxUtilsChillEntityRenderTrait; - public function __construct(private readonly UserRepositoryInterface $userRepository, private readonly \Twig\Environment $engine) {} + public function __construct(private readonly UserRepositoryInterface $userRepository, private readonly \Twig\Environment $engine) + { + } public function renderBox($entity, array $options): string { diff --git a/src/Bundle/ChillMainBundle/Templating/Entity/UserRender.php b/src/Bundle/ChillMainBundle/Templating/Entity/UserRender.php index 77b4255cc..de9f4abbe 100644 --- a/src/Bundle/ChillMainBundle/Templating/Entity/UserRender.php +++ b/src/Bundle/ChillMainBundle/Templating/Entity/UserRender.php @@ -35,14 +35,15 @@ class UserRender implements ChillEntityRenderInterface public function __construct( private readonly TranslatableStringHelper $translatableStringHelper, - private readonly \Twig\Environment $engine, private readonly TranslatorInterface $translator, + private readonly \Twig\Environment $engine, + private readonly TranslatorInterface $translator, private readonly ClockInterface $clock, - ) {} + ) { + } /** - * @param $entity - * @param array{main_scope?: bool, user_job?: bool, absence?: bool, at_date?: null|DateTimeImmutable|DateTime} $options - * @return string + * @param array{main_scope?: bool, user_job?: bool, absence?: bool, at_date?: DateTimeImmutable|\DateTime|null} $options + * * @throws LoaderError * @throws RuntimeError * @throws SyntaxError @@ -53,7 +54,7 @@ class UserRender implements ChillEntityRenderInterface if (null === $opts['at_date']) { $opts['at_date'] = $this->clock->now(); - } elseif ($opts['at_date'] instanceof DateTime) { + } elseif ($opts['at_date'] instanceof \DateTime) { $opts['at_date'] = DateTimeImmutable::createFromMutable($opts['at_date']); } @@ -64,19 +65,17 @@ class UserRender implements ChillEntityRenderInterface } /** - * @param $entity - * @param array{main_scope?: bool, user_job?: bool, absence?: bool, at_date?: null|DateTimeImmutable|DateTimeMutable} $options - * @return string + * @param array{main_scope?: bool, user_job?: bool, absence?: bool, at_date?: DateTimeImmutable|DateTimeMutable|null} $options */ public function renderString($entity, array $options): string { $opts = \array_merge(self::DEFAULT_OPTIONS, $options); -// $immutableAtDate = $opts['at_date'] instanceOf DateTime ? DateTimeImmutable::createFromMutable($opts['at_date']) : $opts['at_date']; + // $immutableAtDate = $opts['at_date'] instanceOf DateTime ? DateTimeImmutable::createFromMutable($opts['at_date']) : $opts['at_date']; if (null === $opts['at_date']) { $opts['at_date'] = $this->clock->now(); - } elseif ($opts['at_date'] instanceof DateTime) { + } elseif ($opts['at_date'] instanceof \DateTime) { $opts['at_date'] = DateTimeImmutable::createFromMutable($opts['at_date']); } diff --git a/src/Bundle/ChillMainBundle/Templating/Listing/FilterOrderGetActiveFilterHelper.php b/src/Bundle/ChillMainBundle/Templating/Listing/FilterOrderGetActiveFilterHelper.php index 4ca9eda41..ecc54acf6 100644 --- a/src/Bundle/ChillMainBundle/Templating/Listing/FilterOrderGetActiveFilterHelper.php +++ b/src/Bundle/ChillMainBundle/Templating/Listing/FilterOrderGetActiveFilterHelper.php @@ -22,7 +22,8 @@ final readonly class FilterOrderGetActiveFilterHelper private TranslatorInterface $translator, private PropertyAccessorInterface $propertyAccessor, private UserRender $userRender, - ) {} + ) { + } /** * Return all the data required to display the active filters. diff --git a/src/Bundle/ChillMainBundle/Templating/Listing/FilterOrderHelper.php b/src/Bundle/ChillMainBundle/Templating/Listing/FilterOrderHelper.php index 9b6a42fe4..9f42461c6 100644 --- a/src/Bundle/ChillMainBundle/Templating/Listing/FilterOrderHelper.php +++ b/src/Bundle/ChillMainBundle/Templating/Listing/FilterOrderHelper.php @@ -51,7 +51,8 @@ final class FilterOrderHelper public function __construct( private readonly FormFactoryInterface $formFactory, private readonly RequestStack $requestStack, - ) {} + ) { + } public function addSingleCheckbox(string $name, string $label): self { @@ -75,7 +76,7 @@ final class FilterOrderHelper return $this->entityChoices; } - public function addUserPicker(string $name, string $label = null, array $options = []): self + public function addUserPicker(string $name, ?string $label = null, array $options = []): self { $this->userPickers[$name] = ['label' => $label, 'options' => $options]; @@ -98,7 +99,7 @@ final class FilterOrderHelper return $this; } - public function addDateRange(string $name, string $label = null, \DateTimeImmutable $from = null, \DateTimeImmutable $to = null): self + public function addDateRange(string $name, ?string $label = null, ?\DateTimeImmutable $from = null, ?\DateTimeImmutable $to = null): self { $this->dateRanges[$name] = ['from' => $from, 'to' => $to, 'label' => $label]; diff --git a/src/Bundle/ChillMainBundle/Templating/Listing/FilterOrderHelperBuilder.php b/src/Bundle/ChillMainBundle/Templating/Listing/FilterOrderHelperBuilder.php index d5df6d4f3..14189b88d 100644 --- a/src/Bundle/ChillMainBundle/Templating/Listing/FilterOrderHelperBuilder.php +++ b/src/Bundle/ChillMainBundle/Templating/Listing/FilterOrderHelperBuilder.php @@ -37,7 +37,9 @@ class FilterOrderHelperBuilder */ private array $userPickers = []; - public function __construct(private readonly FormFactoryInterface $formFactory, private readonly RequestStack $requestStack) {} + public function __construct(private readonly FormFactoryInterface $formFactory, private readonly RequestStack $requestStack) + { + } public function addSingleCheckbox(string $name, string $label): self { @@ -63,7 +65,7 @@ class FilterOrderHelperBuilder return $this; } - public function addDateRange(string $name, string $label = null, \DateTimeImmutable $from = null, \DateTimeImmutable $to = null): self + public function addDateRange(string $name, ?string $label = null, ?\DateTimeImmutable $from = null, ?\DateTimeImmutable $to = null): self { $this->dateRanges[$name] = ['from' => $from, 'to' => $to, 'label' => $label]; @@ -77,7 +79,7 @@ class FilterOrderHelperBuilder return $this; } - public function addUserPicker(string $name, string $label = null, ?array $options = []): self + public function addUserPicker(string $name, ?string $label = null, ?array $options = []): self { $this->userPickers[$name] = ['label' => $label, 'options' => $options]; diff --git a/src/Bundle/ChillMainBundle/Templating/Listing/FilterOrderHelperFactory.php b/src/Bundle/ChillMainBundle/Templating/Listing/FilterOrderHelperFactory.php index 0aff466dc..c9c094a15 100644 --- a/src/Bundle/ChillMainBundle/Templating/Listing/FilterOrderHelperFactory.php +++ b/src/Bundle/ChillMainBundle/Templating/Listing/FilterOrderHelperFactory.php @@ -16,7 +16,9 @@ use Symfony\Component\HttpFoundation\RequestStack; class FilterOrderHelperFactory implements FilterOrderHelperFactoryInterface { - public function __construct(private readonly FormFactoryInterface $formFactory, private readonly RequestStack $requestStack) {} + public function __construct(private readonly FormFactoryInterface $formFactory, private readonly RequestStack $requestStack) + { + } public function create(string $context, ?array $options = []): FilterOrderHelperBuilder { diff --git a/src/Bundle/ChillMainBundle/Templating/Listing/Templating.php b/src/Bundle/ChillMainBundle/Templating/Listing/Templating.php index 6d91cdd83..40eca8679 100644 --- a/src/Bundle/ChillMainBundle/Templating/Listing/Templating.php +++ b/src/Bundle/ChillMainBundle/Templating/Listing/Templating.php @@ -25,7 +25,8 @@ class Templating extends AbstractExtension public function __construct( private readonly RequestStack $requestStack, private readonly FilterOrderGetActiveFilterHelper $filterOrderGetActiveFilterHelper, - ) {} + ) { + } public function getFilters(): array { diff --git a/src/Bundle/ChillMainBundle/Templating/TranslatableStringTwig.php b/src/Bundle/ChillMainBundle/Templating/TranslatableStringTwig.php index eceae8d9c..bdcc1d9d9 100644 --- a/src/Bundle/ChillMainBundle/Templating/TranslatableStringTwig.php +++ b/src/Bundle/ChillMainBundle/Templating/TranslatableStringTwig.php @@ -22,7 +22,9 @@ class TranslatableStringTwig extends AbstractExtension /** * TranslatableStringTwig constructor. */ - public function __construct(private readonly TranslatableStringHelper $helper) {} + public function __construct(private readonly TranslatableStringHelper $helper) + { + } /** * Returns a list of filters to add to the existing list. diff --git a/src/Bundle/ChillMainBundle/Tests/Controller/GeographicalUnitByAddressApiControllerTest.php b/src/Bundle/ChillMainBundle/Tests/Controller/GeographicalUnitByAddressApiControllerTest.php index cf8fabf66..f47ddd40b 100644 --- a/src/Bundle/ChillMainBundle/Tests/Controller/GeographicalUnitByAddressApiControllerTest.php +++ b/src/Bundle/ChillMainBundle/Tests/Controller/GeographicalUnitByAddressApiControllerTest.php @@ -43,7 +43,7 @@ class GeographicalUnitByAddressApiControllerTest extends WebTestCase $em = self::$container->get(EntityManagerInterface::class); $nb = $em->createQuery('SELECT COUNT(a) FROM '.Address::class.' a')->getSingleScalarResult(); - /** @var \Chill\MainBundle\Entity\Address $random */ + /** @var Address $random */ $random = $em->createQuery('SELECT a FROM '.Address::class.' a') ->setFirstResult(random_int(0, $nb)) ->setMaxResults(1) diff --git a/src/Bundle/ChillMainBundle/Tests/Cron/CronJobDatabaseInteractionTest.php b/src/Bundle/ChillMainBundle/Tests/Cron/CronJobDatabaseInteractionTest.php index 594bd6460..38e2c9509 100644 --- a/src/Bundle/ChillMainBundle/Tests/Cron/CronJobDatabaseInteractionTest.php +++ b/src/Bundle/ChillMainBundle/Tests/Cron/CronJobDatabaseInteractionTest.php @@ -91,7 +91,7 @@ class JobWithReturn implements CronJobInterface return 'with-data'; } - public function run(array $lastExecutionData): null|array + public function run(array $lastExecutionData): array|null { return ['data' => 'test']; } diff --git a/src/Bundle/ChillMainBundle/Tests/Cron/CronManagerTest.php b/src/Bundle/ChillMainBundle/Tests/Cron/CronManagerTest.php index cec60c7c9..417e1117b 100644 --- a/src/Bundle/ChillMainBundle/Tests/Cron/CronManagerTest.php +++ b/src/Bundle/ChillMainBundle/Tests/Cron/CronManagerTest.php @@ -161,7 +161,9 @@ final class CronManagerTest extends TestCase class JobCanRun implements CronJobInterface { - public function __construct(private readonly string $key) {} + public function __construct(private readonly string $key) + { + } public function canRun(?CronJobExecution $cronJobExecution): bool { @@ -173,7 +175,7 @@ class JobCanRun implements CronJobInterface return $this->key; } - public function run(array $lastExecutionData): null|array + public function run(array $lastExecutionData): array|null { return null; } @@ -191,7 +193,7 @@ class JobCannotRun implements CronJobInterface return 'job-b'; } - public function run(array $lastExecutionData): null|array + public function run(array $lastExecutionData): array|null { return null; } diff --git a/src/Bundle/ChillMainBundle/Tests/Export/ExportManagerTest.php b/src/Bundle/ChillMainBundle/Tests/Export/ExportManagerTest.php index b9e597ec0..8d71a132b 100644 --- a/src/Bundle/ChillMainBundle/Tests/Export/ExportManagerTest.php +++ b/src/Bundle/ChillMainBundle/Tests/Export/ExportManagerTest.php @@ -58,7 +58,7 @@ final class ExportManagerTest extends KernelTestCase { self::bootKernel(); - $this->prophet = new \Prophecy\Prophet(); + $this->prophet = new Prophet(); } protected function tearDown(): void @@ -370,7 +370,7 @@ final class ExportManagerTest extends KernelTestCase $user = $this->prepareUser([]); $authorizationChecker = $this->prophet->prophesize(); - $authorizationChecker->willImplement(\Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface::class); + $authorizationChecker->willImplement(AuthorizationCheckerInterface::class); $authorizationChecker->isGranted('CHILL_STAT_DUMMY', $center) ->willReturn(true); @@ -399,7 +399,7 @@ final class ExportManagerTest extends KernelTestCase $user = $this->prepareUser([]); $authorizationChecker = $this->prophet->prophesize(); - $authorizationChecker->willImplement(\Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface::class); + $authorizationChecker->willImplement(AuthorizationCheckerInterface::class); $authorizationChecker->isGranted('CHILL_STAT_DUMMY', $center) ->willReturn(true); $authorizationChecker->isGranted('CHILL_STAT_DUMMY', $centerB) @@ -435,7 +435,7 @@ final class ExportManagerTest extends KernelTestCase ); $export = $this->prophet->prophesize(); - $export->willImplement(\Chill\MainBundle\Export\ExportInterface::class); + $export->willImplement(ExportInterface::class); $export->requiredRole()->willReturn('CHILL_STAT_DUMMY'); $result = $exportManager->isGrantedForElement($export->reveal(), null, []); @@ -498,11 +498,11 @@ final class ExportManagerTest extends KernelTestCase * user 'center a_social' from database. */ protected function createExportManager( - LoggerInterface $logger = null, - EntityManagerInterface $em = null, - AuthorizationCheckerInterface $authorizationChecker = null, - AuthorizationHelper $authorizationHelper = null, - UserInterface $user = null, + ?LoggerInterface $logger = null, + ?EntityManagerInterface $em = null, + ?AuthorizationCheckerInterface $authorizationChecker = null, + ?AuthorizationHelper $authorizationHelper = null, + ?UserInterface $user = null, array $exports = [], array $aggregators = [], array $filters = [], @@ -532,14 +532,17 @@ class DummyFilterWithApplying implements FilterInterface public function __construct( private readonly ?string $role, private readonly string $applyOn - ) {} + ) { + } public function getTitle() { return 'dummy'; } - public function buildForm(FormBuilderInterface $builder) {} + public function buildForm(FormBuilderInterface $builder) + { + } public function getFormDefaultData(): array { @@ -556,7 +559,9 @@ class DummyFilterWithApplying implements FilterInterface return $this->role; } - public function alterQuery(QueryBuilder $qb, $data) {} + public function alterQuery(QueryBuilder $qb, $data) + { + } public function applyOn() { @@ -572,14 +577,17 @@ class DummyExport implements ExportInterface * @var array */ private readonly array $supportedModifiers, - ) {} + ) { + } public function getTitle() { return 'dummy'; } - public function buildForm(FormBuilderInterface $builder) {} + public function buildForm(FormBuilderInterface $builder) + { + } public function getFormDefaultData(): array { diff --git a/src/Bundle/ChillMainBundle/Tests/Export/SortExportElementTest.php b/src/Bundle/ChillMainBundle/Tests/Export/SortExportElementTest.php index e7dbaf8fb..a14747c68 100644 --- a/src/Bundle/ChillMainBundle/Tests/Export/SortExportElementTest.php +++ b/src/Bundle/ChillMainBundle/Tests/Export/SortExportElementTest.php @@ -102,7 +102,7 @@ class SortExportElementTest extends KernelTestCase private function makeTranslator(): TranslatorInterface { return new class () implements TranslatorInterface { - public function trans(string $id, array $parameters = [], string $domain = null, string $locale = null) + public function trans(string $id, array $parameters = [], ?string $domain = null, ?string $locale = null) { return $id; } @@ -117,9 +117,13 @@ class SortExportElementTest extends KernelTestCase private function makeAggregator(string $title): AggregatorInterface { return new class ($title) implements AggregatorInterface { - public function __construct(private readonly string $title) {} + public function __construct(private readonly string $title) + { + } - public function buildForm(FormBuilderInterface $builder) {} + public function buildForm(FormBuilderInterface $builder) + { + } public function getFormDefaultData(): array { @@ -146,7 +150,9 @@ class SortExportElementTest extends KernelTestCase return null; } - public function alterQuery(QueryBuilder $qb, $data) {} + public function alterQuery(QueryBuilder $qb, $data) + { + } public function applyOn() { @@ -158,14 +164,18 @@ class SortExportElementTest extends KernelTestCase private function makeFilter(string $title): FilterInterface { return new class ($title) implements FilterInterface { - public function __construct(private readonly string $title) {} + public function __construct(private readonly string $title) + { + } public function getTitle() { return $this->title; } - public function buildForm(FormBuilderInterface $builder) {} + public function buildForm(FormBuilderInterface $builder) + { + } public function getFormDefaultData(): array { @@ -182,7 +192,9 @@ class SortExportElementTest extends KernelTestCase return null; } - public function alterQuery(QueryBuilder $qb, $data) {} + public function alterQuery(QueryBuilder $qb, $data) + { + } public function applyOn() { diff --git a/src/Bundle/ChillMainBundle/Tests/Notification/Email/NotificationMailerTest.php b/src/Bundle/ChillMainBundle/Tests/Notification/Email/NotificationMailerTest.php index 2bd7708b8..fad4a89f5 100644 --- a/src/Bundle/ChillMainBundle/Tests/Notification/Email/NotificationMailerTest.php +++ b/src/Bundle/ChillMainBundle/Tests/Notification/Email/NotificationMailerTest.php @@ -113,7 +113,7 @@ class NotificationMailerTest extends TestCase } private function buildNotificationMailer( - MailerInterface $mailer = null, + ?MailerInterface $mailer = null, ): NotificationMailer { return new NotificationMailer( $mailer, diff --git a/src/Bundle/ChillMainBundle/Tests/Search/SearchProviderTest.php b/src/Bundle/ChillMainBundle/Tests/Search/SearchProviderTest.php index b8ce37fff..d1602f7e2 100644 --- a/src/Bundle/ChillMainBundle/Tests/Search/SearchProviderTest.php +++ b/src/Bundle/ChillMainBundle/Tests/Search/SearchProviderTest.php @@ -25,7 +25,7 @@ use PHPUnit\Framework\TestCase; */ final class SearchProviderTest extends TestCase { - private \Chill\MainBundle\Search\SearchProvider $search; + private SearchProvider $search; protected function setUp(): void { diff --git a/src/Bundle/ChillMainBundle/Tests/Security/Authorization/AuthorizationHelperTest.php b/src/Bundle/ChillMainBundle/Tests/Security/Authorization/AuthorizationHelperTest.php index e74888b83..d21c7d50a 100644 --- a/src/Bundle/ChillMainBundle/Tests/Security/Authorization/AuthorizationHelperTest.php +++ b/src/Bundle/ChillMainBundle/Tests/Security/Authorization/AuthorizationHelperTest.php @@ -258,8 +258,8 @@ final class AuthorizationHelperTest extends KernelTestCase ]); $helper = $this->getAuthorizationHelper(); $entity = $this->prophesize(); - $entity->willImplement('\\'.\Chill\MainBundle\Entity\HasCenterInterface::class); - $entity->willImplement('\\'.\Chill\MainBundle\Entity\HasScopeInterface::class); + $entity->willImplement('\\'.HasCenterInterface::class); + $entity->willImplement('\\'.HasScopeInterface::class); $entity->getCenter()->willReturn($center); $entity->getScope()->willReturn($scope); @@ -383,7 +383,7 @@ final class AuthorizationHelperTest extends KernelTestCase ]); $helper = $this->getAuthorizationHelper(); $entity = $this->prophesize(); - $entity->willImplement('\\'.\Chill\MainBundle\Entity\HasCenterInterface::class); + $entity->willImplement('\\'.HasCenterInterface::class); $entity->getCenter()->willReturn($center); $this->assertTrue($helper->userHasAccess( @@ -407,7 +407,7 @@ final class AuthorizationHelperTest extends KernelTestCase $helper = $this->getAuthorizationHelper(); $entity = $this->prophesize(); - $entity->willImplement('\\'.\Chill\MainBundle\Entity\HasCenterInterface::class); + $entity->willImplement('\\'.HasCenterInterface::class); $entity->getCenter()->willReturn($center); $this->assertTrue($helper->userHasAccess( @@ -431,8 +431,8 @@ final class AuthorizationHelperTest extends KernelTestCase ]); $helper = $this->getAuthorizationHelper(); $entity = $this->prophesize(); - $entity->willImplement('\\'.\Chill\MainBundle\Entity\HasCenterInterface::class); - $entity->willImplement('\\'.\Chill\MainBundle\Entity\HasScopeInterface::class); + $entity->willImplement('\\'.HasCenterInterface::class); + $entity->willImplement('\\'.HasScopeInterface::class); $entity->getCenter()->willReturn($centerB); $entity->getScope()->willReturn($scope); @@ -452,7 +452,7 @@ final class AuthorizationHelperTest extends KernelTestCase ]); $helper = $this->getAuthorizationHelper(); $entity = $this->prophesize(); - $entity->willImplement('\\'.\Chill\MainBundle\Entity\HasCenterInterface::class); + $entity->willImplement('\\'.HasCenterInterface::class); $entity->getCenter()->willReturn($center); $this->assertFalse($helper->userHasAccess($user, $entity->reveal(), 'CHILL_ROLE')); @@ -471,8 +471,8 @@ final class AuthorizationHelperTest extends KernelTestCase ]); $helper = $this->getAuthorizationHelper(); $entity = $this->prophesize(); - $entity->willImplement('\\'.\Chill\MainBundle\Entity\HasCenterInterface::class); - $entity->willImplement('\\'.\Chill\MainBundle\Entity\HasScopeInterface::class); + $entity->willImplement('\\'.HasCenterInterface::class); + $entity->willImplement('\\'.HasScopeInterface::class); $entity->getCenter()->willReturn($center); $entity->getScope()->willReturn($scope); @@ -503,7 +503,7 @@ final class AuthorizationHelperTest extends KernelTestCase ]); $helper = $this->getAuthorizationHelper(); $entity = $this->prophesize(); - $entity->willImplement('\\'.\Chill\MainBundle\Entity\HasCenterInterface::class); + $entity->willImplement('\\'.HasCenterInterface::class); $entity->getCenter()->willReturn($centerA); $this->assertFalse($helper->userHasAccess($user, $entity->reveal(), 'CHILL_ROLE')); @@ -577,7 +577,7 @@ final class AuthorizationHelperTest extends KernelTestCase } /** - * @return \Chill\MainBundle\Security\Authorization\AuthorizationHelper + * @return AuthorizationHelper */ private function getAuthorizationHelper() { diff --git a/src/Bundle/ChillMainBundle/Tests/Security/PasswordRecover/TokenManagerTest.php b/src/Bundle/ChillMainBundle/Tests/Security/PasswordRecover/TokenManagerTest.php index 78956a1d9..b2481917e 100644 --- a/src/Bundle/ChillMainBundle/Tests/Security/PasswordRecover/TokenManagerTest.php +++ b/src/Bundle/ChillMainBundle/Tests/Security/PasswordRecover/TokenManagerTest.php @@ -34,7 +34,9 @@ final class TokenManagerTest extends KernelTestCase $this->tokenManager = new TokenManager('secret', $logger); } - public static function setUpBefore() {} + public static function setUpBefore() + { + } public function testGenerate() { diff --git a/src/Bundle/ChillMainBundle/Tests/Security/Resolver/DefaultScopeResolverTest.php b/src/Bundle/ChillMainBundle/Tests/Security/Resolver/DefaultScopeResolverTest.php index 733e17fec..1ec23fdb3 100644 --- a/src/Bundle/ChillMainBundle/Tests/Security/Resolver/DefaultScopeResolverTest.php +++ b/src/Bundle/ChillMainBundle/Tests/Security/Resolver/DefaultScopeResolverTest.php @@ -35,7 +35,9 @@ final class DefaultScopeResolverTest extends TestCase { $scope = new Scope(); $entity = new class ($scope) implements HasScopeInterface { - public function __construct(private readonly Scope $scope) {} + public function __construct(private readonly Scope $scope) + { + } public function getScope() { @@ -51,7 +53,9 @@ final class DefaultScopeResolverTest extends TestCase public function testHasScopesInterface() { $entity = new class ($scopeA = new Scope(), $scopeB = new Scope()) implements HasScopesInterface { - public function __construct(private readonly Scope $scopeA, private readonly Scope $scopeB) {} + public function __construct(private readonly Scope $scopeA, private readonly Scope $scopeB) + { + } public function getScopes(): iterable { diff --git a/src/Bundle/ChillMainBundle/Tests/Security/Resolver/ScopeResolverDispatcherTest.php b/src/Bundle/ChillMainBundle/Tests/Security/Resolver/ScopeResolverDispatcherTest.php index 35245174c..dd4b7f121 100644 --- a/src/Bundle/ChillMainBundle/Tests/Security/Resolver/ScopeResolverDispatcherTest.php +++ b/src/Bundle/ChillMainBundle/Tests/Security/Resolver/ScopeResolverDispatcherTest.php @@ -36,7 +36,9 @@ final class ScopeResolverDispatcherTest extends TestCase { $scope = new Scope(); $entity = new class ($scope) implements HasScopeInterface { - public function __construct(private readonly Scope $scope) {} + public function __construct(private readonly Scope $scope) + { + } public function getScope() { diff --git a/src/Bundle/ChillMainBundle/Tests/Serializer/Normalizer/DateNormalizerTest.php b/src/Bundle/ChillMainBundle/Tests/Serializer/Normalizer/DateNormalizerTest.php index c820b615d..8d80490c1 100644 --- a/src/Bundle/ChillMainBundle/Tests/Serializer/Normalizer/DateNormalizerTest.php +++ b/src/Bundle/ChillMainBundle/Tests/Serializer/Normalizer/DateNormalizerTest.php @@ -84,7 +84,7 @@ final class DateNormalizerTest extends KernelTestCase $this->assertFalse($this->buildDateNormalizer()->supportsNormalization(new \DateTime(), 'xml')); } - private function buildDateNormalizer(string $locale = null): DateNormalizer + private function buildDateNormalizer(?string $locale = null): DateNormalizer { $requestStack = $this->prophet->prophesize(RequestStack::class); $parameterBag = new ParameterBag(); diff --git a/src/Bundle/ChillMainBundle/Tests/Serializer/Normalizer/PhonenumberNormalizerTest.php b/src/Bundle/ChillMainBundle/Tests/Serializer/Normalizer/PhonenumberNormalizerTest.php index eda761dc1..583dfc4cc 100644 --- a/src/Bundle/ChillMainBundle/Tests/Serializer/Normalizer/PhonenumberNormalizerTest.php +++ b/src/Bundle/ChillMainBundle/Tests/Serializer/Normalizer/PhonenumberNormalizerTest.php @@ -40,7 +40,7 @@ final class PhonenumberNormalizerTest extends TestCase /** * @dataProvider dataProviderNormalizePhonenumber */ - public function testNormalize(?Phonenumber $phonenumber, mixed $format, mixed $context, mixed $expected) + public function testNormalize(?PhoneNumber $phonenumber, mixed $format, mixed $context, mixed $expected) { $parameterBag = $this->prophesize(ParameterBagInterface::class); $parameterBag->get(Argument::exact('chill_main'))->willReturn(['phone_helper' => ['default_carrier_code' => 'BE']]); diff --git a/src/Bundle/ChillMainBundle/Tests/Serializer/Normalizer/UserNormalizerTest.php b/src/Bundle/ChillMainBundle/Tests/Serializer/Normalizer/UserNormalizerTest.php index 123f1c3ae..15334298e 100644 --- a/src/Bundle/ChillMainBundle/Tests/Serializer/Normalizer/UserNormalizerTest.php +++ b/src/Bundle/ChillMainBundle/Tests/Serializer/Normalizer/UserNormalizerTest.php @@ -117,19 +117,19 @@ final class UserNormalizerTest extends TestCase * * @throws ExceptionInterface */ - public function testNormalize(null|User $user, mixed $format, mixed $context, mixed $expected) + public function testNormalize(User|null $user, mixed $format, mixed $context, mixed $expected) { $userRender = $this->prophesize(UserRender::class); $userRender->renderString(Argument::type(User::class), Argument::type('array'))->willReturn($user ? $user->getLabel() : ''); $normalizer = new UserNormalizer($userRender->reveal()); $normalizer->setNormalizer(new class () implements NormalizerInterface { - public function normalize($object, string $format = null, array $context = []) + public function normalize($object, ?string $format = null, array $context = []) { return ['context' => $context['docgen:expects'] ?? null]; } - public function supportsNormalization($data, string $format = null) + public function supportsNormalization($data, ?string $format = null) { return true; } diff --git a/src/Bundle/ChillMainBundle/Tests/Templating/Entity/UserRenderTest.php b/src/Bundle/ChillMainBundle/Tests/Templating/Entity/UserRenderTest.php index 574d272e1..ef08348b4 100644 --- a/src/Bundle/ChillMainBundle/Tests/Templating/Entity/UserRenderTest.php +++ b/src/Bundle/ChillMainBundle/Tests/Templating/Entity/UserRenderTest.php @@ -1,20 +1,32 @@ assertEquals($expectedStringC, $renderer->renderString($user, $optionsNoDate)); } - } diff --git a/src/Bundle/ChillMainBundle/Timeline/TimelineBuilder.php b/src/Bundle/ChillMainBundle/Timeline/TimelineBuilder.php index 53d8faa16..6b4253104 100644 --- a/src/Bundle/ChillMainBundle/Timeline/TimelineBuilder.php +++ b/src/Bundle/ChillMainBundle/Timeline/TimelineBuilder.php @@ -37,7 +37,9 @@ class TimelineBuilder */ private array $providersByContext = []; - public function __construct(private readonly EntityManagerInterface $em, private readonly Environment $twig) {} + public function __construct(private readonly EntityManagerInterface $em, private readonly Environment $twig) + { + } /** * add a provider id. diff --git a/src/Bundle/ChillMainBundle/Timeline/TimelineSingleQuery.php b/src/Bundle/ChillMainBundle/Timeline/TimelineSingleQuery.php index 584e634ea..e736ba749 100644 --- a/src/Bundle/ChillMainBundle/Timeline/TimelineSingleQuery.php +++ b/src/Bundle/ChillMainBundle/Timeline/TimelineSingleQuery.php @@ -15,7 +15,9 @@ class TimelineSingleQuery { private bool $distinct = false; - public function __construct(private ?string $id = null, private ?string $date = null, private ?string $key = null, private ?string $from = null, private ?string $where = null, private array $parameters = []) {} + public function __construct(private ?string $id = null, private ?string $date = null, private ?string $key = null, private ?string $from = null, private ?string $where = null, private array $parameters = []) + { + } public function buildSql(): string { diff --git a/src/Bundle/ChillMainBundle/Util/DateRangeCovering.php b/src/Bundle/ChillMainBundle/Util/DateRangeCovering.php index 821c66e4e..b91d7627a 100644 --- a/src/Bundle/ChillMainBundle/Util/DateRangeCovering.php +++ b/src/Bundle/ChillMainBundle/Util/DateRangeCovering.php @@ -66,7 +66,7 @@ class DateRangeCovering $this->minCover = $minCover; } - public function add(\DateTimeInterface $start, \DateTimeInterface $end = null, $metadata = null): self + public function add(\DateTimeInterface $start, ?\DateTimeInterface $end = null, $metadata = null): self { if ($this->computed) { throw new \LogicException('You cannot add intervals to a computed instance'); @@ -152,7 +152,7 @@ class DateRangeCovering return \count($this->intersections) > 0; } - private function addToSequence($timestamp, int $start = null, int $end = null) + private function addToSequence($timestamp, ?int $start = null, ?int $end = null) { if (!\array_key_exists($timestamp, $this->sequence)) { $this->sequence[$timestamp] = ['s' => [], 'e' => []]; diff --git a/src/Bundle/ChillMainBundle/Validation/Validator/RoleScopeScopePresence.php b/src/Bundle/ChillMainBundle/Validation/Validator/RoleScopeScopePresence.php index 0bbf1d373..8980b8376 100644 --- a/src/Bundle/ChillMainBundle/Validation/Validator/RoleScopeScopePresence.php +++ b/src/Bundle/ChillMainBundle/Validation/Validator/RoleScopeScopePresence.php @@ -21,7 +21,9 @@ use Symfony\Contracts\Translation\TranslatorInterface; class RoleScopeScopePresence extends ConstraintValidator { - public function __construct(private readonly RoleProvider $roleProvider, private readonly LoggerInterface $logger, private readonly TranslatorInterface $translator) {} + public function __construct(private readonly RoleProvider $roleProvider, private readonly LoggerInterface $logger, private readonly TranslatorInterface $translator) + { + } public function validate($value, Constraint $constraint) { diff --git a/src/Bundle/ChillMainBundle/Validation/Validator/ValidPhonenumber.php b/src/Bundle/ChillMainBundle/Validation/Validator/ValidPhonenumber.php index 0c02885ad..f0fd1880c 100644 --- a/src/Bundle/ChillMainBundle/Validation/Validator/ValidPhonenumber.php +++ b/src/Bundle/ChillMainBundle/Validation/Validator/ValidPhonenumber.php @@ -18,7 +18,9 @@ use Symfony\Component\Validator\ConstraintValidator; final class ValidPhonenumber extends ConstraintValidator { - public function __construct(private readonly LoggerInterface $logger, private readonly PhoneNumberHelperInterface $phonenumberHelper) {} + public function __construct(private readonly LoggerInterface $logger, private readonly PhoneNumberHelperInterface $phonenumberHelper) + { + } /** * @param string $value diff --git a/src/Bundle/ChillMainBundle/Workflow/Counter/WorkflowByUserCounter.php b/src/Bundle/ChillMainBundle/Workflow/Counter/WorkflowByUserCounter.php index a1b631265..3ea5d495b 100644 --- a/src/Bundle/ChillMainBundle/Workflow/Counter/WorkflowByUserCounter.php +++ b/src/Bundle/ChillMainBundle/Workflow/Counter/WorkflowByUserCounter.php @@ -22,7 +22,9 @@ use Symfony\Component\Workflow\Event\Event; final readonly class WorkflowByUserCounter implements NotificationCounterInterface, EventSubscriberInterface { - public function __construct(private EntityWorkflowStepRepository $workflowStepRepository, private CacheItemPoolInterface $cacheItemPool) {} + public function __construct(private EntityWorkflowStepRepository $workflowStepRepository, private CacheItemPoolInterface $cacheItemPool) + { + } public function addNotification(UserInterface $u): int { diff --git a/src/Bundle/ChillMainBundle/Workflow/EntityWorkflowManager.php b/src/Bundle/ChillMainBundle/Workflow/EntityWorkflowManager.php index 9a1f52280..6c45cef3d 100644 --- a/src/Bundle/ChillMainBundle/Workflow/EntityWorkflowManager.php +++ b/src/Bundle/ChillMainBundle/Workflow/EntityWorkflowManager.php @@ -20,7 +20,9 @@ class EntityWorkflowManager /** * @param \Chill\MainBundle\Workflow\EntityWorkflowHandlerInterface[] $handlers */ - public function __construct(private readonly iterable $handlers, private readonly Registry $registry) {} + public function __construct(private readonly iterable $handlers, private readonly Registry $registry) + { + } public function getHandler(EntityWorkflow $entityWorkflow, array $options = []): EntityWorkflowHandlerInterface { diff --git a/src/Bundle/ChillMainBundle/Workflow/EventSubscriber/EntityWorkflowTransitionEventSubscriber.php b/src/Bundle/ChillMainBundle/Workflow/EventSubscriber/EntityWorkflowTransitionEventSubscriber.php index b1fa80458..804a6587f 100644 --- a/src/Bundle/ChillMainBundle/Workflow/EventSubscriber/EntityWorkflowTransitionEventSubscriber.php +++ b/src/Bundle/ChillMainBundle/Workflow/EventSubscriber/EntityWorkflowTransitionEventSubscriber.php @@ -23,7 +23,9 @@ use Symfony\Component\Workflow\TransitionBlocker; class EntityWorkflowTransitionEventSubscriber implements EventSubscriberInterface { - public function __construct(private readonly LoggerInterface $chillLogger, private readonly Security $security, private readonly UserRender $userRender) {} + public function __construct(private readonly LoggerInterface $chillLogger, private readonly Security $security, private readonly UserRender $userRender) + { + } public function addDests(Event $event): void { diff --git a/src/Bundle/ChillMainBundle/Workflow/EventSubscriber/NotificationOnTransition.php b/src/Bundle/ChillMainBundle/Workflow/EventSubscriber/NotificationOnTransition.php index e290a567e..07cf8cc14 100644 --- a/src/Bundle/ChillMainBundle/Workflow/EventSubscriber/NotificationOnTransition.php +++ b/src/Bundle/ChillMainBundle/Workflow/EventSubscriber/NotificationOnTransition.php @@ -23,7 +23,9 @@ use Symfony\Component\Workflow\Registry; class NotificationOnTransition implements EventSubscriberInterface { - public function __construct(private readonly EntityManagerInterface $entityManager, private readonly \Twig\Environment $engine, private readonly MetadataExtractor $metadataExtractor, private readonly Security $security, private readonly Registry $registry) {} + public function __construct(private readonly EntityManagerInterface $entityManager, private readonly \Twig\Environment $engine, private readonly MetadataExtractor $metadataExtractor, private readonly Security $security, private readonly Registry $registry) + { + } public static function getSubscribedEvents(): array { diff --git a/src/Bundle/ChillMainBundle/Workflow/EventSubscriber/SendAccessKeyEventSubscriber.php b/src/Bundle/ChillMainBundle/Workflow/EventSubscriber/SendAccessKeyEventSubscriber.php index 90a6e19db..bd07a5a28 100644 --- a/src/Bundle/ChillMainBundle/Workflow/EventSubscriber/SendAccessKeyEventSubscriber.php +++ b/src/Bundle/ChillMainBundle/Workflow/EventSubscriber/SendAccessKeyEventSubscriber.php @@ -20,7 +20,9 @@ use Symfony\Component\Workflow\Registry; class SendAccessKeyEventSubscriber { - public function __construct(private readonly \Twig\Environment $engine, private readonly MetadataExtractor $metadataExtractor, private readonly Registry $registry, private readonly EntityWorkflowManager $entityWorkflowManager, private readonly MailerInterface $mailer) {} + public function __construct(private readonly \Twig\Environment $engine, private readonly MetadataExtractor $metadataExtractor, private readonly Registry $registry, private readonly EntityWorkflowManager $entityWorkflowManager, private readonly MailerInterface $mailer) + { + } public function postPersist(EntityWorkflowStep $step): void { diff --git a/src/Bundle/ChillMainBundle/Workflow/Exception/HandlerNotFoundException.php b/src/Bundle/ChillMainBundle/Workflow/Exception/HandlerNotFoundException.php index 9d91b3357..f4280b50f 100644 --- a/src/Bundle/ChillMainBundle/Workflow/Exception/HandlerNotFoundException.php +++ b/src/Bundle/ChillMainBundle/Workflow/Exception/HandlerNotFoundException.php @@ -11,4 +11,6 @@ declare(strict_types=1); namespace Chill\MainBundle\Workflow\Exception; -class HandlerNotFoundException extends \RuntimeException {} +class HandlerNotFoundException extends \RuntimeException +{ +} diff --git a/src/Bundle/ChillMainBundle/Workflow/Helper/MetadataExtractor.php b/src/Bundle/ChillMainBundle/Workflow/Helper/MetadataExtractor.php index dabe0cf8e..8f0caa62e 100644 --- a/src/Bundle/ChillMainBundle/Workflow/Helper/MetadataExtractor.php +++ b/src/Bundle/ChillMainBundle/Workflow/Helper/MetadataExtractor.php @@ -19,7 +19,9 @@ use Symfony\Component\Workflow\WorkflowInterface; class MetadataExtractor { - public function __construct(private readonly Registry $registry, private readonly TranslatableStringHelperInterface $translatableStringHelper) {} + public function __construct(private readonly Registry $registry, private readonly TranslatableStringHelperInterface $translatableStringHelper) + { + } public function availableWorkflowFor(string $relatedEntityClass, ?int $relatedEntityId = 0): array { @@ -43,7 +45,7 @@ class MetadataExtractor return $workflowsList; } - public function buildArrayPresentationForPlace(EntityWorkflow $entityWorkflow, EntityWorkflowStep $step = null): array + public function buildArrayPresentationForPlace(EntityWorkflow $entityWorkflow, ?EntityWorkflowStep $step = null): array { $workflow = $this->registry->get($entityWorkflow, $entityWorkflow->getWorkflowName()); $step ??= $entityWorkflow->getCurrentStep(); diff --git a/src/Bundle/ChillMainBundle/Workflow/Notification/WorkflowNotificationHandler.php b/src/Bundle/ChillMainBundle/Workflow/Notification/WorkflowNotificationHandler.php index c9ba7cf79..9302cf7f9 100644 --- a/src/Bundle/ChillMainBundle/Workflow/Notification/WorkflowNotificationHandler.php +++ b/src/Bundle/ChillMainBundle/Workflow/Notification/WorkflowNotificationHandler.php @@ -20,7 +20,9 @@ use Symfony\Component\Security\Core\Security; class WorkflowNotificationHandler implements NotificationHandlerInterface { - public function __construct(private readonly EntityWorkflowRepository $entityWorkflowRepository, private readonly EntityWorkflowManager $entityWorkflowManager, private readonly Security $security) {} + public function __construct(private readonly EntityWorkflowRepository $entityWorkflowRepository, private readonly EntityWorkflowManager $entityWorkflowManager, private readonly Security $security) + { + } public function getTemplate(Notification $notification, array $options = []): string { diff --git a/src/Bundle/ChillMainBundle/Workflow/Templating/WorkflowTwigExtensionRuntime.php b/src/Bundle/ChillMainBundle/Workflow/Templating/WorkflowTwigExtensionRuntime.php index f2b7d80db..e9edb11d9 100644 --- a/src/Bundle/ChillMainBundle/Workflow/Templating/WorkflowTwigExtensionRuntime.php +++ b/src/Bundle/ChillMainBundle/Workflow/Templating/WorkflowTwigExtensionRuntime.php @@ -23,7 +23,9 @@ use Twig\Extension\RuntimeExtensionInterface; class WorkflowTwigExtensionRuntime implements RuntimeExtensionInterface { - public function __construct(private readonly EntityWorkflowManager $entityWorkflowManager, private readonly Registry $registry, private readonly EntityWorkflowRepository $repository, private readonly MetadataExtractor $metadataExtractor, private readonly NormalizerInterface $normalizer) {} + public function __construct(private readonly EntityWorkflowManager $entityWorkflowManager, private readonly Registry $registry, private readonly EntityWorkflowRepository $repository, private readonly MetadataExtractor $metadataExtractor, private readonly NormalizerInterface $normalizer) + { + } public function getTransitionByString(EntityWorkflow $entityWorkflow, string $key): ?Transition { diff --git a/src/Bundle/ChillMainBundle/Workflow/Validator/EntityWorkflowCreationValidator.php b/src/Bundle/ChillMainBundle/Workflow/Validator/EntityWorkflowCreationValidator.php index 2020c7b52..f6590c9d3 100644 --- a/src/Bundle/ChillMainBundle/Workflow/Validator/EntityWorkflowCreationValidator.php +++ b/src/Bundle/ChillMainBundle/Workflow/Validator/EntityWorkflowCreationValidator.php @@ -21,7 +21,9 @@ use Symfony\Component\Workflow\WorkflowInterface; class EntityWorkflowCreationValidator extends \Symfony\Component\Validator\ConstraintValidator { - public function __construct(private readonly EntityWorkflowManager $entityWorkflowManager) {} + public function __construct(private readonly EntityWorkflowManager $entityWorkflowManager) + { + } /** * @param EntityWorkflow $value diff --git a/src/Bundle/ChillMainBundle/migrations/Version20100000000000.php b/src/Bundle/ChillMainBundle/migrations/Version20100000000000.php index 55f5a6420..5ae675b51 100644 --- a/src/Bundle/ChillMainBundle/migrations/Version20100000000000.php +++ b/src/Bundle/ChillMainBundle/migrations/Version20100000000000.php @@ -16,7 +16,9 @@ use Doctrine\Migrations\AbstractMigration; class Version20100000000000 extends AbstractMigration { - public function down(Schema $schema): void {} + public function down(Schema $schema): void + { + } public function up(Schema $schema): void { diff --git a/src/Bundle/ChillMainBundle/migrations/Version20220513151853.php b/src/Bundle/ChillMainBundle/migrations/Version20220513151853.php index 4bd9bd18f..c46b40ee5 100644 --- a/src/Bundle/ChillMainBundle/migrations/Version20220513151853.php +++ b/src/Bundle/ChillMainBundle/migrations/Version20220513151853.php @@ -16,7 +16,9 @@ use Doctrine\Migrations\AbstractMigration; final class Version20220513151853 extends AbstractMigration { - public function down(Schema $schema): void {} + public function down(Schema $schema): void + { + } public function getDescription(): string { diff --git a/src/Bundle/ChillPersonBundle/AccompanyingPeriod/Events/PersonAddressMoveEventSubscriber.php b/src/Bundle/ChillPersonBundle/AccompanyingPeriod/Events/PersonAddressMoveEventSubscriber.php index 64d2b8f12..f65533958 100644 --- a/src/Bundle/ChillPersonBundle/AccompanyingPeriod/Events/PersonAddressMoveEventSubscriber.php +++ b/src/Bundle/ChillPersonBundle/AccompanyingPeriod/Events/PersonAddressMoveEventSubscriber.php @@ -22,7 +22,9 @@ use Symfony\Contracts\Translation\TranslatorInterface; class PersonAddressMoveEventSubscriber implements EventSubscriberInterface { - public function __construct(private readonly \Twig\Environment $engine, private readonly NotificationPersisterInterface $notificationPersister, private readonly Security $security, private readonly TranslatorInterface $translator) {} + public function __construct(private readonly \Twig\Environment $engine, private readonly NotificationPersisterInterface $notificationPersister, private readonly Security $security, private readonly TranslatorInterface $translator) + { + } public static function getSubscribedEvents(): array { diff --git a/src/Bundle/ChillPersonBundle/AccompanyingPeriod/Events/UserRefEventSubscriber.php b/src/Bundle/ChillPersonBundle/AccompanyingPeriod/Events/UserRefEventSubscriber.php index 084fe8ff5..297da8673 100644 --- a/src/Bundle/ChillPersonBundle/AccompanyingPeriod/Events/UserRefEventSubscriber.php +++ b/src/Bundle/ChillPersonBundle/AccompanyingPeriod/Events/UserRefEventSubscriber.php @@ -23,7 +23,9 @@ use Symfony\Contracts\Translation\TranslatorInterface; class UserRefEventSubscriber implements EventSubscriberInterface { - public function __construct(private readonly Security $security, private readonly TranslatorInterface $translator, private readonly \Twig\Environment $engine, private readonly NotificationPersisterInterface $notificationPersister) {} + public function __construct(private readonly Security $security, private readonly TranslatorInterface $translator, private readonly \Twig\Environment $engine, private readonly NotificationPersisterInterface $notificationPersister) + { + } public static function getSubscribedEvents() { diff --git a/src/Bundle/ChillPersonBundle/AccompanyingPeriod/Lifecycle/AccompanyingPeriodStepChangeCronjob.php b/src/Bundle/ChillPersonBundle/AccompanyingPeriod/Lifecycle/AccompanyingPeriodStepChangeCronjob.php index 0d362c581..33d88e7de 100644 --- a/src/Bundle/ChillPersonBundle/AccompanyingPeriod/Lifecycle/AccompanyingPeriodStepChangeCronjob.php +++ b/src/Bundle/ChillPersonBundle/AccompanyingPeriod/Lifecycle/AccompanyingPeriodStepChangeCronjob.php @@ -20,7 +20,8 @@ readonly class AccompanyingPeriodStepChangeCronjob implements CronJobInterface public function __construct( private ClockInterface $clock, private AccompanyingPeriodStepChangeRequestor $requestor, - ) {} + ) { + } public function canRun(?CronJobExecution $cronJobExecution): bool { @@ -38,7 +39,7 @@ readonly class AccompanyingPeriodStepChangeCronjob implements CronJobInterface return 'accompanying-period-step-change'; } - public function run(array $lastExecutionData): null|array + public function run(array $lastExecutionData): array|null { ($this->requestor)(); diff --git a/src/Bundle/ChillPersonBundle/AccompanyingPeriod/Lifecycle/AccompanyingPeriodStepChangeMessageHandler.php b/src/Bundle/ChillPersonBundle/AccompanyingPeriod/Lifecycle/AccompanyingPeriodStepChangeMessageHandler.php index 534672efc..71d28c57f 100644 --- a/src/Bundle/ChillPersonBundle/AccompanyingPeriod/Lifecycle/AccompanyingPeriodStepChangeMessageHandler.php +++ b/src/Bundle/ChillPersonBundle/AccompanyingPeriod/Lifecycle/AccompanyingPeriodStepChangeMessageHandler.php @@ -23,7 +23,8 @@ class AccompanyingPeriodStepChangeMessageHandler implements MessageHandlerInterf public function __construct( private readonly AccompanyingPeriodRepository $accompanyingPeriodRepository, private readonly AccompanyingPeriodStepChanger $changer, - ) {} + ) { + } public function __invoke(AccompanyingPeriodStepChangeRequestMessage $message): void { diff --git a/src/Bundle/ChillPersonBundle/AccompanyingPeriod/Lifecycle/AccompanyingPeriodStepChanger.php b/src/Bundle/ChillPersonBundle/AccompanyingPeriod/Lifecycle/AccompanyingPeriodStepChanger.php index 25a739ce0..7e9f87939 100644 --- a/src/Bundle/ChillPersonBundle/AccompanyingPeriod/Lifecycle/AccompanyingPeriodStepChanger.php +++ b/src/Bundle/ChillPersonBundle/AccompanyingPeriod/Lifecycle/AccompanyingPeriodStepChanger.php @@ -30,9 +30,10 @@ class AccompanyingPeriodStepChanger private readonly EntityManagerInterface $entityManager, private readonly LoggerInterface $logger, private readonly Registry $workflowRegistry, - ) {} + ) { + } - public function __invoke(AccompanyingPeriod $period, string $transition, string $workflowName = null): void + public function __invoke(AccompanyingPeriod $period, string $transition, ?string $workflowName = null): void { $workflow = $this->workflowRegistry->get($period, $workflowName); diff --git a/src/Bundle/ChillPersonBundle/Actions/ActionEvent.php b/src/Bundle/ChillPersonBundle/Actions/ActionEvent.php index ac3363db0..465807ebd 100644 --- a/src/Bundle/ChillPersonBundle/Actions/ActionEvent.php +++ b/src/Bundle/ChillPersonBundle/Actions/ActionEvent.php @@ -52,7 +52,8 @@ class ActionEvent extends \Symfony\Contracts\EventDispatcher\Event * an array of key value data to describe the movement. */ protected $metadata = [] - ) {} + ) { + } /** * Add Sql which will be executed **after** the delete statement. diff --git a/src/Bundle/ChillPersonBundle/Actions/Remove/Handler/PersonMoveCenterHistoryHandler.php b/src/Bundle/ChillPersonBundle/Actions/Remove/Handler/PersonMoveCenterHistoryHandler.php index f08bd7dff..b2deb17ca 100644 --- a/src/Bundle/ChillPersonBundle/Actions/Remove/Handler/PersonMoveCenterHistoryHandler.php +++ b/src/Bundle/ChillPersonBundle/Actions/Remove/Handler/PersonMoveCenterHistoryHandler.php @@ -19,7 +19,8 @@ class PersonMoveCenterHistoryHandler implements PersonMoveSqlHandlerInterface { public function __construct( private readonly PersonCenterHistoryRepository $centerHistoryRepository, - ) {} + ) { + } public function supports(string $className, string $field): bool { diff --git a/src/Bundle/ChillPersonBundle/Actions/Remove/PersonMove.php b/src/Bundle/ChillPersonBundle/Actions/Remove/PersonMove.php index 292c805a0..48fa57b85 100644 --- a/src/Bundle/ChillPersonBundle/Actions/Remove/PersonMove.php +++ b/src/Bundle/ChillPersonBundle/Actions/Remove/PersonMove.php @@ -33,7 +33,8 @@ class PersonMove private readonly EntityManagerInterface $em, private readonly PersonMoveManager $personMoveManager, private readonly EventDispatcherInterface $eventDispatcher - ) {} + ) { + } /** * Return the sql used to move or delete entities associated to a person to diff --git a/src/Bundle/ChillPersonBundle/Actions/Remove/PersonMoveManager.php b/src/Bundle/ChillPersonBundle/Actions/Remove/PersonMoveManager.php index 0c9230d90..230c2d4e2 100644 --- a/src/Bundle/ChillPersonBundle/Actions/Remove/PersonMoveManager.php +++ b/src/Bundle/ChillPersonBundle/Actions/Remove/PersonMoveManager.php @@ -20,7 +20,8 @@ class PersonMoveManager * @var iterable */ private readonly iterable $handlers, - ) {} + ) { + } /** * @param class-string $className diff --git a/src/Bundle/ChillPersonBundle/Config/ConfigPersonAltNamesHelper.php b/src/Bundle/ChillPersonBundle/Config/ConfigPersonAltNamesHelper.php index 3f233c174..d91c38f78 100644 --- a/src/Bundle/ChillPersonBundle/Config/ConfigPersonAltNamesHelper.php +++ b/src/Bundle/ChillPersonBundle/Config/ConfigPersonAltNamesHelper.php @@ -24,7 +24,8 @@ class ConfigPersonAltNamesHelper * the raw config, directly from the container parameter. */ private $config - ) {} + ) { + } /** * get the choices as key => values. diff --git a/src/Bundle/ChillPersonBundle/Controller/AccompanyingCourseApiController.php b/src/Bundle/ChillPersonBundle/Controller/AccompanyingCourseApiController.php index 7819ebb46..8efe73d92 100644 --- a/src/Bundle/ChillPersonBundle/Controller/AccompanyingCourseApiController.php +++ b/src/Bundle/ChillPersonBundle/Controller/AccompanyingCourseApiController.php @@ -46,7 +46,9 @@ use Symfony\Component\Workflow\Registry; final class AccompanyingCourseApiController extends ApiController { - public function __construct(private readonly AccompanyingPeriodRepository $accompanyingPeriodRepository, private readonly AccompanyingPeriodACLAwareRepository $accompanyingPeriodACLAwareRepository, private readonly EventDispatcherInterface $eventDispatcher, private readonly ReferralsSuggestionInterface $referralAvailable, private readonly Registry $registry, private readonly ValidatorInterface $validator) {} + public function __construct(private readonly AccompanyingPeriodRepository $accompanyingPeriodRepository, private readonly AccompanyingPeriodACLAwareRepository $accompanyingPeriodACLAwareRepository, private readonly EventDispatcherInterface $eventDispatcher, private readonly ReferralsSuggestionInterface $referralAvailable, private readonly Registry $registry, private readonly ValidatorInterface $validator) + { + } public function commentApi($id, Request $request, string $_format): Response { diff --git a/src/Bundle/ChillPersonBundle/Controller/AccompanyingCourseCommentController.php b/src/Bundle/ChillPersonBundle/Controller/AccompanyingCourseCommentController.php index 895011085..48e0e2cfa 100644 --- a/src/Bundle/ChillPersonBundle/Controller/AccompanyingCourseCommentController.php +++ b/src/Bundle/ChillPersonBundle/Controller/AccompanyingCourseCommentController.php @@ -30,7 +30,9 @@ use Symfony\Contracts\Translation\TranslatorInterface; class AccompanyingCourseCommentController extends AbstractController { - public function __construct(private readonly EntityManagerInterface $entityManager, private readonly FormFactoryInterface $formFactory, private readonly TranslatorInterface $translator) {} + public function __construct(private readonly EntityManagerInterface $entityManager, private readonly FormFactoryInterface $formFactory, private readonly TranslatorInterface $translator) + { + } /** * Page of comments in Accompanying Course section. diff --git a/src/Bundle/ChillPersonBundle/Controller/AccompanyingCourseController.php b/src/Bundle/ChillPersonBundle/Controller/AccompanyingCourseController.php index af4da0bae..a2ced7fee 100644 --- a/src/Bundle/ChillPersonBundle/Controller/AccompanyingCourseController.php +++ b/src/Bundle/ChillPersonBundle/Controller/AccompanyingCourseController.php @@ -37,7 +37,9 @@ use Symfony\Contracts\Translation\TranslatorInterface; */ class AccompanyingCourseController extends \Symfony\Bundle\FrameworkBundle\Controller\AbstractController { - public function __construct(protected SerializerInterface $serializer, protected EventDispatcherInterface $dispatcher, protected ValidatorInterface $validator, private readonly AccompanyingPeriodWorkRepository $workRepository, private readonly Registry $registry, private readonly TranslatorInterface $translator) {} + public function __construct(protected SerializerInterface $serializer, protected EventDispatcherInterface $dispatcher, protected ValidatorInterface $validator, private readonly AccompanyingPeriodWorkRepository $workRepository, private readonly Registry $registry, private readonly TranslatorInterface $translator) + { + } /** * @Route("/{_locale}/parcours/{accompanying_period_id}/close", name="chill_person_accompanying_course_close") diff --git a/src/Bundle/ChillPersonBundle/Controller/AccompanyingCourseWorkApiController.php b/src/Bundle/ChillPersonBundle/Controller/AccompanyingCourseWorkApiController.php index 2a9e4e9da..47e46cb6b 100644 --- a/src/Bundle/ChillPersonBundle/Controller/AccompanyingCourseWorkApiController.php +++ b/src/Bundle/ChillPersonBundle/Controller/AccompanyingCourseWorkApiController.php @@ -21,7 +21,9 @@ use Symfony\Component\Routing\Annotation\Route; class AccompanyingCourseWorkApiController extends ApiController { - public function __construct(private readonly AccompanyingPeriodWorkRepository $accompanyingPeriodWorkRepository) {} + public function __construct(private readonly AccompanyingPeriodWorkRepository $accompanyingPeriodWorkRepository) + { + } /** * @Route("/api/1.0/person/accompanying-period/work/my-near-end") diff --git a/src/Bundle/ChillPersonBundle/Controller/AccompanyingCourseWorkController.php b/src/Bundle/ChillPersonBundle/Controller/AccompanyingCourseWorkController.php index 89ec1ae17..5ae2db0e3 100644 --- a/src/Bundle/ChillPersonBundle/Controller/AccompanyingCourseWorkController.php +++ b/src/Bundle/ChillPersonBundle/Controller/AccompanyingCourseWorkController.php @@ -41,7 +41,8 @@ final class AccompanyingCourseWorkController extends AbstractController private readonly LoggerInterface $chillLogger, private readonly TranslatableStringHelperInterface $translatableStringHelper, private readonly FilterOrderHelperFactoryInterface $filterOrderHelperFactory - ) {} + ) { + } /** * @Route( @@ -223,7 +224,7 @@ final class AccompanyingCourseWorkController extends AbstractController if (1 < count($types)) { $filterBuilder - ->addEntityChoice('typesFilter', 'accompanying_course_work.types_filter', \Chill\PersonBundle\Entity\SocialWork\SocialAction::class, $types, [ + ->addEntityChoice('typesFilter', 'accompanying_course_work.types_filter', SocialAction::class, $types, [ 'choice_label' => fn (SocialAction $sa) => $this->translatableStringHelper->localize($sa->getTitle()), ]); } diff --git a/src/Bundle/ChillPersonBundle/Controller/AccompanyingCourseWorkEvaluationDocumentController.php b/src/Bundle/ChillPersonBundle/Controller/AccompanyingCourseWorkEvaluationDocumentController.php index 21378b9d7..5855692f1 100644 --- a/src/Bundle/ChillPersonBundle/Controller/AccompanyingCourseWorkEvaluationDocumentController.php +++ b/src/Bundle/ChillPersonBundle/Controller/AccompanyingCourseWorkEvaluationDocumentController.php @@ -20,7 +20,9 @@ use Symfony\Component\Security\Core\Security; class AccompanyingCourseWorkEvaluationDocumentController extends AbstractController { - public function __construct(private readonly Security $security) {} + public function __construct(private readonly Security $security) + { + } /** * @Route( diff --git a/src/Bundle/ChillPersonBundle/Controller/AccompanyingPeriodController.php b/src/Bundle/ChillPersonBundle/Controller/AccompanyingPeriodController.php index 55b985b85..e515dc57e 100644 --- a/src/Bundle/ChillPersonBundle/Controller/AccompanyingPeriodController.php +++ b/src/Bundle/ChillPersonBundle/Controller/AccompanyingPeriodController.php @@ -39,7 +39,8 @@ class AccompanyingPeriodController extends AbstractController private readonly EventDispatcherInterface $eventDispatcher, private readonly ValidatorInterface $validator, private readonly TranslatorInterface $translator - ) {} + ) { + } /** * @throws \Exception @@ -431,7 +432,7 @@ class AccompanyingPeriodController extends AbstractController private function _getPerson(int $id): Person { $person = $this->getDoctrine()->getManager() - ->getRepository(\Chill\PersonBundle\Entity\Person::class)->find($id); + ->getRepository(Person::class)->find($id); if (null === $person) { throw $this->createNotFoundException('Person not found'); diff --git a/src/Bundle/ChillPersonBundle/Controller/AccompanyingPeriodRegulationListController.php b/src/Bundle/ChillPersonBundle/Controller/AccompanyingPeriodRegulationListController.php index f5516114f..0c81e21b9 100644 --- a/src/Bundle/ChillPersonBundle/Controller/AccompanyingPeriodRegulationListController.php +++ b/src/Bundle/ChillPersonBundle/Controller/AccompanyingPeriodRegulationListController.php @@ -31,7 +31,9 @@ use Symfony\Component\Security\Core\Security; class AccompanyingPeriodRegulationListController { - public function __construct(private readonly AccompanyingPeriodACLAwareRepositoryInterface $accompanyingPeriodACLAwareRepository, private readonly \Twig\Environment $engine, private readonly FormFactoryInterface $formFactory, private readonly PaginatorFactory $paginatorFactory, private readonly Security $security, private readonly TranslatableStringHelperInterface $translatableStringHelper) {} + public function __construct(private readonly AccompanyingPeriodACLAwareRepositoryInterface $accompanyingPeriodACLAwareRepository, private readonly \Twig\Environment $engine, private readonly FormFactoryInterface $formFactory, private readonly PaginatorFactory $paginatorFactory, private readonly Security $security, private readonly TranslatableStringHelperInterface $translatableStringHelper) + { + } /** * @Route("/{_locale}/person/periods/undispatched", name="chill_person_course_list_regulation") diff --git a/src/Bundle/ChillPersonBundle/Controller/AccompanyingPeriodWorkEvaluationApiController.php b/src/Bundle/ChillPersonBundle/Controller/AccompanyingPeriodWorkEvaluationApiController.php index 60b8e9cff..aa9a265e2 100644 --- a/src/Bundle/ChillPersonBundle/Controller/AccompanyingPeriodWorkEvaluationApiController.php +++ b/src/Bundle/ChillPersonBundle/Controller/AccompanyingPeriodWorkEvaluationApiController.php @@ -29,7 +29,9 @@ use Symfony\Component\Serializer\SerializerInterface; class AccompanyingPeriodWorkEvaluationApiController { - public function __construct(private readonly AccompanyingPeriodWorkEvaluationRepository $accompanyingPeriodWorkEvaluationRepository, private readonly DocGeneratorTemplateRepository $docGeneratorTemplateRepository, private readonly SerializerInterface $serializer, private readonly PaginatorFactory $paginatorFactory, private readonly Security $security) {} + public function __construct(private readonly AccompanyingPeriodWorkEvaluationRepository $accompanyingPeriodWorkEvaluationRepository, private readonly DocGeneratorTemplateRepository $docGeneratorTemplateRepository, private readonly SerializerInterface $serializer, private readonly PaginatorFactory $paginatorFactory, private readonly Security $security) + { + } /** * @Route("/api/1.0/person/docgen/template/by-evaluation/{id}.{_format}", diff --git a/src/Bundle/ChillPersonBundle/Controller/HouseholdApiController.php b/src/Bundle/ChillPersonBundle/Controller/HouseholdApiController.php index a5b1081d5..cea622fab 100644 --- a/src/Bundle/ChillPersonBundle/Controller/HouseholdApiController.php +++ b/src/Bundle/ChillPersonBundle/Controller/HouseholdApiController.php @@ -31,7 +31,9 @@ use Symfony\Contracts\EventDispatcher\EventDispatcherInterface; class HouseholdApiController extends ApiController { - public function __construct(private readonly EventDispatcherInterface $eventDispatcher, private readonly HouseholdRepository $householdRepository, private readonly HouseholdACLAwareRepositoryInterface $householdACLAwareRepository) {} + public function __construct(private readonly EventDispatcherInterface $eventDispatcher, private readonly HouseholdRepository $householdRepository, private readonly HouseholdACLAwareRepositoryInterface $householdACLAwareRepository) + { + } /** * @Route("/api/1.0/person/household/by-address-reference/{id}.json", diff --git a/src/Bundle/ChillPersonBundle/Controller/HouseholdCompositionController.php b/src/Bundle/ChillPersonBundle/Controller/HouseholdCompositionController.php index 00503ab3e..9a9ffa86d 100644 --- a/src/Bundle/ChillPersonBundle/Controller/HouseholdCompositionController.php +++ b/src/Bundle/ChillPersonBundle/Controller/HouseholdCompositionController.php @@ -44,7 +44,8 @@ class HouseholdCompositionController extends AbstractController private readonly TranslatorInterface $translator, private readonly \Twig\Environment $engine, private readonly UrlGeneratorInterface $urlGenerator - ) {} + ) { + } /** * @Route("/{_locale}/person/household/{household_id}/composition/{composition_id}/delete", name="chill_person_household_composition_delete") diff --git a/src/Bundle/ChillPersonBundle/Controller/HouseholdController.php b/src/Bundle/ChillPersonBundle/Controller/HouseholdController.php index c85edaaf7..0c488dba5 100644 --- a/src/Bundle/ChillPersonBundle/Controller/HouseholdController.php +++ b/src/Bundle/ChillPersonBundle/Controller/HouseholdController.php @@ -34,7 +34,9 @@ use Symfony\Contracts\Translation\TranslatorInterface; */ class HouseholdController extends AbstractController { - public function __construct(private readonly TranslatorInterface $translator, private readonly PositionRepository $positionRepository, private readonly SerializerInterface $serializer, private readonly Security $security) {} + public function __construct(private readonly TranslatorInterface $translator, private readonly PositionRepository $positionRepository, private readonly SerializerInterface $serializer, private readonly Security $security) + { + } /** * @Route( diff --git a/src/Bundle/ChillPersonBundle/Controller/HouseholdMemberController.php b/src/Bundle/ChillPersonBundle/Controller/HouseholdMemberController.php index 7f895d478..c37cf63c0 100644 --- a/src/Bundle/ChillPersonBundle/Controller/HouseholdMemberController.php +++ b/src/Bundle/ChillPersonBundle/Controller/HouseholdMemberController.php @@ -30,7 +30,9 @@ use Symfony\Contracts\Translation\TranslatorInterface; class HouseholdMemberController extends ApiController { - public function __construct(private readonly UrlGeneratorInterface $generator, private readonly TranslatorInterface $translator, private readonly AccompanyingPeriodRepository $periodRepository) {} + public function __construct(private readonly UrlGeneratorInterface $generator, private readonly TranslatorInterface $translator, private readonly AccompanyingPeriodRepository $periodRepository) + { + } /** * @Route( diff --git a/src/Bundle/ChillPersonBundle/Controller/PersonAddressController.php b/src/Bundle/ChillPersonBundle/Controller/PersonAddressController.php index 193aad950..c6ffd1fec 100644 --- a/src/Bundle/ChillPersonBundle/Controller/PersonAddressController.php +++ b/src/Bundle/ChillPersonBundle/Controller/PersonAddressController.php @@ -29,7 +29,9 @@ class PersonAddressController extends AbstractController /** * PersonAddressController constructor. */ - public function __construct(private readonly ValidatorInterface $validator, private readonly TranslatorInterface $translator) {} + public function __construct(private readonly ValidatorInterface $validator, private readonly TranslatorInterface $translator) + { + } /** * @\Symfony\Component\Routing\Annotation\Route(path="/{_locale}/person/{person_id}/address/create", name="chill_person_address_create", methods={"POST"}) @@ -37,7 +39,7 @@ class PersonAddressController extends AbstractController public function createAction(mixed $person_id, Request $request) { $person = $this->getDoctrine()->getManager() - ->getRepository(\Chill\PersonBundle\Entity\Person::class) + ->getRepository(Person::class) ->find($person_id); if (null === $person) { @@ -94,7 +96,7 @@ class PersonAddressController extends AbstractController public function editAction(mixed $person_id, mixed $address_id) { $person = $this->getDoctrine()->getManager() - ->getRepository(\Chill\PersonBundle\Entity\Person::class) + ->getRepository(Person::class) ->find($person_id); if (null === $person) { @@ -124,7 +126,7 @@ class PersonAddressController extends AbstractController public function listAction(mixed $person_id) { $person = $this->getDoctrine()->getManager() - ->getRepository(\Chill\PersonBundle\Entity\Person::class) + ->getRepository(Person::class) ->find($person_id); if (null === $person) { @@ -148,7 +150,7 @@ class PersonAddressController extends AbstractController public function newAction(mixed $person_id) { $person = $this->getDoctrine()->getManager() - ->getRepository(\Chill\PersonBundle\Entity\Person::class) + ->getRepository(Person::class) ->find($person_id); if (null === $person) { @@ -177,7 +179,7 @@ class PersonAddressController extends AbstractController public function updateAction(mixed $person_id, mixed $address_id, Request $request) { $person = $this->getDoctrine()->getManager() - ->getRepository(\Chill\PersonBundle\Entity\Person::class) + ->getRepository(Person::class) ->find($person_id); if (null === $person) { diff --git a/src/Bundle/ChillPersonBundle/Controller/PersonController.php b/src/Bundle/ChillPersonBundle/Controller/PersonController.php index f9c24d2d4..99c3899e6 100644 --- a/src/Bundle/ChillPersonBundle/Controller/PersonController.php +++ b/src/Bundle/ChillPersonBundle/Controller/PersonController.php @@ -47,7 +47,8 @@ final class PersonController extends AbstractController private readonly ConfigPersonAltNamesHelper $configPersonAltNameHelper, private readonly ValidatorInterface $validator, private readonly EntityManagerInterface $em, - ) {} + ) { + } /** * @\Symfony\Component\Routing\Annotation\Route(path="/{_locale}/person/{person_id}/general/edit", name="chill_person_general_edit") @@ -106,7 +107,7 @@ final class PersonController extends AbstractController $cFGroup = null; $cFDefaultGroup = $this->em->getRepository(\Chill\CustomFieldsBundle\Entity\CustomFieldsDefaultGroup::class) - ->findOneByEntity(\Chill\PersonBundle\Entity\Person::class); + ->findOneByEntity(Person::class); if ($cFDefaultGroup) { $cFGroup = $cFDefaultGroup->getCustomFieldsGroup(); @@ -281,7 +282,7 @@ final class PersonController extends AbstractController /** * easy getting a person by his id. * - * @return \Chill\PersonBundle\Entity\Person + * @return Person */ private function _getPerson(int $id) { diff --git a/src/Bundle/ChillPersonBundle/Controller/PersonDuplicateController.php b/src/Bundle/ChillPersonBundle/Controller/PersonDuplicateController.php index 3b7188513..31965a498 100644 --- a/src/Bundle/ChillPersonBundle/Controller/PersonDuplicateController.php +++ b/src/Bundle/ChillPersonBundle/Controller/PersonDuplicateController.php @@ -32,7 +32,9 @@ use function count; class PersonDuplicateController extends \Symfony\Bundle\FrameworkBundle\Controller\AbstractController { - public function __construct(private readonly SimilarPersonMatcher $similarPersonMatcher, private readonly TranslatorInterface $translator, private readonly PersonRepository $personRepository, private readonly PersonMove $personMove, private readonly EventDispatcherInterface $eventDispatcher) {} + public function __construct(private readonly SimilarPersonMatcher $similarPersonMatcher, private readonly TranslatorInterface $translator, private readonly PersonRepository $personRepository, private readonly PersonMove $personMove, private readonly EventDispatcherInterface $eventDispatcher) + { + } /** * @\Symfony\Component\Routing\Annotation\Route(path="/{_locale}/person/{person1_id}/duplicate/{person2_id}/confirm", name="chill_person_duplicate_confirm") diff --git a/src/Bundle/ChillPersonBundle/Controller/PersonResourceController.php b/src/Bundle/ChillPersonBundle/Controller/PersonResourceController.php index a9d60d18e..7a112371d 100644 --- a/src/Bundle/ChillPersonBundle/Controller/PersonResourceController.php +++ b/src/Bundle/ChillPersonBundle/Controller/PersonResourceController.php @@ -25,7 +25,9 @@ use Symfony\Contracts\Translation\TranslatorInterface; final class PersonResourceController extends AbstractController { - public function __construct(private readonly PersonResourceRepository $personResourceRepository, private readonly PersonRepository $personRepository, private readonly EntityManagerInterface $em, private readonly TranslatorInterface $translator) {} + public function __construct(private readonly PersonResourceRepository $personResourceRepository, private readonly PersonRepository $personRepository, private readonly EntityManagerInterface $em, private readonly TranslatorInterface $translator) + { + } /** * @\Symfony\Component\Routing\Annotation\Route(path="/{_locale}/person/{person_id}/resources/{resource_id}/delete", name="chill_person_resource_delete") diff --git a/src/Bundle/ChillPersonBundle/Controller/ReassignAccompanyingPeriodController.php b/src/Bundle/ChillPersonBundle/Controller/ReassignAccompanyingPeriodController.php index 03b6975b4..f8e305552 100644 --- a/src/Bundle/ChillPersonBundle/Controller/ReassignAccompanyingPeriodController.php +++ b/src/Bundle/ChillPersonBundle/Controller/ReassignAccompanyingPeriodController.php @@ -39,7 +39,9 @@ use Symfony\Component\Validator\Constraints\NotNull; class ReassignAccompanyingPeriodController extends AbstractController { - public function __construct(private readonly AccompanyingPeriodACLAwareRepositoryInterface $accompanyingPeriodACLAwareRepository, private readonly UserRepository $userRepository, private readonly AccompanyingPeriodRepository $courseRepository, private readonly \Twig\Environment $engine, private readonly FormFactoryInterface $formFactory, private readonly PaginatorFactory $paginatorFactory, private readonly Security $security, private readonly UserRender $userRender, private readonly EntityManagerInterface $em) {} + public function __construct(private readonly AccompanyingPeriodACLAwareRepositoryInterface $accompanyingPeriodACLAwareRepository, private readonly UserRepository $userRepository, private readonly AccompanyingPeriodRepository $courseRepository, private readonly \Twig\Environment $engine, private readonly FormFactoryInterface $formFactory, private readonly PaginatorFactory $paginatorFactory, private readonly Security $security, private readonly UserRender $userRender, private readonly EntityManagerInterface $em) + { + } /** * @Route("/{_locale}/person/accompanying-periods/reassign", name="chill_course_list_reassign") @@ -141,7 +143,7 @@ class ReassignAccompanyingPeriodController extends AbstractController return $builder->getForm(); } - private function buildReassignForm(array $periodIds, User $userFrom = null): FormInterface + private function buildReassignForm(array $periodIds, ?User $userFrom = null): FormInterface { $defaultData = [ 'userFrom' => $userFrom, diff --git a/src/Bundle/ChillPersonBundle/Controller/RelationshipApiController.php b/src/Bundle/ChillPersonBundle/Controller/RelationshipApiController.php index 80cc8c79b..eac149245 100644 --- a/src/Bundle/ChillPersonBundle/Controller/RelationshipApiController.php +++ b/src/Bundle/ChillPersonBundle/Controller/RelationshipApiController.php @@ -21,7 +21,9 @@ use Symfony\Component\Validator\Validator\ValidatorInterface; class RelationshipApiController extends ApiController { - public function __construct(private readonly ValidatorInterface $validator, private readonly RelationshipRepository $repository) {} + public function __construct(private readonly ValidatorInterface $validator, private readonly RelationshipRepository $repository) + { + } /** * @ParamConverter("person", options={"id": "person_id"}) diff --git a/src/Bundle/ChillPersonBundle/Controller/ResidentialAddressController.php b/src/Bundle/ChillPersonBundle/Controller/ResidentialAddressController.php index 4b8278f9d..6d2b92438 100644 --- a/src/Bundle/ChillPersonBundle/Controller/ResidentialAddressController.php +++ b/src/Bundle/ChillPersonBundle/Controller/ResidentialAddressController.php @@ -27,7 +27,9 @@ use Symfony\Contracts\Translation\TranslatorInterface; final class ResidentialAddressController extends AbstractController { - public function __construct(private readonly UrlGeneratorInterface $generator, private readonly TranslatorInterface $translator, private readonly ResidentialAddressRepository $residentialAddressRepository) {} + public function __construct(private readonly UrlGeneratorInterface $generator, private readonly TranslatorInterface $translator, private readonly ResidentialAddressRepository $residentialAddressRepository) + { + } /** * @Route("/{_locale}/person/residential-address/{id}/delete", name="chill_person_residential_address_delete") diff --git a/src/Bundle/ChillPersonBundle/Controller/SocialWork/SocialIssueController.php b/src/Bundle/ChillPersonBundle/Controller/SocialWork/SocialIssueController.php index 7b1dd4211..316417583 100644 --- a/src/Bundle/ChillPersonBundle/Controller/SocialWork/SocialIssueController.php +++ b/src/Bundle/ChillPersonBundle/Controller/SocialWork/SocialIssueController.php @@ -18,7 +18,7 @@ use Symfony\Component\HttpFoundation\Request; class SocialIssueController extends CRUDController { - protected function createFormFor(string $action, $entity, string $formClass = null, array $formOptions = []): FormInterface + protected function createFormFor(string $action, $entity, ?string $formClass = null, array $formOptions = []): FormInterface { if ('new' === $action) { return parent::createFormFor($action, $entity, $formClass, ['step' => 'create']); diff --git a/src/Bundle/ChillPersonBundle/Controller/SocialWorkEvaluationApiController.php b/src/Bundle/ChillPersonBundle/Controller/SocialWorkEvaluationApiController.php index b97f2ed30..b6b7baf00 100644 --- a/src/Bundle/ChillPersonBundle/Controller/SocialWorkEvaluationApiController.php +++ b/src/Bundle/ChillPersonBundle/Controller/SocialWorkEvaluationApiController.php @@ -22,7 +22,9 @@ use Symfony\Component\Routing\Annotation\Route; class SocialWorkEvaluationApiController extends AbstractController { - public function __construct(private readonly PaginatorFactory $paginatorFactory) {} + public function __construct(private readonly PaginatorFactory $paginatorFactory) + { + } /** * @Route("/api/1.0/person/social-work/evaluation/by-social-action/{action_id}.json", diff --git a/src/Bundle/ChillPersonBundle/Controller/SocialWorkGoalApiController.php b/src/Bundle/ChillPersonBundle/Controller/SocialWorkGoalApiController.php index 2a7f39712..cbbd9a748 100644 --- a/src/Bundle/ChillPersonBundle/Controller/SocialWorkGoalApiController.php +++ b/src/Bundle/ChillPersonBundle/Controller/SocialWorkGoalApiController.php @@ -21,7 +21,9 @@ use Symfony\Component\HttpFoundation\Response; class SocialWorkGoalApiController extends ApiController { - public function __construct(private readonly GoalRepository $goalRepository, private readonly PaginatorFactory $paginator) {} + public function __construct(private readonly GoalRepository $goalRepository, private readonly PaginatorFactory $paginator) + { + } public function listBySocialAction(Request $request, SocialAction $action): Response { diff --git a/src/Bundle/ChillPersonBundle/Controller/SocialWorkResultApiController.php b/src/Bundle/ChillPersonBundle/Controller/SocialWorkResultApiController.php index 9b97d8129..aaedfd330 100644 --- a/src/Bundle/ChillPersonBundle/Controller/SocialWorkResultApiController.php +++ b/src/Bundle/ChillPersonBundle/Controller/SocialWorkResultApiController.php @@ -21,7 +21,9 @@ use Symfony\Component\HttpFoundation\Response; class SocialWorkResultApiController extends ApiController { - public function __construct(private readonly ResultRepository $resultRepository) {} + public function __construct(private readonly ResultRepository $resultRepository) + { + } public function listByGoal(Request $request, Goal $goal): Response { diff --git a/src/Bundle/ChillPersonBundle/Controller/SocialWorkSocialActionApiController.php b/src/Bundle/ChillPersonBundle/Controller/SocialWorkSocialActionApiController.php index 6b341e926..5ecc41a4c 100644 --- a/src/Bundle/ChillPersonBundle/Controller/SocialWorkSocialActionApiController.php +++ b/src/Bundle/ChillPersonBundle/Controller/SocialWorkSocialActionApiController.php @@ -26,7 +26,8 @@ final class SocialWorkSocialActionApiController extends ApiController private readonly SocialIssueRepository $socialIssueRepository, private readonly PaginatorFactory $paginator, private readonly ClockInterface $clock, - ) {} + ) { + } public function listBySocialIssueApi($id, Request $request) { diff --git a/src/Bundle/ChillPersonBundle/Controller/TimelinePersonController.php b/src/Bundle/ChillPersonBundle/Controller/TimelinePersonController.php index 21792444e..c271f22f4 100644 --- a/src/Bundle/ChillPersonBundle/Controller/TimelinePersonController.php +++ b/src/Bundle/ChillPersonBundle/Controller/TimelinePersonController.php @@ -22,7 +22,9 @@ use Symfony\Component\HttpFoundation\Request; class TimelinePersonController extends AbstractController { - public function __construct(protected EventDispatcherInterface $eventDispatcher, protected TimelineBuilder $timelineBuilder, protected PaginatorFactory $paginatorFactory) {} + public function __construct(protected EventDispatcherInterface $eventDispatcher, protected TimelineBuilder $timelineBuilder, protected PaginatorFactory $paginatorFactory) + { + } /** * @\Symfony\Component\Routing\Annotation\Route(path="/{_locale}/person/{person_id}/timeline", name="chill_person_timeline") diff --git a/src/Bundle/ChillPersonBundle/Controller/UserAccompanyingPeriodController.php b/src/Bundle/ChillPersonBundle/Controller/UserAccompanyingPeriodController.php index 1f484fd91..d5dd41e5b 100644 --- a/src/Bundle/ChillPersonBundle/Controller/UserAccompanyingPeriodController.php +++ b/src/Bundle/ChillPersonBundle/Controller/UserAccompanyingPeriodController.php @@ -21,7 +21,9 @@ use Symfony\Component\Routing\Annotation\Route; class UserAccompanyingPeriodController extends AbstractController { - public function __construct(private readonly AccompanyingPeriodRepository $accompanyingPeriodRepository, private readonly PaginatorFactory $paginatorFactory) {} + public function __construct(private readonly AccompanyingPeriodRepository $accompanyingPeriodRepository, private readonly PaginatorFactory $paginatorFactory) + { + } /** * @Route("/{_locale}/person/accompanying-periods/my", name="chill_person_accompanying_period_user") diff --git a/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadAccompanyingPeriodWork.php b/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadAccompanyingPeriodWork.php index 44992ebef..63000093e 100644 --- a/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadAccompanyingPeriodWork.php +++ b/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadAccompanyingPeriodWork.php @@ -26,7 +26,9 @@ class LoadAccompanyingPeriodWork extends \Doctrine\Bundle\FixturesBundle\Fixture */ private array $cacheEvaluations = []; - public function __construct(private readonly AccompanyingPeriodRepository $periodRepository, private readonly EvaluationRepository $evaluationRepository) {} + public function __construct(private readonly AccompanyingPeriodRepository $periodRepository, private readonly EvaluationRepository $evaluationRepository) + { + } public function getDependencies() { diff --git a/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadCustomFields.php b/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadCustomFields.php index 30aa345e7..baf18cebc 100644 --- a/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadCustomFields.php +++ b/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadCustomFields.php @@ -25,9 +25,9 @@ use Doctrine\Persistence\ObjectManager; class LoadCustomFields extends AbstractFixture implements OrderedFixtureInterface { - private ?\Chill\CustomFieldsBundle\Entity\CustomField $cfText = null; + private ?CustomField $cfText = null; - private ?\Chill\CustomFieldsBundle\Entity\CustomField $cfChoice = null; + private ?CustomField $cfChoice = null; /** * /** @@ -37,7 +37,8 @@ class LoadCustomFields extends AbstractFixture implements OrderedFixtureInterfac private readonly EntityManagerInterface $entityManager, private readonly CustomFieldChoice $customFieldChoice, private readonly CustomFieldText $customFieldText, - ) {} + ) { + } // put your code here public function getOrder() diff --git a/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadRelationships.php b/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadRelationships.php index 3efcc6386..8fff20a39 100644 --- a/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadRelationships.php +++ b/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadRelationships.php @@ -24,7 +24,9 @@ class LoadRelationships extends Fixture implements DependentFixtureInterface { use PersonRandomHelper; - public function __construct(private readonly EntityManagerInterface $em) {} + public function __construct(private readonly EntityManagerInterface $em) + { + } public function getDependencies(): array { diff --git a/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadSocialWorkMetadata.php b/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadSocialWorkMetadata.php index dc1e7b4dd..9c04d73cd 100644 --- a/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadSocialWorkMetadata.php +++ b/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadSocialWorkMetadata.php @@ -19,7 +19,9 @@ use League\Csv\Reader; class LoadSocialWorkMetadata extends Fixture implements OrderedFixtureInterface { - public function __construct(private readonly SocialWorkMetadata $importer) {} + public function __construct(private readonly SocialWorkMetadata $importer) + { + } public function getOrder() { diff --git a/src/Bundle/ChillPersonBundle/DependencyInjection/ChillPersonExtension.php b/src/Bundle/ChillPersonBundle/DependencyInjection/ChillPersonExtension.php index c5d7a026b..3d5c0bc64 100644 --- a/src/Bundle/ChillPersonBundle/DependencyInjection/ChillPersonExtension.php +++ b/src/Bundle/ChillPersonBundle/DependencyInjection/ChillPersonExtension.php @@ -147,7 +147,7 @@ class ChillPersonExtension extends Extension implements PrependExtensionInterfac $container->prependExtensionConfig('chill_main', [ 'cruds' => [ [ - 'class' => \Chill\PersonBundle\Entity\AccompanyingPeriod\ClosingMotive::class, + 'class' => AccompanyingPeriod\ClosingMotive::class, 'name' => 'closing_motive', 'base_path' => '/admin/person/closing-motive', 'form_class' => \Chill\PersonBundle\Form\ClosingMotiveType::class, @@ -168,7 +168,7 @@ class ChillPersonExtension extends Extension implements PrependExtensionInterfac ], ], [ - 'class' => \Chill\PersonBundle\Entity\AccompanyingPeriod\Origin::class, + 'class' => AccompanyingPeriod\Origin::class, 'name' => 'origin', 'base_path' => '/admin/person/origin', 'form_class' => \Chill\PersonBundle\Form\OriginType::class, @@ -401,16 +401,16 @@ class ChillPersonExtension extends Extension implements PrependExtensionInterfac ], 'apis' => [ [ - 'class' => \Chill\PersonBundle\Entity\AccompanyingPeriod::class, + 'class' => AccompanyingPeriod::class, 'name' => 'accompanying_course', 'base_path' => '/api/1.0/person/accompanying-course', 'controller' => \Chill\PersonBundle\Controller\AccompanyingCourseApiController::class, 'actions' => [ '_entity' => [ 'roles' => [ - Request::METHOD_GET => \Chill\PersonBundle\Security\Authorization\AccompanyingPeriodVoter::SEE, - Request::METHOD_PATCH => \Chill\PersonBundle\Security\Authorization\AccompanyingPeriodVoter::SEE, - Request::METHOD_PUT => \Chill\PersonBundle\Security\Authorization\AccompanyingPeriodVoter::SEE, + Request::METHOD_GET => AccompanyingPeriodVoter::SEE, + Request::METHOD_PATCH => AccompanyingPeriodVoter::SEE, + Request::METHOD_PUT => AccompanyingPeriodVoter::SEE, ], 'methods' => [ Request::METHOD_GET => true, @@ -426,8 +426,8 @@ class ChillPersonExtension extends Extension implements PrependExtensionInterfac Request::METHOD_HEAD => false, ], 'roles' => [ - Request::METHOD_POST => \Chill\PersonBundle\Security\Authorization\AccompanyingPeriodVoter::SEE, - Request::METHOD_DELETE => \Chill\PersonBundle\Security\Authorization\AccompanyingPeriodVoter::SEE, + Request::METHOD_POST => AccompanyingPeriodVoter::SEE, + Request::METHOD_DELETE => AccompanyingPeriodVoter::SEE, ], ], 'resource' => [ @@ -438,8 +438,8 @@ class ChillPersonExtension extends Extension implements PrependExtensionInterfac Request::METHOD_HEAD => false, ], 'roles' => [ - Request::METHOD_POST => \Chill\PersonBundle\Security\Authorization\AccompanyingPeriodVoter::SEE, - Request::METHOD_DELETE => \Chill\PersonBundle\Security\Authorization\AccompanyingPeriodVoter::SEE, + Request::METHOD_POST => AccompanyingPeriodVoter::SEE, + Request::METHOD_DELETE => AccompanyingPeriodVoter::SEE, ], ], 'comment' => [ @@ -450,8 +450,8 @@ class ChillPersonExtension extends Extension implements PrependExtensionInterfac Request::METHOD_HEAD => false, ], 'roles' => [ - Request::METHOD_POST => \Chill\PersonBundle\Security\Authorization\AccompanyingPeriodVoter::SEE, - Request::METHOD_DELETE => \Chill\PersonBundle\Security\Authorization\AccompanyingPeriodVoter::SEE, + Request::METHOD_POST => AccompanyingPeriodVoter::SEE, + Request::METHOD_DELETE => AccompanyingPeriodVoter::SEE, ], ], 'requestor' => [ @@ -462,8 +462,8 @@ class ChillPersonExtension extends Extension implements PrependExtensionInterfac Request::METHOD_HEAD => false, ], 'roles' => [ - Request::METHOD_POST => \Chill\PersonBundle\Security\Authorization\AccompanyingPeriodVoter::SEE, - Request::METHOD_DELETE => \Chill\PersonBundle\Security\Authorization\AccompanyingPeriodVoter::SEE, + Request::METHOD_POST => AccompanyingPeriodVoter::SEE, + Request::METHOD_DELETE => AccompanyingPeriodVoter::SEE, ], ], 'scope' => [ @@ -474,8 +474,8 @@ class ChillPersonExtension extends Extension implements PrependExtensionInterfac Request::METHOD_HEAD => false, ], 'roles' => [ - Request::METHOD_POST => \Chill\PersonBundle\Security\Authorization\AccompanyingPeriodVoter::SEE, - Request::METHOD_DELETE => \Chill\PersonBundle\Security\Authorization\AccompanyingPeriodVoter::SEE, + Request::METHOD_POST => AccompanyingPeriodVoter::SEE, + Request::METHOD_DELETE => AccompanyingPeriodVoter::SEE, ], ], 'socialissue' => [ @@ -487,8 +487,8 @@ class ChillPersonExtension extends Extension implements PrependExtensionInterfac ], 'controller_action' => 'socialIssueApi', 'roles' => [ - Request::METHOD_POST => \Chill\PersonBundle\Security\Authorization\AccompanyingPeriodVoter::SEE, - Request::METHOD_DELETE => \Chill\PersonBundle\Security\Authorization\AccompanyingPeriodVoter::SEE, + Request::METHOD_POST => AccompanyingPeriodVoter::SEE, + Request::METHOD_DELETE => AccompanyingPeriodVoter::SEE, ], ], 'work' => [ @@ -500,7 +500,7 @@ class ChillPersonExtension extends Extension implements PrependExtensionInterfac ], 'controller_action' => 'workApi', 'roles' => [ - Request::METHOD_POST => \Chill\PersonBundle\Security\Authorization\AccompanyingPeriodVoter::SEE, + Request::METHOD_POST => AccompanyingPeriodVoter::SEE, Request::METHOD_DELETE => 'ALWAYS_FAILS', ], ], @@ -511,7 +511,7 @@ class ChillPersonExtension extends Extension implements PrependExtensionInterfac Request::METHOD_HEAD => false, ], 'roles' => [ - Request::METHOD_POST => \Chill\PersonBundle\Security\Authorization\AccompanyingPeriodVoter::SEE, + Request::METHOD_POST => AccompanyingPeriodVoter::SEE, ], ], // 'confidential' => [ @@ -535,7 +535,7 @@ class ChillPersonExtension extends Extension implements PrependExtensionInterfac ], ], [ - 'class' => \Chill\PersonBundle\Entity\AccompanyingPeriod\Comment::class, + 'class' => AccompanyingPeriod\Comment::class, 'name' => 'accompanying_period_comment', 'base_path' => '/api/1.0/person/accompanying-period/comment', 'base_role' => 'ROLE_USER', @@ -554,7 +554,7 @@ class ChillPersonExtension extends Extension implements PrependExtensionInterfac ], ], [ - 'class' => \Chill\PersonBundle\Entity\AccompanyingPeriod\Resource::class, + 'class' => AccompanyingPeriod\Resource::class, 'name' => 'accompanying_period_resource', 'base_path' => '/api/1.0/person/accompanying-period/resource', 'base_role' => 'ROLE_USER', @@ -573,7 +573,7 @@ class ChillPersonExtension extends Extension implements PrependExtensionInterfac ], ], [ - 'class' => \Chill\PersonBundle\Entity\AccompanyingPeriod\Origin::class, + 'class' => AccompanyingPeriod\Origin::class, 'name' => 'accompanying_period_origin', 'base_path' => '/api/1.0/person/accompanying-period/origin', 'controller' => \Chill\PersonBundle\Controller\OpeningApiController::class, @@ -618,7 +618,7 @@ class ChillPersonExtension extends Extension implements PrependExtensionInterfac 'class' => \Chill\PersonBundle\Entity\Person::class, 'name' => 'person', 'base_path' => '/api/1.0/person/person', - 'base_role' => \Chill\PersonBundle\Security\Authorization\PersonVoter::SEE, + 'base_role' => PersonVoter::SEE, 'controller' => \Chill\PersonBundle\Controller\PersonApiController::class, 'actions' => [ '_entity' => [ @@ -629,10 +629,10 @@ class ChillPersonExtension extends Extension implements PrependExtensionInterfac Request::METHOD_PATCH => true, ], 'roles' => [ - Request::METHOD_GET => \Chill\PersonBundle\Security\Authorization\PersonVoter::SEE, - Request::METHOD_HEAD => \Chill\PersonBundle\Security\Authorization\PersonVoter::SEE, - Request::METHOD_POST => \Chill\PersonBundle\Security\Authorization\PersonVoter::CREATE, - Request::METHOD_PATCH => \Chill\PersonBundle\Security\Authorization\PersonVoter::CREATE, + Request::METHOD_GET => PersonVoter::SEE, + Request::METHOD_HEAD => PersonVoter::SEE, + Request::METHOD_POST => PersonVoter::CREATE, + Request::METHOD_PATCH => PersonVoter::CREATE, ], ], 'address' => [ @@ -718,7 +718,7 @@ class ChillPersonExtension extends Extension implements PrependExtensionInterfac ], ], [ - 'class' => \Chill\PersonBundle\Entity\AccompanyingPeriod\AccompanyingPeriodWork::class, + 'class' => AccompanyingPeriod\AccompanyingPeriodWork::class, 'name' => 'accompanying_period_work', 'base_path' => '/api/1.0/person/accompanying-course/work', 'controller' => \Chill\PersonBundle\Controller\AccompanyingCourseWorkApiController::class, @@ -1001,7 +1001,7 @@ class ChillPersonExtension extends Extension implements PrependExtensionInterfac 'property' => 'step', ], 'supports' => [ - \Chill\PersonBundle\Entity\AccompanyingPeriod::class, + AccompanyingPeriod::class, ], 'initial_marking' => 'DRAFT', 'places' => [ diff --git a/src/Bundle/ChillPersonBundle/Doctrine/DQL/AddressPart.php b/src/Bundle/ChillPersonBundle/Doctrine/DQL/AddressPart.php index 38d13ea43..229a69f2c 100644 --- a/src/Bundle/ChillPersonBundle/Doctrine/DQL/AddressPart.php +++ b/src/Bundle/ChillPersonBundle/Doctrine/DQL/AddressPart.php @@ -40,7 +40,7 @@ abstract class AddressPart extends FunctionNode 'country_id', ]; - private null|\Doctrine\ORM\Query\AST\Node|string $date = null; + private \Doctrine\ORM\Query\AST\Node|string|null $date = null; /** * @var \Doctrine\ORM\Query\AST\Node diff --git a/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod.php b/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod.php index 4302a17f4..9c88a4a69 100644 --- a/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod.php +++ b/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod.php @@ -479,7 +479,7 @@ class AccompanyingPeriod implements * * @uses AccompanyingPeriod::setClosingDate() */ - public function __construct(\DateTime $dateOpening = null) + public function __construct(?\DateTime $dateOpening = null) { $this->calendars = new ArrayCollection(); // TODO we cannot add a dependency between AccompanyingPeriod and calendars $this->participations = new ArrayCollection(); @@ -575,7 +575,7 @@ class AccompanyingPeriod implements return $this; } - public function addPerson(Person $person = null): self + public function addPerson(?Person $person = null): self { if (null !== $person) { $this->createParticipationFor($person); @@ -829,7 +829,7 @@ class AccompanyingPeriod implements * * @Groups({"read"}) */ - public function getLocation(\DateTimeImmutable $at = null): ?Address + public function getLocation(?\DateTimeImmutable $at = null): ?Address { if ($this->getPersonLocation() instanceof Person) { return $this->getPersonLocation()->getCurrentPersonAddress(); @@ -1029,7 +1029,7 @@ class AccompanyingPeriod implements /** * @Groups({"read"}) */ - public function getRequestor(): null|Person|ThirdParty + public function getRequestor(): Person|ThirdParty|null { return $this->requestorPerson ?? $this->requestorThirdParty; } @@ -1257,7 +1257,7 @@ class AccompanyingPeriod implements /** * @Groups({"write"}) */ - public function setAddressLocation(Address $addressLocation = null): self + public function setAddressLocation(?Address $addressLocation = null): self { if ($this->addressLocation !== $addressLocation) { $this->addressLocation = $addressLocation; @@ -1297,7 +1297,7 @@ class AccompanyingPeriod implements return $this; } - public function setClosingMotive(ClosingMotive $closingMotive = null): self + public function setClosingMotive(?ClosingMotive $closingMotive = null): self { $this->closingMotive = $closingMotive; @@ -1372,7 +1372,7 @@ class AccompanyingPeriod implements /** * @Groups({"write"}) */ - public function setPersonLocation(Person $person = null): self + public function setPersonLocation(?Person $person = null): self { if ($this->personLocation !== $person) { $this->personLocation = $person; @@ -1394,7 +1394,7 @@ class AccompanyingPeriod implements /** * @Groups({"write"}) */ - public function setPinnedComment(Comment $comment = null): self + public function setPinnedComment(?Comment $comment = null): self { if (null !== $this->pinnedComment) { $this->addComment($this->pinnedComment); @@ -1405,7 +1405,7 @@ class AccompanyingPeriod implements return $this; } - public function setRemark(string $remark = null): self + public function setRemark(?string $remark = null): self { $this->remark = (string) $remark; @@ -1566,14 +1566,14 @@ class AccompanyingPeriod implements } while ($steps->valid()); } - private function setRequestorPerson(Person $requestorPerson = null): self + private function setRequestorPerson(?Person $requestorPerson = null): self { $this->requestorPerson = $requestorPerson; return $this; } - private function setRequestorThirdParty(ThirdParty $requestorThirdParty = null): self + private function setRequestorThirdParty(?ThirdParty $requestorThirdParty = null): self { $this->requestorThirdParty = $requestorThirdParty; diff --git a/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/AccompanyingPeriodInfo.php b/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/AccompanyingPeriodInfo.php index d68292927..fe552dfe0 100644 --- a/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/AccompanyingPeriodInfo.php +++ b/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/AccompanyingPeriodInfo.php @@ -84,5 +84,6 @@ class AccompanyingPeriodInfo * @ORM\Column(type="text") */ public readonly string $discriminator, - ) {} + ) { + } } diff --git a/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/AccompanyingPeriodWork.php b/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/AccompanyingPeriodWork.php index 126318908..ef0cf0573 100644 --- a/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/AccompanyingPeriodWork.php +++ b/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/AccompanyingPeriodWork.php @@ -385,6 +385,7 @@ class AccompanyingPeriodWork implements AccompanyingPeriodLinkedWithSocialIssues /** * @return ReadableCollection + * * @Serializer\Groups({"accompanying_period_work:edit"}) */ public function getReferrers(): ReadableCollection @@ -562,7 +563,7 @@ class AccompanyingPeriodWork implements AccompanyingPeriodLinkedWithSocialIssues return $this; } - public function setEndDate(\DateTimeInterface $endDate = null): self + public function setEndDate(?\DateTimeInterface $endDate = null): self { $this->endDate = $endDate; diff --git a/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/AccompanyingPeriodWorkGoal.php b/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/AccompanyingPeriodWorkGoal.php index a569f3a9d..c0a1528ad 100644 --- a/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/AccompanyingPeriodWorkGoal.php +++ b/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/AccompanyingPeriodWorkGoal.php @@ -35,7 +35,7 @@ class AccompanyingPeriodWorkGoal /** * @ORM\ManyToOne(targetEntity=AccompanyingPeriodWork::class, inversedBy="goals") */ - private ?\Chill\PersonBundle\Entity\AccompanyingPeriod\AccompanyingPeriodWork $accompanyingPeriodWork = null; + private ?AccompanyingPeriodWork $accompanyingPeriodWork = null; /** * @ORM\ManyToOne(targetEntity=Goal::class) diff --git a/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/AccompanyingPeriodWorkReferrerHistory.php b/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/AccompanyingPeriodWorkReferrerHistory.php index 0086faab2..8ce1c7749 100644 --- a/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/AccompanyingPeriodWorkReferrerHistory.php +++ b/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/AccompanyingPeriodWorkReferrerHistory.php @@ -59,7 +59,8 @@ class AccompanyingPeriodWorkReferrerHistory implements TrackCreationInterface, T * @ORM\Column(type="date_immutable", nullable=false) */ private \DateTimeImmutable $startDate - ) {} + ) { + } public function getId(): ?int { diff --git a/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/Resource.php b/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/Resource.php index 515816637..f0ff1d956 100644 --- a/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/Resource.php +++ b/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/Resource.php @@ -107,7 +107,7 @@ class Resource /** * @Groups({"read"}) */ - public function getResource(): null|\Chill\PersonBundle\Entity\Person|\Chill\ThirdPartyBundle\Entity\ThirdParty + public function getResource(): Person|ThirdParty|null { return $this->person ?? $this->thirdParty; } @@ -124,7 +124,7 @@ class Resource return $this; } - public function setComment(string $comment = null): self + public function setComment(?string $comment = null): self { $this->comment = (string) $comment; diff --git a/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/UserHistory.php b/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/UserHistory.php index ab9ca7c7d..41b798a3f 100644 --- a/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/UserHistory.php +++ b/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/UserHistory.php @@ -58,7 +58,8 @@ class UserHistory implements TrackCreationInterface * @ORM\Column(type="datetime_immutable", nullable=false, options={"default": "now()"}) */ private \DateTimeImmutable $startDate = new \DateTimeImmutable('now') - ) {} + ) { + } public function getAccompanyingPeriod(): AccompanyingPeriod { diff --git a/src/Bundle/ChillPersonBundle/Entity/HasPerson.php b/src/Bundle/ChillPersonBundle/Entity/HasPerson.php index ba4f3699d..ab0854a57 100644 --- a/src/Bundle/ChillPersonBundle/Entity/HasPerson.php +++ b/src/Bundle/ChillPersonBundle/Entity/HasPerson.php @@ -18,5 +18,5 @@ interface HasPerson { public function getPerson(): ?Person; - public function setPerson(Person $person = null): HasPerson; + public function setPerson(?Person $person = null): HasPerson; } diff --git a/src/Bundle/ChillPersonBundle/Entity/Household/Household.php b/src/Bundle/ChillPersonBundle/Entity/Household/Household.php index 6d5bdf674..cc0ff2d69 100644 --- a/src/Bundle/ChillPersonBundle/Entity/Household/Household.php +++ b/src/Bundle/ChillPersonBundle/Entity/Household/Household.php @@ -214,7 +214,7 @@ class Household * * @Serializer\SerializedName("current_address") */ - public function getCurrentAddress(\DateTime $at = null): ?Address + public function getCurrentAddress(?\DateTime $at = null): ?Address { $at ??= new \DateTime('today'); @@ -234,7 +234,7 @@ class Household * * @Serializer\SerializedName("current_composition") */ - public function getCurrentComposition(\DateTimeImmutable $at = null): ?HouseholdComposition + public function getCurrentComposition(?\DateTimeImmutable $at = null): ?HouseholdComposition { $at ??= new \DateTimeImmutable('today'); $criteria = new Criteria(); @@ -262,12 +262,12 @@ class Household /** * @Serializer\Groups({"docgen:read"}) */ - public function getCurrentMembers(\DateTimeImmutable $now = null): Collection + public function getCurrentMembers(?\DateTimeImmutable $now = null): Collection { return $this->getMembers()->matching($this->buildCriteriaCurrentMembers($now)); } - public function getCurrentMembersByPosition(Position $position, \DateTimeInterface $now = null) + public function getCurrentMembersByPosition(Position $position, ?\DateTimeInterface $now = null) { $criteria = new Criteria(); $expr = Criteria::expr(); @@ -286,7 +286,7 @@ class Household * * @Serializer\SerializedName("current_members_id") */ - public function getCurrentMembersIds(\DateTimeImmutable $now = null): ReadableCollection + public function getCurrentMembersIds(?\DateTimeImmutable $now = null): ReadableCollection { return $this->getCurrentMembers($now)->map( static fn (HouseholdMember $m) => $m->getId() @@ -296,7 +296,7 @@ class Household /** * @return HouseholdMember[] */ - public function getCurrentMembersOrdered(\DateTimeImmutable $now = null): Collection + public function getCurrentMembersOrdered(?\DateTimeImmutable $now = null): Collection { $members = $this->getCurrentMembers($now); @@ -338,7 +338,7 @@ class Household return $members; } - public function getCurrentMembersWithoutPosition(\DateTimeInterface $now = null) + public function getCurrentMembersWithoutPosition(?\DateTimeInterface $now = null) { $criteria = new Criteria(); $expr = Criteria::expr(); @@ -355,7 +355,7 @@ class Household * * @return ReadableCollection<(int|string), Person> */ - public function getCurrentPersons(\DateTimeImmutable $now = null): ReadableCollection + public function getCurrentPersons(?\DateTimeImmutable $now = null): ReadableCollection { return $this->getCurrentMembers($now) ->map(static fn (HouseholdMember $m) => $m->getPerson()); @@ -424,7 +424,7 @@ class Household }); } - public function getNonCurrentMembers(\DateTimeImmutable $now = null): Collection + public function getNonCurrentMembers(?\DateTimeImmutable $now = null): Collection { $criteria = new Criteria(); $expr = Criteria::expr(); @@ -444,7 +444,7 @@ class Household return $this->getMembers()->matching($criteria); } - public function getNonCurrentMembersByPosition(Position $position, \DateTimeInterface $now = null) + public function getNonCurrentMembersByPosition(Position $position, ?\DateTimeInterface $now = null) { $criteria = new Criteria(); $expr = Criteria::expr(); @@ -454,7 +454,7 @@ class Household return $this->getNonCurrentMembers($now)->matching($criteria); } - public function getNonCurrentMembersWithoutPosition(\DateTimeInterface $now = null) + public function getNonCurrentMembersWithoutPosition(?\DateTimeInterface $now = null) { $criteria = new Criteria(); $expr = Criteria::expr(); @@ -644,7 +644,7 @@ class Household } } - private function buildCriteriaCurrentMembers(\DateTimeImmutable $now = null): Criteria + private function buildCriteriaCurrentMembers(?\DateTimeImmutable $now = null): Criteria { $criteria = new Criteria(); $expr = Criteria::expr(); diff --git a/src/Bundle/ChillPersonBundle/Entity/Household/HouseholdMember.php b/src/Bundle/ChillPersonBundle/Entity/Household/HouseholdMember.php index ccce246c8..21c28f52e 100644 --- a/src/Bundle/ChillPersonBundle/Entity/Household/HouseholdMember.php +++ b/src/Bundle/ChillPersonBundle/Entity/Household/HouseholdMember.php @@ -153,7 +153,7 @@ class HouseholdMember return $this->startDate; } - public function isCurrent(\DateTimeImmutable $at = null): bool + public function isCurrent(?\DateTimeImmutable $at = null): bool { $at ??= new \DateTimeImmutable('now'); @@ -174,7 +174,7 @@ class HouseholdMember return $this; } - public function setEndDate(\DateTimeImmutable $endDate = null): self + public function setEndDate(?\DateTimeImmutable $endDate = null): self { $this->endDate = $endDate; diff --git a/src/Bundle/ChillPersonBundle/Entity/Household/PersonHouseholdAddress.php b/src/Bundle/ChillPersonBundle/Entity/Household/PersonHouseholdAddress.php index 453176334..529f3e0a6 100644 --- a/src/Bundle/ChillPersonBundle/Entity/Household/PersonHouseholdAddress.php +++ b/src/Bundle/ChillPersonBundle/Entity/Household/PersonHouseholdAddress.php @@ -52,7 +52,7 @@ class PersonHouseholdAddress * * @ORM\JoinColumn(nullable=false) */ - private ?\Chill\MainBundle\Entity\Address $address = null; + private ?Address $address = null; /** * @ORM\Id @@ -61,7 +61,7 @@ class PersonHouseholdAddress * * @ORM\JoinColumn(nullable=false) */ - private ?\Chill\PersonBundle\Entity\Household\Household $household = null; + private ?Household $household = null; /** * @ORM\Id @@ -70,7 +70,7 @@ class PersonHouseholdAddress * * @ORM\JoinColumn(nullable=false) */ - private ?\Chill\PersonBundle\Entity\Person $person = null; + private ?Person $person = null; /** * @ORM\Column(type="date_immutable") diff --git a/src/Bundle/ChillPersonBundle/Entity/Person.php b/src/Bundle/ChillPersonBundle/Entity/Person.php index 57c1a0314..cd28da9a7 100644 --- a/src/Bundle/ChillPersonBundle/Entity/Person.php +++ b/src/Bundle/ChillPersonBundle/Entity/Person.php @@ -227,7 +227,7 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI * * @ORM\JoinColumn(nullable=true) */ - private ?\Chill\MainBundle\Entity\Civility $civility = null; + private ?Civility $civility = null; /** * Contact information for contacting the person. @@ -245,7 +245,7 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI * * @ORM\JoinColumn(nullable=true) */ - private ?\Chill\MainBundle\Entity\Country $countryOfBirth = null; + private ?Country $countryOfBirth = null; /** * @ORM\Column(type="datetime", nullable=true, options={"default": NULL}) @@ -257,7 +257,7 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI * * @ORM\JoinColumn(nullable=true) */ - private ?\Chill\MainBundle\Entity\User $createdBy = null; + private ?User $createdBy = null; /** * Cache the computation of household. @@ -390,7 +390,7 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI * * @ORM\JoinColumn(nullable=true) */ - private ?\Chill\PersonBundle\Entity\MaritalStatus $maritalStatus = null; + private ?MaritalStatus $maritalStatus = null; /** * Comment on marital status. @@ -433,7 +433,7 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI * * @ORM\JoinColumn(nullable=true) */ - private ?\Chill\MainBundle\Entity\Country $nationality = null; + private ?Country $nationality = null; /** * Number of children. @@ -525,14 +525,14 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI * targetEntity=User::class * ) */ - private ?\Chill\MainBundle\Entity\User $updatedBy = null; + private ?User $updatedBy = null; /** * Person constructor. */ public function __construct() { - $this->calendars = new \Doctrine\Common\Collections\ArrayCollection(); + $this->calendars = new ArrayCollection(); $this->accompanyingPeriodParticipations = new ArrayCollection(); $this->spokenLanguages = new ArrayCollection(); $this->addresses = new ArrayCollection(); @@ -671,7 +671,7 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI * * @throws \Exception if two lines of the accompanying period are open */ - public function close(AccompanyingPeriod $accompanyingPeriod = null): void + public function close(?AccompanyingPeriod $accompanyingPeriod = null): void { $this->proxyAccompanyingPeriodOpenState = false; } @@ -854,7 +854,7 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI * * @throws \Exception */ - public function getAddressAt(\DateTimeInterface $at = null): ?Address + public function getAddressAt(?\DateTimeInterface $at = null): ?Address { $at ??= new \DateTime('now'); @@ -1035,7 +1035,7 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI return $currentAccompanyingPeriods; } - public function getCurrentHousehold(\DateTimeImmutable $at = null): ?Household + public function getCurrentHousehold(?\DateTimeImmutable $at = null): ?Household { $participation = $this->getCurrentHouseholdParticipationShareHousehold($at); @@ -1050,7 +1050,7 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI * if the given date is 'now', use instead @see{getCurrentPersonAddress}, which is optimized on * database side. */ - public function getCurrentHouseholdAddress(\DateTimeImmutable $at = null): ?Address + public function getCurrentHouseholdAddress(?\DateTimeImmutable $at = null): ?Address { if ( null === $at @@ -1084,7 +1084,7 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI return null; } - public function getCurrentHouseholdParticipationShareHousehold(\DateTimeImmutable $at = null): ?HouseholdMember + public function getCurrentHouseholdParticipationShareHousehold(?\DateTimeImmutable $at = null): ?HouseholdMember { $criteria = new Criteria(); $expr = Criteria::expr(); @@ -1253,7 +1253,7 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI * * @throws \Exception */ - public function getLastAddress(\DateTime $from = null) + public function getLastAddress(?\DateTime $from = null) { return $this->getCurrentHouseholdAddress( null !== $from ? \DateTimeImmutable::createFromMutable($from) : null @@ -1356,7 +1356,7 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI /** * @return PersonResource[]|Collection */ - public function getResources(): array|\Doctrine\Common\Collections\Collection + public function getResources(): array|Collection { return $this->resources; } @@ -1381,7 +1381,7 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI return $this->updatedBy; } - public function hasCurrentHouseholdAddress(\DateTimeImmutable $at = null): bool + public function hasCurrentHouseholdAddress(?\DateTimeImmutable $at = null): bool { return null !== $this->getCurrentHouseholdAddress($at); } @@ -1468,7 +1468,7 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI return false; } - public function isSharingHousehold(\DateTimeImmutable $at = null): bool + public function isSharingHousehold(?\DateTimeImmutable $at = null): bool { return null !== $this->getCurrentHousehold($at); } @@ -1619,7 +1619,7 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI return $this; } - public function setCivility(Civility $civility = null): self + public function setCivility(?Civility $civility = null): self { $this->civility = $civility; @@ -1637,7 +1637,7 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI return $this; } - public function setCountryOfBirth(Country $countryOfBirth = null): self + public function setCountryOfBirth(?Country $countryOfBirth = null): self { $this->countryOfBirth = $countryOfBirth; @@ -1707,7 +1707,7 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI return $this; } - public function setMaritalStatus(MaritalStatus $maritalStatus = null): self + public function setMaritalStatus(?MaritalStatus $maritalStatus = null): self { $this->maritalStatus = $maritalStatus; @@ -1748,7 +1748,7 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI return $this; } - public function setNationality(Country $nationality = null): self + public function setNationality(?Country $nationality = null): self { $this->nationality = $nationality; diff --git a/src/Bundle/ChillPersonBundle/Entity/Person/PersonCenterHistory.php b/src/Bundle/ChillPersonBundle/Entity/Person/PersonCenterHistory.php index 04cad642b..89ee1f5af 100644 --- a/src/Bundle/ChillPersonBundle/Entity/Person/PersonCenterHistory.php +++ b/src/Bundle/ChillPersonBundle/Entity/Person/PersonCenterHistory.php @@ -59,7 +59,8 @@ class PersonCenterHistory implements TrackCreationInterface, TrackUpdateInterfac * @ORM\Column(type="date_immutable", nullable=false) */ private ?\DateTimeImmutable $startDate = null - ) {} + ) { + } public function getCenter(): ?Center { diff --git a/src/Bundle/ChillPersonBundle/Entity/PersonAltName.php b/src/Bundle/ChillPersonBundle/Entity/PersonAltName.php index 9b6b24621..c17172882 100644 --- a/src/Bundle/ChillPersonBundle/Entity/PersonAltName.php +++ b/src/Bundle/ChillPersonBundle/Entity/PersonAltName.php @@ -52,7 +52,7 @@ class PersonAltName * inversedBy="altNames" * ) */ - private ?\Chill\PersonBundle\Entity\Person $person = null; + private ?Person $person = null; /** * Get id. @@ -116,7 +116,7 @@ class PersonAltName /** * @return $this */ - public function setPerson(Person $person = null) + public function setPerson(?Person $person = null) { $this->person = $person; diff --git a/src/Bundle/ChillPersonBundle/Entity/PersonNotDuplicate.php b/src/Bundle/ChillPersonBundle/Entity/PersonNotDuplicate.php index ad0f4236f..7d296576c 100644 --- a/src/Bundle/ChillPersonBundle/Entity/PersonNotDuplicate.php +++ b/src/Bundle/ChillPersonBundle/Entity/PersonNotDuplicate.php @@ -43,17 +43,17 @@ class PersonNotDuplicate /** * @ORM\ManyToOne(targetEntity="Chill\PersonBundle\Entity\Person") */ - private ?\Chill\PersonBundle\Entity\Person $person1 = null; + private ?Person $person1 = null; /** * @ORM\ManyToOne(targetEntity="Chill\PersonBundle\Entity\Person") */ - private ?\Chill\PersonBundle\Entity\Person $person2 = null; + private ?Person $person2 = null; /** * @ORM\ManyToOne(targetEntity="Chill\MainBundle\Entity\User") */ - private ?\Chill\MainBundle\Entity\User $user = null; + private ?User $user = null; public function __construct() { diff --git a/src/Bundle/ChillPersonBundle/Entity/SocialWork/SocialAction.php b/src/Bundle/ChillPersonBundle/Entity/SocialWork/SocialAction.php index 8361399f5..19fd7395b 100644 --- a/src/Bundle/ChillPersonBundle/Entity/SocialWork/SocialAction.php +++ b/src/Bundle/ChillPersonBundle/Entity/SocialWork/SocialAction.php @@ -79,7 +79,7 @@ class SocialAction /** * @ORM\ManyToOne(targetEntity=SocialIssue::class, inversedBy="socialActions") */ - private ?\Chill\PersonBundle\Entity\SocialWork\SocialIssue $issue = null; + private ?SocialIssue $issue = null; /** * @ORM\Column(type="float", name="ordering", options={"default": 0.0}) @@ -89,7 +89,7 @@ class SocialAction /** * @ORM\ManyToOne(targetEntity=SocialAction::class, inversedBy="children") */ - private ?\Chill\PersonBundle\Entity\SocialWork\SocialAction $parent = null; + private ?SocialAction $parent = null; /** * @var Collection @@ -166,7 +166,7 @@ class SocialAction * * @return Collection|SocialAction[] a list with the elements of the given list which are parent of other elements in the given list */ - public static function findAncestorSocialActions(array|\Doctrine\Common\Collections\Collection $socialActions): Collection + public static function findAncestorSocialActions(array|Collection $socialActions): Collection { $ancestors = new ArrayCollection(); @@ -246,7 +246,7 @@ class SocialAction /** * @param Collection|SocialAction[] $socialActions */ - public static function getDescendantsWithThisForActions(array|\Doctrine\Common\Collections\Collection $socialActions): Collection + public static function getDescendantsWithThisForActions(array|Collection $socialActions): Collection { $unique = []; diff --git a/src/Bundle/ChillPersonBundle/Entity/SocialWork/SocialIssue.php b/src/Bundle/ChillPersonBundle/Entity/SocialWork/SocialIssue.php index 12e1c1742..397e5a826 100644 --- a/src/Bundle/ChillPersonBundle/Entity/SocialWork/SocialIssue.php +++ b/src/Bundle/ChillPersonBundle/Entity/SocialWork/SocialIssue.php @@ -57,7 +57,7 @@ class SocialIssue /** * @ORM\ManyToOne(targetEntity=SocialIssue::class, inversedBy="children") */ - private ?\Chill\PersonBundle\Entity\SocialWork\SocialIssue $parent = null; + private ?SocialIssue $parent = null; /** * @var Collection @@ -115,7 +115,7 @@ class SocialIssue * * @return Collection|SocialIssue[] */ - public static function findAncestorSocialIssues(array|\Doctrine\Common\Collections\Collection $socialIssues): Collection + public static function findAncestorSocialIssues(array|Collection $socialIssues): Collection { $ancestors = new ArrayCollection(); diff --git a/src/Bundle/ChillPersonBundle/Event/Person/PersonAddressMoveEvent.php b/src/Bundle/ChillPersonBundle/Event/Person/PersonAddressMoveEvent.php index cf15018fd..a65f68102 100644 --- a/src/Bundle/ChillPersonBundle/Event/Person/PersonAddressMoveEvent.php +++ b/src/Bundle/ChillPersonBundle/Event/Person/PersonAddressMoveEvent.php @@ -29,7 +29,9 @@ class PersonAddressMoveEvent extends Event private ?HouseholdMember $previousMembership = null; - public function __construct(private readonly Person $person) {} + public function __construct(private readonly Person $person) + { + } /** * Get the date of the move. diff --git a/src/Bundle/ChillPersonBundle/EventListener/AccompanyingPeriodWorkEventListener.php b/src/Bundle/ChillPersonBundle/EventListener/AccompanyingPeriodWorkEventListener.php index c6b366fc8..60d521424 100644 --- a/src/Bundle/ChillPersonBundle/EventListener/AccompanyingPeriodWorkEventListener.php +++ b/src/Bundle/ChillPersonBundle/EventListener/AccompanyingPeriodWorkEventListener.php @@ -17,7 +17,9 @@ use Symfony\Component\Security\Core\Security; class AccompanyingPeriodWorkEventListener { - public function __construct(private readonly Security $security) {} + public function __construct(private readonly Security $security) + { + } public function prePersistAccompanyingPeriodWork(AccompanyingPeriodWork $work): void { diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/AdministrativeLocationAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/AdministrativeLocationAggregator.php index 522b2ecdd..6d15566af 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/AdministrativeLocationAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/AdministrativeLocationAggregator.php @@ -20,7 +20,9 @@ use Symfony\Component\Form\FormBuilderInterface; class AdministrativeLocationAggregator implements AggregatorInterface { - public function __construct(private readonly LocationRepository $locationRepository, private readonly TranslatableStringHelper $translatableStringHelper) {} + public function __construct(private readonly LocationRepository $locationRepository, private readonly TranslatableStringHelper $translatableStringHelper) + { + } public function addRole(): ?string { diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/ClosingDateAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/ClosingDateAggregator.php index ce96c40c9..6a9cce351 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/ClosingDateAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/ClosingDateAggregator.php @@ -48,7 +48,7 @@ final readonly class ClosingDateAggregator implements AggregatorInterface public function getLabels($key, array $values, mixed $data) { - return function (null|string $value): string { + return function (string|null $value): string { if ('_header' === $value) { return 'export.aggregator.course.by_closing_date.header'; } diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/ClosingMotiveAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/ClosingMotiveAggregator.php index 259d5fb66..9ea9998b3 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/ClosingMotiveAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/ClosingMotiveAggregator.php @@ -20,7 +20,9 @@ use Symfony\Component\Form\FormBuilderInterface; class ClosingMotiveAggregator implements AggregatorInterface { - public function __construct(private readonly ClosingMotiveRepositoryInterface $motiveRepository, private readonly TranslatableStringHelper $translatableStringHelper) {} + public function __construct(private readonly ClosingMotiveRepositoryInterface $motiveRepository, private readonly TranslatableStringHelper $translatableStringHelper) + { + } public function addRole(): ?string { diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/ConfidentialAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/ConfidentialAggregator.php index 0e3e5f735..3c404c513 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/ConfidentialAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/ConfidentialAggregator.php @@ -19,7 +19,9 @@ use Symfony\Contracts\Translation\TranslatorInterface; class ConfidentialAggregator implements AggregatorInterface { - public function __construct(private readonly TranslatorInterface $translator) {} + public function __construct(private readonly TranslatorInterface $translator) + { + } public function addRole(): ?string { diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/CreatorJobAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/CreatorJobAggregator.php index 32afe5247..bc2232a65 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/CreatorJobAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/CreatorJobAggregator.php @@ -16,7 +16,6 @@ use Chill\MainBundle\Export\AggregatorInterface; use Chill\MainBundle\Repository\UserJobRepository; use Chill\MainBundle\Templating\TranslatableStringHelper; use Chill\PersonBundle\Export\Declarations; -use Doctrine\ORM\Query\Expr; use Doctrine\ORM\Query\Expr\Join; use Doctrine\ORM\QueryBuilder; use Symfony\Component\Form\FormBuilderInterface; @@ -28,7 +27,8 @@ class CreatorJobAggregator implements AggregatorInterface public function __construct( private readonly UserJobRepository $jobRepository, private readonly TranslatableStringHelper $translatableStringHelper - ) {} + ) { + } public function addRole(): ?string { @@ -58,7 +58,7 @@ class CreatorJobAggregator implements AggregatorInterface ->leftJoin( UserJobHistory::class, "{$p}_jobHistory", - Expr\Join::WITH, + Join::WITH, $qb->expr()->andX( $qb->expr()->eq("{$p}_jobHistory.user", "{$p}_userHistory.createdBy"), // et si il est null ? $qb->expr()->andX( @@ -79,7 +79,9 @@ class CreatorJobAggregator implements AggregatorInterface return Declarations::ACP_TYPE; } - public function buildForm(FormBuilderInterface $builder) {} + public function buildForm(FormBuilderInterface $builder) + { + } public function getFormDefaultData(): array { diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/DurationAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/DurationAggregator.php index f5dc99115..f0dbec2c4 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/DurationAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/DurationAggregator.php @@ -26,7 +26,9 @@ final readonly class DurationAggregator implements AggregatorInterface 'day', ]; - public function __construct(private TranslatorInterface $translator) {} + public function __construct(private TranslatorInterface $translator) + { + } public function addRole(): ?string { diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/EmergencyAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/EmergencyAggregator.php index 0217166d2..c215eeb6a 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/EmergencyAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/EmergencyAggregator.php @@ -19,7 +19,9 @@ use Symfony\Contracts\Translation\TranslatorInterface; class EmergencyAggregator implements AggregatorInterface { - public function __construct(private readonly TranslatorInterface $translator) {} + public function __construct(private readonly TranslatorInterface $translator) + { + } public function addRole(): ?string { diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/EvaluationAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/EvaluationAggregator.php index a90896ccd..de2f9305e 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/EvaluationAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/EvaluationAggregator.php @@ -20,7 +20,9 @@ use Symfony\Component\Form\FormBuilderInterface; final readonly class EvaluationAggregator implements AggregatorInterface { - public function __construct(private EvaluationRepository $evaluationRepository, private TranslatableStringHelper $translatableStringHelper) {} + public function __construct(private EvaluationRepository $evaluationRepository, private TranslatableStringHelper $translatableStringHelper) + { + } public function addRole(): ?string { diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/GeographicalUnitStatAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/GeographicalUnitStatAggregator.php index 3fa612988..2d6dbeae4 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/GeographicalUnitStatAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/GeographicalUnitStatAggregator.php @@ -28,7 +28,9 @@ use Symfony\Component\Form\FormBuilderInterface; final readonly class GeographicalUnitStatAggregator implements AggregatorInterface { - public function __construct(private GeographicalUnitLayerRepositoryInterface $geographicalUnitLayerRepository, private TranslatableStringHelperInterface $translatableStringHelper, private RollingDateConverterInterface $rollingDateConverter) {} + public function __construct(private GeographicalUnitLayerRepositoryInterface $geographicalUnitLayerRepository, private TranslatableStringHelperInterface $translatableStringHelper, private RollingDateConverterInterface $rollingDateConverter) + { + } public function addRole(): ?string { diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/IntensityAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/IntensityAggregator.php index de42039c1..d7dff6265 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/IntensityAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/IntensityAggregator.php @@ -19,7 +19,9 @@ use Symfony\Contracts\Translation\TranslatorInterface; class IntensityAggregator implements AggregatorInterface { - public function __construct(private readonly TranslatorInterface $translator) {} + public function __construct(private readonly TranslatorInterface $translator) + { + } public function addRole(): ?string { diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/JobWorkingOnCourseAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/JobWorkingOnCourseAggregator.php index 69f443300..cfb9d53aa 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/JobWorkingOnCourseAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/JobWorkingOnCourseAggregator.php @@ -28,7 +28,8 @@ final readonly class JobWorkingOnCourseAggregator implements AggregatorInterface public function __construct( private UserJobRepositoryInterface $userJobRepository, private TranslatableStringHelperInterface $translatableStringHelper, - ) {} + ) { + } public function addRole(): ?string { @@ -72,7 +73,9 @@ final readonly class JobWorkingOnCourseAggregator implements AggregatorInterface return Declarations::ACP_TYPE; } - public function buildForm(FormBuilderInterface $builder) {} + public function buildForm(FormBuilderInterface $builder) + { + } public function getFormDefaultData(): array { @@ -81,7 +84,7 @@ final readonly class JobWorkingOnCourseAggregator implements AggregatorInterface public function getLabels($key, array $values, $data): \Closure { - return function (null|int|string $jobId) { + return function (int|string|null $jobId) { if (null === $jobId || '' === $jobId) { return ''; } diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/OpeningDateAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/OpeningDateAggregator.php index bf71d04d8..6f9ea4859 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/OpeningDateAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/OpeningDateAggregator.php @@ -48,7 +48,7 @@ final readonly class OpeningDateAggregator implements AggregatorInterface public function getLabels($key, array $values, mixed $data) { - return function (null|string $value): string { + return function (string|null $value): string { if ('_header' === $value) { return 'export.aggregator.course.by_opening_date.header'; } diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/ReferrerAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/ReferrerAggregator.php index 823b10d86..78349dd56 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/ReferrerAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/ReferrerAggregator.php @@ -27,7 +27,9 @@ final readonly class ReferrerAggregator implements AggregatorInterface private const P = 'acp_ref_agg_date'; - public function __construct(private UserRepository $userRepository, private UserRender $userRender, private RollingDateConverterInterface $rollingDateConverter) {} + public function __construct(private UserRepository $userRepository, private UserRender $userRender, private RollingDateConverterInterface $rollingDateConverter) + { + } public function addRole(): ?string { diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/ReferrerScopeAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/ReferrerScopeAggregator.php index 9f58b6539..b0a44bcd1 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/ReferrerScopeAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/ReferrerScopeAggregator.php @@ -27,7 +27,8 @@ readonly class ReferrerScopeAggregator implements AggregatorInterface public function __construct( private ScopeRepositoryInterface $scopeRepository, private TranslatableStringHelperInterface $translatableStringHelper, - ) {} + ) { + } public function addRole(): ?string { @@ -78,7 +79,9 @@ readonly class ReferrerScopeAggregator implements AggregatorInterface return Declarations::ACP_TYPE; } - public function buildForm(FormBuilderInterface $builder) {} + public function buildForm(FormBuilderInterface $builder) + { + } public function getFormDefaultData(): array { diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/RequestorAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/RequestorAggregator.php index ec168ceaf..824d7431f 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/RequestorAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/RequestorAggregator.php @@ -19,7 +19,9 @@ use Symfony\Contracts\Translation\TranslatorInterface; final readonly class RequestorAggregator implements AggregatorInterface { - public function __construct(private TranslatorInterface $translator) {} + public function __construct(private TranslatorInterface $translator) + { + } public function addRole(): ?string { diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/ScopeAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/ScopeAggregator.php index 06dbc906d..d7cdfbab1 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/ScopeAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/ScopeAggregator.php @@ -20,7 +20,9 @@ use Symfony\Component\Form\FormBuilderInterface; final readonly class ScopeAggregator implements AggregatorInterface { - public function __construct(private ScopeRepository $scopeRepository, private TranslatableStringHelper $translatableStringHelper) {} + public function __construct(private ScopeRepository $scopeRepository, private TranslatableStringHelper $translatableStringHelper) + { + } public function addRole(): ?string { diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/ScopeWorkingOnCourseAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/ScopeWorkingOnCourseAggregator.php index 8b3466158..23159cae8 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/ScopeWorkingOnCourseAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/ScopeWorkingOnCourseAggregator.php @@ -28,7 +28,8 @@ final readonly class ScopeWorkingOnCourseAggregator implements AggregatorInterfa public function __construct( private ScopeRepositoryInterface $scopeRepository, private TranslatableStringHelperInterface $translatableStringHelper, - ) {} + ) { + } public function addRole(): ?string { @@ -72,7 +73,9 @@ final readonly class ScopeWorkingOnCourseAggregator implements AggregatorInterfa return Declarations::ACP_TYPE; } - public function buildForm(FormBuilderInterface $builder) {} + public function buildForm(FormBuilderInterface $builder) + { + } public function getFormDefaultData(): array { @@ -81,7 +84,7 @@ final readonly class ScopeWorkingOnCourseAggregator implements AggregatorInterfa public function getLabels($key, array $values, $data): \Closure { - return function (null|int|string $scopeId) { + return function (int|string|null $scopeId) { if (null === $scopeId || '' === $scopeId) { return ''; } diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/SocialActionAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/SocialActionAggregator.php index 7abad2602..4459d634a 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/SocialActionAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/SocialActionAggregator.php @@ -20,7 +20,9 @@ use Symfony\Component\Form\FormBuilderInterface; final readonly class SocialActionAggregator implements AggregatorInterface { - public function __construct(private SocialActionRender $actionRender, private SocialActionRepository $actionRepository) {} + public function __construct(private SocialActionRender $actionRender, private SocialActionRepository $actionRepository) + { + } public function addRole(): ?string { diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/SocialIssueAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/SocialIssueAggregator.php index 8c0cbfbd5..02746f82a 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/SocialIssueAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/SocialIssueAggregator.php @@ -20,7 +20,9 @@ use Symfony\Component\Form\FormBuilderInterface; final readonly class SocialIssueAggregator implements AggregatorInterface { - public function __construct(private SocialIssueRepository $issueRepository, private SocialIssueRender $issueRender) {} + public function __construct(private SocialIssueRepository $issueRepository, private SocialIssueRender $issueRender) + { + } public function addRole(): ?string { diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/StepAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/StepAggregator.php index a9439a63f..5623a7212 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/StepAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/StepAggregator.php @@ -27,7 +27,9 @@ final readonly class StepAggregator implements AggregatorInterface private const P = 'acp_step_agg_date'; - public function __construct(private RollingDateConverterInterface $rollingDateConverter, private TranslatorInterface $translator) {} + public function __construct(private RollingDateConverterInterface $rollingDateConverter, private TranslatorInterface $translator) + { + } public function addRole(): ?string { diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/UserJobAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/UserJobAggregator.php index 0702edf6f..0bf536929 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/UserJobAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/UserJobAggregator.php @@ -27,7 +27,8 @@ final readonly class UserJobAggregator implements AggregatorInterface public function __construct( private UserJobRepository $jobRepository, private TranslatableStringHelper $translatableStringHelper - ) {} + ) { + } public function addRole(): ?string { @@ -78,7 +79,9 @@ final readonly class UserJobAggregator implements AggregatorInterface return Declarations::ACP_TYPE; } - public function buildForm(FormBuilderInterface $builder) {} + public function buildForm(FormBuilderInterface $builder) + { + } public function getFormDefaultData(): array { diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/UserWorkingOnCourseAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/UserWorkingOnCourseAggregator.php index b27477fd8..b4bc40c10 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/UserWorkingOnCourseAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/UserWorkingOnCourseAggregator.php @@ -27,7 +27,8 @@ final readonly class UserWorkingOnCourseAggregator implements AggregatorInterfac public function __construct( private UserRender $userRender, private UserRepositoryInterface $userRepository, - ) {} + ) { + } public function buildForm(FormBuilderInterface $builder) { @@ -41,7 +42,7 @@ final readonly class UserWorkingOnCourseAggregator implements AggregatorInterfac public function getLabels($key, array $values, $data): \Closure { - return function (null|int|string $userId) { + return function (int|string|null $userId) { if (null === $userId || '' === $userId) { return ''; } diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/EvaluationAggregators/EvaluationTypeAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/EvaluationAggregators/EvaluationTypeAggregator.php index 9ff2ad50a..593e23420 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/EvaluationAggregators/EvaluationTypeAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/EvaluationAggregators/EvaluationTypeAggregator.php @@ -20,7 +20,9 @@ use Symfony\Component\Form\FormBuilderInterface; class EvaluationTypeAggregator implements AggregatorInterface { - public function __construct(private readonly EvaluationRepository $evaluationRepository, private readonly TranslatableStringHelper $translatableStringHelper) {} + public function __construct(private readonly EvaluationRepository $evaluationRepository, private readonly TranslatableStringHelper $translatableStringHelper) + { + } public function addRole(): ?string { diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/EvaluationAggregators/HavingEndDateAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/EvaluationAggregators/HavingEndDateAggregator.php index 4dfddab81..8960cbd86 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/EvaluationAggregators/HavingEndDateAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/EvaluationAggregators/HavingEndDateAggregator.php @@ -19,7 +19,9 @@ use Symfony\Contracts\Translation\TranslatorInterface; class HavingEndDateAggregator implements AggregatorInterface { - public function __construct(private readonly TranslatorInterface $translator) {} + public function __construct(private readonly TranslatorInterface $translator) + { + } public function addRole(): ?string { diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/HouseholdAggregators/ChildrenNumberAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/HouseholdAggregators/ChildrenNumberAggregator.php index 730c570a1..750841337 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/HouseholdAggregators/ChildrenNumberAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/HouseholdAggregators/ChildrenNumberAggregator.php @@ -22,7 +22,9 @@ use Symfony\Component\Form\FormBuilderInterface; class ChildrenNumberAggregator implements AggregatorInterface { - public function __construct(private readonly RollingDateConverterInterface $rollingDateConverter) {} + public function __construct(private readonly RollingDateConverterInterface $rollingDateConverter) + { + } public function addRole(): ?string { @@ -70,7 +72,7 @@ class ChildrenNumberAggregator implements AggregatorInterface public function getLabels($key, array $values, $data) { - return static function (null|int|string $value): string { + return static function (int|string|null $value): string { if ('_header' === $value) { return 'Number of children'; } diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/HouseholdAggregators/CompositionAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/HouseholdAggregators/CompositionAggregator.php index 3dc3a1398..45263dd52 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/HouseholdAggregators/CompositionAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/HouseholdAggregators/CompositionAggregator.php @@ -24,7 +24,9 @@ use Symfony\Component\Form\FormBuilderInterface; class CompositionAggregator implements AggregatorInterface { - public function __construct(private readonly HouseholdCompositionTypeRepository $typeRepository, private readonly TranslatableStringHelper $translatableStringHelper, private readonly RollingDateConverterInterface $rollingDateConverter) {} + public function __construct(private readonly HouseholdCompositionTypeRepository $typeRepository, private readonly TranslatableStringHelper $translatableStringHelper, private readonly RollingDateConverterInterface $rollingDateConverter) + { + } public function addRole(): ?string { diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/AgeAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/AgeAggregator.php index 2ca286b57..68ed28492 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/AgeAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/AgeAggregator.php @@ -24,7 +24,8 @@ final readonly class AgeAggregator implements AggregatorInterface, ExportElement { public function __construct( private RollingDateConverterInterface $rollingDateConverter, - ) {} + ) { + } public function addRole(): ?string { diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/ByHouseholdCompositionAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/ByHouseholdCompositionAggregator.php index af1018f6e..06647dbc7 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/ByHouseholdCompositionAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/ByHouseholdCompositionAggregator.php @@ -27,7 +27,9 @@ class ByHouseholdCompositionAggregator implements AggregatorInterface { private const PREFIX = 'acp_by_household_compo_agg'; - public function __construct(private readonly RollingDateConverterInterface $rollingDateConverter, private readonly HouseholdCompositionTypeRepositoryInterface $householdCompositionTypeRepository, private readonly TranslatableStringHelperInterface $translatableStringHelper) {} + public function __construct(private readonly RollingDateConverterInterface $rollingDateConverter, private readonly HouseholdCompositionTypeRepositoryInterface $householdCompositionTypeRepository, private readonly TranslatableStringHelperInterface $translatableStringHelper) + { + } public function addRole(): ?string { diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/CenterAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/CenterAggregator.php index 4881241f4..fd48bdb01 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/CenterAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/CenterAggregator.php @@ -27,7 +27,8 @@ final readonly class CenterAggregator implements AggregatorInterface public function __construct( private CenterRepositoryInterface $centerRepository, private RollingDateConverterInterface $rollingDateConverter, - ) {} + ) { + } public function buildForm(FormBuilderInterface $builder) { @@ -45,7 +46,7 @@ final readonly class CenterAggregator implements AggregatorInterface public function getLabels($key, array $values, $data): \Closure { - return function (null|int|string $value) { + return function (int|string|null $value) { if (null === $value || '' === $value) { return ''; } diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/CountryOfBirthAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/CountryOfBirthAggregator.php index b8d204dc5..e54714d7a 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/CountryOfBirthAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/CountryOfBirthAggregator.php @@ -25,7 +25,9 @@ use Symfony\Contracts\Translation\TranslatorInterface; final readonly class CountryOfBirthAggregator implements AggregatorInterface, ExportElementValidatedInterface { - public function __construct(private CountryRepository $countriesRepository, private TranslatableStringHelper $translatableStringHelper, private TranslatorInterface $translator) {} + public function __construct(private CountryRepository $countriesRepository, private TranslatableStringHelper $translatableStringHelper, private TranslatorInterface $translator) + { + } public function addRole(): ?string { diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/GenderAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/GenderAggregator.php index 0181c6e7b..05a9273e5 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/GenderAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/GenderAggregator.php @@ -20,7 +20,9 @@ use Symfony\Contracts\Translation\TranslatorInterface; final readonly class GenderAggregator implements AggregatorInterface { - public function __construct(private TranslatorInterface $translator) {} + public function __construct(private TranslatorInterface $translator) + { + } public function addRole(): ?string { @@ -39,7 +41,9 @@ final readonly class GenderAggregator implements AggregatorInterface return Declarations::PERSON_TYPE; } - public function buildForm(FormBuilderInterface $builder) {} + public function buildForm(FormBuilderInterface $builder) + { + } public function getFormDefaultData(): array { diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/GeographicalUnitAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/GeographicalUnitAggregator.php index 8ce51a3ab..8691f8cd3 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/GeographicalUnitAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/GeographicalUnitAggregator.php @@ -26,7 +26,9 @@ use Symfony\Component\Form\FormBuilderInterface; class GeographicalUnitAggregator implements AggregatorInterface { - public function __construct(private readonly GeographicalUnitLayerRepositoryInterface $geographicalUnitLayerRepository, private readonly TranslatableStringHelperInterface $translatableStringHelper, private readonly RollingDateConverterInterface $rollingDateConverter) {} + public function __construct(private readonly GeographicalUnitLayerRepositoryInterface $geographicalUnitLayerRepository, private readonly TranslatableStringHelperInterface $translatableStringHelper, private readonly RollingDateConverterInterface $rollingDateConverter) + { + } public function addRole(): ?string { diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/HouseholdPositionAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/HouseholdPositionAggregator.php index eb1e52d9b..f44b949dc 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/HouseholdPositionAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/HouseholdPositionAggregator.php @@ -28,7 +28,9 @@ use Symfony\Contracts\Translation\TranslatorInterface; final readonly class HouseholdPositionAggregator implements AggregatorInterface, ExportElementValidatedInterface { - public function __construct(private TranslatorInterface $translator, private TranslatableStringHelper $translatableStringHelper, private PositionRepository $positionRepository, private RollingDateConverterInterface $rollingDateConverter) {} + public function __construct(private TranslatorInterface $translator, private TranslatableStringHelper $translatableStringHelper, private PositionRepository $positionRepository, private RollingDateConverterInterface $rollingDateConverter) + { + } public function addRole(): ?string { diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/MaritalStatusAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/MaritalStatusAggregator.php index 1555a5a12..c0f86ea25 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/MaritalStatusAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/MaritalStatusAggregator.php @@ -20,7 +20,9 @@ use Symfony\Component\Form\FormBuilderInterface; final readonly class MaritalStatusAggregator implements AggregatorInterface { - public function __construct(private MaritalStatusRepository $maritalStatusRepository, private TranslatableStringHelper $translatableStringHelper) {} + public function __construct(private MaritalStatusRepository $maritalStatusRepository, private TranslatableStringHelper $translatableStringHelper) + { + } public function addRole(): ?string { diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/NationalityAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/NationalityAggregator.php index 9daca5b34..bc11565e4 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/NationalityAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/NationalityAggregator.php @@ -24,7 +24,9 @@ use Symfony\Contracts\Translation\TranslatorInterface; final readonly class NationalityAggregator implements AggregatorInterface, ExportElementValidatedInterface { - public function __construct(private CountryRepository $countriesRepository, private TranslatableStringHelper $translatableStringHelper, private TranslatorInterface $translator) {} + public function __construct(private CountryRepository $countriesRepository, private TranslatableStringHelper $translatableStringHelper, private TranslatorInterface $translator) + { + } public function addRole(): ?string { diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/PostalCodeAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/PostalCodeAggregator.php index 6f8978ad4..aa06fff61 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/PostalCodeAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/PostalCodeAggregator.php @@ -26,7 +26,8 @@ final readonly class PostalCodeAggregator implements AggregatorInterface public function __construct( private RollingDateConverterInterface $rollingDateConverter, - ) {} + ) { + } public function buildForm(FormBuilderInterface $builder) { @@ -43,7 +44,7 @@ final readonly class PostalCodeAggregator implements AggregatorInterface public function getLabels($key, array $values, mixed $data) { - return function (null|int|string $value): string { + return function (int|string|null $value): string { if ('_header' === $value) { return 'export.aggregator.person.by_postal_code.header'; } diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/ActionTypeAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/ActionTypeAggregator.php index 9abf5c1e7..901bd1cb6 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/ActionTypeAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/ActionTypeAggregator.php @@ -22,7 +22,9 @@ use Symfony\Component\Form\FormBuilderInterface; final readonly class ActionTypeAggregator implements AggregatorInterface { - public function __construct(private SocialActionRepository $socialActionRepository, private SocialActionRender $actionRender, private SocialIssueRender $socialIssueRender, private SocialIssueRepository $socialIssueRepository) {} + public function __construct(private SocialActionRepository $socialActionRepository, private SocialActionRender $actionRender, private SocialIssueRender $socialIssueRender, private SocialIssueRepository $socialIssueRepository) + { + } public function addRole(): ?string { diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/CreatorAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/CreatorAggregator.php index f7c203a4e..d879e42f5 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/CreatorAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/CreatorAggregator.php @@ -25,7 +25,8 @@ class CreatorAggregator implements AggregatorInterface public function __construct( private readonly UserRepository $userRepository, private readonly UserRender $userRender - ) {} + ) { + } public function addRole(): ?string { @@ -46,7 +47,9 @@ class CreatorAggregator implements AggregatorInterface return Declarations::SOCIAL_WORK_ACTION_TYPE; } - public function buildForm(FormBuilderInterface $builder) {} + public function buildForm(FormBuilderInterface $builder) + { + } public function getFormDefaultData(): array { diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/CreatorJobAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/CreatorJobAggregator.php index 1f7fdca5a..ea4499e1d 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/CreatorJobAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/CreatorJobAggregator.php @@ -27,7 +27,8 @@ class CreatorJobAggregator implements AggregatorInterface public function __construct( private readonly UserJobRepository $jobRepository, private readonly TranslatableStringHelper $translatableStringHelper - ) {} + ) { + } public function addRole(): ?string { @@ -63,7 +64,9 @@ class CreatorJobAggregator implements AggregatorInterface return Declarations::SOCIAL_WORK_ACTION_TYPE; } - public function buildForm(FormBuilderInterface $builder) {} + public function buildForm(FormBuilderInterface $builder) + { + } public function getFormDefaultData(): array { diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/CreatorScopeAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/CreatorScopeAggregator.php index c57607693..6654212b0 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/CreatorScopeAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/CreatorScopeAggregator.php @@ -27,7 +27,8 @@ class CreatorScopeAggregator implements AggregatorInterface public function __construct( private readonly ScopeRepository $scopeRepository, private readonly TranslatableStringHelper $translatableStringHelper - ) {} + ) { + } public function addRole(): ?string { @@ -63,7 +64,9 @@ class CreatorScopeAggregator implements AggregatorInterface return Declarations::SOCIAL_WORK_ACTION_TYPE; } - public function buildForm(FormBuilderInterface $builder) {} + public function buildForm(FormBuilderInterface $builder) + { + } public function getFormDefaultData(): array { diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/CurrentActionAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/CurrentActionAggregator.php index a9f8e020a..95e1b8518 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/CurrentActionAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/CurrentActionAggregator.php @@ -19,7 +19,9 @@ use Symfony\Contracts\Translation\TranslatorInterface; class CurrentActionAggregator implements AggregatorInterface { - public function __construct(private readonly TranslatorInterface $translator) {} + public function __construct(private readonly TranslatorInterface $translator) + { + } public function addRole(): ?string { diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/GoalAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/GoalAggregator.php index ce1e381f2..84367578e 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/GoalAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/GoalAggregator.php @@ -20,7 +20,9 @@ use Symfony\Component\Form\FormBuilderInterface; final readonly class GoalAggregator implements AggregatorInterface { - public function __construct(private GoalRepository $goalRepository, private TranslatableStringHelper $translatableStringHelper) {} + public function __construct(private GoalRepository $goalRepository, private TranslatableStringHelper $translatableStringHelper) + { + } public function addRole(): ?string { diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/GoalResultAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/GoalResultAggregator.php index e1549f315..de4e1d46e 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/GoalResultAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/GoalResultAggregator.php @@ -21,7 +21,9 @@ use Symfony\Component\Form\FormBuilderInterface; class GoalResultAggregator implements AggregatorInterface { - public function __construct(private readonly ResultRepository $resultRepository, private readonly GoalRepository $goalRepository, private readonly TranslatableStringHelper $translatableStringHelper) {} + public function __construct(private readonly ResultRepository $resultRepository, private readonly GoalRepository $goalRepository, private readonly TranslatableStringHelper $translatableStringHelper) + { + } public function addRole(): ?string { diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/HandlingThirdPartyAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/HandlingThirdPartyAggregator.php index f58246a25..f02e05f4f 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/HandlingThirdPartyAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/HandlingThirdPartyAggregator.php @@ -25,7 +25,9 @@ final readonly class HandlingThirdPartyAggregator implements AggregatorInterface { private const PREFIX = 'acpw_handling3party_agg'; - public function __construct(private LabelThirdPartyHelper $labelThirdPartyHelper) {} + public function __construct(private LabelThirdPartyHelper $labelThirdPartyHelper) + { + } public function buildForm(FormBuilderInterface $builder) { diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/JobAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/JobAggregator.php index c8336b09b..1cd226e27 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/JobAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/JobAggregator.php @@ -28,7 +28,8 @@ final readonly class JobAggregator implements AggregatorInterface public function __construct( private UserJobRepository $jobRepository, private TranslatableStringHelper $translatableStringHelper - ) {} + ) { + } public function addRole(): ?string { @@ -58,7 +59,9 @@ final readonly class JobAggregator implements AggregatorInterface return Declarations::SOCIAL_WORK_ACTION_TYPE; } - public function buildForm(FormBuilderInterface $builder) {} + public function buildForm(FormBuilderInterface $builder) + { + } public function getFormDefaultData(): array { diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/ReferrerAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/ReferrerAggregator.php index c97229048..9488cb091 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/ReferrerAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/ReferrerAggregator.php @@ -29,7 +29,8 @@ final readonly class ReferrerAggregator implements AggregatorInterface private UserRepository $userRepository, private UserRender $userRender, private RollingDateConverterInterface $rollingDateConverter - ) {} + ) { + } public function addRole(): ?string { diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/ResultAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/ResultAggregator.php index 63a037f21..53628d329 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/ResultAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/ResultAggregator.php @@ -20,7 +20,9 @@ use Symfony\Component\Form\FormBuilderInterface; final readonly class ResultAggregator implements AggregatorInterface { - public function __construct(private ResultRepository $resultRepository, private TranslatableStringHelper $translatableStringHelper) {} + public function __construct(private ResultRepository $resultRepository, private TranslatableStringHelper $translatableStringHelper) + { + } public function addRole(): ?string { diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/ScopeAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/ScopeAggregator.php index dfffaa9e4..060712f6a 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/ScopeAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/ScopeAggregator.php @@ -28,7 +28,8 @@ final readonly class ScopeAggregator implements AggregatorInterface public function __construct( private ScopeRepository $scopeRepository, private TranslatableStringHelper $translatableStringHelper - ) {} + ) { + } public function addRole(): ?string { @@ -58,7 +59,9 @@ final readonly class ScopeAggregator implements AggregatorInterface return Declarations::SOCIAL_WORK_ACTION_TYPE; } - public function buildForm(FormBuilderInterface $builder) {} + public function buildForm(FormBuilderInterface $builder) + { + } public function getFormDefaultData(): array { diff --git a/src/Bundle/ChillPersonBundle/Export/Export/AvgDurationAPWorkPersonAssociatedOnAccompanyingPeriod.php b/src/Bundle/ChillPersonBundle/Export/Export/AvgDurationAPWorkPersonAssociatedOnAccompanyingPeriod.php index ad3f8f745..209bf8889 100644 --- a/src/Bundle/ChillPersonBundle/Export/Export/AvgDurationAPWorkPersonAssociatedOnAccompanyingPeriod.php +++ b/src/Bundle/ChillPersonBundle/Export/Export/AvgDurationAPWorkPersonAssociatedOnAccompanyingPeriod.php @@ -34,7 +34,9 @@ class AvgDurationAPWorkPersonAssociatedOnAccompanyingPeriod implements ExportInt $this->filterStatsByCenters = $parameterBag->get('chill_main')['acl']['filter_stats_by_center']; } - public function buildForm(FormBuilderInterface $builder) {} + public function buildForm(FormBuilderInterface $builder) + { + } public function getFormDefaultData(): array { diff --git a/src/Bundle/ChillPersonBundle/Export/Export/AvgDurationAPWorkPersonAssociatedOnWork.php b/src/Bundle/ChillPersonBundle/Export/Export/AvgDurationAPWorkPersonAssociatedOnWork.php index 8d34837ae..db3b84ce7 100644 --- a/src/Bundle/ChillPersonBundle/Export/Export/AvgDurationAPWorkPersonAssociatedOnWork.php +++ b/src/Bundle/ChillPersonBundle/Export/Export/AvgDurationAPWorkPersonAssociatedOnWork.php @@ -34,7 +34,9 @@ class AvgDurationAPWorkPersonAssociatedOnWork implements ExportInterface, Groupe $this->filterStatsByCenters = $parameterBag->get('chill_main')['acl']['filter_stats_by_center']; } - public function buildForm(FormBuilderInterface $builder) {} + public function buildForm(FormBuilderInterface $builder) + { + } public function getFormDefaultData(): array { diff --git a/src/Bundle/ChillPersonBundle/Export/Export/CountEvaluation.php b/src/Bundle/ChillPersonBundle/Export/Export/CountEvaluation.php index 0cbe7b3e8..c5c66cd01 100644 --- a/src/Bundle/ChillPersonBundle/Export/Export/CountEvaluation.php +++ b/src/Bundle/ChillPersonBundle/Export/Export/CountEvaluation.php @@ -35,7 +35,9 @@ class CountEvaluation implements ExportInterface, GroupedExportInterface $this->filterStatsByCenters = $parameterBag->get('chill_main')['acl']['filter_stats_by_center']; } - public function buildForm(FormBuilderInterface $builder) {} + public function buildForm(FormBuilderInterface $builder) + { + } public function getFormDefaultData(): array { diff --git a/src/Bundle/ChillPersonBundle/Export/Export/ListAccompanyingPeriod.php b/src/Bundle/ChillPersonBundle/Export/Export/ListAccompanyingPeriod.php index 7d0e52169..6c9efcfc3 100644 --- a/src/Bundle/ChillPersonBundle/Export/Export/ListAccompanyingPeriod.php +++ b/src/Bundle/ChillPersonBundle/Export/Export/ListAccompanyingPeriod.php @@ -34,7 +34,8 @@ final readonly class ListAccompanyingPeriod implements ListInterface, GroupedExp private RollingDateConverterInterface $rollingDateConverter, private ListAccompanyingPeriodHelper $listAccompanyingPeriodHelper, private FilterListAccompanyingPeriodHelperInterface $filterListAccompanyingPeriodHelper, - ) {} + ) { + } public function buildForm(FormBuilderInterface $builder) { diff --git a/src/Bundle/ChillPersonBundle/Export/Export/ListAccompanyingPeriodWorkAssociatePersonOnAccompanyingPeriod.php b/src/Bundle/ChillPersonBundle/Export/Export/ListAccompanyingPeriodWorkAssociatePersonOnAccompanyingPeriod.php index 688681e97..6ebfa1bec 100644 --- a/src/Bundle/ChillPersonBundle/Export/Export/ListAccompanyingPeriodWorkAssociatePersonOnAccompanyingPeriod.php +++ b/src/Bundle/ChillPersonBundle/Export/Export/ListAccompanyingPeriodWorkAssociatePersonOnAccompanyingPeriod.php @@ -92,7 +92,8 @@ final readonly class ListAccompanyingPeriodWorkAssociatePersonOnAccompanyingPeri private readonly AggregateStringHelper $aggregateStringHelper, private readonly SocialActionRepository $socialActionRepository, private readonly FilterListAccompanyingPeriodHelperInterface $filterListAccompanyingPeriodHelper, - ) {} + ) { + } public function buildForm(FormBuilderInterface $builder) { diff --git a/src/Bundle/ChillPersonBundle/Export/Export/ListAccompanyingPeriodWorkAssociatePersonOnWork.php b/src/Bundle/ChillPersonBundle/Export/Export/ListAccompanyingPeriodWorkAssociatePersonOnWork.php index ed64da7b0..f55f254b8 100644 --- a/src/Bundle/ChillPersonBundle/Export/Export/ListAccompanyingPeriodWorkAssociatePersonOnWork.php +++ b/src/Bundle/ChillPersonBundle/Export/Export/ListAccompanyingPeriodWorkAssociatePersonOnWork.php @@ -92,7 +92,8 @@ final readonly class ListAccompanyingPeriodWorkAssociatePersonOnWork implements private readonly AggregateStringHelper $aggregateStringHelper, private readonly SocialActionRepository $socialActionRepository, private FilterListAccompanyingPeriodHelperInterface $filterListAccompanyingPeriodHelper, - ) {} + ) { + } public function buildForm(FormBuilderInterface $builder) { diff --git a/src/Bundle/ChillPersonBundle/Export/Export/ListEvaluation.php b/src/Bundle/ChillPersonBundle/Export/Export/ListEvaluation.php index 71d9924be..fe707d56a 100644 --- a/src/Bundle/ChillPersonBundle/Export/Export/ListEvaluation.php +++ b/src/Bundle/ChillPersonBundle/Export/Export/ListEvaluation.php @@ -81,7 +81,8 @@ final readonly class ListEvaluation implements ListInterface, GroupedExportInter private readonly AggregateStringHelper $aggregateStringHelper, private readonly RollingDateConverterInterface $rollingDateConverter, private FilterListAccompanyingPeriodHelperInterface $filterListAccompanyingPeriodHelper, - ) {} + ) { + } public function buildForm(FormBuilderInterface $builder) { diff --git a/src/Bundle/ChillPersonBundle/Export/Export/ListPersonDuplicate.php b/src/Bundle/ChillPersonBundle/Export/Export/ListPersonDuplicate.php index 1a1fd0316..a11df19c7 100644 --- a/src/Bundle/ChillPersonBundle/Export/Export/ListPersonDuplicate.php +++ b/src/Bundle/ChillPersonBundle/Export/Export/ListPersonDuplicate.php @@ -135,7 +135,9 @@ class ListPersonDuplicate implements DirectExportInterface, ExportElementValidat return PersonVoter::DUPLICATE; } - public function validateForm($data, ExecutionContextInterface $context) {} + public function validateForm($data, ExecutionContextInterface $context) + { + } protected function getHeaders(): array { diff --git a/src/Bundle/ChillPersonBundle/Export/Export/ListPersonWithAccompanyingPeriodDetails.php b/src/Bundle/ChillPersonBundle/Export/Export/ListPersonWithAccompanyingPeriodDetails.php index d283c8d8a..d29ba3fde 100644 --- a/src/Bundle/ChillPersonBundle/Export/Export/ListPersonWithAccompanyingPeriodDetails.php +++ b/src/Bundle/ChillPersonBundle/Export/Export/ListPersonWithAccompanyingPeriodDetails.php @@ -41,7 +41,8 @@ final readonly class ListPersonWithAccompanyingPeriodDetails implements ListInte private EntityManagerInterface $entityManager, private RollingDateConverterInterface $rollingDateConverter, private FilterListAccompanyingPeriodHelperInterface $filterListAccompanyingPeriodHelper, - ) {} + ) { + } public function buildForm(FormBuilderInterface $builder) { diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/ActiveOnDateFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/ActiveOnDateFilter.php index 6bcb4f8b8..d34eb7a15 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/ActiveOnDateFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/ActiveOnDateFilter.php @@ -22,7 +22,9 @@ use Symfony\Component\Form\FormBuilderInterface; class ActiveOnDateFilter implements FilterInterface { - public function __construct(private readonly RollingDateConverterInterface $rollingDateConverter) {} + public function __construct(private readonly RollingDateConverterInterface $rollingDateConverter) + { + } public function addRole(): ?string { diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/ActiveOneDayBetweenDatesFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/ActiveOneDayBetweenDatesFilter.php index 3b7c4fe25..fb5d6dc02 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/ActiveOneDayBetweenDatesFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/ActiveOneDayBetweenDatesFilter.php @@ -21,7 +21,9 @@ use Symfony\Component\Form\FormBuilderInterface; class ActiveOneDayBetweenDatesFilter implements FilterInterface { - public function __construct(private readonly RollingDateConverterInterface $rollingDateConverter) {} + public function __construct(private readonly RollingDateConverterInterface $rollingDateConverter) + { + } public function addRole(): ?string { diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/AdministrativeLocationFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/AdministrativeLocationFilter.php index 915a2c9e6..c79f94daf 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/AdministrativeLocationFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/AdministrativeLocationFilter.php @@ -20,7 +20,9 @@ use Symfony\Component\Form\FormBuilderInterface; class AdministrativeLocationFilter implements FilterInterface { - public function __construct(private readonly TranslatableStringHelper $translatableStringHelper) {} + public function __construct(private readonly TranslatableStringHelper $translatableStringHelper) + { + } public function addRole(): ?string { diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/ClosingMotiveFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/ClosingMotiveFilter.php index 7fb032050..442dc505b 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/ClosingMotiveFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/ClosingMotiveFilter.php @@ -22,7 +22,9 @@ use Symfony\Component\Form\FormBuilderInterface; class ClosingMotiveFilter implements FilterInterface { - public function __construct(private readonly TranslatableStringHelper $translatableStringHelper) {} + public function __construct(private readonly TranslatableStringHelper $translatableStringHelper) + { + } public function addRole(): ?string { diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/ConfidentialFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/ConfidentialFilter.php index 4c8baf147..230267904 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/ConfidentialFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/ConfidentialFilter.php @@ -28,7 +28,9 @@ class ConfidentialFilter implements FilterInterface private const DEFAULT_CHOICE = 'false'; - public function __construct(private readonly TranslatorInterface $translator) {} + public function __construct(private readonly TranslatorInterface $translator) + { + } public function addRole(): ?string { diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/CreatorJobFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/CreatorJobFilter.php index cc7e21b08..790afc66b 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/CreatorJobFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/CreatorJobFilter.php @@ -29,7 +29,8 @@ class CreatorJobFilter implements FilterInterface public function __construct( private readonly TranslatableStringHelper $translatableStringHelper, private readonly UserJobRepositoryInterface $userJobRepository - ) {} + ) { + } public function addRole(): ?string { diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/EmergencyFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/EmergencyFilter.php index 671b87407..10528a007 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/EmergencyFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/EmergencyFilter.php @@ -28,7 +28,9 @@ class EmergencyFilter implements FilterInterface private const DEFAULT_CHOICE = 'false'; - public function __construct(private readonly TranslatorInterface $translator) {} + public function __construct(private readonly TranslatorInterface $translator) + { + } public function addRole(): ?string { diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/EvaluationFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/EvaluationFilter.php index bec01c249..95dcb5c62 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/EvaluationFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/EvaluationFilter.php @@ -22,7 +22,9 @@ use Symfony\Component\Form\FormBuilderInterface; class EvaluationFilter implements FilterInterface { - public function __construct(private readonly EvaluationRepositoryInterface $evaluationRepository, private readonly TranslatableStringHelper $translatableStringHelper) {} + public function __construct(private readonly EvaluationRepositoryInterface $evaluationRepository, private readonly TranslatableStringHelper $translatableStringHelper) + { + } public function addRole(): ?string { diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/GeographicalUnitStatFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/GeographicalUnitStatFilter.php index 3b1183c99..ce193e1a4 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/GeographicalUnitStatFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/GeographicalUnitStatFilter.php @@ -33,7 +33,9 @@ use Symfony\Component\Form\FormBuilderInterface; */ class GeographicalUnitStatFilter implements FilterInterface { - public function __construct(private readonly GeographicalUnitRepositoryInterface $geographicalUnitRepository, private readonly GeographicalUnitLayerRepositoryInterface $geographicalUnitLayerRepository, private readonly TranslatableStringHelperInterface $translatableStringHelper, private readonly RollingDateConverterInterface $rollingDateConverter) {} + public function __construct(private readonly GeographicalUnitRepositoryInterface $geographicalUnitRepository, private readonly GeographicalUnitLayerRepositoryInterface $geographicalUnitLayerRepository, private readonly TranslatableStringHelperInterface $translatableStringHelper, private readonly RollingDateConverterInterface $rollingDateConverter) + { + } public function addRole(): ?string { diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/HandlingThirdPartyFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/HandlingThirdPartyFilter.php index 8a9f734aa..818f7567a 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/HandlingThirdPartyFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/HandlingThirdPartyFilter.php @@ -26,7 +26,8 @@ final readonly class HandlingThirdPartyFilter implements FilterInterface public function __construct( private ThirdPartyRender $thirdPartyRender, - ) {} + ) { + } public function getTitle() { diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/HasNoReferrerFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/HasNoReferrerFilter.php index 72bcce39e..7df3ff0d2 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/HasNoReferrerFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/HasNoReferrerFilter.php @@ -22,7 +22,9 @@ use Symfony\Component\Form\FormBuilderInterface; class HasNoReferrerFilter implements FilterInterface { - public function __construct(private readonly RollingDateConverterInterface $rollingDateConverter) {} + public function __construct(private readonly RollingDateConverterInterface $rollingDateConverter) + { + } public function addRole(): ?string { diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/HasTemporaryLocationFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/HasTemporaryLocationFilter.php index 88d1d6933..ca5ccaf27 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/HasTemporaryLocationFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/HasTemporaryLocationFilter.php @@ -22,7 +22,9 @@ use Symfony\Component\Form\FormBuilderInterface; class HasTemporaryLocationFilter implements FilterInterface { - public function __construct(private readonly RollingDateConverterInterface $rollingDateConverter) {} + public function __construct(private readonly RollingDateConverterInterface $rollingDateConverter) + { + } public function addRole(): ?string { diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/HavingAnAccompanyingPeriodInfoWithinDatesFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/HavingAnAccompanyingPeriodInfoWithinDatesFilter.php index d6436f8b4..b6a05a466 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/HavingAnAccompanyingPeriodInfoWithinDatesFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/HavingAnAccompanyingPeriodInfoWithinDatesFilter.php @@ -29,7 +29,8 @@ final readonly class HavingAnAccompanyingPeriodInfoWithinDatesFilter implements { public function __construct( private RollingDateConverterInterface $rollingDateConverter, - ) {} + ) { + } public function buildForm(FormBuilderInterface $builder): void { diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/IntensityFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/IntensityFilter.php index 3eb8bbb24..d1d3de19d 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/IntensityFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/IntensityFilter.php @@ -28,7 +28,9 @@ class IntensityFilter implements FilterInterface private const DEFAULT_CHOICE = 'occasional'; - public function __construct(private readonly TranslatorInterface $translator) {} + public function __construct(private readonly TranslatorInterface $translator) + { + } public function addRole(): ?string { diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/JobWorkingOnCourseFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/JobWorkingOnCourseFilter.php index 099320c95..8ba1b585d 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/JobWorkingOnCourseFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/JobWorkingOnCourseFilter.php @@ -39,7 +39,8 @@ readonly class JobWorkingOnCourseFilter implements FilterInterface private UserJobRepositoryInterface $userJobRepository, private RollingDateConverterInterface $rollingDateConverter, private TranslatableStringHelperInterface $translatableStringHelper, - ) {} + ) { + } public function addRole(): ?string { diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/OpenBetweenDatesFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/OpenBetweenDatesFilter.php index 1b85f6cd7..2427b1637 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/OpenBetweenDatesFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/OpenBetweenDatesFilter.php @@ -22,7 +22,9 @@ use Symfony\Component\Form\FormBuilderInterface; class OpenBetweenDatesFilter implements FilterInterface { - public function __construct(private readonly RollingDateConverterInterface $rollingDateConverter) {} + public function __construct(private readonly RollingDateConverterInterface $rollingDateConverter) + { + } public function addRole(): ?string { diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/OriginFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/OriginFilter.php index 617577cde..7ded268f6 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/OriginFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/OriginFilter.php @@ -22,7 +22,9 @@ use Symfony\Component\Form\FormBuilderInterface; class OriginFilter implements FilterInterface { - public function __construct(private readonly TranslatableStringHelper $translatableStringHelper) {} + public function __construct(private readonly TranslatableStringHelper $translatableStringHelper) + { + } public function addRole(): ?string { diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/ReferrerFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/ReferrerFilter.php index 30f67f664..22a4b560f 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/ReferrerFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/ReferrerFilter.php @@ -28,7 +28,9 @@ class ReferrerFilter implements FilterInterface private const PU = 'acp_referrer_filter_users'; - public function __construct(private readonly RollingDateConverterInterface $rollingDateConverter) {} + public function __construct(private readonly RollingDateConverterInterface $rollingDateConverter) + { + } public function addRole(): ?string { diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/RequestorFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/RequestorFilter.php index 0b7ce6994..90f6953f1 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/RequestorFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/RequestorFilter.php @@ -31,7 +31,9 @@ final readonly class RequestorFilter implements FilterInterface 'no requestor' => 'no_requestor', ]; - public function __construct(private TranslatorInterface $translator, private EntityManagerInterface $em) {} + public function __construct(private TranslatorInterface $translator, private EntityManagerInterface $em) + { + } public function addRole(): ?string { diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/ScopeWorkingOnCourseFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/ScopeWorkingOnCourseFilter.php index 403ddd0b5..9aec79c94 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/ScopeWorkingOnCourseFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/ScopeWorkingOnCourseFilter.php @@ -39,7 +39,8 @@ readonly class ScopeWorkingOnCourseFilter implements FilterInterface private ScopeRepositoryInterface $scopeRepository, private RollingDateConverterInterface $rollingDateConverter, private TranslatableStringHelperInterface $translatableStringHelper, - ) {} + ) { + } public function addRole(): ?string { diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/SocialActionFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/SocialActionFilter.php index dc5ffa042..702c7533c 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/SocialActionFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/SocialActionFilter.php @@ -31,7 +31,8 @@ final readonly class SocialActionFilter implements FilterInterface private SocialActionRender $actionRender, private RollingDateConverterInterface $rollingDateConverter, private TranslatorInterface $translator - ) {} + ) { + } public function addRole(): ?string { diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/StepFilterBetweenDates.php b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/StepFilterBetweenDates.php index dfd627eda..8b0a4c085 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/StepFilterBetweenDates.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/StepFilterBetweenDates.php @@ -39,7 +39,9 @@ class StepFilterBetweenDates implements FilterInterface 'course.inactive_long' => AccompanyingPeriod::STEP_CONFIRMED_INACTIVE_LONG, ]; - public function __construct(private readonly RollingDateConverterInterface $rollingDateConverter, private readonly TranslatorInterface $translator) {} + public function __construct(private readonly RollingDateConverterInterface $rollingDateConverter, private readonly TranslatorInterface $translator) + { + } public function addRole(): ?string { diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/StepFilterOnDate.php b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/StepFilterOnDate.php index 8b36b1b5b..c88bf1e34 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/StepFilterOnDate.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/StepFilterOnDate.php @@ -43,7 +43,9 @@ class StepFilterOnDate implements FilterInterface 'course.inactive_long' => AccompanyingPeriod::STEP_CONFIRMED_INACTIVE_LONG, ]; - public function __construct(private readonly RollingDateConverterInterface $rollingDateConverter, private readonly TranslatorInterface $translator) {} + public function __construct(private readonly RollingDateConverterInterface $rollingDateConverter, private readonly TranslatorInterface $translator) + { + } public function addRole(): ?string { diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/UserJobFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/UserJobFilter.php index 3c6c12c63..d6bc25198 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/UserJobFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/UserJobFilter.php @@ -30,7 +30,8 @@ class UserJobFilter implements FilterInterface public function __construct( private readonly TranslatableStringHelper $translatableStringHelper, private readonly UserJobRepositoryInterface $userJobRepository, - ) {} + ) { + } public function addRole(): ?string { diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/UserScopeFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/UserScopeFilter.php index e7ed194f1..bfbe8e66d 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/UserScopeFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/UserScopeFilter.php @@ -30,7 +30,8 @@ class UserScopeFilter implements FilterInterface public function __construct( private readonly ScopeRepositoryInterface $scopeRepository, private readonly TranslatableStringHelper $translatableStringHelper, - ) {} + ) { + } public function addRole(): ?string { diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/UserWorkingOnCourseFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/UserWorkingOnCourseFilter.php index 85d5db9d6..af7674570 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/UserWorkingOnCourseFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/UserWorkingOnCourseFilter.php @@ -34,7 +34,8 @@ final readonly class UserWorkingOnCourseFilter implements FilterInterface public function __construct( private UserRender $userRender, private RollingDateConverterInterface $rollingDateConverter, - ) {} + ) { + } public function buildForm(FormBuilderInterface $builder): void { diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/EvaluationFilters/ByEndDateFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/EvaluationFilters/ByEndDateFilter.php index a0d8d0033..3bb8eb417 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/EvaluationFilters/ByEndDateFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/EvaluationFilters/ByEndDateFilter.php @@ -21,7 +21,9 @@ use Symfony\Component\Form\FormBuilderInterface; class ByEndDateFilter implements FilterInterface { - public function __construct(private readonly RollingDateConverterInterface $rollingDateConverter) {} + public function __construct(private readonly RollingDateConverterInterface $rollingDateConverter) + { + } public function addRole(): ?string { diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/EvaluationFilters/ByStartDateFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/EvaluationFilters/ByStartDateFilter.php index 401cd79a5..8c46fbfc2 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/EvaluationFilters/ByStartDateFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/EvaluationFilters/ByStartDateFilter.php @@ -21,7 +21,9 @@ use Symfony\Component\Form\FormBuilderInterface; class ByStartDateFilter implements FilterInterface { - public function __construct(private readonly RollingDateConverterInterface $rollingDateConverter) {} + public function __construct(private readonly RollingDateConverterInterface $rollingDateConverter) + { + } public function addRole(): ?string { diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/EvaluationFilters/EvaluationTypeFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/EvaluationFilters/EvaluationTypeFilter.php index 20472420c..fce1600d1 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/EvaluationFilters/EvaluationTypeFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/EvaluationFilters/EvaluationTypeFilter.php @@ -22,7 +22,9 @@ use Symfony\Component\Form\FormBuilderInterface; final readonly class EvaluationTypeFilter implements FilterInterface { - public function __construct(private TranslatableStringHelper $translatableStringHelper, private EvaluationRepositoryInterface $evaluationRepository) {} + public function __construct(private TranslatableStringHelper $translatableStringHelper, private EvaluationRepositoryInterface $evaluationRepository) + { + } public function addRole(): ?string { diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/EvaluationFilters/MaxDateFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/EvaluationFilters/MaxDateFilter.php index 6094d56ee..8555fbac9 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/EvaluationFilters/MaxDateFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/EvaluationFilters/MaxDateFilter.php @@ -25,7 +25,9 @@ class MaxDateFilter implements FilterInterface 'maxdate is not specified' => false, ]; - public function __construct(private readonly TranslatorInterface $translator) {} + public function __construct(private readonly TranslatorInterface $translator) + { + } public function addRole(): ?string { diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/HouseholdFilters/CompositionFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/HouseholdFilters/CompositionFilter.php index 733e41480..c35b9cc69 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/HouseholdFilters/CompositionFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/HouseholdFilters/CompositionFilter.php @@ -28,7 +28,8 @@ readonly class CompositionFilter implements FilterInterface public function __construct( private TranslatableStringHelper $translatableStringHelper, private RollingDateConverterInterface $rollingDateConverter - ) {} + ) { + } public function addRole(): ?string { diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/AddressRefStatusFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/AddressRefStatusFilter.php index 8cd675abe..7c79f473a 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/AddressRefStatusFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/AddressRefStatusFilter.php @@ -23,7 +23,9 @@ use Symfony\Component\Form\FormBuilderInterface; class AddressRefStatusFilter implements \Chill\MainBundle\Export\FilterInterface { - public function __construct(private readonly RollingDateConverterInterface $rollingDateConverter) {} + public function __construct(private readonly RollingDateConverterInterface $rollingDateConverter) + { + } public function addRole(): ?string { diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/AgeFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/AgeFilter.php index aa97ad54c..1c34f90ee 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/AgeFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/AgeFilter.php @@ -25,7 +25,9 @@ use Symfony\Component\Validator\Context\ExecutionContextInterface; class AgeFilter implements ExportElementValidatedInterface, FilterInterface { - public function __construct(private readonly RollingDateConverterInterface $rollingDateConverter) {} + public function __construct(private readonly RollingDateConverterInterface $rollingDateConverter) + { + } public function addRole(): ?string { diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/BirthdateFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/BirthdateFilter.php index dd14c71ef..45d190eee 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/BirthdateFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/BirthdateFilter.php @@ -24,7 +24,9 @@ use Symfony\Component\Validator\Context\ExecutionContextInterface; class BirthdateFilter implements ExportElementValidatedInterface, FilterInterface { - public function __construct(private readonly RollingDateConverterInterface $rollingDateConverter) {} + public function __construct(private readonly RollingDateConverterInterface $rollingDateConverter) + { + } public function addRole(): ?string { diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/ByHouseholdCompositionFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/ByHouseholdCompositionFilter.php index e873a6598..77f4f758f 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/ByHouseholdCompositionFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/ByHouseholdCompositionFilter.php @@ -29,7 +29,9 @@ use Symfony\Component\Form\FormBuilderInterface; class ByHouseholdCompositionFilter implements FilterInterface { - public function __construct(private readonly HouseholdCompositionTypeRepositoryInterface $householdCompositionTypeRepository, private readonly RollingDateConverterInterface $rollingDateConverter, private readonly TranslatableStringHelperInterface $translatableStringHelper) {} + public function __construct(private readonly HouseholdCompositionTypeRepositoryInterface $householdCompositionTypeRepository, private readonly RollingDateConverterInterface $rollingDateConverter, private readonly TranslatableStringHelperInterface $translatableStringHelper) + { + } public function addRole(): ?string { diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/DeadOrAliveFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/DeadOrAliveFilter.php index 82cda25ed..3cbd46a7b 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/DeadOrAliveFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/DeadOrAliveFilter.php @@ -23,7 +23,9 @@ use Symfony\Component\Form\FormBuilderInterface; class DeadOrAliveFilter implements FilterInterface { - public function __construct(private readonly RollingDateConverterInterface $rollingDateConverter) {} + public function __construct(private readonly RollingDateConverterInterface $rollingDateConverter) + { + } public function addRole(): ?string { diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/DeathdateFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/DeathdateFilter.php index 1bc32d9bb..8caf64fbf 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/DeathdateFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/DeathdateFilter.php @@ -24,7 +24,9 @@ use Symfony\Component\Validator\Context\ExecutionContextInterface; class DeathdateFilter implements ExportElementValidatedInterface, FilterInterface { - public function __construct(private readonly RollingDateConverterInterface $rollingDateConverter) {} + public function __construct(private readonly RollingDateConverterInterface $rollingDateConverter) + { + } public function addRole(): ?string { diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/GeographicalUnitFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/GeographicalUnitFilter.php index e2041c3fa..a0aefe75b 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/GeographicalUnitFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/GeographicalUnitFilter.php @@ -27,7 +27,9 @@ use Symfony\Component\Form\FormBuilderInterface; class GeographicalUnitFilter implements \Chill\MainBundle\Export\FilterInterface { - public function __construct(private readonly GeographicalUnitRepositoryInterface $geographicalUnitRepository, private readonly GeographicalUnitLayerRepositoryInterface $geographicalUnitLayerRepository, private readonly TranslatableStringHelperInterface $translatableStringHelper, private readonly RollingDateConverterInterface $rollingDateConverter) {} + public function __construct(private readonly GeographicalUnitRepositoryInterface $geographicalUnitRepository, private readonly GeographicalUnitLayerRepositoryInterface $geographicalUnitLayerRepository, private readonly TranslatableStringHelperInterface $translatableStringHelper, private readonly RollingDateConverterInterface $rollingDateConverter) + { + } public function addRole(): ?string { diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/MaritalStatusFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/MaritalStatusFilter.php index 6c4cdf802..d6af8204d 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/MaritalStatusFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/MaritalStatusFilter.php @@ -19,7 +19,9 @@ use Symfony\Bridge\Doctrine\Form\Type\EntityType; class MaritalStatusFilter implements FilterInterface { - public function __construct(private readonly TranslatableStringHelper $translatableStringHelper) {} + public function __construct(private readonly TranslatableStringHelper $translatableStringHelper) + { + } public function addRole(): ?string { diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/NationalityFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/NationalityFilter.php index 4c83fafe3..556be8188 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/NationalityFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/NationalityFilter.php @@ -26,7 +26,9 @@ class NationalityFilter implements ExportElementValidatedInterface, FilterInterface { - public function __construct(private readonly TranslatableStringHelper $translatableStringHelper) {} + public function __construct(private readonly TranslatableStringHelper $translatableStringHelper) + { + } public function addRole(): ?string { diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/ResidentialAddressAtThirdpartyFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/ResidentialAddressAtThirdpartyFilter.php index ea8e01baf..ff511fe91 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/ResidentialAddressAtThirdpartyFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/ResidentialAddressAtThirdpartyFilter.php @@ -26,7 +26,9 @@ use Symfony\Component\Form\FormBuilderInterface; class ResidentialAddressAtThirdpartyFilter implements FilterInterface { - public function __construct(private readonly RollingDateConverterInterface $rollingDateConverter, private readonly TranslatableStringHelper $translatableStringHelper) {} + public function __construct(private readonly RollingDateConverterInterface $rollingDateConverter, private readonly TranslatableStringHelper $translatableStringHelper) + { + } public function addRole(): ?string { diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/ResidentialAddressAtUserFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/ResidentialAddressAtUserFilter.php index 3c2d7a3a6..acd5ede84 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/ResidentialAddressAtUserFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/ResidentialAddressAtUserFilter.php @@ -23,7 +23,9 @@ use Doctrine\ORM\QueryBuilder; class ResidentialAddressAtUserFilter implements FilterInterface { - public function __construct(private readonly RollingDateConverterInterface $rollingDateConverter) {} + public function __construct(private readonly RollingDateConverterInterface $rollingDateConverter) + { + } public function addRole(): ?string { diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/WithoutHouseholdComposition.php b/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/WithoutHouseholdComposition.php index c34c7eb40..079040b7f 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/WithoutHouseholdComposition.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/WithoutHouseholdComposition.php @@ -24,7 +24,9 @@ use Symfony\Component\Form\FormBuilderInterface; class WithoutHouseholdComposition implements FilterInterface { - public function __construct(private readonly RollingDateConverterInterface $rollingDateConverter) {} + public function __construct(private readonly RollingDateConverterInterface $rollingDateConverter) + { + } public function addRole(): ?string { diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/SocialWorkFilters/AccompanyingPeriodWorkEndDateBetweenDateFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/SocialWorkFilters/AccompanyingPeriodWorkEndDateBetweenDateFilter.php index 32bbbaf6e..92258ccf9 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/SocialWorkFilters/AccompanyingPeriodWorkEndDateBetweenDateFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/SocialWorkFilters/AccompanyingPeriodWorkEndDateBetweenDateFilter.php @@ -24,7 +24,8 @@ final readonly class AccompanyingPeriodWorkEndDateBetweenDateFilter implements F { public function __construct( private RollingDateConverterInterface $rollingDateConverter, - ) {} + ) { + } public function buildForm(FormBuilderInterface $builder): void { diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/SocialWorkFilters/AccompanyingPeriodWorkStartDateBetweenDateFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/SocialWorkFilters/AccompanyingPeriodWorkStartDateBetweenDateFilter.php index 880543355..7b404796e 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/SocialWorkFilters/AccompanyingPeriodWorkStartDateBetweenDateFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/SocialWorkFilters/AccompanyingPeriodWorkStartDateBetweenDateFilter.php @@ -24,7 +24,8 @@ final readonly class AccompanyingPeriodWorkStartDateBetweenDateFilter implements { public function __construct( private RollingDateConverterInterface $rollingDateConverter, - ) {} + ) { + } public function buildForm(FormBuilderInterface $builder): void { diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/SocialWorkFilters/CreatorJobFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/SocialWorkFilters/CreatorJobFilter.php index 2b7a6ef07..d413cdb37 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/SocialWorkFilters/CreatorJobFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/SocialWorkFilters/CreatorJobFilter.php @@ -29,7 +29,8 @@ class CreatorJobFilter implements FilterInterface public function __construct( private readonly UserJobRepository $userJobRepository, private readonly TranslatableStringHelper $translatableStringHelper - ) {} + ) { + } public function addRole(): ?string { diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/SocialWorkFilters/CreatorScopeFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/SocialWorkFilters/CreatorScopeFilter.php index 16ed52755..cedae69f6 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/SocialWorkFilters/CreatorScopeFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/SocialWorkFilters/CreatorScopeFilter.php @@ -29,7 +29,8 @@ class CreatorScopeFilter implements FilterInterface public function __construct( private readonly ScopeRepository $scopeRepository, private readonly TranslatableStringHelper $translatableStringHelper - ) {} + ) { + } public function addRole(): ?string { diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/SocialWorkFilters/JobFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/SocialWorkFilters/JobFilter.php index d3e54f2a5..4622f61f9 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/SocialWorkFilters/JobFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/SocialWorkFilters/JobFilter.php @@ -29,7 +29,8 @@ class JobFilter implements FilterInterface public function __construct( protected TranslatorInterface $translator, private readonly TranslatableStringHelper $translatableStringHelper - ) {} + ) { + } public function addRole(): ?string { diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/SocialWorkFilters/ReferrerFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/SocialWorkFilters/ReferrerFilter.php index 4d456fdb2..3997139c2 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/SocialWorkFilters/ReferrerFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/SocialWorkFilters/ReferrerFilter.php @@ -24,7 +24,9 @@ final readonly class ReferrerFilter implements FilterInterface { private const PREFIX = 'acpw_referrer_filter'; - public function __construct(private RollingDateConverterInterface $rollingDateConverter) {} + public function __construct(private RollingDateConverterInterface $rollingDateConverter) + { + } public function addRole(): ?string { diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/SocialWorkFilters/ScopeFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/SocialWorkFilters/ScopeFilter.php index d4867a884..2569c3d5b 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/SocialWorkFilters/ScopeFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/SocialWorkFilters/ScopeFilter.php @@ -29,7 +29,8 @@ class ScopeFilter implements FilterInterface public function __construct( protected TranslatorInterface $translator, private readonly TranslatableStringHelper $translatableStringHelper - ) {} + ) { + } public function addRole(): ?string { diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/SocialWorkFilters/SocialWorkTypeFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/SocialWorkFilters/SocialWorkTypeFilter.php index c84ed7f40..7204e6e11 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/SocialWorkFilters/SocialWorkTypeFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/SocialWorkFilters/SocialWorkTypeFilter.php @@ -26,7 +26,9 @@ use Symfony\Component\Form\FormBuilderInterface; class SocialWorkTypeFilter implements FilterInterface { - public function __construct(private readonly SocialActionRender $socialActionRender, private readonly TranslatableStringHelper $translatableStringHelper, private readonly EntityManagerInterface $em) {} + public function __construct(private readonly SocialActionRender $socialActionRender, private readonly TranslatableStringHelper $translatableStringHelper, private readonly EntityManagerInterface $em) + { + } public function addRole(): ?string { diff --git a/src/Bundle/ChillPersonBundle/Export/Helper/LabelPersonHelper.php b/src/Bundle/ChillPersonBundle/Export/Helper/LabelPersonHelper.php index 8f75d033c..2b3c3674e 100644 --- a/src/Bundle/ChillPersonBundle/Export/Helper/LabelPersonHelper.php +++ b/src/Bundle/ChillPersonBundle/Export/Helper/LabelPersonHelper.php @@ -16,11 +16,13 @@ use Chill\PersonBundle\Templating\Entity\PersonRenderInterface; class LabelPersonHelper { - public function __construct(private readonly PersonRepository $personRepository, private readonly PersonRenderInterface $personRender) {} + public function __construct(private readonly PersonRepository $personRepository, private readonly PersonRenderInterface $personRender) + { + } public function getLabel(string $key, array $values, string $header): callable { - return function (null|int|string $value) use ($header): string { + return function (int|string|null $value) use ($header): string { if ('_header' === $value) { return $header; } diff --git a/src/Bundle/ChillPersonBundle/Export/Helper/ListAccompanyingPeriodHelper.php b/src/Bundle/ChillPersonBundle/Export/Helper/ListAccompanyingPeriodHelper.php index 30233bb39..5865bb4da 100644 --- a/src/Bundle/ChillPersonBundle/Export/Helper/ListAccompanyingPeriodHelper.php +++ b/src/Bundle/ChillPersonBundle/Export/Helper/ListAccompanyingPeriodHelper.php @@ -79,7 +79,8 @@ final readonly class ListAccompanyingPeriodHelper private TranslatableStringHelperInterface $translatableStringHelper, private TranslatorInterface $translator, private UserHelper $userHelper, - ) {} + ) { + } public function getQueryKeys($data) { diff --git a/src/Bundle/ChillPersonBundle/Export/Helper/ListPersonHelper.php b/src/Bundle/ChillPersonBundle/Export/Helper/ListPersonHelper.php index 576885f2d..eef69e4fc 100644 --- a/src/Bundle/ChillPersonBundle/Export/Helper/ListPersonHelper.php +++ b/src/Bundle/ChillPersonBundle/Export/Helper/ListPersonHelper.php @@ -69,7 +69,9 @@ class ListPersonHelper 'lifecycleUpdate', ]; - public function __construct(private readonly ExportAddressHelper $addressHelper, private readonly CenterRepositoryInterface $centerRepository, private readonly CivilityRepositoryInterface $civilityRepository, private readonly CountryRepository $countryRepository, private readonly LanguageRepositoryInterface $languageRepository, private readonly MaritalStatusRepositoryInterface $maritalStatusRepository, private readonly TranslatableStringHelper $translatableStringHelper, private readonly TranslatorInterface $translator, private readonly UserRepositoryInterface $userRepository) {} + public function __construct(private readonly ExportAddressHelper $addressHelper, private readonly CenterRepositoryInterface $centerRepository, private readonly CivilityRepositoryInterface $civilityRepository, private readonly CountryRepository $countryRepository, private readonly LanguageRepositoryInterface $languageRepository, private readonly MaritalStatusRepositoryInterface $maritalStatusRepository, private readonly TranslatableStringHelper $translatableStringHelper, private readonly TranslatorInterface $translator, private readonly UserRepositoryInterface $userRepository) + { + } /** * Those keys are the "direct" keys, which are created when we decide to use to list all the keys. diff --git a/src/Bundle/ChillPersonBundle/Form/ChoiceLoader/PersonChoiceLoader.php b/src/Bundle/ChillPersonBundle/Form/ChoiceLoader/PersonChoiceLoader.php index 8031de926..9de66b272 100644 --- a/src/Bundle/ChillPersonBundle/Form/ChoiceLoader/PersonChoiceLoader.php +++ b/src/Bundle/ChillPersonBundle/Form/ChoiceLoader/PersonChoiceLoader.php @@ -27,7 +27,7 @@ class PersonChoiceLoader implements ChoiceLoaderInterface public function __construct( protected PersonRepository $personRepository, - array $centers = null + ?array $centers = null ) { if (null !== $centers) { $this->centers = $centers; diff --git a/src/Bundle/ChillPersonBundle/Form/ClosingMotiveType.php b/src/Bundle/ChillPersonBundle/Form/ClosingMotiveType.php index fd7ef3ecb..5116ff1b0 100644 --- a/src/Bundle/ChillPersonBundle/Form/ClosingMotiveType.php +++ b/src/Bundle/ChillPersonBundle/Form/ClosingMotiveType.php @@ -26,7 +26,9 @@ use Symfony\Contracts\Translation\TranslatorInterface; */ class ClosingMotiveType extends AbstractType { - public function __construct(private readonly TranslatorInterface $translator) {} + public function __construct(private readonly TranslatorInterface $translator) + { + } public function buildForm(FormBuilderInterface $builder, array $options) { diff --git a/src/Bundle/ChillPersonBundle/Form/HouseholdCompositionType.php b/src/Bundle/ChillPersonBundle/Form/HouseholdCompositionType.php index 2df66039f..0fe60cbe9 100644 --- a/src/Bundle/ChillPersonBundle/Form/HouseholdCompositionType.php +++ b/src/Bundle/ChillPersonBundle/Form/HouseholdCompositionType.php @@ -22,7 +22,9 @@ use Symfony\Component\Form\FormBuilderInterface; class HouseholdCompositionType extends AbstractType { - public function __construct(private readonly HouseholdCompositionTypeRepository $householdCompositionTypeRepository, private readonly TranslatableStringHelperInterface $translatableStringHelper) {} + public function __construct(private readonly HouseholdCompositionTypeRepository $householdCompositionTypeRepository, private readonly TranslatableStringHelperInterface $translatableStringHelper) + { + } public function buildForm(FormBuilderInterface $builder, array $options) { diff --git a/src/Bundle/ChillPersonBundle/Form/PersonResourceType.php b/src/Bundle/ChillPersonBundle/Form/PersonResourceType.php index 2063b0e21..a4946b52d 100644 --- a/src/Bundle/ChillPersonBundle/Form/PersonResourceType.php +++ b/src/Bundle/ChillPersonBundle/Form/PersonResourceType.php @@ -29,7 +29,9 @@ use Symfony\Contracts\Translation\TranslatorInterface; final class PersonResourceType extends AbstractType { - public function __construct(private readonly ResourceKindRender $resourceKindRender, private readonly PersonRenderInterface $personRender, private readonly ThirdPartyRender $thirdPartyRender, private readonly TranslatorInterface $translator) {} + public function __construct(private readonly ResourceKindRender $resourceKindRender, private readonly PersonRenderInterface $personRender, private readonly ThirdPartyRender $thirdPartyRender, private readonly TranslatorInterface $translator) + { + } public function buildForm(FormBuilderInterface $builder, array $options) { diff --git a/src/Bundle/ChillPersonBundle/Form/PersonType.php b/src/Bundle/ChillPersonBundle/Form/PersonType.php index c971495b6..21717a25b 100644 --- a/src/Bundle/ChillPersonBundle/Form/PersonType.php +++ b/src/Bundle/ChillPersonBundle/Form/PersonType.php @@ -154,7 +154,7 @@ class PersonType extends AbstractType 'allow_delete' => true, 'by_reference' => false, 'label' => false, - 'delete_empty' => static fn (PersonPhone $pp = null) => null === $pp || $pp->isEmpty(), + 'delete_empty' => static fn (?PersonPhone $pp = null) => null === $pp || $pp->isEmpty(), 'error_bubbling' => false, 'empty_collection_explain' => 'No additional phone numbers', ]); diff --git a/src/Bundle/ChillPersonBundle/Form/SocialWork/SocialIssueType.php b/src/Bundle/ChillPersonBundle/Form/SocialWork/SocialIssueType.php index 0d7a3bb4b..cce3ca46d 100644 --- a/src/Bundle/ChillPersonBundle/Form/SocialWork/SocialIssueType.php +++ b/src/Bundle/ChillPersonBundle/Form/SocialWork/SocialIssueType.php @@ -23,7 +23,9 @@ use Symfony\Component\OptionsResolver\OptionsResolver; class SocialIssueType extends AbstractType { - public function __construct(protected TranslatableStringHelperInterface $translatableStringHelper) {} + public function __construct(protected TranslatableStringHelperInterface $translatableStringHelper) + { + } public function buildForm(FormBuilderInterface $builder, array $options) { diff --git a/src/Bundle/ChillPersonBundle/Form/Type/PersonAltNameType.php b/src/Bundle/ChillPersonBundle/Form/Type/PersonAltNameType.php index 6d983be37..17aad8bd0 100644 --- a/src/Bundle/ChillPersonBundle/Form/Type/PersonAltNameType.php +++ b/src/Bundle/ChillPersonBundle/Form/Type/PersonAltNameType.php @@ -21,7 +21,9 @@ use Symfony\Component\OptionsResolver\OptionsResolver; class PersonAltNameType extends AbstractType { - public function __construct(private readonly ConfigPersonAltNamesHelper $configHelper, private readonly TranslatableStringHelper $translatableStringHelper) {} + public function __construct(private readonly ConfigPersonAltNamesHelper $configHelper, private readonly TranslatableStringHelper $translatableStringHelper) + { + } public function buildForm(FormBuilderInterface $builder, array $options) { diff --git a/src/Bundle/ChillPersonBundle/Form/Type/PersonPhoneType.php b/src/Bundle/ChillPersonBundle/Form/Type/PersonPhoneType.php index 0e84bfc83..a55721011 100644 --- a/src/Bundle/ChillPersonBundle/Form/Type/PersonPhoneType.php +++ b/src/Bundle/ChillPersonBundle/Form/Type/PersonPhoneType.php @@ -24,7 +24,9 @@ use Symfony\Component\OptionsResolver\OptionsResolver; class PersonPhoneType extends AbstractType { - public function __construct(private readonly PhonenumberHelper $phonenumberHelper, private readonly EntityManagerInterface $em) {} + public function __construct(private readonly PhonenumberHelper $phonenumberHelper, private readonly EntityManagerInterface $em) + { + } public function buildForm(FormBuilderInterface $builder, array $options) { diff --git a/src/Bundle/ChillPersonBundle/Form/Type/PickPersonDynamicType.php b/src/Bundle/ChillPersonBundle/Form/Type/PickPersonDynamicType.php index c14472cdd..440b6568c 100644 --- a/src/Bundle/ChillPersonBundle/Form/Type/PickPersonDynamicType.php +++ b/src/Bundle/ChillPersonBundle/Form/Type/PickPersonDynamicType.php @@ -26,7 +26,9 @@ use Symfony\Component\Serializer\SerializerInterface; */ class PickPersonDynamicType extends AbstractType { - public function __construct(private readonly DenormalizerInterface $denormalizer, private readonly SerializerInterface $serializer, private readonly NormalizerInterface $normalizer) {} + public function __construct(private readonly DenormalizerInterface $denormalizer, private readonly SerializerInterface $serializer, private readonly NormalizerInterface $normalizer) + { + } public function buildForm(FormBuilderInterface $builder, array $options) { diff --git a/src/Bundle/ChillPersonBundle/Form/Type/PickSocialActionType.php b/src/Bundle/ChillPersonBundle/Form/Type/PickSocialActionType.php index 19258f23d..0fe09e56a 100644 --- a/src/Bundle/ChillPersonBundle/Form/Type/PickSocialActionType.php +++ b/src/Bundle/ChillPersonBundle/Form/Type/PickSocialActionType.php @@ -20,7 +20,9 @@ use Symfony\Component\OptionsResolver\OptionsResolver; class PickSocialActionType extends AbstractType { - public function __construct(private readonly SocialActionRender $actionRender, private readonly SocialActionRepository $actionRepository) {} + public function __construct(private readonly SocialActionRender $actionRender, private readonly SocialActionRepository $actionRepository) + { + } public function configureOptions(OptionsResolver $resolver) { diff --git a/src/Bundle/ChillPersonBundle/Form/Type/PickSocialIssueType.php b/src/Bundle/ChillPersonBundle/Form/Type/PickSocialIssueType.php index b61343423..3e6ae1e97 100644 --- a/src/Bundle/ChillPersonBundle/Form/Type/PickSocialIssueType.php +++ b/src/Bundle/ChillPersonBundle/Form/Type/PickSocialIssueType.php @@ -20,7 +20,9 @@ use Symfony\Component\OptionsResolver\OptionsResolver; class PickSocialIssueType extends AbstractType { - public function __construct(private readonly SocialIssueRender $issueRender, private readonly SocialIssueRepository $issueRepository) {} + public function __construct(private readonly SocialIssueRender $issueRender, private readonly SocialIssueRepository $issueRepository) + { + } public function configureOptions(OptionsResolver $resolver) { diff --git a/src/Bundle/ChillPersonBundle/Form/Type/Select2MaritalStatusType.php b/src/Bundle/ChillPersonBundle/Form/Type/Select2MaritalStatusType.php index b820aa86f..c33244635 100644 --- a/src/Bundle/ChillPersonBundle/Form/Type/Select2MaritalStatusType.php +++ b/src/Bundle/ChillPersonBundle/Form/Type/Select2MaritalStatusType.php @@ -25,17 +25,19 @@ use Symfony\Component\OptionsResolver\OptionsResolver; */ class Select2MaritalStatusType extends AbstractType { - public function __construct(private readonly TranslatableStringHelper $translatableStringHelper, private readonly EntityManagerInterface $em) {} + public function __construct(private readonly TranslatableStringHelper $translatableStringHelper, private readonly EntityManagerInterface $em) + { + } public function buildForm(FormBuilderInterface $builder, array $options) { - $transformer = new ObjectToIdTransformer($this->em, \Chill\PersonBundle\Entity\MaritalStatus::class); + $transformer = new ObjectToIdTransformer($this->em, MaritalStatus::class); $builder->addModelTransformer($transformer); } public function configureOptions(OptionsResolver $resolver) { - $maritalStatuses = $this->em->getRepository(\Chill\PersonBundle\Entity\MaritalStatus::class)->findAll(); + $maritalStatuses = $this->em->getRepository(MaritalStatus::class)->findAll(); $choices = []; foreach ($maritalStatuses as $ms) { diff --git a/src/Bundle/ChillPersonBundle/Household/MembersEditor.php b/src/Bundle/ChillPersonBundle/Household/MembersEditor.php index 3f89202e1..e61fbe105 100644 --- a/src/Bundle/ChillPersonBundle/Household/MembersEditor.php +++ b/src/Bundle/ChillPersonBundle/Household/MembersEditor.php @@ -42,7 +42,8 @@ class MembersEditor private readonly ValidatorInterface $validator, private readonly ?Household $household, private readonly EventDispatcherInterface $eventDispatcher - ) {} + ) { + } /** * Add a person to the household. @@ -52,7 +53,7 @@ class MembersEditor * If the person is also a member of another household, or the same household at the same position, the person * is not associated any more with the previous household. */ - public function addMovement(\DateTimeImmutable $date, Person $person, ?Position $position, ?bool $holder = false, string $comment = null): self + public function addMovement(\DateTimeImmutable $date, Person $person, ?Position $position, ?bool $holder = false, ?string $comment = null): self { if (null === $this->household) { throw new \LogicException('You must define a household first'); diff --git a/src/Bundle/ChillPersonBundle/Household/MembersEditorFactory.php b/src/Bundle/ChillPersonBundle/Household/MembersEditorFactory.php index 7f98fe120..cb6f7d4ea 100644 --- a/src/Bundle/ChillPersonBundle/Household/MembersEditorFactory.php +++ b/src/Bundle/ChillPersonBundle/Household/MembersEditorFactory.php @@ -17,9 +17,11 @@ use Symfony\Contracts\EventDispatcher\EventDispatcherInterface; class MembersEditorFactory { - public function __construct(private readonly EventDispatcherInterface $eventDispatcher, private readonly ValidatorInterface $validator) {} + public function __construct(private readonly EventDispatcherInterface $eventDispatcher, private readonly ValidatorInterface $validator) + { + } - public function createEditor(Household $household = null): MembersEditor + public function createEditor(?Household $household = null): MembersEditor { return new MembersEditor($this->validator, $household, $this->eventDispatcher); } diff --git a/src/Bundle/ChillPersonBundle/Menu/SectionMenuBuilder.php b/src/Bundle/ChillPersonBundle/Menu/SectionMenuBuilder.php index c82038b40..870f021f5 100644 --- a/src/Bundle/ChillPersonBundle/Menu/SectionMenuBuilder.php +++ b/src/Bundle/ChillPersonBundle/Menu/SectionMenuBuilder.php @@ -28,7 +28,9 @@ class SectionMenuBuilder implements LocalMenuBuilderInterface /** * SectionMenuBuilder constructor. */ - public function __construct(protected ParameterBagInterface $parameterBag, private readonly Security $security, protected TranslatorInterface $translator) {} + public function __construct(protected ParameterBagInterface $parameterBag, private readonly Security $security, protected TranslatorInterface $translator) + { + } public function buildMenu($menuId, MenuItem $menu, array $parameters) { diff --git a/src/Bundle/ChillPersonBundle/Notification/AccompanyingPeriodNotificationHandler.php b/src/Bundle/ChillPersonBundle/Notification/AccompanyingPeriodNotificationHandler.php index 668f868ae..4f1146391 100644 --- a/src/Bundle/ChillPersonBundle/Notification/AccompanyingPeriodNotificationHandler.php +++ b/src/Bundle/ChillPersonBundle/Notification/AccompanyingPeriodNotificationHandler.php @@ -18,7 +18,9 @@ use Chill\PersonBundle\Repository\AccompanyingPeriodRepository; final readonly class AccompanyingPeriodNotificationHandler implements NotificationHandlerInterface { - public function __construct(private AccompanyingPeriodRepository $accompanyingPeriodRepository) {} + public function __construct(private AccompanyingPeriodRepository $accompanyingPeriodRepository) + { + } public function getTemplate(Notification $notification, array $options = []): string { diff --git a/src/Bundle/ChillPersonBundle/Notification/AccompanyingPeriodWorkEvaluationDocumentNotificationHandler.php b/src/Bundle/ChillPersonBundle/Notification/AccompanyingPeriodWorkEvaluationDocumentNotificationHandler.php index 40aff8570..f69c49071 100644 --- a/src/Bundle/ChillPersonBundle/Notification/AccompanyingPeriodWorkEvaluationDocumentNotificationHandler.php +++ b/src/Bundle/ChillPersonBundle/Notification/AccompanyingPeriodWorkEvaluationDocumentNotificationHandler.php @@ -18,7 +18,9 @@ use Chill\PersonBundle\Repository\AccompanyingPeriod\AccompanyingPeriodWorkEvalu final readonly class AccompanyingPeriodWorkEvaluationDocumentNotificationHandler implements NotificationHandlerInterface { - public function __construct(private AccompanyingPeriodWorkEvaluationDocumentRepository $accompanyingPeriodWorkEvaluationDocumentRepository) {} + public function __construct(private AccompanyingPeriodWorkEvaluationDocumentRepository $accompanyingPeriodWorkEvaluationDocumentRepository) + { + } public function getTemplate(Notification $notification, array $options = []): string { diff --git a/src/Bundle/ChillPersonBundle/Notification/AccompanyingPeriodWorkNotificationHandler.php b/src/Bundle/ChillPersonBundle/Notification/AccompanyingPeriodWorkNotificationHandler.php index e147fa520..abb8123bc 100644 --- a/src/Bundle/ChillPersonBundle/Notification/AccompanyingPeriodWorkNotificationHandler.php +++ b/src/Bundle/ChillPersonBundle/Notification/AccompanyingPeriodWorkNotificationHandler.php @@ -18,7 +18,9 @@ use Chill\PersonBundle\Repository\AccompanyingPeriod\AccompanyingPeriodWorkRepos final readonly class AccompanyingPeriodWorkNotificationHandler implements NotificationHandlerInterface { - public function __construct(private AccompanyingPeriodWorkRepository $accompanyingPeriodWorkRepository) {} + public function __construct(private AccompanyingPeriodWorkRepository $accompanyingPeriodWorkRepository) + { + } public function getTemplate(Notification $notification, array $options = []): string { diff --git a/src/Bundle/ChillPersonBundle/Privacy/AccompanyingPeriodPrivacyEvent.php b/src/Bundle/ChillPersonBundle/Privacy/AccompanyingPeriodPrivacyEvent.php index 739387941..f6619317f 100644 --- a/src/Bundle/ChillPersonBundle/Privacy/AccompanyingPeriodPrivacyEvent.php +++ b/src/Bundle/ChillPersonBundle/Privacy/AccompanyingPeriodPrivacyEvent.php @@ -37,7 +37,9 @@ class AccompanyingPeriodPrivacyEvent extends \Symfony\Contracts\EventDispatcher\ { final public const ACCOMPANYING_PERIOD_PRIVACY_EVENT = 'chill_person.accompanying_period_privacy_event'; - public function __construct(protected $period, protected $args = []) {} + public function __construct(protected $period, protected $args = []) + { + } public function getArgs(): array { diff --git a/src/Bundle/ChillPersonBundle/Privacy/PrivacyEvent.php b/src/Bundle/ChillPersonBundle/Privacy/PrivacyEvent.php index df57a08fd..4e728c635 100644 --- a/src/Bundle/ChillPersonBundle/Privacy/PrivacyEvent.php +++ b/src/Bundle/ChillPersonBundle/Privacy/PrivacyEvent.php @@ -48,7 +48,9 @@ class PrivacyEvent extends \Symfony\Contracts\EventDispatcher\Event /** * PrivacyEvent constructor. */ - public function __construct(private readonly Person $person, private readonly array $args = ['action' => 'show']) {} + public function __construct(private readonly Person $person, private readonly array $args = ['action' => 'show']) + { + } public function addPerson(Person $person) { diff --git a/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriod/AccompanyingPeriodInfoRepository.php b/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriod/AccompanyingPeriodInfoRepository.php index 0f68efabb..88c89af7c 100644 --- a/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriod/AccompanyingPeriodInfoRepository.php +++ b/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriod/AccompanyingPeriodInfoRepository.php @@ -73,7 +73,7 @@ readonly class AccompanyingPeriodInfoRepository implements AccompanyingPeriodInf return $this->entityRepository->findAll(); } - public function findBy(array $criteria, array $orderBy = null, int $limit = null, int $offset = null): array + public function findBy(array $criteria, ?array $orderBy = null, ?int $limit = null, ?int $offset = null): array { return $this->entityRepository->findBy($criteria, $orderBy, $limit, $offset); } diff --git a/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriod/AccompanyingPeriodWorkEvaluationDocumentRepository.php b/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriod/AccompanyingPeriodWorkEvaluationDocumentRepository.php index a0364188a..59bb3f915 100644 --- a/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriod/AccompanyingPeriodWorkEvaluationDocumentRepository.php +++ b/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriod/AccompanyingPeriodWorkEvaluationDocumentRepository.php @@ -44,7 +44,7 @@ class AccompanyingPeriodWorkEvaluationDocumentRepository implements ObjectReposi * * @return array|object[]|AccompanyingPeriodWorkEvaluationDocument[] */ - public function findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null): array + public function findBy(array $criteria, ?array $orderBy = null, $limit = null, $offset = null): array { return $this->repository->findBy($criteria, $orderBy, $limit, $offset); } diff --git a/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriod/AccompanyingPeriodWorkEvaluationRepository.php b/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriod/AccompanyingPeriodWorkEvaluationRepository.php index 840c44304..9c6ed19fc 100644 --- a/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriod/AccompanyingPeriodWorkEvaluationRepository.php +++ b/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriod/AccompanyingPeriodWorkEvaluationRepository.php @@ -53,7 +53,7 @@ class AccompanyingPeriodWorkEvaluationRepository implements ObjectRepository * * @return array|AccompanyingPeriodWorkEvaluation[] */ - public function findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null): array + public function findBy(array $criteria, ?array $orderBy = null, $limit = null, $offset = null): array { return $this->repository->findBy($criteria, $orderBy, $limit, $offset); } diff --git a/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriod/AccompanyingPeriodWorkRepository.php b/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriod/AccompanyingPeriodWorkRepository.php index f0f00183d..95b995e74 100644 --- a/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriod/AccompanyingPeriodWorkRepository.php +++ b/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriod/AccompanyingPeriodWorkRepository.php @@ -52,7 +52,7 @@ final readonly class AccompanyingPeriodWorkRepository implements ObjectRepositor ->select('count(w)')->getQuery()->getSingleScalarResult(); } - public function createQueryBuilder(string $alias, string $indexBy = null): QueryBuilder + public function createQueryBuilder(string $alias, ?string $indexBy = null): QueryBuilder { return $this->repository->createQueryBuilder($alias, $indexBy); } @@ -67,7 +67,7 @@ final readonly class AccompanyingPeriodWorkRepository implements ObjectRepositor return $this->repository->findAll(); } - public function findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null): array + public function findBy(array $criteria, ?array $orderBy = null, $limit = null, $offset = null): array { return $this->repository->findBy($criteria, $orderBy, $limit, $offset); } diff --git a/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriod/ClosingMotiveRepository.php b/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriod/ClosingMotiveRepository.php index c60bdf4a7..de5df1347 100644 --- a/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriod/ClosingMotiveRepository.php +++ b/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriod/ClosingMotiveRepository.php @@ -41,7 +41,7 @@ final readonly class ClosingMotiveRepository implements ClosingMotiveRepositoryI /** * @return array|ClosingMotive[] */ - public function findBy(array $criteria, array $orderBy = null, int $limit = null, int $offset = null): array + public function findBy(array $criteria, ?array $orderBy = null, ?int $limit = null, ?int $offset = null): array { return $this->repository->findBy($criteria, $orderBy, $limit, $offset); } diff --git a/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriodACLAwareRepository.php b/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriodACLAwareRepository.php index 0a43697c8..e058c4e8d 100644 --- a/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriodACLAwareRepository.php +++ b/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriodACLAwareRepository.php @@ -40,7 +40,8 @@ final readonly class AccompanyingPeriodACLAwareRepository implements Accompanyin private Security $security, private AuthorizationHelperForCurrentUserInterface $authorizationHelper, private CenterResolverManagerInterface $centerResolver - ) {} + ) { + } public function buildQueryOpenedAccompanyingCourseByUserAndPostalCodes(?User $user, array $postalCodes = []): QueryBuilder { @@ -107,8 +108,8 @@ final readonly class AccompanyingPeriodACLAwareRepository implements Accompanyin Person $person, string $role, ?array $orderBy = [], - int $limit = null, - int $offset = null + ?int $limit = null, + ?int $offset = null ): array { $qb = $this->accompanyingPeriodRepository->createQueryBuilder('ap'); $scopes = $this->authorizationHelper @@ -137,7 +138,7 @@ final readonly class AccompanyingPeriodACLAwareRepository implements Accompanyin return $qb->getQuery()->getResult(); } - public function addOrderLimitClauses(QueryBuilder $qb, array $orderBy = null, int $limit = null, int $offset = null): QueryBuilder + public function addOrderLimitClauses(QueryBuilder $qb, ?array $orderBy = null, ?int $limit = null, ?int $offset = null): QueryBuilder { if (null !== $orderBy) { foreach ($orderBy as $field => $order) { @@ -230,7 +231,7 @@ final readonly class AccompanyingPeriodACLAwareRepository implements Accompanyin return $centerOnScopes; } - public function findByUnDispatched(array $jobs, array $services, array $administrativeAdministrativeLocations, array $orderBy = null, int $limit = null, int $offset = null): array + public function findByUnDispatched(array $jobs, array $services, array $administrativeAdministrativeLocations, ?array $orderBy = null, ?int $limit = null, ?int $offset = null): array { $qb = $this->buildQueryUnDispatched($jobs, $services, $administrativeAdministrativeLocations); $qb->select('ap'); diff --git a/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriodACLAwareRepositoryInterface.php b/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriodACLAwareRepositoryInterface.php index 645a4d996..ba3396af8 100644 --- a/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriodACLAwareRepositoryInterface.php +++ b/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriodACLAwareRepositoryInterface.php @@ -40,8 +40,8 @@ interface AccompanyingPeriodACLAwareRepositoryInterface Person $person, string $role, ?array $orderBy = [], - int $limit = null, - int $offset = null + ?int $limit = null, + ?int $offset = null ): array; /** @@ -51,7 +51,7 @@ interface AccompanyingPeriodACLAwareRepositoryInterface * * @return list */ - public function findByUnDispatched(array $jobs, array $services, array $administrativeLocations, array $orderBy = null, int $limit = null, int $offset = null): array; + public function findByUnDispatched(array $jobs, array $services, array $administrativeLocations, ?array $orderBy = null, ?int $limit = null, ?int $offset = null): array; /** * @param array|PostalCode[] $postalCodes diff --git a/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriodRepository.php b/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriodRepository.php index 449df5160..7b681a8f5 100644 --- a/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriodRepository.php +++ b/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriodRepository.php @@ -39,7 +39,7 @@ final class AccompanyingPeriodRepository implements ObjectRepository return $qb->select('count(a)')->getQuery()->getSingleScalarResult(); } - public function createQueryBuilder(string $alias, string $indexBy = null): QueryBuilder + public function createQueryBuilder(string $alias, ?string $indexBy = null): QueryBuilder { return $this->repository->createQueryBuilder($alias, $indexBy); } @@ -57,7 +57,7 @@ final class AccompanyingPeriodRepository implements ObjectRepository return $this->repository->findAll(); } - public function findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null): array + public function findBy(array $criteria, ?array $orderBy = null, $limit = null, $offset = null): array { return $this->repository->findBy($criteria, $orderBy, $limit, $offset); } diff --git a/src/Bundle/ChillPersonBundle/Repository/Household/HouseholdACLAwareRepository.php b/src/Bundle/ChillPersonBundle/Repository/Household/HouseholdACLAwareRepository.php index 26121ffdc..6460ba958 100644 --- a/src/Bundle/ChillPersonBundle/Repository/Household/HouseholdACLAwareRepository.php +++ b/src/Bundle/ChillPersonBundle/Repository/Household/HouseholdACLAwareRepository.php @@ -21,7 +21,9 @@ use Symfony\Component\Security\Core\Security; final readonly class HouseholdACLAwareRepository implements HouseholdACLAwareRepositoryInterface { - public function __construct(private EntityManagerInterface $em, private AuthorizationHelper $authorizationHelper, private Security $security) {} + public function __construct(private EntityManagerInterface $em, private AuthorizationHelper $authorizationHelper, private Security $security) + { + } public function addACL(QueryBuilder $qb, string $alias = 'h'): QueryBuilder { diff --git a/src/Bundle/ChillPersonBundle/Repository/Household/HouseholdCompositionRepository.php b/src/Bundle/ChillPersonBundle/Repository/Household/HouseholdCompositionRepository.php index bf9ffb1ff..5a0dee15d 100644 --- a/src/Bundle/ChillPersonBundle/Repository/Household/HouseholdCompositionRepository.php +++ b/src/Bundle/ChillPersonBundle/Repository/Household/HouseholdCompositionRepository.php @@ -49,7 +49,7 @@ final class HouseholdCompositionRepository implements HouseholdCompositionReposi * * @return array|object[]|HouseholdComposition[] */ - public function findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null): array + public function findBy(array $criteria, ?array $orderBy = null, $limit = null, $offset = null): array { return $this->repository->findBy($criteria, $orderBy, $limit, $offset); } @@ -57,7 +57,7 @@ final class HouseholdCompositionRepository implements HouseholdCompositionReposi /** * @return array|HouseholdComposition[]|object[] */ - public function findByHousehold(Household $household, array $orderBy = null, int $limit = null, int $offset = null): array + public function findByHousehold(Household $household, ?array $orderBy = null, ?int $limit = null, ?int $offset = null): array { return $this->findBy(['household' => $household], $orderBy, $limit, $offset); } diff --git a/src/Bundle/ChillPersonBundle/Repository/Household/HouseholdCompositionRepositoryInterface.php b/src/Bundle/ChillPersonBundle/Repository/Household/HouseholdCompositionRepositoryInterface.php index 3fc4bb46f..84c62392b 100644 --- a/src/Bundle/ChillPersonBundle/Repository/Household/HouseholdCompositionRepositoryInterface.php +++ b/src/Bundle/ChillPersonBundle/Repository/Household/HouseholdCompositionRepositoryInterface.php @@ -32,12 +32,12 @@ interface HouseholdCompositionRepositoryInterface extends ObjectRepository * * @return array|object[]|HouseholdComposition[] */ - public function findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null): array; + public function findBy(array $criteria, ?array $orderBy = null, $limit = null, $offset = null): array; /** * @return array|HouseholdComposition[]|object[] */ - public function findByHousehold(Household $household, array $orderBy = null, int $limit = null, int $offset = null): array; + public function findByHousehold(Household $household, ?array $orderBy = null, ?int $limit = null, ?int $offset = null): array; public function findOneBy(array $criteria): ?HouseholdComposition; diff --git a/src/Bundle/ChillPersonBundle/Repository/Household/HouseholdCompositionTypeRepository.php b/src/Bundle/ChillPersonBundle/Repository/Household/HouseholdCompositionTypeRepository.php index d13b17fe4..2b748865b 100644 --- a/src/Bundle/ChillPersonBundle/Repository/Household/HouseholdCompositionTypeRepository.php +++ b/src/Bundle/ChillPersonBundle/Repository/Household/HouseholdCompositionTypeRepository.php @@ -51,7 +51,7 @@ final class HouseholdCompositionTypeRepository implements HouseholdCompositionTy * * @return array|HouseholdCompositionType[]|object[] */ - public function findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null): array + public function findBy(array $criteria, ?array $orderBy = null, $limit = null, $offset = null): array { return $this->repository->findBy($criteria, $orderBy, $limit, $offset); } diff --git a/src/Bundle/ChillPersonBundle/Repository/Household/HouseholdCompositionTypeRepositoryInterface.php b/src/Bundle/ChillPersonBundle/Repository/Household/HouseholdCompositionTypeRepositoryInterface.php index 4041430d8..2eea434b8 100644 --- a/src/Bundle/ChillPersonBundle/Repository/Household/HouseholdCompositionTypeRepositoryInterface.php +++ b/src/Bundle/ChillPersonBundle/Repository/Household/HouseholdCompositionTypeRepositoryInterface.php @@ -34,7 +34,7 @@ interface HouseholdCompositionTypeRepositoryInterface extends ObjectRepository * * @return array|HouseholdCompositionType[]|object[] */ - public function findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null): array; + public function findBy(array $criteria, ?array $orderBy = null, $limit = null, $offset = null): array; public function findOneBy(array $criteria): ?HouseholdCompositionType; diff --git a/src/Bundle/ChillPersonBundle/Repository/Household/HouseholdRepository.php b/src/Bundle/ChillPersonBundle/Repository/Household/HouseholdRepository.php index 5fa3f22de..2904ffb61 100644 --- a/src/Bundle/ChillPersonBundle/Repository/Household/HouseholdRepository.php +++ b/src/Bundle/ChillPersonBundle/Repository/Household/HouseholdRepository.php @@ -65,7 +65,7 @@ final class HouseholdRepository implements ObjectRepository return $this->repository->findAll(); } - public function findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null) + public function findBy(array $criteria, ?array $orderBy = null, $limit = null, $offset = null) { return $this->repository->findBy($criteria, $orderBy, $limit, $offset); } diff --git a/src/Bundle/ChillPersonBundle/Repository/Household/PersonHouseholdAddressRepository.php b/src/Bundle/ChillPersonBundle/Repository/Household/PersonHouseholdAddressRepository.php index 58c89fb7b..ebcfabe4f 100644 --- a/src/Bundle/ChillPersonBundle/Repository/Household/PersonHouseholdAddressRepository.php +++ b/src/Bundle/ChillPersonBundle/Repository/Household/PersonHouseholdAddressRepository.php @@ -44,12 +44,12 @@ final class PersonHouseholdAddressRepository implements ObjectRepository * * @return PersonHouseholdAddress[] */ - public function findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null): array + public function findBy(array $criteria, ?array $orderBy = null, $limit = null, $offset = null): array { return $this->repository->findBy($criteria, $orderBy, $limit, $offset); } - public function findOneBy(array $criteria, array $orderBy = null): ?PersonHouseholdAddress + public function findOneBy(array $criteria, ?array $orderBy = null): ?PersonHouseholdAddress { return $this->repository->findOneBy($criteria, $orderBy); } diff --git a/src/Bundle/ChillPersonBundle/Repository/Household/PositionRepository.php b/src/Bundle/ChillPersonBundle/Repository/Household/PositionRepository.php index b2fc2b2d1..32ca5b8fa 100644 --- a/src/Bundle/ChillPersonBundle/Repository/Household/PositionRepository.php +++ b/src/Bundle/ChillPersonBundle/Repository/Household/PositionRepository.php @@ -49,7 +49,7 @@ final class PositionRepository implements ObjectRepository * * @return Position[] */ - public function findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null): array + public function findBy(array $criteria, ?array $orderBy = null, $limit = null, $offset = null): array { return $this->repository->findBy($criteria, $orderBy, $limit, $offset); } diff --git a/src/Bundle/ChillPersonBundle/Repository/MaritalStatusRepository.php b/src/Bundle/ChillPersonBundle/Repository/MaritalStatusRepository.php index b2409eace..3324ee444 100644 --- a/src/Bundle/ChillPersonBundle/Repository/MaritalStatusRepository.php +++ b/src/Bundle/ChillPersonBundle/Repository/MaritalStatusRepository.php @@ -34,7 +34,7 @@ class MaritalStatusRepository implements MaritalStatusRepositoryInterface return $this->repository->findAll(); } - public function findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null): array + public function findBy(array $criteria, ?array $orderBy = null, $limit = null, $offset = null): array { return $this->repository->findBy($criteria, $orderBy, $limit, $offset); } diff --git a/src/Bundle/ChillPersonBundle/Repository/MaritalStatusRepositoryInterface.php b/src/Bundle/ChillPersonBundle/Repository/MaritalStatusRepositoryInterface.php index 13be6842e..1f51060e9 100644 --- a/src/Bundle/ChillPersonBundle/Repository/MaritalStatusRepositoryInterface.php +++ b/src/Bundle/ChillPersonBundle/Repository/MaritalStatusRepositoryInterface.php @@ -19,7 +19,7 @@ interface MaritalStatusRepositoryInterface public function findAll(): array; - public function findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null): array; + public function findBy(array $criteria, ?array $orderBy = null, $limit = null, $offset = null): array; public function findOneBy(array $criteria): ?MaritalStatus; diff --git a/src/Bundle/ChillPersonBundle/Repository/Person/PersonCenterHistoryInterface.php b/src/Bundle/ChillPersonBundle/Repository/Person/PersonCenterHistoryInterface.php index fc5d0606d..c1bb427fd 100644 --- a/src/Bundle/ChillPersonBundle/Repository/Person/PersonCenterHistoryInterface.php +++ b/src/Bundle/ChillPersonBundle/Repository/Person/PersonCenterHistoryInterface.php @@ -13,4 +13,6 @@ namespace Chill\PersonBundle\Repository\Person; use Doctrine\Persistence\ObjectRepository; -interface PersonCenterHistoryInterface extends ObjectRepository {} +interface PersonCenterHistoryInterface extends ObjectRepository +{ +} diff --git a/src/Bundle/ChillPersonBundle/Repository/Person/PersonCenterHistoryRepository.php b/src/Bundle/ChillPersonBundle/Repository/Person/PersonCenterHistoryRepository.php index bf8ec9344..b6d80a721 100644 --- a/src/Bundle/ChillPersonBundle/Repository/Person/PersonCenterHistoryRepository.php +++ b/src/Bundle/ChillPersonBundle/Repository/Person/PersonCenterHistoryRepository.php @@ -40,7 +40,7 @@ class PersonCenterHistoryRepository implements PersonCenterHistoryInterface /** * @return array|PersonCenterHistory[] */ - public function findBy(array $criteria, array $orderBy = null, int $limit = null, int $offset = null): array + public function findBy(array $criteria, ?array $orderBy = null, ?int $limit = null, ?int $offset = null): array { return $this->repository->findBy($criteria, $orderBy, $limit, $offset); } diff --git a/src/Bundle/ChillPersonBundle/Repository/PersonACLAwareRepository.php b/src/Bundle/ChillPersonBundle/Repository/PersonACLAwareRepository.php index 0b6b96339..f59f843ac 100644 --- a/src/Bundle/ChillPersonBundle/Repository/PersonACLAwareRepository.php +++ b/src/Bundle/ChillPersonBundle/Repository/PersonACLAwareRepository.php @@ -25,19 +25,21 @@ use Symfony\Component\Security\Core\Security; final readonly class PersonACLAwareRepository implements PersonACLAwareRepositoryInterface { - public function __construct(private Security $security, private EntityManagerInterface $em, private CountryRepository $countryRepository, private AuthorizationHelperInterface $authorizationHelper) {} + public function __construct(private Security $security, private EntityManagerInterface $em, private CountryRepository $countryRepository, private AuthorizationHelperInterface $authorizationHelper) + { + } public function buildAuthorizedQuery( - string $default = null, - string $firstname = null, - string $lastname = null, - \DateTimeInterface $birthdate = null, - \DateTimeInterface $birthdateBefore = null, - \DateTimeInterface $birthdateAfter = null, - string $gender = null, - string $countryCode = null, - string $phonenumber = null, - string $city = null + ?string $default = null, + ?string $firstname = null, + ?string $lastname = null, + ?\DateTimeInterface $birthdate = null, + ?\DateTimeInterface $birthdateBefore = null, + ?\DateTimeInterface $birthdateAfter = null, + ?string $gender = null, + ?string $countryCode = null, + ?string $phonenumber = null, + ?string $city = null ): SearchApiQuery { $query = $this->createSearchQuery( $default, @@ -56,16 +58,16 @@ final readonly class PersonACLAwareRepository implements PersonACLAwareRepositor } public function countBySearchCriteria( - string $default = null, - string $firstname = null, - string $lastname = null, - \DateTimeInterface $birthdate = null, - \DateTimeInterface $birthdateBefore = null, - \DateTimeInterface $birthdateAfter = null, - string $gender = null, - string $countryCode = null, - string $phonenumber = null, - string $city = null + ?string $default = null, + ?string $firstname = null, + ?string $lastname = null, + ?\DateTimeInterface $birthdate = null, + ?\DateTimeInterface $birthdateBefore = null, + ?\DateTimeInterface $birthdateAfter = null, + ?string $gender = null, + ?string $countryCode = null, + ?string $phonenumber = null, + ?string $city = null ): int { $query = $this->buildAuthorizedQuery( $default, @@ -90,16 +92,16 @@ final readonly class PersonACLAwareRepository implements PersonACLAwareRepositor * @throws ParsingException */ public function createSearchQuery( - string $default = null, - string $firstname = null, - string $lastname = null, - \DateTimeInterface $birthdate = null, - \DateTimeInterface $birthdateBefore = null, - \DateTimeInterface $birthdateAfter = null, - string $gender = null, - string $countryCode = null, - string $phonenumber = null, - string $city = null + ?string $default = null, + ?string $firstname = null, + ?string $lastname = null, + ?\DateTimeInterface $birthdate = null, + ?\DateTimeInterface $birthdateBefore = null, + ?\DateTimeInterface $birthdateAfter = null, + ?string $gender = null, + ?string $countryCode = null, + ?string $phonenumber = null, + ?string $city = null ): SearchApiQuery { $query = new SearchApiQuery(); $query @@ -247,16 +249,16 @@ final readonly class PersonACLAwareRepository implements PersonACLAwareRepositor int $start, int $limit, bool $simplify = false, - string $default = null, - string $firstname = null, - string $lastname = null, - \DateTimeInterface $birthdate = null, - \DateTimeInterface $birthdateBefore = null, - \DateTimeInterface $birthdateAfter = null, - string $gender = null, - string $countryCode = null, - string $phonenumber = null, - string $city = null + ?string $default = null, + ?string $firstname = null, + ?string $lastname = null, + ?\DateTimeInterface $birthdate = null, + ?\DateTimeInterface $birthdateBefore = null, + ?\DateTimeInterface $birthdateAfter = null, + ?string $gender = null, + ?string $countryCode = null, + ?string $phonenumber = null, + ?string $city = null ): array { $query = $this->buildAuthorizedQuery( $default, diff --git a/src/Bundle/ChillPersonBundle/Repository/PersonACLAwareRepositoryInterface.php b/src/Bundle/ChillPersonBundle/Repository/PersonACLAwareRepositoryInterface.php index b9f62b89f..c327ecd40 100644 --- a/src/Bundle/ChillPersonBundle/Repository/PersonACLAwareRepositoryInterface.php +++ b/src/Bundle/ChillPersonBundle/Repository/PersonACLAwareRepositoryInterface.php @@ -17,29 +17,29 @@ use Chill\PersonBundle\Entity\Person; interface PersonACLAwareRepositoryInterface { public function buildAuthorizedQuery( - string $default = null, - string $firstname = null, - string $lastname = null, - \DateTimeInterface $birthdate = null, - \DateTimeInterface $birthdateBefore = null, - \DateTimeInterface $birthdateAfter = null, - string $gender = null, - string $countryCode = null, - string $phonenumber = null, - string $city = null + ?string $default = null, + ?string $firstname = null, + ?string $lastname = null, + ?\DateTimeInterface $birthdate = null, + ?\DateTimeInterface $birthdateBefore = null, + ?\DateTimeInterface $birthdateAfter = null, + ?string $gender = null, + ?string $countryCode = null, + ?string $phonenumber = null, + ?string $city = null ): SearchApiQuery; public function countBySearchCriteria( - string $default = null, - string $firstname = null, - string $lastname = null, - \DateTimeInterface $birthdate = null, - \DateTimeInterface $birthdateBefore = null, - \DateTimeInterface $birthdateAfter = null, - string $gender = null, - string $countryCode = null, - string $phonenumber = null, - string $city = null + ?string $default = null, + ?string $firstname = null, + ?string $lastname = null, + ?\DateTimeInterface $birthdate = null, + ?\DateTimeInterface $birthdateBefore = null, + ?\DateTimeInterface $birthdateAfter = null, + ?string $gender = null, + ?string $countryCode = null, + ?string $phonenumber = null, + ?string $city = null ); /** @@ -49,15 +49,15 @@ interface PersonACLAwareRepositoryInterface int $start, int $limit, bool $simplify = false, - string $default = null, - string $firstname = null, - string $lastname = null, - \DateTimeInterface $birthdate = null, - \DateTimeInterface $birthdateBefore = null, - \DateTimeInterface $birthdateAfter = null, - string $gender = null, - string $countryCode = null, - string $phonenumber = null, - string $city = null + ?string $default = null, + ?string $firstname = null, + ?string $lastname = null, + ?\DateTimeInterface $birthdate = null, + ?\DateTimeInterface $birthdateBefore = null, + ?\DateTimeInterface $birthdateAfter = null, + ?string $gender = null, + ?string $countryCode = null, + ?string $phonenumber = null, + ?string $city = null ): array; } diff --git a/src/Bundle/ChillPersonBundle/Repository/PersonRepository.php b/src/Bundle/ChillPersonBundle/Repository/PersonRepository.php index 0d951e3bd..b7104a843 100644 --- a/src/Bundle/ChillPersonBundle/Repository/PersonRepository.php +++ b/src/Bundle/ChillPersonBundle/Repository/PersonRepository.php @@ -44,7 +44,7 @@ class PersonRepository implements ObjectRepository return $qb->getQuery()->getSingleScalarResult(); } - public function createQueryBuilder(string $alias, string $indexBy = null): QueryBuilder + public function createQueryBuilder(string $alias, ?string $indexBy = null): QueryBuilder { return $this->repository->createQueryBuilder($alias, $indexBy); } @@ -59,7 +59,7 @@ class PersonRepository implements ObjectRepository return $this->repository->findAll(); } - public function findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null) + public function findBy(array $criteria, ?array $orderBy = null, $limit = null, $offset = null) { return $this->repository->findBy($criteria, $orderBy, $limit, $offset); } diff --git a/src/Bundle/ChillPersonBundle/Repository/PersonResourceRepository.php b/src/Bundle/ChillPersonBundle/Repository/PersonResourceRepository.php index 04d8d09f9..b2bff2ce5 100644 --- a/src/Bundle/ChillPersonBundle/Repository/PersonResourceRepository.php +++ b/src/Bundle/ChillPersonBundle/Repository/PersonResourceRepository.php @@ -26,7 +26,7 @@ final class PersonResourceRepository implements ObjectRepository $this->repository = $entityManager->getRepository(PersonResource::class); } - public function createQueryBuilder(string $alias, string $indexBy = null): QueryBuilder + public function createQueryBuilder(string $alias, ?string $indexBy = null): QueryBuilder { return $this->repository->createQueryBuilder($alias, $indexBy); } @@ -50,7 +50,7 @@ final class PersonResourceRepository implements ObjectRepository * * @return PersonResource[] */ - public function findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null): array + public function findBy(array $criteria, ?array $orderBy = null, $limit = null, $offset = null): array { return $this->repository->findBy($criteria, $orderBy, $limit, $offset); } diff --git a/src/Bundle/ChillPersonBundle/Repository/Relationships/RelationRepository.php b/src/Bundle/ChillPersonBundle/Repository/Relationships/RelationRepository.php index d66d14572..d3fe813dc 100644 --- a/src/Bundle/ChillPersonBundle/Repository/Relationships/RelationRepository.php +++ b/src/Bundle/ChillPersonBundle/Repository/Relationships/RelationRepository.php @@ -35,7 +35,7 @@ class RelationRepository implements ObjectRepository return $this->repository->findAll(); } - public function findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null): array + public function findBy(array $criteria, ?array $orderBy = null, $limit = null, $offset = null): array { return $this->repository->findBy($criteria, $orderBy, $limit, $offset); } diff --git a/src/Bundle/ChillPersonBundle/Repository/Relationships/RelationshipRepository.php b/src/Bundle/ChillPersonBundle/Repository/Relationships/RelationshipRepository.php index 26ae266d8..932b872c5 100644 --- a/src/Bundle/ChillPersonBundle/Repository/Relationships/RelationshipRepository.php +++ b/src/Bundle/ChillPersonBundle/Repository/Relationships/RelationshipRepository.php @@ -48,7 +48,7 @@ class RelationshipRepository implements ObjectRepository return $this->repository->findAll(); } - public function findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null): array + public function findBy(array $criteria, ?array $orderBy = null, $limit = null, $offset = null): array { return $this->repository->findBy($criteria, $orderBy, $limit, $offset); } diff --git a/src/Bundle/ChillPersonBundle/Repository/ResidentialAddressRepository.php b/src/Bundle/ChillPersonBundle/Repository/ResidentialAddressRepository.php index a866d5eec..22556d747 100644 --- a/src/Bundle/ChillPersonBundle/Repository/ResidentialAddressRepository.php +++ b/src/Bundle/ChillPersonBundle/Repository/ResidentialAddressRepository.php @@ -41,7 +41,7 @@ class ResidentialAddressRepository extends ServiceEntityRepository ->getSingleScalarResult(); } - public function buildQueryFindCurrentResidentialAddresses(Person $person, \DateTimeImmutable $at = null): QueryBuilder + public function buildQueryFindCurrentResidentialAddresses(Person $person, ?\DateTimeImmutable $at = null): QueryBuilder { $date = $at ?? new \DateTimeImmutable('today'); $qb = $this->createQueryBuilder('ra'); @@ -66,7 +66,7 @@ class ResidentialAddressRepository extends ServiceEntityRepository /** * @return array|ResidentialAddress[]|null */ - public function findCurrentResidentialAddressByPerson(Person $person, \DateTimeImmutable $at = null): array + public function findCurrentResidentialAddressByPerson(Person $person, ?\DateTimeImmutable $at = null): array { return $this->buildQueryFindCurrentResidentialAddresses($person, $at) ->select('ra') diff --git a/src/Bundle/ChillPersonBundle/Repository/SocialWork/EvaluationRepository.php b/src/Bundle/ChillPersonBundle/Repository/SocialWork/EvaluationRepository.php index 8391132f1..a7b739f7d 100644 --- a/src/Bundle/ChillPersonBundle/Repository/SocialWork/EvaluationRepository.php +++ b/src/Bundle/ChillPersonBundle/Repository/SocialWork/EvaluationRepository.php @@ -48,12 +48,12 @@ final class EvaluationRepository implements EvaluationRepositoryInterface * * @return array */ - public function findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null): array + public function findBy(array $criteria, ?array $orderBy = null, $limit = null, $offset = null): array { return $this->repository->findBy($criteria, $orderBy, $limit, $offset); } - public function findOneBy(array $criteria, array $orderBy = null): ?Evaluation + public function findOneBy(array $criteria, ?array $orderBy = null): ?Evaluation { return $this->repository->findOneBy($criteria, $orderBy); } diff --git a/src/Bundle/ChillPersonBundle/Repository/SocialWork/EvaluationRepositoryInterface.php b/src/Bundle/ChillPersonBundle/Repository/SocialWork/EvaluationRepositoryInterface.php index cba57efe0..aa1de34eb 100644 --- a/src/Bundle/ChillPersonBundle/Repository/SocialWork/EvaluationRepositoryInterface.php +++ b/src/Bundle/ChillPersonBundle/Repository/SocialWork/EvaluationRepositoryInterface.php @@ -34,9 +34,9 @@ interface EvaluationRepositoryInterface extends ObjectRepository * * @return array */ - public function findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null): array; + public function findBy(array $criteria, ?array $orderBy = null, $limit = null, $offset = null): array; - public function findOneBy(array $criteria, array $orderBy = null): ?Evaluation; + public function findOneBy(array $criteria, ?array $orderBy = null): ?Evaluation; /** * @return class-string diff --git a/src/Bundle/ChillPersonBundle/Repository/SocialWork/GoalRepository.php b/src/Bundle/ChillPersonBundle/Repository/SocialWork/GoalRepository.php index 8a2831996..f99bd54a5 100644 --- a/src/Bundle/ChillPersonBundle/Repository/SocialWork/GoalRepository.php +++ b/src/Bundle/ChillPersonBundle/Repository/SocialWork/GoalRepository.php @@ -56,7 +56,7 @@ final class GoalRepository implements ObjectRepository * * @return array */ - public function findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null): array + public function findBy(array $criteria, ?array $orderBy = null, $limit = null, $offset = null): array { return $this->repository->findBy($criteria, $orderBy, $limit, $offset); } @@ -64,7 +64,7 @@ final class GoalRepository implements ObjectRepository /** * @return Goal[] */ - public function findBySocialActionWithDescendants(SocialAction $action, array $orderBy = [], int $limit = null, int $offset = null): array + public function findBySocialActionWithDescendants(SocialAction $action, array $orderBy = [], ?int $limit = null, ?int $offset = null): array { $qb = $this->buildQueryBySocialActionWithDescendants($action); $qb->select('g'); @@ -88,7 +88,7 @@ final class GoalRepository implements ObjectRepository ->getResult(); } - public function findOneBy(array $criteria, array $orderBy = null): ?Goal + public function findOneBy(array $criteria, ?array $orderBy = null): ?Goal { return $this->repository->findOneBy($criteria, $orderBy); } diff --git a/src/Bundle/ChillPersonBundle/Repository/SocialWork/ResultRepository.php b/src/Bundle/ChillPersonBundle/Repository/SocialWork/ResultRepository.php index 8b8fbfc2b..786c6635a 100644 --- a/src/Bundle/ChillPersonBundle/Repository/SocialWork/ResultRepository.php +++ b/src/Bundle/ChillPersonBundle/Repository/SocialWork/ResultRepository.php @@ -67,7 +67,7 @@ final class ResultRepository implements ObjectRepository * * @return array */ - public function findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null): array + public function findBy(array $criteria, ?array $orderBy = null, $limit = null, $offset = null): array { return $this->repository->findBy($criteria, $orderBy, $limit, $offset); } @@ -75,7 +75,7 @@ final class ResultRepository implements ObjectRepository /** * @return array */ - public function findByGoal(Goal $goal, array $orderBy = null, int $limit = null, int $offset = null): array + public function findByGoal(Goal $goal, ?array $orderBy = null, ?int $limit = null, ?int $offset = null): array { $qb = $this->buildQueryByGoal($goal); @@ -96,7 +96,7 @@ final class ResultRepository implements ObjectRepository /** * @return Result[] */ - public function findBySocialActionWithDescendants(SocialAction $action, array $orderBy = [], int $limit = null, int $offset = null): array + public function findBySocialActionWithDescendants(SocialAction $action, array $orderBy = [], ?int $limit = null, ?int $offset = null): array { $qb = $this->buildQueryBySocialActionWithDescendants($action); $qb->select('r'); @@ -112,7 +112,7 @@ final class ResultRepository implements ObjectRepository ->getResult(); } - public function findOneBy(array $criteria, array $orderBy = null): ?Result + public function findOneBy(array $criteria, ?array $orderBy = null): ?Result { return $this->repository->findOneBy($criteria, $orderBy); } diff --git a/src/Bundle/ChillPersonBundle/Repository/SocialWork/SocialActionRepository.php b/src/Bundle/ChillPersonBundle/Repository/SocialWork/SocialActionRepository.php index 2fc3b35df..da6bfcc46 100644 --- a/src/Bundle/ChillPersonBundle/Repository/SocialWork/SocialActionRepository.php +++ b/src/Bundle/ChillPersonBundle/Repository/SocialWork/SocialActionRepository.php @@ -26,7 +26,7 @@ final class SocialActionRepository implements ObjectRepository $this->repository = $entityManager->getRepository(SocialAction::class); } - public function createQueryBuilder(string $alias, string $indexBy = null): QueryBuilder + public function createQueryBuilder(string $alias, ?string $indexBy = null): QueryBuilder { return $this->repository->createQueryBuilder($alias, $indexBy); } @@ -58,12 +58,12 @@ final class SocialActionRepository implements ObjectRepository * * @return array */ - public function findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null): array + public function findBy(array $criteria, ?array $orderBy = null, $limit = null, $offset = null): array { return $this->repository->findBy($criteria, $orderBy, $limit, $offset); } - public function findOneBy(array $criteria, array $orderBy = null): ?SocialAction + public function findOneBy(array $criteria, ?array $orderBy = null): ?SocialAction { return $this->repository->findOneBy($criteria, $orderBy); } diff --git a/src/Bundle/ChillPersonBundle/Repository/SocialWork/SocialIssueRepository.php b/src/Bundle/ChillPersonBundle/Repository/SocialWork/SocialIssueRepository.php index d3e6fa10f..21f06afd1 100644 --- a/src/Bundle/ChillPersonBundle/Repository/SocialWork/SocialIssueRepository.php +++ b/src/Bundle/ChillPersonBundle/Repository/SocialWork/SocialIssueRepository.php @@ -53,12 +53,12 @@ final class SocialIssueRepository implements ObjectRepository * * @return array */ - public function findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null): array + public function findBy(array $criteria, ?array $orderBy = null, $limit = null, $offset = null): array { return $this->repository->findBy($criteria, $orderBy, $limit, $offset); } - public function findOneBy(array $criteria, array $orderBy = null): ?SocialIssue + public function findOneBy(array $criteria, ?array $orderBy = null): ?SocialIssue { return $this->repository->findOneBy($criteria, $orderBy); } diff --git a/src/Bundle/ChillPersonBundle/Search/PersonSearch.php b/src/Bundle/ChillPersonBundle/Search/PersonSearch.php index 9ca72ecac..b22253abe 100644 --- a/src/Bundle/ChillPersonBundle/Search/PersonSearch.php +++ b/src/Bundle/ChillPersonBundle/Search/PersonSearch.php @@ -36,7 +36,9 @@ class PersonSearch extends AbstractSearch implements HasAdvancedSearchFormInterf 'birthdate-after', 'gender', 'nationality', 'phonenumber', 'city', ]; - public function __construct(private readonly \Twig\Environment $templating, private readonly ExtractDateFromPattern $extractDateFromPattern, private readonly ExtractPhonenumberFromPattern $extractPhonenumberFromPattern, private readonly PaginatorFactory $paginatorFactory, private readonly PersonACLAwareRepositoryInterface $personACLAwareRepository) {} + public function __construct(private readonly \Twig\Environment $templating, private readonly ExtractDateFromPattern $extractDateFromPattern, private readonly ExtractPhonenumberFromPattern $extractPhonenumberFromPattern, private readonly PaginatorFactory $paginatorFactory, private readonly PersonACLAwareRepositoryInterface $personACLAwareRepository) + { + } public function buildForm(FormBuilderInterface $builder) { diff --git a/src/Bundle/ChillPersonBundle/Search/SearchHouseholdApiProvider.php b/src/Bundle/ChillPersonBundle/Search/SearchHouseholdApiProvider.php index 6fdd66a84..1f04df11b 100644 --- a/src/Bundle/ChillPersonBundle/Search/SearchHouseholdApiProvider.php +++ b/src/Bundle/ChillPersonBundle/Search/SearchHouseholdApiProvider.php @@ -22,7 +22,9 @@ use Symfony\Component\Security\Core\Security; class SearchHouseholdApiProvider implements SearchApiInterface { - public function __construct(private readonly HouseholdRepository $householdRepository, private readonly PersonACLAwareRepositoryInterface $personACLAwareRepository, private readonly Security $security, private readonly AuthorizationHelperInterface $authorizationHelper, private readonly ExtractDateFromPattern $extractDateFromPattern, private readonly ExtractPhonenumberFromPattern $extractPhonenumberFromPattern) {} + public function __construct(private readonly HouseholdRepository $householdRepository, private readonly PersonACLAwareRepositoryInterface $personACLAwareRepository, private readonly Security $security, private readonly AuthorizationHelperInterface $authorizationHelper, private readonly ExtractDateFromPattern $extractDateFromPattern, private readonly ExtractPhonenumberFromPattern $extractPhonenumberFromPattern) + { + } public function getResult(string $key, array $metadata, float $pertinence) { diff --git a/src/Bundle/ChillPersonBundle/Search/SearchPersonApiProvider.php b/src/Bundle/ChillPersonBundle/Search/SearchPersonApiProvider.php index 8444a41ec..0d721c657 100644 --- a/src/Bundle/ChillPersonBundle/Search/SearchPersonApiProvider.php +++ b/src/Bundle/ChillPersonBundle/Search/SearchPersonApiProvider.php @@ -22,7 +22,9 @@ use Symfony\Component\Security\Core\Security; class SearchPersonApiProvider implements SearchApiInterface { - public function __construct(private readonly PersonRepository $personRepository, private readonly PersonACLAwareRepositoryInterface $personACLAwareRepository, private readonly Security $security, private readonly AuthorizationHelperInterface $authorizationHelper, private readonly ExtractDateFromPattern $extractDateFromPattern, private readonly ExtractPhonenumberFromPattern $extractPhonenumberFromPattern) {} + public function __construct(private readonly PersonRepository $personRepository, private readonly PersonACLAwareRepositoryInterface $personACLAwareRepository, private readonly Security $security, private readonly AuthorizationHelperInterface $authorizationHelper, private readonly ExtractDateFromPattern $extractDateFromPattern, private readonly ExtractPhonenumberFromPattern $extractPhonenumberFromPattern) + { + } public function getResult(string $key, array $metadata, float $pertinence) { diff --git a/src/Bundle/ChillPersonBundle/Security/Authorization/AccompanyingPeriodCommentVoter.php b/src/Bundle/ChillPersonBundle/Security/Authorization/AccompanyingPeriodCommentVoter.php index 3bba4f5c5..383e76276 100644 --- a/src/Bundle/ChillPersonBundle/Security/Authorization/AccompanyingPeriodCommentVoter.php +++ b/src/Bundle/ChillPersonBundle/Security/Authorization/AccompanyingPeriodCommentVoter.php @@ -22,7 +22,9 @@ class AccompanyingPeriodCommentVoter extends Voter final public const EDIT = 'CHILL_PERSON_ACCOMPANYING_PERIOD_COMMENT_EDIT'; - public function __construct(private readonly Security $security) {} + public function __construct(private readonly Security $security) + { + } protected function supports($attribute, $subject) { diff --git a/src/Bundle/ChillPersonBundle/Security/Authorization/AccompanyingPeriodResourceVoter.php b/src/Bundle/ChillPersonBundle/Security/Authorization/AccompanyingPeriodResourceVoter.php index 5750a7b58..5a59e6b4b 100644 --- a/src/Bundle/ChillPersonBundle/Security/Authorization/AccompanyingPeriodResourceVoter.php +++ b/src/Bundle/ChillPersonBundle/Security/Authorization/AccompanyingPeriodResourceVoter.php @@ -20,7 +20,9 @@ class AccompanyingPeriodResourceVoter extends Voter { final public const EDIT = 'CHILL_PERSON_ACCOMPANYING_PERIOD_RESOURCE_EDIT'; - public function __construct(private readonly AccessDecisionManagerInterface $accessDecisionManager) {} + public function __construct(private readonly AccessDecisionManagerInterface $accessDecisionManager) + { + } protected function supports($attribute, $subject) { diff --git a/src/Bundle/ChillPersonBundle/Security/Authorization/AccompanyingPeriodWorkEvaluationDocumentVoter.php b/src/Bundle/ChillPersonBundle/Security/Authorization/AccompanyingPeriodWorkEvaluationDocumentVoter.php index 77c131cd9..eb49e0cbe 100644 --- a/src/Bundle/ChillPersonBundle/Security/Authorization/AccompanyingPeriodWorkEvaluationDocumentVoter.php +++ b/src/Bundle/ChillPersonBundle/Security/Authorization/AccompanyingPeriodWorkEvaluationDocumentVoter.php @@ -25,7 +25,9 @@ class AccompanyingPeriodWorkEvaluationDocumentVoter extends Voter { final public const SEE = 'CHILL_MAIN_ACCOMPANYING_PERIOD_WORK_EVALUATION_DOCUMENT_SHOW'; - public function __construct(private readonly AccessDecisionManagerInterface $accessDecisionManager) {} + public function __construct(private readonly AccessDecisionManagerInterface $accessDecisionManager) + { + } protected function supports($attribute, $subject) { diff --git a/src/Bundle/ChillPersonBundle/Security/Authorization/AccompanyingPeriodWorkEvaluationVoter.php b/src/Bundle/ChillPersonBundle/Security/Authorization/AccompanyingPeriodWorkEvaluationVoter.php index ce5faca8d..41a464581 100644 --- a/src/Bundle/ChillPersonBundle/Security/Authorization/AccompanyingPeriodWorkEvaluationVoter.php +++ b/src/Bundle/ChillPersonBundle/Security/Authorization/AccompanyingPeriodWorkEvaluationVoter.php @@ -28,7 +28,9 @@ class AccompanyingPeriodWorkEvaluationVoter extends Voter implements ChillVoterI final public const STATS = 'CHILL_MAIN_ACCOMPANYING_PERIOD_WORK_EVALUATION_STATS'; - public function __construct(private readonly Security $security) {} + public function __construct(private readonly Security $security) + { + } protected function supports($attribute, $subject) { diff --git a/src/Bundle/ChillPersonBundle/Serializer/Normalizer/AccompanyingPeriodDocGenNormalizer.php b/src/Bundle/ChillPersonBundle/Serializer/Normalizer/AccompanyingPeriodDocGenNormalizer.php index e266fe0ae..80480cd33 100644 --- a/src/Bundle/ChillPersonBundle/Serializer/Normalizer/AccompanyingPeriodDocGenNormalizer.php +++ b/src/Bundle/ChillPersonBundle/Serializer/Normalizer/AccompanyingPeriodDocGenNormalizer.php @@ -71,7 +71,9 @@ class AccompanyingPeriodDocGenNormalizer implements ContextAwareNormalizerInterf 'pinnedComment' => AccompanyingPeriod\Comment::class, ]; - public function __construct(private readonly TranslatorInterface $translator, private readonly TranslatableStringHelper $translatableStringHelper, private readonly SocialIssueRender $socialIssueRender, private readonly ClosingMotiveRender $closingMotiveRender, private readonly ScopeResolverDispatcher $scopeResolverDispatcher) {} + public function __construct(private readonly TranslatorInterface $translator, private readonly TranslatableStringHelper $translatableStringHelper, private readonly SocialIssueRender $socialIssueRender, private readonly ClosingMotiveRender $closingMotiveRender, private readonly ScopeResolverDispatcher $scopeResolverDispatcher) + { + } /** * @param AccompanyingPeriod|null $period diff --git a/src/Bundle/ChillPersonBundle/Serializer/Normalizer/AccompanyingPeriodResourceNormalizer.php b/src/Bundle/ChillPersonBundle/Serializer/Normalizer/AccompanyingPeriodResourceNormalizer.php index 2e26e96c4..f5720e5bc 100644 --- a/src/Bundle/ChillPersonBundle/Serializer/Normalizer/AccompanyingPeriodResourceNormalizer.php +++ b/src/Bundle/ChillPersonBundle/Serializer/Normalizer/AccompanyingPeriodResourceNormalizer.php @@ -28,7 +28,9 @@ class AccompanyingPeriodResourceNormalizer implements DenormalizerAwareInterface use ObjectToPopulateTrait; - public function __construct(private readonly ResourceRepository $repository) {} + public function __construct(private readonly ResourceRepository $repository) + { + } public function denormalize($data, $type, $format = null, array $context = []) { diff --git a/src/Bundle/ChillPersonBundle/Serializer/Normalizer/AccompanyingPeriodWorkDenormalizer.php b/src/Bundle/ChillPersonBundle/Serializer/Normalizer/AccompanyingPeriodWorkDenormalizer.php index e5cd50f09..036b62ec0 100644 --- a/src/Bundle/ChillPersonBundle/Serializer/Normalizer/AccompanyingPeriodWorkDenormalizer.php +++ b/src/Bundle/ChillPersonBundle/Serializer/Normalizer/AccompanyingPeriodWorkDenormalizer.php @@ -35,7 +35,9 @@ class AccompanyingPeriodWorkDenormalizer implements ContextAwareDenormalizerInte final public const GROUP_EDIT = 'accompanying_period_work:edit'; - public function __construct(private readonly AccompanyingPeriodWorkRepository $workRepository, private readonly EntityManagerInterface $em) {} + public function __construct(private readonly AccompanyingPeriodWorkRepository $workRepository, private readonly EntityManagerInterface $em) + { + } public function denormalize($data, $type, $format = null, array $context = []) { diff --git a/src/Bundle/ChillPersonBundle/Serializer/Normalizer/AccompanyingPeriodWorkEvaluationDocumentNormalizer.php b/src/Bundle/ChillPersonBundle/Serializer/Normalizer/AccompanyingPeriodWorkEvaluationDocumentNormalizer.php index 720bb9c03..b476c2f5f 100644 --- a/src/Bundle/ChillPersonBundle/Serializer/Normalizer/AccompanyingPeriodWorkEvaluationDocumentNormalizer.php +++ b/src/Bundle/ChillPersonBundle/Serializer/Normalizer/AccompanyingPeriodWorkEvaluationDocumentNormalizer.php @@ -25,9 +25,11 @@ class AccompanyingPeriodWorkEvaluationDocumentNormalizer implements ContextAware private const SKIP = 'accompanying_period_work_evaluation_document_skip'; - public function __construct(private readonly EntityWorkflowRepository $entityWorkflowRepository, private readonly MetadataExtractor $metadataExtractor, private readonly Registry $registry) {} + public function __construct(private readonly EntityWorkflowRepository $entityWorkflowRepository, private readonly MetadataExtractor $metadataExtractor, private readonly Registry $registry) + { + } - public function normalize($object, string $format = null, array $context = []): array + public function normalize($object, ?string $format = null, array $context = []): array { $initial = $this->normalizer->normalize($object, $format, array_merge($context, [ self::SKIP => spl_object_hash($object), @@ -47,7 +49,7 @@ class AccompanyingPeriodWorkEvaluationDocumentNormalizer implements ContextAware return $initial; } - public function supportsNormalization($data, string $format = null, array $context = []) + public function supportsNormalization($data, ?string $format = null, array $context = []) { return $data instanceof AccompanyingPeriodWorkEvaluationDocument && 'json' === $format diff --git a/src/Bundle/ChillPersonBundle/Serializer/Normalizer/AccompanyingPeriodWorkEvaluationNormalizer.php b/src/Bundle/ChillPersonBundle/Serializer/Normalizer/AccompanyingPeriodWorkEvaluationNormalizer.php index 67c9209e5..016098535 100644 --- a/src/Bundle/ChillPersonBundle/Serializer/Normalizer/AccompanyingPeriodWorkEvaluationNormalizer.php +++ b/src/Bundle/ChillPersonBundle/Serializer/Normalizer/AccompanyingPeriodWorkEvaluationNormalizer.php @@ -26,12 +26,14 @@ class AccompanyingPeriodWorkEvaluationNormalizer implements ContextAwareNormaliz private const IGNORE_EVALUATION = 'evaluation:ignore'; - public function __construct(private readonly Registry $registry, private readonly EntityWorkflowRepository $entityWorkflowRepository, private readonly MetadataExtractor $metadataExtractor) {} + public function __construct(private readonly Registry $registry, private readonly EntityWorkflowRepository $entityWorkflowRepository, private readonly MetadataExtractor $metadataExtractor) + { + } /** * @param AccompanyingPeriodWorkEvaluation $object */ - public function normalize($object, string $format = null, array $context = []): array + public function normalize($object, ?string $format = null, array $context = []): array { $initial = $this->normalizer->normalize($object, $format, array_merge( $context, @@ -64,7 +66,7 @@ class AccompanyingPeriodWorkEvaluationNormalizer implements ContextAwareNormaliz return $initial; } - public function supportsNormalization($data, string $format = null, array $context = []): bool + public function supportsNormalization($data, ?string $format = null, array $context = []): bool { return 'json' === $format && $data instanceof AccompanyingPeriodWorkEvaluation diff --git a/src/Bundle/ChillPersonBundle/Serializer/Normalizer/AccompanyingPeriodWorkNormalizer.php b/src/Bundle/ChillPersonBundle/Serializer/Normalizer/AccompanyingPeriodWorkNormalizer.php index 81830cabd..94c440519 100644 --- a/src/Bundle/ChillPersonBundle/Serializer/Normalizer/AccompanyingPeriodWorkNormalizer.php +++ b/src/Bundle/ChillPersonBundle/Serializer/Normalizer/AccompanyingPeriodWorkNormalizer.php @@ -29,14 +29,16 @@ class AccompanyingPeriodWorkNormalizer implements ContextAwareNormalizerInterfac private const IGNORE_WORK = 'ignore:work'; - public function __construct(private readonly Registry $registry, private readonly EntityWorkflowRepository $entityWorkflowRepository, private readonly MetadataExtractor $metadataExtractor) {} + public function __construct(private readonly Registry $registry, private readonly EntityWorkflowRepository $entityWorkflowRepository, private readonly MetadataExtractor $metadataExtractor) + { + } /** * @param AccompanyingPeriodWork $object * * @throws ExceptionInterface */ - public function normalize($object, string $format = null, array $context = []): null|array|\ArrayObject|bool|float|int|string + public function normalize($object, ?string $format = null, array $context = []): array|\ArrayObject|bool|float|int|string|null { $initial = $this->normalizer->normalize($object, $format, array_merge( $context, @@ -61,13 +63,15 @@ class AccompanyingPeriodWorkNormalizer implements ContextAwareNormalizerInterfac continue; } - $initial['referrers'][] = $this->normalizer->normalize($referrerHistory->getUser(), - $format, [...$context, UserNormalizer::AT_DATE => $referrerHistory->getStartDate()]); + $initial['referrers'][] = $this->normalizer->normalize( + $referrerHistory->getUser(), + $format, + [...$context, UserNormalizer::AT_DATE => $referrerHistory->getStartDate()] + ); } } - if ($format === 'json') { - + if ('json' === $format) { // then, we add normalization for things which are not into the entity $initial['workflows_availables'] = $this->metadataExtractor->availableWorkflowFor( AccompanyingPeriodWork::class, @@ -93,10 +97,10 @@ class AccompanyingPeriodWorkNormalizer implements ContextAwareNormalizerInterfac return $initial; } - public function supportsNormalization($data, string $format = null, array $context = []): bool + public function supportsNormalization($data, ?string $format = null, array $context = []): bool { return ('json' === $format || 'docgen' === $format) - && ($data instanceof AccompanyingPeriodWork || ('docgen' === $format && $data === null && ($context['docgen:expects'] ?? null) === AccompanyingPeriodWork::class)) + && ($data instanceof AccompanyingPeriodWork || ('docgen' === $format && null === $data && ($context['docgen:expects'] ?? null) === AccompanyingPeriodWork::class)) && !\array_key_exists(self::IGNORE_WORK, $context); } } diff --git a/src/Bundle/ChillPersonBundle/Serializer/Normalizer/MembersEditorNormalizer.php b/src/Bundle/ChillPersonBundle/Serializer/Normalizer/MembersEditorNormalizer.php index 0e358483e..d9679a699 100644 --- a/src/Bundle/ChillPersonBundle/Serializer/Normalizer/MembersEditorNormalizer.php +++ b/src/Bundle/ChillPersonBundle/Serializer/Normalizer/MembersEditorNormalizer.php @@ -27,7 +27,9 @@ class MembersEditorNormalizer implements DenormalizerAwareInterface, Denormalize { use DenormalizerAwareTrait; - public function __construct(private readonly MembersEditorFactory $factory) {} + public function __construct(private readonly MembersEditorFactory $factory) + { + } public function denormalize($data, $type, $format = null, array $context = []) { diff --git a/src/Bundle/ChillPersonBundle/Serializer/Normalizer/PersonDocGenNormalizer.php b/src/Bundle/ChillPersonBundle/Serializer/Normalizer/PersonDocGenNormalizer.php index c8f9cf455..2f2458c90 100644 --- a/src/Bundle/ChillPersonBundle/Serializer/Normalizer/PersonDocGenNormalizer.php +++ b/src/Bundle/ChillPersonBundle/Serializer/Normalizer/PersonDocGenNormalizer.php @@ -40,7 +40,9 @@ class PersonDocGenNormalizer implements private const CIRCULAR_KEY = 'person:circular'; - public function __construct(private readonly PersonRenderInterface $personRender, private readonly RelationshipRepository $relationshipRepository, private readonly TranslatorInterface $translator, private readonly TranslatableStringHelper $translatableStringHelper, private readonly SummaryBudgetInterface $summaryBudget) {} + public function __construct(private readonly PersonRenderInterface $personRender, private readonly RelationshipRepository $relationshipRepository, private readonly TranslatorInterface $translator, private readonly TranslatableStringHelper $translatableStringHelper, private readonly SummaryBudgetInterface $summaryBudget) + { + } public function normalize($person, $format = null, array $context = []) { diff --git a/src/Bundle/ChillPersonBundle/Serializer/Normalizer/PersonJsonNormalizer.php b/src/Bundle/ChillPersonBundle/Serializer/Normalizer/PersonJsonNormalizer.php index eae33f399..3d99adf17 100644 --- a/src/Bundle/ChillPersonBundle/Serializer/Normalizer/PersonJsonNormalizer.php +++ b/src/Bundle/ChillPersonBundle/Serializer/Normalizer/PersonJsonNormalizer.php @@ -48,7 +48,8 @@ class PersonJsonNormalizer implements DenormalizerAwareInterface, NormalizerAwar private readonly CenterResolverManagerInterface $centerResolverManager, private readonly ResidentialAddressRepository $residentialAddressRepository, private readonly PhoneNumberHelperInterface $phoneNumberHelper - ) {} + ) { + } public function denormalize($data, $type, $format = null, array $context = []) { diff --git a/src/Bundle/ChillPersonBundle/Serializer/Normalizer/PersonJsonNormalizerInterface.php b/src/Bundle/ChillPersonBundle/Serializer/Normalizer/PersonJsonNormalizerInterface.php index 36ec86966..96f9ea934 100644 --- a/src/Bundle/ChillPersonBundle/Serializer/Normalizer/PersonJsonNormalizerInterface.php +++ b/src/Bundle/ChillPersonBundle/Serializer/Normalizer/PersonJsonNormalizerInterface.php @@ -19,4 +19,6 @@ use Symfony\Component\Serializer\Normalizer\NormalizerInterface; */ interface PersonJsonNormalizerInterface extends DenormalizerInterface, - NormalizerInterface {} + NormalizerInterface +{ +} diff --git a/src/Bundle/ChillPersonBundle/Serializer/Normalizer/RelationshipDocGenNormalizer.php b/src/Bundle/ChillPersonBundle/Serializer/Normalizer/RelationshipDocGenNormalizer.php index 402f5ff03..78a6d8769 100644 --- a/src/Bundle/ChillPersonBundle/Serializer/Normalizer/RelationshipDocGenNormalizer.php +++ b/src/Bundle/ChillPersonBundle/Serializer/Normalizer/RelationshipDocGenNormalizer.php @@ -22,7 +22,9 @@ class RelationshipDocGenNormalizer implements ContextAwareNormalizerInterface, N { use NormalizerAwareTrait; - public function __construct(private readonly TranslatableStringHelperInterface $translatableStringHelper) {} + public function __construct(private readonly TranslatableStringHelperInterface $translatableStringHelper) + { + } /** * @param Relationship $relation diff --git a/src/Bundle/ChillPersonBundle/Serializer/Normalizer/SocialActionNormalizer.php b/src/Bundle/ChillPersonBundle/Serializer/Normalizer/SocialActionNormalizer.php index 78a91bd9c..12c36b286 100644 --- a/src/Bundle/ChillPersonBundle/Serializer/Normalizer/SocialActionNormalizer.php +++ b/src/Bundle/ChillPersonBundle/Serializer/Normalizer/SocialActionNormalizer.php @@ -21,7 +21,9 @@ class SocialActionNormalizer implements NormalizerAwareInterface, NormalizerInte { use NormalizerAwareTrait; - public function __construct(private readonly SocialActionRender $render) {} + public function __construct(private readonly SocialActionRender $render) + { + } public function normalize($socialAction, $format = null, array $context = []) { diff --git a/src/Bundle/ChillPersonBundle/Serializer/Normalizer/SocialIssueNormalizer.php b/src/Bundle/ChillPersonBundle/Serializer/Normalizer/SocialIssueNormalizer.php index 778336d2b..e2a60b20c 100644 --- a/src/Bundle/ChillPersonBundle/Serializer/Normalizer/SocialIssueNormalizer.php +++ b/src/Bundle/ChillPersonBundle/Serializer/Normalizer/SocialIssueNormalizer.php @@ -21,7 +21,9 @@ class SocialIssueNormalizer implements ContextAwareNormalizerInterface, Normaliz { use NormalizerAwareTrait; - public function __construct(private readonly SocialIssueRender $render) {} + public function __construct(private readonly SocialIssueRender $render) + { + } public function normalize($socialIssue, $format = null, array $context = []) { diff --git a/src/Bundle/ChillPersonBundle/Serializer/Normalizer/WorkflowNormalizer.php b/src/Bundle/ChillPersonBundle/Serializer/Normalizer/WorkflowNormalizer.php index 41666e576..99314ebdc 100644 --- a/src/Bundle/ChillPersonBundle/Serializer/Normalizer/WorkflowNormalizer.php +++ b/src/Bundle/ChillPersonBundle/Serializer/Normalizer/WorkflowNormalizer.php @@ -25,7 +25,9 @@ class WorkflowNormalizer implements ContextAwareNormalizerInterface, NormalizerA private const IGNORE_ENTITY_WORKFLOW = 'ignore:entity_workflow'; - public function __construct(private readonly Registry $registry, private readonly MetadataExtractor $metadataExtractor) {} + public function __construct(private readonly Registry $registry, private readonly MetadataExtractor $metadataExtractor) + { + } /** * @param EntityWorkflow $object @@ -34,7 +36,7 @@ class WorkflowNormalizer implements ContextAwareNormalizerInterface, NormalizerA * * @throws ExceptionInterface */ - public function normalize($object, string $format = null, array $context = []): array + public function normalize($object, ?string $format = null, array $context = []): array { $data = $this->normalizer->normalize($object, $format, array_merge( $context, @@ -51,7 +53,7 @@ class WorkflowNormalizer implements ContextAwareNormalizerInterface, NormalizerA return $data; } - public function supportsNormalization($data, string $format = null, array $context = []): bool + public function supportsNormalization($data, ?string $format = null, array $context = []): bool { return 'json' === $format && $data instanceof EntityWorkflow diff --git a/src/Bundle/ChillPersonBundle/Service/AccompanyingPeriod/OldDraftAccompanyingPeriodRemover.php b/src/Bundle/ChillPersonBundle/Service/AccompanyingPeriod/OldDraftAccompanyingPeriodRemover.php index 44d2e38d5..d82156994 100644 --- a/src/Bundle/ChillPersonBundle/Service/AccompanyingPeriod/OldDraftAccompanyingPeriodRemover.php +++ b/src/Bundle/ChillPersonBundle/Service/AccompanyingPeriod/OldDraftAccompanyingPeriodRemover.php @@ -20,7 +20,9 @@ use Psr\Log\LoggerInterface; class OldDraftAccompanyingPeriodRemover implements OldDraftAccompanyingPeriodRemoverInterface { - public function __construct(private readonly EntityManagerInterface $em, private readonly LoggerInterface $logger) {} + public function __construct(private readonly EntityManagerInterface $em, private readonly LoggerInterface $logger) + { + } public function remove(\DateInterval $interval): void { diff --git a/src/Bundle/ChillPersonBundle/Service/DocGenerator/AccompanyingPeriodContext.php b/src/Bundle/ChillPersonBundle/Service/DocGenerator/AccompanyingPeriodContext.php index b01e7c5f3..592ab21fb 100644 --- a/src/Bundle/ChillPersonBundle/Service/DocGenerator/AccompanyingPeriodContext.php +++ b/src/Bundle/ChillPersonBundle/Service/DocGenerator/AccompanyingPeriodContext.php @@ -60,7 +60,8 @@ class AccompanyingPeriodContext implements private readonly BaseContextData $baseContextData, private readonly ThirdPartyRender $thirdPartyRender, private readonly ThirdPartyRepository $thirdPartyRepository - ) {} + ) { + } public function adminFormReverseTransform(array $data): array { diff --git a/src/Bundle/ChillPersonBundle/Service/DocGenerator/AccompanyingPeriodWorkContext.php b/src/Bundle/ChillPersonBundle/Service/DocGenerator/AccompanyingPeriodWorkContext.php index 4c1be8159..c3f754eab 100644 --- a/src/Bundle/ChillPersonBundle/Service/DocGenerator/AccompanyingPeriodWorkContext.php +++ b/src/Bundle/ChillPersonBundle/Service/DocGenerator/AccompanyingPeriodWorkContext.php @@ -29,7 +29,9 @@ use Symfony\Component\Serializer\Normalizer\NormalizerInterface; */ class AccompanyingPeriodWorkContext implements DocGeneratorContextWithPublicFormInterface { - public function __construct(private readonly AccompanyingPeriodContext $periodContext, private readonly NormalizerInterface $normalizer) {} + public function __construct(private readonly AccompanyingPeriodContext $periodContext, private readonly NormalizerInterface $normalizer) + { + } public function adminFormReverseTransform(array $data): array { diff --git a/src/Bundle/ChillPersonBundle/Service/DocGenerator/AccompanyingPeriodWorkEvaluationContext.php b/src/Bundle/ChillPersonBundle/Service/DocGenerator/AccompanyingPeriodWorkEvaluationContext.php index 6ecaa99b4..8887e65c9 100644 --- a/src/Bundle/ChillPersonBundle/Service/DocGenerator/AccompanyingPeriodWorkEvaluationContext.php +++ b/src/Bundle/ChillPersonBundle/Service/DocGenerator/AccompanyingPeriodWorkEvaluationContext.php @@ -37,7 +37,9 @@ class AccompanyingPeriodWorkEvaluationContext implements DocGeneratorContextWithAdminFormInterface, DocGeneratorContextWithPublicFormInterface { - public function __construct(private readonly AccompanyingPeriodWorkContext $accompanyingPeriodWorkContext, private readonly EntityManagerInterface $em, private readonly EvaluationRepository $evaluationRepository, private readonly NormalizerInterface $normalizer, private readonly TranslatableStringHelperInterface $translatableStringHelper, private readonly ThirdPartyRender $thirdPartyRender, private readonly TranslatorInterface $translator) {} + public function __construct(private readonly AccompanyingPeriodWorkContext $accompanyingPeriodWorkContext, private readonly EntityManagerInterface $em, private readonly EvaluationRepository $evaluationRepository, private readonly NormalizerInterface $normalizer, private readonly TranslatableStringHelperInterface $translatableStringHelper, private readonly ThirdPartyRender $thirdPartyRender, private readonly TranslatorInterface $translator) + { + } public function adminFormReverseTransform(array $data): array { diff --git a/src/Bundle/ChillPersonBundle/Service/DocGenerator/PersonContextWithThirdParty.php b/src/Bundle/ChillPersonBundle/Service/DocGenerator/PersonContextWithThirdParty.php index 7f142fdbf..d865d686a 100644 --- a/src/Bundle/ChillPersonBundle/Service/DocGenerator/PersonContextWithThirdParty.php +++ b/src/Bundle/ChillPersonBundle/Service/DocGenerator/PersonContextWithThirdParty.php @@ -31,7 +31,8 @@ class PersonContextWithThirdParty implements DocGeneratorContextWithAdminFormInt private readonly PersonContextInterface $personContext, private readonly NormalizerInterface $normalizer, private readonly ThirdPartyRepository $thirdPartyRepository - ) {} + ) { + } public function adminFormReverseTransform(array $data): array { diff --git a/src/Bundle/ChillPersonBundle/Service/EntityInfo/AccompanyingPeriodViewEntityInfoProvider.php b/src/Bundle/ChillPersonBundle/Service/EntityInfo/AccompanyingPeriodViewEntityInfoProvider.php index 19059ef47..a157c392b 100644 --- a/src/Bundle/ChillPersonBundle/Service/EntityInfo/AccompanyingPeriodViewEntityInfoProvider.php +++ b/src/Bundle/ChillPersonBundle/Service/EntityInfo/AccompanyingPeriodViewEntityInfoProvider.php @@ -21,7 +21,8 @@ class AccompanyingPeriodViewEntityInfoProvider implements ViewEntityInfoProvider */ private readonly iterable $unions, private readonly AccompanyingPeriodInfoQueryBuilder $builder, - ) {} + ) { + } public function getViewQuery(): string { diff --git a/src/Bundle/ChillPersonBundle/Service/GenericDoc/Providers/AccompanyingPeriodWorkEvaluationGenericDocProvider.php b/src/Bundle/ChillPersonBundle/Service/GenericDoc/Providers/AccompanyingPeriodWorkEvaluationGenericDocProvider.php index 40e85b368..7d6e199bd 100644 --- a/src/Bundle/ChillPersonBundle/Service/GenericDoc/Providers/AccompanyingPeriodWorkEvaluationGenericDocProvider.php +++ b/src/Bundle/ChillPersonBundle/Service/GenericDoc/Providers/AccompanyingPeriodWorkEvaluationGenericDocProvider.php @@ -30,9 +30,10 @@ final readonly class AccompanyingPeriodWorkEvaluationGenericDocProvider implemen public function __construct( private Security $security, private EntityManagerInterface $entityManager, - ) {} + ) { + } - public function buildFetchQueryForAccompanyingPeriod(AccompanyingPeriod $accompanyingPeriod, \DateTimeImmutable $startDate = null, \DateTimeImmutable $endDate = null, string $content = null, string $origin = null): FetchQueryInterface + public function buildFetchQueryForAccompanyingPeriod(AccompanyingPeriod $accompanyingPeriod, ?\DateTimeImmutable $startDate = null, ?\DateTimeImmutable $endDate = null, ?string $content = null, ?string $origin = null): FetchQueryInterface { $accompanyingPeriodWorkMetadata = $this->entityManager->getClassMetadata(AccompanyingPeriod\AccompanyingPeriodWork::class); $query = $this->buildBaseQuery(); @@ -51,7 +52,7 @@ final readonly class AccompanyingPeriodWorkEvaluationGenericDocProvider implemen return $this->security->isGranted(AccompanyingPeriodWorkVoter::SEE, $accompanyingPeriod); } - private function addWhereClausesToQuery(FetchQuery $query, \DateTimeImmutable $startDate = null, \DateTimeImmutable $endDate = null, string $content = null): FetchQuery + private function addWhereClausesToQuery(FetchQuery $query, ?\DateTimeImmutable $startDate = null, ?\DateTimeImmutable $endDate = null, ?string $content = null): FetchQuery { $classMetadata = $this->entityManager->getClassMetadata(AccompanyingPeriod\AccompanyingPeriodWorkEvaluationDocument::class); $storedObjectMetadata = $this->entityManager->getClassMetadata(StoredObject::class); @@ -83,7 +84,7 @@ final readonly class AccompanyingPeriodWorkEvaluationGenericDocProvider implemen return $query; } - public function buildFetchQueryForPerson(Person $person, \DateTimeImmutable $startDate = null, \DateTimeImmutable $endDate = null, string $content = null, string $origin = null): FetchQueryInterface + public function buildFetchQueryForPerson(Person $person, ?\DateTimeImmutable $startDate = null, ?\DateTimeImmutable $endDate = null, ?string $content = null, ?string $origin = null): FetchQueryInterface { $storedObjectMetadata = $this->entityManager->getClassMetadata(StoredObject::class); $accompanyingPeriodWorkMetadata = $this->entityManager->getClassMetadata(AccompanyingPeriod\AccompanyingPeriodWork::class); diff --git a/src/Bundle/ChillPersonBundle/Service/GenericDoc/Renderer/AccompanyingPeriodWorkEvaluationGenericDocRenderer.php b/src/Bundle/ChillPersonBundle/Service/GenericDoc/Renderer/AccompanyingPeriodWorkEvaluationGenericDocRenderer.php index 7c6f2264f..207d90edd 100644 --- a/src/Bundle/ChillPersonBundle/Service/GenericDoc/Renderer/AccompanyingPeriodWorkEvaluationGenericDocRenderer.php +++ b/src/Bundle/ChillPersonBundle/Service/GenericDoc/Renderer/AccompanyingPeriodWorkEvaluationGenericDocRenderer.php @@ -20,7 +20,8 @@ final readonly class AccompanyingPeriodWorkEvaluationGenericDocRenderer implemen { public function __construct( private AccompanyingPeriodWorkEvaluationDocumentRepository $accompanyingPeriodWorkEvaluationDocumentRepository, - ) {} + ) { + } public function supports(GenericDocDTO $genericDocDTO, $options = []): bool { diff --git a/src/Bundle/ChillPersonBundle/Service/Import/SocialWorkMetadata.php b/src/Bundle/ChillPersonBundle/Service/Import/SocialWorkMetadata.php index 21406072d..7ce08fd3b 100644 --- a/src/Bundle/ChillPersonBundle/Service/Import/SocialWorkMetadata.php +++ b/src/Bundle/ChillPersonBundle/Service/Import/SocialWorkMetadata.php @@ -27,7 +27,9 @@ use Doctrine\Persistence\ObjectRepository; final readonly class SocialWorkMetadata implements SocialWorkMetadataInterface { - public function __construct(private SocialIssueRepository $socialIssueRepository, private SocialActionRepository $socialActionRepository, private GoalRepository $goalRepository, private ResultRepository $resultRepository, private EvaluationRepository $evaluationRepository, private EntityManagerInterface $entityManager) {} + public function __construct(private SocialIssueRepository $socialIssueRepository, private SocialActionRepository $socialActionRepository, private GoalRepository $goalRepository, private ResultRepository $resultRepository, private EvaluationRepository $evaluationRepository, private EntityManagerInterface $entityManager) + { + } /** * @throws \Exception diff --git a/src/Bundle/ChillPersonBundle/Service/Import/SocialWorkMetadataInterface.php b/src/Bundle/ChillPersonBundle/Service/Import/SocialWorkMetadataInterface.php index f31612606..f61d22252 100644 --- a/src/Bundle/ChillPersonBundle/Service/Import/SocialWorkMetadataInterface.php +++ b/src/Bundle/ChillPersonBundle/Service/Import/SocialWorkMetadataInterface.php @@ -11,4 +11,6 @@ declare(strict_types=1); namespace Chill\PersonBundle\Service\Import; -interface SocialWorkMetadataInterface extends ChillImporter {} +interface SocialWorkMetadataInterface extends ChillImporter +{ +} diff --git a/src/Bundle/ChillPersonBundle/Templating/Entity/ClosingMotiveRender.php b/src/Bundle/ChillPersonBundle/Templating/Entity/ClosingMotiveRender.php index 29ed4226a..e09c659c0 100644 --- a/src/Bundle/ChillPersonBundle/Templating/Entity/ClosingMotiveRender.php +++ b/src/Bundle/ChillPersonBundle/Templating/Entity/ClosingMotiveRender.php @@ -30,7 +30,8 @@ final readonly class ClosingMotiveRender implements ChillEntityRenderInterface public function __construct( private TranslatableStringHelperInterface $translatableStringHelper, private TranslatorInterface $translator - ) {} + ) { + } public function renderBox($entity, array $options): string { diff --git a/src/Bundle/ChillPersonBundle/Templating/Entity/PersonRender.php b/src/Bundle/ChillPersonBundle/Templating/Entity/PersonRender.php index a09ad11f5..fe41d974e 100644 --- a/src/Bundle/ChillPersonBundle/Templating/Entity/PersonRender.php +++ b/src/Bundle/ChillPersonBundle/Templating/Entity/PersonRender.php @@ -23,7 +23,9 @@ class PersonRender implements PersonRenderInterface { use BoxUtilsChillEntityRenderTrait; - public function __construct(private readonly ConfigPersonAltNamesHelper $configAltNamesHelper, private readonly \Twig\Environment $engine, private readonly TranslatorInterface $translator) {} + public function __construct(private readonly ConfigPersonAltNamesHelper $configAltNamesHelper, private readonly \Twig\Environment $engine, private readonly TranslatorInterface $translator) + { + } public function renderBox($person, array $options): string { diff --git a/src/Bundle/ChillPersonBundle/Templating/Entity/PersonRenderInterface.php b/src/Bundle/ChillPersonBundle/Templating/Entity/PersonRenderInterface.php index 203281b67..2f69d31a9 100644 --- a/src/Bundle/ChillPersonBundle/Templating/Entity/PersonRenderInterface.php +++ b/src/Bundle/ChillPersonBundle/Templating/Entity/PersonRenderInterface.php @@ -19,4 +19,6 @@ use Chill\PersonBundle\Entity\Person; * * @extends ChillEntityRenderInterface */ -interface PersonRenderInterface extends ChillEntityRenderInterface {} +interface PersonRenderInterface extends ChillEntityRenderInterface +{ +} diff --git a/src/Bundle/ChillPersonBundle/Templating/Entity/ResourceKindRender.php b/src/Bundle/ChillPersonBundle/Templating/Entity/ResourceKindRender.php index b9cf28fb7..87e658766 100644 --- a/src/Bundle/ChillPersonBundle/Templating/Entity/ResourceKindRender.php +++ b/src/Bundle/ChillPersonBundle/Templating/Entity/ResourceKindRender.php @@ -20,7 +20,9 @@ use Chill\PersonBundle\Entity\Person\PersonResourceKind; */ final readonly class ResourceKindRender implements ChillEntityRenderInterface { - public function __construct(private TranslatableStringHelper $translatableStringHelper) {} + public function __construct(private TranslatableStringHelper $translatableStringHelper) + { + } public function renderBox($entity, array $options): string { diff --git a/src/Bundle/ChillPersonBundle/Templating/Entity/SocialActionRender.php b/src/Bundle/ChillPersonBundle/Templating/Entity/SocialActionRender.php index 657ed0f53..a13df7ecc 100644 --- a/src/Bundle/ChillPersonBundle/Templating/Entity/SocialActionRender.php +++ b/src/Bundle/ChillPersonBundle/Templating/Entity/SocialActionRender.php @@ -43,7 +43,9 @@ class SocialActionRender implements ChillEntityRenderInterface */ final public const SHOW_AND_CHILDREN = 'show_and_children'; - public function __construct(private readonly TranslatableStringHelper $translatableStringHelper, private readonly \Twig\Environment $engine, private readonly TranslatorInterface $translator) {} + public function __construct(private readonly TranslatableStringHelper $translatableStringHelper, private readonly \Twig\Environment $engine, private readonly TranslatorInterface $translator) + { + } public function renderBox($socialAction, array $options): string { diff --git a/src/Bundle/ChillPersonBundle/Templating/Entity/SocialIssueRender.php b/src/Bundle/ChillPersonBundle/Templating/Entity/SocialIssueRender.php index af8622f67..17e211892 100644 --- a/src/Bundle/ChillPersonBundle/Templating/Entity/SocialIssueRender.php +++ b/src/Bundle/ChillPersonBundle/Templating/Entity/SocialIssueRender.php @@ -37,7 +37,9 @@ final readonly class SocialIssueRender implements ChillEntityRenderInterface */ public const SHOW_AND_CHILDREN = 'show_and_children'; - public function __construct(private TranslatableStringHelper $translatableStringHelper, private \Twig\Environment $engine, private TranslatorInterface $translator) {} + public function __construct(private TranslatableStringHelper $translatableStringHelper, private \Twig\Environment $engine, private TranslatorInterface $translator) + { + } public function renderBox($socialIssue, array $options): string { diff --git a/src/Bundle/ChillPersonBundle/Tests/AccompanyingPeriod/Events/PersonMoveEventSubscriberTest.php b/src/Bundle/ChillPersonBundle/Tests/AccompanyingPeriod/Events/PersonMoveEventSubscriberTest.php index 021cab706..bb833c96b 100644 --- a/src/Bundle/ChillPersonBundle/Tests/AccompanyingPeriod/Events/PersonMoveEventSubscriberTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/AccompanyingPeriod/Events/PersonMoveEventSubscriberTest.php @@ -244,10 +244,10 @@ final class PersonMoveEventSubscriberTest extends KernelTestCase } private function buildSubscriber( - \Twig\Environment $engine = null, - NotificationPersisterInterface $notificationPersister = null, - Security $security = null, - TranslatorInterface $translator = null + ?\Twig\Environment $engine = null, + ?NotificationPersisterInterface $notificationPersister = null, + ?Security $security = null, + ?TranslatorInterface $translator = null ): PersonAddressMoveEventSubscriber { if (null === $translator) { $double = $this->prophesize(TranslatorInterface::class); diff --git a/src/Bundle/ChillPersonBundle/Tests/AccompanyingPeriod/SocialIssueConsistency/AccompanyingPeriodSocialIssueConsistencyEntityListenerTest.php b/src/Bundle/ChillPersonBundle/Tests/AccompanyingPeriod/SocialIssueConsistency/AccompanyingPeriodSocialIssueConsistencyEntityListenerTest.php index 75e3877bc..dc5252108 100644 --- a/src/Bundle/ChillPersonBundle/Tests/AccompanyingPeriod/SocialIssueConsistency/AccompanyingPeriodSocialIssueConsistencyEntityListenerTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/AccompanyingPeriod/SocialIssueConsistency/AccompanyingPeriodSocialIssueConsistencyEntityListenerTest.php @@ -121,7 +121,9 @@ final class AccompanyingPeriodSocialIssueConsistencyEntityListenerTest extends T protected function generateClass(AccompanyingPeriod $period, Collection $socialIssues): AccompanyingPeriodLinkedWithSocialIssuesEntityInterface { return new class ($period, $socialIssues) implements AccompanyingPeriodLinkedWithSocialIssuesEntityInterface { - public function __construct(public $period, public $socialIssues) {} + public function __construct(public $period, public $socialIssues) + { + } public function getAccompanyingPeriod(): AccompanyingPeriod { diff --git a/src/Bundle/ChillPersonBundle/Tests/Controller/PersonAddressControllerTest.php b/src/Bundle/ChillPersonBundle/Tests/Controller/PersonAddressControllerTest.php index 14c6e30fa..b62c06489 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Controller/PersonAddressControllerTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Controller/PersonAddressControllerTest.php @@ -196,7 +196,7 @@ final class PersonAddressControllerTest extends WebTestCase */ protected function refreshPerson() { - self::$person = $this->em->getRepository(\Chill\PersonBundle\Entity\Person::class) + self::$person = $this->em->getRepository(Person::class) ->find(self::$person->getId()); } } diff --git a/src/Bundle/ChillPersonBundle/Tests/Controller/PersonControllerCreateTest.php b/src/Bundle/ChillPersonBundle/Tests/Controller/PersonControllerCreateTest.php index 572374bc1..a0223e660 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Controller/PersonControllerCreateTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Controller/PersonControllerCreateTest.php @@ -89,7 +89,7 @@ final class PersonControllerCreateTest extends WebTestCase $form = $crawler->selectButton("Créer l'usager")->form(); $this->assertInstanceOf( - \Symfony\Component\DomCrawler\Form::class, + Form::class, $form, 'The page contains a button' ); @@ -222,7 +222,7 @@ final class PersonControllerCreateTest extends WebTestCase Form &$creationForm, string $firstname = 'God', string $lastname = 'Jesus', - \DateTime $birthdate = null + ?\DateTime $birthdate = null ) { $creationForm->get(self::FIRSTNAME_INPUT)->setValue($firstname.'_'.uniqid()); $creationForm->get(self::LASTNAME_INPUT)->setValue($lastname.'_'.uniqid()); diff --git a/src/Bundle/ChillPersonBundle/Tests/Controller/PersonControllerUpdateTest.php b/src/Bundle/ChillPersonBundle/Tests/Controller/PersonControllerUpdateTest.php index d1ef1f1c9..5682f343d 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Controller/PersonControllerUpdateTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Controller/PersonControllerUpdateTest.php @@ -43,7 +43,9 @@ final class PersonControllerUpdateTest extends WebTestCase /** * Prepare client and create a random person. */ - protected function setUp(): void {} + protected function setUp(): void + { + } protected function tearDown(): void { diff --git a/src/Bundle/ChillPersonBundle/Tests/Controller/PersonControllerUpdateWithHiddenFieldsTest.php b/src/Bundle/ChillPersonBundle/Tests/Controller/PersonControllerUpdateWithHiddenFieldsTest.php index d23fbcb7a..db77c5672 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Controller/PersonControllerUpdateWithHiddenFieldsTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Controller/PersonControllerUpdateWithHiddenFieldsTest.php @@ -34,7 +34,7 @@ final class PersonControllerUpdateWithHiddenFieldsTest extends WebTestCase private ?object $em = null; - private ?\Chill\PersonBundle\Entity\Person $person = null; + private ?Person $person = null; /** * @var string The url using for seeing the person's information @@ -205,7 +205,7 @@ final class PersonControllerUpdateWithHiddenFieldsTest extends WebTestCase */ protected function refreshPerson() { - $this->person = $this->em->getRepository(\Chill\PersonBundle\Entity\Person::class) + $this->person = $this->em->getRepository(Person::class) ->find($this->person->getId()); } diff --git a/src/Bundle/ChillPersonBundle/Tests/Controller/PersonControllerViewWithHiddenFieldsTest.php b/src/Bundle/ChillPersonBundle/Tests/Controller/PersonControllerViewWithHiddenFieldsTest.php index e0d56204f..6463c246b 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Controller/PersonControllerViewWithHiddenFieldsTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Controller/PersonControllerViewWithHiddenFieldsTest.php @@ -23,7 +23,7 @@ final class PersonControllerViewWithHiddenFieldsTest extends WebTestCase { private ?object $em = null; - private ?\Chill\PersonBundle\Entity\Person $person = null; + private ?Person $person = null; /** * @var string The url to view the person details @@ -98,7 +98,7 @@ final class PersonControllerViewWithHiddenFieldsTest extends WebTestCase */ protected function refreshPerson() { - $this->person = $this->em->getRepository(\Chill\PersonBundle\Entity\Person::class) + $this->person = $this->em->getRepository(Person::class) ->find($this->person->getId()); } } diff --git a/src/Bundle/ChillPersonBundle/Tests/Export/Export/CountAccompanyingPeriodWorkAssociatePersonOnWorkTest.php b/src/Bundle/ChillPersonBundle/Tests/Export/Export/CountAccompanyingPeriodWorkAssociatePersonOnWorkTest.php index 6b6e7b7b4..6eb058f2c 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Export/Export/CountAccompanyingPeriodWorkAssociatePersonOnWorkTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Export/Export/CountAccompanyingPeriodWorkAssociatePersonOnWorkTest.php @@ -33,7 +33,7 @@ final class CountAccompanyingPeriodWorkAssociatePersonOnWorkTest extends Abstrac $em = self::$container->get(EntityManagerInterface::class); yield new CountAccompanyingPeriodWorkAssociatePersonOnWork($em, $this->getParameters(true)); - yield new CountAccompanyingPeriodWorkAssociatePersonOnwork($em, $this->getParameters(false)); + yield new CountAccompanyingPeriodWorkAssociatePersonOnWork($em, $this->getParameters(false)); } public function getFormData(): array diff --git a/src/Bundle/ChillPersonBundle/Tests/Household/MembersEditorTest.php b/src/Bundle/ChillPersonBundle/Tests/Household/MembersEditorTest.php index 827b2a2e2..99515562c 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Household/MembersEditorTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Household/MembersEditorTest.php @@ -561,8 +561,8 @@ final class MembersEditorTest extends TestCase } private function buildMembersEditorFactory( - EventDispatcherInterface $eventDispatcher = null, - ValidatorInterface $validator = null + ?EventDispatcherInterface $eventDispatcher = null, + ?ValidatorInterface $validator = null ) { if (null === $eventDispatcher) { $double = $this->getProphet()->prophesize(); diff --git a/src/Bundle/ChillPersonBundle/Tests/Repository/AccompanyingPeriodACLAwareRepositoryTest.php b/src/Bundle/ChillPersonBundle/Tests/Repository/AccompanyingPeriodACLAwareRepositoryTest.php index 87c57be86..609ee03fb 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Repository/AccompanyingPeriodACLAwareRepositoryTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Repository/AccompanyingPeriodACLAwareRepositoryTest.php @@ -521,7 +521,7 @@ class AccompanyingPeriodACLAwareRepositoryTest extends KernelTestCase /** * @param array $scopes */ - private function buildPeriod(Person $person, array $scopes, null|User $creator, bool $confirm): AccompanyingPeriod + private function buildPeriod(Person $person, array $scopes, User|null $creator, bool $confirm): AccompanyingPeriod { $period = new AccompanyingPeriod(); $period->addPerson($person); diff --git a/src/Bundle/ChillPersonBundle/Tests/Security/Authorization/PersonVoterTest.php b/src/Bundle/ChillPersonBundle/Tests/Security/Authorization/PersonVoterTest.php index 1dbbceb3e..ec8893ff9 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Security/Authorization/PersonVoterTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Security/Authorization/PersonVoterTest.php @@ -155,7 +155,7 @@ final class PersonVoterTest extends KernelTestCase * * @return \Symfony\Component\Security\Core\Authentication\Token\TokenInterface */ - protected function prepareToken(array $permissions = null) + protected function prepareToken(?array $permissions = null) { $token = $this->prophet->prophesize(); $token diff --git a/src/Bundle/ChillPersonBundle/Tests/Serializer/Normalizer/PersonDocGenNormalizerTest.php b/src/Bundle/ChillPersonBundle/Tests/Serializer/Normalizer/PersonDocGenNormalizerTest.php index 59bb0a731..70fe30e6a 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Serializer/Normalizer/PersonDocGenNormalizerTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Serializer/Normalizer/PersonDocGenNormalizerTest.php @@ -237,12 +237,12 @@ final class PersonDocGenNormalizerTest extends KernelTestCase } private function buildNormalizer( - PersonRender $personRender = null, - RelationshipRepository $relationshipRepository = null, - TranslatorInterface $translator = null, - TranslatableStringHelper $translatableStringHelper = null, - NormalizerInterface $normalizer = null, - SummaryBudgetInterface $summaryBudget = null + ?PersonRender $personRender = null, + ?RelationshipRepository $relationshipRepository = null, + ?TranslatorInterface $translator = null, + ?TranslatableStringHelper $translatableStringHelper = null, + ?NormalizerInterface $normalizer = null, + ?SummaryBudgetInterface $summaryBudget = null ): PersonDocGenNormalizer { if (null === $summaryBudget) { $summaryBudget = $this->prophesize(SummaryBudgetInterface::class); @@ -274,11 +274,11 @@ final class PersonDocGenNormalizerTest extends KernelTestCase } private function buildPersonNormalizer( - PersonRender $personRender = null, - RelationshipRepository $relationshipRepository = null, - TranslatorInterface $translator = null, - TranslatableStringHelper $translatableStringHelper = null, - SummaryBudgetInterface $summaryBudget = null + ?PersonRender $personRender = null, + ?RelationshipRepository $relationshipRepository = null, + ?TranslatorInterface $translator = null, + ?TranslatableStringHelper $translatableStringHelper = null, + ?SummaryBudgetInterface $summaryBudget = null ): PersonDocGenNormalizer { if (null === $relationshipRepository) { $relationshipRepository = $this->prophesize(RelationshipRepository::class); diff --git a/src/Bundle/ChillPersonBundle/Tests/Service/DocGenerator/PersonContextTest.php b/src/Bundle/ChillPersonBundle/Tests/Service/DocGenerator/PersonContextTest.php index 772e669bb..f6b2bdde9 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Service/DocGenerator/PersonContextTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Service/DocGenerator/PersonContextTest.php @@ -341,20 +341,20 @@ final class PersonContextTest extends KernelTestCase } private function buildPersonContext( - AuthorizationHelperInterface $authorizationHelper = null, - BaseContextData $baseContextData = null, - CenterResolverManagerInterface $centerResolverManager = null, - DocumentCategoryRepository $documentCategoryRepository = null, - EntityManagerInterface $em = null, - NormalizerInterface $normalizer = null, - ParameterBagInterface $parameterBag = null, - ScopeRepositoryInterface $scopeRepository = null, - Security $security = null, - TranslatorInterface $translator = null, - TranslatableStringHelperInterface $translatableStringHelper = null, - ThirdPartyRender $thirdPartyRender = null, - ThirdPartyRepository $thirdPartyRepository = null, - ResidentialAddressRepository $residentialAddressRepository = null + ?AuthorizationHelperInterface $authorizationHelper = null, + ?BaseContextData $baseContextData = null, + ?CenterResolverManagerInterface $centerResolverManager = null, + ?DocumentCategoryRepository $documentCategoryRepository = null, + ?EntityManagerInterface $em = null, + ?NormalizerInterface $normalizer = null, + ?ParameterBagInterface $parameterBag = null, + ?ScopeRepositoryInterface $scopeRepository = null, + ?Security $security = null, + ?TranslatorInterface $translator = null, + ?TranslatableStringHelperInterface $translatableStringHelper = null, + ?ThirdPartyRender $thirdPartyRender = null, + ?ThirdPartyRepository $thirdPartyRepository = null, + ?ResidentialAddressRepository $residentialAddressRepository = null ): PersonContext { if (null === $authorizationHelper) { $authorizationHelper = $this->prophesize(AuthorizationHelperInterface::class)->reveal(); diff --git a/src/Bundle/ChillPersonBundle/Tests/Service/GenericDoc/Providers/AccompanyingPeriodWorkEvaluationGenericDocProviderTest.php b/src/Bundle/ChillPersonBundle/Tests/Service/GenericDoc/Providers/AccompanyingPeriodWorkEvaluationGenericDocProviderTest.php index afbc0b2ab..35617e37a 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Service/GenericDoc/Providers/AccompanyingPeriodWorkEvaluationGenericDocProviderTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Service/GenericDoc/Providers/AccompanyingPeriodWorkEvaluationGenericDocProviderTest.php @@ -39,9 +39,9 @@ class AccompanyingPeriodWorkEvaluationGenericDocProviderTest extends KernelTestC * @dataProvider provideSearchArguments */ public function testBuildFetchQueryForAccompanyingPeriod( - \DateTimeImmutable $startDate = null, - \DateTimeImmutable $endDate = null, - string $content = null + ?\DateTimeImmutable $startDate = null, + ?\DateTimeImmutable $endDate = null, + ?string $content = null ): void { $period = $this->entityManager->createQuery('SELECT a FROM '.AccompanyingPeriod::class.' a') ->setMaxResults(1) diff --git a/src/Bundle/ChillPersonBundle/Timeline/AbstractTimelineAccompanyingPeriod.php b/src/Bundle/ChillPersonBundle/Timeline/AbstractTimelineAccompanyingPeriod.php index 6973eba1d..401ef5a07 100644 --- a/src/Bundle/ChillPersonBundle/Timeline/AbstractTimelineAccompanyingPeriod.php +++ b/src/Bundle/ChillPersonBundle/Timeline/AbstractTimelineAccompanyingPeriod.php @@ -31,7 +31,9 @@ abstract class AbstractTimelineAccompanyingPeriod implements TimelineProviderInt { private const SUPPORTED_CONTEXTS = ['person', 'center']; - public function __construct(protected EntityManager $em, private readonly Security $security, private readonly AuthorizationHelper $authorizationHelper) {} + public function __construct(protected EntityManager $em, private readonly Security $security, private readonly AuthorizationHelper $authorizationHelper) + { + } public function getEntities(array $ids) { diff --git a/src/Bundle/ChillPersonBundle/Validator/Constraints/AccompanyingPeriod/AccompanyingPeriodValidityValidator.php b/src/Bundle/ChillPersonBundle/Validator/Constraints/AccompanyingPeriod/AccompanyingPeriodValidityValidator.php index 6198e4e47..3c3ff4d4d 100644 --- a/src/Bundle/ChillPersonBundle/Validator/Constraints/AccompanyingPeriod/AccompanyingPeriodValidityValidator.php +++ b/src/Bundle/ChillPersonBundle/Validator/Constraints/AccompanyingPeriod/AccompanyingPeriodValidityValidator.php @@ -23,7 +23,9 @@ use Symfony\Component\Validator\Exception\UnexpectedValueException; class AccompanyingPeriodValidityValidator extends ConstraintValidator { - public function __construct(private readonly ActivityRepository $activityRepository, private readonly SocialIssueRender $socialIssueRender, private readonly TokenStorageInterface $token) {} + public function __construct(private readonly ActivityRepository $activityRepository, private readonly SocialIssueRender $socialIssueRender, private readonly TokenStorageInterface $token) + { + } public function validate($period, Constraint $constraint) { diff --git a/src/Bundle/ChillPersonBundle/Validator/Constraints/AccompanyingPeriod/LocationValidityValidator.php b/src/Bundle/ChillPersonBundle/Validator/Constraints/AccompanyingPeriod/LocationValidityValidator.php index 4b4a13c18..4de58387a 100644 --- a/src/Bundle/ChillPersonBundle/Validator/Constraints/AccompanyingPeriod/LocationValidityValidator.php +++ b/src/Bundle/ChillPersonBundle/Validator/Constraints/AccompanyingPeriod/LocationValidityValidator.php @@ -20,7 +20,9 @@ use Symfony\Component\Validator\Exception\UnexpectedValueException; class LocationValidityValidator extends ConstraintValidator { - public function __construct(private readonly PersonRenderInterface $render) {} + public function __construct(private readonly PersonRenderInterface $render) + { + } public function validate($period, Constraint $constraint) { diff --git a/src/Bundle/ChillPersonBundle/Validator/Constraints/AccompanyingPeriod/ParticipationOverlapValidator.php b/src/Bundle/ChillPersonBundle/Validator/Constraints/AccompanyingPeriod/ParticipationOverlapValidator.php index d3c25199b..7ab10d1f9 100644 --- a/src/Bundle/ChillPersonBundle/Validator/Constraints/AccompanyingPeriod/ParticipationOverlapValidator.php +++ b/src/Bundle/ChillPersonBundle/Validator/Constraints/AccompanyingPeriod/ParticipationOverlapValidator.php @@ -24,7 +24,9 @@ class ParticipationOverlapValidator extends ConstraintValidator { private const MAX_PARTICIPATION = 1; - public function __construct(private readonly PersonRenderInterface $personRender, private readonly ThirdPartyRender $thirdpartyRender) {} + public function __construct(private readonly PersonRenderInterface $personRender, private readonly ThirdPartyRender $thirdpartyRender) + { + } public function validate($participations, Constraint $constraint) { diff --git a/src/Bundle/ChillPersonBundle/Validator/Constraints/AccompanyingPeriod/ResourceDuplicateCheckValidator.php b/src/Bundle/ChillPersonBundle/Validator/Constraints/AccompanyingPeriod/ResourceDuplicateCheckValidator.php index d7573c400..96f63f19b 100644 --- a/src/Bundle/ChillPersonBundle/Validator/Constraints/AccompanyingPeriod/ResourceDuplicateCheckValidator.php +++ b/src/Bundle/ChillPersonBundle/Validator/Constraints/AccompanyingPeriod/ResourceDuplicateCheckValidator.php @@ -21,7 +21,9 @@ use Symfony\Component\Validator\ConstraintValidator; class ResourceDuplicateCheckValidator extends ConstraintValidator { - public function __construct(private readonly PersonRenderInterface $personRender, private readonly ThirdPartyRender $thirdpartyRender) {} + public function __construct(private readonly PersonRenderInterface $personRender, private readonly ThirdPartyRender $thirdpartyRender) + { + } public function validate($resources, Constraint $constraint) { diff --git a/src/Bundle/ChillPersonBundle/Validator/Constraints/Household/HouseholdMembershipSequentialValidator.php b/src/Bundle/ChillPersonBundle/Validator/Constraints/Household/HouseholdMembershipSequentialValidator.php index 2ca0af42c..8c1eebce2 100644 --- a/src/Bundle/ChillPersonBundle/Validator/Constraints/Household/HouseholdMembershipSequentialValidator.php +++ b/src/Bundle/ChillPersonBundle/Validator/Constraints/Household/HouseholdMembershipSequentialValidator.php @@ -24,7 +24,9 @@ use Symfony\Component\Validator\Exception\UnexpectedTypeException; */ class HouseholdMembershipSequentialValidator extends ConstraintValidator { - public function __construct(private readonly PersonRenderInterface $render) {} + public function __construct(private readonly PersonRenderInterface $render) + { + } public function validate($person, Constraint $constraint) { diff --git a/src/Bundle/ChillPersonBundle/Validator/Constraints/Relationship/RelationshipNoDuplicateValidator.php b/src/Bundle/ChillPersonBundle/Validator/Constraints/Relationship/RelationshipNoDuplicateValidator.php index 8a54de53e..4c340fc81 100644 --- a/src/Bundle/ChillPersonBundle/Validator/Constraints/Relationship/RelationshipNoDuplicateValidator.php +++ b/src/Bundle/ChillPersonBundle/Validator/Constraints/Relationship/RelationshipNoDuplicateValidator.php @@ -20,7 +20,9 @@ use Symfony\Component\Validator\Exception\UnexpectedValueException; class RelationshipNoDuplicateValidator extends ConstraintValidator { - public function __construct(private readonly RelationshipRepository $relationshipRepository) {} + public function __construct(private readonly RelationshipRepository $relationshipRepository) + { + } public function validate($value, Constraint $constraint) { diff --git a/src/Bundle/ChillPersonBundle/Widget/PersonListWidget.php b/src/Bundle/ChillPersonBundle/Widget/PersonListWidget.php index aab72f148..b80c91f6e 100644 --- a/src/Bundle/ChillPersonBundle/Widget/PersonListWidget.php +++ b/src/Bundle/ChillPersonBundle/Widget/PersonListWidget.php @@ -34,7 +34,9 @@ class PersonListWidget implements WidgetInterface { protected UserInterface $user; - public function __construct(protected PersonRepository $personRepository, protected EntityManagerInterface $entityManager, protected AuthorizationHelperInterface $authorizationHelper, protected TokenStorageInterface $tokenStorage) {} + public function __construct(protected PersonRepository $personRepository, protected EntityManagerInterface $entityManager, protected AuthorizationHelperInterface $authorizationHelper, protected TokenStorageInterface $tokenStorage) + { + } public function render(Environment $env, $place, array $context, array $config) { diff --git a/src/Bundle/ChillPersonBundle/Workflow/AccompanyingPeriodWorkEvaluationDocumentWorkflowHandler.php b/src/Bundle/ChillPersonBundle/Workflow/AccompanyingPeriodWorkEvaluationDocumentWorkflowHandler.php index 0fc13224e..19c8949c9 100644 --- a/src/Bundle/ChillPersonBundle/Workflow/AccompanyingPeriodWorkEvaluationDocumentWorkflowHandler.php +++ b/src/Bundle/ChillPersonBundle/Workflow/AccompanyingPeriodWorkEvaluationDocumentWorkflowHandler.php @@ -21,7 +21,9 @@ use Symfony\Contracts\Translation\TranslatorInterface; class AccompanyingPeriodWorkEvaluationDocumentWorkflowHandler implements EntityWorkflowHandlerInterface { - public function __construct(private readonly AccompanyingPeriodWorkEvaluationDocumentRepository $repository, private readonly TranslatableStringHelperInterface $translatableStringHelper, private readonly TranslatorInterface $translator) {} + public function __construct(private readonly AccompanyingPeriodWorkEvaluationDocumentRepository $repository, private readonly TranslatableStringHelperInterface $translatableStringHelper, private readonly TranslatorInterface $translator) + { + } public function getDeletionRoles(): array { diff --git a/src/Bundle/ChillPersonBundle/Workflow/AccompanyingPeriodWorkEvaluationWorkflowHandler.php b/src/Bundle/ChillPersonBundle/Workflow/AccompanyingPeriodWorkEvaluationWorkflowHandler.php index 63b34d1dc..17a1eba45 100644 --- a/src/Bundle/ChillPersonBundle/Workflow/AccompanyingPeriodWorkEvaluationWorkflowHandler.php +++ b/src/Bundle/ChillPersonBundle/Workflow/AccompanyingPeriodWorkEvaluationWorkflowHandler.php @@ -22,7 +22,9 @@ use Symfony\Contracts\Translation\TranslatorInterface; class AccompanyingPeriodWorkEvaluationWorkflowHandler implements EntityWorkflowHandlerInterface { - public function __construct(private readonly AccompanyingPeriodWorkEvaluationRepository $repository, private readonly TranslatableStringHelperInterface $translatableStringHelper, private readonly TranslatorInterface $translator) {} + public function __construct(private readonly AccompanyingPeriodWorkEvaluationRepository $repository, private readonly TranslatableStringHelperInterface $translatableStringHelper, private readonly TranslatorInterface $translator) + { + } public function getDeletionRoles(): array { diff --git a/src/Bundle/ChillPersonBundle/Workflow/AccompanyingPeriodWorkWorkflowHandler.php b/src/Bundle/ChillPersonBundle/Workflow/AccompanyingPeriodWorkWorkflowHandler.php index 5c74e5b17..b78b81a20 100644 --- a/src/Bundle/ChillPersonBundle/Workflow/AccompanyingPeriodWorkWorkflowHandler.php +++ b/src/Bundle/ChillPersonBundle/Workflow/AccompanyingPeriodWorkWorkflowHandler.php @@ -23,7 +23,9 @@ use Symfony\Contracts\Translation\TranslatorInterface; class AccompanyingPeriodWorkWorkflowHandler implements EntityWorkflowHandlerInterface { - public function __construct(private readonly AccompanyingPeriodWorkRepository $repository, private readonly TranslatableStringHelperInterface $translatableStringHelper, private readonly TranslatorInterface $translator) {} + public function __construct(private readonly AccompanyingPeriodWorkRepository $repository, private readonly TranslatableStringHelperInterface $translatableStringHelper, private readonly TranslatorInterface $translator) + { + } public function getDeletionRoles(): array { diff --git a/src/Bundle/ChillPersonBundle/migrations/Version20160422000000.php b/src/Bundle/ChillPersonBundle/migrations/Version20160422000000.php index 159e969a3..da6cf8552 100644 --- a/src/Bundle/ChillPersonBundle/migrations/Version20160422000000.php +++ b/src/Bundle/ChillPersonBundle/migrations/Version20160422000000.php @@ -19,7 +19,9 @@ use Doctrine\Migrations\AbstractMigration; */ class Version20160422000000 extends AbstractMigration { - public function down(Schema $schema): void {} + public function down(Schema $schema): void + { + } public function up(Schema $schema): void { diff --git a/src/Bundle/ChillPersonBundle/migrations/Version20210419112619.php b/src/Bundle/ChillPersonBundle/migrations/Version20210419112619.php index e713486d0..8db3880ed 100644 --- a/src/Bundle/ChillPersonBundle/migrations/Version20210419112619.php +++ b/src/Bundle/ChillPersonBundle/migrations/Version20210419112619.php @@ -19,7 +19,9 @@ use Doctrine\Migrations\AbstractMigration; */ final class Version20210419112619 extends AbstractMigration { - public function down(Schema $schema): void {} + public function down(Schema $schema): void + { + } public function getDescription(): string { diff --git a/src/Bundle/ChillPersonBundle/migrations/Version20231121070151.php b/src/Bundle/ChillPersonBundle/migrations/Version20231121070151.php index 1123ef1c3..c85132aff 100644 --- a/src/Bundle/ChillPersonBundle/migrations/Version20231121070151.php +++ b/src/Bundle/ChillPersonBundle/migrations/Version20231121070151.php @@ -29,5 +29,7 @@ final class Version20231121070151 extends AbstractMigration $this->addSql("UPDATE chill_person_person SET gender = 'both' WHERE chill_person_person.gender = 'neuter'"); } - public function down(Schema $schema): void {} + public function down(Schema $schema): void + { + } } diff --git a/src/Bundle/ChillReportBundle/ChillReportBundle.php b/src/Bundle/ChillReportBundle/ChillReportBundle.php index 76bc4c9b2..ef92fa192 100644 --- a/src/Bundle/ChillReportBundle/ChillReportBundle.php +++ b/src/Bundle/ChillReportBundle/ChillReportBundle.php @@ -13,4 +13,6 @@ namespace Chill\ReportBundle; use Symfony\Component\HttpKernel\Bundle\Bundle; -class ChillReportBundle extends Bundle {} +class ChillReportBundle extends Bundle +{ +} diff --git a/src/Bundle/ChillReportBundle/Controller/ReportController.php b/src/Bundle/ChillReportBundle/Controller/ReportController.php index 22830a8df..7354edf3e 100644 --- a/src/Bundle/ChillReportBundle/Controller/ReportController.php +++ b/src/Bundle/ChillReportBundle/Controller/ReportController.php @@ -37,7 +37,8 @@ class ReportController extends AbstractController private readonly AuthorizationHelper $authorizationHelper, private readonly PaginatorFactory $paginator, private readonly TranslatorInterface $translator - ) {} + ) { + } /** * Create a new report for a given person and of a given type. @@ -56,7 +57,7 @@ class ReportController extends AbstractController $cFGroup = $em->getRepository(\Chill\CustomFieldsBundle\Entity\CustomFieldsGroup::class) ->find($cf_group_id); - $person = $em->getRepository(\Chill\PersonBundle\Entity\Person::class) + $person = $em->getRepository(Person::class) ->find($person_id); if (null === $person || null === $cFGroup) { @@ -182,7 +183,7 @@ class ReportController extends AbstractController { $em = $this->getDoctrine()->getManager(); - $person = $em->getRepository(\Chill\PersonBundle\Entity\Person::class)->find($person_id); + $person = $em->getRepository(Person::class)->find($person_id); $this->denyAccessUnlessGranted('CHILL_PERSON_SEE', $person); @@ -239,7 +240,7 @@ class ReportController extends AbstractController { $em = $this->getDoctrine()->getManager(); - $person = $em->getRepository(\Chill\PersonBundle\Entity\Person::class)->find($person_id); + $person = $em->getRepository(Person::class)->find($person_id); $cFGroup = $em ->getRepository(\Chill\CustomFieldsBundle\Entity\CustomFieldsGroup::class) ->find($cf_group_id); @@ -287,7 +288,7 @@ class ReportController extends AbstractController { $em = $this->getDoctrine()->getManager(); - $person = $em->getRepository(\Chill\PersonBundle\Entity\Person::class) + $person = $em->getRepository(Person::class) ->find($person_id); if (null === $person) { @@ -309,7 +310,7 @@ class ReportController extends AbstractController } $cFGroups = $em->getRepository(\Chill\CustomFieldsBundle\Entity\CustomFieldsGroup::class) - ->findByEntity(\Chill\ReportBundle\Entity\Report::class); + ->findByEntity(Report::class); if (1 === \count($cFGroups)) { return $this->redirectToRoute('report_new', ['person_id' => $person_id, 'cf_group_id' => $cFGroups[0]->getId()]); @@ -331,7 +332,7 @@ class ReportController extends AbstractController ]) ->getForm(); - $person = $em->getRepository(\Chill\PersonBundle\Entity\Person::class)->find($person_id); + $person = $em->getRepository(Person::class)->find($person_id); return $this->render('@ChillReport/Report/select_report_type.html.twig', [ 'form' => $form->createView(), @@ -358,7 +359,7 @@ class ReportController extends AbstractController $em = $this->getDoctrine()->getManager(); $cFGroups = $em->getRepository(\Chill\CustomFieldsBundle\Entity\CustomFieldsGroup::class) - ->findByEntity(\Chill\ReportBundle\Entity\Report::class); + ->findByEntity(Report::class); if (1 === \count($cFGroups)) { return $this->redirectToRoute('report_export_list', ['cf_group_id' => $cFGroups[0]->getId()]); @@ -458,7 +459,7 @@ class ReportController extends AbstractController { $em = $this->getDoctrine()->getManager(); - $person = $em->getRepository(\Chill\PersonBundle\Entity\Person::class)->find($person_id); + $person = $em->getRepository(Person::class)->find($person_id); $entity = $em->getRepository('ChillReportBundle:Report')->find($report_id); diff --git a/src/Bundle/ChillReportBundle/Entity/Report.php b/src/Bundle/ChillReportBundle/Entity/Report.php index 1db2ed080..53878aa10 100644 --- a/src/Bundle/ChillReportBundle/Entity/Report.php +++ b/src/Bundle/ChillReportBundle/Entity/Report.php @@ -41,7 +41,7 @@ class Report implements HasCenterInterface, HasScopeInterface * @ORM\ManyToOne( * targetEntity="Chill\CustomFieldsBundle\Entity\CustomFieldsGroup") */ - private ?\Chill\CustomFieldsBundle\Entity\CustomFieldsGroup $cFGroup = null; + private ?CustomFieldsGroup $cFGroup = null; /** * @ORM\Column(type="datetime") @@ -60,17 +60,17 @@ class Report implements HasCenterInterface, HasScopeInterface /** * @ORM\ManyToOne(targetEntity="Chill\PersonBundle\Entity\Person") */ - private ?\Chill\PersonBundle\Entity\Person $person = null; + private ?Person $person = null; /** * @ORM\ManyToOne(targetEntity="Chill\MainBundle\Entity\Scope") */ - private ?\Chill\MainBundle\Entity\Scope $scope = null; + private ?Scope $scope = null; /** * @ORM\ManyToOne(targetEntity="Chill\MainBundle\Entity\User") */ - private ?\Chill\MainBundle\Entity\User $user = null; + private ?User $user = null; /** * @return Center diff --git a/src/Bundle/ChillReportBundle/Export/Export/ReportList.php b/src/Bundle/ChillReportBundle/Export/Export/ReportList.php index 1761e3522..7f281c2cb 100644 --- a/src/Bundle/ChillReportBundle/Export/Export/ReportList.php +++ b/src/Bundle/ChillReportBundle/Export/Export/ReportList.php @@ -46,7 +46,9 @@ class ReportList implements ExportElementValidatedInterface, ListInterface protected array $slugs = []; - public function __construct(protected CustomFieldsGroup $customfieldsGroup, protected TranslatableStringHelper $translatableStringHelper, protected TranslatorInterface $translator, protected CustomFieldProvider $customFieldProvider, protected EntityManagerInterface $em) {} + public function __construct(protected CustomFieldsGroup $customfieldsGroup, protected TranslatableStringHelper $translatableStringHelper, protected TranslatorInterface $translator, protected CustomFieldProvider $customFieldProvider, protected EntityManagerInterface $em) + { + } public function buildForm(FormBuilderInterface $builder) { diff --git a/src/Bundle/ChillReportBundle/Export/Filter/ReportDateFilter.php b/src/Bundle/ChillReportBundle/Export/Filter/ReportDateFilter.php index 0346f2ab3..68fc7b001 100644 --- a/src/Bundle/ChillReportBundle/Export/Filter/ReportDateFilter.php +++ b/src/Bundle/ChillReportBundle/Export/Filter/ReportDateFilter.php @@ -19,7 +19,9 @@ use Doctrine\ORM\Query\Expr; class ReportDateFilter implements FilterInterface { - public function __construct(private readonly RollingDateConverterInterface $rollingDateConverter) {} + public function __construct(private readonly RollingDateConverterInterface $rollingDateConverter) + { + } public function addRole(): ?string { diff --git a/src/Bundle/ChillReportBundle/Form/ReportType.php b/src/Bundle/ChillReportBundle/Form/ReportType.php index 8d6551443..8d717a424 100644 --- a/src/Bundle/ChillReportBundle/Form/ReportType.php +++ b/src/Bundle/ChillReportBundle/Form/ReportType.php @@ -32,7 +32,7 @@ class ReportType extends AbstractType protected $authorizationHelper; /** - * @var \Doctrine\Persistence\ObjectManager + * @var ObjectManager */ protected $om; diff --git a/src/Bundle/ChillReportBundle/Search/ReportSearch.php b/src/Bundle/ChillReportBundle/Search/ReportSearch.php index 4737edd99..bfad327b4 100644 --- a/src/Bundle/ChillReportBundle/Search/ReportSearch.php +++ b/src/Bundle/ChillReportBundle/Search/ReportSearch.php @@ -96,7 +96,7 @@ class ReportSearch extends AbstractSearch implements ContainerAwareInterface /** * @param array $terms the terms * - * @return \Doctrine\ORM\QueryBuilder + * @return QueryBuilder */ private function buildQuery(array $terms) { diff --git a/src/Bundle/ChillReportBundle/Tests/Controller/ReportControllerNextTest.php b/src/Bundle/ChillReportBundle/Tests/Controller/ReportControllerNextTest.php index a16653601..d91583dc0 100644 --- a/src/Bundle/ChillReportBundle/Tests/Controller/ReportControllerNextTest.php +++ b/src/Bundle/ChillReportBundle/Tests/Controller/ReportControllerNextTest.php @@ -43,7 +43,7 @@ final class ReportControllerNextTest extends WebTestCase ->get('doctrine.orm.entity_manager'); $this->person = $em - ->getRepository(\Chill\PersonBundle\Entity\Person::class) + ->getRepository(Person::class) ->findOneBy( [ 'lastName' => 'Charline', @@ -58,7 +58,7 @@ final class ReportControllerNextTest extends WebTestCase // get custom fields group from fixture $customFieldsGroups = self::$kernel->getContainer() ->get('doctrine.orm.entity_manager') - ->getRepository(\Chill\CustomFieldsBundle\Entity\CustomFieldsGroup::class) + ->getRepository(CustomFieldsGroup::class) ->findBy(['entity' => \Chill\ReportBundle\Entity\Report::class]); // filter customFieldsGroup to get only "situation de logement" $filteredCustomFieldsGroupHouse = array_filter( diff --git a/src/Bundle/ChillReportBundle/Tests/Controller/ReportControllerTest.php b/src/Bundle/ChillReportBundle/Tests/Controller/ReportControllerTest.php index 1259e4b5f..e5270c038 100644 --- a/src/Bundle/ChillReportBundle/Tests/Controller/ReportControllerTest.php +++ b/src/Bundle/ChillReportBundle/Tests/Controller/ReportControllerTest.php @@ -43,7 +43,7 @@ final class ReportControllerTest extends WebTestCase private static $group; /** - * @var \Chill\PersonBundle\Entity\Person + * @var Person */ private static $person; @@ -59,7 +59,7 @@ final class ReportControllerTest extends WebTestCase // get a random person self::$person = self::$kernel->getContainer() ->get('doctrine.orm.entity_manager') - ->getRepository(\Chill\PersonBundle\Entity\Person::class) + ->getRepository(Person::class) ->findOneBy( [ 'lastName' => 'Charline', @@ -73,7 +73,7 @@ final class ReportControllerTest extends WebTestCase $customFieldsGroups = self::$kernel->getContainer() ->get('doctrine.orm.entity_manager') - ->getRepository(\Chill\CustomFieldsBundle\Entity\CustomFieldsGroup::class) + ->getRepository(CustomFieldsGroup::class) ->findBy(['entity' => \Chill\ReportBundle\Entity\Report::class]); // filter customFieldsGroup to get only "situation de logement" $filteredCustomFieldsGroupHouse = array_filter( @@ -123,7 +123,7 @@ final class ReportControllerTest extends WebTestCase $form = $crawlerAddAReportPage->selectButton('Créer un nouveau rapport')->form(); $this->assertInstanceOf( - \Symfony\Component\DomCrawler\Form::class, + Form::class, $form, 'I can see a form with a button "add a new report" ' ); @@ -242,7 +242,7 @@ final class ReportControllerTest extends WebTestCase $link = $crawlerPersonPage->selectLink("AJOUT D'UN RAPPORT")->link(); $this->assertInstanceOf( - \Symfony\Component\DomCrawler\Link::class, + Link::class, $link, 'There is a "add a report" link in menu' ); @@ -270,7 +270,7 @@ final class ReportControllerTest extends WebTestCase ->form(); $this->assertInstanceOf( - \Symfony\Component\DomCrawler\Form::class, + Form::class, $addForm, 'I have a report form' ); diff --git a/src/Bundle/ChillReportBundle/Tests/Security/Authorization/ReportVoterTest.php b/src/Bundle/ChillReportBundle/Tests/Security/Authorization/ReportVoterTest.php index 5d4261d8a..743d83c8a 100644 --- a/src/Bundle/ChillReportBundle/Tests/Security/Authorization/ReportVoterTest.php +++ b/src/Bundle/ChillReportBundle/Tests/Security/Authorization/ReportVoterTest.php @@ -44,7 +44,9 @@ final class ReportVoterTest extends KernelTestCase */ protected $voter; - public static function setUpBeforeClass(): void {} + public static function setUpBeforeClass(): void + { + } protected function setUp(): void { @@ -132,7 +134,7 @@ final class ReportVoterTest extends KernelTestCase Report $report, $action, $message, - User $user = null + ?User $user = null ) { $token = $this->prepareToken($user); $result = $this->voter->vote($token, $report, [$action]); @@ -159,7 +161,7 @@ final class ReportVoterTest extends KernelTestCase * * @return \Symfony\Component\Security\Core\Authentication\Token\TokenInterface */ - protected function prepareToken(User $user = null) + protected function prepareToken(?User $user = null) { $token = $this->prophet->prophesize(); $token diff --git a/src/Bundle/ChillReportBundle/Tests/Timeline/TimelineProviderTest.php b/src/Bundle/ChillReportBundle/Tests/Timeline/TimelineProviderTest.php index 6e7a6dad1..d7a4054f7 100644 --- a/src/Bundle/ChillReportBundle/Tests/Timeline/TimelineProviderTest.php +++ b/src/Bundle/ChillReportBundle/Tests/Timeline/TimelineProviderTest.php @@ -28,7 +28,7 @@ final class TimelineProviderTest extends WebTestCase { private static ?object $em = null; - private \Chill\PersonBundle\Entity\Person $person; + private Person $person; /** * @var Report @@ -58,7 +58,7 @@ final class TimelineProviderTest extends WebTestCase $scopesSocial = array_filter( self::$em - ->getRepository(\Chill\MainBundle\Entity\Scope::class) + ->getRepository(Scope::class) ->findAll(), static fn (Scope $scope) => 'social' === $scope->getName()['en'] ); diff --git a/src/Bundle/ChillReportBundle/Timeline/TimelineReportProvider.php b/src/Bundle/ChillReportBundle/Timeline/TimelineReportProvider.php index 17b600149..6a3f00dd5 100644 --- a/src/Bundle/ChillReportBundle/Timeline/TimelineReportProvider.php +++ b/src/Bundle/ChillReportBundle/Timeline/TimelineReportProvider.php @@ -25,7 +25,9 @@ use Symfony\Component\Security\Core\Security; */ class TimelineReportProvider implements TimelineProviderInterface { - public function __construct(protected EntityManager $em, protected AuthorizationHelper $helper, private readonly Security $security, protected CustomFieldsHelper $customFieldsHelper, protected $showEmptyValues) {} + public function __construct(protected EntityManager $em, protected AuthorizationHelper $helper, private readonly Security $security, protected CustomFieldsHelper $customFieldsHelper, protected $showEmptyValues) + { + } public function fetchQuery($context, array $args) { diff --git a/src/Bundle/ChillReportBundle/migrations/Version20150622233319.php b/src/Bundle/ChillReportBundle/migrations/Version20150622233319.php index 15827738e..c4c261cd3 100644 --- a/src/Bundle/ChillReportBundle/migrations/Version20150622233319.php +++ b/src/Bundle/ChillReportBundle/migrations/Version20150622233319.php @@ -22,7 +22,7 @@ use Symfony\Component\DependencyInjection\ContainerInterface; */ class Version20150622233319 extends AbstractMigration implements ContainerAwareInterface { - private ?\Symfony\Component\DependencyInjection\ContainerInterface $container = null; + private ?ContainerInterface $container = null; public function down(Schema $schema): void { @@ -37,7 +37,7 @@ class Version20150622233319 extends AbstractMigration implements ContainerAwareI $this->addSql('ALTER TABLE Report DROP scope_id'); } - public function setContainer(ContainerInterface $container = null) + public function setContainer(?ContainerInterface $container = null) { if (null === $container) { throw new \RuntimeException('Container is not provided. This migration need container to set a default center'); diff --git a/src/Bundle/ChillTaskBundle/Controller/SingleTaskController.php b/src/Bundle/ChillTaskBundle/Controller/SingleTaskController.php index 16c520c75..bf7e2086f 100644 --- a/src/Bundle/ChillTaskBundle/Controller/SingleTaskController.php +++ b/src/Bundle/ChillTaskBundle/Controller/SingleTaskController.php @@ -55,7 +55,8 @@ final class SingleTaskController extends AbstractController private readonly FilterOrderHelperFactoryInterface $filterOrderHelperFactory, private readonly SingleTaskStateRepository $singleTaskStateRepository, private readonly SingleTaskRepository $singleTaskRepository, - ) {} + ) { + } /** * @Route( @@ -625,7 +626,7 @@ final class SingleTaskController extends AbstractController } /** - * @return \Symfony\Component\Form\FormInterface + * @return FormInterface */ protected function setCreateForm(SingleTask $task, string $role) { diff --git a/src/Bundle/ChillTaskBundle/Entity/AbstractTask.php b/src/Bundle/ChillTaskBundle/Entity/AbstractTask.php index 51ab8166d..f9118737f 100644 --- a/src/Bundle/ChillTaskBundle/Entity/AbstractTask.php +++ b/src/Bundle/ChillTaskBundle/Entity/AbstractTask.php @@ -39,14 +39,14 @@ abstract class AbstractTask implements HasCenterInterface, HasScopeInterface * * @Serializer\Groups({"read"}) */ - private ?\Chill\MainBundle\Entity\User $assignee = null; + private ?User $assignee = null; /** * @ORM\ManyToOne( * targetEntity="\Chill\MainBundle\Entity\Scope" * ) */ - private ?\Chill\MainBundle\Entity\Scope $circle = null; + private ?Scope $circle = null; /** * @ORM\Column(name="closed", type="boolean", options={ "default": false }) @@ -60,7 +60,7 @@ abstract class AbstractTask implements HasCenterInterface, HasScopeInterface * * @Serializer\Groups({"read"}) */ - private ?\Chill\PersonBundle\Entity\AccompanyingPeriod $course = null; + private ?AccompanyingPeriod $course = null; /** * @ORM\Column(name="current_states", type="json", options={"jsonb"=true, "default"="[]"}) @@ -83,7 +83,7 @@ abstract class AbstractTask implements HasCenterInterface, HasScopeInterface * * @Serializer\Groups({"read"}) */ - private ?\Chill\PersonBundle\Entity\Person $person = null; + private ?Person $person = null; /** * @ORM\Column(name="title", type="text") @@ -189,7 +189,7 @@ abstract class AbstractTask implements HasCenterInterface, HasScopeInterface return $this->closed; } - public function setAssignee(User $assignee = null) + public function setAssignee(?User $assignee = null) { $this->assignee = $assignee; diff --git a/src/Bundle/ChillTaskBundle/Entity/SingleTask.php b/src/Bundle/ChillTaskBundle/Entity/SingleTask.php index eca0c17cc..150394c45 100644 --- a/src/Bundle/ChillTaskBundle/Entity/SingleTask.php +++ b/src/Bundle/ChillTaskBundle/Entity/SingleTask.php @@ -71,7 +71,7 @@ class SingleTask extends AbstractTask * inversedBy="singleTasks" * ) */ - private ?\Chill\TaskBundle\Entity\RecurringTask $recurringTask = null; + private ?RecurringTask $recurringTask = null; /** * @ORM\Column(name="start_date", type="date", nullable=true) @@ -115,7 +115,7 @@ class SingleTask extends AbstractTask * message="An end date is required if a warning interval is set" * ) */ - private null|\DateInterval $warningInterval = null; + private \DateInterval|null $warningInterval = null; public function __construct() { @@ -125,7 +125,7 @@ class SingleTask extends AbstractTask /** * Get endDate. */ - public function getEndDate(): null|\DateTime + public function getEndDate(): \DateTime|null { return $this->endDate; } @@ -187,7 +187,7 @@ class SingleTask extends AbstractTask /** * Get warningInterval. */ - public function getWarningInterval(): null|\DateInterval + public function getWarningInterval(): \DateInterval|null { return $this->warningInterval; } @@ -237,7 +237,7 @@ class SingleTask extends AbstractTask * * @return SingleTask */ - public function setWarningInterval(null|\DateInterval $warningInterval) + public function setWarningInterval(\DateInterval|null $warningInterval) { $this->warningInterval = $warningInterval; diff --git a/src/Bundle/ChillTaskBundle/Entity/Task/AbstractTaskPlaceEvent.php b/src/Bundle/ChillTaskBundle/Entity/Task/AbstractTaskPlaceEvent.php index 8a47eda19..367bfbfb8 100644 --- a/src/Bundle/ChillTaskBundle/Entity/Task/AbstractTaskPlaceEvent.php +++ b/src/Bundle/ChillTaskBundle/Entity/Task/AbstractTaskPlaceEvent.php @@ -26,7 +26,7 @@ class AbstractTaskPlaceEvent * targetEntity="\Chill\MainBundle\Entity\User" * ) */ - private ?\Chill\MainBundle\Entity\User $author = null; + private ?User $author = null; /** * @ORM\Column(name="data", type="json") diff --git a/src/Bundle/ChillTaskBundle/Entity/Task/SingleTaskPlaceEvent.php b/src/Bundle/ChillTaskBundle/Entity/Task/SingleTaskPlaceEvent.php index 47e3eabfb..50f1dce64 100644 --- a/src/Bundle/ChillTaskBundle/Entity/Task/SingleTaskPlaceEvent.php +++ b/src/Bundle/ChillTaskBundle/Entity/Task/SingleTaskPlaceEvent.php @@ -48,7 +48,7 @@ class SingleTaskPlaceEvent extends AbstractTaskPlaceEvent * inversedBy="taskPlaceEvents" * ) */ - protected ?\Chill\TaskBundle\Entity\SingleTask $task = null; + protected ?SingleTask $task = null; public function getTask(): SingleTask { diff --git a/src/Bundle/ChillTaskBundle/Form/SingleTaskType.php b/src/Bundle/ChillTaskBundle/Form/SingleTaskType.php index 7e572e078..2d4c7cef9 100644 --- a/src/Bundle/ChillTaskBundle/Form/SingleTaskType.php +++ b/src/Bundle/ChillTaskBundle/Form/SingleTaskType.php @@ -27,7 +27,9 @@ use Symfony\Component\OptionsResolver\OptionsResolver; class SingleTaskType extends AbstractType { - public function __construct(private readonly ParameterBagInterface $parameterBag, private readonly CenterResolverDispatcherInterface $centerResolverDispatcher, private readonly ScopeResolverDispatcher $scopeResolverDispatcher) {} + public function __construct(private readonly ParameterBagInterface $parameterBag, private readonly CenterResolverDispatcherInterface $centerResolverDispatcher, private readonly ScopeResolverDispatcher $scopeResolverDispatcher) + { + } public function buildForm(FormBuilderInterface $builder, array $options) { diff --git a/src/Bundle/ChillTaskBundle/Repository/AbstractTaskRepository.php b/src/Bundle/ChillTaskBundle/Repository/AbstractTaskRepository.php index 6ac7f10ec..d19420580 100644 --- a/src/Bundle/ChillTaskBundle/Repository/AbstractTaskRepository.php +++ b/src/Bundle/ChillTaskBundle/Repository/AbstractTaskRepository.php @@ -17,4 +17,6 @@ namespace Chill\TaskBundle\Repository; * This class was generated by the Doctrine ORM. Add your own custom * repository methods below. */ -abstract class AbstractTaskRepository extends \Doctrine\ORM\EntityRepository {} +abstract class AbstractTaskRepository extends \Doctrine\ORM\EntityRepository +{ +} diff --git a/src/Bundle/ChillTaskBundle/Repository/RecurringTaskRepository.php b/src/Bundle/ChillTaskBundle/Repository/RecurringTaskRepository.php index 985aa9935..4bbedd1bb 100644 --- a/src/Bundle/ChillTaskBundle/Repository/RecurringTaskRepository.php +++ b/src/Bundle/ChillTaskBundle/Repository/RecurringTaskRepository.php @@ -17,4 +17,6 @@ namespace Chill\TaskBundle\Repository; * This class was generated by the Doctrine ORM. Add your own custom * repository methods below. */ -class RecurringTaskRepository extends \Doctrine\ORM\EntityRepository {} +class RecurringTaskRepository extends \Doctrine\ORM\EntityRepository +{ +} diff --git a/src/Bundle/ChillTaskBundle/Repository/SingleTaskAclAwareRepository.php b/src/Bundle/ChillTaskBundle/Repository/SingleTaskAclAwareRepository.php index 605597fea..d72c23298 100644 --- a/src/Bundle/ChillTaskBundle/Repository/SingleTaskAclAwareRepository.php +++ b/src/Bundle/ChillTaskBundle/Repository/SingleTaskAclAwareRepository.php @@ -23,10 +23,12 @@ use Symfony\Component\Security\Core\Security; final readonly class SingleTaskAclAwareRepository implements SingleTaskAclAwareRepositoryInterface { - public function __construct(private CenterResolverManagerInterface $centerResolverDispatcher, private EntityManagerInterface $em, private Security $security, private AuthorizationHelperInterface $authorizationHelper) {} + public function __construct(private CenterResolverManagerInterface $centerResolverDispatcher, private EntityManagerInterface $em, private Security $security, private AuthorizationHelperInterface $authorizationHelper) + { + } public function buildBaseQuery( - string $pattern = null, + ?string $pattern = null, ?array $flags = [], ?array $types = [], ?array $users = [] @@ -148,7 +150,7 @@ final readonly class SingleTaskAclAwareRepository implements SingleTaskAclAwareR public function buildQueryByCourse( AccompanyingPeriod $course, - string $pattern = null, + ?string $pattern = null, ?array $flags = [] ): QueryBuilder { $qb = $this->buildBaseQuery($pattern, $flags); @@ -160,7 +162,7 @@ final readonly class SingleTaskAclAwareRepository implements SingleTaskAclAwareR public function buildQueryByPerson( Person $person, - string $pattern = null, + ?string $pattern = null, ?array $flags = [] ): QueryBuilder { $qb = $this->buildBaseQuery($pattern, $flags); @@ -171,7 +173,7 @@ final readonly class SingleTaskAclAwareRepository implements SingleTaskAclAwareR } public function buildQueryMyTasks( - string $pattern = null, + ?string $pattern = null, ?array $flags = [] ): QueryBuilder { $qb = $this->buildBaseQuery($pattern, $flags); @@ -182,7 +184,7 @@ final readonly class SingleTaskAclAwareRepository implements SingleTaskAclAwareR } public function countByAllViewable( - string $pattern = null, + ?string $pattern = null, ?array $flags = [], ?array $types = [], ?array $users = [] @@ -197,7 +199,7 @@ final readonly class SingleTaskAclAwareRepository implements SingleTaskAclAwareR public function countByCourse( AccompanyingPeriod $course, - string $pattern = null, + ?string $pattern = null, ?array $flags = [] ): int { $qb = $this->buildQueryByCourse($course, $pattern, $flags); @@ -209,7 +211,7 @@ final readonly class SingleTaskAclAwareRepository implements SingleTaskAclAwareR } public function countByCurrentUsersTasks( - string $pattern = null, + ?string $pattern = null, ?array $flags = [] ): int { return $this->buildQueryMyTasks($pattern, $flags) @@ -219,7 +221,7 @@ final readonly class SingleTaskAclAwareRepository implements SingleTaskAclAwareR public function countByPerson( Person $person, - string $pattern = null, + ?string $pattern = null, ?array $flags = [] ): int { $qb = $this->buildQueryByPerson($person, $pattern, $flags); @@ -231,7 +233,7 @@ final readonly class SingleTaskAclAwareRepository implements SingleTaskAclAwareR } public function findByAllViewable( - string $pattern = null, + ?string $pattern = null, ?array $flags = [], ?array $types = [], ?array $users = [], @@ -247,7 +249,7 @@ final readonly class SingleTaskAclAwareRepository implements SingleTaskAclAwareR public function findByCourse( AccompanyingPeriod $course, - string $pattern = null, + ?string $pattern = null, ?array $flags = [], ?int $start = 0, ?int $limit = 50, @@ -260,7 +262,7 @@ final readonly class SingleTaskAclAwareRepository implements SingleTaskAclAwareR } public function findByCurrentUsersTasks( - string $pattern = null, + ?string $pattern = null, ?array $flags = [], ?int $start = 0, ?int $limit = 50, @@ -273,7 +275,7 @@ final readonly class SingleTaskAclAwareRepository implements SingleTaskAclAwareR public function findByPerson( Person $person, - string $pattern = null, + ?string $pattern = null, ?array $flags = [], ?int $start = 0, ?int $limit = 50, diff --git a/src/Bundle/ChillTaskBundle/Repository/SingleTaskAclAwareRepositoryInterface.php b/src/Bundle/ChillTaskBundle/Repository/SingleTaskAclAwareRepositoryInterface.php index 2f305ae3e..bb63c0caa 100644 --- a/src/Bundle/ChillTaskBundle/Repository/SingleTaskAclAwareRepositoryInterface.php +++ b/src/Bundle/ChillTaskBundle/Repository/SingleTaskAclAwareRepositoryInterface.php @@ -17,7 +17,7 @@ use Chill\PersonBundle\Entity\Person; interface SingleTaskAclAwareRepositoryInterface { public function countByAllViewable( - string $pattern = null, + ?string $pattern = null, ?array $flags = [], ?array $types = [], ?array $users = [] @@ -25,20 +25,20 @@ interface SingleTaskAclAwareRepositoryInterface public function countByCourse( AccompanyingPeriod $course, - string $pattern = null, + ?string $pattern = null, ?array $flags = [] ): int; - public function countByCurrentUsersTasks(string $pattern = null, ?array $flags = []): int; + public function countByCurrentUsersTasks(?string $pattern = null, ?array $flags = []): int; public function countByPerson( Person $person, - string $pattern = null, + ?string $pattern = null, ?array $flags = [] ): int; public function findByAllViewable( - string $pattern = null, + ?string $pattern = null, ?array $flags = [], ?array $types = [], ?array $users = [], @@ -49,18 +49,18 @@ interface SingleTaskAclAwareRepositoryInterface public function findByCourse( AccompanyingPeriod $course, - string $pattern = null, + ?string $pattern = null, ?array $flags = [], ?int $start = 0, ?int $limit = 50, ?array $orderBy = [] ): array; - public function findByCurrentUsersTasks(string $pattern = null, ?array $flags = [], ?int $start = 0, ?int $limit = 50, ?array $orderBy = []): array; + public function findByCurrentUsersTasks(?string $pattern = null, ?array $flags = [], ?int $start = 0, ?int $limit = 50, ?array $orderBy = []): array; public function findByPerson( Person $person, - string $pattern = null, + ?string $pattern = null, ?array $flags = [], ?int $start = 0, ?int $limit = 50, diff --git a/src/Bundle/ChillTaskBundle/Repository/SingleTaskRepository.php b/src/Bundle/ChillTaskBundle/Repository/SingleTaskRepository.php index 6260b90c1..c8a84cbf8 100644 --- a/src/Bundle/ChillTaskBundle/Repository/SingleTaskRepository.php +++ b/src/Bundle/ChillTaskBundle/Repository/SingleTaskRepository.php @@ -56,7 +56,7 @@ class SingleTaskRepository extends EntityRepository * * @return int */ - public function countByParameters($params, User $currentUser = null) + public function countByParameters($params, ?User $currentUser = null) { $qb = $this->createQueryBuilder('st') ->select('COUNT(st)'); @@ -175,7 +175,7 @@ class SingleTaskRepository extends EntityRepository $qb->where($where); } - protected function buildQuery(QueryBuilder $qb, $params, User $currentUser = null) + protected function buildQuery(QueryBuilder $qb, $params, ?User $currentUser = null) { if (null !== $currentUser) { $this->buildACLQuery($qb, $currentUser); diff --git a/src/Bundle/ChillTaskBundle/Repository/SingleTaskStateRepository.php b/src/Bundle/ChillTaskBundle/Repository/SingleTaskStateRepository.php index 614870264..477788aa7 100644 --- a/src/Bundle/ChillTaskBundle/Repository/SingleTaskStateRepository.php +++ b/src/Bundle/ChillTaskBundle/Repository/SingleTaskStateRepository.php @@ -22,7 +22,8 @@ class SingleTaskStateRepository public function __construct( private readonly Connection $connection - ) {} + ) { + } /** * Return a list of all states associated to at least one single task in the database. diff --git a/src/Bundle/ChillTaskBundle/Security/Authorization/AuthorizationEvent.php b/src/Bundle/ChillTaskBundle/Security/Authorization/AuthorizationEvent.php index 3c1103ddf..3b2de6ed5 100644 --- a/src/Bundle/ChillTaskBundle/Security/Authorization/AuthorizationEvent.php +++ b/src/Bundle/ChillTaskBundle/Security/Authorization/AuthorizationEvent.php @@ -26,10 +26,11 @@ class AuthorizationEvent extends \Symfony\Contracts\EventDispatcher\Event protected $vote; public function __construct( - private readonly null|AbstractTask|AccompanyingPeriod|Person $subject, + private readonly AbstractTask|AccompanyingPeriod|Person|null $subject, private readonly string $attribute, private readonly TokenInterface $token - ) {} + ) { + } public function getAttribute() { diff --git a/src/Bundle/ChillTaskBundle/Templating/TaskTwigExtension.php b/src/Bundle/ChillTaskBundle/Templating/TaskTwigExtension.php index 878ae43cd..affaab8c7 100644 --- a/src/Bundle/ChillTaskBundle/Templating/TaskTwigExtension.php +++ b/src/Bundle/ChillTaskBundle/Templating/TaskTwigExtension.php @@ -39,7 +39,7 @@ class TaskTwigExtension extends AbstractExtension AbstractTask $task, string $key, $metadataSubject = null, - string $name = null + ?string $name = null ) { return $this->taskWorkflowManager->getWorkflowMetadata($task, $key, $metadataSubject, $name); } diff --git a/src/Bundle/ChillTaskBundle/Tests/Controller/TaskControllerTest.php b/src/Bundle/ChillTaskBundle/Tests/Controller/TaskControllerTest.php index e8758290a..d4169549c 100644 --- a/src/Bundle/ChillTaskBundle/Tests/Controller/TaskControllerTest.php +++ b/src/Bundle/ChillTaskBundle/Tests/Controller/TaskControllerTest.php @@ -18,4 +18,6 @@ use Symfony\Bundle\FrameworkBundle\Test\WebTestCase; * * @coversNothing */ -final class TaskControllerTest extends WebTestCase {} +final class TaskControllerTest extends WebTestCase +{ +} diff --git a/src/Bundle/ChillTaskBundle/Timeline/TaskLifeCycleEventTimelineProvider.php b/src/Bundle/ChillTaskBundle/Timeline/TaskLifeCycleEventTimelineProvider.php index 98b38a989..fa4c2527e 100644 --- a/src/Bundle/ChillTaskBundle/Timeline/TaskLifeCycleEventTimelineProvider.php +++ b/src/Bundle/ChillTaskBundle/Timeline/TaskLifeCycleEventTimelineProvider.php @@ -30,7 +30,9 @@ class TaskLifeCycleEventTimelineProvider implements TimelineProviderInterface { final public const TYPE = 'chill_task.transition'; - public function __construct(protected EntityManagerInterface $em, protected Registry $registry, protected AuthorizationHelper $authorizationHelper, protected Security $security) {} + public function __construct(protected EntityManagerInterface $em, protected Registry $registry, protected AuthorizationHelper $authorizationHelper, protected Security $security) + { + } public function fetchQuery($context, $args) { diff --git a/src/Bundle/ChillTaskBundle/Workflow/TaskWorkflowDefinition.php b/src/Bundle/ChillTaskBundle/Workflow/TaskWorkflowDefinition.php index 81fea25e6..76a8da7c8 100644 --- a/src/Bundle/ChillTaskBundle/Workflow/TaskWorkflowDefinition.php +++ b/src/Bundle/ChillTaskBundle/Workflow/TaskWorkflowDefinition.php @@ -11,4 +11,6 @@ declare(strict_types=1); namespace Chill\TaskBundle\Workflow; -interface TaskWorkflowDefinition {} +interface TaskWorkflowDefinition +{ +} diff --git a/src/Bundle/ChillTaskBundle/Workflow/TaskWorkflowManager.php b/src/Bundle/ChillTaskBundle/Workflow/TaskWorkflowManager.php index 949786dd5..c0ce60dbe 100644 --- a/src/Bundle/ChillTaskBundle/Workflow/TaskWorkflowManager.php +++ b/src/Bundle/ChillTaskBundle/Workflow/TaskWorkflowManager.php @@ -56,7 +56,7 @@ class TaskWorkflowManager implements WorkflowSupportStrategyInterface return $definitions[0]; } - public function getWorkflowMetadata(AbstractTask $task, string $key, $metadataSubject = null, string $name = null) + public function getWorkflowMetadata(AbstractTask $task, string $key, $metadataSubject = null, ?string $name = null) { return $this->getTaskWorkflowDefinition($task) ->getWorkflowMetadata($task, $key, $metadataSubject); diff --git a/src/Bundle/ChillThirdPartyBundle/Controller/ThirdPartyController.php b/src/Bundle/ChillThirdPartyBundle/Controller/ThirdPartyController.php index 214d9ba36..30082d90b 100644 --- a/src/Bundle/ChillThirdPartyBundle/Controller/ThirdPartyController.php +++ b/src/Bundle/ChillThirdPartyBundle/Controller/ThirdPartyController.php @@ -59,7 +59,7 @@ final class ThirdPartyController extends CRUDController ->build(); } - protected function countEntities(string $action, Request $request, FilterOrderHelper $filterOrder = null): int + protected function countEntities(string $action, Request $request, ?FilterOrderHelper $filterOrder = null): int { if (null === $filterOrder) { throw new \LogicException('filterOrder should not be null'); @@ -71,7 +71,7 @@ final class ThirdPartyController extends CRUDController ); } - protected function createFormFor(string $action, $entity, string $formClass = null, array $formOptions = []): FormInterface + protected function createFormFor(string $action, $entity, ?string $formClass = null, array $formOptions = []): FormInterface { if ('new' === $action) { return parent::createFormFor($action, $entity, $formClass, \array_merge( @@ -90,7 +90,7 @@ final class ThirdPartyController extends CRUDController return parent::createFormFor($action, $entity, $formClass, $formOptions); } - protected function getQueryResult(string $action, Request $request, int $totalItems, PaginatorInterface $paginator, FilterOrderHelper $filterOrder = null) + protected function getQueryResult(string $action, Request $request, int $totalItems, PaginatorInterface $paginator, ?FilterOrderHelper $filterOrder = null) { return $this->thirdPartyACLAwareRepository ->listThirdParties( diff --git a/src/Bundle/ChillThirdPartyBundle/DependencyInjection/ChillThirdPartyExtension.php b/src/Bundle/ChillThirdPartyBundle/DependencyInjection/ChillThirdPartyExtension.php index 91625c827..cff064edc 100644 --- a/src/Bundle/ChillThirdPartyBundle/DependencyInjection/ChillThirdPartyExtension.php +++ b/src/Bundle/ChillThirdPartyBundle/DependencyInjection/ChillThirdPartyExtension.php @@ -127,7 +127,7 @@ class ChillThirdPartyExtension extends Extension implements PrependExtensionInte ], 'apis' => [ [ - 'class' => \Chill\ThirdPartyBundle\Entity\ThirdParty::class, + 'class' => ThirdParty::class, 'name' => 'thirdparty', 'base_path' => '/api/1.0/thirdparty/thirdparty', // 'base_role' => \Chill\ThirdPartyBundle\Security\Authorization\ThirdPartyVoter::SHOW, @@ -142,11 +142,11 @@ class ChillThirdPartyExtension extends Extension implements PrependExtensionInte Request::METHOD_PATCH => true, ], 'roles' => [ - Request::METHOD_GET => \Chill\ThirdPartyBundle\Security\Voter\ThirdPartyVoter::SHOW, - Request::METHOD_HEAD => \Chill\ThirdPartyBundle\Security\Voter\ThirdPartyVoter::SHOW, - Request::METHOD_POST => \Chill\ThirdPartyBundle\Security\Voter\ThirdPartyVoter::CREATE, - Request::METHOD_PUT => \Chill\ThirdPartyBundle\Security\Voter\ThirdPartyVoter::CREATE, - Request::METHOD_PATCH => \Chill\ThirdPartyBundle\Security\Voter\ThirdPartyVoter::CREATE, + Request::METHOD_GET => ThirdPartyVoter::SHOW, + Request::METHOD_HEAD => ThirdPartyVoter::SHOW, + Request::METHOD_POST => ThirdPartyVoter::CREATE, + Request::METHOD_PUT => ThirdPartyVoter::CREATE, + Request::METHOD_PATCH => ThirdPartyVoter::CREATE, ], ], ], diff --git a/src/Bundle/ChillThirdPartyBundle/Entity/ThirdParty.php b/src/Bundle/ChillThirdPartyBundle/Entity/ThirdParty.php index f4ad5293c..721fbcb67 100644 --- a/src/Bundle/ChillThirdPartyBundle/Entity/ThirdParty.php +++ b/src/Bundle/ChillThirdPartyBundle/Entity/ThirdParty.php @@ -655,7 +655,7 @@ class ThirdParty implements TrackCreationInterface, TrackUpdateInterface, \Strin throw new \UnexpectedValueException(sprintf('typeAndCategory should be a string or a %s', ThirdPartyCategory::class)); } - public function setAcronym(string $acronym = null): ThirdParty + public function setAcronym(?string $acronym = null): ThirdParty { $this->acronym = (string) $acronym; @@ -679,7 +679,7 @@ class ThirdParty implements TrackCreationInterface, TrackUpdateInterface, \Strin /** * @return $this */ - public function setAddress(Address $address = null) + public function setAddress(?Address $address = null) { $this->address = $address; @@ -716,7 +716,7 @@ class ThirdParty implements TrackCreationInterface, TrackUpdateInterface, \Strin * * @return ThirdParty */ - public function setComment(string $comment = null) + public function setComment(?string $comment = null) { $this->comment = $comment; @@ -754,7 +754,7 @@ class ThirdParty implements TrackCreationInterface, TrackUpdateInterface, \Strin * * @return ThirdParty */ - public function setEmail(string $email = null) + public function setEmail(?string $email = null) { $this->email = trim((string) $email); @@ -806,7 +806,7 @@ class ThirdParty implements TrackCreationInterface, TrackUpdateInterface, \Strin /** * Set telephone. */ - public function setTelephone(PhoneNumber $telephone = null): self + public function setTelephone(?PhoneNumber $telephone = null): self { $this->telephone = $telephone; diff --git a/src/Bundle/ChillThirdPartyBundle/Export/Helper/LabelThirdPartyHelper.php b/src/Bundle/ChillThirdPartyBundle/Export/Helper/LabelThirdPartyHelper.php index e92cdae93..41e18d62c 100644 --- a/src/Bundle/ChillThirdPartyBundle/Export/Helper/LabelThirdPartyHelper.php +++ b/src/Bundle/ChillThirdPartyBundle/Export/Helper/LabelThirdPartyHelper.php @@ -16,7 +16,9 @@ use Chill\ThirdPartyBundle\Templating\Entity\ThirdPartyRender; class LabelThirdPartyHelper { - public function __construct(private readonly ThirdPartyRender $thirdPartyRender, private readonly ThirdPartyRepository $thirdPartyRepository) {} + public function __construct(private readonly ThirdPartyRender $thirdPartyRender, private readonly ThirdPartyRepository $thirdPartyRepository) + { + } public function getLabel(string $key, array $values, string $header): callable { diff --git a/src/Bundle/ChillThirdPartyBundle/Form/ThirdPartyType.php b/src/Bundle/ChillThirdPartyBundle/Form/ThirdPartyType.php index 41e0140c8..046d553e9 100644 --- a/src/Bundle/ChillThirdPartyBundle/Form/ThirdPartyType.php +++ b/src/Bundle/ChillThirdPartyBundle/Form/ThirdPartyType.php @@ -100,7 +100,7 @@ class ThirdPartyType extends AbstractType 'label' => 'thirdparty.Contact data are confidential', ]); - // Institutional ThirdParty (parent) + // Institutional ThirdParty (parent) } else { $builder ->add('nameCompany', TextType::class, [ diff --git a/src/Bundle/ChillThirdPartyBundle/Form/Type/PickThirdPartyTypeCategoryType.php b/src/Bundle/ChillThirdPartyBundle/Form/Type/PickThirdPartyTypeCategoryType.php index 77720331d..b2ef89132 100644 --- a/src/Bundle/ChillThirdPartyBundle/Form/Type/PickThirdPartyTypeCategoryType.php +++ b/src/Bundle/ChillThirdPartyBundle/Form/Type/PickThirdPartyTypeCategoryType.php @@ -24,7 +24,9 @@ class PickThirdPartyTypeCategoryType extends \Symfony\Component\Form\AbstractTyp { private const PREFIX_TYPE = 'chill_3party.key_label.'; - public function __construct(private readonly ThirdPartyCategoryRepository $thirdPartyCategoryRepository, private readonly ThirdPartyTypeManager $thirdPartyTypeManager, private readonly TranslatableStringHelper $translatableStringHelper, private readonly TranslatorInterface $translator) {} + public function __construct(private readonly ThirdPartyCategoryRepository $thirdPartyCategoryRepository, private readonly ThirdPartyTypeManager $thirdPartyTypeManager, private readonly TranslatableStringHelper $translatableStringHelper, private readonly TranslatorInterface $translator) + { + } public function configureOptions(OptionsResolver $resolver) { diff --git a/src/Bundle/ChillThirdPartyBundle/Form/Type/PickThirdpartyDynamicType.php b/src/Bundle/ChillThirdPartyBundle/Form/Type/PickThirdpartyDynamicType.php index 0fd640f9b..9022fb6dc 100644 --- a/src/Bundle/ChillThirdPartyBundle/Form/Type/PickThirdpartyDynamicType.php +++ b/src/Bundle/ChillThirdPartyBundle/Form/Type/PickThirdpartyDynamicType.php @@ -26,7 +26,9 @@ use Symfony\Component\Serializer\SerializerInterface; */ class PickThirdpartyDynamicType extends AbstractType { - public function __construct(private readonly DenormalizerInterface $denormalizer, private readonly SerializerInterface $serializer, private readonly NormalizerInterface $normalizer) {} + public function __construct(private readonly DenormalizerInterface $denormalizer, private readonly SerializerInterface $serializer, private readonly NormalizerInterface $normalizer) + { + } public function buildForm(FormBuilderInterface $builder, array $options) { diff --git a/src/Bundle/ChillThirdPartyBundle/Repository/ThirdPartyACLAwareRepository.php b/src/Bundle/ChillThirdPartyBundle/Repository/ThirdPartyACLAwareRepository.php index f05ad0296..3538a7877 100644 --- a/src/Bundle/ChillThirdPartyBundle/Repository/ThirdPartyACLAwareRepository.php +++ b/src/Bundle/ChillThirdPartyBundle/Repository/ThirdPartyACLAwareRepository.php @@ -17,9 +17,11 @@ use Symfony\Component\Security\Core\Security; final readonly class ThirdPartyACLAwareRepository implements ThirdPartyACLAwareRepositoryInterface { - public function __construct(private Security $security, private AuthorizationHelper $authorizationHelper, private ThirdPartyRepository $thirdPartyRepository) {} + public function __construct(private Security $security, private AuthorizationHelper $authorizationHelper, private ThirdPartyRepository $thirdPartyRepository) + { + } - public function buildQuery(string $filterString = null): QueryBuilder + public function buildQuery(?string $filterString = null): QueryBuilder { $qb = $this->thirdPartyRepository->createQueryBuilder('tp'); @@ -51,8 +53,8 @@ final readonly class ThirdPartyACLAwareRepository implements ThirdPartyACLAwareR string $role, ?string $filterString, ?array $orderBy = [], - int $limit = null, - int $offset = null + ?int $limit = null, + ?int $offset = null ): array { $qb = $this->buildQuery($filterString); diff --git a/src/Bundle/ChillThirdPartyBundle/Repository/ThirdPartyRepository.php b/src/Bundle/ChillThirdPartyBundle/Repository/ThirdPartyRepository.php index c2e6c74c1..7390808c8 100644 --- a/src/Bundle/ChillThirdPartyBundle/Repository/ThirdPartyRepository.php +++ b/src/Bundle/ChillThirdPartyBundle/Repository/ThirdPartyRepository.php @@ -38,7 +38,7 @@ class ThirdPartyRepository implements ObjectRepository return $qb->getQuery()->getSingleScalarResult(); } - public function createQueryBuilder(string $alias, string $indexBy = null): QueryBuilder + public function createQueryBuilder(string $alias, ?string $indexBy = null): QueryBuilder { return $this->repository->createQueryBuilder($alias, $indexBy); } @@ -62,7 +62,7 @@ class ThirdPartyRepository implements ObjectRepository * * @return array|ThirdParty[] */ - public function findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null): array + public function findBy(array $criteria, ?array $orderBy = null, $limit = null, $offset = null): array { return $this->repository->findBy($criteria, $orderBy, $limit, $offset); } diff --git a/src/Bundle/ChillThirdPartyBundle/Search/ThirdPartyApiSearch.php b/src/Bundle/ChillThirdPartyBundle/Search/ThirdPartyApiSearch.php index 8970fec1c..844302295 100644 --- a/src/Bundle/ChillThirdPartyBundle/Search/ThirdPartyApiSearch.php +++ b/src/Bundle/ChillThirdPartyBundle/Search/ThirdPartyApiSearch.php @@ -44,14 +44,18 @@ FROM rows, searches */ class ThirdPartyApiSearch implements SearchApiInterface { - public function __construct(private readonly ThirdPartyRepository $thirdPartyRepository) {} + public function __construct(private readonly ThirdPartyRepository $thirdPartyRepository) + { + } public function getResult(string $key, array $metadata, float $pertinence) { return $this->thirdPartyRepository->find($metadata['id']); } - public function prepare(array $metadatas): void {} + public function prepare(array $metadatas): void + { + } public function provideQuery(string $pattern, array $parameters): SearchApiQuery { diff --git a/src/Bundle/ChillThirdPartyBundle/Serializer/Normalizer/ThirdPartyNormalizer.php b/src/Bundle/ChillThirdPartyBundle/Serializer/Normalizer/ThirdPartyNormalizer.php index 26f175705..b2271e8df 100644 --- a/src/Bundle/ChillThirdPartyBundle/Serializer/Normalizer/ThirdPartyNormalizer.php +++ b/src/Bundle/ChillThirdPartyBundle/Serializer/Normalizer/ThirdPartyNormalizer.php @@ -24,7 +24,9 @@ class ThirdPartyNormalizer implements NormalizerAwareInterface, NormalizerInterf { use NormalizerAwareTrait; - public function __construct(private readonly ThirdPartyRender $thirdPartyRender, private readonly TranslatableStringHelperInterface $translatableStringHelper) {} + public function __construct(private readonly ThirdPartyRender $thirdPartyRender, private readonly TranslatableStringHelperInterface $translatableStringHelper) + { + } public function normalize($thirdParty, $format = null, array $context = []) { diff --git a/src/Bundle/ChillThirdPartyBundle/Templating/Entity/ThirdPartyRender.php b/src/Bundle/ChillThirdPartyBundle/Templating/Entity/ThirdPartyRender.php index a36ceda4e..4a7403f17 100644 --- a/src/Bundle/ChillThirdPartyBundle/Templating/Entity/ThirdPartyRender.php +++ b/src/Bundle/ChillThirdPartyBundle/Templating/Entity/ThirdPartyRender.php @@ -23,7 +23,9 @@ class ThirdPartyRender implements ChillEntityRenderInterface { use BoxUtilsChillEntityRenderTrait; - public function __construct(protected \Twig\Environment $engine, protected TranslatableStringHelper $translatableStringHelper) {} + public function __construct(protected \Twig\Environment $engine, protected TranslatableStringHelper $translatableStringHelper) + { + } public function renderBox($entity, array $options): string { diff --git a/src/Bundle/ChillWopiBundle/src/ChillWopiBundle.php b/src/Bundle/ChillWopiBundle/src/ChillWopiBundle.php index 401eb9970..5ca164db1 100644 --- a/src/Bundle/ChillWopiBundle/src/ChillWopiBundle.php +++ b/src/Bundle/ChillWopiBundle/src/ChillWopiBundle.php @@ -13,4 +13,6 @@ namespace Chill\WopiBundle; use Symfony\Component\HttpKernel\Bundle\Bundle; -final class ChillWopiBundle extends Bundle {} +final class ChillWopiBundle extends Bundle +{ +} diff --git a/src/Bundle/ChillWopiBundle/src/Controller/Editor.php b/src/Bundle/ChillWopiBundle/src/Controller/Editor.php index 053b7abd0..feae8d708 100644 --- a/src/Bundle/ChillWopiBundle/src/Controller/Editor.php +++ b/src/Bundle/ChillWopiBundle/src/Controller/Editor.php @@ -37,7 +37,9 @@ use Twig\Environment; */ final readonly class Editor { - public function __construct(private ConfigurationInterface $wopiConfiguration, private DiscoveryInterface $wopiDiscovery, private DocumentManagerInterface $documentManager, private Environment $engine, private JWTTokenManagerInterface $JWTTokenManager, private NormalizerInterface $normalizer, private ResponderInterface $responder, private Security $security, private Psr17Interface $psr17, private RouterInterface $router) {} + public function __construct(private ConfigurationInterface $wopiConfiguration, private DiscoveryInterface $wopiDiscovery, private DocumentManagerInterface $documentManager, private Environment $engine, private JWTTokenManagerInterface $JWTTokenManager, private NormalizerInterface $normalizer, private ResponderInterface $responder, private Security $security, private Psr17Interface $psr17, private RouterInterface $router) + { + } public function __invoke(string $fileId, Request $request): Response { diff --git a/src/Bundle/ChillWopiBundle/src/Resources/config/routes/routes.php b/src/Bundle/ChillWopiBundle/src/Resources/config/routes/routes.php index 141799207..2272c9efd 100644 --- a/src/Bundle/ChillWopiBundle/src/Resources/config/routes/routes.php +++ b/src/Bundle/ChillWopiBundle/src/Resources/config/routes/routes.php @@ -19,5 +19,5 @@ return static function (RoutingConfigurator $routes) { $routes ->add('chill_wopi_object_convert', '/convert/{uuid}') - ->controller(\Chill\WopiBundle\Controller\Convert::class); + ->controller(Chill\WopiBundle\Controller\Convert::class); }; diff --git a/src/Bundle/ChillWopiBundle/src/Service/Controller/Responder.php b/src/Bundle/ChillWopiBundle/src/Service/Controller/Responder.php index a57eab761..b85d1b8b3 100644 --- a/src/Bundle/ChillWopiBundle/src/Service/Controller/Responder.php +++ b/src/Bundle/ChillWopiBundle/src/Service/Controller/Responder.php @@ -22,11 +22,13 @@ use Twig\Environment; final readonly class Responder implements ResponderInterface { - public function __construct(private Environment $twig, private UrlGeneratorInterface $urlGenerator, private SerializerInterface $serializer) {} + public function __construct(private Environment $twig, private UrlGeneratorInterface $urlGenerator, private SerializerInterface $serializer) + { + } public function file( $file, - string $filename = null, + ?string $filename = null, string $disposition = ResponseHeaderBag::DISPOSITION_ATTACHMENT ): BinaryFileResponse { $response = new BinaryFileResponse($file); diff --git a/src/Bundle/ChillWopiBundle/src/Service/Controller/ResponderInterface.php b/src/Bundle/ChillWopiBundle/src/Service/Controller/ResponderInterface.php index 734a5b5b3..a2d7b5518 100644 --- a/src/Bundle/ChillWopiBundle/src/Service/Controller/ResponderInterface.php +++ b/src/Bundle/ChillWopiBundle/src/Service/Controller/ResponderInterface.php @@ -27,7 +27,7 @@ interface ResponderInterface */ public function file( $file, - string $filename = null, + ?string $filename = null, string $disposition = ResponseHeaderBag::DISPOSITION_ATTACHMENT ): BinaryFileResponse; diff --git a/src/Bundle/ChillWopiBundle/src/Service/Wopi/AuthorizationManager.php b/src/Bundle/ChillWopiBundle/src/Service/Wopi/AuthorizationManager.php index 1496ba479..53e9ad819 100644 --- a/src/Bundle/ChillWopiBundle/src/Service/Wopi/AuthorizationManager.php +++ b/src/Bundle/ChillWopiBundle/src/Service/Wopi/AuthorizationManager.php @@ -19,7 +19,9 @@ use Symfony\Component\Security\Core\Security; class AuthorizationManager implements \ChampsLibres\WopiBundle\Contracts\AuthorizationManagerInterface { - public function __construct(private readonly JWTTokenManagerInterface $tokenManager, private readonly Security $security) {} + public function __construct(private readonly JWTTokenManagerInterface $tokenManager, private readonly Security $security) + { + } public function isRestrictedWebViewOnly(string $accessToken, Document $document, RequestInterface $request): bool { diff --git a/src/Bundle/ChillWopiBundle/src/Service/Wopi/ChillDocumentLockManager.php b/src/Bundle/ChillWopiBundle/src/Service/Wopi/ChillDocumentLockManager.php index e6889778c..594bdffcc 100644 --- a/src/Bundle/ChillWopiBundle/src/Service/Wopi/ChillDocumentLockManager.php +++ b/src/Bundle/ChillWopiBundle/src/Service/Wopi/ChillDocumentLockManager.php @@ -28,7 +28,8 @@ class ChillDocumentLockManager implements DocumentLockManagerInterface public function __construct( private readonly ChillRedis $redis, private readonly int $ttlAfterDeleteSeconds = self::LOCK_GRACEFUL_DURATION_TIME - ) {} + ) { + } public function deleteLock(Document $document, RequestInterface $request): bool { diff --git a/src/Bundle/ChillWopiBundle/src/Service/Wopi/ChillWopi.php b/src/Bundle/ChillWopiBundle/src/Service/Wopi/ChillWopi.php index 9f2dac4f0..189b780b2 100644 --- a/src/Bundle/ChillWopiBundle/src/Service/Wopi/ChillWopi.php +++ b/src/Bundle/ChillWopiBundle/src/Service/Wopi/ChillWopi.php @@ -17,7 +17,9 @@ use Psr\Http\Message\ResponseInterface; final readonly class ChillWopi implements WopiInterface { - public function __construct(private WopiInterface $wopi) {} + public function __construct(private WopiInterface $wopi) + { + } public function checkFileInfo( string $fileId, diff --git a/src/Bundle/ChillWopiBundle/src/Service/Wopi/UserManager.php b/src/Bundle/ChillWopiBundle/src/Service/Wopi/UserManager.php index f72ae3cde..4a0857521 100644 --- a/src/Bundle/ChillWopiBundle/src/Service/Wopi/UserManager.php +++ b/src/Bundle/ChillWopiBundle/src/Service/Wopi/UserManager.php @@ -17,7 +17,9 @@ use Symfony\Component\Security\Core\Security; class UserManager implements \ChampsLibres\WopiBundle\Contracts\UserManagerInterface { - public function __construct(private readonly Security $security) {} + public function __construct(private readonly Security $security) + { + } public function getUserFriendlyName(string $accessToken, string $fileId, RequestInterface $request): ?string { diff --git a/utils/rector/src/Rector/ChillBundleAddFormDefaultDataOnExportFilterAggregatorRector.php b/utils/rector/src/Rector/ChillBundleAddFormDefaultDataOnExportFilterAggregatorRector.php index b2efd260a..a087c20d9 100644 --- a/utils/rector/src/Rector/ChillBundleAddFormDefaultDataOnExportFilterAggregatorRector.php +++ b/utils/rector/src/Rector/ChillBundleAddFormDefaultDataOnExportFilterAggregatorRector.php @@ -25,7 +25,8 @@ class ChillBundleAddFormDefaultDataOnExportFilterAggregatorRector extends Abstra { public function __construct( private readonly ClassAnalyzer $classAnalyzer, - ) {} + ) { + } public function getRuleDefinition(): RuleDefinition { diff --git a/utils/rector/tests/Rector/ChillBundleAddFormDefaultDataOnExportFilterAggregatorRector/config/config.php b/utils/rector/tests/Rector/ChillBundleAddFormDefaultDataOnExportFilterAggregatorRector/config/config.php index 89ec65f14..c4178c04b 100644 --- a/utils/rector/tests/Rector/ChillBundleAddFormDefaultDataOnExportFilterAggregatorRector/config/config.php +++ b/utils/rector/tests/Rector/ChillBundleAddFormDefaultDataOnExportFilterAggregatorRector/config/config.php @@ -10,5 +10,5 @@ declare(strict_types=1); */ return static function (Rector\Config\RectorConfig $rectorConfig): void { - $rectorConfig->rule(\Chill\Utils\Rector\Rector\ChillBundleAddFormDefaultDataOnExportFilterAggregatorRector::class); + $rectorConfig->rule(Chill\Utils\Rector\Rector\ChillBundleAddFormDefaultDataOnExportFilterAggregatorRector::class); }; From 087032881b819bc2a997c62fcdcbc9c442f3bf3f Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Mon, 12 Feb 2024 14:50:26 +0100 Subject: [PATCH 21/67] Correct 2 phpstan errors, condition is always true and wrong typing --- .../Templating/Entity/UserRender.php | 2 +- .../AccompanyingPeriodWorkNormalizer.php | 21 +++++++++---------- 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/src/Bundle/ChillMainBundle/Templating/Entity/UserRender.php b/src/Bundle/ChillMainBundle/Templating/Entity/UserRender.php index de9f4abbe..170116f04 100644 --- a/src/Bundle/ChillMainBundle/Templating/Entity/UserRender.php +++ b/src/Bundle/ChillMainBundle/Templating/Entity/UserRender.php @@ -65,7 +65,7 @@ class UserRender implements ChillEntityRenderInterface } /** - * @param array{main_scope?: bool, user_job?: bool, absence?: bool, at_date?: DateTimeImmutable|DateTimeMutable|null} $options + * @param array{main_scope?: bool, user_job?: bool, absence?: bool, at_date?: DateTimeImmutable|DateTime|null} $options */ public function renderString($entity, array $options): string { diff --git a/src/Bundle/ChillPersonBundle/Serializer/Normalizer/AccompanyingPeriodWorkNormalizer.php b/src/Bundle/ChillPersonBundle/Serializer/Normalizer/AccompanyingPeriodWorkNormalizer.php index 94c440519..5d6000164 100644 --- a/src/Bundle/ChillPersonBundle/Serializer/Normalizer/AccompanyingPeriodWorkNormalizer.php +++ b/src/Bundle/ChillPersonBundle/Serializer/Normalizer/AccompanyingPeriodWorkNormalizer.php @@ -57,20 +57,19 @@ class AccompanyingPeriodWorkNormalizer implements ContextAwareNormalizerInterfac // add the referrers $initial['referrers'] = []; - if ($object instanceof AccompanyingPeriodWork) { - foreach ($object->getReferrersHistory() as $referrerHistory) { - if (null !== $referrerHistory->getEndDate()) { - continue; - } - - $initial['referrers'][] = $this->normalizer->normalize( - $referrerHistory->getUser(), - $format, - [...$context, UserNormalizer::AT_DATE => $referrerHistory->getStartDate()] - ); + foreach ($object->getReferrersHistory() as $referrerHistory) { + if (null !== $referrerHistory->getEndDate()) { + continue; } + + $initial['referrers'][] = $this->normalizer->normalize( + $referrerHistory->getUser(), + $format, + [...$context, UserNormalizer::AT_DATE => $referrerHistory->getStartDate()] + ); } + if ('json' === $format) { // then, we add normalization for things which are not into the entity $initial['workflows_availables'] = $this->metadataExtractor->availableWorkflowFor( From a533ab77edef93d146514e16c2bbadbd63910d41 Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Mon, 12 Feb 2024 18:44:32 +0100 Subject: [PATCH 22/67] fix userNormalizerTest by adding clock in the construct of UserNormalizer --- .../Tests/Serializer/Normalizer/UserNormalizerTest.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Bundle/ChillMainBundle/Tests/Serializer/Normalizer/UserNormalizerTest.php b/src/Bundle/ChillMainBundle/Tests/Serializer/Normalizer/UserNormalizerTest.php index 15334298e..0219e5a5e 100644 --- a/src/Bundle/ChillMainBundle/Tests/Serializer/Normalizer/UserNormalizerTest.php +++ b/src/Bundle/ChillMainBundle/Tests/Serializer/Normalizer/UserNormalizerTest.php @@ -25,6 +25,7 @@ use libphonenumber\PhoneNumberUtil; use PHPUnit\Framework\TestCase; use Prophecy\Argument; use Prophecy\PhpUnit\ProphecyTrait; +use Symfony\Component\Clock\MockClock; use Symfony\Component\Serializer\Exception\ExceptionInterface; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; @@ -122,7 +123,9 @@ final class UserNormalizerTest extends TestCase $userRender = $this->prophesize(UserRender::class); $userRender->renderString(Argument::type(User::class), Argument::type('array'))->willReturn($user ? $user->getLabel() : ''); - $normalizer = new UserNormalizer($userRender->reveal()); + $clock = new MockClock(new \DateTimeImmutable('now')); + + $normalizer = new UserNormalizer($userRender->reveal(), $clock); $normalizer->setNormalizer(new class () implements NormalizerInterface { public function normalize($object, ?string $format = null, array $context = []) { From 9b8e1438559b5853a0bd1e445f5bf143f7e3854b Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Mon, 12 Feb 2024 18:55:00 +0100 Subject: [PATCH 23/67] fix typing --- .../ChillMainBundle/Templating/Entity/UserRender.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Bundle/ChillMainBundle/Templating/Entity/UserRender.php b/src/Bundle/ChillMainBundle/Templating/Entity/UserRender.php index 170116f04..d0db6cddd 100644 --- a/src/Bundle/ChillMainBundle/Templating/Entity/UserRender.php +++ b/src/Bundle/ChillMainBundle/Templating/Entity/UserRender.php @@ -12,7 +12,7 @@ declare(strict_types=1); namespace Chill\MainBundle\Templating\Entity; use Chill\MainBundle\Entity\User; -use Chill\MainBundle\Templating\TranslatableStringHelper; +use Chill\MainBundle\Templating\TranslatableStringHelperInterface; use DateTime; use Monolog\DateTimeImmutable; use Symfony\Component\Clock\ClockInterface; @@ -34,7 +34,7 @@ class UserRender implements ChillEntityRenderInterface ]; public function __construct( - private readonly TranslatableStringHelper $translatableStringHelper, + private readonly TranslatableStringHelperInterface $translatableStringHelper, private readonly \Twig\Environment $engine, private readonly TranslatorInterface $translator, private readonly ClockInterface $clock, @@ -42,7 +42,7 @@ class UserRender implements ChillEntityRenderInterface } /** - * @param array{main_scope?: bool, user_job?: bool, absence?: bool, at_date?: DateTimeImmutable|\DateTime|null} $options + * @param array{main_scope?: bool, user_job?: bool, absence?: bool, at_date?: DateTimeImmutable|DateTime|null} $options * * @throws LoaderError * @throws RuntimeError @@ -54,7 +54,7 @@ class UserRender implements ChillEntityRenderInterface if (null === $opts['at_date']) { $opts['at_date'] = $this->clock->now(); - } elseif ($opts['at_date'] instanceof \DateTime) { + } elseif ($opts['at_date'] instanceof DateTime) { $opts['at_date'] = DateTimeImmutable::createFromMutable($opts['at_date']); } @@ -75,7 +75,7 @@ class UserRender implements ChillEntityRenderInterface if (null === $opts['at_date']) { $opts['at_date'] = $this->clock->now(); - } elseif ($opts['at_date'] instanceof \DateTime) { + } elseif ($opts['at_date'] instanceof DateTime) { $opts['at_date'] = DateTimeImmutable::createFromMutable($opts['at_date']); } From 0b739fda348f927aa7feffa3ba521eae4088ec93 Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Mon, 12 Feb 2024 18:56:05 +0100 Subject: [PATCH 24/67] test still failing with error saying column phonenumber of relation users does not exist --- .../Templating/Entity/UserRenderTest.php | 20 ++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/src/Bundle/ChillMainBundle/Tests/Templating/Entity/UserRenderTest.php b/src/Bundle/ChillMainBundle/Tests/Templating/Entity/UserRenderTest.php index ef08348b4..e7cee62d7 100644 --- a/src/Bundle/ChillMainBundle/Tests/Templating/Entity/UserRenderTest.php +++ b/src/Bundle/ChillMainBundle/Tests/Templating/Entity/UserRenderTest.php @@ -16,6 +16,9 @@ use Chill\MainBundle\Entity\User; use Chill\MainBundle\Entity\UserJob; use Chill\MainBundle\Templating\Entity\UserRender; use Chill\MainBundle\Templating\TranslatableStringHelperInterface; +use Doctrine\ORM\EntityManagerInterface; +use JetBrains\PhpStorm\NoReturn; +use libphonenumber\PhoneNumberUtil; use Prophecy\PhpUnit\ProphecyTrait; use Symfony\Bundle\FrameworkBundle\Test\WebTestCase; use Symfony\Component\Clock\MockClock; @@ -36,8 +39,11 @@ class UserRenderTest extends WebTestCase self::bootKernel(); } - public function testRenderUserWithJobAndScopeAtCertainDate(): void + #[NoReturn] public function testRenderUserWithJobAndScopeAtCertainDate(): void { + self::bootKernel(); + $em = self::$container->get(EntityManagerInterface::class); + assert($em instanceof EntityManagerInterface); // Create a user with a certain user job $user = new User(); @@ -47,6 +53,8 @@ class UserRenderTest extends WebTestCase $userJobA->setLabel(['fr' => 'assistant social']); $scopeA->setName(['fr' => 'service A']); $user->setLabel('BOB ISLA'); +// $user->setPhonenumber(PhoneNumberUtil::getInstance()->parse('+32475928635')); + $userJobB = new UserJob(); $scopeB = new Scope(); @@ -82,6 +90,14 @@ class UserRenderTest extends WebTestCase $user->getUserJobHistories()->add($userJobHistoryB); $user->getUserScopeHistories()->add($userScopeHistoryB); + $em->persist($user); + $em->persist($userJobA); + $em->persist($userJobB); + $em->persist($scopeA); + $em->persist($scopeB); + + $em->flush(); + // Create renderer $translatableStringHelperMock = $this->getMockBuilder(TranslatableStringHelperInterface::class) ->getMock(); @@ -96,6 +112,8 @@ class UserRenderTest extends WebTestCase $options['at_date'] = new \DateTime('2023-11-25 12:00:00'); $optionsTwo['at_date'] = new \DateTime('2024-01-30 12:00:00'); +// dd($user); + // Check that the user render for the first activity corresponds with the first user job $expectedStringA = 'BOB ISLA (assistant social) (service A)'; $this->assertEquals($expectedStringA, $renderer->renderString($user, $options)); From d0ec6f981913f431f0cacddd8f13d349c48ea78e Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Mon, 8 Jan 2024 11:25:13 +0100 Subject: [PATCH 25/67] Improve naming for 'at date' in user render component --- src/Bundle/ChillMainBundle/Entity/User.php | 16 ++++++++-------- .../Resources/views/Entity/user.html.twig | 8 ++++---- .../Templating/Entity/UserRender.php | 10 +++++----- 3 files changed, 17 insertions(+), 17 deletions(-) diff --git a/src/Bundle/ChillMainBundle/Entity/User.php b/src/Bundle/ChillMainBundle/Entity/User.php index 05112430c..c95ccbf33 100644 --- a/src/Bundle/ChillMainBundle/Entity/User.php +++ b/src/Bundle/ChillMainBundle/Entity/User.php @@ -274,13 +274,13 @@ class User implements UserInterface, \Stringable return $this->mainLocation; } - public function getMainScope(?\DateTimeImmutable $at = null): ?Scope + public function getMainScope(\DateTime $atDate = null): ?Scope { - $at ??= new \DateTimeImmutable('now'); + $atDate ??= new \DateTimeImmutable('now'); foreach ($this->scopeHistories as $scopeHistory) { - if ($at >= $scopeHistory->getStartDate() && ( - null === $scopeHistory->getEndDate() || $at < $scopeHistory->getEndDate() + if ($atDate >= $scopeHistory->getStartDate() && ( + null === $scopeHistory->getEndDate() || $atDate < $scopeHistory->getEndDate() )) { return $scopeHistory->getScope(); } @@ -326,13 +326,13 @@ class User implements UserInterface, \Stringable return $this->salt; } - public function getUserJob(?\DateTimeImmutable $at = null): ?UserJob + public function getUserJob(\DateTime $atDate = null): ?UserJob { - $at ??= new \DateTimeImmutable('now'); + $atDate ??= new \DateTimeImmutable('now'); foreach ($this->jobHistories as $jobHistory) { - if ($at >= $jobHistory->getStartDate() && ( - null === $jobHistory->getEndDate() || $at < $jobHistory->getEndDate() + if ($atDate >= $jobHistory->getStartDate() && ( + null === $jobHistory->getEndDate() || $atDate < $jobHistory->getEndDate() )) { return $jobHistory->getJob(); } diff --git a/src/Bundle/ChillMainBundle/Resources/views/Entity/user.html.twig b/src/Bundle/ChillMainBundle/Resources/views/Entity/user.html.twig index c95308610..84973a096 100644 --- a/src/Bundle/ChillMainBundle/Resources/views/Entity/user.html.twig +++ b/src/Bundle/ChillMainBundle/Resources/views/Entity/user.html.twig @@ -1,10 +1,10 @@ {{- user.label }} - {%- if opts['user_job'] and user.userJob(opts['at']) is not null %} - ({{ user.userJob(opts['at']).label|localize_translatable_string }}) + {%- if opts['user_job'] and user.userJob(opts['at_date']) is not null %} + ({{ user.userJob(opts['at_date']).label|localize_translatable_string }}) {%- endif -%} - {%- if opts['main_scope'] and user.mainScope(opts['at']) is not null %} - ({{ user.mainScope(opts['at']).name|localize_translatable_string }}) + {%- if opts['main_scope'] and user.mainScope(opts['at_date']) is not null %} + ({{ user.mainScope(opts['at_date']).name|localize_translatable_string }}) {%- endif -%} {%- if opts['absence'] and user.isAbsent %} {{ 'absence.A'|trans }} diff --git a/src/Bundle/ChillMainBundle/Templating/Entity/UserRender.php b/src/Bundle/ChillMainBundle/Templating/Entity/UserRender.php index f246b0185..376b3b454 100644 --- a/src/Bundle/ChillMainBundle/Templating/Entity/UserRender.php +++ b/src/Bundle/ChillMainBundle/Templating/Entity/UserRender.php @@ -24,7 +24,7 @@ class UserRender implements ChillEntityRenderInterface 'main_scope' => true, 'user_job' => true, 'absence' => true, - 'at' => null, + 'at_date' => null, ]; public function __construct(private readonly TranslatableStringHelper $translatableStringHelper, private readonly \Twig\Environment $engine, private readonly TranslatorInterface $translator) @@ -47,14 +47,14 @@ class UserRender implements ChillEntityRenderInterface $str = $entity->getLabel(); - if (null !== $entity->getUserJob($opts['at']) && $opts['user_job']) { + if (null !== $entity->getUserJob($opts['at_date']) && $opts['user_job']) { $str .= ' ('.$this->translatableStringHelper - ->localize($entity->getUserJob($opts['at'])->getLabel()).')'; + ->localize($entity->getUserJob($opts['at_date'])->getLabel()).')'; } - if (null !== $entity->getMainScope($opts['at']) && $opts['main_scope']) { + if (null !== $entity->getMainScope($opts['at_date']) && $opts['main_scope']) { $str .= ' ('.$this->translatableStringHelper - ->localize($entity->getMainScope($opts['at'])->getName()).')'; + ->localize($entity->getMainScope($opts['at_date'])->getName()).')'; } if ($entity->isAbsent() && $opts['absence']) { From fe695f1a146a0d64e4d3c26b648ce78371fa5d6c Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Mon, 8 Jan 2024 11:25:33 +0100 Subject: [PATCH 26/67] Implement 'at date' in user render component for activities --- .../Resources/views/Activity/_list_item.html.twig | 2 +- .../Resources/views/Activity/list_recent.html.twig | 2 +- .../ChillActivityBundle/Resources/views/Activity/show.html.twig | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Bundle/ChillActivityBundle/Resources/views/Activity/_list_item.html.twig b/src/Bundle/ChillActivityBundle/Resources/views/Activity/_list_item.html.twig index b3382c3de..13dfa7461 100644 --- a/src/Bundle/ChillActivityBundle/Resources/views/Activity/_list_item.html.twig +++ b/src/Bundle/ChillActivityBundle/Resources/views/Activity/_list_item.html.twig @@ -68,7 +68,7 @@

    {{ 'Referrer'|trans }}

    - {{ activity.user|chill_entity_render_box }} + {{ activity.user|chill_entity_render_box({'at_date': activity.date}) }}

  • diff --git a/src/Bundle/ChillActivityBundle/Resources/views/Activity/list_recent.html.twig b/src/Bundle/ChillActivityBundle/Resources/views/Activity/list_recent.html.twig index aa0bbea0c..04ea936d4 100644 --- a/src/Bundle/ChillActivityBundle/Resources/views/Activity/list_recent.html.twig +++ b/src/Bundle/ChillActivityBundle/Resources/views/Activity/list_recent.html.twig @@ -41,7 +41,7 @@ {% if activity.user and t.userVisible %}
  • {{ 'Referrer'|trans ~ ': ' }} - {{ activity.user|chill_entity_render_box }} + {{ activity.user|chill_entity_render_box({'at_date': activity.date}) }}
  • {% endif %} diff --git a/src/Bundle/ChillActivityBundle/Resources/views/Activity/show.html.twig b/src/Bundle/ChillActivityBundle/Resources/views/Activity/show.html.twig index d4beb606a..0330377aa 100644 --- a/src/Bundle/ChillActivityBundle/Resources/views/Activity/show.html.twig +++ b/src/Bundle/ChillActivityBundle/Resources/views/Activity/show.html.twig @@ -37,7 +37,7 @@ {%- if entity.user is not null %}
    {{ 'Referrer'|trans|capitalize }}
    - {{ entity.user|chill_entity_render_box }} + {{ entity.user|chill_entity_render_box({'at_date': entity.date}) }}
    {% endif %} From fbbf421d8b2b92ce308df1a8bf56f0208b179273 Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Mon, 8 Jan 2024 12:35:09 +0100 Subject: [PATCH 27/67] Handle DateTime type for activity while DateTimeImmutable is expected --- src/Bundle/ChillMainBundle/Entity/User.php | 4 ++-- .../Templating/Entity/UserRender.php | 13 +++++++++---- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/src/Bundle/ChillMainBundle/Entity/User.php b/src/Bundle/ChillMainBundle/Entity/User.php index c95ccbf33..8b0412a38 100644 --- a/src/Bundle/ChillMainBundle/Entity/User.php +++ b/src/Bundle/ChillMainBundle/Entity/User.php @@ -274,7 +274,7 @@ class User implements UserInterface, \Stringable return $this->mainLocation; } - public function getMainScope(\DateTime $atDate = null): ?Scope + public function getMainScope(\DateTimeImmutable $atDate = null): ?Scope { $atDate ??= new \DateTimeImmutable('now'); @@ -326,7 +326,7 @@ class User implements UserInterface, \Stringable return $this->salt; } - public function getUserJob(\DateTime $atDate = null): ?UserJob + public function getUserJob(\DateTimeImmutable $atDate = null): ?UserJob { $atDate ??= new \DateTimeImmutable('now'); diff --git a/src/Bundle/ChillMainBundle/Templating/Entity/UserRender.php b/src/Bundle/ChillMainBundle/Templating/Entity/UserRender.php index 376b3b454..a03acb476 100644 --- a/src/Bundle/ChillMainBundle/Templating/Entity/UserRender.php +++ b/src/Bundle/ChillMainBundle/Templating/Entity/UserRender.php @@ -13,6 +13,7 @@ namespace Chill\MainBundle\Templating\Entity; use Chill\MainBundle\Entity\User; use Chill\MainBundle\Templating\TranslatableStringHelper; +use Monolog\DateTimeImmutable; use Symfony\Contracts\Translation\TranslatorInterface; /** @@ -35,6 +36,8 @@ class UserRender implements ChillEntityRenderInterface { $opts = \array_merge(self::DEFAULT_OPTIONS, $options); + $opts['at_date'] = $opts['at_date'] instanceOf \DateTime ? DateTimeImmutable::createFromMutable($opts['at_date']) : $opts['at_date']; + return $this->engine->render('@ChillMain/Entity/user.html.twig', [ 'user' => $entity, 'opts' => $opts, @@ -45,16 +48,18 @@ class UserRender implements ChillEntityRenderInterface { $opts = \array_merge(self::DEFAULT_OPTIONS, $options); + $immutableAtDate = $opts['at_date'] instanceOf \DateTime ? DateTimeImmutable::createFromMutable($opts['at_date']) : $opts['at_date']; + $str = $entity->getLabel(); - if (null !== $entity->getUserJob($opts['at_date']) && $opts['user_job']) { + if (null !== $entity->getUserJob($immutableAtDate) && $opts['user_job']) { $str .= ' ('.$this->translatableStringHelper - ->localize($entity->getUserJob($opts['at_date'])->getLabel()).')'; + ->localize($entity->getUserJob($immutableAtDate)->getLabel()).')'; } - if (null !== $entity->getMainScope($opts['at_date']) && $opts['main_scope']) { + if (null !== $entity->getMainScope($immutableAtDate) && $opts['main_scope']) { $str .= ' ('.$this->translatableStringHelper - ->localize($entity->getMainScope($opts['at_date'])->getName()).')'; + ->localize($entity->getMainScope($immutableAtDate)->getName()).')'; } if ($entity->isAbsent() && $opts['absence']) { From d15fbadd2755b6d5f0ef15c82598f73cb5fe463d Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Mon, 8 Jan 2024 12:35:41 +0100 Subject: [PATCH 28/67] Implement 'at date' for display of service and user job in calendar entities --- .../Resources/views/Calendar/_list.html.twig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Bundle/ChillCalendarBundle/Resources/views/Calendar/_list.html.twig b/src/Bundle/ChillCalendarBundle/Resources/views/Calendar/_list.html.twig index 9e87af8ef..264836ecb 100644 --- a/src/Bundle/ChillCalendarBundle/Resources/views/Calendar/_list.html.twig +++ b/src/Bundle/ChillCalendarBundle/Resources/views/Calendar/_list.html.twig @@ -55,7 +55,7 @@
      {% if calendar.mainUser is not empty %} - {{ calendar.mainUser|chill_entity_render_box }} + {{ calendar.mainUser|chill_entity_render_box({'at_date': calendar.startDate}) }} {% endif %}
    From 2149ef1cb484c707c59955c612498b69a15497de Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Mon, 8 Jan 2024 16:37:25 +0100 Subject: [PATCH 29/67] Implement 'at date' for display of service and user job in aside activities entities --- .../src/Resources/views/asideActivity/index.html.twig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Bundle/ChillAsideActivityBundle/src/Resources/views/asideActivity/index.html.twig b/src/Bundle/ChillAsideActivityBundle/src/Resources/views/asideActivity/index.html.twig index 1e2711bfe..0a8648749 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/Resources/views/asideActivity/index.html.twig +++ b/src/Bundle/ChillAsideActivityBundle/src/Resources/views/asideActivity/index.html.twig @@ -49,13 +49,13 @@
  • {{ 'By'|trans }}: - {{ entity.createdBy|chill_entity_render_box }} + {{ entity.createdBy|chill_entity_render_box({'at_date': entity.date}) }}
  • {{ 'For'|trans }}: - {{ entity.agent|chill_entity_render_box }} + {{ entity.agent|chill_entity_render_box({'at_date': entity.date}) }}
  • From d62e9ce26909b176615af41b8fefdefe092c4e27 Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Mon, 8 Jan 2024 16:38:07 +0100 Subject: [PATCH 30/67] Implement 'at date' for display of service and user job in accompanying period work entities (for twig templates) -> vue component still to fix --- .../Entity/AccompanyingPeriod/AccompanyingPeriodWork.php | 2 +- .../Resources/views/AccompanyingCourseWork/_item.html.twig | 4 ++-- .../list_recent_by_accompanying_period.html.twig | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/AccompanyingPeriodWork.php b/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/AccompanyingPeriodWork.php index 618918695..7841f67f9 100644 --- a/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/AccompanyingPeriodWork.php +++ b/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/AccompanyingPeriodWork.php @@ -403,7 +403,7 @@ class AccompanyingPeriodWork implements AccompanyingPeriodLinkedWithSocialIssues { $users = $this->referrersHistory ->filter(fn (AccompanyingPeriodWorkReferrerHistory $h) => null === $h->getEndDate()) - ->map(fn (AccompanyingPeriodWorkReferrerHistory $h) => $h->getUser()) + ->map(fn (AccompanyingPeriodWorkReferrerHistory $h) => ['user' => $h->getUser(), 'startDate' => $h->getStartDate()]) ->getValues() ; diff --git a/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/_item.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/_item.html.twig index b53898602..ad3c17783 100644 --- a/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/_item.html.twig +++ b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/_item.html.twig @@ -83,9 +83,9 @@
    {%- if w.referrers|length > 0 -%} - {% for u in w.referrers %} + {% for rh in w.referrers %} - {{ u|chill_entity_render_box }} + {{ rh.user|chill_entity_render_box({'at_date': rh.startDate}) }} {% if not loop.last %}, {% endif %} {% endfor %} diff --git a/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/list_recent_by_accompanying_period.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/list_recent_by_accompanying_period.html.twig index 7ee296cc7..9772641f7 100644 --- a/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/list_recent_by_accompanying_period.html.twig +++ b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/list_recent_by_accompanying_period.html.twig @@ -33,8 +33,8 @@ {% if w.referrers %}
  • {{ 'Referrers'|trans ~ ' : ' }} - {% for u in w.referrers %} - {{ u|chill_entity_render_box }} + {% for rh in w.referrers %} + {{ rh.user|chill_entity_render_box({'at_date': rh.startDate}) }} {% endfor %} {% if w.referrers|length == 0 %} {{ 'Not given'|trans }} From 50c04382ef4fcca860cb6be852131e2e7a7a7cd0 Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Mon, 8 Jan 2024 16:38:50 +0100 Subject: [PATCH 31/67] Adjust view template for aside activity --- .../src/Resources/views/asideActivity/view.html.twig | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Bundle/ChillAsideActivityBundle/src/Resources/views/asideActivity/view.html.twig b/src/Bundle/ChillAsideActivityBundle/src/Resources/views/asideActivity/view.html.twig index 8fb487d31..4ef237336 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/Resources/views/asideActivity/view.html.twig +++ b/src/Bundle/ChillAsideActivityBundle/src/Resources/views/asideActivity/view.html.twig @@ -18,11 +18,11 @@
    {{ entity.type|chill_entity_render_box }}
    {{ 'Created by'|trans }}
    -
    {{ entity.createdBy }}
    +
    {{ entity.createdBy|chill_entity_render_box({'at_date': entity.date}) }}
    {{ 'Created for'|trans }}
    -
    {{ entity.agent }}
    - +
    {{ entity.agent|chill_entity_render_box({'at_date': entity.date}) }}
    +
    {{ 'Asideactivity location'|trans }}
    {%- if entity.location.name is defined -%}
    {{ entity.location.name }}
    From ad6154a1e42294c1d43b776bcc12747cb5a35e76 Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Mon, 8 Jan 2024 16:51:06 +0100 Subject: [PATCH 32/67] Implement 'at date' for concerned groups in activity --- .../Resources/views/Activity/concernedGroups.html.twig | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/Bundle/ChillActivityBundle/Resources/views/Activity/concernedGroups.html.twig b/src/Bundle/ChillActivityBundle/Resources/views/Activity/concernedGroups.html.twig index 48eb839d7..76db92d42 100644 --- a/src/Bundle/ChillActivityBundle/Resources/views/Activity/concernedGroups.html.twig +++ b/src/Bundle/ChillActivityBundle/Resources/views/Activity/concernedGroups.html.twig @@ -87,7 +87,8 @@
  • {% if bloc.type == 'user' %} - {{ item|chill_entity_render_box({'render': 'raw', 'addAltNames': false }) }} + hello + {{ item|chill_entity_render_box({'render': 'raw', 'addAltNames': false, 'at_date': entity.date }) }} {% else %} {{ _self.insert_onthefly(bloc.type, item) }} @@ -114,7 +115,7 @@
  • {% if bloc.type == 'user' %} - {{ item|chill_entity_render_box({'render': 'raw', 'addAltNames': false }) }} + {{ item|chill_entity_render_box({'render': 'raw', 'addAltNames': false, 'at_date': entity.date }) }} {% else %} {{ _self.insert_onthefly(bloc.type, item) }} @@ -142,7 +143,7 @@ {% if bloc.type == 'user' %} - {{ item|chill_entity_render_box({'render': 'raw', 'addAltNames': false }) }} + {{ item|chill_entity_render_box({'render': 'raw', 'addAltNames': false, 'at_date': entity.date }) }} {%- if context == 'calendar_accompanyingCourse' or context == 'calendar_person' %} {% set invite = entity.inviteForUser(item) %} {% if invite is not null %} From 853014d8d2dd23333e53fe8be4201d80a55827fa Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Wed, 17 Jan 2024 17:27:54 +0100 Subject: [PATCH 33/67] remove attempt to adjust accompanyingperiod work for display of user job and service at specific date --- .../Entity/AccompanyingPeriod/AccompanyingPeriodWork.php | 5 ++--- .../Resources/views/AccompanyingCourseWork/_item.html.twig | 4 ++-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/AccompanyingPeriodWork.php b/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/AccompanyingPeriodWork.php index 7841f67f9..8326fc43b 100644 --- a/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/AccompanyingPeriodWork.php +++ b/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/AccompanyingPeriodWork.php @@ -403,9 +403,8 @@ class AccompanyingPeriodWork implements AccompanyingPeriodLinkedWithSocialIssues { $users = $this->referrersHistory ->filter(fn (AccompanyingPeriodWorkReferrerHistory $h) => null === $h->getEndDate()) - ->map(fn (AccompanyingPeriodWorkReferrerHistory $h) => ['user' => $h->getUser(), 'startDate' => $h->getStartDate()]) - ->getValues() - ; + ->map(fn (AccompanyingPeriodWorkReferrerHistory $h) => $h->getUser()) + ->getValues(); return new ArrayCollection(array_values($users)); } diff --git a/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/_item.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/_item.html.twig index ad3c17783..e8f6f1171 100644 --- a/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/_item.html.twig +++ b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/_item.html.twig @@ -83,9 +83,9 @@
  • {%- if w.referrers|length > 0 -%} - {% for rh in w.referrers %} + {% for r in w.referrers %} - {{ rh.user|chill_entity_render_box({'at_date': rh.startDate}) }} + {{ r|chill_entity_render_box }} {% if not loop.last %}, {% endif %} {% endfor %} From d91b1a70bff5d64bef5f4ebcc0b6e8df1405ebb5 Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Tue, 23 Jan 2024 18:13:33 +0100 Subject: [PATCH 34/67] work on userRender test --- .../Templating/Entity/UserRenderTest.php | 65 +++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 src/Bundle/ChillMainBundle/Tests/Templating/Entity/UserRenderTest.php diff --git a/src/Bundle/ChillMainBundle/Tests/Templating/Entity/UserRenderTest.php b/src/Bundle/ChillMainBundle/Tests/Templating/Entity/UserRenderTest.php new file mode 100644 index 000000000..fe0ad7e04 --- /dev/null +++ b/src/Bundle/ChillMainBundle/Tests/Templating/Entity/UserRenderTest.php @@ -0,0 +1,65 @@ +setLabel(['fr' => 'assistant social']); + $scope->setName(['fr' => 'service A']); + $user->setLabel('BOB ISLA'); + $user->setUserJob($userJob); + $user->setMainScope($scope); + + // Change the user job + $userJobTwo = new UserJob(); + $userJobTwo->setLabel(['fr' => 'directrice']); + /* this automatically creates a UserJobHistory. How to set the date manually though? **/ + + // Change the scope + $scopeTwo = new Scope(); + $scopeTwo->setName(['fr' => 'service B']); + /* this automatically creates a UserScopeHistory. How to set the date manually though? **/ + + + // Create renderer + $translatableStringHelper = $this->createMock(TranslatableStringHelperInterface::class); + $engine = $this->createMock(Environment::class); + $translator = $this->createMock(TranslatorInterface::class); + $renderer = new UserRender($translatableStringHelper, $engine, $translator); + + + $options['at_date'] = new \DateTime('2023-11-30 12:00:00'); + $optionsTwo['at_date'] = new \DateTime('2024-01-30 12:00:00'); + + // Check that the user render for the first activity corresponds with the first user job + $expectedStringA = 'BOB ISLA (assistant social) (service A)'; + $this->assertEquals($expectedStringA, $renderer->renderString($user, $options)); + + // Check that the user render for the second activity corresponds with the second user job + $expectedStringB = 'BOB ISLA (directrice) (service B)'; + $this->assertEquals($expectedStringB, $renderer->renderString($user, $optionsTwo)); + + + } + +} From bc683b28d61fbcf74f6e485bd4146036f36178d1 Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Wed, 24 Jan 2024 19:30:09 +0100 Subject: [PATCH 35/67] update normalizers to take into account referrerHistory logic for accompanying period work --- .../Serializer/Normalizer/UserNormalizer.php | 9 +++- .../Templating/Entity/UserRender.php | 27 ++++++++-- .../AccompanyingPeriodWork.php | 7 ++- ...st_recent_by_accompanying_period.html.twig | 2 +- .../AccompanyingPeriodWorkNormalizer.php | 53 ++++++++++++------- 5 files changed, 68 insertions(+), 30 deletions(-) diff --git a/src/Bundle/ChillMainBundle/Serializer/Normalizer/UserNormalizer.php b/src/Bundle/ChillMainBundle/Serializer/Normalizer/UserNormalizer.php index 9843c5dd5..92f5ea4d8 100644 --- a/src/Bundle/ChillMainBundle/Serializer/Normalizer/UserNormalizer.php +++ b/src/Bundle/ChillMainBundle/Serializer/Normalizer/UserNormalizer.php @@ -19,6 +19,7 @@ use Chill\MainBundle\Entity\User; use Chill\MainBundle\Entity\UserJob; use Chill\MainBundle\Templating\Entity\UserRender; use libphonenumber\PhoneNumber; +use Symfony\Component\Clock\ClockInterface; use Symfony\Component\Serializer\Normalizer\ContextAwareNormalizerInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface; use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait; @@ -27,6 +28,8 @@ class UserNormalizer implements ContextAwareNormalizerInterface, NormalizerAware { use NormalizerAwareTrait; + final public const AT_DATE = 'chill:user:at_date'; + final public const NULL_USER = [ 'type' => 'user', 'id' => '', @@ -74,6 +77,8 @@ class UserNormalizer implements ContextAwareNormalizerInterface, NormalizerAware return [...self::NULL_USER, 'phonenumber' => $this->normalizer->normalize(null, $format, $phonenumberContext), 'civility' => $this->normalizer->normalize(null, $format, $civilityContext), 'user_job' => $this->normalizer->normalize(null, $format, $userJobContext), 'main_center' => $this->normalizer->normalize(null, $format, $centerContext), 'main_scope' => $this->normalizer->normalize(null, $format, $scopeContext), 'current_location' => $this->normalizer->normalize(null, $format, $locationContext), 'main_location' => $this->normalizer->normalize(null, $format, $locationContext)]; } + $at = $context[self::AT_DATE] ?? $this->clock->now(); + $data = [ 'type' => 'user', 'id' => $object->getId(), @@ -83,9 +88,9 @@ class UserNormalizer implements ContextAwareNormalizerInterface, NormalizerAware 'label' => $object->getLabel(), 'email' => (string) $object->getEmail(), 'phonenumber' => $this->normalizer->normalize($object->getPhonenumber(), $format, $phonenumberContext), - 'user_job' => $this->normalizer->normalize($object->getUserJob(), $format, $userJobContext), + 'user_job' => $this->normalizer->normalize($object->getUserJob($at), $format, $userJobContext), 'main_center' => $this->normalizer->normalize($object->getMainCenter(), $format, $centerContext), - 'main_scope' => $this->normalizer->normalize($object->getMainScope(), $format, $scopeContext), + 'main_scope' => $this->normalizer->normalize($object->getMainScope($at), $format, $scopeContext), 'isAbsent' => $object->isAbsent(), ]; diff --git a/src/Bundle/ChillMainBundle/Templating/Entity/UserRender.php b/src/Bundle/ChillMainBundle/Templating/Entity/UserRender.php index a03acb476..45aad79ee 100644 --- a/src/Bundle/ChillMainBundle/Templating/Entity/UserRender.php +++ b/src/Bundle/ChillMainBundle/Templating/Entity/UserRender.php @@ -14,6 +14,7 @@ namespace Chill\MainBundle\Templating\Entity; use Chill\MainBundle\Entity\User; use Chill\MainBundle\Templating\TranslatableStringHelper; use Monolog\DateTimeImmutable; +use Symfony\Component\Clock\ClockInterface; use Symfony\Contracts\Translation\TranslatorInterface; /** @@ -25,18 +26,29 @@ class UserRender implements ChillEntityRenderInterface 'main_scope' => true, 'user_job' => true, 'absence' => true, - 'at_date' => null, + 'at_date' => null, // instanceof DateTimeInterface ]; - public function __construct(private readonly TranslatableStringHelper $translatableStringHelper, private readonly \Twig\Environment $engine, private readonly TranslatorInterface $translator) - { - } + public function __construct( + private readonly TranslatableStringHelper $translatableStringHelper, + private readonly \Twig\Environment $engine, private readonly TranslatorInterface $translator, + private readonly ClockInterface $clock, + ) {} + /** + * @param $entity + * @param array{main_scope?: bool, user_job?: bool, absence?: bool, at_date?: null|DateTimeImmutable|DateTimeMutable} $options + * @return string + */ public function renderBox($entity, array $options): string { $opts = \array_merge(self::DEFAULT_OPTIONS, $options); - $opts['at_date'] = $opts['at_date'] instanceOf \DateTime ? DateTimeImmutable::createFromMutable($opts['at_date']) : $opts['at_date']; + if (null === $opts['at_date']) { + $opts['at_date'] = $this->clock->now(); + } elseif ($opts['at_date'] instanceof \DateTime) { + $opts['at_date'] = DateTimeImmutable::createFromMutable($opts['at_date']); + } return $this->engine->render('@ChillMain/Entity/user.html.twig', [ 'user' => $entity, @@ -44,6 +56,11 @@ class UserRender implements ChillEntityRenderInterface ]); } + /** + * @param $entity + * @param array{main_scope?: bool, user_job?: bool, absence?: bool, at_date?: null|DateTimeImmutable|DateTimeMutable} $options + * @return string + */ public function renderString($entity, array $options): string { $opts = \array_merge(self::DEFAULT_OPTIONS, $options); diff --git a/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/AccompanyingPeriodWork.php b/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/AccompanyingPeriodWork.php index 8326fc43b..62f7e868f 100644 --- a/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/AccompanyingPeriodWork.php +++ b/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/AccompanyingPeriodWork.php @@ -394,10 +394,6 @@ class AccompanyingPeriodWork implements AccompanyingPeriodLinkedWithSocialIssues /** * @return ReadableCollection - * - * @Serializer\Groups({"read", "docgen:read", "read:accompanyingPeriodWork:light"}) - * @Serializer\Groups({"accompanying_period_work:edit"}) - * @Serializer\Groups({"accompanying_period_work:create"}) */ public function getReferrers(): ReadableCollection { @@ -409,6 +405,9 @@ class AccompanyingPeriodWork implements AccompanyingPeriodLinkedWithSocialIssues return new ArrayCollection(array_values($users)); } + /** + * @return Collection + */ public function getReferrersHistory(): Collection { return $this->referrersHistory; diff --git a/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/list_recent_by_accompanying_period.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/list_recent_by_accompanying_period.html.twig index 9772641f7..21552e44c 100644 --- a/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/list_recent_by_accompanying_period.html.twig +++ b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/list_recent_by_accompanying_period.html.twig @@ -34,7 +34,7 @@
  • {{ 'Referrers'|trans ~ ' : ' }} {% for rh in w.referrers %} - {{ rh.user|chill_entity_render_box({'at_date': rh.startDate}) }} + {{ rh|chill_entity_render_box }} {% endfor %} {% if w.referrers|length == 0 %} {{ 'Not given'|trans }} diff --git a/src/Bundle/ChillPersonBundle/Serializer/Normalizer/AccompanyingPeriodWorkNormalizer.php b/src/Bundle/ChillPersonBundle/Serializer/Normalizer/AccompanyingPeriodWorkNormalizer.php index 438e89093..040576fa6 100644 --- a/src/Bundle/ChillPersonBundle/Serializer/Normalizer/AccompanyingPeriodWorkNormalizer.php +++ b/src/Bundle/ChillPersonBundle/Serializer/Normalizer/AccompanyingPeriodWorkNormalizer.php @@ -12,6 +12,7 @@ declare(strict_types=1); namespace Chill\PersonBundle\Serializer\Normalizer; use Chill\MainBundle\Repository\Workflow\EntityWorkflowRepository; +use Chill\MainBundle\Serializer\Normalizer\UserNormalizer; use Chill\MainBundle\Workflow\Helper\MetadataExtractor; use Chill\PersonBundle\Entity\AccompanyingPeriod\AccompanyingPeriodWork; use Chill\PersonBundle\Entity\AccompanyingPeriod\AccompanyingPeriodWorkEvaluation; @@ -53,35 +54,51 @@ class AccompanyingPeriodWorkNormalizer implements ContextAwareNormalizerInterfac $context ); - // then, we add normalization for things which are not into the entity + // add the referrers + $initial['referrers'] = []; - $initial['workflows_availables'] = $this->metadataExtractor->availableWorkflowFor( - AccompanyingPeriodWork::class, - $object->getId() - ); + if ($object instanceof AccompanyingPeriodWork) { + foreach ($object->getReferrersHistory() as $referrerHistory) { + if (null !== $referrerHistory->getEndDate()) { + continue; + } - $initial['workflows_availables_evaluation'] = $this->metadataExtractor->availableWorkflowFor( - AccompanyingPeriodWorkEvaluation::class - ); + $initial['referrers'][] = $this->normalizer->normalize($referrerHistory->getUser(), + $format, [...$context, UserNormalizer::AT_DATE => $referrerHistory->getStartDate()]); + } + } - $initial['workflows_availables_evaluation_documents'] = $this->metadataExtractor->availableWorkflowFor( - AccompanyingPeriodWorkEvaluationDocument::class - ); + if ($format === 'json') { - $workflows = $this->entityWorkflowRepository->findBy([ - 'relatedEntityClass' => AccompanyingPeriodWork::class, - 'relatedEntityId' => $object->getId(), - ]); + // then, we add normalization for things which are not into the entity + $initial['workflows_availables'] = $this->metadataExtractor->availableWorkflowFor( + AccompanyingPeriodWork::class, + $object->getId() + ); - $initial['workflows'] = $this->normalizer->normalize($workflows, 'json', $context); + $initial['workflows_availables_evaluation'] = $this->metadataExtractor->availableWorkflowFor( + AccompanyingPeriodWorkEvaluation::class + ); + + $initial['workflows_availables_evaluation_documents'] = $this->metadataExtractor->availableWorkflowFor( + AccompanyingPeriodWorkEvaluationDocument::class + ); + + $workflows = $this->entityWorkflowRepository->findBy([ + 'relatedEntityClass' => AccompanyingPeriodWork::class, + 'relatedEntityId' => $object->getId(), + ]); + + $initial['workflows'] = $this->normalizer->normalize($workflows, 'json', $context); + } return $initial; } public function supportsNormalization($data, ?string $format = null, array $context = []): bool { - return 'json' === $format - && $data instanceof AccompanyingPeriodWork + return ('json' === $format || 'docgen' === $format) + && ($data instanceof AccompanyingPeriodWork || ('docgen' === $format && $data === null && ($context['docgen:expects'] ?? null) === AccompanyingPeriodWork::class)) && !\array_key_exists(self::IGNORE_WORK, $context); } } From c3a799cb7d231f1bafe240b4c3accc25550a42d2 Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Wed, 24 Jan 2024 19:31:04 +0100 Subject: [PATCH 36/67] work on test logic --- .../Tests/Templating/Entity/UserRenderTest.php | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/Bundle/ChillMainBundle/Tests/Templating/Entity/UserRenderTest.php b/src/Bundle/ChillMainBundle/Tests/Templating/Entity/UserRenderTest.php index fe0ad7e04..c7bbca342 100644 --- a/src/Bundle/ChillMainBundle/Tests/Templating/Entity/UserRenderTest.php +++ b/src/Bundle/ChillMainBundle/Tests/Templating/Entity/UserRenderTest.php @@ -27,7 +27,12 @@ class UserRenderTest extends TestCase $userJob->setLabel(['fr' => 'assistant social']); $scope->setName(['fr' => 'service A']); $user->setLabel('BOB ISLA'); - $user->setUserJob($userJob); + $userJobHistory = (new User\UserJobHistory()) + ->setUser($user) + ->setJob($userJob) + //setStartDate + ; + $user->getUserJobHistories()->add($userJobHistory); $user->setMainScope($scope); // Change the user job @@ -45,8 +50,8 @@ class UserRenderTest extends TestCase $translatableStringHelper = $this->createMock(TranslatableStringHelperInterface::class); $engine = $this->createMock(Environment::class); $translator = $this->createMock(TranslatorInterface::class); - $renderer = new UserRender($translatableStringHelper, $engine, $translator); - + $clock = new MockClock(new \DateTimeImmutable('2023-12-15')); + $renderer = new UserRender($translatableStringHelper, $engine, $translator, $clock); $options['at_date'] = new \DateTime('2023-11-30 12:00:00'); $optionsTwo['at_date'] = new \DateTime('2024-01-30 12:00:00'); From 8d58805abdde3622057dc942c6847cb99ce7f1bb Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Mon, 29 Jan 2024 15:07:27 +0100 Subject: [PATCH 37/67] work on user render test --- .../Tests/Templating/Entity/UserRenderTest.php | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/Bundle/ChillMainBundle/Tests/Templating/Entity/UserRenderTest.php b/src/Bundle/ChillMainBundle/Tests/Templating/Entity/UserRenderTest.php index c7bbca342..21f73d466 100644 --- a/src/Bundle/ChillMainBundle/Tests/Templating/Entity/UserRenderTest.php +++ b/src/Bundle/ChillMainBundle/Tests/Templating/Entity/UserRenderTest.php @@ -16,6 +16,10 @@ use Twig\Environment; class UserRenderTest extends TestCase { + /** + * @throws \DateInvalidTimeZoneException + * @throws \DateMalformedStringException + */ public function renderUserWithJobAndScopeAtCertainDateTest(): void { // Create a user with a certain user job @@ -27,23 +31,27 @@ class UserRenderTest extends TestCase $userJob->setLabel(['fr' => 'assistant social']); $scope->setName(['fr' => 'service A']); $user->setLabel('BOB ISLA'); + $userJobHistory = (new User\UserJobHistory()) ->setUser($user) ->setJob($userJob) //setStartDate ; + + $userScopeHistory = (new User\UserScopeHistory()) + ->setUser($user) + ->setScope($scope) + ; $user->getUserJobHistories()->add($userJobHistory); $user->setMainScope($scope); - // Change the user job +/* // Change the user job $userJobTwo = new UserJob(); $userJobTwo->setLabel(['fr' => 'directrice']); - /* this automatically creates a UserJobHistory. How to set the date manually though? **/ // Change the scope $scopeTwo = new Scope(); - $scopeTwo->setName(['fr' => 'service B']); - /* this automatically creates a UserScopeHistory. How to set the date manually though? **/ + $scopeTwo->setName(['fr' => 'service B']);*/ // Create renderer From b46883fe364504f2b3b24f900263a7aab1e435e6 Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Tue, 30 Jan 2024 16:31:29 +0100 Subject: [PATCH 38/67] Implement clockInterface in renderString method --- .../Templating/Entity/UserRender.php | 27 ++++++++++++++----- 1 file changed, 20 insertions(+), 7 deletions(-) diff --git a/src/Bundle/ChillMainBundle/Templating/Entity/UserRender.php b/src/Bundle/ChillMainBundle/Templating/Entity/UserRender.php index 45aad79ee..77b4255cc 100644 --- a/src/Bundle/ChillMainBundle/Templating/Entity/UserRender.php +++ b/src/Bundle/ChillMainBundle/Templating/Entity/UserRender.php @@ -13,9 +13,13 @@ namespace Chill\MainBundle\Templating\Entity; use Chill\MainBundle\Entity\User; use Chill\MainBundle\Templating\TranslatableStringHelper; +use DateTime; use Monolog\DateTimeImmutable; use Symfony\Component\Clock\ClockInterface; use Symfony\Contracts\Translation\TranslatorInterface; +use Twig\Error\LoaderError; +use Twig\Error\RuntimeError; +use Twig\Error\SyntaxError; /** * @implements ChillEntityRenderInterface @@ -37,8 +41,11 @@ class UserRender implements ChillEntityRenderInterface /** * @param $entity - * @param array{main_scope?: bool, user_job?: bool, absence?: bool, at_date?: null|DateTimeImmutable|DateTimeMutable} $options + * @param array{main_scope?: bool, user_job?: bool, absence?: bool, at_date?: null|DateTimeImmutable|DateTime} $options * @return string + * @throws LoaderError + * @throws RuntimeError + * @throws SyntaxError */ public function renderBox($entity, array $options): string { @@ -46,7 +53,7 @@ class UserRender implements ChillEntityRenderInterface if (null === $opts['at_date']) { $opts['at_date'] = $this->clock->now(); - } elseif ($opts['at_date'] instanceof \DateTime) { + } elseif ($opts['at_date'] instanceof DateTime) { $opts['at_date'] = DateTimeImmutable::createFromMutable($opts['at_date']); } @@ -65,18 +72,24 @@ class UserRender implements ChillEntityRenderInterface { $opts = \array_merge(self::DEFAULT_OPTIONS, $options); - $immutableAtDate = $opts['at_date'] instanceOf \DateTime ? DateTimeImmutable::createFromMutable($opts['at_date']) : $opts['at_date']; +// $immutableAtDate = $opts['at_date'] instanceOf DateTime ? DateTimeImmutable::createFromMutable($opts['at_date']) : $opts['at_date']; + + if (null === $opts['at_date']) { + $opts['at_date'] = $this->clock->now(); + } elseif ($opts['at_date'] instanceof DateTime) { + $opts['at_date'] = DateTimeImmutable::createFromMutable($opts['at_date']); + } $str = $entity->getLabel(); - if (null !== $entity->getUserJob($immutableAtDate) && $opts['user_job']) { + if (null !== $entity->getUserJob($opts['at_date']) && $opts['user_job']) { $str .= ' ('.$this->translatableStringHelper - ->localize($entity->getUserJob($immutableAtDate)->getLabel()).')'; + ->localize($entity->getUserJob($opts['at_date'])->getLabel()).')'; } - if (null !== $entity->getMainScope($immutableAtDate) && $opts['main_scope']) { + if (null !== $entity->getMainScope($opts['at_date']) && $opts['main_scope']) { $str .= ' ('.$this->translatableStringHelper - ->localize($entity->getMainScope($immutableAtDate)->getName()).')'; + ->localize($entity->getMainScope($opts['at_date'])->getName()).')'; } if ($entity->isAbsent() && $opts['absence']) { From 6c9101c16707afea441d18d651fd13feb9411f3b Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Tue, 30 Jan 2024 17:01:45 +0100 Subject: [PATCH 39/67] Adapt the rendering of user in accompanyingPeriodWork list and item templates --- .../Resources/views/AccompanyingCourseWork/_item.html.twig | 4 ++-- .../list_recent_by_accompanying_period.html.twig | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/_item.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/_item.html.twig index e8f6f1171..6477f4a95 100644 --- a/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/_item.html.twig +++ b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/_item.html.twig @@ -83,9 +83,9 @@
  • {%- if w.referrers|length > 0 -%} - {% for r in w.referrers %} + {% for r in w.referrersHistory %} - {{ r|chill_entity_render_box }} + {{ r.user|chill_entity_render_box({'at_date': r.startDate}) }} {% if not loop.last %}, {% endif %} {% endfor %} diff --git a/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/list_recent_by_accompanying_period.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/list_recent_by_accompanying_period.html.twig index 21552e44c..30bdc44d2 100644 --- a/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/list_recent_by_accompanying_period.html.twig +++ b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/list_recent_by_accompanying_period.html.twig @@ -33,8 +33,8 @@ {% if w.referrers %}
  • {{ 'Referrers'|trans ~ ' : ' }} - {% for rh in w.referrers %} - {{ rh|chill_entity_render_box }} + {% for rh in w.referrersHistory %} + {{ rh.user|chill_entity_render_box({'at_date': rh.startDate}) }} {% endfor %} {% if w.referrers|length == 0 %} {{ 'Not given'|trans }} From 2121b3ef28ab28852c15d18973f301587bd3a30b Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Tue, 30 Jan 2024 17:03:24 +0100 Subject: [PATCH 40/67] Add at_date to userRender for rendering the text --- .../ChillMainBundle/Serializer/Normalizer/UserNormalizer.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Bundle/ChillMainBundle/Serializer/Normalizer/UserNormalizer.php b/src/Bundle/ChillMainBundle/Serializer/Normalizer/UserNormalizer.php index 92f5ea4d8..ea8c8a0f4 100644 --- a/src/Bundle/ChillMainBundle/Serializer/Normalizer/UserNormalizer.php +++ b/src/Bundle/ChillMainBundle/Serializer/Normalizer/UserNormalizer.php @@ -83,7 +83,7 @@ class UserNormalizer implements ContextAwareNormalizerInterface, NormalizerAware 'type' => 'user', 'id' => $object->getId(), 'username' => $object->getUsername(), - 'text' => $this->userRender->renderString($object, []), + 'text' => $this->userRender->renderString($object, ['at_date' => $at]), 'text_without_absent' => $this->userRender->renderString($object, ['absence' => false]), 'label' => $object->getLabel(), 'email' => (string) $object->getEmail(), From 835409cb94fd1aed9c4a176b961f29705f5b314a Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Wed, 7 Feb 2024 07:19:26 +0100 Subject: [PATCH 41/67] work on userRenderTest --- src/Bundle/ChillMainBundle/Entity/User.php | 5 ++ .../Templating/Entity/UserRenderTest.php | 66 +++++++++++-------- 2 files changed, 44 insertions(+), 27 deletions(-) diff --git a/src/Bundle/ChillMainBundle/Entity/User.php b/src/Bundle/ChillMainBundle/Entity/User.php index 8b0412a38..2d155b54a 100644 --- a/src/Bundle/ChillMainBundle/Entity/User.php +++ b/src/Bundle/ChillMainBundle/Entity/User.php @@ -346,6 +346,11 @@ class User implements UserInterface, \Stringable return $this->jobHistories; } + public function getUserScopeHistories(): Collection + { + return $this->scopeHistories; + } + /** * @return ArrayCollection|UserJobHistory[] */ diff --git a/src/Bundle/ChillMainBundle/Tests/Templating/Entity/UserRenderTest.php b/src/Bundle/ChillMainBundle/Tests/Templating/Entity/UserRenderTest.php index 21f73d466..999421c40 100644 --- a/src/Bundle/ChillMainBundle/Tests/Templating/Entity/UserRenderTest.php +++ b/src/Bundle/ChillMainBundle/Tests/Templating/Entity/UserRenderTest.php @@ -16,52 +16,62 @@ use Twig\Environment; class UserRenderTest extends TestCase { - /** - * @throws \DateInvalidTimeZoneException - * @throws \DateMalformedStringException - */ - public function renderUserWithJobAndScopeAtCertainDateTest(): void + public function testRenderUserWithJobAndScopeAtCertainDate(): void { // Create a user with a certain user job $user = new User(); - $userJob = new UserJob(); - $scope = new Scope(); + $userJobA = new UserJob(); + $scopeA = new Scope(); - $userJob->setLabel(['fr' => 'assistant social']); - $scope->setName(['fr' => 'service A']); + $userJobA->setLabel(['fr' => 'assistant social']); + $scopeA->setName(['fr' => 'service A']); $user->setLabel('BOB ISLA'); - $userJobHistory = (new User\UserJobHistory()) + $userJobB = new UserJob(); + $scopeB = new Scope(); + + $userJobB->setLabel(['fr' => 'directrice']); + $scopeB->setName(['fr' => 'service B']); + + $userJobHistoryA = (new User\UserJobHistory()) ->setUser($user) - ->setJob($userJob) - //setStartDate - ; + ->setJob($userJobA) + ->setStartDate(new \DateTimeImmutable('2023-11-01 12:00:00')) + ->setEndDate(new \DateTimeImmutable('2023-11-30 00:00:00')); - $userScopeHistory = (new User\UserScopeHistory()) + $userScopeHistoryA = (new User\UserScopeHistory()) ->setUser($user) - ->setScope($scope) - ; - $user->getUserJobHistories()->add($userJobHistory); - $user->setMainScope($scope); + ->setScope($scopeA) + ->setStartDate(new \DateTimeImmutable('2023-11-01 12:00:00')) + ->setEndDate(new \DateTimeImmutable('2023-11-30 00:00:00')); -/* // Change the user job - $userJobTwo = new UserJob(); - $userJobTwo->setLabel(['fr' => 'directrice']); + $userJobHistoryB = (new User\UserJobHistory()) + ->setUser($user) + ->setJob($userJobB) + ->setStartDate(new \DateTimeImmutable('2023-12-01 12:00:00')); - // Change the scope - $scopeTwo = new Scope(); - $scopeTwo->setName(['fr' => 'service B']);*/ + $userScopeHistoryB = (new User\UserScopeHistory()) + ->setUser($user) + ->setScope($scopeB) + ->setStartDate(new \DateTimeImmutable('2023-12-01 12:00:00')); + $user->getUserJobHistories()->add($userJobHistoryA); + $user->getUserScopeHistories()->add($userScopeHistoryA); + + $user->getUserJobHistories()->add($userJobHistoryB); + $user->getUserScopeHistories()->add($userScopeHistoryB); // Create renderer $translatableStringHelper = $this->createMock(TranslatableStringHelperInterface::class); $engine = $this->createMock(Environment::class); $translator = $this->createMock(TranslatorInterface::class); - $clock = new MockClock(new \DateTimeImmutable('2023-12-15')); + $clock = new MockClock(new \DateTimeImmutable('2023-12-15 12:00:00')); + $renderer = new UserRender($translatableStringHelper, $engine, $translator, $clock); - $options['at_date'] = new \DateTime('2023-11-30 12:00:00'); + $optionsNoDate['at_date'] = null; + $options['at_date'] = new \DateTime('2023-11-25 12:00:00'); $optionsTwo['at_date'] = new \DateTime('2024-01-30 12:00:00'); // Check that the user render for the first activity corresponds with the first user job @@ -72,7 +82,9 @@ class UserRenderTest extends TestCase $expectedStringB = 'BOB ISLA (directrice) (service B)'; $this->assertEquals($expectedStringB, $renderer->renderString($user, $optionsTwo)); - + // Check that the user renders the job and scope that is active now, when no date is given + $expectedStringC = 'BOB ISLA (directrice) (service B)'; + $this->assertEquals($expectedStringC, $renderer->renderString($user, $optionsNoDate)); } } From f510acd170a4932843dc9b386a75a3995943b34e Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Mon, 12 Feb 2024 09:02:48 +0100 Subject: [PATCH 42/67] add back the annotation to edit accompanying period work for referrers --- .../Entity/AccompanyingPeriod/AccompanyingPeriodWork.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/AccompanyingPeriodWork.php b/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/AccompanyingPeriodWork.php index 62f7e868f..73bc0729d 100644 --- a/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/AccompanyingPeriodWork.php +++ b/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/AccompanyingPeriodWork.php @@ -394,6 +394,7 @@ class AccompanyingPeriodWork implements AccompanyingPeriodLinkedWithSocialIssues /** * @return ReadableCollection + * @Serializer\Groups({"accompanying_period_work:edit"}) */ public function getReferrers(): ReadableCollection { From 1b96deb4eed1cd0365235446183ea140b963ca1c Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Mon, 12 Feb 2024 14:36:41 +0100 Subject: [PATCH 43/67] try to fix userRenderTest: mock not working --- .../Templating/Entity/UserRenderTest.php | 22 ++++++++++++++----- 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/src/Bundle/ChillMainBundle/Tests/Templating/Entity/UserRenderTest.php b/src/Bundle/ChillMainBundle/Tests/Templating/Entity/UserRenderTest.php index 999421c40..574d272e1 100644 --- a/src/Bundle/ChillMainBundle/Tests/Templating/Entity/UserRenderTest.php +++ b/src/Bundle/ChillMainBundle/Tests/Templating/Entity/UserRenderTest.php @@ -2,7 +2,6 @@ namespace Templating\Entity; -use Chill\ActivityBundle\Entity\Activity; use Chill\MainBundle\Entity\Scope; use Chill\MainBundle\Entity\User; use Chill\MainBundle\Entity\UserJob; @@ -10,12 +9,21 @@ use Chill\MainBundle\Templating\Entity\UserRender; use Chill\MainBundle\Templating\TranslatableStringHelper; use Chill\MainBundle\Templating\TranslatableStringHelperInterface; use PHPUnit\Framework\TestCase; +use Prophecy\PhpUnit\ProphecyTrait; +use Symfony\Bundle\FrameworkBundle\Test\WebTestCase; use Symfony\Component\Clock\MockClock; use Symfony\Contracts\Translation\TranslatorInterface; use Twig\Environment; -class UserRenderTest extends TestCase +class UserRenderTest extends WebTestCase { + use ProphecyTrait; + + public function setUp(): void + { + self::bootKernel(); + } + public function testRenderUserWithJobAndScopeAtCertainDate(): void { // Create a user with a certain user job @@ -63,12 +71,14 @@ class UserRenderTest extends TestCase $user->getUserScopeHistories()->add($userScopeHistoryB); // Create renderer - $translatableStringHelper = $this->createMock(TranslatableStringHelperInterface::class); - $engine = $this->createMock(Environment::class); - $translator = $this->createMock(TranslatorInterface::class); + $translatableStringHelperMock = $this->getMockBuilder(TranslatableStringHelperInterface::class) + ->getMock(); + + $engineMock = $this->createMock(Environment::class); + $translatorMock = $this->createMock(TranslatorInterface::class); $clock = new MockClock(new \DateTimeImmutable('2023-12-15 12:00:00')); - $renderer = new UserRender($translatableStringHelper, $engine, $translator, $clock); + $renderer = new UserRender($translatableStringHelperMock, $engineMock, $translatorMock, $clock); $optionsNoDate['at_date'] = null; $options['at_date'] = new \DateTime('2023-11-25 12:00:00'); From addc623add07f2757757ad8c30bc0be1f08710b3 Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Mon, 12 Feb 2024 14:37:54 +0100 Subject: [PATCH 44/67] php style fixer --- src/Bundle/ChillMainBundle/Entity/User.php | 4 ++-- .../Serializer/Normalizer/UserNormalizer.php | 2 +- .../Templating/Entity/UserRender.php | 21 +++++++++---------- .../Templating/Entity/UserRenderTest.php | 17 ++++++++++++--- .../AccompanyingPeriodWork.php | 1 + .../AccompanyingPeriodWorkNormalizer.php | 12 ++++++----- 6 files changed, 35 insertions(+), 22 deletions(-) diff --git a/src/Bundle/ChillMainBundle/Entity/User.php b/src/Bundle/ChillMainBundle/Entity/User.php index 2d155b54a..b94d90760 100644 --- a/src/Bundle/ChillMainBundle/Entity/User.php +++ b/src/Bundle/ChillMainBundle/Entity/User.php @@ -274,7 +274,7 @@ class User implements UserInterface, \Stringable return $this->mainLocation; } - public function getMainScope(\DateTimeImmutable $atDate = null): ?Scope + public function getMainScope(?\DateTimeImmutable $atDate = null): ?Scope { $atDate ??= new \DateTimeImmutable('now'); @@ -326,7 +326,7 @@ class User implements UserInterface, \Stringable return $this->salt; } - public function getUserJob(\DateTimeImmutable $atDate = null): ?UserJob + public function getUserJob(?\DateTimeImmutable $atDate = null): ?UserJob { $atDate ??= new \DateTimeImmutable('now'); diff --git a/src/Bundle/ChillMainBundle/Serializer/Normalizer/UserNormalizer.php b/src/Bundle/ChillMainBundle/Serializer/Normalizer/UserNormalizer.php index ea8c8a0f4..99e76c5ff 100644 --- a/src/Bundle/ChillMainBundle/Serializer/Normalizer/UserNormalizer.php +++ b/src/Bundle/ChillMainBundle/Serializer/Normalizer/UserNormalizer.php @@ -41,7 +41,7 @@ class UserNormalizer implements ContextAwareNormalizerInterface, NormalizerAware 'isAbsent' => false, ]; - public function __construct(private readonly UserRender $userRender) + public function __construct(private readonly UserRender $userRender, private readonly ClockInterface $clock) { } diff --git a/src/Bundle/ChillMainBundle/Templating/Entity/UserRender.php b/src/Bundle/ChillMainBundle/Templating/Entity/UserRender.php index 77b4255cc..de9f4abbe 100644 --- a/src/Bundle/ChillMainBundle/Templating/Entity/UserRender.php +++ b/src/Bundle/ChillMainBundle/Templating/Entity/UserRender.php @@ -35,14 +35,15 @@ class UserRender implements ChillEntityRenderInterface public function __construct( private readonly TranslatableStringHelper $translatableStringHelper, - private readonly \Twig\Environment $engine, private readonly TranslatorInterface $translator, + private readonly \Twig\Environment $engine, + private readonly TranslatorInterface $translator, private readonly ClockInterface $clock, - ) {} + ) { + } /** - * @param $entity - * @param array{main_scope?: bool, user_job?: bool, absence?: bool, at_date?: null|DateTimeImmutable|DateTime} $options - * @return string + * @param array{main_scope?: bool, user_job?: bool, absence?: bool, at_date?: DateTimeImmutable|\DateTime|null} $options + * * @throws LoaderError * @throws RuntimeError * @throws SyntaxError @@ -53,7 +54,7 @@ class UserRender implements ChillEntityRenderInterface if (null === $opts['at_date']) { $opts['at_date'] = $this->clock->now(); - } elseif ($opts['at_date'] instanceof DateTime) { + } elseif ($opts['at_date'] instanceof \DateTime) { $opts['at_date'] = DateTimeImmutable::createFromMutable($opts['at_date']); } @@ -64,19 +65,17 @@ class UserRender implements ChillEntityRenderInterface } /** - * @param $entity - * @param array{main_scope?: bool, user_job?: bool, absence?: bool, at_date?: null|DateTimeImmutable|DateTimeMutable} $options - * @return string + * @param array{main_scope?: bool, user_job?: bool, absence?: bool, at_date?: DateTimeImmutable|DateTimeMutable|null} $options */ public function renderString($entity, array $options): string { $opts = \array_merge(self::DEFAULT_OPTIONS, $options); -// $immutableAtDate = $opts['at_date'] instanceOf DateTime ? DateTimeImmutable::createFromMutable($opts['at_date']) : $opts['at_date']; + // $immutableAtDate = $opts['at_date'] instanceOf DateTime ? DateTimeImmutable::createFromMutable($opts['at_date']) : $opts['at_date']; if (null === $opts['at_date']) { $opts['at_date'] = $this->clock->now(); - } elseif ($opts['at_date'] instanceof DateTime) { + } elseif ($opts['at_date'] instanceof \DateTime) { $opts['at_date'] = DateTimeImmutable::createFromMutable($opts['at_date']); } diff --git a/src/Bundle/ChillMainBundle/Tests/Templating/Entity/UserRenderTest.php b/src/Bundle/ChillMainBundle/Tests/Templating/Entity/UserRenderTest.php index 574d272e1..ef08348b4 100644 --- a/src/Bundle/ChillMainBundle/Tests/Templating/Entity/UserRenderTest.php +++ b/src/Bundle/ChillMainBundle/Tests/Templating/Entity/UserRenderTest.php @@ -1,20 +1,32 @@ assertEquals($expectedStringC, $renderer->renderString($user, $optionsNoDate)); } - } diff --git a/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/AccompanyingPeriodWork.php b/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/AccompanyingPeriodWork.php index 73bc0729d..53a1434a4 100644 --- a/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/AccompanyingPeriodWork.php +++ b/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/AccompanyingPeriodWork.php @@ -394,6 +394,7 @@ class AccompanyingPeriodWork implements AccompanyingPeriodLinkedWithSocialIssues /** * @return ReadableCollection + * * @Serializer\Groups({"accompanying_period_work:edit"}) */ public function getReferrers(): ReadableCollection diff --git a/src/Bundle/ChillPersonBundle/Serializer/Normalizer/AccompanyingPeriodWorkNormalizer.php b/src/Bundle/ChillPersonBundle/Serializer/Normalizer/AccompanyingPeriodWorkNormalizer.php index 040576fa6..94c440519 100644 --- a/src/Bundle/ChillPersonBundle/Serializer/Normalizer/AccompanyingPeriodWorkNormalizer.php +++ b/src/Bundle/ChillPersonBundle/Serializer/Normalizer/AccompanyingPeriodWorkNormalizer.php @@ -63,13 +63,15 @@ class AccompanyingPeriodWorkNormalizer implements ContextAwareNormalizerInterfac continue; } - $initial['referrers'][] = $this->normalizer->normalize($referrerHistory->getUser(), - $format, [...$context, UserNormalizer::AT_DATE => $referrerHistory->getStartDate()]); + $initial['referrers'][] = $this->normalizer->normalize( + $referrerHistory->getUser(), + $format, + [...$context, UserNormalizer::AT_DATE => $referrerHistory->getStartDate()] + ); } } - if ($format === 'json') { - + if ('json' === $format) { // then, we add normalization for things which are not into the entity $initial['workflows_availables'] = $this->metadataExtractor->availableWorkflowFor( AccompanyingPeriodWork::class, @@ -98,7 +100,7 @@ class AccompanyingPeriodWorkNormalizer implements ContextAwareNormalizerInterfac public function supportsNormalization($data, ?string $format = null, array $context = []): bool { return ('json' === $format || 'docgen' === $format) - && ($data instanceof AccompanyingPeriodWork || ('docgen' === $format && $data === null && ($context['docgen:expects'] ?? null) === AccompanyingPeriodWork::class)) + && ($data instanceof AccompanyingPeriodWork || ('docgen' === $format && null === $data && ($context['docgen:expects'] ?? null) === AccompanyingPeriodWork::class)) && !\array_key_exists(self::IGNORE_WORK, $context); } } From 1ecc825945cf3b8a7daee37580cf20e575068532 Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Mon, 12 Feb 2024 14:50:26 +0100 Subject: [PATCH 45/67] Correct 2 phpstan errors, condition is always true and wrong typing --- .../Templating/Entity/UserRender.php | 2 +- .../AccompanyingPeriodWorkNormalizer.php | 21 +++++++++---------- 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/src/Bundle/ChillMainBundle/Templating/Entity/UserRender.php b/src/Bundle/ChillMainBundle/Templating/Entity/UserRender.php index de9f4abbe..170116f04 100644 --- a/src/Bundle/ChillMainBundle/Templating/Entity/UserRender.php +++ b/src/Bundle/ChillMainBundle/Templating/Entity/UserRender.php @@ -65,7 +65,7 @@ class UserRender implements ChillEntityRenderInterface } /** - * @param array{main_scope?: bool, user_job?: bool, absence?: bool, at_date?: DateTimeImmutable|DateTimeMutable|null} $options + * @param array{main_scope?: bool, user_job?: bool, absence?: bool, at_date?: DateTimeImmutable|DateTime|null} $options */ public function renderString($entity, array $options): string { diff --git a/src/Bundle/ChillPersonBundle/Serializer/Normalizer/AccompanyingPeriodWorkNormalizer.php b/src/Bundle/ChillPersonBundle/Serializer/Normalizer/AccompanyingPeriodWorkNormalizer.php index 94c440519..5d6000164 100644 --- a/src/Bundle/ChillPersonBundle/Serializer/Normalizer/AccompanyingPeriodWorkNormalizer.php +++ b/src/Bundle/ChillPersonBundle/Serializer/Normalizer/AccompanyingPeriodWorkNormalizer.php @@ -57,20 +57,19 @@ class AccompanyingPeriodWorkNormalizer implements ContextAwareNormalizerInterfac // add the referrers $initial['referrers'] = []; - if ($object instanceof AccompanyingPeriodWork) { - foreach ($object->getReferrersHistory() as $referrerHistory) { - if (null !== $referrerHistory->getEndDate()) { - continue; - } - - $initial['referrers'][] = $this->normalizer->normalize( - $referrerHistory->getUser(), - $format, - [...$context, UserNormalizer::AT_DATE => $referrerHistory->getStartDate()] - ); + foreach ($object->getReferrersHistory() as $referrerHistory) { + if (null !== $referrerHistory->getEndDate()) { + continue; } + + $initial['referrers'][] = $this->normalizer->normalize( + $referrerHistory->getUser(), + $format, + [...$context, UserNormalizer::AT_DATE => $referrerHistory->getStartDate()] + ); } + if ('json' === $format) { // then, we add normalization for things which are not into the entity $initial['workflows_availables'] = $this->metadataExtractor->availableWorkflowFor( From 4e0d8e4deff0a354fa2d0c1172dfd8f1a9206c0b Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Mon, 12 Feb 2024 18:44:32 +0100 Subject: [PATCH 46/67] fix userNormalizerTest by adding clock in the construct of UserNormalizer --- .../Tests/Serializer/Normalizer/UserNormalizerTest.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Bundle/ChillMainBundle/Tests/Serializer/Normalizer/UserNormalizerTest.php b/src/Bundle/ChillMainBundle/Tests/Serializer/Normalizer/UserNormalizerTest.php index 96587a24c..4a6fc032f 100644 --- a/src/Bundle/ChillMainBundle/Tests/Serializer/Normalizer/UserNormalizerTest.php +++ b/src/Bundle/ChillMainBundle/Tests/Serializer/Normalizer/UserNormalizerTest.php @@ -25,6 +25,7 @@ use libphonenumber\PhoneNumberUtil; use PHPUnit\Framework\TestCase; use Prophecy\Argument; use Prophecy\PhpUnit\ProphecyTrait; +use Symfony\Component\Clock\MockClock; use Symfony\Component\Serializer\Exception\ExceptionInterface; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; @@ -122,7 +123,9 @@ final class UserNormalizerTest extends TestCase $userRender = $this->prophesize(UserRender::class); $userRender->renderString(Argument::type(User::class), Argument::type('array'))->willReturn($user ? $user->getLabel() : ''); - $normalizer = new UserNormalizer($userRender->reveal()); + $clock = new MockClock(new \DateTimeImmutable('now')); + + $normalizer = new UserNormalizer($userRender->reveal(), $clock); $normalizer->setNormalizer(new class () implements NormalizerInterface { public function normalize($object, ?string $format = null, array $context = []) { From 25f93e8a89a9a662ab62be43a154e9448cd5dee8 Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Mon, 12 Feb 2024 18:55:00 +0100 Subject: [PATCH 47/67] fix typing --- .../ChillMainBundle/Templating/Entity/UserRender.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Bundle/ChillMainBundle/Templating/Entity/UserRender.php b/src/Bundle/ChillMainBundle/Templating/Entity/UserRender.php index 170116f04..d0db6cddd 100644 --- a/src/Bundle/ChillMainBundle/Templating/Entity/UserRender.php +++ b/src/Bundle/ChillMainBundle/Templating/Entity/UserRender.php @@ -12,7 +12,7 @@ declare(strict_types=1); namespace Chill\MainBundle\Templating\Entity; use Chill\MainBundle\Entity\User; -use Chill\MainBundle\Templating\TranslatableStringHelper; +use Chill\MainBundle\Templating\TranslatableStringHelperInterface; use DateTime; use Monolog\DateTimeImmutable; use Symfony\Component\Clock\ClockInterface; @@ -34,7 +34,7 @@ class UserRender implements ChillEntityRenderInterface ]; public function __construct( - private readonly TranslatableStringHelper $translatableStringHelper, + private readonly TranslatableStringHelperInterface $translatableStringHelper, private readonly \Twig\Environment $engine, private readonly TranslatorInterface $translator, private readonly ClockInterface $clock, @@ -42,7 +42,7 @@ class UserRender implements ChillEntityRenderInterface } /** - * @param array{main_scope?: bool, user_job?: bool, absence?: bool, at_date?: DateTimeImmutable|\DateTime|null} $options + * @param array{main_scope?: bool, user_job?: bool, absence?: bool, at_date?: DateTimeImmutable|DateTime|null} $options * * @throws LoaderError * @throws RuntimeError @@ -54,7 +54,7 @@ class UserRender implements ChillEntityRenderInterface if (null === $opts['at_date']) { $opts['at_date'] = $this->clock->now(); - } elseif ($opts['at_date'] instanceof \DateTime) { + } elseif ($opts['at_date'] instanceof DateTime) { $opts['at_date'] = DateTimeImmutable::createFromMutable($opts['at_date']); } @@ -75,7 +75,7 @@ class UserRender implements ChillEntityRenderInterface if (null === $opts['at_date']) { $opts['at_date'] = $this->clock->now(); - } elseif ($opts['at_date'] instanceof \DateTime) { + } elseif ($opts['at_date'] instanceof DateTime) { $opts['at_date'] = DateTimeImmutable::createFromMutable($opts['at_date']); } From 0bc9fff82523cf9982b04328d94b421a756b8d6b Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Mon, 12 Feb 2024 18:56:05 +0100 Subject: [PATCH 48/67] test still failing with error saying column phonenumber of relation users does not exist --- .../Templating/Entity/UserRenderTest.php | 20 ++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/src/Bundle/ChillMainBundle/Tests/Templating/Entity/UserRenderTest.php b/src/Bundle/ChillMainBundle/Tests/Templating/Entity/UserRenderTest.php index ef08348b4..e7cee62d7 100644 --- a/src/Bundle/ChillMainBundle/Tests/Templating/Entity/UserRenderTest.php +++ b/src/Bundle/ChillMainBundle/Tests/Templating/Entity/UserRenderTest.php @@ -16,6 +16,9 @@ use Chill\MainBundle\Entity\User; use Chill\MainBundle\Entity\UserJob; use Chill\MainBundle\Templating\Entity\UserRender; use Chill\MainBundle\Templating\TranslatableStringHelperInterface; +use Doctrine\ORM\EntityManagerInterface; +use JetBrains\PhpStorm\NoReturn; +use libphonenumber\PhoneNumberUtil; use Prophecy\PhpUnit\ProphecyTrait; use Symfony\Bundle\FrameworkBundle\Test\WebTestCase; use Symfony\Component\Clock\MockClock; @@ -36,8 +39,11 @@ class UserRenderTest extends WebTestCase self::bootKernel(); } - public function testRenderUserWithJobAndScopeAtCertainDate(): void + #[NoReturn] public function testRenderUserWithJobAndScopeAtCertainDate(): void { + self::bootKernel(); + $em = self::$container->get(EntityManagerInterface::class); + assert($em instanceof EntityManagerInterface); // Create a user with a certain user job $user = new User(); @@ -47,6 +53,8 @@ class UserRenderTest extends WebTestCase $userJobA->setLabel(['fr' => 'assistant social']); $scopeA->setName(['fr' => 'service A']); $user->setLabel('BOB ISLA'); +// $user->setPhonenumber(PhoneNumberUtil::getInstance()->parse('+32475928635')); + $userJobB = new UserJob(); $scopeB = new Scope(); @@ -82,6 +90,14 @@ class UserRenderTest extends WebTestCase $user->getUserJobHistories()->add($userJobHistoryB); $user->getUserScopeHistories()->add($userScopeHistoryB); + $em->persist($user); + $em->persist($userJobA); + $em->persist($userJobB); + $em->persist($scopeA); + $em->persist($scopeB); + + $em->flush(); + // Create renderer $translatableStringHelperMock = $this->getMockBuilder(TranslatableStringHelperInterface::class) ->getMock(); @@ -96,6 +112,8 @@ class UserRenderTest extends WebTestCase $options['at_date'] = new \DateTime('2023-11-25 12:00:00'); $optionsTwo['at_date'] = new \DateTime('2024-01-30 12:00:00'); +// dd($user); + // Check that the user render for the first activity corresponds with the first user job $expectedStringA = 'BOB ISLA (assistant social) (service A)'; $this->assertEquals($expectedStringA, $renderer->renderString($user, $options)); From b9b342fe44594d65ceeb512aa0111a2c58c9aa9a Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Tue, 16 Apr 2024 20:09:00 +0200 Subject: [PATCH 49/67] Set isActive property for userjob --- .../Tests/Templating/Entity/UserRenderTest.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Bundle/ChillMainBundle/Tests/Templating/Entity/UserRenderTest.php b/src/Bundle/ChillMainBundle/Tests/Templating/Entity/UserRenderTest.php index e7cee62d7..06ea12d30 100644 --- a/src/Bundle/ChillMainBundle/Tests/Templating/Entity/UserRenderTest.php +++ b/src/Bundle/ChillMainBundle/Tests/Templating/Entity/UserRenderTest.php @@ -50,7 +50,8 @@ class UserRenderTest extends WebTestCase $userJobA = new UserJob(); $scopeA = new Scope(); - $userJobA->setLabel(['fr' => 'assistant social']); + $userJobA->setLabel(['fr' => 'assistant social']) + ->setActive(true); $scopeA->setName(['fr' => 'service A']); $user->setLabel('BOB ISLA'); // $user->setPhonenumber(PhoneNumberUtil::getInstance()->parse('+32475928635')); @@ -59,7 +60,8 @@ class UserRenderTest extends WebTestCase $userJobB = new UserJob(); $scopeB = new Scope(); - $userJobB->setLabel(['fr' => 'directrice']); + $userJobB->setLabel(['fr' => 'directrice']) + ->setActive(true); $scopeB->setName(['fr' => 'service B']); $userJobHistoryA = (new User\UserJobHistory()) From c9e13be736ba1a709a8b31db5b9a77922bf31607 Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Tue, 16 Apr 2024 20:16:45 +0200 Subject: [PATCH 50/67] pipeline fixes for phpstan, cs-fixer, rector --- .../ChillMainBundle/Templating/Entity/UserRender.php | 8 ++++---- .../Tests/Templating/Entity/UserRenderTest.php | 11 +++++------ .../Normalizer/AccompanyingPeriodWorkNormalizer.php | 1 - 3 files changed, 9 insertions(+), 11 deletions(-) diff --git a/src/Bundle/ChillMainBundle/Templating/Entity/UserRender.php b/src/Bundle/ChillMainBundle/Templating/Entity/UserRender.php index d0db6cddd..c52875482 100644 --- a/src/Bundle/ChillMainBundle/Templating/Entity/UserRender.php +++ b/src/Bundle/ChillMainBundle/Templating/Entity/UserRender.php @@ -42,7 +42,7 @@ class UserRender implements ChillEntityRenderInterface } /** - * @param array{main_scope?: bool, user_job?: bool, absence?: bool, at_date?: DateTimeImmutable|DateTime|null} $options + * @param array $options * * @throws LoaderError * @throws RuntimeError @@ -54,7 +54,7 @@ class UserRender implements ChillEntityRenderInterface if (null === $opts['at_date']) { $opts['at_date'] = $this->clock->now(); - } elseif ($opts['at_date'] instanceof DateTime) { + } elseif ($opts['at_date'] instanceof \DateTime) { $opts['at_date'] = DateTimeImmutable::createFromMutable($opts['at_date']); } @@ -65,7 +65,7 @@ class UserRender implements ChillEntityRenderInterface } /** - * @param array{main_scope?: bool, user_job?: bool, absence?: bool, at_date?: DateTimeImmutable|DateTime|null} $options + * @param array $options */ public function renderString($entity, array $options): string { @@ -75,7 +75,7 @@ class UserRender implements ChillEntityRenderInterface if (null === $opts['at_date']) { $opts['at_date'] = $this->clock->now(); - } elseif ($opts['at_date'] instanceof DateTime) { + } elseif ($opts['at_date'] instanceof \DateTime) { $opts['at_date'] = DateTimeImmutable::createFromMutable($opts['at_date']); } diff --git a/src/Bundle/ChillMainBundle/Tests/Templating/Entity/UserRenderTest.php b/src/Bundle/ChillMainBundle/Tests/Templating/Entity/UserRenderTest.php index 06ea12d30..0efccc96c 100644 --- a/src/Bundle/ChillMainBundle/Tests/Templating/Entity/UserRenderTest.php +++ b/src/Bundle/ChillMainBundle/Tests/Templating/Entity/UserRenderTest.php @@ -39,7 +39,8 @@ class UserRenderTest extends WebTestCase self::bootKernel(); } - #[NoReturn] public function testRenderUserWithJobAndScopeAtCertainDate(): void + #[NoReturn] + public function testRenderUserWithJobAndScopeAtCertainDate(): void { self::bootKernel(); $em = self::$container->get(EntityManagerInterface::class); @@ -54,8 +55,7 @@ class UserRenderTest extends WebTestCase ->setActive(true); $scopeA->setName(['fr' => 'service A']); $user->setLabel('BOB ISLA'); -// $user->setPhonenumber(PhoneNumberUtil::getInstance()->parse('+32475928635')); - + // $user->setPhonenumber(PhoneNumberUtil::getInstance()->parse('+32475928635')); $userJobB = new UserJob(); $scopeB = new Scope(); @@ -101,8 +101,7 @@ class UserRenderTest extends WebTestCase $em->flush(); // Create renderer - $translatableStringHelperMock = $this->getMockBuilder(TranslatableStringHelperInterface::class) - ->getMock(); + $translatableStringHelperMock = $this->createMock(TranslatableStringHelperInterface::class); $engineMock = $this->createMock(Environment::class); $translatorMock = $this->createMock(TranslatorInterface::class); @@ -114,7 +113,7 @@ class UserRenderTest extends WebTestCase $options['at_date'] = new \DateTime('2023-11-25 12:00:00'); $optionsTwo['at_date'] = new \DateTime('2024-01-30 12:00:00'); -// dd($user); + // dd($user); // Check that the user render for the first activity corresponds with the first user job $expectedStringA = 'BOB ISLA (assistant social) (service A)'; diff --git a/src/Bundle/ChillPersonBundle/Serializer/Normalizer/AccompanyingPeriodWorkNormalizer.php b/src/Bundle/ChillPersonBundle/Serializer/Normalizer/AccompanyingPeriodWorkNormalizer.php index 5d6000164..13d25deb8 100644 --- a/src/Bundle/ChillPersonBundle/Serializer/Normalizer/AccompanyingPeriodWorkNormalizer.php +++ b/src/Bundle/ChillPersonBundle/Serializer/Normalizer/AccompanyingPeriodWorkNormalizer.php @@ -69,7 +69,6 @@ class AccompanyingPeriodWorkNormalizer implements ContextAwareNormalizerInterfac ); } - if ('json' === $format) { // then, we add normalization for things which are not into the entity $initial['workflows_availables'] = $this->metadataExtractor->availableWorkflowFor( From a7ec7c9f375fdf916a675afcbf85077e7ee98bcc Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Tue, 7 May 2024 16:32:12 +0200 Subject: [PATCH 51/67] fix pipeline for branch affichage metiers --- src/Bundle/ChillMainBundle/Templating/Entity/UserRender.php | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/Bundle/ChillMainBundle/Templating/Entity/UserRender.php b/src/Bundle/ChillMainBundle/Templating/Entity/UserRender.php index c52875482..3edd56512 100644 --- a/src/Bundle/ChillMainBundle/Templating/Entity/UserRender.php +++ b/src/Bundle/ChillMainBundle/Templating/Entity/UserRender.php @@ -42,8 +42,6 @@ class UserRender implements ChillEntityRenderInterface } /** - * @param array $options - * * @throws LoaderError * @throws RuntimeError * @throws SyntaxError @@ -64,9 +62,6 @@ class UserRender implements ChillEntityRenderInterface ]); } - /** - * @param array $options - */ public function renderString($entity, array $options): string { $opts = \array_merge(self::DEFAULT_OPTIONS, $options); From 61877e015717573ea7e40aefb0a16c272966da97 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Fri, 7 Jun 2024 12:35:14 +0200 Subject: [PATCH 52/67] Refactor UserRenderTest and remove unused methods The UserRenderTest class has been refactored significantly. Redundant methods related to the booting kernel of Symfony have been removed. The approach of mocking objects has been changed, swapping from traditional mocking to prophecy mocking. --- .../Templating/Entity/UserRenderTest.php | 33 ++++--------------- 1 file changed, 6 insertions(+), 27 deletions(-) diff --git a/src/Bundle/ChillMainBundle/Tests/Templating/Entity/UserRenderTest.php b/src/Bundle/ChillMainBundle/Tests/Templating/Entity/UserRenderTest.php index 0efccc96c..1d6c91e13 100644 --- a/src/Bundle/ChillMainBundle/Tests/Templating/Entity/UserRenderTest.php +++ b/src/Bundle/ChillMainBundle/Tests/Templating/Entity/UserRenderTest.php @@ -16,11 +16,9 @@ use Chill\MainBundle\Entity\User; use Chill\MainBundle\Entity\UserJob; use Chill\MainBundle\Templating\Entity\UserRender; use Chill\MainBundle\Templating\TranslatableStringHelperInterface; -use Doctrine\ORM\EntityManagerInterface; -use JetBrains\PhpStorm\NoReturn; -use libphonenumber\PhoneNumberUtil; +use PHPUnit\Framework\TestCase; +use Prophecy\Argument; use Prophecy\PhpUnit\ProphecyTrait; -use Symfony\Bundle\FrameworkBundle\Test\WebTestCase; use Symfony\Component\Clock\MockClock; use Symfony\Contracts\Translation\TranslatorInterface; use Twig\Environment; @@ -30,21 +28,12 @@ use Twig\Environment; * * @coversNothing */ -class UserRenderTest extends WebTestCase +class UserRenderTest extends TestCase { use ProphecyTrait; - public function setUp(): void - { - self::bootKernel(); - } - - #[NoReturn] public function testRenderUserWithJobAndScopeAtCertainDate(): void { - self::bootKernel(); - $em = self::$container->get(EntityManagerInterface::class); - assert($em instanceof EntityManagerInterface); // Create a user with a certain user job $user = new User(); @@ -55,7 +44,6 @@ class UserRenderTest extends WebTestCase ->setActive(true); $scopeA->setName(['fr' => 'service A']); $user->setLabel('BOB ISLA'); - // $user->setPhonenumber(PhoneNumberUtil::getInstance()->parse('+32475928635')); $userJobB = new UserJob(); $scopeB = new Scope(); @@ -92,29 +80,20 @@ class UserRenderTest extends WebTestCase $user->getUserJobHistories()->add($userJobHistoryB); $user->getUserScopeHistories()->add($userScopeHistoryB); - $em->persist($user); - $em->persist($userJobA); - $em->persist($userJobB); - $em->persist($scopeA); - $em->persist($scopeB); - - $em->flush(); - // Create renderer - $translatableStringHelperMock = $this->createMock(TranslatableStringHelperInterface::class); + $translatableStringHelperMock = $this->prophesize(TranslatableStringHelperInterface::class); + $translatableStringHelperMock->localize(Argument::type('array'))->will(fn($args) => $args[0]['fr']); $engineMock = $this->createMock(Environment::class); $translatorMock = $this->createMock(TranslatorInterface::class); $clock = new MockClock(new \DateTimeImmutable('2023-12-15 12:00:00')); - $renderer = new UserRender($translatableStringHelperMock, $engineMock, $translatorMock, $clock); + $renderer = new UserRender($translatableStringHelperMock->reveal(), $engineMock, $translatorMock, $clock); $optionsNoDate['at_date'] = null; $options['at_date'] = new \DateTime('2023-11-25 12:00:00'); $optionsTwo['at_date'] = new \DateTime('2024-01-30 12:00:00'); - // dd($user); - // Check that the user render for the first activity corresponds with the first user job $expectedStringA = 'BOB ISLA (assistant social) (service A)'; $this->assertEquals($expectedStringA, $renderer->renderString($user, $options)); From ebb856fe859c53c93bc6e3f58a44c443466cf078 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Fri, 7 Jun 2024 13:06:46 +0200 Subject: [PATCH 53/67] fix rendering of accompanying course commen with at_date --- .../ChillPersonBundle/Entity/AccompanyingPeriod/Comment.php | 5 +++++ .../AccompanyingCourse/Comment/macro_showItem.html.twig | 6 ++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/Comment.php b/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/Comment.php index c972f453a..509dcabb0 100644 --- a/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/Comment.php +++ b/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/Comment.php @@ -167,6 +167,11 @@ class Comment implements TrackCreationInterface, TrackUpdateInterface return $this; } + public function getCreatedBy(): ?User + { + return $this->getCreator(); + } + public function setUpdatedAt(\DateTimeInterface $updatedAt): self { $this->updatedAt = $updatedAt; diff --git a/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourse/Comment/macro_showItem.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourse/Comment/macro_showItem.html.twig index 8812dcdae..156353652 100644 --- a/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourse/Comment/macro_showItem.html.twig +++ b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourse/Comment/macro_showItem.html.twig @@ -7,10 +7,8 @@ {% endif %} - {% set creator = comment.creator is defined ? comment.creator : comment.createdBy %} - {{ 'by'|trans }}{{ creator }} - - {{ ', ' ~ 'on'|trans ~ ' ' ~ comment.createdAt|format_date('long') }}
    + {{ 'by'|trans }} + {{ comment.createdBy|chill_entity_render_box({'at_date': comment.createdAt }) }}{{ ', ' ~ 'on'|trans ~ ' ' ~ comment.createdAt|format_date('long') }}
    {{ 'Last updated on'|trans ~ ' ' ~ comment.updatedAt|format_datetime('long', 'short') }}
    • From f62f1891d8fe3aa7c9dabc0747bd3d3833da25fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Fri, 7 Jun 2024 13:07:25 +0200 Subject: [PATCH 54/67] Fix displaying calendar: reproduce same getAtDate method as Activity --- src/Bundle/ChillCalendarBundle/Entity/Calendar.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/Bundle/ChillCalendarBundle/Entity/Calendar.php b/src/Bundle/ChillCalendarBundle/Entity/Calendar.php index 32308a50c..5962ae4d1 100644 --- a/src/Bundle/ChillCalendarBundle/Entity/Calendar.php +++ b/src/Bundle/ChillCalendarBundle/Entity/Calendar.php @@ -524,6 +524,16 @@ class Calendar implements TrackCreationInterface, TrackUpdateInterface, HasCente return $this->startDate; } + /** + * get the date of the calendar. + * + * Useful for showing the date of the calendar event, required by twig in some places. + */ + public function getDate(): ?\DateTimeImmutable + { + return $this->getStartDate(); + } + public function getStatus(): ?string { return $this->status; From be730679c85e80eafd6321a0447cd68f379c2b72 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Mon, 10 Jun 2024 15:23:12 +0200 Subject: [PATCH 55/67] Update rendering of user information in AccompanyingCourse/Comment: show user at the comment's date --- .../Resources/views/AccompanyingCourse/index.html.twig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourse/index.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourse/index.html.twig index 3ef4825ef..4ceadf7a1 100644 --- a/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourse/index.html.twig +++ b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourse/index.html.twig @@ -99,7 +99,7 @@ {% endif %} -{{ closing_box|raw }} \ No newline at end of file +{{ closing_box|raw }} diff --git a/src/Bundle/ChillMainBundle/Resources/views/Workflow/_decision.html.twig b/src/Bundle/ChillMainBundle/Resources/views/Workflow/_decision.html.twig index 2aec17cf9..0056c503d 100644 --- a/src/Bundle/ChillMainBundle/Resources/views/Workflow/_decision.html.twig +++ b/src/Bundle/ChillMainBundle/Resources/views/Workflow/_decision.html.twig @@ -31,14 +31,14 @@
      {{ 'By'|trans }} - {{ step.previous.transitionBy|chill_entity_render_box }}, + {{ step.previous.transitionBy|chill_entity_render_box({'at_date': step.previous.transitionAt }) }}, {{ step.previous.transitionAt|format_datetime('short', 'short') }}
      {% else %}
      {{ 'workflow.Created by'|trans }}
      -
      {{ step.entityWorkflow.createdBy|chill_entity_render_box }}
      +
      {{ step.entityWorkflow.createdBy|chill_entity_render_box({'at_date': step.entityWorkflow.createdAt}) }}
      {{ 'Le'|trans }}
      @@ -110,8 +110,8 @@ {% if entity_workflow.currentStep.destUserByAccessKey|length > 0 %}

      {{ 'workflow.Those users are also granted to apply a transition by using an access key'|trans }} :

        - {% for u in entity_workflow.currentStep.destUserByAccessKey %} -
      • {{ u|chill_entity_render_box }}
      • + {% for u in entity_workflow.currentStepChained.destUserByAccessKey %} +
      • {{ u|chill_entity_render_box({'at_date': entity_workflow.currentStepChained.previous.transitionAt }) }}
      • {% endfor %}
      {% endif %} diff --git a/src/Bundle/ChillMainBundle/Resources/views/Workflow/_history.html.twig b/src/Bundle/ChillMainBundle/Resources/views/Workflow/_history.html.twig index acbf97cf7..a3e2e24b9 100644 --- a/src/Bundle/ChillMainBundle/Resources/views/Workflow/_history.html.twig +++ b/src/Bundle/ChillMainBundle/Resources/views/Workflow/_history.html.twig @@ -42,7 +42,7 @@
      {% if step.transitionBy is not null %}
      - {{ step.transitionBy|chill_entity_render_box }} + {{ step.transitionBy|chill_entity_render_box({'at_date': step.transitionAt}) }}
      {% endif %}
      @@ -76,7 +76,7 @@

      {{ 'workflow.Users allowed to apply transition'|trans }} :

        {% for u in step.destUser %} -
      • {{ u|chill_entity_render_box }}
      • +
      • {{ u|chill_entity_render_box({'at_date': step.previous.transitionAt}) }}
      • {% endfor %}
      {% endif %} @@ -85,7 +85,7 @@

      {{ 'workflow.Users put in Cc'|trans }} :

        {% for u in step.ccUser %} -
      • {{ u|chill_entity_render_box }}
      • +
      • {{ u|chill_entity_render_box({'at_date': step.previous.transitionAt}) }}
      • {% endfor %}
      {% endif %} @@ -103,7 +103,7 @@

      {{ 'workflow.Those users are also granted to apply a transition by using an access key'|trans }} :

        {% for u in step.destUserByAccessKey %} -
      • {{ u|chill_entity_render_box }}
      • +
      • {{ u|chill_entity_render_box({'at_date': step.previous.transitionAt}) }}
      • {% endfor %}
      {% endif %} diff --git a/src/Bundle/ChillMainBundle/Resources/views/Workflow/macro_breadcrumb.html.twig b/src/Bundle/ChillMainBundle/Resources/views/Workflow/macro_breadcrumb.html.twig index 2ba893910..71d1efcf1 100644 --- a/src/Bundle/ChillMainBundle/Resources/views/Workflow/macro_breadcrumb.html.twig +++ b/src/Bundle/ChillMainBundle/Resources/views/Workflow/macro_breadcrumb.html.twig @@ -3,7 +3,7 @@ {% if step.previous is not null %}
    • {{ 'By'|trans ~ ' : ' }} - {{ step.previous.transitionBy|chill_entity_render_box }} + {{ step.previous.transitionBy|chill_entity_render_box({'at_date': step.previous.transitionAt }) }}
    • {{ 'Le'|trans ~ ' : ' }} @@ -12,19 +12,19 @@
    • {{ 'workflow.For'|trans ~ ' : ' }} - {% for d in step.destUser %}{{ d|chill_entity_render_string }}{% if not loop.last %}, {% endif %}{% endfor %} + {% for d in step.destUser %}{{ d|chill_entity_render_string({'at_date': step.previous.transitionAt}) }}{% if not loop.last %}, {% endif %}{% endfor %}
    • {{ 'workflow.Cc'|trans ~ ' : ' }} - {% for u in step.ccUser %}{{ u|chill_entity_render_string }}{% if not loop.last %}, {% endif %}{% endfor %} + {% for u in step.ccUser %}{{ u|chill_entity_render_string({'at_date': step.previous.transitionAt }) }}{% if not loop.last %}, {% endif %}{% endfor %}
    • {% else %}
    • {{ 'workflow.Created by'|trans ~ ' : ' }} - {{ step.entityWorkflow.createdBy|chill_entity_render_box }} + {{ step.entityWorkflow.createdBy|chill_entity_render_box({'at_date': step.entityWorkflow.createdAt }) }}
    • {{ 'Le'|trans ~ ' : ' }} diff --git a/src/Bundle/ChillMainBundle/Serializer/Normalizer/EntityWorkflowStepNormalizer.php b/src/Bundle/ChillMainBundle/Serializer/Normalizer/EntityWorkflowStepNormalizer.php index 46dbd00cc..2d924eb4d 100644 --- a/src/Bundle/ChillMainBundle/Serializer/Normalizer/EntityWorkflowStepNormalizer.php +++ b/src/Bundle/ChillMainBundle/Serializer/Normalizer/EntityWorkflowStepNormalizer.php @@ -54,7 +54,7 @@ class EntityWorkflowStepNormalizer implements NormalizerAwareInterface, Normaliz $data['transitionPreviousBy'] = $this->normalizer->normalize( $previous->getTransitionBy(), $format, - $context + [...$context, UserNormalizer::AT_DATE => $previous->getTransitionAt()] ); $data['transitionPreviousAt'] = $this->normalizer->normalize( $previous->getTransitionAt(), diff --git a/src/Bundle/ChillPersonBundle/Serializer/Normalizer/WorkflowNormalizer.php b/src/Bundle/ChillPersonBundle/Serializer/Normalizer/WorkflowNormalizer.php index 99314ebdc..5e18fdd31 100644 --- a/src/Bundle/ChillPersonBundle/Serializer/Normalizer/WorkflowNormalizer.php +++ b/src/Bundle/ChillPersonBundle/Serializer/Normalizer/WorkflowNormalizer.php @@ -12,6 +12,7 @@ declare(strict_types=1); namespace Chill\PersonBundle\Serializer\Normalizer; use Chill\MainBundle\Entity\Workflow\EntityWorkflow; +use Chill\MainBundle\Serializer\Normalizer\UserNormalizer; use Chill\MainBundle\Workflow\Helper\MetadataExtractor; use Symfony\Component\Serializer\Exception\ExceptionInterface; use Symfony\Component\Serializer\Normalizer\ContextAwareNormalizerInterface; @@ -48,7 +49,7 @@ class WorkflowNormalizer implements ContextAwareNormalizerInterface, NormalizerA $data['workflow'] = $this->metadataExtractor->buildArrayPresentationForWorkflow($workflow); $data['current_place'] = $this->metadataExtractor->buildArrayPresentationForPlace($object); $data['current_place_at'] = $this->normalizer->normalize($object->getCurrentStepCreatedAt(), 'json', ['groups' => ['read']]); - $data['current_place_by'] = $this->normalizer->normalize($object->getCurrentStepCreatedBy(), 'json', ['groups' => ['read']]); + $data['current_place_by'] = $this->normalizer->normalize($object->getCurrentStepCreatedBy(), 'json', ['groups' => ['read'], UserNormalizer::AT_DATE => $object->getCurrentStepCreatedAt()]); return $data; } From 83883567a221abb7f645bef9c3fd1d17a78380e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Tue, 11 Jun 2024 09:38:56 +0200 Subject: [PATCH 58/67] Upgrade node dependencies and add necessary fixes --- package.json | 4 +++- .../public/lib/download-report/download-report.js | 11 +++++++++-- .../HomepageWidget/DashboardWidgets/NewsItem.vue | 4 ++-- 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 6b494a68d..17c7064a7 100644 --- a/package.json +++ b/package.json @@ -42,11 +42,13 @@ "@fullcalendar/vue3": "^6.1.4", "@popperjs/core": "^2.9.2", "@types/leaflet": "^1.9.3", + "@types/dompurify": "^3.0.5", "dropzone": "^5.7.6", "es6-promise": "^4.2.8", "leaflet": "^1.7.1", + "marked": "^12.0.2", "masonry-layout": "^4.2.2", - "mime": "^3.0.0", + "mime": "^4.0.0", "swagger-ui": "^4.15.5", "vis-network": "^9.1.0", "vue": "^3.2.37", diff --git a/src/Bundle/ChillMainBundle/Resources/public/lib/download-report/download-report.js b/src/Bundle/ChillMainBundle/Resources/public/lib/download-report/download-report.js index 041e94c45..e7dce2d48 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/lib/download-report/download-report.js +++ b/src/Bundle/ChillMainBundle/Resources/public/lib/download-report/download-report.js @@ -43,7 +43,14 @@ var download_report = (url, container) => { content = URL.createObjectURL(blob); } - extension = mime.getExtension(type); + const extensions = new Map(); + extensions.set('application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', 'xlsx'); + extensions.set('application/vnd.oasis.opendocument.spreadsheet', 'ods'); + extensions.set('application/vnd.ms-excel', 'xlsx'); + extensions.set('text/csv', 'csv'); + extensions.set('text/csv; charset=utf-8', 'csv'); + + extension = extensions.get(type); link.appendChild(document.createTextNode(download_text)); link.classList.add("btn", "btn-action"); @@ -55,7 +62,7 @@ var download_report = (url, container) => { container.innerHTML = ""; container.appendChild(link); }).catch(function(error) { - console.log(error); + console.error(error); var problem_text = document.createTextNode("Problem during download"); diff --git a/src/Bundle/ChillMainBundle/Resources/public/vuejs/HomepageWidget/DashboardWidgets/NewsItem.vue b/src/Bundle/ChillMainBundle/Resources/public/vuejs/HomepageWidget/DashboardWidgets/NewsItem.vue index bbad4315c..d3b499cac 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/vuejs/HomepageWidget/DashboardWidgets/NewsItem.vue +++ b/src/Bundle/ChillMainBundle/Resources/public/vuejs/HomepageWidget/DashboardWidgets/NewsItem.vue @@ -139,8 +139,8 @@ const postprocess = (html: string): string => { } const convertMarkdownToHtml = (markdown: string): string => { - marked.use({'hooks': {postprocess, preprocess}}); - const rawHtml = marked(markdown); + marked.use({'hooks': {postprocess, preprocess}, 'async': false}); + const rawHtml = marked(markdown) as string; return rawHtml; }; From 1993fac1c4aa67efc2806a3cfa91753a1a68c03a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Tue, 11 Jun 2024 09:39:32 +0200 Subject: [PATCH 59/67] Update button rendering in AddPersons.vue This commit modifies the button rendering in AddPersons.vue component to ensure that it doesn't crash if 'buttonTitle' is undefined. It does so by providing an empty string as a fallback in case 'buttonTitle' is unavailable, improving the component's stability. --- .../Resources/public/vuejs/_components/AddPersons.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/_components/AddPersons.vue b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/_components/AddPersons.vue index 05f622d00..84984fc01 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/_components/AddPersons.vue +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/_components/AddPersons.vue @@ -1,6 +1,6 @@