From 51a4ffca2e1d1c777ecf1286b57d9f5adf541127 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Mon, 16 Oct 2023 11:59:49 +0200 Subject: [PATCH] Fix cs with new cs rules (php-cs-fixer version 3.35) --- .../Repository/ActivityACLAwareRepository.php | 2 +- .../Repository/ChargeRepository.php | 2 +- .../Repository/ResourceRepository.php | 4 ++-- .../Connector/MSGraph/MSUserAbsenceReader.php | 2 +- .../MSGraph/MSUserAbsenceReaderInterface.php | 2 +- .../CustomFields/CustomFieldChoice.php | 2 +- .../Entity/CustomFieldsGroup.php | 2 +- .../Controller/ParticipationController.php | 16 ++++++++-------- src/Bundle/ChillEventBundle/Entity/Event.php | 2 +- .../Command/LoadPostalCodesCommand.php | 2 +- .../Controller/PasswordController.php | 4 ++-- .../ChillMainBundle/Doctrine/DQL/Extract.php | 2 +- .../ChillMainBundle/Doctrine/DQL/JsonExtract.php | 2 +- .../ChillMainBundle/Doctrine/DQL/ToChar.php | 2 +- .../ChillMainBundle/Export/ExportFormHelper.php | 4 ++-- .../ChillMainBundle/Export/ExportManager.php | 8 ++++---- .../Authorization/AuthorizationHelper.php | 8 ++++---- .../AuthorizationHelperInterface.php | 2 +- .../Resolver/ScopeResolverDispatcher.php | 2 +- .../DiscriminatedObjectDenormalizer.php | 2 +- .../Doctrine/DQL/AddressPart.php | 2 +- .../Entity/AccompanyingPeriod.php | 2 +- .../Entity/AccompanyingPeriod/Resource.php | 2 +- src/Bundle/ChillPersonBundle/Entity/Person.php | 2 +- .../Entity/SocialWork/SocialAction.php | 6 +++--- .../Entity/SocialWork/SocialIssue.php | 2 +- .../JobWorkingOnCourseAggregator.php | 2 +- .../ScopeWorkingOnCourseAggregator.php | 2 +- .../UserWorkingOnCourseAggregator.php | 2 +- .../PersonAggregators/CenterAggregator.php | 2 +- .../AccompanyingPeriodWorkNormalizer.php | 2 +- .../AccompanyingPeriodACLAwareRepositoryTest.php | 2 +- .../DataFixtures/ORM/LoadReports.php | 2 +- .../Authorization/AuthorizationEvent.php | 2 +- .../ChillWopiBundle/src/Controller/Convert.php | 2 +- 35 files changed, 53 insertions(+), 53 deletions(-) diff --git a/src/Bundle/ChillActivityBundle/Repository/ActivityACLAwareRepository.php b/src/Bundle/ChillActivityBundle/Repository/ActivityACLAwareRepository.php index 6babecc55..d61e0999e 100644 --- a/src/Bundle/ChillActivityBundle/Repository/ActivityACLAwareRepository.php +++ b/src/Bundle/ChillActivityBundle/Repository/ActivityACLAwareRepository.php @@ -193,7 +193,7 @@ final readonly class ActivityACLAwareRepository implements ActivityACLAwareRepos return $qb->getQuery()->getResult(); } - public function findUserJobByAssociated(Person|AccompanyingPeriod $associated): array + public function findUserJobByAssociated(AccompanyingPeriod|Person $associated): array { $in = $this->em->createQueryBuilder(); $in->select('IDENTITY(u.job)') diff --git a/src/Bundle/ChillBudgetBundle/Repository/ChargeRepository.php b/src/Bundle/ChillBudgetBundle/Repository/ChargeRepository.php index 9b89010dc..475657f68 100644 --- a/src/Bundle/ChillBudgetBundle/Repository/ChargeRepository.php +++ b/src/Bundle/ChillBudgetBundle/Repository/ChargeRepository.php @@ -34,7 +34,7 @@ class ChargeRepository extends ServiceEntityRepository /** * @return Charge[] */ - public function findAllByEntity(Person|Household $entity): array + public function findAllByEntity(Household|Person $entity): array { $qb = $this->createQueryBuilder('c'); diff --git a/src/Bundle/ChillBudgetBundle/Repository/ResourceRepository.php b/src/Bundle/ChillBudgetBundle/Repository/ResourceRepository.php index 836f13e4b..6ecf13d28 100644 --- a/src/Bundle/ChillBudgetBundle/Repository/ResourceRepository.php +++ b/src/Bundle/ChillBudgetBundle/Repository/ResourceRepository.php @@ -35,7 +35,7 @@ class ResourceRepository extends ServiceEntityRepository /** * @return Resource[] */ - public function findAllByEntity(Person|Household $entity): array + public function findAllByEntity(Household|Person $entity): array { $qb = $this->createQueryBuilder('r'); @@ -47,7 +47,7 @@ class ResourceRepository extends ServiceEntityRepository return $qb->getQuery()->getResult(); } - public function findByEntityAndDate(Person|Household $entity, DateTime $date, $sort = null) + public function findByEntityAndDate(Household|Person $entity, DateTime $date, $sort = null) { $qb = $this->createQueryBuilder('c'); diff --git a/src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/MSGraph/MSUserAbsenceReader.php b/src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/MSGraph/MSUserAbsenceReader.php index a81ef34c3..740666cd6 100644 --- a/src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/MSGraph/MSUserAbsenceReader.php +++ b/src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/MSGraph/MSUserAbsenceReader.php @@ -33,7 +33,7 @@ final readonly class MSUserAbsenceReader implements MSUserAbsenceReaderInterface /** * @throw UserAbsenceSyncException when the data cannot be reached or is not valid from microsoft */ - public function isUserAbsent(User $user): bool|null + public function isUserAbsent(User $user): null|bool { $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 a918bb7ea..f67562e27 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): bool|null; + public function isUserAbsent(User $user): null|bool; } diff --git a/src/Bundle/ChillCustomFieldsBundle/CustomFields/CustomFieldChoice.php b/src/Bundle/ChillCustomFieldsBundle/CustomFields/CustomFieldChoice.php index 27a4f930f..2ee0a9c48 100644 --- a/src/Bundle/ChillCustomFieldsBundle/CustomFields/CustomFieldChoice.php +++ b/src/Bundle/ChillCustomFieldsBundle/CustomFields/CustomFieldChoice.php @@ -366,7 +366,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(array|string|null $value) + private function guessValue(null|array|string $value) { if (null === $value) { return null; diff --git a/src/Bundle/ChillCustomFieldsBundle/Entity/CustomFieldsGroup.php b/src/Bundle/ChillCustomFieldsBundle/Entity/CustomFieldsGroup.php index 7ede1a08a..41fc535fe 100644 --- a/src/Bundle/ChillCustomFieldsBundle/Entity/CustomFieldsGroup.php +++ b/src/Bundle/ChillCustomFieldsBundle/Entity/CustomFieldsGroup.php @@ -138,7 +138,7 @@ class CustomFieldsGroup /** * Get name. */ - public function getName(?string $language = null): string|array + 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/ChillEventBundle/Controller/ParticipationController.php b/src/Bundle/ChillEventBundle/Controller/ParticipationController.php index 126178a9e..54dc763ef 100644 --- a/src/Bundle/ChillEventBundle/Controller/ParticipationController.php +++ b/src/Bundle/ChillEventBundle/Controller/ParticipationController.php @@ -44,7 +44,7 @@ class ParticipationController extends AbstractController * @return Response|\Symfony\Component\HttpFoundation\RedirectResponse * @\Symfony\Component\Routing\Annotation\Route(path="/{_locale}/event/participation/create", name="chill_event_participation_create") */ - public function createAction(Request $request): \Symfony\Component\HttpFoundation\Response|\Symfony\Component\HttpFoundation\RedirectResponse + public function createAction(Request $request): \Symfony\Component\HttpFoundation\RedirectResponse|\Symfony\Component\HttpFoundation\Response { // test the request is correct try { @@ -162,7 +162,7 @@ class ParticipationController extends AbstractController /** * @return Response|\Symfony\Component\HttpFoundation\RedirectResponse */ - public function createMultiple(Request $request): \Symfony\Component\HttpFoundation\Response|\Symfony\Component\HttpFoundation\RedirectResponse + public function createMultiple(Request $request): \Symfony\Component\HttpFoundation\RedirectResponse|\Symfony\Component\HttpFoundation\Response { $participations = $this->handleRequest($request, new Participation(), true); @@ -205,7 +205,7 @@ class ParticipationController extends AbstractController /** * @return Response|\Symfony\Component\HttpFoundation\RedirectResponse */ - public function createSingle(Request $request): \Symfony\Component\HttpFoundation\Response|\Symfony\Component\HttpFoundation\RedirectResponse + public function createSingle(Request $request): \Symfony\Component\HttpFoundation\RedirectResponse|\Symfony\Component\HttpFoundation\Response { $participation = $this->handleRequest($request, new Participation(), false); @@ -249,7 +249,7 @@ class ParticipationController extends AbstractController * @return Response|\Symfony\Component\HttpFoundation\RedirectResponse * @\Symfony\Component\Routing\Annotation\Route(path="/{_locale}/event/participation/{participation_id}/delete", name="chill_event_participation_delete", requirements={"participation_id"="\d+"}, methods={"GET", "DELETE"}) */ - public function deleteAction($participation_id, Request $request): \Symfony\Component\HttpFoundation\Response|\Symfony\Component\HttpFoundation\RedirectResponse + public function deleteAction($participation_id, Request $request): \Symfony\Component\HttpFoundation\RedirectResponse|\Symfony\Component\HttpFoundation\Response { $em = $this->getDoctrine()->getManager(); $participation = $em->getRepository(\Chill\EventBundle\Entity\Participation::class)->findOneBy([ @@ -330,7 +330,7 @@ class ParticipationController extends AbstractController * @return Response|\Symfony\Component\HttpFoundation\RedirectResponse * @\Symfony\Component\Routing\Annotation\Route(path="/{_locale}/event/participation/{event_id}/edit_multiple", name="chill_event_participation_edit_multiple") */ - public function editMultipleAction($event_id): \Symfony\Component\HttpFoundation\Response|\Symfony\Component\HttpFoundation\RedirectResponse + public function editMultipleAction($event_id): \Symfony\Component\HttpFoundation\RedirectResponse|\Symfony\Component\HttpFoundation\Response { $event = $this->getDoctrine()->getRepository(\Chill\EventBundle\Entity\Event::class) ->find($event_id); @@ -388,7 +388,7 @@ class ParticipationController extends AbstractController * @return Response|\Symfony\Component\HttpFoundation\RedirectResponse * @\Symfony\Component\Routing\Annotation\Route(path="/{_locale}/event/participation/new", name="chill_event_participation_new") */ - public function newAction(Request $request): \Symfony\Component\HttpFoundation\Response|\Symfony\Component\HttpFoundation\RedirectResponse + public function newAction(Request $request): \Symfony\Component\HttpFoundation\RedirectResponse|\Symfony\Component\HttpFoundation\Response { // test the request is correct try { @@ -560,7 +560,7 @@ class ParticipationController extends AbstractController Request $request, Participation $participation, bool $multiple = false - ): \Chill\EventBundle\Entity\Participation|array { + ): array|\Chill\EventBundle\Entity\Participation { $em = $this->getDoctrine()->getManager(); if ($em->contains($participation)) { @@ -637,7 +637,7 @@ class ParticipationController extends AbstractController * * @return Response|\Symfony\Component\HttpFoundation\RedirectResponse */ - protected function newMultiple(Request $request): \Symfony\Component\HttpFoundation\Response|\Symfony\Component\HttpFoundation\RedirectResponse + protected function newMultiple(Request $request): \Symfony\Component\HttpFoundation\RedirectResponse|\Symfony\Component\HttpFoundation\Response { $participations = $this->handleRequest($request, new Participation(), true); $ignoredParticipations = $newParticipations = []; diff --git a/src/Bundle/ChillEventBundle/Entity/Event.php b/src/Bundle/ChillEventBundle/Entity/Event.php index 17f7899fc..b2e00c24e 100644 --- a/src/Bundle/ChillEventBundle/Entity/Event.php +++ b/src/Bundle/ChillEventBundle/Entity/Event.php @@ -135,7 +135,7 @@ class Event implements HasCenterInterface, HasScopeInterface return $this->id; } - public function getModerator(): User|null + public function getModerator(): null|User { return $this->moderator; } diff --git a/src/Bundle/ChillMainBundle/Command/LoadPostalCodesCommand.php b/src/Bundle/ChillMainBundle/Command/LoadPostalCodesCommand.php index 6b6bfa8e0..c68cf6762 100644 --- a/src/Bundle/ChillMainBundle/Command/LoadPostalCodesCommand.php +++ b/src/Bundle/ChillMainBundle/Command/LoadPostalCodesCommand.php @@ -96,7 +96,7 @@ class LoadPostalCodesCommand extends Command try { $this->addPostalCode($row, $output); ++$num; - } catch (ExistingPostalCodeException|CountryCodeNotFoundException|PostalCodeNotValidException $ex) { + } catch (CountryCodeNotFoundException|ExistingPostalCodeException|PostalCodeNotValidException $ex) { $output->writeln(' on line ' . $line . ' : ' . $ex->getMessage() . ''); } ++$line; diff --git a/src/Bundle/ChillMainBundle/Controller/PasswordController.php b/src/Bundle/ChillMainBundle/Controller/PasswordController.php index 1c1d11f84..dc0856cc0 100644 --- a/src/Bundle/ChillMainBundle/Controller/PasswordController.php +++ b/src/Bundle/ChillMainBundle/Controller/PasswordController.php @@ -99,7 +99,7 @@ class PasswordController extends AbstractController * @return Response|\Symfony\Component\HttpFoundation\RedirectResponse * @\Symfony\Component\Routing\Annotation\Route(path="/public/{_locale}/password/recover", name="password_recover") */ - public function recoverAction(Request $request): \Symfony\Component\HttpFoundation\Response|\Symfony\Component\HttpFoundation\RedirectResponse + public function recoverAction(Request $request): \Symfony\Component\HttpFoundation\RedirectResponse|\Symfony\Component\HttpFoundation\Response { if (false === $this->isGranted(PasswordRecoverVoter::ASK_TOKEN)) { return new Response($this->translator->trans('You are not allowed ' @@ -168,7 +168,7 @@ class PasswordController extends AbstractController * @return Response|\Symfony\Component\HttpFoundation\RedirectResponse * @\Symfony\Component\Routing\Annotation\Route(path="/public/{_locale}/password/request-recover", name="password_request_recover") */ - public function requestRecoverAction(Request $request): \Symfony\Component\HttpFoundation\Response|\Symfony\Component\HttpFoundation\RedirectResponse + public function requestRecoverAction(Request $request): \Symfony\Component\HttpFoundation\RedirectResponse|\Symfony\Component\HttpFoundation\Response { if (false === $this->isGranted(PasswordRecoverVoter::ASK_TOKEN)) { return new Response($this->translator->trans('You are not allowed ' diff --git a/src/Bundle/ChillMainBundle/Doctrine/DQL/Extract.php b/src/Bundle/ChillMainBundle/Doctrine/DQL/Extract.php index a63f04164..6fc763c6d 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 \Doctrine\ORM\Query\AST\Node|string|null $value = null; + private null|\Doctrine\ORM\Query\AST\Node|string $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 95d851790..7d93071b7 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 \Doctrine\ORM\Query\AST\Node|string|null $element = null; + private null|\Doctrine\ORM\Query\AST\Node|string $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 ef150867e..a5e73209d 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 \Doctrine\ORM\Query\AST\Node|string|null $fmt = null; + private null|\Doctrine\ORM\Query\AST\Node|string $fmt = null; public function getSql(SqlWalker $sqlWalker) { diff --git a/src/Bundle/ChillMainBundle/Export/ExportFormHelper.php b/src/Bundle/ChillMainBundle/Export/ExportFormHelper.php index e21ea7f4d..8d9320424 100644 --- a/src/Bundle/ChillMainBundle/Export/ExportFormHelper.php +++ b/src/Bundle/ChillMainBundle/Export/ExportFormHelper.php @@ -28,7 +28,7 @@ final readonly class ExportFormHelper private FormFactoryInterface $formFactory, ) {} - public function getDefaultData(string $step, ExportInterface|DirectExportInterface $export, array $options = []): array + public function getDefaultData(string $step, DirectExportInterface|ExportInterface $export, array $options = []): array { return match ($step) { 'centers', 'generate_centers' => ['centers' => $this->authorizationHelper->getReachableCenters($export->requiredRole())], @@ -45,7 +45,7 @@ final readonly class ExportFormHelper return $formatter->getFormDefaultData($options['aggregator_aliases']); } - private function getDefaultDataStepExport(ExportInterface|DirectExportInterface $export, array $options): array + private function getDefaultDataStepExport(DirectExportInterface|ExportInterface $export, array $options): array { $data = [ ExportType::EXPORT_KEY => $export->getFormDefaultData(), diff --git a/src/Bundle/ChillMainBundle/Export/ExportManager.php b/src/Bundle/ChillMainBundle/Export/ExportManager.php index 612ff4140..dae3f7de3 100644 --- a/src/Bundle/ChillMainBundle/Export/ExportManager.php +++ b/src/Bundle/ChillMainBundle/Export/ExportManager.php @@ -101,7 +101,7 @@ class ExportManager * * @return FilterInterface[] a \Generator that contains filters. The key is the filter's alias */ - public function &getFiltersApplyingOn(ExportInterface|DirectExportInterface $export, ?array $centers = null): iterable + public function &getFiltersApplyingOn(DirectExportInterface|ExportInterface $export, ?array $centers = null): iterable { if ($export instanceof DirectExportInterface) { return; @@ -124,7 +124,7 @@ class ExportManager * * @return null|iterable a \Generator that contains aggretagors. The key is the filter's alias */ - public function &getAggregatorsApplyingOn(ExportInterface|DirectExportInterface $export, ?array $centers = null): ?iterable + public function &getAggregatorsApplyingOn(DirectExportInterface|ExportInterface $export, ?array $centers = null): ?iterable { if ($export instanceof ListInterface || $export instanceof DirectExportInterface) { return; @@ -307,7 +307,7 @@ class ExportManager * * @throws RuntimeException */ - public function getExport($alias): ExportInterface|DirectExportInterface + public function getExport($alias): DirectExportInterface|ExportInterface { if (!array_key_exists($alias, $this->exports)) { throw new RuntimeException("The export with alias {$alias} is not known."); @@ -453,7 +453,7 @@ class ExportManager * */ public function isGrantedForElement( - ExportInterface|DirectExportInterface|ModifierInterface $element, + DirectExportInterface|ExportInterface|ModifierInterface $element, \Chill\MainBundle\Export\DirectExportInterface|\Chill\MainBundle\Export\ExportInterface $export = null, ?array $centers = null ): bool { diff --git a/src/Bundle/ChillMainBundle/Security/Authorization/AuthorizationHelper.php b/src/Bundle/ChillMainBundle/Security/Authorization/AuthorizationHelper.php index 574d98b90..413492915 100644 --- a/src/Bundle/ChillMainBundle/Security/Authorization/AuthorizationHelper.php +++ b/src/Bundle/ChillMainBundle/Security/Authorization/AuthorizationHelper.php @@ -66,7 +66,7 @@ class AuthorizationHelper implements AuthorizationHelperInterface * * @return User[] */ - public function findUsersReaching(string $role, array|\Chill\MainBundle\Entity\Center $center, array|\Chill\MainBundle\Entity\Scope|null $scope = null, bool $onlyEnabled = true): array + public function findUsersReaching(string $role, array|\Chill\MainBundle\Entity\Center $center, null|array|\Chill\MainBundle\Entity\Scope $scope = null, bool $onlyEnabled = true): array { return $this->userACLAwareRepository ->findUsersByReachedACL($role, $center, $scope, $onlyEnabled); @@ -130,7 +130,7 @@ class AuthorizationHelper implements AuthorizationHelperInterface * @param Center|Center[] $center * @return Scope[] */ - public function getReachableCircles(UserInterface $user, string $role, \Chill\MainBundle\Entity\Center|array $center) + public function getReachableCircles(UserInterface $user, string $role, array|\Chill\MainBundle\Entity\Center $center) { $scopes = []; @@ -162,7 +162,7 @@ class AuthorizationHelper implements AuthorizationHelperInterface /** * Return all reachable scope for a given user, center and role. */ - public function getReachableScopes(UserInterface $user, string $role, Center|array $center): array + public function getReachableScopes(UserInterface $user, string $role, array|Center $center): array { return $this->getReachableCircles($user, $role, $center); } @@ -172,7 +172,7 @@ class AuthorizationHelper implements AuthorizationHelperInterface * * @param Center|Center[] $center May be an array of center */ - public function userCanReachCenter(User $user, \Chill\MainBundle\Entity\Center|array $center): bool + public function userCanReachCenter(User $user, array|\Chill\MainBundle\Entity\Center $center): bool { if ($center instanceof Traversable) { foreach ($center as $c) { diff --git a/src/Bundle/ChillMainBundle/Security/Authorization/AuthorizationHelperInterface.php b/src/Bundle/ChillMainBundle/Security/Authorization/AuthorizationHelperInterface.php index 1dc9668ec..2a8c6587c 100644 --- a/src/Bundle/ChillMainBundle/Security/Authorization/AuthorizationHelperInterface.php +++ b/src/Bundle/ChillMainBundle/Security/Authorization/AuthorizationHelperInterface.php @@ -29,5 +29,5 @@ interface AuthorizationHelperInterface * @param Center|array
$center * @return list */ - public function getReachableScopes(UserInterface $user, string $role, Center|array $center): array; + public function getReachableScopes(UserInterface $user, string $role, array|Center $center): array; } diff --git a/src/Bundle/ChillMainBundle/Security/Resolver/ScopeResolverDispatcher.php b/src/Bundle/ChillMainBundle/Security/Resolver/ScopeResolverDispatcher.php index afec7c6ad..a4a464e45 100644 --- a/src/Bundle/ChillMainBundle/Security/Resolver/ScopeResolverDispatcher.php +++ b/src/Bundle/ChillMainBundle/Security/Resolver/ScopeResolverDispatcher.php @@ -32,7 +32,7 @@ final readonly class ScopeResolverDispatcher return false; } - public function resolveScope(mixed $entity, ?array $options = []): iterable|\Chill\MainBundle\Entity\Scope|null + public function resolveScope(mixed $entity, ?array $options = []): null|\Chill\MainBundle\Entity\Scope|iterable { foreach ($this->resolvers as $resolver) { if ($resolver->supports($entity, $options)) { diff --git a/src/Bundle/ChillMainBundle/Serializer/Normalizer/DiscriminatedObjectDenormalizer.php b/src/Bundle/ChillMainBundle/Serializer/Normalizer/DiscriminatedObjectDenormalizer.php index 58dc7e839..4149e387b 100644 --- a/src/Bundle/ChillMainBundle/Serializer/Normalizer/DiscriminatedObjectDenormalizer.php +++ b/src/Bundle/ChillMainBundle/Serializer/Normalizer/DiscriminatedObjectDenormalizer.php @@ -45,7 +45,7 @@ class DiscriminatedObjectDenormalizer implements ContextAwareDenormalizerInterfa if ($this->denormalizer->supportsDenormalization($data, $localType, $format)) { try { return $this->denormalizer->denormalize($data, $localType, $format, $context); - } catch (RuntimeException|NotNormalizableValueException $e) { + } catch (NotNormalizableValueException|RuntimeException $e) { $lastException = $e; } } diff --git a/src/Bundle/ChillPersonBundle/Doctrine/DQL/AddressPart.php b/src/Bundle/ChillPersonBundle/Doctrine/DQL/AddressPart.php index 229a69f2c..38d13ea43 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 \Doctrine\ORM\Query\AST\Node|string|null $date = null; + private null|\Doctrine\ORM\Query\AST\Node|string $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 2224f307b..e074f53ef 100644 --- a/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod.php +++ b/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod.php @@ -977,7 +977,7 @@ class AccompanyingPeriod implements /** * @Groups({"read"}) */ - public function getRequestor(): Person|ThirdParty|null + public function getRequestor(): null|Person|ThirdParty { return $this->requestorPerson ?? $this->requestorThirdParty; } diff --git a/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/Resource.php b/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/Resource.php index c9f1e9279..abe171df1 100644 --- a/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/Resource.php +++ b/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/Resource.php @@ -96,7 +96,7 @@ class Resource /** * @Groups({"read"}) */ - public function getResource(): \Chill\PersonBundle\Entity\Person|\Chill\ThirdPartyBundle\Entity\ThirdParty|null + public function getResource(): null|\Chill\PersonBundle\Entity\Person|\Chill\ThirdPartyBundle\Entity\ThirdParty { return $this->person ?? $this->thirdParty; } diff --git a/src/Bundle/ChillPersonBundle/Entity/Person.php b/src/Bundle/ChillPersonBundle/Entity/Person.php index 832afb987..3265f09e1 100644 --- a/src/Bundle/ChillPersonBundle/Entity/Person.php +++ b/src/Bundle/ChillPersonBundle/Entity/Person.php @@ -619,7 +619,7 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI * @return true | array True if the accompanying periods are not collapsing, * an array with data for displaying the error */ - public function checkAccompanyingPeriodsAreNotCollapsing(): bool|array + public function checkAccompanyingPeriodsAreNotCollapsing(): array|bool { $periods = $this->getAccompanyingPeriodsOrdered(); $periodsNbr = count($periods); diff --git a/src/Bundle/ChillPersonBundle/Entity/SocialWork/SocialAction.php b/src/Bundle/ChillPersonBundle/Entity/SocialWork/SocialAction.php index a5475263e..f98964fcb 100644 --- a/src/Bundle/ChillPersonBundle/Entity/SocialWork/SocialAction.php +++ b/src/Bundle/ChillPersonBundle/Entity/SocialWork/SocialAction.php @@ -156,7 +156,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(\Doctrine\Common\Collections\Collection|array $socialActions): Collection + public static function findAncestorSocialActions(array|\Doctrine\Common\Collections\Collection $socialActions): Collection { $ancestors = new ArrayCollection(); @@ -236,7 +236,7 @@ class SocialAction /** * @param Collection|SocialAction[] $socialActions */ - public static function getDescendantsWithThisForActions(\Doctrine\Common\Collections\Collection|array $socialActions): Collection + public static function getDescendantsWithThisForActions(array|\Doctrine\Common\Collections\Collection $socialActions): Collection { $unique = []; @@ -420,7 +420,7 @@ class SocialAction return $this; } - public static function filterRemoveDeactivatedActions(ReadableCollection|array $actions, \DateTime $comparisonDate): ReadableCollection|array + public static function filterRemoveDeactivatedActions(array|ReadableCollection $actions, \DateTime $comparisonDate): array|ReadableCollection { $filterFn = fn (SocialAction $socialAction) => !$socialAction->isDesactivated($comparisonDate); diff --git a/src/Bundle/ChillPersonBundle/Entity/SocialWork/SocialIssue.php b/src/Bundle/ChillPersonBundle/Entity/SocialWork/SocialIssue.php index 5c9f1a9c4..000d83397 100644 --- a/src/Bundle/ChillPersonBundle/Entity/SocialWork/SocialIssue.php +++ b/src/Bundle/ChillPersonBundle/Entity/SocialWork/SocialIssue.php @@ -110,7 +110,7 @@ class SocialIssue * * @return Collection|SocialIssue[] */ - public static function findAncestorSocialIssues(\Doctrine\Common\Collections\Collection|array $socialIssues): Collection + public static function findAncestorSocialIssues(array|\Doctrine\Common\Collections\Collection $socialIssues): Collection { $ancestors = new ArrayCollection(); diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/JobWorkingOnCourseAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/JobWorkingOnCourseAggregator.php index ad38b4a6b..b42bb0cd5 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/JobWorkingOnCourseAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/JobWorkingOnCourseAggregator.php @@ -81,7 +81,7 @@ final readonly class JobWorkingOnCourseAggregator implements AggregatorInterface public function getLabels($key, array $values, $data): \Closure { - return function (int|string|null $jobId) { + return function (null|int|string $jobId) { if (null === $jobId || '' === $jobId) { return ''; } diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/ScopeWorkingOnCourseAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/ScopeWorkingOnCourseAggregator.php index fbc4947bf..f0dcff515 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/ScopeWorkingOnCourseAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/ScopeWorkingOnCourseAggregator.php @@ -81,7 +81,7 @@ final readonly class ScopeWorkingOnCourseAggregator implements AggregatorInterfa public function getLabels($key, array $values, $data): \Closure { - return function (int|string|null $scopeId) { + return function (null|int|string $scopeId) { if (null === $scopeId || '' === $scopeId) { return ''; } diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/UserWorkingOnCourseAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/UserWorkingOnCourseAggregator.php index 862a2de79..b36795cdd 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/UserWorkingOnCourseAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/UserWorkingOnCourseAggregator.php @@ -41,7 +41,7 @@ final readonly class UserWorkingOnCourseAggregator implements AggregatorInterfac public function getLabels($key, array $values, $data): \Closure { - return function (int|string|null $userId) { + return function (null|int|string $userId) { if (null === $userId || '' === $userId) { return ''; } diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/CenterAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/CenterAggregator.php index 99187264a..c6d8cfae0 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/CenterAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/CenterAggregator.php @@ -46,7 +46,7 @@ final readonly class CenterAggregator implements AggregatorInterface public function getLabels($key, array $values, $data): Closure { - return function (int|string|null $value) { + return function (null|int|string $value) { if (null === $value || '' === $value) { return ''; } diff --git a/src/Bundle/ChillPersonBundle/Serializer/Normalizer/AccompanyingPeriodWorkNormalizer.php b/src/Bundle/ChillPersonBundle/Serializer/Normalizer/AccompanyingPeriodWorkNormalizer.php index f6faeed12..86e94f52e 100644 --- a/src/Bundle/ChillPersonBundle/Serializer/Normalizer/AccompanyingPeriodWorkNormalizer.php +++ b/src/Bundle/ChillPersonBundle/Serializer/Normalizer/AccompanyingPeriodWorkNormalizer.php @@ -37,7 +37,7 @@ class AccompanyingPeriodWorkNormalizer implements ContextAwareNormalizerInterfac * * @throws ExceptionInterface */ - public function normalize($object, ?string $format = null, array $context = []): array|\ArrayObject|bool|float|int|string|null + public function normalize($object, ?string $format = null, array $context = []): null|array|\ArrayObject|bool|float|int|string { $initial = $this->normalizer->normalize($object, $format, array_merge( $context, diff --git a/src/Bundle/ChillPersonBundle/Tests/Repository/AccompanyingPeriodACLAwareRepositoryTest.php b/src/Bundle/ChillPersonBundle/Tests/Repository/AccompanyingPeriodACLAwareRepositoryTest.php index 050a839e6..83335c02a 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Repository/AccompanyingPeriodACLAwareRepositoryTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Repository/AccompanyingPeriodACLAwareRepositoryTest.php @@ -518,7 +518,7 @@ class AccompanyingPeriodACLAwareRepositoryTest extends KernelTestCase /** * @param array $scopes */ - private function buildPeriod(Person $person, array $scopes, User|null $creator, bool $confirm): AccompanyingPeriod + private function buildPeriod(Person $person, array $scopes, null|User $creator, bool $confirm): AccompanyingPeriod { $period = new AccompanyingPeriod(); $period->addPerson($person); diff --git a/src/Bundle/ChillReportBundle/DataFixtures/ORM/LoadReports.php b/src/Bundle/ChillReportBundle/DataFixtures/ORM/LoadReports.php index 80c1edd87..3593b612c 100644 --- a/src/Bundle/ChillReportBundle/DataFixtures/ORM/LoadReports.php +++ b/src/Bundle/ChillReportBundle/DataFixtures/ORM/LoadReports.php @@ -165,7 +165,7 @@ final class LoadReports extends AbstractFixture implements OrderedFixtureInterfa * * @return string|string[] */ - private function getRandomChoice(CustomField $field): string|array + private function getRandomChoice(CustomField $field): array|string { $choices = $field->getOptions()['choices']; $multiple = $field->getOptions()['multiple']; diff --git a/src/Bundle/ChillTaskBundle/Security/Authorization/AuthorizationEvent.php b/src/Bundle/ChillTaskBundle/Security/Authorization/AuthorizationEvent.php index 203963d80..de8b52c4c 100644 --- a/src/Bundle/ChillTaskBundle/Security/Authorization/AuthorizationEvent.php +++ b/src/Bundle/ChillTaskBundle/Security/Authorization/AuthorizationEvent.php @@ -27,7 +27,7 @@ class AuthorizationEvent extends \Symfony\Contracts\EventDispatcher\Event protected $vote; public function __construct( - private readonly Person|AbstractTask|AccompanyingPeriod|null $subject, + private readonly null|AbstractTask|AccompanyingPeriod|Person $subject, private readonly string $attribute, private readonly TokenInterface $token ) {} diff --git a/src/Bundle/ChillWopiBundle/src/Controller/Convert.php b/src/Bundle/ChillWopiBundle/src/Controller/Convert.php index 665386ffe..c4702c2b2 100644 --- a/src/Bundle/ChillWopiBundle/src/Controller/Convert.php +++ b/src/Bundle/ChillWopiBundle/src/Controller/Convert.php @@ -78,7 +78,7 @@ class Convert return new Response($response->getContent(), Response::HTTP_OK, [ 'Content-Type' => 'application/pdf', ]); - } catch (ClientExceptionInterface|TransportExceptionInterface|RedirectionExceptionInterface|ServerExceptionInterface $exception) { + } catch (ClientExceptionInterface|RedirectionExceptionInterface|ServerExceptionInterface|TransportExceptionInterface $exception) { return $this->onConversionFailed($url, $exception->getResponse()); } }