From 036fe8d6f868d1878b5eba5900d7014e1ad2371a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Wed, 7 Feb 2024 10:43:53 +0100 Subject: [PATCH] upgrade php-cs 3.49 --- .../ByActivityTypeAggregator.php | 2 +- .../Aggregator/ActivityPresenceAggregator.php | 2 +- .../Aggregator/ActivityTypeAggregator.php | 2 +- .../ActivityDocumentACLAwareRepository.php | 8 +- ...ityDocumentACLAwareRepositoryInterface.php | 4 +- .../Repository/ActivityPresenceRepository.php | 2 +- .../ActivityPresenceRepositoryInterface.php | 2 +- .../Repository/ActivityTypeRepository.php | 2 +- ...anyingPeriodActivityGenericDocProvider.php | 4 +- .../PersonActivityGenericDocProvider.php | 2 +- .../Authorization/ActivityVoterTest.php | 2 +- .../Controller/AsideActivityController.php | 2 +- .../AsideActivityCategoryRepository.php | 2 +- .../Entity/AbstractElement.php | 4 +- .../Repository/ChargeKindRepository.php | 2 +- .../ChargeKindRepositoryInterface.php | 2 +- .../Repository/ResourceKindRepository.php | 2 +- .../ResourceKindRepositoryInterface.php | 2 +- .../migrations/Version20221207105407.php | 2 +- .../Exception/UserAbsenceSyncException.php | 2 +- .../Connector/MSGraph/MSUserAbsenceReader.php | 2 +- .../MSGraph/MSUserAbsenceReaderInterface.php | 2 +- .../Connector/MSGraph/MachineHttpClient.php | 4 +- .../Connector/MSGraph/MapCalendarToUser.php | 4 +- .../MSGraph/OnBehalfOfUserHttpClient.php | 4 +- .../MSGraphRemoteCalendarConnector.php | 2 +- .../Connector/NullRemoteCalendarConnector.php | 2 +- .../RemoteCalendarConnectorInterface.php | 2 +- .../Repository/CalendarACLAwareRepository.php | 4 +- .../CalendarACLAwareRepositoryInterface.php | 4 +- .../Repository/CalendarDocRepository.php | 2 +- .../CalendarDocRepositoryInterface.php | 2 +- .../Repository/CalendarRangeRepository.php | 6 +- .../Repository/CalendarRepository.php | 10 +-- .../Repository/InviteRepository.php | 2 +- ...anyingPeriodCalendarGenericDocProvider.php | 4 +- .../PersonCalendarGenericDocProvider.php | 4 +- .../DocGenerator/CalendarContextTest.php | 4 +- .../CustomFieldsGroupController.php | 2 +- .../CustomFields/CustomFieldChoice.php | 4 +- .../Entity/CustomField.php | 2 +- .../Entity/CustomFieldLongChoice/Option.php | 2 +- .../Entity/CustomFieldsGroup.php | 2 +- .../Service/CustomFieldProvider.php | 2 +- .../GeneratorDriver/DriverInterface.php | 2 +- .../Exception/TemplateException.php | 2 +- .../GeneratorDriver/RelatorioDriver.php | 2 +- .../DocGeneratorTemplateRepository.php | 4 +- .../Helper/NormalizeNullValueHelper.php | 2 +- .../Service/Context/BaseContextData.php | 2 +- .../Service/Generator/Generator.php | 6 +- .../Service/Generator/GeneratorException.php | 2 +- .../Service/Generator/GeneratorInterface.php | 6 +- .../RelatedEntityNotFoundException.php | 2 +- .../Service/Context/BaseContextDataTest.php | 2 +- .../ChillDocStoreBundle/Entity/Document.php | 2 +- ...ForAccompanyingPeriodProviderInterface.php | 8 +- .../GenericDocForPersonProviderInterface.php | 8 +- .../GenericDoc/Manager.php | 30 +++---- ...anyingCourseDocumentGenericDocProvider.php | 6 +- .../PersonDocumentGenericDocProvider.php | 10 +-- .../AccompanyingCourseDocumentRepository.php | 2 +- .../Repository/DocumentCategoryRepository.php | 2 +- .../PersonDocumentACLAwareRepository.php | 8 +- ...sonDocumentACLAwareRepositoryInterface.php | 12 +-- .../Repository/PersonDocumentRepository.php | 2 +- .../Repository/StoredObjectRepository.php | 2 +- .../WopiEditTwigExtensionRuntime.php | 6 +- .../Tests/GenericDoc/ManagerTest.php | 4 +- ...ngCourseDocumentGenericDocProviderTest.php | 2 +- .../PersonDocumentACLAwareRepositoryTest.php | 8 +- .../Tests/StoredObjectManagerTest.php | 4 +- src/Bundle/ChillEventBundle/Entity/Event.php | 2 +- .../ChillEventBundle/Entity/Participation.php | 14 ++-- src/Bundle/ChillEventBundle/Entity/Role.php | 2 +- src/Bundle/ChillEventBundle/Entity/Status.php | 2 +- .../Form/ChoiceLoader/EventChoiceLoader.php | 2 +- .../CRUD/Controller/CRUDController.php | 12 +-- .../Controller/ExportController.php | 6 +- .../Controller/PermissionsGroupController.php | 2 +- .../Controller/UserController.php | 6 +- .../ChillMainBundle/Cron/CronJobInterface.php | 2 +- .../ChillMainBundle/Cron/CronManager.php | 2 +- .../Cron/CronManagerInterface.php | 2 +- .../ORM/LoadAddressReferences.php | 2 +- .../DataFixtures/ORM/LoadCountries.php | 2 +- .../DataFixtures/ORM/LoadLanguages.php | 2 +- .../DataFixtures/ORM/LoadLocationType.php | 2 +- .../DataFixtures/ORM/LoadUsers.php | 2 +- .../ChillMainBundle/Doctrine/DQL/Extract.php | 2 +- .../Doctrine/DQL/JsonExtract.php | 2 +- .../ChillMainBundle/Doctrine/DQL/ToChar.php | 2 +- .../Hydration/FlatHierarchyEntityHydrator.php | 2 +- src/Bundle/ChillMainBundle/Entity/Address.php | 6 +- .../Entity/AddressReference.php | 2 +- .../ChillMainBundle/Entity/PostalCode.php | 2 +- .../ChillMainBundle/Entity/RoleScope.php | 4 +- src/Bundle/ChillMainBundle/Entity/User.php | 4 +- .../Entity/User/UserJobHistory.php | 4 +- .../Entity/User/UserScopeHistory.php | 4 +- .../ChillMainBundle/Export/ExportManager.php | 8 +- .../Export/Helper/UserHelper.php | 2 +- .../ChoiceLoader/PostalCodeChoiceLoader.php | 2 +- .../IdToEntityDataTransformer.php | 2 +- .../ChillMainBundle/Notification/Mailer.php | 2 +- .../Pagination/PaginatorFactory.php | 4 +- .../PhoneNumberHelperInterface.php | 2 +- .../Phonenumber/PhonenumberHelper.php | 2 +- .../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/UserJobRepository.php | 2 +- .../Repository/UserJobRepositoryInterface.php | 2 +- .../Repository/UserRepository.php | 10 +-- .../Repository/UserRepositoryInterface.php | 6 +- .../Workflow/EntityWorkflowRepository.php | 12 +-- .../Workflow/EntityWorkflowStepRepository.php | 4 +- .../ChillMainBundle/Routing/MenuTwig.php | 2 +- .../Search/SearchApiNoQueryException.php | 2 +- .../Authorization/AuthorizationHelper.php | 4 +- .../AuthorizationHelperForCurrentUser.php | 2 +- ...orizationHelperForCurrentUserInterface.php | 2 +- .../AuthorizationHelperInterface.php | 2 +- .../Resolver/ScopeResolverDispatcher.php | 2 +- .../CommentEmbeddableDocGenNormalizer.php | 4 +- .../Normalizer/EntityWorkflowNormalizer.php | 4 +- .../EntityWorkflowStepNormalizer.php | 4 +- .../Normalizer/NotificationNormalizer.php | 4 +- .../Normalizer/PhonenumberNormalizer.php | 4 +- .../PrivateCommentEmbeddableNormalizer.php | 6 +- ...ddressWithReferenceOrPostalCodeCronJob.php | 2 +- ...eographicalUnitMaterializedViewCronJob.php | 2 +- .../Import/AddressReferenceBaseImporter.php | 6 +- .../Import/GeographicalUnitBaseImporter.php | 2 +- .../Service/Mailer/ChillMailer.php | 2 +- .../Templating/Listing/FilterOrderHelper.php | 4 +- .../Listing/FilterOrderHelperBuilder.php | 4 +- .../Cron/CronJobDatabaseInteractionTest.php | 2 +- .../Tests/Cron/CronManagerTest.php | 4 +- .../Tests/Export/ExportManagerTest.php | 10 +-- .../Tests/Export/SortExportElementTest.php | 2 +- .../Email/NotificationMailerTest.php | 2 +- .../Normalizer/DateNormalizerTest.php | 2 +- .../Normalizer/UserNormalizerTest.php | 6 +- .../Util/DateRangeCovering.php | 4 +- .../Workflow/Helper/MetadataExtractor.php | 2 +- .../AccompanyingPeriodStepChangeCronjob.php | 2 +- .../AccompanyingPeriodStepChanger.php | 2 +- .../ReassignAccompanyingPeriodController.php | 2 +- .../SocialWork/SocialIssueController.php | 2 +- .../Doctrine/DQL/AddressPart.php | 2 +- .../Entity/AccompanyingPeriod.php | 22 ++--- .../AccompanyingPeriodLocationHistory.php | 10 +-- .../AccompanyingPeriodStepHistory.php | 2 +- .../AccompanyingPeriodWork.php | 16 ++-- .../Entity/AccompanyingPeriod/Resource.php | 4 +- .../Entity/AccompanyingPeriod/UserHistory.php | 2 +- .../ChillPersonBundle/Entity/HasPerson.php | 2 +- .../Entity/Household/Household.php | 24 +++--- .../Entity/Household/HouseholdMember.php | 4 +- .../ChillPersonBundle/Entity/Person.php | 24 +++--- .../Entity/Person/PersonCenterCurrent.php | 2 +- .../Entity/Person/PersonResource.php | 6 +- .../Entity/PersonAltName.php | 2 +- .../ClosingDateAggregator.php | 2 +- .../JobWorkingOnCourseAggregator.php | 2 +- .../OpeningDateAggregator.php | 2 +- .../ScopeWorkingOnCourseAggregator.php | 2 +- .../UserWorkingOnCourseAggregator.php | 2 +- .../ChildrenNumberAggregator.php | 2 +- .../PersonAggregators/CenterAggregator.php | 2 +- .../PostalCodeAggregator.php | 2 +- .../Export/Helper/LabelPersonHelper.php | 2 +- .../Form/ChoiceLoader/PersonChoiceLoader.php | 2 +- .../ChillPersonBundle/Form/PersonType.php | 2 +- .../Household/MembersEditor.php | 2 +- .../Household/MembersEditorFactory.php | 2 +- .../AccompanyingPeriodInfoRepository.php | 2 +- ...PeriodWorkEvaluationDocumentRepository.php | 2 +- ...mpanyingPeriodWorkEvaluationRepository.php | 2 +- .../AccompanyingPeriodWorkRepository.php | 4 +- .../ClosingMotiveRepository.php | 2 +- .../AccompanyingPeriodACLAwareRepository.php | 8 +- ...nyingPeriodACLAwareRepositoryInterface.php | 6 +- .../AccompanyingPeriodRepository.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/PersonCenterHistoryRepository.php | 2 +- .../Repository/PersonACLAwareRepository.php | 80 +++++++++---------- .../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 +- ...PeriodWorkEvaluationDocumentNormalizer.php | 4 +- ...mpanyingPeriodWorkEvaluationNormalizer.php | 4 +- .../AccompanyingPeriodWorkNormalizer.php | 4 +- .../Normalizer/WorkflowNormalizer.php | 4 +- ...PeriodWorkEvaluationGenericDocProvider.php | 6 +- .../Events/PersonMoveEventSubscriberTest.php | 8 +- .../Controller/PersonControllerCreateTest.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 +- .../Authorization/ReportVoterTest.php | 4 +- .../migrations/Version20150622233319.php | 2 +- .../ChillTaskBundle/Entity/AbstractTask.php | 2 +- .../ChillTaskBundle/Entity/SingleTask.php | 8 +- .../SingleTaskAclAwareRepository.php | 24 +++--- .../SingleTaskAclAwareRepositoryInterface.php | 16 ++-- .../Repository/SingleTaskRepository.php | 4 +- .../Authorization/AuthorizationEvent.php | 2 +- .../Templating/TaskTwigExtension.php | 2 +- .../Workflow/TaskWorkflowManager.php | 2 +- .../Controller/ThirdPartyController.php | 6 +- .../Entity/ThirdParty.php | 10 +-- .../ThirdPartyACLAwareRepository.php | 6 +- .../Repository/ThirdPartyRepository.php | 4 +- .../src/Service/Controller/Responder.php | 2 +- .../Service/Controller/ResponderInterface.php | 2 +- 257 files changed, 605 insertions(+), 605 deletions(-) diff --git a/src/Bundle/ChillActivityBundle/Export/Aggregator/ACPAggregators/ByActivityTypeAggregator.php b/src/Bundle/ChillActivityBundle/Export/Aggregator/ACPAggregators/ByActivityTypeAggregator.php index d8551c11d..0f41547d9 100644 --- a/src/Bundle/ChillActivityBundle/Export/Aggregator/ACPAggregators/ByActivityTypeAggregator.php +++ b/src/Bundle/ChillActivityBundle/Export/Aggregator/ACPAggregators/ByActivityTypeAggregator.php @@ -57,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/ActivityPresenceAggregator.php b/src/Bundle/ChillActivityBundle/Export/Aggregator/ActivityPresenceAggregator.php index a22a75189..392ff5b19 100644 --- a/src/Bundle/ChillActivityBundle/Export/Aggregator/ActivityPresenceAggregator.php +++ b/src/Bundle/ChillActivityBundle/Export/Aggregator/ActivityPresenceAggregator.php @@ -35,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 0cb185857..d433e6a86 100644 --- a/src/Bundle/ChillActivityBundle/Export/Aggregator/ActivityTypeAggregator.php +++ b/src/Bundle/ChillActivityBundle/Export/Aggregator/ActivityTypeAggregator.php @@ -58,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/Repository/ActivityDocumentACLAwareRepository.php b/src/Bundle/ChillActivityBundle/Repository/ActivityDocumentACLAwareRepository.php index 38bb42e51..0623601a5 100644 --- a/src/Bundle/ChillActivityBundle/Repository/ActivityDocumentACLAwareRepository.php +++ b/src/Bundle/ChillActivityBundle/Repository/ActivityDocumentACLAwareRepository.php @@ -36,14 +36,14 @@ final readonly class ActivityDocumentACLAwareRepository implements ActivityDocum ) { } - 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); @@ -72,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); @@ -123,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/GenericDoc/Providers/AccompanyingPeriodActivityGenericDocProvider.php b/src/Bundle/ChillActivityBundle/Service/GenericDoc/Providers/AccompanyingPeriodActivityGenericDocProvider.php index ff198b345..291ef5832 100644 --- a/src/Bundle/ChillActivityBundle/Service/GenericDoc/Providers/AccompanyingPeriodActivityGenericDocProvider.php +++ b/src/Bundle/ChillActivityBundle/Service/GenericDoc/Providers/AccompanyingPeriodActivityGenericDocProvider.php @@ -37,7 +37,7 @@ final readonly class AccompanyingPeriodActivityGenericDocProvider implements Gen ) { } - 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); @@ -100,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 1b0ed507b..618775452 100644 --- a/src/Bundle/ChillActivityBundle/Service/GenericDoc/Providers/PersonActivityGenericDocProvider.php +++ b/src/Bundle/ChillActivityBundle/Service/GenericDoc/Providers/PersonActivityGenericDocProvider.php @@ -28,7 +28,7 @@ final readonly class PersonActivityGenericDocProvider implements GenericDocForPe ) { } - 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/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/Controller/AsideActivityController.php b/src/Bundle/ChillAsideActivityBundle/src/Controller/AsideActivityController.php index 0a7891a07..6bd2affe7 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/Controller/AsideActivityController.php +++ b/src/Bundle/ChillAsideActivityBundle/src/Controller/AsideActivityController.php @@ -49,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/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/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/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/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/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/RemoteCalendar/Connector/MSGraph/MSUserAbsenceReader.php b/src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/MSGraph/MSUserAbsenceReader.php index 2d1006cca..58cd04dfa 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): 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/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/MapCalendarToUser.php b/src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/MSGraph/MapCalendarToUser.php index 70a0fae55..aa3b1c4a4 100644 --- a/src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/MSGraph/MapCalendarToUser.php +++ b/src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/MSGraph/MapCalendarToUser.php @@ -178,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/MSGraphRemoteCalendarConnector.php b/src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/MSGraphRemoteCalendarConnector.php index 23f83688a..27297f3ac 100644 --- a/src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/MSGraphRemoteCalendarConnector.php +++ b/src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/MSGraphRemoteCalendarConnector.php @@ -171,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 4acb40554..7da67df0c 100644 --- a/src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/NullRemoteCalendarConnector.php +++ b/src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/NullRemoteCalendarConnector.php @@ -46,7 +46,7 @@ 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 { } 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/Repository/CalendarACLAwareRepository.php b/src/Bundle/ChillCalendarBundle/Repository/CalendarACLAwareRepository.php index c91794c6b..a3350a7cd 100644 --- a/src/Bundle/ChillCalendarBundle/Repository/CalendarACLAwareRepository.php +++ b/src/Bundle/ChillCalendarBundle/Repository/CalendarACLAwareRepository.php @@ -159,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'); @@ -178,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/Service/GenericDoc/Providers/AccompanyingPeriodCalendarGenericDocProvider.php b/src/Bundle/ChillCalendarBundle/Service/GenericDoc/Providers/AccompanyingPeriodCalendarGenericDocProvider.php index 7b566a2f1..faca60a67 100644 --- a/src/Bundle/ChillCalendarBundle/Service/GenericDoc/Providers/AccompanyingPeriodCalendarGenericDocProvider.php +++ b/src/Bundle/ChillCalendarBundle/Service/GenericDoc/Providers/AccompanyingPeriodCalendarGenericDocProvider.php @@ -44,7 +44,7 @@ final readonly class AccompanyingPeriodCalendarGenericDocProvider implements Gen /** * @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); @@ -91,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 7b7a8f96d..f088e27ba 100644 --- a/src/Bundle/ChillCalendarBundle/Service/GenericDoc/Providers/PersonCalendarGenericDocProvider.php +++ b/src/Bundle/ChillCalendarBundle/Service/GenericDoc/Providers/PersonCalendarGenericDocProvider.php @@ -40,7 +40,7 @@ final readonly class PersonCalendarGenericDocProvider implements GenericDocForPe ) { } - 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); @@ -74,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/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/Controller/CustomFieldsGroupController.php b/src/Bundle/ChillCustomFieldsBundle/Controller/CustomFieldsGroupController.php index b88a005dc..a218e2cd2 100644 --- a/src/Bundle/ChillCustomFieldsBundle/Controller/CustomFieldsGroupController.php +++ b/src/Bundle/ChillCustomFieldsBundle/Controller/CustomFieldsGroupController.php @@ -363,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 3daee9ecb..b57b45bc9 100644 --- a/src/Bundle/ChillCustomFieldsBundle/CustomFields/CustomFieldChoice.php +++ b/src/Bundle/ChillCustomFieldsBundle/CustomFields/CustomFieldChoice.php @@ -156,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']; } @@ -355,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/Entity/CustomField.php b/src/Bundle/ChillCustomFieldsBundle/Entity/CustomField.php index 93eeafdea..6d1373fb0 100644 --- a/src/Bundle/ChillCustomFieldsBundle/Entity/CustomField.php +++ b/src/Bundle/ChillCustomFieldsBundle/Entity/CustomField.php @@ -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 a17bb5aaf..2d9889066 100644 --- a/src/Bundle/ChillCustomFieldsBundle/Entity/CustomFieldLongChoice/Option.php +++ b/src/Bundle/ChillCustomFieldsBundle/Entity/CustomFieldLongChoice/Option.php @@ -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/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/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/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/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 c7167670d..79cf47be5 100644 --- a/src/Bundle/ChillDocGeneratorBundle/Serializer/Helper/NormalizeNullValueHelper.php +++ b/src/Bundle/ChillDocGeneratorBundle/Serializer/Helper/NormalizeNullValueHelper.php @@ -20,7 +20,7 @@ class NormalizeNullValueHelper { } - 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 28092331f..2773d3816 100644 --- a/src/Bundle/ChillDocGeneratorBundle/Service/Context/BaseContextData.php +++ b/src/Bundle/ChillDocGeneratorBundle/Service/Context/BaseContextData.php @@ -21,7 +21,7 @@ class BaseContextData { } - 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 25b5f9f03..6c9a6f219 100644 --- a/src/Bundle/ChillDocGeneratorBundle/Service/Generator/Generator.php +++ b/src/Bundle/ChillDocGeneratorBundle/Service/Generator/Generator.php @@ -46,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/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/Entity/Document.php b/src/Bundle/ChillDocStoreBundle/Entity/Document.php index d4d6dc945..a56b6b800 100644 --- a/src/Bundle/ChillDocStoreBundle/Entity/Document.php +++ b/src/Bundle/ChillDocStoreBundle/Entity/Document.php @@ -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/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 3ef5d5482..d45f68a38 100644 --- a/src/Bundle/ChillDocStoreBundle/GenericDoc/Providers/AccompanyingCourseDocumentGenericDocProvider.php +++ b/src/Bundle/ChillDocStoreBundle/GenericDoc/Providers/AccompanyingCourseDocumentGenericDocProvider.php @@ -34,7 +34,7 @@ final readonly class AccompanyingCourseDocumentGenericDocProvider implements Gen ) { } - 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); @@ -59,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); @@ -108,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 3345b1c7e..9f4cd4aff 100644 --- a/src/Bundle/ChillDocStoreBundle/GenericDoc/Providers/PersonDocumentGenericDocProvider.php +++ b/src/Bundle/ChillDocStoreBundle/GenericDoc/Providers/PersonDocumentGenericDocProvider.php @@ -32,10 +32,10 @@ final readonly class PersonDocumentGenericDocProvider implements GenericDocForPe 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, @@ -50,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/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 dacd141f3..b43605018 100644 --- a/src/Bundle/ChillDocStoreBundle/Repository/PersonDocumentACLAwareRepository.php +++ b/src/Bundle/ChillDocStoreBundle/Repository/PersonDocumentACLAwareRepository.php @@ -48,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); @@ -114,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); @@ -134,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/Templating/WopiEditTwigExtensionRuntime.php b/src/Bundle/ChillDocStoreBundle/Templating/WopiEditTwigExtensionRuntime.php index 969e4f95e..f833200c8 100644 --- a/src/Bundle/ChillDocStoreBundle/Templating/WopiEditTwigExtensionRuntime.php +++ b/src/Bundle/ChillDocStoreBundle/Templating/WopiEditTwigExtensionRuntime.php @@ -136,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, @@ -153,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/Entity/Event.php b/src/Bundle/ChillEventBundle/Entity/Event.php index 9d7b4d935..b5d013588 100644 --- a/src/Bundle/ChillEventBundle/Entity/Event.php +++ b/src/Bundle/ChillEventBundle/Entity/Event.php @@ -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 37899262f..464feaf30 100644 --- a/src/Bundle/ChillEventBundle/Entity/Participation.php +++ b/src/Bundle/ChillEventBundle/Entity/Participation.php @@ -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 d0e07021e..d51fb87e3 100644 --- a/src/Bundle/ChillEventBundle/Entity/Role.php +++ b/src/Bundle/ChillEventBundle/Entity/Role.php @@ -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 3c4237eb5..59ae93df1 100644 --- a/src/Bundle/ChillEventBundle/Entity/Status.php +++ b/src/Bundle/ChillEventBundle/Entity/Status.php @@ -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/ChillMainBundle/CRUD/Controller/CRUDController.php b/src/Bundle/ChillMainBundle/CRUD/Controller/CRUDController.php index 78e559ad8..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); @@ -463,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); @@ -660,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); @@ -670,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); @@ -934,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/Controller/ExportController.php b/src/Bundle/ChillMainBundle/Controller/ExportController.php index 963e03322..2df7008d6 100644 --- a/src/Bundle/ChillMainBundle/Controller/ExportController.php +++ b/src/Bundle/ChillMainBundle/Controller/ExportController.php @@ -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); @@ -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', [ diff --git a/src/Bundle/ChillMainBundle/Controller/PermissionsGroupController.php b/src/Bundle/ChillMainBundle/Controller/PermissionsGroupController.php index b5fdeca7e..42d0d6a78 100644 --- a/src/Bundle/ChillMainBundle/Controller/PermissionsGroupController.php +++ b/src/Bundle/ChillMainBundle/Controller/PermissionsGroupController.php @@ -400,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/UserController.php b/src/Bundle/ChillMainBundle/Controller/UserController.php index 69e9a5d80..b335b356a 100644 --- a/src/Bundle/ChillMainBundle/Controller/UserController.php +++ b/src/Bundle/ChillMainBundle/Controller/UserController.php @@ -268,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); @@ -281,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) { @@ -325,7 +325,7 @@ class UserController extends CRUDController Request $request, int $totalItems, PaginatorInterface $paginator, - FilterOrderHelper $filterOrder = null + ?FilterOrderHelper $filterOrder = null ) { if (0 === $totalItems) { return []; 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 147d035cd..14878235d 100644 --- a/src/Bundle/ChillMainBundle/Cron/CronManager.php +++ b/src/Bundle/ChillMainBundle/Cron/CronManager.php @@ -58,7 +58,7 @@ final readonly class CronManager implements CronManagerInterface ) { } - 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 68f16cd01..d04ef29e8 100644 --- a/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadAddressReferences.php +++ b/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadAddressReferences.php @@ -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 9f36a315e..3433eebd7 100644 --- a/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadCountries.php +++ b/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadCountries.php @@ -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 70c7e90a9..c5c03277f 100644 --- a/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadLanguages.php +++ b/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadLanguages.php @@ -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 3058ed635..aab896add 100644 --- a/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadLocationType.php +++ b/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadLocationType.php @@ -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 766d2246b..8cb335fba 100644 --- a/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadUsers.php +++ b/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadUsers.php @@ -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/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/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/PostalCode.php b/src/Bundle/ChillMainBundle/Entity/PostalCode.php index b4c246bd5..4d906d6c8 100644 --- a/src/Bundle/ChillMainBundle/Entity/PostalCode.php +++ b/src/Bundle/ChillMainBundle/Entity/PostalCode.php @@ -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 423d0f3ba..d5821c08f 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 $at = null): ?Scope + public function getMainScope(?\DateTimeImmutable $at = null): ?Scope { $at ??= new \DateTimeImmutable('now'); @@ -326,7 +326,7 @@ class User implements UserInterface, \Stringable return $this->salt; } - public function getUserJob(\DateTimeImmutable $at = null): ?UserJob + public function getUserJob(?\DateTimeImmutable $at = null): ?UserJob { $at ??= new \DateTimeImmutable('now'); diff --git a/src/Bundle/ChillMainBundle/Entity/User/UserJobHistory.php b/src/Bundle/ChillMainBundle/Entity/User/UserJobHistory.php index 6bda2afec..7916d9891 100644 --- a/src/Bundle/ChillMainBundle/Entity/User/UserJobHistory.php +++ b/src/Bundle/ChillMainBundle/Entity/User/UserJobHistory.php @@ -84,7 +84,7 @@ class UserJobHistory return $this; } - public function setJob(?UserJob $job): User\UserJobHistory + public function setJob(?UserJob $job): UserJobHistory { $this->job = $job; @@ -98,7 +98,7 @@ class UserJobHistory return $this; } - public function setUser(User $user): User\UserJobHistory + public function setUser(User $user): UserJobHistory { $this->user = $user; diff --git a/src/Bundle/ChillMainBundle/Entity/User/UserScopeHistory.php b/src/Bundle/ChillMainBundle/Entity/User/UserScopeHistory.php index a82599ed6..6ac768de2 100644 --- a/src/Bundle/ChillMainBundle/Entity/User/UserScopeHistory.php +++ b/src/Bundle/ChillMainBundle/Entity/User/UserScopeHistory.php @@ -84,7 +84,7 @@ class UserScopeHistory return $this; } - public function setScope(?Scope $scope): User\UserScopeHistory + public function setScope(?Scope $scope): UserScopeHistory { $this->scope = $scope; @@ -98,7 +98,7 @@ class UserScopeHistory return $this; } - public function setUser(User $user): User\UserScopeHistory + public function setUser(User $user): UserScopeHistory { $this->user = $user; 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/Helper/UserHelper.php b/src/Bundle/ChillMainBundle/Export/Helper/UserHelper.php index 693bb0376..36b126df9 100644 --- a/src/Bundle/ChillMainBundle/Export/Helper/UserHelper.php +++ b/src/Bundle/ChillMainBundle/Export/Helper/UserHelper.php @@ -34,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/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/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/Notification/Mailer.php b/src/Bundle/ChillMainBundle/Notification/Mailer.php index 246480361..d62d6bc75 100644 --- a/src/Bundle/ChillMainBundle/Notification/Mailer.php +++ b/src/Bundle/ChillMainBundle/Notification/Mailer.php @@ -74,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/Pagination/PaginatorFactory.php b/src/Bundle/ChillMainBundle/Pagination/PaginatorFactory.php index 166dcdb68..0daad7283 100644 --- a/src/Bundle/ChillMainBundle/Pagination/PaginatorFactory.php +++ b/src/Bundle/ChillMainBundle/Pagination/PaginatorFactory.php @@ -59,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 9006268bd..d08d393a3 100644 --- a/src/Bundle/ChillMainBundle/Phonenumber/PhonenumberHelper.php +++ b/src/Bundle/ChillMainBundle/Phonenumber/PhonenumberHelper.php @@ -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/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/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/MenuTwig.php b/src/Bundle/ChillMainBundle/Routing/MenuTwig.php index 2989187a8..7431833ab 100644 --- a/src/Bundle/ChillMainBundle/Routing/MenuTwig.php +++ b/src/Bundle/ChillMainBundle/Routing/MenuTwig.php @@ -87,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/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/Security/Authorization/AuthorizationHelper.php b/src/Bundle/ChillMainBundle/Security/Authorization/AuthorizationHelper.php index 7e5d8a325..48c9b836f 100644 --- a/src/Bundle/ChillMainBundle/Security/Authorization/AuthorizationHelper.php +++ b/src/Bundle/ChillMainBundle/Security/Authorization/AuthorizationHelper.php @@ -61,7 +61,7 @@ class AuthorizationHelper implements AuthorizationHelperInterface * * @return User[] */ - public function findUsersReaching(string $role, array|Center $center, array|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); @@ -86,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 []; diff --git a/src/Bundle/ChillMainBundle/Security/Authorization/AuthorizationHelperForCurrentUser.php b/src/Bundle/ChillMainBundle/Security/Authorization/AuthorizationHelperForCurrentUser.php index 4bc07f915..0a9d837a6 100644 --- a/src/Bundle/ChillMainBundle/Security/Authorization/AuthorizationHelperForCurrentUser.php +++ b/src/Bundle/ChillMainBundle/Security/Authorization/AuthorizationHelperForCurrentUser.php @@ -21,7 +21,7 @@ class AuthorizationHelperForCurrentUser implements AuthorizationHelperForCurrent { } - 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/Resolver/ScopeResolverDispatcher.php b/src/Bundle/ChillMainBundle/Security/Resolver/ScopeResolverDispatcher.php index ce1e16862..a61d92b4a 100644 --- a/src/Bundle/ChillMainBundle/Security/Resolver/ScopeResolverDispatcher.php +++ b/src/Bundle/ChillMainBundle/Security/Resolver/ScopeResolverDispatcher.php @@ -37,7 +37,7 @@ final readonly class ScopeResolverDispatcher /** * @return Scope|iterable|Scope|null */ - public function resolveScope(mixed $entity, ?array $options = []): null|iterable|Scope + public function resolveScope(mixed $entity, ?array $options = []): iterable|Scope|null { foreach ($this->resolvers as $resolver) { if ($resolver->supports($entity, $options)) { diff --git a/src/Bundle/ChillMainBundle/Serializer/Normalizer/CommentEmbeddableDocGenNormalizer.php b/src/Bundle/ChillMainBundle/Serializer/Normalizer/CommentEmbeddableDocGenNormalizer.php index e1d692a19..4cf80ccd7 100644 --- a/src/Bundle/ChillMainBundle/Serializer/Normalizer/CommentEmbeddableDocGenNormalizer.php +++ b/src/Bundle/ChillMainBundle/Serializer/Normalizer/CommentEmbeddableDocGenNormalizer.php @@ -32,7 +32,7 @@ class CommentEmbeddableDocGenNormalizer implements ContextAwareNormalizerInterfa * * @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 [ @@ -65,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/EntityWorkflowNormalizer.php b/src/Bundle/ChillMainBundle/Serializer/Normalizer/EntityWorkflowNormalizer.php index df125994d..83e84f7a0 100644 --- a/src/Bundle/ChillMainBundle/Serializer/Normalizer/EntityWorkflowNormalizer.php +++ b/src/Bundle/ChillMainBundle/Serializer/Normalizer/EntityWorkflowNormalizer.php @@ -32,7 +32,7 @@ class EntityWorkflowNormalizer implements NormalizerInterface, NormalizerAwareIn * * @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); @@ -50,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 47ec0427e..46dbd00cc 100644 --- a/src/Bundle/ChillMainBundle/Serializer/Normalizer/EntityWorkflowStepNormalizer.php +++ b/src/Bundle/ChillMainBundle/Serializer/Normalizer/EntityWorkflowStepNormalizer.php @@ -28,7 +28,7 @@ class EntityWorkflowStepNormalizer implements NormalizerAwareInterface, Normaliz /** * @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', @@ -77,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 50b3e33f6..70cd9a838 100644 --- a/src/Bundle/ChillMainBundle/Serializer/Normalizer/NotificationNormalizer.php +++ b/src/Bundle/ChillMainBundle/Serializer/Normalizer/NotificationNormalizer.php @@ -32,7 +32,7 @@ class NotificationNormalizer implements NormalizerAwareInterface, NormalizerInte * * @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()) @@ -53,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 80407a6b1..1d7ee43ce 100644 --- a/src/Bundle/ChillMainBundle/Serializer/Normalizer/PrivateCommentEmbeddableNormalizer.php +++ b/src/Bundle/ChillMainBundle/Serializer/Normalizer/PrivateCommentEmbeddableNormalizer.php @@ -22,7 +22,7 @@ class PrivateCommentEmbeddableNormalizer implements NormalizerInterface, Denorma { } - 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(); @@ -40,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/Service/AddressGeographicalUnit/CollateAddressWithReferenceOrPostalCodeCronJob.php b/src/Bundle/ChillMainBundle/Service/AddressGeographicalUnit/CollateAddressWithReferenceOrPostalCodeCronJob.php index d2c9fc960..0267b126d 100644 --- a/src/Bundle/ChillMainBundle/Service/AddressGeographicalUnit/CollateAddressWithReferenceOrPostalCodeCronJob.php +++ b/src/Bundle/ChillMainBundle/Service/AddressGeographicalUnit/CollateAddressWithReferenceOrPostalCodeCronJob.php @@ -41,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 31982d6eb..46c79a250 100644 --- a/src/Bundle/ChillMainBundle/Service/AddressGeographicalUnit/RefreshAddressToGeographicalUnitMaterializedViewCronJob.php +++ b/src/Bundle/ChillMainBundle/Service/AddressGeographicalUnit/RefreshAddressToGeographicalUnitMaterializedViewCronJob.php @@ -46,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/Import/AddressReferenceBaseImporter.php b/src/Bundle/ChillMainBundle/Service/Import/AddressReferenceBaseImporter.php index 1eaf42e76..9407bd600 100644 --- a/src/Bundle/ChillMainBundle/Service/Import/AddressReferenceBaseImporter.php +++ b/src/Bundle/ChillMainBundle/Service/Import/AddressReferenceBaseImporter.php @@ -68,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/GeographicalUnitBaseImporter.php b/src/Bundle/ChillMainBundle/Service/Import/GeographicalUnitBaseImporter.php index 6196f8fad..6b6885ff2 100644 --- a/src/Bundle/ChillMainBundle/Service/Import/GeographicalUnitBaseImporter.php +++ b/src/Bundle/ChillMainBundle/Service/Import/GeographicalUnitBaseImporter.php @@ -66,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/Mailer/ChillMailer.php b/src/Bundle/ChillMainBundle/Service/Mailer/ChillMailer.php index b0bfae2b3..0d5d6b2d8 100644 --- a/src/Bundle/ChillMainBundle/Service/Mailer/ChillMailer.php +++ b/src/Bundle/ChillMainBundle/Service/Mailer/ChillMailer.php @@ -26,7 +26,7 @@ class ChillMailer implements MailerInterface { } - 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/Templating/Listing/FilterOrderHelper.php b/src/Bundle/ChillMainBundle/Templating/Listing/FilterOrderHelper.php index ebce380b0..9f42461c6 100644 --- a/src/Bundle/ChillMainBundle/Templating/Listing/FilterOrderHelper.php +++ b/src/Bundle/ChillMainBundle/Templating/Listing/FilterOrderHelper.php @@ -76,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]; @@ -99,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 4bef35046..14189b88d 100644 --- a/src/Bundle/ChillMainBundle/Templating/Listing/FilterOrderHelperBuilder.php +++ b/src/Bundle/ChillMainBundle/Templating/Listing/FilterOrderHelperBuilder.php @@ -65,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]; @@ -79,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/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 489bab4cb..417e1117b 100644 --- a/src/Bundle/ChillMainBundle/Tests/Cron/CronManagerTest.php +++ b/src/Bundle/ChillMainBundle/Tests/Cron/CronManagerTest.php @@ -175,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; } @@ -193,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 44091f38b..8d71a132b 100644 --- a/src/Bundle/ChillMainBundle/Tests/Export/ExportManagerTest.php +++ b/src/Bundle/ChillMainBundle/Tests/Export/ExportManagerTest.php @@ -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 = [], diff --git a/src/Bundle/ChillMainBundle/Tests/Export/SortExportElementTest.php b/src/Bundle/ChillMainBundle/Tests/Export/SortExportElementTest.php index d7fdc49c8..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; } 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/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/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/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/Workflow/Helper/MetadataExtractor.php b/src/Bundle/ChillMainBundle/Workflow/Helper/MetadataExtractor.php index 05ee58d87..8f0caa62e 100644 --- a/src/Bundle/ChillMainBundle/Workflow/Helper/MetadataExtractor.php +++ b/src/Bundle/ChillMainBundle/Workflow/Helper/MetadataExtractor.php @@ -45,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/ChillPersonBundle/AccompanyingPeriod/Lifecycle/AccompanyingPeriodStepChangeCronjob.php b/src/Bundle/ChillPersonBundle/AccompanyingPeriod/Lifecycle/AccompanyingPeriodStepChangeCronjob.php index 2ddf3415c..33d88e7de 100644 --- a/src/Bundle/ChillPersonBundle/AccompanyingPeriod/Lifecycle/AccompanyingPeriodStepChangeCronjob.php +++ b/src/Bundle/ChillPersonBundle/AccompanyingPeriod/Lifecycle/AccompanyingPeriodStepChangeCronjob.php @@ -39,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/AccompanyingPeriodStepChanger.php b/src/Bundle/ChillPersonBundle/AccompanyingPeriod/Lifecycle/AccompanyingPeriodStepChanger.php index b0fe4c5b2..7e9f87939 100644 --- a/src/Bundle/ChillPersonBundle/AccompanyingPeriod/Lifecycle/AccompanyingPeriodStepChanger.php +++ b/src/Bundle/ChillPersonBundle/AccompanyingPeriod/Lifecycle/AccompanyingPeriodStepChanger.php @@ -33,7 +33,7 @@ class AccompanyingPeriodStepChanger ) { } - 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/Controller/ReassignAccompanyingPeriodController.php b/src/Bundle/ChillPersonBundle/Controller/ReassignAccompanyingPeriodController.php index a83b831f1..f8e305552 100644 --- a/src/Bundle/ChillPersonBundle/Controller/ReassignAccompanyingPeriodController.php +++ b/src/Bundle/ChillPersonBundle/Controller/ReassignAccompanyingPeriodController.php @@ -143,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/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/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/AccompanyingPeriodLocationHistory.php b/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/AccompanyingPeriodLocationHistory.php index ab6e66f1c..700076506 100644 --- a/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/AccompanyingPeriodLocationHistory.php +++ b/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/AccompanyingPeriodLocationHistory.php @@ -91,14 +91,14 @@ class AccompanyingPeriodLocationHistory implements TrackCreationInterface return $this->startDate; } - public function setAddressLocation(?Address $addressLocation): AccompanyingPeriod\AccompanyingPeriodLocationHistory + public function setAddressLocation(?Address $addressLocation): AccompanyingPeriodLocationHistory { $this->addressLocation = $addressLocation; return $this; } - public function setEndDate(?\DateTimeImmutable $endDate): AccompanyingPeriod\AccompanyingPeriodLocationHistory + public function setEndDate(?\DateTimeImmutable $endDate): AccompanyingPeriodLocationHistory { $this->endDate = $endDate; @@ -108,21 +108,21 @@ class AccompanyingPeriodLocationHistory implements TrackCreationInterface /** * @internal use AccompanyingPeriod::addLocationHistory */ - public function setPeriod(AccompanyingPeriod $period): AccompanyingPeriod\AccompanyingPeriodLocationHistory + public function setPeriod(AccompanyingPeriod $period): AccompanyingPeriodLocationHistory { $this->period = $period; return $this; } - public function setPersonLocation(?Person $personLocation): AccompanyingPeriod\AccompanyingPeriodLocationHistory + public function setPersonLocation(?Person $personLocation): AccompanyingPeriodLocationHistory { $this->personLocation = $personLocation; return $this; } - public function setStartDate(?\DateTimeImmutable $startDate): AccompanyingPeriod\AccompanyingPeriodLocationHistory + public function setStartDate(?\DateTimeImmutable $startDate): AccompanyingPeriodLocationHistory { $this->startDate = $startDate; diff --git a/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/AccompanyingPeriodStepHistory.php b/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/AccompanyingPeriodStepHistory.php index 5a3ed774c..15b2f0d2e 100644 --- a/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/AccompanyingPeriodStepHistory.php +++ b/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/AccompanyingPeriodStepHistory.php @@ -108,7 +108,7 @@ class AccompanyingPeriodStepHistory implements TrackCreationInterface, TrackUpda return $this; } - public function setStep(string $step): AccompanyingPeriod\AccompanyingPeriodStepHistory + public function setStep(string $step): AccompanyingPeriodStepHistory { $this->step = $step; diff --git a/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/AccompanyingPeriodWork.php b/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/AccompanyingPeriodWork.php index afb4b1c82..77906b1ba 100644 --- a/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/AccompanyingPeriodWork.php +++ b/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/AccompanyingPeriodWork.php @@ -255,7 +255,7 @@ class AccompanyingPeriodWork implements AccompanyingPeriodLinkedWithSocialIssues $this->referrersHistory = new ArrayCollection(); } - public function addAccompanyingPeriodWorkEvaluation(AccompanyingPeriod\AccompanyingPeriodWorkEvaluation $evaluation): self + public function addAccompanyingPeriodWorkEvaluation(AccompanyingPeriodWorkEvaluation $evaluation): self { if (!$this->accompanyingPeriodWorkEvaluations->contains($evaluation)) { $this->accompanyingPeriodWorkEvaluations[] = $evaluation; @@ -265,7 +265,7 @@ class AccompanyingPeriodWork implements AccompanyingPeriodLinkedWithSocialIssues return $this; } - public function addGoal(AccompanyingPeriod\AccompanyingPeriodWorkGoal $goal): self + public function addGoal(AccompanyingPeriodWorkGoal $goal): self { if (!$this->goals->contains($goal)) { $this->goals[] = $goal; @@ -288,7 +288,7 @@ class AccompanyingPeriodWork implements AccompanyingPeriodLinkedWithSocialIssues { if (!$this->getReferrers()->contains($referrer)) { $this->referrersHistory[] = - new AccompanyingPeriod\AccompanyingPeriodWorkReferrerHistory($this, $referrer, new \DateTimeImmutable('today')); + new AccompanyingPeriodWorkReferrerHistory($this, $referrer, new \DateTimeImmutable('today')); } return $this; @@ -393,8 +393,8 @@ class AccompanyingPeriodWork implements AccompanyingPeriodLinkedWithSocialIssues public function getReferrers(): ReadableCollection { $users = $this->referrersHistory - ->filter(fn (AccompanyingPeriod\AccompanyingPeriodWorkReferrerHistory $h) => null === $h->getEndDate()) - ->map(fn (AccompanyingPeriod\AccompanyingPeriodWorkReferrerHistory $h) => $h->getUser()) + ->filter(fn (AccompanyingPeriodWorkReferrerHistory $h) => null === $h->getEndDate()) + ->map(fn (AccompanyingPeriodWorkReferrerHistory $h) => $h->getUser()) ->getValues() ; @@ -452,7 +452,7 @@ class AccompanyingPeriodWork implements AccompanyingPeriodLinkedWithSocialIssues return $this->updatedBy; } - public function removeAccompanyingPeriodWorkEvaluation(AccompanyingPeriod\AccompanyingPeriodWorkEvaluation $evaluation): self + public function removeAccompanyingPeriodWorkEvaluation(AccompanyingPeriodWorkEvaluation $evaluation): self { $this->accompanyingPeriodWorkEvaluations ->removeElement($evaluation); @@ -461,7 +461,7 @@ class AccompanyingPeriodWork implements AccompanyingPeriodLinkedWithSocialIssues return $this; } - public function removeGoal(AccompanyingPeriod\AccompanyingPeriodWorkGoal $goal): self + public function removeGoal(AccompanyingPeriodWorkGoal $goal): self { if ($this->goals->removeElement($goal)) { // set the owning side to null (unless already changed) @@ -563,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/Resource.php b/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/Resource.php index 99ef4f7da..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|Person|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 29696cfe1..41b798a3f 100644 --- a/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/UserHistory.php +++ b/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/UserHistory.php @@ -86,7 +86,7 @@ class UserHistory implements TrackCreationInterface return $this->user; } - public function setEndDate(?\DateTimeImmutable $endDate): AccompanyingPeriod\UserHistory + public function setEndDate(?\DateTimeImmutable $endDate): UserHistory { $this->endDate = $endDate; 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/Person.php b/src/Bundle/ChillPersonBundle/Entity/Person.php index 050be3260..cd28da9a7 100644 --- a/src/Bundle/ChillPersonBundle/Entity/Person.php +++ b/src/Bundle/ChillPersonBundle/Entity/Person.php @@ -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 @@ -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/PersonCenterCurrent.php b/src/Bundle/ChillPersonBundle/Entity/Person/PersonCenterCurrent.php index 3cc618af4..551f8fd03 100644 --- a/src/Bundle/ChillPersonBundle/Entity/Person/PersonCenterCurrent.php +++ b/src/Bundle/ChillPersonBundle/Entity/Person/PersonCenterCurrent.php @@ -63,7 +63,7 @@ class PersonCenterCurrent * * @internal Should not be instantied, unless inside Person entity */ - public function __construct(Person\PersonCenterHistory $history) + public function __construct(PersonCenterHistory $history) { $this->person = $history->getPerson(); $this->center = $history->getCenter(); diff --git a/src/Bundle/ChillPersonBundle/Entity/Person/PersonResource.php b/src/Bundle/ChillPersonBundle/Entity/Person/PersonResource.php index 7f0a3e978..c5c2c8d08 100644 --- a/src/Bundle/ChillPersonBundle/Entity/Person/PersonResource.php +++ b/src/Bundle/ChillPersonBundle/Entity/Person/PersonResource.php @@ -71,7 +71,7 @@ class PersonResource implements TrackCreationInterface, TrackUpdateInterface * * @Groups({"read", "docgen:read"}) */ - private ?Person\PersonResourceKind $kind = null; + private ?PersonResourceKind $kind = null; /** * The person which host the owner of this resource. @@ -127,7 +127,7 @@ class PersonResource implements TrackCreationInterface, TrackUpdateInterface return $this->id; } - public function getKind(): ?Person\PersonResourceKind + public function getKind(): ?PersonResourceKind { return $this->kind; } @@ -196,7 +196,7 @@ class PersonResource implements TrackCreationInterface, TrackUpdateInterface return $this; } - public function setKind(?Person\PersonResourceKind $kind): self + public function setKind(?PersonResourceKind $kind): self { $this->kind = $kind; diff --git a/src/Bundle/ChillPersonBundle/Entity/PersonAltName.php b/src/Bundle/ChillPersonBundle/Entity/PersonAltName.php index 78d820298..c17172882 100644 --- a/src/Bundle/ChillPersonBundle/Entity/PersonAltName.php +++ b/src/Bundle/ChillPersonBundle/Entity/PersonAltName.php @@ -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/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/JobWorkingOnCourseAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/JobWorkingOnCourseAggregator.php index bb2df08d3..cfb9d53aa 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/JobWorkingOnCourseAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/JobWorkingOnCourseAggregator.php @@ -84,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/ScopeWorkingOnCourseAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/ScopeWorkingOnCourseAggregator.php index 7248b5b98..23159cae8 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/ScopeWorkingOnCourseAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/ScopeWorkingOnCourseAggregator.php @@ -84,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/UserWorkingOnCourseAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/UserWorkingOnCourseAggregator.php index f9b033784..b4bc40c10 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/UserWorkingOnCourseAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/UserWorkingOnCourseAggregator.php @@ -42,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/HouseholdAggregators/ChildrenNumberAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/HouseholdAggregators/ChildrenNumberAggregator.php index 4b13bd477..750841337 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/HouseholdAggregators/ChildrenNumberAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/HouseholdAggregators/ChildrenNumberAggregator.php @@ -72,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/PersonAggregators/CenterAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/CenterAggregator.php index 79d28c24e..fd48bdb01 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 (null|int|string $value) { + return function (int|string|null $value) { if (null === $value || '' === $value) { return ''; } diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/PostalCodeAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/PostalCodeAggregator.php index abb8b0e27..aa06fff61 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/PostalCodeAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/PostalCodeAggregator.php @@ -44,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/Helper/LabelPersonHelper.php b/src/Bundle/ChillPersonBundle/Export/Helper/LabelPersonHelper.php index 567f2f7e6..2b3c3674e 100644 --- a/src/Bundle/ChillPersonBundle/Export/Helper/LabelPersonHelper.php +++ b/src/Bundle/ChillPersonBundle/Export/Helper/LabelPersonHelper.php @@ -22,7 +22,7 @@ class LabelPersonHelper 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/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/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/Household/MembersEditor.php b/src/Bundle/ChillPersonBundle/Household/MembersEditor.php index c4be4ba5e..e61fbe105 100644 --- a/src/Bundle/ChillPersonBundle/Household/MembersEditor.php +++ b/src/Bundle/ChillPersonBundle/Household/MembersEditor.php @@ -53,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 16e25bc63..cb6f7d4ea 100644 --- a/src/Bundle/ChillPersonBundle/Household/MembersEditorFactory.php +++ b/src/Bundle/ChillPersonBundle/Household/MembersEditorFactory.php @@ -21,7 +21,7 @@ class MembersEditorFactory { } - 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/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 b50a1b18e..e058c4e8d 100644 --- a/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriodACLAwareRepository.php +++ b/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriodACLAwareRepository.php @@ -108,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 @@ -138,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) { @@ -231,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/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/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 7b6010718..f59f843ac 100644 --- a/src/Bundle/ChillPersonBundle/Repository/PersonACLAwareRepository.php +++ b/src/Bundle/ChillPersonBundle/Repository/PersonACLAwareRepository.php @@ -30,16 +30,16 @@ final readonly class PersonACLAwareRepository implements PersonACLAwareRepositor } 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, @@ -58,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, @@ -92,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 @@ -249,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/Serializer/Normalizer/AccompanyingPeriodWorkEvaluationDocumentNormalizer.php b/src/Bundle/ChillPersonBundle/Serializer/Normalizer/AccompanyingPeriodWorkEvaluationDocumentNormalizer.php index d6cc4c25f..b476c2f5f 100644 --- a/src/Bundle/ChillPersonBundle/Serializer/Normalizer/AccompanyingPeriodWorkEvaluationDocumentNormalizer.php +++ b/src/Bundle/ChillPersonBundle/Serializer/Normalizer/AccompanyingPeriodWorkEvaluationDocumentNormalizer.php @@ -29,7 +29,7 @@ class AccompanyingPeriodWorkEvaluationDocumentNormalizer implements ContextAware { } - 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), @@ -49,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 39560883e..016098535 100644 --- a/src/Bundle/ChillPersonBundle/Serializer/Normalizer/AccompanyingPeriodWorkEvaluationNormalizer.php +++ b/src/Bundle/ChillPersonBundle/Serializer/Normalizer/AccompanyingPeriodWorkEvaluationNormalizer.php @@ -33,7 +33,7 @@ class AccompanyingPeriodWorkEvaluationNormalizer implements ContextAwareNormaliz /** * @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, @@ -66,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 361321f38..438e89093 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 = []): 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, @@ -78,7 +78,7 @@ 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 && $data instanceof AccompanyingPeriodWork diff --git a/src/Bundle/ChillPersonBundle/Serializer/Normalizer/WorkflowNormalizer.php b/src/Bundle/ChillPersonBundle/Serializer/Normalizer/WorkflowNormalizer.php index cfd310013..99314ebdc 100644 --- a/src/Bundle/ChillPersonBundle/Serializer/Normalizer/WorkflowNormalizer.php +++ b/src/Bundle/ChillPersonBundle/Serializer/Normalizer/WorkflowNormalizer.php @@ -36,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, @@ -53,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/GenericDoc/Providers/AccompanyingPeriodWorkEvaluationGenericDocProvider.php b/src/Bundle/ChillPersonBundle/Service/GenericDoc/Providers/AccompanyingPeriodWorkEvaluationGenericDocProvider.php index a6f82be91..7d6e199bd 100644 --- a/src/Bundle/ChillPersonBundle/Service/GenericDoc/Providers/AccompanyingPeriodWorkEvaluationGenericDocProvider.php +++ b/src/Bundle/ChillPersonBundle/Service/GenericDoc/Providers/AccompanyingPeriodWorkEvaluationGenericDocProvider.php @@ -33,7 +33,7 @@ final readonly class AccompanyingPeriodWorkEvaluationGenericDocProvider implemen ) { } - 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(); @@ -52,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); @@ -84,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/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/Controller/PersonControllerCreateTest.php b/src/Bundle/ChillPersonBundle/Tests/Controller/PersonControllerCreateTest.php index 86796fc3f..a0223e660 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Controller/PersonControllerCreateTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Controller/PersonControllerCreateTest.php @@ -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/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/ChillReportBundle/Tests/Security/Authorization/ReportVoterTest.php b/src/Bundle/ChillReportBundle/Tests/Security/Authorization/ReportVoterTest.php index 90163fd2e..743d83c8a 100644 --- a/src/Bundle/ChillReportBundle/Tests/Security/Authorization/ReportVoterTest.php +++ b/src/Bundle/ChillReportBundle/Tests/Security/Authorization/ReportVoterTest.php @@ -134,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]); @@ -161,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/migrations/Version20150622233319.php b/src/Bundle/ChillReportBundle/migrations/Version20150622233319.php index 268335cbc..c4c261cd3 100644 --- a/src/Bundle/ChillReportBundle/migrations/Version20150622233319.php +++ b/src/Bundle/ChillReportBundle/migrations/Version20150622233319.php @@ -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/Entity/AbstractTask.php b/src/Bundle/ChillTaskBundle/Entity/AbstractTask.php index 948f9a81a..f9118737f 100644 --- a/src/Bundle/ChillTaskBundle/Entity/AbstractTask.php +++ b/src/Bundle/ChillTaskBundle/Entity/AbstractTask.php @@ -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 f5ed0d3b0..25b5008b0 100644 --- a/src/Bundle/ChillTaskBundle/Entity/SingleTask.php +++ b/src/Bundle/ChillTaskBundle/Entity/SingleTask.php @@ -112,7 +112,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() { @@ -122,7 +122,7 @@ class SingleTask extends AbstractTask /** * Get endDate. */ - public function getEndDate(): null|\DateTime + public function getEndDate(): \DateTime|null { return $this->endDate; } @@ -184,7 +184,7 @@ class SingleTask extends AbstractTask /** * Get warningInterval. */ - public function getWarningInterval(): null|\DateInterval + public function getWarningInterval(): \DateInterval|null { return $this->warningInterval; } @@ -234,7 +234,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/Repository/SingleTaskAclAwareRepository.php b/src/Bundle/ChillTaskBundle/Repository/SingleTaskAclAwareRepository.php index e55a8f700..d72c23298 100644 --- a/src/Bundle/ChillTaskBundle/Repository/SingleTaskAclAwareRepository.php +++ b/src/Bundle/ChillTaskBundle/Repository/SingleTaskAclAwareRepository.php @@ -28,7 +28,7 @@ final readonly class SingleTaskAclAwareRepository implements SingleTaskAclAwareR } public function buildBaseQuery( - string $pattern = null, + ?string $pattern = null, ?array $flags = [], ?array $types = [], ?array $users = [] @@ -150,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); @@ -162,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); @@ -173,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); @@ -184,7 +184,7 @@ final readonly class SingleTaskAclAwareRepository implements SingleTaskAclAwareR } public function countByAllViewable( - string $pattern = null, + ?string $pattern = null, ?array $flags = [], ?array $types = [], ?array $users = [] @@ -199,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); @@ -211,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) @@ -221,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); @@ -233,7 +233,7 @@ final readonly class SingleTaskAclAwareRepository implements SingleTaskAclAwareR } public function findByAllViewable( - string $pattern = null, + ?string $pattern = null, ?array $flags = [], ?array $types = [], ?array $users = [], @@ -249,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, @@ -262,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, @@ -275,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/Security/Authorization/AuthorizationEvent.php b/src/Bundle/ChillTaskBundle/Security/Authorization/AuthorizationEvent.php index cc65d0215..3b2de6ed5 100644 --- a/src/Bundle/ChillTaskBundle/Security/Authorization/AuthorizationEvent.php +++ b/src/Bundle/ChillTaskBundle/Security/Authorization/AuthorizationEvent.php @@ -26,7 +26,7 @@ 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 ) { 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/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/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/Repository/ThirdPartyACLAwareRepository.php b/src/Bundle/ChillThirdPartyBundle/Repository/ThirdPartyACLAwareRepository.php index 63538cfc2..3538a7877 100644 --- a/src/Bundle/ChillThirdPartyBundle/Repository/ThirdPartyACLAwareRepository.php +++ b/src/Bundle/ChillThirdPartyBundle/Repository/ThirdPartyACLAwareRepository.php @@ -21,7 +21,7 @@ final readonly class ThirdPartyACLAwareRepository implements ThirdPartyACLAwareR { } - public function buildQuery(string $filterString = null): QueryBuilder + public function buildQuery(?string $filterString = null): QueryBuilder { $qb = $this->thirdPartyRepository->createQueryBuilder('tp'); @@ -53,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/ChillWopiBundle/src/Service/Controller/Responder.php b/src/Bundle/ChillWopiBundle/src/Service/Controller/Responder.php index 633529d02..b85d1b8b3 100644 --- a/src/Bundle/ChillWopiBundle/src/Service/Controller/Responder.php +++ b/src/Bundle/ChillWopiBundle/src/Service/Controller/Responder.php @@ -28,7 +28,7 @@ final readonly class Responder implements ResponderInterface 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;