From 6d63177ff4769fb60c5bf5ec85f283498536477c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Mon, 1 May 2023 21:39:45 +0200 Subject: [PATCH] apply rules rector up to php82 --- .../widgets/ChillMainConfiguration.php | 2 +- .../Controller/ActivityController.php | 33 +++++++-------- .../Controller/ActivityReasonController.php | 2 +- .../DataFixtures/ORM/LoadActivity.php | 2 +- .../ChillActivityBundle/Entity/Activity.php | 4 +- .../Entity/ActivityType.php | 6 +-- .../EntityListener/ActivityEntityListener.php | 2 +- .../ACPAggregators/ByCreatorAggregator.php | 2 +- .../BySocialActionAggregator.php | 2 +- .../BySocialIssueAggregator.php | 2 +- .../ACPAggregators/ByThirdpartyAggregator.php | 2 +- .../ACPAggregators/CreatorScopeAggregator.php | 2 +- .../ACPAggregators/DateAggregator.php | 2 +- .../ACPAggregators/LocationTypeAggregator.php | 2 +- .../Aggregator/ActivityTypeAggregator.php | 2 +- .../Aggregator/ActivityUserAggregator.php | 4 +- .../Aggregator/ActivityUsersAggregator.php | 2 +- .../Aggregator/ActivityUsersJobAggregator.php | 2 +- .../ActivityUsersScopeAggregator.php | 2 +- .../Aggregator/SentReceivedAggregator.php | 2 +- .../Export/Declarations.php | 6 +-- .../Export/LinkedToACP/ListActivity.php | 2 +- .../Export/LinkedToPerson/ListActivity.php | 2 +- .../LinkedToPerson/StatActivityDuration.php | 4 +- .../Export/Export/ListActivityHelper.php | 4 +- .../Filter/ACPFilters/ActivityTypeFilter.php | 2 +- .../Filter/ACPFilters/ByCreatorFilter.php | 2 +- .../ACPFilters/BySocialActionFilter.php | 2 +- .../Filter/ACPFilters/BySocialIssueFilter.php | 2 +- .../Filter/ACPFilters/EmergencyFilter.php | 2 +- .../Filter/ACPFilters/LocationTypeFilter.php | 2 +- .../Filter/ACPFilters/SentReceivedFilter.php | 2 +- .../Export/Filter/ACPFilters/UserFilter.php | 2 +- .../Filter/ACPFilters/UserScopeFilter.php | 2 +- .../Export/Filter/ActivityDateFilter.php | 2 +- .../Export/Filter/ActivityUsersFilter.php | 2 +- .../Export/Filter/UsersJobFilter.php | 2 +- .../Export/Filter/UsersScopeFilter.php | 2 +- .../Form/ActivityTypeType.php | 2 +- .../Form/Type/PickActivityReasonType.php | 2 +- ...TranslatableActivityReasonCategoryType.php | 2 +- .../Menu/AdminMenuBuilder.php | 2 +- .../ActivityNotificationHandler.php | 2 +- .../Repository/ActivityACLAwareRepository.php | 2 +- .../Repository/ActivityPresenceRepository.php | 2 +- .../Repository/ActivityReasonRepository.php | 2 +- .../Repository/ActivityTypeRepository.php | 2 +- .../Authorization/ActivityStatsVoter.php | 4 +- .../Security/Authorization/ActivityVoter.php | 16 +++---- .../Service/DocGenerator/ActivityContext.php | 2 +- ...tActivitiesByAccompanyingPeriodContext.php | 2 +- .../Controller/ActivityControllerTest.php | 2 +- .../ActivityReasonCategoryControllerTest.php | 2 +- .../ActivityReasonControllerTest.php | 2 +- .../Controller/ActivityTypeControllerTest.php | 2 +- .../Type/TranslatableActivityReasonTest.php | 2 +- .../Tests/Timeline/TimelineProviderTest.php | 2 +- .../Constraints/ActivityValidity.php | 4 +- .../Controller/AsideActivityController.php | 2 +- .../DataFixtures/ORM/LoadAsideActivity.php | 2 +- .../Aggregator/ByActivityTypeAggregator.php | 2 +- .../Export/Aggregator/ByUserJobAggregator.php | 2 +- .../Aggregator/ByUserScopeAggregator.php | 2 +- .../src/Export/Declarations.php | 2 +- .../Export/AvgAsideActivityDuration.php | 2 +- .../src/Export/Export/CountAsideActivity.php | 2 +- .../src/Export/Export/ListAsideActivity.php | 2 +- .../Export/SumAsideActivityDuration.php | 2 +- .../Export/Filter/ByActivityTypeFilter.php | 2 +- .../src/Export/Filter/ByDateFilter.php | 2 +- .../src/Export/Filter/ByUserFilter.php | 2 +- .../src/Export/Filter/ByUserJobFilter.php | 2 +- .../src/Export/Filter/ByUserScopeFilter.php | 2 +- .../src/Form/AsideActivityCategoryType.php | 2 +- .../src/Form/AsideActivityFormType.php | 10 +---- .../Type/PickAsideActivityCategoryType.php | 2 +- .../src/Menu/AdminMenuBuilder.php | 2 +- .../AsideActivityCategoryRepository.php | 2 +- .../src/Security/AsideActivityVoter.php | 4 +- .../src/Templating/Entity/CategoryRender.php | 2 +- .../Calculator/CalculatorResult.php | 6 +-- .../Controller/ElementController.php | 2 +- .../ChillBudgetBundle/Entity/Charge.php | 10 ++--- .../ChillBudgetBundle/Form/ChargeType.php | 2 +- .../ChillBudgetBundle/Form/ResourceType.php | 2 +- .../Menu/AdminMenuBuilder.php | 2 +- .../Repository/ChargeKindRepository.php | 2 +- .../Repository/ResourceKindRepository.php | 2 +- .../Authorization/BudgetElementVoter.php | 10 ++--- .../Service/Summary/SummaryBudget.php | 2 +- .../Templating/BudgetElementTypeRender.php | 2 +- .../Service/Summary/SummaryBudgetTest.php | 4 +- .../AzureGrantAdminConsentAndAcquireToken.php | 2 +- .../MapAndSubscribeUserCalendarCommand.php | 10 ++--- .../SendShortMessageOnEligibleCalendar.php | 2 +- .../SendTestShortMessageOnCalendarCommand.php | 12 +++--- .../Controller/CalendarAPIController.php | 2 +- .../Controller/CalendarController.php | 2 +- .../Controller/CalendarDocController.php | 4 +- .../Controller/CalendarRangeAPIController.php | 2 +- .../Controller/InviteApiController.php | 2 +- .../RemoteCalendarConnectAzureController.php | 2 +- .../RemoteCalendarMSGraphSyncController.php | 2 +- .../RemoteCalendarProxyController.php | 2 +- .../DataFixtures/ORM/LoadCalendarRange.php | 2 +- .../ChillCalendarBundle/Entity/Calendar.php | 12 +++--- .../Entity/CancelReason.php | 6 +-- .../ChillCalendarBundle/Entity/Invite.php | 10 ++--- .../Event/ListenToActivityCreate.php | 2 +- .../Export/Aggregator/AgentAggregator.php | 2 +- .../Aggregator/CancelReasonAggregator.php | 2 +- .../Export/Aggregator/JobAggregator.php | 2 +- .../Export/Aggregator/LocationAggregator.php | 2 +- .../Aggregator/LocationTypeAggregator.php | 2 +- .../Export/Aggregator/ScopeAggregator.php | 2 +- .../Export/Aggregator/UrgencyAggregator.php | 2 +- .../Export/Declarations.php | 2 +- .../Export/Export/CountCalendars.php | 2 +- .../Export/Export/StatCalendarAvgDuration.php | 2 +- .../Export/Export/StatCalendarSumDuration.php | 2 +- .../Export/Filter/AgentFilter.php | 2 +- .../Export/Filter/BetweenDatesFilter.php | 2 +- .../Export/Filter/CalendarRangeFilter.php | 2 +- .../Export/Filter/JobFilter.php | 2 +- .../Export/Filter/ScopeFilter.php | 2 +- .../ChillCalendarBundle/Form/CalendarType.php | 2 +- .../Menu/AccompanyingCourseMenuBuilder.php | 2 +- .../Menu/PersonMenuBuilder.php | 2 +- .../Menu/UserMenuBuilder.php | 2 +- .../Doctrine/CalendarEntityListener.php | 2 +- .../Doctrine/CalendarRangeEntityListener.php | 2 +- .../CalendarRangeRemoveToRemoteHandler.php | 2 +- .../Handler/CalendarRangeToRemoteHandler.php | 2 +- .../Handler/CalendarRemoveHandler.php | 2 +- .../Handler/CalendarToRemoteHandler.php | 2 +- .../Messenger/Handler/InviteUpdateHandler.php | 2 +- .../MSGraphChangeNotificationHandler.php | 2 +- .../Messenger/Message/CalendarMessage.php | 10 ++--- .../Message/CalendarRangeMessage.php | 8 ++-- .../Message/CalendarRangeRemovedMessage.php | 6 +-- .../Message/CalendarRemovedMessage.php | 6 +-- .../Messenger/Message/InviteUpdateMessage.php | 4 +- .../MSGraphChangeNotificationMessage.php | 2 +- .../Connector/MSGraph/AddressConverter.php | 2 +- .../EventsOnUserSubscriptionCreator.php | 2 +- .../Connector/MSGraph/LocationConverter.php | 2 +- .../MSGraph/MSGraphUserRepository.php | 2 +- .../Connector/MSGraph/MachineHttpClient.php | 4 +- .../Connector/MSGraph/MachineTokenStorage.php | 2 +- .../Connector/MSGraph/MapCalendarToUser.php | 10 ++--- .../MSGraph/OnBehalfOfUserHttpClient.php | 4 +- .../MSGraph/OnBehalfOfUserTokenStorage.php | 4 +- .../MSGraph/RemoteEventConverter.php | 18 ++++---- .../RemoteToLocalSync/CalendarRangeSyncer.php | 2 +- .../RemoteToLocalSync/CalendarSyncer.php | 4 +- .../MSGraphRemoteCalendarConnector.php | 2 +- .../Repository/CalendarACLAwareRepository.php | 2 +- .../Repository/CalendarDocRepository.php | 2 +- .../Repository/CalendarRangeRepository.php | 4 +- .../Repository/CalendarRepository.php | 4 +- .../Repository/InviteRepository.php | 2 +- .../Security/Voter/CalendarDocVoter.php | 6 +-- .../Security/Voter/CalendarVoter.php | 16 +++---- .../Security/Voter/InviteVoter.php | 2 +- .../Service/DocGenerator/CalendarContext.php | 2 +- .../BulkCalendarShortMessageSender.php | 2 +- .../CalendarForShortMessageProvider.php | 2 +- .../DefaultShortMessageForCalendarBuilder.php | 2 +- .../Tests/Form/CalendarTypeTest.php | 2 +- .../Command/CreateFieldsOnGroupCommand.php | 10 ++--- .../CustomFieldsGroupController.php | 2 +- .../CustomFields/CustomFieldChoice.php | 14 +++---- .../CustomFields/CustomFieldDate.php | 10 ++--- .../CustomFields/CustomFieldLongChoice.php | 8 ++-- .../CustomFields/CustomFieldNumber.php | 10 ++--- .../CustomFields/CustomFieldText.php | 10 ++--- .../CustomFields/CustomFieldTitle.php | 12 +++--- .../Entity/CustomField.php | 4 +- .../Form/CustomFieldType.php | 2 +- .../Form/CustomFieldsGroupType.php | 4 +- .../CustomFieldDataTransformer.php | 2 +- .../CustomFieldsGroupToIdTransformer.php | 2 +- .../JsonCustomFieldToArrayTransformer.php | 18 ++++---- .../Form/Type/CustomFieldType.php | 2 +- .../Form/Type/LinkedCustomFieldsType.php | 4 +- .../Service/CustomFieldsHelper.php | 2 +- .../Twig/CustomFieldRenderingTwig.php | 17 ++------ .../Twig/CustomFieldsGroupRenderingTwig.php | 5 +-- .../Context/ContextManager.php | 2 +- .../AdminDocGeneratorTemplateController.php | 2 +- .../DocGeneratorTemplateController.php | 2 +- .../Form/DocGeneratorTemplateType.php | 2 +- .../Exception/TemplateException.php | 2 +- .../GeneratorDriver/RelatorioDriver.php | 6 +-- .../Menu/AdminMenuBuilder.php | 2 +- .../DocGeneratorTemplateRepository.php | 4 +- .../Helper/NormalizeNullValueHelper.php | 2 +- .../Normalizer/DocGenObjectNormalizer.php | 6 +-- .../Service/Context/BaseContextData.php | 2 +- .../Service/Generator/Generator.php | 2 +- .../Service/Generator/GeneratorException.php | 2 +- .../Service/Messenger/OnGenerationFails.php | 2 +- .../Messenger/RequestGenerationHandler.php | 4 +- .../Messenger/RequestGenerationMessage.php | 12 +++--- .../Normalizer/DocGenObjectNormalizerTest.php | 4 +- .../DocumentAccompanyingCourseController.php | 2 +- .../Controller/DocumentPersonController.php | 2 +- .../Controller/StoredObjectApiController.php | 2 +- .../Entity/StoredObject.php | 6 +-- .../Form/DocumentCategoryType.php | 2 +- .../Form/PersonDocumentType.php | 2 +- .../Form/StoredObjectType.php | 14 +++---- .../ChillDocStoreBundle/Menu/MenuBuilder.php | 2 +- .../AccompanyingCourseDocumentRepository.php | 4 +- .../Repository/DocumentCategoryRepository.php | 4 +- .../PersonDocumentACLAwareRepository.php | 2 +- .../Repository/StoredObjectRepository.php | 2 +- .../AccompanyingCourseDocumentVoter.php | 10 ++--- .../Authorization/PersonDocumentVoter.php | 10 ++--- .../Normalizer/StoredObjectDenormalizer.php | 2 +- .../Service/StoredObjectManager.php | 2 +- .../WopiEditTwigExtensionRuntime.php | 4 +- ...ompanyingCourseDocumentWorkflowHandler.php | 4 +- .../Controller/ParticipationController.php | 6 +-- src/Bundle/ChillEventBundle/Entity/Event.php | 2 +- .../ChillEventBundle/Search/EventSearch.php | 10 ++--- .../Security/Authorization/EventVoter.php | 10 ++--- .../Authorization/ParticipationVoter.php | 10 ++--- .../Tests/Controller/EventControllerTest.php | 2 +- .../Controller/EventTypeControllerTest.php | 2 +- .../Tests/Controller/RoleControllerTest.php | 2 +- .../Tests/Controller/StatusControllerTest.php | 2 +- .../Tests/Search/EventSearchTest.php | 2 +- .../Controller/FamilyMemberController.php | 2 +- .../Form/FamilyMemberType.php | 2 +- .../Security/Voter/FamilyMemberVoter.php | 10 ++--- .../Templating/Twig.php | 10 ++--- .../CRUD/Resolver/Resolver.php | 6 +-- .../CRUD/Templating/TwigCRUDResolver.php | 4 +- .../Command/ChillImportUsersCommand.php | 4 +- .../ChillUserSendRenewPasswordCodeCommand.php | 4 +- .../Command/ExecuteCronJobCommand.php | 2 +- .../LoadAddressesBEFromBestAddressCommand.php | 4 +- .../LoadAddressesFRFromBANOCommand.php | 2 +- .../Command/LoadAndUpdateLanguagesCommand.php | 6 +-- .../Command/LoadCountriesCommand.php | 2 +- .../Command/LoadPostalCodeFR.php | 2 +- .../Command/LoadPostalCodesCommand.php | 6 +-- .../Command/SetPasswordCommand.php | 2 +- .../AddressReferenceAPIController.php | 4 +- .../AddressToReferenceMatcherController.php | 2 +- .../Controller/ExportController.php | 4 +- ...GeographicalUnitByAddressApiController.php | 2 +- .../Controller/NotificationApiController.php | 2 +- .../Controller/NotificationController.php | 2 +- .../Controller/PermissionApiController.php | 2 +- .../Controller/PermissionsGroupController.php | 2 +- .../Controller/PostalCodeAPIController.php | 4 +- .../Controller/SavedExportController.php | 2 +- .../Controller/SearchController.php | 2 +- .../Controller/TimelineCenterController.php | 2 +- .../Controller/UserController.php | 4 +- .../Controller/WorkflowApiController.php | 2 +- .../Controller/WorkflowController.php | 2 +- .../ChillMainBundle/Cron/CronManager.php | 2 +- .../DataFixtures/ORM/LoadUsers.php | 2 +- .../CompilerPass/ShortMessageCompilerPass.php | 2 +- .../DependencyInjection/Configuration.php | 2 +- .../Event/TrackCreateUpdateSubscriber.php | 2 +- .../ChillMainBundle/Doctrine/Model/Point.php | 2 +- .../Doctrine/Type/NativeDateIntervalType.php | 8 ++-- .../Doctrine/Type/PointType.php | 2 +- src/Bundle/ChillMainBundle/Entity/Address.php | 6 +-- .../Entity/CronJobExecution.php | 4 +- .../ChillMainBundle/Entity/LocationType.php | 10 ++--- .../ChillMainBundle/Export/ExportManager.php | 6 +-- .../Export/Helper/DateTimeHelper.php | 2 +- .../Export/Helper/ExportAddressHelper.php | 24 +++++------ .../TranslatableStringExportLabelHelper.php | 2 +- .../Export/Helper/UserHelper.php | 2 +- .../DataMapper/PrivateCommentDataMapper.php | 2 +- .../Form/DataMapper/ScopePickerDataMapper.php | 2 +- .../IdToEntityDataTransformer.php | 4 +- .../Form/Event/CustomizeFormEvent.php | 2 +- .../ChillMainBundle/Form/LocationFormType.php | 2 +- .../Form/PermissionsGroupType.php | 2 +- .../Form/Type/ChillPhoneNumberType.php | 4 +- .../Form/Type/ComposedRoleScopeType.php | 2 +- .../AddressToIdDataTransformer.php | 2 +- .../DataTransformer/CenterTransformer.php | 4 +- .../EntityToJsonTransformer.php | 4 +- .../MultipleObjectsToIdTransformer.php | 2 +- .../DataTransformer/ObjectToIdTransformer.php | 2 +- .../PostalCodeToIdTransformer.php | 2 +- .../Type/DataTransformer/ScopeTransformer.php | 2 +- .../Form/Type/Export/ExportType.php | 8 ++-- .../Form/Type/Export/FilterType.php | 2 +- .../Form/Type/Export/PickCenterType.php | 8 ++-- .../Form/Type/Listing/FilterOrderType.php | 2 +- .../Form/Type/PickAddressType.php | 2 +- .../Form/Type/PickCivilityType.php | 2 +- .../Form/Type/PickLocationTypeType.php | 2 +- .../Form/Type/PickPostalCodeType.php | 2 +- .../Form/Type/PickRollingDateType.php | 2 +- .../Form/Type/PickUserDynamicType.php | 2 +- .../Form/Type/PickUserLocationType.php | 2 +- .../Form/Type/ScopePickerType.php | 2 +- .../Form/Type/Select2CountryType.php | 2 +- .../Form/Type/Select2LanguageType.php | 2 +- .../Form/Type/TranslatableStringFormType.php | 2 +- .../Form/Type/UserPickerType.php | 2 +- src/Bundle/ChillMainBundle/Form/UserType.php | 2 +- .../ChillMainBundle/Form/WorkflowStepType.php | 2 +- .../Counter/NotificationByUserCounter.php | 2 +- .../Notification/Email/NotificationMailer.php | 2 +- ...NotificationOnTerminateEventSubscriber.php | 2 +- .../ChillMainBundle/Notification/Mailer.php | 2 +- .../NotificationHandlerManager.php | 2 +- .../Notification/NotificationPresence.php | 2 +- .../NotificationTwigExtensionRuntime.php | 2 +- .../Pagination/ChillItemsPerPageTwig.php | 2 +- .../Pagination/ChillPaginationTwig.php | 6 +-- .../Pagination/PaginatorFactory.php | 10 ++--- .../Phonenumber/PhonenumberHelper.php | 12 +++--- .../Phonenumber/Templating.php | 2 +- .../Redis/RedisConnectionFactory.php | 8 ++-- .../Repository/AddressReferenceRepository.php | 4 +- .../Repository/AddressRepository.php | 2 +- .../Repository/CenterRepository.php | 2 +- .../Repository/CivilityRepository.php | 2 +- .../Repository/CountryRepository.php | 2 +- .../Repository/CronJobExecutionRepository.php | 2 +- .../GeographicalUnitLayerLayerRepository.php | 2 +- .../Repository/GeographicalUnitRepository.php | 2 +- .../Repository/GroupCenterRepository.php | 2 +- .../Repository/LanguageRepository.php | 2 +- .../Repository/NotificationRepository.php | 4 +- .../Repository/PermissionsGroupRepository.php | 2 +- .../Repository/PostalCodeRepository.php | 4 +- .../Repository/RegroupmentRepository.php | 2 +- .../Repository/RoleScopeRepository.php | 2 +- .../Repository/SavedExportRepository.php | 2 +- .../Repository/ScopeRepository.php | 2 +- .../Repository/UserACLAwareRepository.php | 2 +- .../Repository/UserJobRepository.php | 2 +- .../Repository/UserRepository.php | 2 +- .../Workflow/EntityWorkflowRepository.php | 2 +- .../Workflow/EntityWorkflowStepRepository.php | 2 +- .../Routing/Loader/ChillRoutesLoader.php | 2 +- .../Routing/MenuBuilder/UserMenuBuilder.php | 2 +- .../ChillMainBundle/Routing/MenuComposer.php | 2 +- .../ChillMainBundle/Routing/MenuTwig.php | 4 +- .../ChillMainBundle/Search/AbstractSearch.php | 4 +- .../Search/Entity/SearchUserApiProvider.php | 2 +- .../ChillMainBundle/Search/Model/Result.php | 2 +- .../ChillMainBundle/Search/SearchApi.php | 2 +- .../Search/SearchApiNoQueryException.php | 6 +-- .../Search/SearchApiResult.php | 4 +- .../ChillMainBundle/Search/SearchProvider.php | 8 ++-- .../Utils/ExtractPhonenumberFromPattern.php | 2 +- .../Search/Utils/SearchExtractionResult.php | 2 +- .../Authorization/AuthorizationHelper.php | 2 +- .../AuthorizationHelperForCurrentUser.php | 2 +- .../Authorization/ChillExportVoter.php | 4 +- .../Authorization/DefaultVoterHelper.php | 2 +- .../DefaultVoterHelperGenerator.php | 2 +- .../Authorization/EntityWorkflowVoter.php | 10 ++--- .../Authorization/SavedExportVoter.php | 6 +-- .../WorkflowEntityDeletionVoter.php | 2 +- .../PasswordRecover/PasswordRecoverEvent.php | 15 ++++--- .../PasswordRecover/PasswordRecoverLocker.php | 14 +++---- .../PasswordRecover/PasswordRecoverVoter.php | 4 +- .../PasswordRecover/RecoverPasswordHelper.php | 4 +- .../Security/PasswordRecover/TokenManager.php | 12 +++--- .../Resolver/CenterResolverDispatcher.php | 2 +- .../Resolver/CenterResolverManager.php | 2 +- .../Resolver/ResolverTwigExtension.php | 8 ++-- .../Resolver/ScopeResolverDispatcher.php | 2 +- .../Serializer/Model/Collection.php | 2 +- .../Normalizer/AddressNormalizer.php | 2 +- .../Normalizer/CenterNormalizer.php | 2 +- .../CommentEmbeddableDocGenNormalizer.php | 2 +- .../Serializer/Normalizer/DateNormalizer.php | 2 +- .../DiscriminatedObjectDenormalizer.php | 4 +- .../DoctrineExistingEntityNormalizer.php | 2 +- .../Normalizer/EntityWorkflowNormalizer.php | 2 +- .../EntityWorkflowStepNormalizer.php | 2 +- .../Normalizer/NotificationNormalizer.php | 2 +- .../Normalizer/PhonenumberNormalizer.php | 4 +- .../PrivateCommentEmbeddableNormalizer.php | 2 +- .../Serializer/Normalizer/UserNormalizer.php | 13 ++---- ...eographicalUnitMaterializedViewCronJob.php | 2 +- .../AddressReferenceBEFromBestAddress.php | 2 +- .../Import/AddressReferenceBaseImporter.php | 2 +- .../Import/AddressReferenceFromBano.php | 2 +- .../Import/AddressToReferenceMatcher.php | 2 +- .../Import/GeographicalUnitBaseImporter.php | 2 +- .../Import/PostalCodeBEFromBestAddress.php | 6 +-- .../Service/Import/PostalCodeBaseImporter.php | 2 +- .../Import/PostalCodeFRFromOpenData.php | 10 ++--- .../Service/Mailer/ChillMailer.php | 2 +- .../Service/RollingDate/RollingDate.php | 42 ++++++++----------- .../Service/ShortMessage/ShortMessage.php | 4 +- .../ShortMessage/ShortMessageHandler.php | 2 +- .../ShortMessage/ShortMessageTransporter.php | 2 +- .../ShortMessageOvh/OvhShortMessageSender.php | 10 ++--- .../Templating/CSVCellTwig.php | 2 +- .../ChillMarkdownRenderExtension.php | 2 +- .../Templating/ChillTwigHelper.php | 2 +- .../Templating/ChillTwigRoutingHelper.php | 8 ++-- .../Templating/Entity/AddressRender.php | 4 +- .../Entity/ChillEntityRenderExtension.php | 4 +- .../Templating/Entity/CommentRender.php | 2 +- .../Templating/Entity/UserRender.php | 4 +- .../Events/DelegatedBlockRenderingEvent.php | 4 +- .../Templating/Listing/FilterOrderHelper.php | 2 +- .../Listing/FilterOrderHelperBuilder.php | 2 +- .../Listing/FilterOrderHelperFactory.php | 2 +- .../Templating/Listing/Templating.php | 2 +- .../Templating/TranslatableStringHelper.php | 4 +- .../Templating/TranslatableStringTwig.php | 4 +- .../Templating/Widget/WidgetRenderingTwig.php | 4 +- .../PermissionsGroupControllerTest.php | 2 +- .../Tests/Cron/CronManagerTest.php | 2 +- .../Tests/Form/Type/PickCenterTypeTest.php | 6 +-- .../Tests/Search/AbstractSearchTest.php | 2 +- .../GeographicalUnitBaseImporterTest.php | 4 +- .../Timeline/TimelineBuilder.php | 2 +- .../Util/DateRangeCovering.php | 4 +- .../Validator/RoleScopeScopePresence.php | 2 +- .../Validation/Validator/ValidPhonenumber.php | 2 +- .../Counter/WorkflowByUserCounter.php | 2 +- .../Workflow/EntityWorkflowManager.php | 2 +- ...ntityWorkflowTransitionEventSubscriber.php | 2 +- .../NotificationOnTransition.php | 2 +- .../SendAccessKeyEventSubscriber.php | 2 +- .../Workflow/Helper/MetadataExtractor.php | 2 +- .../WorkflowNotificationHandler.php | 2 +- .../WorkflowTwigExtensionRuntime.php | 2 +- .../EntityWorkflowCreationValidator.php | 2 +- .../PersonAddressMoveEventSubscriber.php | 2 +- .../Events/UserRefEventSubscriber.php | 2 +- .../ChillPersonBundle/Actions/ActionEvent.php | 4 +- .../OneToOneEntityPersonCRUDController.php | 2 +- .../Command/ChillPersonMoveCommand.php | 8 ++-- ...emoveOldDraftAccompanyingPeriodCommand.php | 2 +- .../AccompanyingCourseApiController.php | 2 +- .../AccompanyingCourseCommentController.php | 2 +- .../AccompanyingCourseController.php | 2 +- .../AccompanyingCourseWorkApiController.php | 2 +- .../AccompanyingCourseWorkController.php | 2 +- ...mpanyingPeriodRegulationListController.php | 2 +- ...nyingPeriodWorkEvaluationApiController.php | 2 +- .../Controller/HouseholdApiController.php | 2 +- .../HouseholdCompositionController.php | 2 +- .../Controller/HouseholdController.php | 2 +- .../Controller/HouseholdMemberController.php | 2 +- .../Controller/PersonApiController.php | 6 +-- .../Controller/PersonController.php | 8 ++-- .../Controller/PersonDuplicateController.php | 2 +- .../Controller/PersonResourceController.php | 2 +- .../ReassignAccompanyingPeriodController.php | 4 +- .../Controller/RelationshipApiController.php | 2 +- .../ResidentialAddressController.php | 2 +- .../SocialWorkEvaluationApiController.php | 2 +- .../SocialWorkGoalApiController.php | 2 +- .../SocialWorkResultApiController.php | 2 +- .../SocialWorkSocialActionApiController.php | 2 +- .../UserAccompanyingPeriodController.php | 2 +- .../ORM/LoadAccompanyingPeriodOrigin.php | 2 +- .../ORM/LoadAccompanyingPeriodWork.php | 2 +- .../DataFixtures/ORM/LoadCustomFields.php | 2 +- .../DataFixtures/ORM/LoadHousehold.php | 4 +- .../ORM/LoadHouseholdCompositionType.php | 2 +- .../ORM/LoadHouseholdPosition.php | 8 ++-- .../DataFixtures/ORM/LoadPeople.php | 2 +- .../DataFixtures/ORM/LoadRelations.php | 4 +- .../DataFixtures/ORM/LoadRelationships.php | 2 +- .../ORM/LoadSocialWorkMetadata.php | 2 +- .../Entity/AccompanyingPeriod.php | 12 +++--- .../Entity/AccompanyingPeriod/UserHistory.php | 26 +++++------- .../ChillPersonBundle/Entity/Person.php | 12 +++--- .../Event/Person/PersonAddressMoveEvent.php | 4 +- .../AccompanyingPeriodWorkEventListener.php | 2 +- .../AdministrativeLocationAggregator.php | 2 +- .../ClosingMotiveAggregator.php | 2 +- .../ConfidentialAggregator.php | 2 +- .../CreatorJobAggregator.php | 2 +- .../DurationAggregator.php | 2 +- .../EmergencyAggregator.php | 2 +- .../EvaluationAggregator.php | 2 +- .../GeographicalUnitStatAggregator.php | 2 +- .../IntensityAggregator.php | 2 +- .../OriginAggregator.php | 4 +- .../ReferrerAggregator.php | 2 +- .../ReferrerScopeAggregator.php | 2 +- .../RequestorAggregator.php | 2 +- .../ScopeAggregator.php | 2 +- .../SocialActionAggregator.php | 2 +- .../SocialIssueAggregator.php | 2 +- .../StepAggregator.php | 2 +- .../UserJobAggregator.php | 2 +- .../ByEndDateAggregator.php | 2 - .../ByMaxDateAggregator.php | 2 - .../ByStartDateAggregator.php | 2 - .../EvaluationTypeAggregator.php | 2 +- .../HavingEndDateAggregator.php | 2 +- .../ChildrenNumberAggregator.php | 2 +- .../CompositionAggregator.php | 2 +- .../PersonAggregators/AgeAggregator.php | 2 +- .../ByHouseholdCompositionAggregator.php | 2 +- .../CountryOfBirthAggregator.php | 2 +- .../PersonAggregators/GenderAggregator.php | 2 +- .../GeographicalUnitAggregator.php | 2 +- .../HouseholdPositionAggregator.php | 2 +- .../MaritalStatusAggregator.php | 2 +- .../NationalityAggregator.php | 2 +- .../ActionTypeAggregator.php | 2 +- .../CurrentActionAggregator.php | 2 +- .../SocialWorkAggregators/GoalAggregator.php | 2 +- .../GoalResultAggregator.php | 2 +- .../SocialWorkAggregators/JobAggregator.php | 2 +- .../ReferrerAggregator.php | 2 +- .../ResultAggregator.php | 2 +- .../SocialWorkAggregators/ScopeAggregator.php | 2 +- .../ChillPersonBundle/Export/Declarations.php | 12 +++--- .../Export/Export/CountEvaluation.php | 2 +- .../Export/Export/CountHousehold.php | 2 +- .../CountPersonWithAccompanyingCourse.php | 2 +- .../Export/Export/ListAccompanyingPeriod.php | 2 +- .../Export/ListAccompanyingPeriodWork.php | 2 +- .../Export/Export/ListEvaluation.php | 2 +- .../Export/Export/ListHouseholdInPeriod.php | 2 +- .../Export/Export/ListPerson.php | 2 +- .../Export/Export/ListPersonDuplicate.php | 4 +- .../ListPersonWithAccompanyingPeriod.php | 2 +- .../Export/StatAccompanyingCourseDuration.php | 2 +- .../ActiveOnDateFilter.php | 2 +- .../ActiveOneDayBetweenDatesFilter.php | 2 +- .../AdministrativeLocationFilter.php | 2 +- .../ClosingMotiveFilter.php | 2 +- .../ConfidentialFilter.php | 2 +- .../CreatorJobFilter.php | 2 +- .../EmergencyFilter.php | 2 +- .../EvaluationFilter.php | 2 +- .../GeographicalUnitStatFilter.php | 2 +- .../HasNoReferrerFilter.php | 2 +- .../HasTemporaryLocationFilter.php | 2 +- .../IntensityFilter.php | 2 +- .../OpenBetweenDatesFilter.php | 2 +- .../OriginFilter.php | 2 +- .../ReferrerFilter.php | 2 +- .../RequestorFilter.php | 2 +- .../SocialActionFilter.php | 2 +- .../SocialIssueFilter.php | 2 +- .../AccompanyingCourseFilters/StepFilter.php | 2 +- .../UserJobFilter.php | 2 +- .../UserScopeFilter.php | 2 +- .../EvaluationFilters/ByEndDateFilter.php | 2 +- .../EvaluationFilters/ByStartDateFilter.php | 2 +- .../EvaluationTypeFilter.php | 2 +- .../EvaluationFilters/MaxDateFilter.php | 2 +- .../HouseholdFilters/CompositionFilter.php | 2 +- .../PersonFilters/AddressRefStatusFilter.php | 2 +- .../Export/Filter/PersonFilters/AgeFilter.php | 2 +- .../Filter/PersonFilters/BirthdateFilter.php | 2 +- .../ByHouseholdCompositionFilter.php | 2 +- .../PersonFilters/DeadOrAliveFilter.php | 2 +- .../Filter/PersonFilters/DeathdateFilter.php | 2 +- .../PersonFilters/GeographicalUnitFilter.php | 2 +- .../PersonFilters/MaritalStatusFilter.php | 2 +- .../PersonFilters/NationalityFilter.php | 2 +- .../ResidentialAddressAtThirdpartyFilter.php | 2 +- .../ResidentialAddressAtUserFilter.php | 2 +- .../WithoutHouseholdComposition.php | 2 +- .../Filter/SocialWorkFilters/JobFilter.php | 2 +- .../Filter/SocialWorkFilters/ScopeFilter.php | 2 +- .../SocialWorkTypeFilter.php | 2 +- .../Export/Helper/LabelPersonHelper.php | 2 +- .../Export/Helper/ListPersonHelper.php | 6 +-- .../Form/CreationPersonType.php | 8 ++-- .../Form/HouseholdCompositionType.php | 2 +- .../Form/PersonResourceType.php | 2 +- .../ChillPersonBundle/Form/PersonType.php | 2 +- .../Form/Type/PersonAltNameType.php | 2 +- .../Form/Type/PersonPhoneType.php | 2 +- .../Form/Type/PickPersonDynamicType.php | 2 +- .../Form/Type/PickSocialActionType.php | 2 +- .../Form/Type/PickSocialIssueType.php | 2 +- .../Form/Type/Select2MaritalStatusType.php | 2 +- .../Household/MembersEditor.php | 8 ++-- .../Household/MembersEditorFactory.php | 2 +- .../Menu/PersonMenuBuilder.php | 4 +- .../Menu/SectionMenuBuilder.php | 2 +- .../AccompanyingPeriodNotificationHandler.php | 2 +- .../AccompanyingPeriodPrivacyEvent.php | 2 +- .../Privacy/PrivacyEvent.php | 4 +- ...PeriodWorkEvaluationDocumentRepository.php | 2 +- ...mpanyingPeriodWorkEvaluationRepository.php | 2 +- .../AccompanyingPeriodWorkGoalRepository.php | 2 +- .../AccompanyingPeriodWorkRepository.php | 2 +- .../ClosingMotiveRepository.php | 2 +- .../AccompanyingPeriod/CommentRepository.php | 2 +- .../AccompanyingPeriod/OriginRepository.php | 2 +- .../AccompanyingPeriod/ResourceRepository.php | 2 +- .../AccompanyingPeriodACLAwareRepository.php | 2 +- ...ompanyingPeriodParticipationRepository.php | 2 +- .../AccompanyingPeriodRepository.php | 2 +- .../Household/HouseholdACLAwareRepository.php | 2 +- .../HouseholdCompositionRepository.php | 2 +- .../HouseholdCompositionTypeRepository.php | 2 +- .../Household/HouseholdMembersRepository.php | 2 +- .../Household/HouseholdRepository.php | 4 +- .../PersonHouseholdAddressRepository.php | 2 +- .../Household/PositionRepository.php | 2 +- .../Repository/MaritalStatusRepository.php | 2 +- .../Person/PersonCenterHistoryRepository.php | 2 +- .../Repository/PersonACLAwareRepository.php | 2 +- .../Repository/PersonAltNameRepository.php | 2 +- .../PersonNotDuplicateRepository.php | 2 +- .../Repository/PersonRepository.php | 2 +- .../Repository/PersonResourceRepository.php | 2 +- .../Relationships/RelationRepository.php | 2 +- .../Relationships/RelationshipRepository.php | 4 +- .../SocialWork/EvaluationRepository.php | 2 +- .../Repository/SocialWork/GoalRepository.php | 2 +- .../SocialWork/ResultRepository.php | 2 +- .../SocialWork/SocialActionRepository.php | 2 +- .../SocialWork/SocialIssueRepository.php | 2 +- .../ChillPersonBundle/Search/PersonSearch.php | 6 +-- .../Search/SearchHouseholdApiProvider.php | 2 +- .../Search/SearchPersonApiProvider.php | 2 +- .../Search/SimilarPersonMatcher.php | 4 +- .../AccompanyingPeriodCommentVoter.php | 6 +-- .../AccompanyingPeriodResourceVoter.php | 4 +- .../Authorization/AccompanyingPeriodVoter.php | 32 +++++++------- ...nyingPeriodWorkEvaluationDocumentVoter.php | 4 +- .../AccompanyingPeriodWorkEvaluationVoter.php | 8 ++-- .../AccompanyingPeriodWorkVoter.php | 14 +++---- .../Security/Authorization/HouseholdVoter.php | 12 +++--- .../Security/Authorization/PersonVoter.php | 12 +++--- .../AuthorizedCenterOnPersonCreation.php | 4 +- .../AccompanyingPeriodDocGenNormalizer.php | 2 +- .../AccompanyingPeriodResourceNormalizer.php | 2 +- .../AccompanyingPeriodWorkDenormalizer.php | 6 +-- ...PeriodWorkEvaluationDocumentNormalizer.php | 2 +- ...mpanyingPeriodWorkEvaluationNormalizer.php | 2 +- .../AccompanyingPeriodWorkNormalizer.php | 2 +- .../Normalizer/MembersEditorNormalizer.php | 2 +- .../Normalizer/PersonDocGenNormalizer.php | 2 +- .../Normalizer/PersonJsonNormalizer.php | 21 ++++------ .../RelationshipDocGenNormalizer.php | 2 +- .../Normalizer/SocialActionNormalizer.php | 2 +- .../Normalizer/SocialIssueNormalizer.php | 2 +- .../Normalizer/WorkflowNormalizer.php | 2 +- .../OldDraftAccompanyingPeriodRemover.php | 2 +- .../AccompanyingPeriodContext.php | 2 +- .../AccompanyingPeriodWorkContext.php | 2 +- ...ccompanyingPeriodWorkEvaluationContext.php | 2 +- .../Service/DocGenerator/PersonContext.php | 22 +++++----- .../PersonContextWithThirdParty.php | 2 +- .../Service/Import/SocialWorkMetadata.php | 2 +- .../Templating/Entity/ClosingMotiveRender.php | 2 +- .../Templating/Entity/PersonRender.php | 2 +- .../Templating/Entity/ResourceKindRender.php | 2 +- .../Templating/Entity/SocialActionRender.php | 12 +++--- .../Templating/Entity/SocialIssueRender.php | 2 +- .../AccompanyingPeriodConfidentialTest.php | 2 +- .../AccompanyingCourseApiControllerTest.php | 22 +++++----- .../AccompanyingCourseControllerTest.php | 4 +- .../AccompanyingPeriodControllerTest.php | 6 +-- ...rsonControllerViewWithHiddenFieldsTest.php | 2 +- .../Tests/Form/Type/PickPersonTypeTest.php | 4 +- .../Tests/Search/PersonSearchTest.php | 12 +++--- ...ngPeriodWorkEvaluationDenormalizerTest.php | 2 +- .../Normalizer/HouseholdNormalizerTest.php | 2 +- .../Normalizer/PersonDocGenNormalizerTest.php | 6 +-- .../TimelineAccompanyingPeriodTest.php | 2 +- .../AbstractTimelineAccompanyingPeriod.php | 2 +- .../AccompanyingPeriodValidityValidator.php | 2 +- .../LocationValidityValidator.php | 2 +- .../ParticipationOverlapValidator.php | 2 +- .../ResourceDuplicateCheckValidator.php | 2 +- ...HouseholdMembershipSequentialValidator.php | 2 +- .../Constraints/Person/Birthdate.php | 2 +- .../Person/PersonHasCenterValidator.php | 4 +- .../RelationshipNoDuplicateValidator.php | 2 +- ...dWorkEvaluationDocumentWorkflowHandler.php | 2 +- ...ingPeriodWorkEvaluationWorkflowHandler.php | 2 +- .../AccompanyingPeriodWorkWorkflowHandler.php | 2 +- .../Export/Export/ReportList.php | 8 ++-- .../Export/Filter/ReportDateFilter.php | 2 +- .../ChillReportBundle/Search/ReportSearch.php | 4 +- .../Security/Authorization/ReportVoter.php | 8 ++-- .../Tests/Controller/ReportControllerTest.php | 4 +- .../Timeline/TimelineReportProvider.php | 2 +- .../Controller/SingleTaskController.php | 2 +- .../ChillTaskBundle/Event/TaskEvent.php | 2 +- .../ChillTaskBundle/Event/UI/UIEvent.php | 6 +-- .../ChillTaskBundle/Form/SingleTaskType.php | 2 +- .../SingleTaskAclAwareRepository.php | 6 +-- .../Repository/SingleTaskRepository.php | 10 ++--- .../Authorization/AuthorizationEvent.php | 8 ++-- .../Security/Authorization/TaskVoter.php | 8 ++-- .../Templating/TaskTwigExtension.php | 2 +- .../Templating/UI/CountNotificationTask.php | 4 +- .../SingleTaskACLAwareRepositoryTest.php | 2 +- ...TaskTaskLifeCycleEventTimelineProvider.php | 2 +- .../TaskLifeCycleEventTimelineProvider.php | 2 +- .../Definition/DefaultTaskDefinition.php | 4 +- .../Controller/ThirdPartyController.php | 2 +- .../DataFixtures/ORM/LoadThirdParty.php | 2 +- .../ThirdPartyTypeCompilerPass.php | 2 +- .../Entity/ThirdParty.php | 6 +-- .../Export/Helper/LabelThirdPartyHelper.php | 2 +- .../Form/ThirdPartyType.php | 2 +- .../Type/PickThirdPartyTypeCategoryType.php | 2 +- .../Form/Type/PickThirdpartyDynamicType.php | 2 +- .../ThirdPartyACLAwareRepository.php | 2 +- .../Repository/ThirdPartyRepository.php | 2 +- .../Search/ThirdPartyApiSearch.php | 2 +- .../Search/ThirdPartySearch.php | 4 +- .../Security/Voter/ThirdPartyVoter.php | 6 +-- .../Normalizer/ThirdPartyNormalizer.php | 2 +- .../ThirdPartyType/ThirdPartyTypeManager.php | 2 +- .../src/Controller/Convert.php | 12 +++--- .../ChillWopiBundle/src/Controller/Editor.php | 2 +- .../src/Service/Controller/Responder.php | 9 +--- .../src/Service/Wopi/AuthorizationManager.php | 2 +- .../Service/Wopi/ChillDocumentLockManager.php | 2 +- .../src/Service/Wopi/ChillDocumentManager.php | 12 +++--- .../src/Service/Wopi/ChillWopi.php | 2 +- .../src/Service/Wopi/UserManager.php | 2 +- 733 files changed, 1257 insertions(+), 1322 deletions(-) diff --git a/docs/source/development/user-interface/widgets/ChillMainConfiguration.php b/docs/source/development/user-interface/widgets/ChillMainConfiguration.php index b4567729c..14588a487 100644 --- a/docs/source/development/user-interface/widgets/ChillMainConfiguration.php +++ b/docs/source/development/user-interface/widgets/ChillMainConfiguration.php @@ -25,7 +25,7 @@ class ChillMainConfiguration implements ConfigurationInterface public function __construct( array $widgetFactories, - private ContainerBuilder $containerBuilder + private readonly ContainerBuilder $containerBuilder ) { // we register here widget factories (see below) $this->setWidgetFactories($widgetFactories); diff --git a/src/Bundle/ChillActivityBundle/Controller/ActivityController.php b/src/Bundle/ChillActivityBundle/Controller/ActivityController.php index 69d3f3312..75f393bc0 100644 --- a/src/Bundle/ChillActivityBundle/Controller/ActivityController.php +++ b/src/Bundle/ChillActivityBundle/Controller/ActivityController.php @@ -48,23 +48,22 @@ use function array_key_exists; final class ActivityController extends AbstractController { public function __construct( - private ActivityACLAwareRepositoryInterface $activityACLAwareRepository, - private ActivityTypeRepositoryInterface $activityTypeRepository, - private ActivityTypeCategoryRepository $activityTypeCategoryRepository, - private PersonRepository $personRepository, - private ThirdPartyRepository $thirdPartyRepository, - private LocationRepository $locationRepository, - private ActivityRepository $activityRepository, - private AccompanyingPeriodRepository $accompanyingPeriodRepository, - private EntityManagerInterface $entityManager, - private EventDispatcherInterface $eventDispatcher, - private LoggerInterface $logger, - private SerializerInterface $serializer, - private UserRepositoryInterface $userRepository, - private CenterResolverManagerInterface $centerResolver, - private TranslatorInterface $translator, - ) - { + private readonly ActivityACLAwareRepositoryInterface $activityACLAwareRepository, + private readonly ActivityTypeRepositoryInterface $activityTypeRepository, + private readonly ActivityTypeCategoryRepository $activityTypeCategoryRepository, + private readonly PersonRepository $personRepository, + private readonly ThirdPartyRepository $thirdPartyRepository, + private readonly LocationRepository $locationRepository, + private readonly ActivityRepository $activityRepository, + private readonly AccompanyingPeriodRepository $accompanyingPeriodRepository, + private readonly EntityManagerInterface $entityManager, + private readonly EventDispatcherInterface $eventDispatcher, + private readonly LoggerInterface $logger, + private readonly SerializerInterface $serializer, + private readonly UserRepositoryInterface $userRepository, + private readonly CenterResolverManagerInterface $centerResolver, + private readonly TranslatorInterface $translator, + ) { } /** diff --git a/src/Bundle/ChillActivityBundle/Controller/ActivityReasonController.php b/src/Bundle/ChillActivityBundle/Controller/ActivityReasonController.php index 60a7636e4..226177d7f 100644 --- a/src/Bundle/ChillActivityBundle/Controller/ActivityReasonController.php +++ b/src/Bundle/ChillActivityBundle/Controller/ActivityReasonController.php @@ -24,7 +24,7 @@ use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; */ class ActivityReasonController extends AbstractController { - public function __construct(private ActivityReasonRepository $activityReasonRepository) + public function __construct(private readonly ActivityReasonRepository $activityReasonRepository) { } diff --git a/src/Bundle/ChillActivityBundle/DataFixtures/ORM/LoadActivity.php b/src/Bundle/ChillActivityBundle/DataFixtures/ORM/LoadActivity.php index 74eb4f8d3..9f0c59784 100644 --- a/src/Bundle/ChillActivityBundle/DataFixtures/ORM/LoadActivity.php +++ b/src/Bundle/ChillActivityBundle/DataFixtures/ORM/LoadActivity.php @@ -30,7 +30,7 @@ class LoadActivity extends AbstractFixture implements OrderedFixtureInterface */ private $faker; - public function __construct(private EntityManagerInterface $em) + public function __construct(private readonly EntityManagerInterface $em) { $this->faker = FakerFactory::create('fr_FR'); } diff --git a/src/Bundle/ChillActivityBundle/Entity/Activity.php b/src/Bundle/ChillActivityBundle/Entity/Activity.php index 32ceb2e74..c697cdf9b 100644 --- a/src/Bundle/ChillActivityBundle/Entity/Activity.php +++ b/src/Bundle/ChillActivityBundle/Entity/Activity.php @@ -65,9 +65,9 @@ class Activity implements AccompanyingPeriodLinkedWithSocialIssuesEntityInterfac use TrackUpdateTrait; - public const SENTRECEIVED_RECEIVED = 'received'; + final public const SENTRECEIVED_RECEIVED = 'received'; - public const SENTRECEIVED_SENT = 'sent'; + final public const SENTRECEIVED_SENT = 'sent'; /** * @ORM\ManyToOne(targetEntity="Chill\PersonBundle\Entity\AccompanyingPeriod") diff --git a/src/Bundle/ChillActivityBundle/Entity/ActivityType.php b/src/Bundle/ChillActivityBundle/Entity/ActivityType.php index f49297f02..aa6598b0b 100644 --- a/src/Bundle/ChillActivityBundle/Entity/ActivityType.php +++ b/src/Bundle/ChillActivityBundle/Entity/ActivityType.php @@ -27,11 +27,11 @@ use Symfony\Component\Validator\Context\ExecutionContextInterface; */ class ActivityType { - public const FIELD_INVISIBLE = 0; + final public const FIELD_INVISIBLE = 0; - public const FIELD_OPTIONAL = 1; + final public const FIELD_OPTIONAL = 1; - public const FIELD_REQUIRED = 2; + final public const FIELD_REQUIRED = 2; /** * @deprecated not in use diff --git a/src/Bundle/ChillActivityBundle/EntityListener/ActivityEntityListener.php b/src/Bundle/ChillActivityBundle/EntityListener/ActivityEntityListener.php index fb2fb8a1c..8ae053728 100644 --- a/src/Bundle/ChillActivityBundle/EntityListener/ActivityEntityListener.php +++ b/src/Bundle/ChillActivityBundle/EntityListener/ActivityEntityListener.php @@ -22,7 +22,7 @@ use function in_array; class ActivityEntityListener { - public function __construct(private EntityManagerInterface $em, private AccompanyingPeriodWorkRepository $workRepository) + public function __construct(private readonly EntityManagerInterface $em, private readonly AccompanyingPeriodWorkRepository $workRepository) { } diff --git a/src/Bundle/ChillActivityBundle/Export/Aggregator/ACPAggregators/ByCreatorAggregator.php b/src/Bundle/ChillActivityBundle/Export/Aggregator/ACPAggregators/ByCreatorAggregator.php index 60cff42f8..5e20bd6ab 100644 --- a/src/Bundle/ChillActivityBundle/Export/Aggregator/ACPAggregators/ByCreatorAggregator.php +++ b/src/Bundle/ChillActivityBundle/Export/Aggregator/ACPAggregators/ByCreatorAggregator.php @@ -20,7 +20,7 @@ use Symfony\Component\Form\FormBuilderInterface; class ByCreatorAggregator implements AggregatorInterface { - public function __construct(private UserRepositoryInterface $userRepository, private UserRender $userRender) + public function __construct(private readonly UserRepositoryInterface $userRepository, private readonly UserRender $userRender) { } diff --git a/src/Bundle/ChillActivityBundle/Export/Aggregator/ACPAggregators/BySocialActionAggregator.php b/src/Bundle/ChillActivityBundle/Export/Aggregator/ACPAggregators/BySocialActionAggregator.php index a09c254eb..c3f205543 100644 --- a/src/Bundle/ChillActivityBundle/Export/Aggregator/ACPAggregators/BySocialActionAggregator.php +++ b/src/Bundle/ChillActivityBundle/Export/Aggregator/ACPAggregators/BySocialActionAggregator.php @@ -21,7 +21,7 @@ use function in_array; class BySocialActionAggregator implements AggregatorInterface { - public function __construct(private SocialActionRender $actionRender, private SocialActionRepository $actionRepository) + public function __construct(private readonly SocialActionRender $actionRender, private readonly SocialActionRepository $actionRepository) { } diff --git a/src/Bundle/ChillActivityBundle/Export/Aggregator/ACPAggregators/BySocialIssueAggregator.php b/src/Bundle/ChillActivityBundle/Export/Aggregator/ACPAggregators/BySocialIssueAggregator.php index 111bdcf4b..a54049e13 100644 --- a/src/Bundle/ChillActivityBundle/Export/Aggregator/ACPAggregators/BySocialIssueAggregator.php +++ b/src/Bundle/ChillActivityBundle/Export/Aggregator/ACPAggregators/BySocialIssueAggregator.php @@ -21,7 +21,7 @@ use function in_array; class BySocialIssueAggregator implements AggregatorInterface { - public function __construct(private SocialIssueRepository $issueRepository, private SocialIssueRender $issueRender) + public function __construct(private readonly SocialIssueRepository $issueRepository, private readonly SocialIssueRender $issueRender) { } diff --git a/src/Bundle/ChillActivityBundle/Export/Aggregator/ACPAggregators/ByThirdpartyAggregator.php b/src/Bundle/ChillActivityBundle/Export/Aggregator/ACPAggregators/ByThirdpartyAggregator.php index 83c4a5d2a..7b0996eb4 100644 --- a/src/Bundle/ChillActivityBundle/Export/Aggregator/ACPAggregators/ByThirdpartyAggregator.php +++ b/src/Bundle/ChillActivityBundle/Export/Aggregator/ACPAggregators/ByThirdpartyAggregator.php @@ -21,7 +21,7 @@ use function in_array; class ByThirdpartyAggregator implements AggregatorInterface { - public function __construct(private ThirdPartyRepository $thirdPartyRepository, private ThirdPartyRender $thirdPartyRender) + public function __construct(private readonly ThirdPartyRepository $thirdPartyRepository, private readonly ThirdPartyRender $thirdPartyRender) { } diff --git a/src/Bundle/ChillActivityBundle/Export/Aggregator/ACPAggregators/CreatorScopeAggregator.php b/src/Bundle/ChillActivityBundle/Export/Aggregator/ACPAggregators/CreatorScopeAggregator.php index 3014352ad..249bb0a5d 100644 --- a/src/Bundle/ChillActivityBundle/Export/Aggregator/ACPAggregators/CreatorScopeAggregator.php +++ b/src/Bundle/ChillActivityBundle/Export/Aggregator/ACPAggregators/CreatorScopeAggregator.php @@ -21,7 +21,7 @@ use function in_array; class CreatorScopeAggregator implements AggregatorInterface { - public function __construct(private ScopeRepository $scopeRepository, private TranslatableStringHelper $translatableStringHelper) + public function __construct(private readonly ScopeRepository $scopeRepository, private readonly TranslatableStringHelper $translatableStringHelper) { } diff --git a/src/Bundle/ChillActivityBundle/Export/Aggregator/ACPAggregators/DateAggregator.php b/src/Bundle/ChillActivityBundle/Export/Aggregator/ACPAggregators/DateAggregator.php index a4f93e3b3..461fac62d 100644 --- a/src/Bundle/ChillActivityBundle/Export/Aggregator/ACPAggregators/DateAggregator.php +++ b/src/Bundle/ChillActivityBundle/Export/Aggregator/ACPAggregators/DateAggregator.php @@ -29,7 +29,7 @@ class DateAggregator implements AggregatorInterface private const DEFAULT_CHOICE = 'year'; - public function __construct(private TranslatorInterface $translator) + public function __construct(private readonly TranslatorInterface $translator) { } diff --git a/src/Bundle/ChillActivityBundle/Export/Aggregator/ACPAggregators/LocationTypeAggregator.php b/src/Bundle/ChillActivityBundle/Export/Aggregator/ACPAggregators/LocationTypeAggregator.php index fa2c7f7c2..6c023692e 100644 --- a/src/Bundle/ChillActivityBundle/Export/Aggregator/ACPAggregators/LocationTypeAggregator.php +++ b/src/Bundle/ChillActivityBundle/Export/Aggregator/ACPAggregators/LocationTypeAggregator.php @@ -21,7 +21,7 @@ use function in_array; class LocationTypeAggregator implements AggregatorInterface { - public function __construct(private LocationTypeRepository $locationTypeRepository, private TranslatableStringHelper $translatableStringHelper) + public function __construct(private readonly LocationTypeRepository $locationTypeRepository, private readonly TranslatableStringHelper $translatableStringHelper) { } diff --git a/src/Bundle/ChillActivityBundle/Export/Aggregator/ActivityTypeAggregator.php b/src/Bundle/ChillActivityBundle/Export/Aggregator/ActivityTypeAggregator.php index 272727d55..f262c8b58 100644 --- a/src/Bundle/ChillActivityBundle/Export/Aggregator/ActivityTypeAggregator.php +++ b/src/Bundle/ChillActivityBundle/Export/Aggregator/ActivityTypeAggregator.php @@ -22,7 +22,7 @@ use function in_array; class ActivityTypeAggregator implements AggregatorInterface { - public const KEY = 'activity_type_aggregator'; + final public const KEY = 'activity_type_aggregator'; public function __construct(protected ActivityTypeRepositoryInterface $activityTypeRepository, protected TranslatableStringHelperInterface $translatableStringHelper) { diff --git a/src/Bundle/ChillActivityBundle/Export/Aggregator/ActivityUserAggregator.php b/src/Bundle/ChillActivityBundle/Export/Aggregator/ActivityUserAggregator.php index 228ab8500..a79cfcffd 100644 --- a/src/Bundle/ChillActivityBundle/Export/Aggregator/ActivityUserAggregator.php +++ b/src/Bundle/ChillActivityBundle/Export/Aggregator/ActivityUserAggregator.php @@ -21,9 +21,9 @@ use Symfony\Component\Form\FormBuilderInterface; class ActivityUserAggregator implements AggregatorInterface { - public const KEY = 'activity_user_id'; + final public const KEY = 'activity_user_id'; - public function __construct(private UserRepository $userRepository, private UserRender $userRender) + public function __construct(private readonly UserRepository $userRepository, private readonly UserRender $userRender) { } diff --git a/src/Bundle/ChillActivityBundle/Export/Aggregator/ActivityUsersAggregator.php b/src/Bundle/ChillActivityBundle/Export/Aggregator/ActivityUsersAggregator.php index c1b2ff845..b04fd9321 100644 --- a/src/Bundle/ChillActivityBundle/Export/Aggregator/ActivityUsersAggregator.php +++ b/src/Bundle/ChillActivityBundle/Export/Aggregator/ActivityUsersAggregator.php @@ -21,7 +21,7 @@ use function in_array; class ActivityUsersAggregator implements AggregatorInterface { - public function __construct(private UserRepositoryInterface $userRepository, private UserRender $userRender) + public function __construct(private readonly UserRepositoryInterface $userRepository, private readonly UserRender $userRender) { } diff --git a/src/Bundle/ChillActivityBundle/Export/Aggregator/ActivityUsersJobAggregator.php b/src/Bundle/ChillActivityBundle/Export/Aggregator/ActivityUsersJobAggregator.php index 1b8cb7e1c..d02017feb 100644 --- a/src/Bundle/ChillActivityBundle/Export/Aggregator/ActivityUsersJobAggregator.php +++ b/src/Bundle/ChillActivityBundle/Export/Aggregator/ActivityUsersJobAggregator.php @@ -20,7 +20,7 @@ use function in_array; class ActivityUsersJobAggregator implements \Chill\MainBundle\Export\AggregatorInterface { - public function __construct(private UserJobRepositoryInterface $userJobRepository, private TranslatableStringHelperInterface $translatableStringHelper) + public function __construct(private readonly UserJobRepositoryInterface $userJobRepository, private readonly TranslatableStringHelperInterface $translatableStringHelper) { } diff --git a/src/Bundle/ChillActivityBundle/Export/Aggregator/ActivityUsersScopeAggregator.php b/src/Bundle/ChillActivityBundle/Export/Aggregator/ActivityUsersScopeAggregator.php index 1f39ccf82..a83a7375a 100644 --- a/src/Bundle/ChillActivityBundle/Export/Aggregator/ActivityUsersScopeAggregator.php +++ b/src/Bundle/ChillActivityBundle/Export/Aggregator/ActivityUsersScopeAggregator.php @@ -20,7 +20,7 @@ use function in_array; class ActivityUsersScopeAggregator implements \Chill\MainBundle\Export\AggregatorInterface { - public function __construct(private ScopeRepositoryInterface $scopeRepository, private TranslatableStringHelperInterface $translatableStringHelper) + public function __construct(private readonly ScopeRepositoryInterface $scopeRepository, private readonly TranslatableStringHelperInterface $translatableStringHelper) { } diff --git a/src/Bundle/ChillActivityBundle/Export/Aggregator/SentReceivedAggregator.php b/src/Bundle/ChillActivityBundle/Export/Aggregator/SentReceivedAggregator.php index 7ff94aaca..ec0c00648 100644 --- a/src/Bundle/ChillActivityBundle/Export/Aggregator/SentReceivedAggregator.php +++ b/src/Bundle/ChillActivityBundle/Export/Aggregator/SentReceivedAggregator.php @@ -20,7 +20,7 @@ use Symfony\Contracts\Translation\TranslatorInterface; class SentReceivedAggregator implements AggregatorInterface { - public function __construct(private TranslatorInterface $translator) + public function __construct(private readonly TranslatorInterface $translator) { } diff --git a/src/Bundle/ChillActivityBundle/Export/Declarations.php b/src/Bundle/ChillActivityBundle/Export/Declarations.php index 79afb09c8..210988770 100644 --- a/src/Bundle/ChillActivityBundle/Export/Declarations.php +++ b/src/Bundle/ChillActivityBundle/Export/Declarations.php @@ -16,9 +16,9 @@ namespace Chill\ActivityBundle\Export; */ abstract class Declarations { - public const ACTIVITY = 'activity'; + final public const ACTIVITY = 'activity'; - public const ACTIVITY_ACP = 'activity_linked_to_acp'; + final public const ACTIVITY_ACP = 'activity_linked_to_acp'; - public const ACTIVITY_PERSON = 'activity_linked_to_person'; + final public const ACTIVITY_PERSON = 'activity_linked_to_person'; } diff --git a/src/Bundle/ChillActivityBundle/Export/Export/LinkedToACP/ListActivity.php b/src/Bundle/ChillActivityBundle/Export/Export/LinkedToACP/ListActivity.php index 6e98565c6..9dd8b1e4f 100644 --- a/src/Bundle/ChillActivityBundle/Export/Export/LinkedToACP/ListActivity.php +++ b/src/Bundle/ChillActivityBundle/Export/Export/LinkedToACP/ListActivity.php @@ -24,7 +24,7 @@ use Symfony\Component\Form\FormBuilderInterface; class ListActivity implements ListInterface, GroupedExportInterface { - public function __construct(private ListActivityHelper $helper, private EntityManagerInterface $entityManager, private TranslatableStringExportLabelHelper $translatableStringExportLabelHelper) + public function __construct(private readonly ListActivityHelper $helper, private readonly EntityManagerInterface $entityManager, private readonly TranslatableStringExportLabelHelper $translatableStringExportLabelHelper) { } diff --git a/src/Bundle/ChillActivityBundle/Export/Export/LinkedToPerson/ListActivity.php b/src/Bundle/ChillActivityBundle/Export/Export/LinkedToPerson/ListActivity.php index ff4d4fa47..21c85260b 100644 --- a/src/Bundle/ChillActivityBundle/Export/Export/LinkedToPerson/ListActivity.php +++ b/src/Bundle/ChillActivityBundle/Export/Export/LinkedToPerson/ListActivity.php @@ -50,7 +50,7 @@ class ListActivity implements ListInterface, GroupedExportInterface 'person_id', ]; - public function __construct(protected EntityManagerInterface $entityManager, protected TranslatorInterface $translator, protected TranslatableStringHelperInterface $translatableStringHelper, private ActivityRepository $activityRepository) + public function __construct(protected EntityManagerInterface $entityManager, protected TranslatorInterface $translator, protected TranslatableStringHelperInterface $translatableStringHelper, private readonly ActivityRepository $activityRepository) { } diff --git a/src/Bundle/ChillActivityBundle/Export/Export/LinkedToPerson/StatActivityDuration.php b/src/Bundle/ChillActivityBundle/Export/Export/LinkedToPerson/StatActivityDuration.php index bb8be00ff..da1669756 100644 --- a/src/Bundle/ChillActivityBundle/Export/Export/LinkedToPerson/StatActivityDuration.php +++ b/src/Bundle/ChillActivityBundle/Export/Export/LinkedToPerson/StatActivityDuration.php @@ -30,13 +30,13 @@ use Symfony\Component\Form\FormBuilderInterface; */ class StatActivityDuration implements ExportInterface, GroupedExportInterface { - public const SUM = 'sum'; + final public const SUM = 'sum'; /** * @param string $action the stat to perform */ public function __construct( - private ActivityRepository $activityRepository, + private readonly ActivityRepository $activityRepository, /** * The action for this report. */ diff --git a/src/Bundle/ChillActivityBundle/Export/Export/ListActivityHelper.php b/src/Bundle/ChillActivityBundle/Export/Export/ListActivityHelper.php index 43c9f4688..79d297851 100644 --- a/src/Bundle/ChillActivityBundle/Export/Export/ListActivityHelper.php +++ b/src/Bundle/ChillActivityBundle/Export/Export/ListActivityHelper.php @@ -30,9 +30,9 @@ use const SORT_NUMERIC; class ListActivityHelper { - public const MSG_KEY = 'export.list.activity.'; + final public const MSG_KEY = 'export.list.activity.'; - public function __construct(private ActivityPresenceRepositoryInterface $activityPresenceRepository, private ActivityTypeRepositoryInterface $activityTypeRepository, private DateTimeHelper $dateTimeHelper, private LabelPersonHelper $labelPersonHelper, private LabelThirdPartyHelper $labelThirdPartyHelper, private TranslatorInterface $translator, private TranslatableStringHelperInterface $translatableStringHelper, private TranslatableStringExportLabelHelper $translatableStringLabelHelper, private UserHelper $userHelper) + public function __construct(private readonly ActivityPresenceRepositoryInterface $activityPresenceRepository, private readonly ActivityTypeRepositoryInterface $activityTypeRepository, private readonly DateTimeHelper $dateTimeHelper, private readonly LabelPersonHelper $labelPersonHelper, private readonly LabelThirdPartyHelper $labelThirdPartyHelper, private readonly TranslatorInterface $translator, private readonly TranslatableStringHelperInterface $translatableStringHelper, private readonly TranslatableStringExportLabelHelper $translatableStringLabelHelper, private readonly UserHelper $userHelper) { } diff --git a/src/Bundle/ChillActivityBundle/Export/Filter/ACPFilters/ActivityTypeFilter.php b/src/Bundle/ChillActivityBundle/Export/Filter/ACPFilters/ActivityTypeFilter.php index a1f2bc786..163ac4208 100644 --- a/src/Bundle/ChillActivityBundle/Export/Filter/ACPFilters/ActivityTypeFilter.php +++ b/src/Bundle/ChillActivityBundle/Export/Filter/ACPFilters/ActivityTypeFilter.php @@ -23,7 +23,7 @@ use Symfony\Component\Form\FormBuilderInterface; class ActivityTypeFilter implements FilterInterface { - public function __construct(private ActivityTypeRepositoryInterface $activityTypeRepository, private TranslatableStringHelperInterface $translatableStringHelper) + public function __construct(private readonly ActivityTypeRepositoryInterface $activityTypeRepository, private readonly TranslatableStringHelperInterface $translatableStringHelper) { } diff --git a/src/Bundle/ChillActivityBundle/Export/Filter/ACPFilters/ByCreatorFilter.php b/src/Bundle/ChillActivityBundle/Export/Filter/ACPFilters/ByCreatorFilter.php index 28264c919..3c8df8df6 100644 --- a/src/Bundle/ChillActivityBundle/Export/Filter/ACPFilters/ByCreatorFilter.php +++ b/src/Bundle/ChillActivityBundle/Export/Filter/ACPFilters/ByCreatorFilter.php @@ -20,7 +20,7 @@ use Symfony\Component\Form\FormBuilderInterface; class ByCreatorFilter implements FilterInterface { - public function __construct(private UserRender $userRender) + public function __construct(private readonly UserRender $userRender) { } diff --git a/src/Bundle/ChillActivityBundle/Export/Filter/ACPFilters/BySocialActionFilter.php b/src/Bundle/ChillActivityBundle/Export/Filter/ACPFilters/BySocialActionFilter.php index 89330728f..08ffdb638 100644 --- a/src/Bundle/ChillActivityBundle/Export/Filter/ACPFilters/BySocialActionFilter.php +++ b/src/Bundle/ChillActivityBundle/Export/Filter/ACPFilters/BySocialActionFilter.php @@ -22,7 +22,7 @@ use function in_array; class BySocialActionFilter implements FilterInterface { - public function __construct(private SocialActionRender $actionRender) + public function __construct(private readonly SocialActionRender $actionRender) { } diff --git a/src/Bundle/ChillActivityBundle/Export/Filter/ACPFilters/BySocialIssueFilter.php b/src/Bundle/ChillActivityBundle/Export/Filter/ACPFilters/BySocialIssueFilter.php index d78efbde0..e3163798d 100644 --- a/src/Bundle/ChillActivityBundle/Export/Filter/ACPFilters/BySocialIssueFilter.php +++ b/src/Bundle/ChillActivityBundle/Export/Filter/ACPFilters/BySocialIssueFilter.php @@ -22,7 +22,7 @@ use function in_array; class BySocialIssueFilter implements FilterInterface { - public function __construct(private SocialIssueRender $issueRender) + public function __construct(private readonly SocialIssueRender $issueRender) { } diff --git a/src/Bundle/ChillActivityBundle/Export/Filter/ACPFilters/EmergencyFilter.php b/src/Bundle/ChillActivityBundle/Export/Filter/ACPFilters/EmergencyFilter.php index aff224bf3..ea2a70a77 100644 --- a/src/Bundle/ChillActivityBundle/Export/Filter/ACPFilters/EmergencyFilter.php +++ b/src/Bundle/ChillActivityBundle/Export/Filter/ACPFilters/EmergencyFilter.php @@ -28,7 +28,7 @@ class EmergencyFilter implements FilterInterface private const DEFAULT_CHOICE = false; - public function __construct(private TranslatorInterface $translator) + public function __construct(private readonly TranslatorInterface $translator) { } diff --git a/src/Bundle/ChillActivityBundle/Export/Filter/ACPFilters/LocationTypeFilter.php b/src/Bundle/ChillActivityBundle/Export/Filter/ACPFilters/LocationTypeFilter.php index 800381416..40835d367 100644 --- a/src/Bundle/ChillActivityBundle/Export/Filter/ACPFilters/LocationTypeFilter.php +++ b/src/Bundle/ChillActivityBundle/Export/Filter/ACPFilters/LocationTypeFilter.php @@ -22,7 +22,7 @@ use function in_array; class LocationTypeFilter implements FilterInterface { - public function __construct(private TranslatableStringHelper $translatableStringHelper) + public function __construct(private readonly TranslatableStringHelper $translatableStringHelper) { } diff --git a/src/Bundle/ChillActivityBundle/Export/Filter/ACPFilters/SentReceivedFilter.php b/src/Bundle/ChillActivityBundle/Export/Filter/ACPFilters/SentReceivedFilter.php index b901ebde7..6a44414a3 100644 --- a/src/Bundle/ChillActivityBundle/Export/Filter/ACPFilters/SentReceivedFilter.php +++ b/src/Bundle/ChillActivityBundle/Export/Filter/ACPFilters/SentReceivedFilter.php @@ -29,7 +29,7 @@ class SentReceivedFilter implements FilterInterface private const DEFAULT_CHOICE = Activity::SENTRECEIVED_SENT; - public function __construct(private TranslatorInterface $translator) + public function __construct(private readonly TranslatorInterface $translator) { } diff --git a/src/Bundle/ChillActivityBundle/Export/Filter/ACPFilters/UserFilter.php b/src/Bundle/ChillActivityBundle/Export/Filter/ACPFilters/UserFilter.php index 1a5d28059..f1537bfb2 100644 --- a/src/Bundle/ChillActivityBundle/Export/Filter/ACPFilters/UserFilter.php +++ b/src/Bundle/ChillActivityBundle/Export/Filter/ACPFilters/UserFilter.php @@ -21,7 +21,7 @@ use Symfony\Component\Form\FormBuilderInterface; class UserFilter implements FilterInterface { - public function __construct(private UserRender $userRender) + public function __construct(private readonly UserRender $userRender) { } diff --git a/src/Bundle/ChillActivityBundle/Export/Filter/ACPFilters/UserScopeFilter.php b/src/Bundle/ChillActivityBundle/Export/Filter/ACPFilters/UserScopeFilter.php index 47445a012..5cc872aea 100644 --- a/src/Bundle/ChillActivityBundle/Export/Filter/ACPFilters/UserScopeFilter.php +++ b/src/Bundle/ChillActivityBundle/Export/Filter/ACPFilters/UserScopeFilter.php @@ -23,7 +23,7 @@ use function in_array; class UserScopeFilter implements FilterInterface { - public function __construct(private TranslatableStringHelper $translatableStringHelper) + public function __construct(private readonly TranslatableStringHelper $translatableStringHelper) { } diff --git a/src/Bundle/ChillActivityBundle/Export/Filter/ActivityDateFilter.php b/src/Bundle/ChillActivityBundle/Export/Filter/ActivityDateFilter.php index 1ea273c64..30c625a39 100644 --- a/src/Bundle/ChillActivityBundle/Export/Filter/ActivityDateFilter.php +++ b/src/Bundle/ChillActivityBundle/Export/Filter/ActivityDateFilter.php @@ -27,7 +27,7 @@ use Symfony\Contracts\Translation\TranslatorInterface; class ActivityDateFilter implements FilterInterface { - public function __construct(protected TranslatorInterface $translator, private RollingDateConverterInterface $rollingDateConverter) + public function __construct(protected TranslatorInterface $translator, private readonly RollingDateConverterInterface $rollingDateConverter) { } diff --git a/src/Bundle/ChillActivityBundle/Export/Filter/ActivityUsersFilter.php b/src/Bundle/ChillActivityBundle/Export/Filter/ActivityUsersFilter.php index 735b66a31..43163b5ab 100644 --- a/src/Bundle/ChillActivityBundle/Export/Filter/ActivityUsersFilter.php +++ b/src/Bundle/ChillActivityBundle/Export/Filter/ActivityUsersFilter.php @@ -20,7 +20,7 @@ use Symfony\Component\Form\FormBuilderInterface; class ActivityUsersFilter implements FilterInterface { - public function __construct(private UserRender $userRender) + public function __construct(private readonly UserRender $userRender) { } diff --git a/src/Bundle/ChillActivityBundle/Export/Filter/UsersJobFilter.php b/src/Bundle/ChillActivityBundle/Export/Filter/UsersJobFilter.php index c9e942816..6f35e98b6 100644 --- a/src/Bundle/ChillActivityBundle/Export/Filter/UsersJobFilter.php +++ b/src/Bundle/ChillActivityBundle/Export/Filter/UsersJobFilter.php @@ -22,7 +22,7 @@ use Symfony\Component\Form\FormBuilderInterface; class UsersJobFilter implements FilterInterface { - public function __construct(private TranslatableStringHelperInterface $translatableStringHelper) + public function __construct(private readonly TranslatableStringHelperInterface $translatableStringHelper) { } diff --git a/src/Bundle/ChillActivityBundle/Export/Filter/UsersScopeFilter.php b/src/Bundle/ChillActivityBundle/Export/Filter/UsersScopeFilter.php index f93f982aa..58533cae4 100644 --- a/src/Bundle/ChillActivityBundle/Export/Filter/UsersScopeFilter.php +++ b/src/Bundle/ChillActivityBundle/Export/Filter/UsersScopeFilter.php @@ -23,7 +23,7 @@ use Symfony\Component\Form\FormBuilderInterface; class UsersScopeFilter implements FilterInterface { - public function __construct(private ScopeRepositoryInterface $scopeRepository, private TranslatableStringHelperInterface $translatableStringHelper) + public function __construct(private readonly ScopeRepositoryInterface $scopeRepository, private readonly TranslatableStringHelperInterface $translatableStringHelper) { } diff --git a/src/Bundle/ChillActivityBundle/Form/ActivityTypeType.php b/src/Bundle/ChillActivityBundle/Form/ActivityTypeType.php index 6288486f7..63b1ab6c8 100644 --- a/src/Bundle/ChillActivityBundle/Form/ActivityTypeType.php +++ b/src/Bundle/ChillActivityBundle/Form/ActivityTypeType.php @@ -25,7 +25,7 @@ use Symfony\Component\OptionsResolver\OptionsResolver; class ActivityTypeType extends AbstractType { - public function __construct(private TranslatableStringHelper $translatableStringHelper) + public function __construct(private readonly TranslatableStringHelper $translatableStringHelper) { } diff --git a/src/Bundle/ChillActivityBundle/Form/Type/PickActivityReasonType.php b/src/Bundle/ChillActivityBundle/Form/Type/PickActivityReasonType.php index 4709b3010..392019ec9 100644 --- a/src/Bundle/ChillActivityBundle/Form/Type/PickActivityReasonType.php +++ b/src/Bundle/ChillActivityBundle/Form/Type/PickActivityReasonType.php @@ -24,7 +24,7 @@ use Symfony\Component\OptionsResolver\OptionsResolver; */ class PickActivityReasonType extends AbstractType { - public function __construct(private ActivityReasonRepository $activityReasonRepository, private ActivityReasonRender $reasonRender, private TranslatableStringHelperInterface $translatableStringHelper) + public function __construct(private readonly ActivityReasonRepository $activityReasonRepository, private readonly ActivityReasonRender $reasonRender, private readonly TranslatableStringHelperInterface $translatableStringHelper) { } diff --git a/src/Bundle/ChillActivityBundle/Form/Type/TranslatableActivityReasonCategoryType.php b/src/Bundle/ChillActivityBundle/Form/Type/TranslatableActivityReasonCategoryType.php index 8ccdf42c8..37bc90b0c 100644 --- a/src/Bundle/ChillActivityBundle/Form/Type/TranslatableActivityReasonCategoryType.php +++ b/src/Bundle/ChillActivityBundle/Form/Type/TranslatableActivityReasonCategoryType.php @@ -23,7 +23,7 @@ use Symfony\Contracts\Translation\TranslatorInterface; */ class TranslatableActivityReasonCategoryType extends AbstractType { - public function __construct(private TranslatableStringHelperInterface $translatableStringHelper, private TranslatorInterface $translator) + public function __construct(private readonly TranslatableStringHelperInterface $translatableStringHelper, private readonly TranslatorInterface $translator) { } diff --git a/src/Bundle/ChillActivityBundle/Menu/AdminMenuBuilder.php b/src/Bundle/ChillActivityBundle/Menu/AdminMenuBuilder.php index bdffafcb2..8337a3582 100644 --- a/src/Bundle/ChillActivityBundle/Menu/AdminMenuBuilder.php +++ b/src/Bundle/ChillActivityBundle/Menu/AdminMenuBuilder.php @@ -18,7 +18,7 @@ use Symfony\Component\Security\Core\Security; /** * @implements LocalMenuBuilderInterface */ -final class AdminMenuBuilder implements LocalMenuBuilderInterface +final readonly class AdminMenuBuilder implements LocalMenuBuilderInterface { public function __construct(private Security $security) { diff --git a/src/Bundle/ChillActivityBundle/Notification/ActivityNotificationHandler.php b/src/Bundle/ChillActivityBundle/Notification/ActivityNotificationHandler.php index 4b8566484..3356e7107 100644 --- a/src/Bundle/ChillActivityBundle/Notification/ActivityNotificationHandler.php +++ b/src/Bundle/ChillActivityBundle/Notification/ActivityNotificationHandler.php @@ -16,7 +16,7 @@ use Chill\ActivityBundle\Repository\ActivityRepository; use Chill\MainBundle\Entity\Notification; use Chill\MainBundle\Notification\NotificationHandlerInterface; -final class ActivityNotificationHandler implements NotificationHandlerInterface +final readonly class ActivityNotificationHandler implements NotificationHandlerInterface { public function __construct(private ActivityRepository $activityRepository) { diff --git a/src/Bundle/ChillActivityBundle/Repository/ActivityACLAwareRepository.php b/src/Bundle/ChillActivityBundle/Repository/ActivityACLAwareRepository.php index c4eae39f0..06a74a1f0 100644 --- a/src/Bundle/ChillActivityBundle/Repository/ActivityACLAwareRepository.php +++ b/src/Bundle/ChillActivityBundle/Repository/ActivityACLAwareRepository.php @@ -33,7 +33,7 @@ use Symfony\Component\Security\Core\Security; use function count; use function in_array; -final class ActivityACLAwareRepository implements ActivityACLAwareRepositoryInterface +final readonly class ActivityACLAwareRepository implements ActivityACLAwareRepositoryInterface { public function __construct(private AuthorizationHelper $authorizationHelper, private CenterResolverDispatcherInterface $centerResolverDispatcher, private TokenStorageInterface $tokenStorage, private ActivityRepository $repository, private EntityManagerInterface $em, private Security $security) { diff --git a/src/Bundle/ChillActivityBundle/Repository/ActivityPresenceRepository.php b/src/Bundle/ChillActivityBundle/Repository/ActivityPresenceRepository.php index 2cf9f9470..3ed96074b 100644 --- a/src/Bundle/ChillActivityBundle/Repository/ActivityPresenceRepository.php +++ b/src/Bundle/ChillActivityBundle/Repository/ActivityPresenceRepository.php @@ -17,7 +17,7 @@ use Doctrine\ORM\EntityRepository; class ActivityPresenceRepository implements ActivityPresenceRepositoryInterface { - private EntityRepository $repository; + private readonly EntityRepository $repository; public function __construct(EntityManagerInterface $entityManager) { diff --git a/src/Bundle/ChillActivityBundle/Repository/ActivityReasonRepository.php b/src/Bundle/ChillActivityBundle/Repository/ActivityReasonRepository.php index 33c36693e..47a7b35e8 100644 --- a/src/Bundle/ChillActivityBundle/Repository/ActivityReasonRepository.php +++ b/src/Bundle/ChillActivityBundle/Repository/ActivityReasonRepository.php @@ -25,7 +25,7 @@ class ActivityReasonRepository extends ServiceEntityRepository { public function __construct( ManagerRegistry $registry, - private RequestStack $requestStack + private readonly RequestStack $requestStack ) { parent::__construct($registry, ActivityReason::class); } diff --git a/src/Bundle/ChillActivityBundle/Repository/ActivityTypeRepository.php b/src/Bundle/ChillActivityBundle/Repository/ActivityTypeRepository.php index fd5d52fce..99adf4fe0 100644 --- a/src/Bundle/ChillActivityBundle/Repository/ActivityTypeRepository.php +++ b/src/Bundle/ChillActivityBundle/Repository/ActivityTypeRepository.php @@ -17,7 +17,7 @@ use Doctrine\ORM\EntityRepository; final class ActivityTypeRepository implements ActivityTypeRepositoryInterface { - private EntityRepository $repository; + private readonly EntityRepository $repository; public function __construct(EntityManagerInterface $em) { diff --git a/src/Bundle/ChillActivityBundle/Security/Authorization/ActivityStatsVoter.php b/src/Bundle/ChillActivityBundle/Security/Authorization/ActivityStatsVoter.php index 2e55f862c..27f4b07a6 100644 --- a/src/Bundle/ChillActivityBundle/Security/Authorization/ActivityStatsVoter.php +++ b/src/Bundle/ChillActivityBundle/Security/Authorization/ActivityStatsVoter.php @@ -20,9 +20,9 @@ use Symfony\Component\Security\Core\Authentication\Token\TokenInterface; class ActivityStatsVoter extends AbstractChillVoter implements ProvideRoleHierarchyInterface { - public const LISTS = 'CHILL_ACTIVITY_LIST'; + final public const LISTS = 'CHILL_ACTIVITY_LIST'; - public const STATS = 'CHILL_ACTIVITY_STATS'; + final public const STATS = 'CHILL_ACTIVITY_STATS'; protected VoterHelperInterface $helper; diff --git a/src/Bundle/ChillActivityBundle/Security/Authorization/ActivityVoter.php b/src/Bundle/ChillActivityBundle/Security/Authorization/ActivityVoter.php index a036c9784..06cbb7145 100644 --- a/src/Bundle/ChillActivityBundle/Security/Authorization/ActivityVoter.php +++ b/src/Bundle/ChillActivityBundle/Security/Authorization/ActivityVoter.php @@ -35,7 +35,7 @@ class ActivityVoter extends AbstractChillVoter implements ProvideRoleHierarchyIn * * It is safe for usage in template and controller */ - public const CREATE = 'CHILL_ACTIVITY_CREATE'; + final public const CREATE = 'CHILL_ACTIVITY_CREATE'; /** * role to allow to create an activity associated win an accompanying course. @@ -44,7 +44,7 @@ class ActivityVoter extends AbstractChillVoter implements ProvideRoleHierarchyIn * * @internal */ - public const CREATE_ACCOMPANYING_COURSE = 'CHILL_ACTIVITY_CREATE_ACCOMPANYING_COURSE'; + final public const CREATE_ACCOMPANYING_COURSE = 'CHILL_ACTIVITY_CREATE_ACCOMPANYING_COURSE'; /** * role to allow to create an activity associated with a person. @@ -53,17 +53,17 @@ class ActivityVoter extends AbstractChillVoter implements ProvideRoleHierarchyIn * * @internal */ - public const CREATE_PERSON = 'CHILL_ACTIVITY_CREATE_PERSON'; + final public const CREATE_PERSON = 'CHILL_ACTIVITY_CREATE_PERSON'; - public const DELETE = 'CHILL_ACTIVITY_DELETE'; + final public const DELETE = 'CHILL_ACTIVITY_DELETE'; - public const FULL = 'CHILL_ACTIVITY_FULL'; + final public const FULL = 'CHILL_ACTIVITY_FULL'; - public const SEE = 'CHILL_ACTIVITY_SEE'; + final public const SEE = 'CHILL_ACTIVITY_SEE'; - public const SEE_DETAILS = 'CHILL_ACTIVITY_SEE_DETAILS'; + final public const SEE_DETAILS = 'CHILL_ACTIVITY_SEE_DETAILS'; - public const UPDATE = 'CHILL_ACTIVITY_UPDATE'; + final public const UPDATE = 'CHILL_ACTIVITY_UPDATE'; private const ALL = [ self::CREATE, diff --git a/src/Bundle/ChillActivityBundle/Service/DocGenerator/ActivityContext.php b/src/Bundle/ChillActivityBundle/Service/DocGenerator/ActivityContext.php index 95a5a4b10..e1bcd7677 100644 --- a/src/Bundle/ChillActivityBundle/Service/DocGenerator/ActivityContext.php +++ b/src/Bundle/ChillActivityBundle/Service/DocGenerator/ActivityContext.php @@ -39,7 +39,7 @@ class ActivityContext implements DocGeneratorContextWithAdminFormInterface, DocGeneratorContextWithPublicFormInterface { - public function __construct(private DocumentCategoryRepository $documentCategoryRepository, private NormalizerInterface $normalizer, private TranslatableStringHelperInterface $translatableStringHelper, private EntityManagerInterface $em, private PersonRenderInterface $personRender, private PersonRepository $personRepository, private TranslatorInterface $translator, private BaseContextData $baseContextData) + public function __construct(private readonly DocumentCategoryRepository $documentCategoryRepository, private readonly NormalizerInterface $normalizer, private readonly TranslatableStringHelperInterface $translatableStringHelper, private readonly EntityManagerInterface $em, private readonly PersonRenderInterface $personRender, private readonly PersonRepository $personRepository, private readonly TranslatorInterface $translator, private readonly BaseContextData $baseContextData) { } diff --git a/src/Bundle/ChillActivityBundle/Service/DocGenerator/ListActivitiesByAccompanyingPeriodContext.php b/src/Bundle/ChillActivityBundle/Service/DocGenerator/ListActivitiesByAccompanyingPeriodContext.php index dc895782a..4d049515c 100644 --- a/src/Bundle/ChillActivityBundle/Service/DocGenerator/ListActivitiesByAccompanyingPeriodContext.php +++ b/src/Bundle/ChillActivityBundle/Service/DocGenerator/ListActivitiesByAccompanyingPeriodContext.php @@ -48,7 +48,7 @@ class ListActivitiesByAccompanyingPeriodContext implements DocGeneratorContextWithAdminFormInterface, DocGeneratorContextWithPublicFormInterface { - public function __construct(private AccompanyingPeriodContext $accompanyingPeriodContext, private ActivityACLAwareRepositoryInterface $activityACLAwareRepository, private NormalizerInterface $normalizer, private PersonRepository $personRepository, private SocialActionRepository $socialActionRepository, private SocialIssueRepository $socialIssueRepository, private ThirdPartyRepository $thirdPartyRepository, private TranslatableStringHelperInterface $translatableStringHelper, private UserRepository $userRepository) + public function __construct(private readonly AccompanyingPeriodContext $accompanyingPeriodContext, private readonly ActivityACLAwareRepositoryInterface $activityACLAwareRepository, private readonly NormalizerInterface $normalizer, private readonly PersonRepository $personRepository, private readonly SocialActionRepository $socialActionRepository, private readonly SocialIssueRepository $socialIssueRepository, private readonly ThirdPartyRepository $thirdPartyRepository, private readonly TranslatableStringHelperInterface $translatableStringHelper, private readonly UserRepository $userRepository) { } diff --git a/src/Bundle/ChillActivityBundle/Tests/Controller/ActivityControllerTest.php b/src/Bundle/ChillActivityBundle/Tests/Controller/ActivityControllerTest.php index b90a5018e..30fb72fb9 100644 --- a/src/Bundle/ChillActivityBundle/Tests/Controller/ActivityControllerTest.php +++ b/src/Bundle/ChillActivityBundle/Tests/Controller/ActivityControllerTest.php @@ -214,7 +214,7 @@ final class ActivityControllerTest extends WebTestCase ->setName('social without activity'); //copy role scopes where ACTIVITY is not present foreach ($socialPermissionGroup->getRoleScopes() as $roleScope) { - if (!strpos($roleScope->getRole(), 'ACTIVITY')) { + if (!strpos((string) $roleScope->getRole(), 'ACTIVITY')) { $withoutActivityPermissionGroup->addRoleScope($roleScope); } } diff --git a/src/Bundle/ChillActivityBundle/Tests/Controller/ActivityReasonCategoryControllerTest.php b/src/Bundle/ChillActivityBundle/Tests/Controller/ActivityReasonCategoryControllerTest.php index 14f75e863..88d6535d2 100644 --- a/src/Bundle/ChillActivityBundle/Tests/Controller/ActivityReasonCategoryControllerTest.php +++ b/src/Bundle/ChillActivityBundle/Tests/Controller/ActivityReasonCategoryControllerTest.php @@ -19,7 +19,7 @@ use Symfony\Bundle\FrameworkBundle\Test\WebTestCase; */ final class ActivityReasonCategoryControllerTest extends WebTestCase { - public function testToWrite() + public function testToWrite(): never { $this->markTestSkipped(); } diff --git a/src/Bundle/ChillActivityBundle/Tests/Controller/ActivityReasonControllerTest.php b/src/Bundle/ChillActivityBundle/Tests/Controller/ActivityReasonControllerTest.php index 47de677a3..eafa7ed0b 100644 --- a/src/Bundle/ChillActivityBundle/Tests/Controller/ActivityReasonControllerTest.php +++ b/src/Bundle/ChillActivityBundle/Tests/Controller/ActivityReasonControllerTest.php @@ -19,7 +19,7 @@ use Symfony\Bundle\FrameworkBundle\Test\WebTestCase; */ final class ActivityReasonControllerTest extends WebTestCase { - public function testToWrite() + public function testToWrite(): never { $this->markTestSkipped(); } diff --git a/src/Bundle/ChillActivityBundle/Tests/Controller/ActivityTypeControllerTest.php b/src/Bundle/ChillActivityBundle/Tests/Controller/ActivityTypeControllerTest.php index b2276f427..49c0c6a08 100644 --- a/src/Bundle/ChillActivityBundle/Tests/Controller/ActivityTypeControllerTest.php +++ b/src/Bundle/ChillActivityBundle/Tests/Controller/ActivityTypeControllerTest.php @@ -19,7 +19,7 @@ use Symfony\Bundle\FrameworkBundle\Test\WebTestCase; */ final class ActivityTypeControllerTest extends WebTestCase { - public function testToWrite() + public function testToWrite(): never { $this->markTestSkipped(); } diff --git a/src/Bundle/ChillActivityBundle/Tests/Form/Type/TranslatableActivityReasonTest.php b/src/Bundle/ChillActivityBundle/Tests/Form/Type/TranslatableActivityReasonTest.php index a8d85daa6..82750a751 100644 --- a/src/Bundle/ChillActivityBundle/Tests/Form/Type/TranslatableActivityReasonTest.php +++ b/src/Bundle/ChillActivityBundle/Tests/Form/Type/TranslatableActivityReasonTest.php @@ -34,7 +34,7 @@ final class TranslatableActivityReasonTest extends TypeTestCase parent::setUp(); } - public function testSimple() + public function testSimple(): never { $translatableActivityReasonType = new PickActivityReasonType( $this->getTranslatableStringHelper() diff --git a/src/Bundle/ChillActivityBundle/Tests/Timeline/TimelineProviderTest.php b/src/Bundle/ChillActivityBundle/Tests/Timeline/TimelineProviderTest.php index 664196ad4..ff6f46567 100644 --- a/src/Bundle/ChillActivityBundle/Tests/Timeline/TimelineProviderTest.php +++ b/src/Bundle/ChillActivityBundle/Tests/Timeline/TimelineProviderTest.php @@ -19,7 +19,7 @@ use Symfony\Bundle\FrameworkBundle\Test\WebTestCase; */ final class TimelineProviderTest extends WebTestCase { - public function testAnActivityIsShownOnTimeline() + public function testAnActivityIsShownOnTimeline(): never { $this->markTestSkipped('we have to write fixtures before writing this tests'); } diff --git a/src/Bundle/ChillActivityBundle/Validator/Constraints/ActivityValidity.php b/src/Bundle/ChillActivityBundle/Validator/Constraints/ActivityValidity.php index 393b33322..bb1dbc9d3 100644 --- a/src/Bundle/ChillActivityBundle/Validator/Constraints/ActivityValidity.php +++ b/src/Bundle/ChillActivityBundle/Validator/Constraints/ActivityValidity.php @@ -18,9 +18,9 @@ use Symfony\Component\Validator\Constraint; */ class ActivityValidity extends Constraint { - public const IS_REQUIRED_MESSAGE = ' is required'; + final public const IS_REQUIRED_MESSAGE = ' is required'; - public const ROOT_MESSAGE = 'For this type of activity, '; + final public const ROOT_MESSAGE = 'For this type of activity, '; public $noPersonsMessage = 'For this type of activity, you must add at least one person'; diff --git a/src/Bundle/ChillAsideActivityBundle/src/Controller/AsideActivityController.php b/src/Bundle/ChillAsideActivityBundle/src/Controller/AsideActivityController.php index 281585bb9..1aa53db4e 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/Controller/AsideActivityController.php +++ b/src/Bundle/ChillAsideActivityBundle/src/Controller/AsideActivityController.php @@ -21,7 +21,7 @@ use Symfony\Component\HttpFoundation\Request; final class AsideActivityController extends CRUDController { - public function __construct(private AsideActivityCategoryRepository $categoryRepository) + public function __construct(private readonly AsideActivityCategoryRepository $categoryRepository) { } diff --git a/src/Bundle/ChillAsideActivityBundle/src/DataFixtures/ORM/LoadAsideActivity.php b/src/Bundle/ChillAsideActivityBundle/src/DataFixtures/ORM/LoadAsideActivity.php index e39813009..fdf035682 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/DataFixtures/ORM/LoadAsideActivity.php +++ b/src/Bundle/ChillAsideActivityBundle/src/DataFixtures/ORM/LoadAsideActivity.php @@ -24,7 +24,7 @@ use function random_int; class LoadAsideActivity extends Fixture implements DependentFixtureInterface { - public function __construct(private UserRepository $userRepository) + public function __construct(private readonly UserRepository $userRepository) { } diff --git a/src/Bundle/ChillAsideActivityBundle/src/Export/Aggregator/ByActivityTypeAggregator.php b/src/Bundle/ChillAsideActivityBundle/src/Export/Aggregator/ByActivityTypeAggregator.php index 86a1360dc..aed5f95a0 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/Export/Aggregator/ByActivityTypeAggregator.php +++ b/src/Bundle/ChillAsideActivityBundle/src/Export/Aggregator/ByActivityTypeAggregator.php @@ -20,7 +20,7 @@ use Symfony\Component\Form\FormBuilderInterface; class ByActivityTypeAggregator implements AggregatorInterface { - public function __construct(private AsideActivityCategoryRepository $asideActivityCategoryRepository, private TranslatableStringHelper $translatableStringHelper) + public function __construct(private readonly AsideActivityCategoryRepository $asideActivityCategoryRepository, private readonly TranslatableStringHelper $translatableStringHelper) { } diff --git a/src/Bundle/ChillAsideActivityBundle/src/Export/Aggregator/ByUserJobAggregator.php b/src/Bundle/ChillAsideActivityBundle/src/Export/Aggregator/ByUserJobAggregator.php index a911ad163..aa4e57481 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/Export/Aggregator/ByUserJobAggregator.php +++ b/src/Bundle/ChillAsideActivityBundle/src/Export/Aggregator/ByUserJobAggregator.php @@ -22,7 +22,7 @@ use function in_array; class ByUserJobAggregator implements AggregatorInterface { - public function __construct(private UserJobRepositoryInterface $userJobRepository, private TranslatableStringHelperInterface $translatableStringHelper) + public function __construct(private readonly UserJobRepositoryInterface $userJobRepository, private readonly TranslatableStringHelperInterface $translatableStringHelper) { } diff --git a/src/Bundle/ChillAsideActivityBundle/src/Export/Aggregator/ByUserScopeAggregator.php b/src/Bundle/ChillAsideActivityBundle/src/Export/Aggregator/ByUserScopeAggregator.php index 553e2f77b..47c0b6826 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/Export/Aggregator/ByUserScopeAggregator.php +++ b/src/Bundle/ChillAsideActivityBundle/src/Export/Aggregator/ByUserScopeAggregator.php @@ -22,7 +22,7 @@ use function in_array; class ByUserScopeAggregator implements AggregatorInterface { - public function __construct(private ScopeRepositoryInterface $scopeRepository, private TranslatableStringHelperInterface $translatableStringHelper) + public function __construct(private readonly ScopeRepositoryInterface $scopeRepository, private readonly TranslatableStringHelperInterface $translatableStringHelper) { } diff --git a/src/Bundle/ChillAsideActivityBundle/src/Export/Declarations.php b/src/Bundle/ChillAsideActivityBundle/src/Export/Declarations.php index 8c808ea37..f86f78866 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/Export/Declarations.php +++ b/src/Bundle/ChillAsideActivityBundle/src/Export/Declarations.php @@ -16,5 +16,5 @@ namespace Chill\AsideActivityBundle\Export; */ abstract class Declarations { - public const ASIDE_ACTIVITY_TYPE = 'aside_activity'; + final public const ASIDE_ACTIVITY_TYPE = 'aside_activity'; } diff --git a/src/Bundle/ChillAsideActivityBundle/src/Export/Export/AvgAsideActivityDuration.php b/src/Bundle/ChillAsideActivityBundle/src/Export/Export/AvgAsideActivityDuration.php index 75d221b70..62b37b870 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/Export/Export/AvgAsideActivityDuration.php +++ b/src/Bundle/ChillAsideActivityBundle/src/Export/Export/AvgAsideActivityDuration.php @@ -23,7 +23,7 @@ use Symfony\Component\Form\FormBuilderInterface; class AvgAsideActivityDuration implements ExportInterface, GroupedExportInterface { - public function __construct(private AsideActivityRepository $repository) + public function __construct(private readonly AsideActivityRepository $repository) { } diff --git a/src/Bundle/ChillAsideActivityBundle/src/Export/Export/CountAsideActivity.php b/src/Bundle/ChillAsideActivityBundle/src/Export/Export/CountAsideActivity.php index e9c4932f3..7e4d40bef 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/Export/Export/CountAsideActivity.php +++ b/src/Bundle/ChillAsideActivityBundle/src/Export/Export/CountAsideActivity.php @@ -23,7 +23,7 @@ use Symfony\Component\Form\FormBuilderInterface; class CountAsideActivity implements ExportInterface, GroupedExportInterface { - public function __construct(private AsideActivityRepository $repository) + public function __construct(private readonly AsideActivityRepository $repository) { } diff --git a/src/Bundle/ChillAsideActivityBundle/src/Export/Export/ListAsideActivity.php b/src/Bundle/ChillAsideActivityBundle/src/Export/Export/ListAsideActivity.php index a59962829..b6772dbb0 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/Export/Export/ListAsideActivity.php +++ b/src/Bundle/ChillAsideActivityBundle/src/Export/Export/ListAsideActivity.php @@ -32,7 +32,7 @@ use Doctrine\ORM\QueryBuilder; use LogicException; use Symfony\Component\Form\FormBuilderInterface; -final class ListAsideActivity implements ListInterface, GroupedExportInterface +final readonly class ListAsideActivity implements ListInterface, GroupedExportInterface { public function __construct(private EntityManagerInterface $em, private DateTimeHelper $dateTimeHelper, private UserHelper $userHelper, private ScopeRepositoryInterface $scopeRepository, private CenterRepositoryInterface $centerRepository, private AsideActivityCategoryRepository $asideActivityCategoryRepository, private CategoryRender $categoryRender, private TranslatableStringHelperInterface $translatableStringHelper) { diff --git a/src/Bundle/ChillAsideActivityBundle/src/Export/Export/SumAsideActivityDuration.php b/src/Bundle/ChillAsideActivityBundle/src/Export/Export/SumAsideActivityDuration.php index 278fd7b91..7aca79004 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/Export/Export/SumAsideActivityDuration.php +++ b/src/Bundle/ChillAsideActivityBundle/src/Export/Export/SumAsideActivityDuration.php @@ -23,7 +23,7 @@ use Symfony\Component\Form\FormBuilderInterface; class SumAsideActivityDuration implements ExportInterface, GroupedExportInterface { - public function __construct(private AsideActivityRepository $repository) + public function __construct(private readonly AsideActivityRepository $repository) { } diff --git a/src/Bundle/ChillAsideActivityBundle/src/Export/Filter/ByActivityTypeFilter.php b/src/Bundle/ChillAsideActivityBundle/src/Export/Filter/ByActivityTypeFilter.php index 535ee04bb..13b60ab7e 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/Export/Filter/ByActivityTypeFilter.php +++ b/src/Bundle/ChillAsideActivityBundle/src/Export/Filter/ByActivityTypeFilter.php @@ -23,7 +23,7 @@ use Symfony\Component\Form\FormBuilderInterface; class ByActivityTypeFilter implements FilterInterface { - public function __construct(private CategoryRender $categoryRender, private TranslatableStringHelperInterface $translatableStringHelper, private AsideActivityCategoryRepository $asideActivityTypeRepository) + public function __construct(private readonly CategoryRender $categoryRender, private readonly TranslatableStringHelperInterface $translatableStringHelper, private readonly AsideActivityCategoryRepository $asideActivityTypeRepository) { } diff --git a/src/Bundle/ChillAsideActivityBundle/src/Export/Filter/ByDateFilter.php b/src/Bundle/ChillAsideActivityBundle/src/Export/Filter/ByDateFilter.php index 05bf46889..226caaba1 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/Export/Filter/ByDateFilter.php +++ b/src/Bundle/ChillAsideActivityBundle/src/Export/Filter/ByDateFilter.php @@ -26,7 +26,7 @@ use Symfony\Contracts\Translation\TranslatorInterface; class ByDateFilter implements FilterInterface { - public function __construct(private RollingDateConverterInterface $rollingDateConverter, protected TranslatorInterface $translator) + public function __construct(private readonly RollingDateConverterInterface $rollingDateConverter, protected TranslatorInterface $translator) { } diff --git a/src/Bundle/ChillAsideActivityBundle/src/Export/Filter/ByUserFilter.php b/src/Bundle/ChillAsideActivityBundle/src/Export/Filter/ByUserFilter.php index 809ec1250..6b7f19601 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/Export/Filter/ByUserFilter.php +++ b/src/Bundle/ChillAsideActivityBundle/src/Export/Filter/ByUserFilter.php @@ -20,7 +20,7 @@ use Symfony\Component\Form\FormBuilderInterface; class ByUserFilter implements FilterInterface { - public function __construct(private UserRender $userRender) + public function __construct(private readonly UserRender $userRender) { } diff --git a/src/Bundle/ChillAsideActivityBundle/src/Export/Filter/ByUserJobFilter.php b/src/Bundle/ChillAsideActivityBundle/src/Export/Filter/ByUserJobFilter.php index 8b7b1c662..5b3f3cf62 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/Export/Filter/ByUserJobFilter.php +++ b/src/Bundle/ChillAsideActivityBundle/src/Export/Filter/ByUserJobFilter.php @@ -22,7 +22,7 @@ use Symfony\Component\Form\FormBuilderInterface; class ByUserJobFilter implements FilterInterface { - public function __construct(private TranslatableStringHelperInterface $translatableStringHelper) + public function __construct(private readonly TranslatableStringHelperInterface $translatableStringHelper) { } diff --git a/src/Bundle/ChillAsideActivityBundle/src/Export/Filter/ByUserScopeFilter.php b/src/Bundle/ChillAsideActivityBundle/src/Export/Filter/ByUserScopeFilter.php index b7b7edfe4..6269ff562 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/Export/Filter/ByUserScopeFilter.php +++ b/src/Bundle/ChillAsideActivityBundle/src/Export/Filter/ByUserScopeFilter.php @@ -23,7 +23,7 @@ use Symfony\Component\Form\FormBuilderInterface; class ByUserScopeFilter implements FilterInterface { - public function __construct(private ScopeRepositoryInterface $scopeRepository, private TranslatableStringHelperInterface $translatableStringHelper) + public function __construct(private readonly ScopeRepositoryInterface $scopeRepository, private readonly TranslatableStringHelperInterface $translatableStringHelper) { } diff --git a/src/Bundle/ChillAsideActivityBundle/src/Form/AsideActivityCategoryType.php b/src/Bundle/ChillAsideActivityBundle/src/Form/AsideActivityCategoryType.php index 584c528e4..c285f0f9b 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/Form/AsideActivityCategoryType.php +++ b/src/Bundle/ChillAsideActivityBundle/src/Form/AsideActivityCategoryType.php @@ -22,7 +22,7 @@ use Symfony\Component\Form\FormBuilderInterface; final class AsideActivityCategoryType extends AbstractType { - public function __construct(private CategoryRender $categoryRender) + public function __construct(private readonly CategoryRender $categoryRender) { } diff --git a/src/Bundle/ChillAsideActivityBundle/src/Form/AsideActivityFormType.php b/src/Bundle/ChillAsideActivityBundle/src/Form/AsideActivityFormType.php index 727287972..dee87061c 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/Form/AsideActivityFormType.php +++ b/src/Bundle/ChillAsideActivityBundle/src/Form/AsideActivityFormType.php @@ -33,7 +33,7 @@ use function in_array; final class AsideActivityFormType extends AbstractType { - private array $timeChoices; + private readonly array $timeChoices; public function __construct( ParameterBagInterface $parameterBag, @@ -105,13 +105,7 @@ final class AsideActivityFormType extends AbstractType if (!in_array($data->getTimestamp(), $timeChoices, true)) { // the data are not in the possible values. add them $timeChoices[$data->format('H:i')] = $data->getTimestamp(); - $form = $builder->create($fieldName, ChoiceType::class, array_merge( - $durationTimeOptions, - [ - 'choices' => $timeChoices, - 'auto_initialize' => false, - ] - )); + $form = $builder->create($fieldName, ChoiceType::class, [...$durationTimeOptions, 'choices' => $timeChoices, 'auto_initialize' => false]); $form->addModelTransformer($durationTimeTransformer); $formEvent->getForm()->getParent()->add($form->getForm()); } diff --git a/src/Bundle/ChillAsideActivityBundle/src/Form/Type/PickAsideActivityCategoryType.php b/src/Bundle/ChillAsideActivityBundle/src/Form/Type/PickAsideActivityCategoryType.php index 63f6372d8..8341d8595 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/Form/Type/PickAsideActivityCategoryType.php +++ b/src/Bundle/ChillAsideActivityBundle/src/Form/Type/PickAsideActivityCategoryType.php @@ -20,7 +20,7 @@ use Symfony\Component\OptionsResolver\OptionsResolver; final class PickAsideActivityCategoryType extends AbstractType { - public function __construct(private CategoryRender $categoryRender) + public function __construct(private readonly CategoryRender $categoryRender) { } diff --git a/src/Bundle/ChillAsideActivityBundle/src/Menu/AdminMenuBuilder.php b/src/Bundle/ChillAsideActivityBundle/src/Menu/AdminMenuBuilder.php index dcf5c6720..d0a593dab 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/Menu/AdminMenuBuilder.php +++ b/src/Bundle/ChillAsideActivityBundle/src/Menu/AdminMenuBuilder.php @@ -14,7 +14,7 @@ namespace Chill\AsideActivityBundle\Menu; use Knp\Menu\MenuItem; use Symfony\Component\Security\Core\Security; -final class AdminMenuBuilder implements \Chill\MainBundle\Routing\LocalMenuBuilderInterface +final readonly class AdminMenuBuilder implements \Chill\MainBundle\Routing\LocalMenuBuilderInterface { public function __construct(private Security $security) { diff --git a/src/Bundle/ChillAsideActivityBundle/src/Repository/AsideActivityCategoryRepository.php b/src/Bundle/ChillAsideActivityBundle/src/Repository/AsideActivityCategoryRepository.php index 918cec586..6735606ce 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/Repository/AsideActivityCategoryRepository.php +++ b/src/Bundle/ChillAsideActivityBundle/src/Repository/AsideActivityCategoryRepository.php @@ -18,7 +18,7 @@ use Doctrine\Persistence\ObjectRepository; class AsideActivityCategoryRepository implements ObjectRepository { - private EntityRepository $repository; + private readonly EntityRepository $repository; public function __construct(EntityManagerInterface $entityManager) { diff --git a/src/Bundle/ChillAsideActivityBundle/src/Security/AsideActivityVoter.php b/src/Bundle/ChillAsideActivityBundle/src/Security/AsideActivityVoter.php index 6b308b5f2..e15abd439 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/Security/AsideActivityVoter.php +++ b/src/Bundle/ChillAsideActivityBundle/src/Security/AsideActivityVoter.php @@ -21,9 +21,9 @@ use Symfony\Component\Security\Core\Authentication\Token\TokenInterface; class AsideActivityVoter extends AbstractChillVoter implements ProvideRoleHierarchyInterface { - public const STATS = 'CHILL_ASIDE_ACTIVITY_STATS'; + final public const STATS = 'CHILL_ASIDE_ACTIVITY_STATS'; - private VoterHelperInterface $voterHelper; + private readonly VoterHelperInterface $voterHelper; public function __construct( VoterHelperFactoryInterface $voterHelperFactory diff --git a/src/Bundle/ChillAsideActivityBundle/src/Templating/Entity/CategoryRender.php b/src/Bundle/ChillAsideActivityBundle/src/Templating/Entity/CategoryRender.php index f4a7c4977..9094169c2 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/Templating/Entity/CategoryRender.php +++ b/src/Bundle/ChillAsideActivityBundle/src/Templating/Entity/CategoryRender.php @@ -19,7 +19,7 @@ use Symfony\Component\Templating\EngineInterface; /** * @implements ChillEntityRenderInterface */ -final class CategoryRender implements ChillEntityRenderInterface +final readonly class CategoryRender implements ChillEntityRenderInterface { public const DEFAULT_ARGS = [ self::SEPERATOR_KEY => ' > ', diff --git a/src/Bundle/ChillBudgetBundle/Calculator/CalculatorResult.php b/src/Bundle/ChillBudgetBundle/Calculator/CalculatorResult.php index 380e641a6..052045f7e 100644 --- a/src/Bundle/ChillBudgetBundle/Calculator/CalculatorResult.php +++ b/src/Bundle/ChillBudgetBundle/Calculator/CalculatorResult.php @@ -13,11 +13,11 @@ namespace Chill\BudgetBundle\Calculator; class CalculatorResult { - public const TYPE_CURRENCY = 'currency'; + final public const TYPE_CURRENCY = 'currency'; - public const TYPE_PERCENTAGE = 'percentage'; + final public const TYPE_PERCENTAGE = 'percentage'; - public const TYPE_RATE = 'rate'; + final public const TYPE_RATE = 'rate'; public $label; diff --git a/src/Bundle/ChillBudgetBundle/Controller/ElementController.php b/src/Bundle/ChillBudgetBundle/Controller/ElementController.php index 20f05a8ca..c949342b9 100644 --- a/src/Bundle/ChillBudgetBundle/Controller/ElementController.php +++ b/src/Bundle/ChillBudgetBundle/Controller/ElementController.php @@ -31,7 +31,7 @@ use function count; class ElementController extends AbstractController { - public function __construct(private CalculatorManager $calculator, private ResourceRepository $resourceRepository, private ChargeRepository $chargeRepository) + public function __construct(private readonly CalculatorManager $calculator, private readonly ResourceRepository $resourceRepository, private readonly ChargeRepository $chargeRepository) { } diff --git a/src/Bundle/ChillBudgetBundle/Entity/Charge.php b/src/Bundle/ChillBudgetBundle/Entity/Charge.php index 056e4abff..50602e849 100644 --- a/src/Bundle/ChillBudgetBundle/Entity/Charge.php +++ b/src/Bundle/ChillBudgetBundle/Entity/Charge.php @@ -24,15 +24,15 @@ use Doctrine\ORM\Mapping as ORM; */ class Charge extends AbstractElement implements HasCentersInterface { - public const HELP_ASKED = 'running'; + final public const HELP_ASKED = 'running'; - public const HELP_NO = 'no'; + final public const HELP_NO = 'no'; - public const HELP_NOT_RELEVANT = 'not-relevant'; + final public const HELP_NOT_RELEVANT = 'not-relevant'; - public const HELP_YES = 'yes'; + final public const HELP_YES = 'yes'; - public const HELPS = [ + final public const HELPS = [ self::HELP_ASKED, self::HELP_NO, self::HELP_YES, diff --git a/src/Bundle/ChillBudgetBundle/Form/ChargeType.php b/src/Bundle/ChillBudgetBundle/Form/ChargeType.php index 778866cb3..c2f2e4b67 100644 --- a/src/Bundle/ChillBudgetBundle/Form/ChargeType.php +++ b/src/Bundle/ChillBudgetBundle/Form/ChargeType.php @@ -27,7 +27,7 @@ use Symfony\Contracts\Translation\TranslatorInterface; class ChargeType extends AbstractType { - public function __construct(protected TranslatableStringHelperInterface $translatableStringHelper, private ChargeKindRepository $repository, private TranslatorInterface $translator) + public function __construct(protected TranslatableStringHelperInterface $translatableStringHelper, private readonly ChargeKindRepository $repository, private readonly TranslatorInterface $translator) { } diff --git a/src/Bundle/ChillBudgetBundle/Form/ResourceType.php b/src/Bundle/ChillBudgetBundle/Form/ResourceType.php index c98301597..3896b0dd8 100644 --- a/src/Bundle/ChillBudgetBundle/Form/ResourceType.php +++ b/src/Bundle/ChillBudgetBundle/Form/ResourceType.php @@ -26,7 +26,7 @@ use Symfony\Contracts\Translation\TranslatorInterface; class ResourceType extends AbstractType { - public function __construct(protected TranslatableStringHelperInterface $translatableStringHelper, private ResourceKindRepository $repository, private TranslatorInterface $translator) + public function __construct(protected TranslatableStringHelperInterface $translatableStringHelper, private readonly ResourceKindRepository $repository, private readonly TranslatorInterface $translator) { } diff --git a/src/Bundle/ChillBudgetBundle/Menu/AdminMenuBuilder.php b/src/Bundle/ChillBudgetBundle/Menu/AdminMenuBuilder.php index 787980862..805ad865d 100644 --- a/src/Bundle/ChillBudgetBundle/Menu/AdminMenuBuilder.php +++ b/src/Bundle/ChillBudgetBundle/Menu/AdminMenuBuilder.php @@ -15,7 +15,7 @@ use Chill\MainBundle\Routing\LocalMenuBuilderInterface; use Knp\Menu\MenuItem; use Symfony\Component\Security\Core\Security; -final class AdminMenuBuilder implements LocalMenuBuilderInterface +final readonly class AdminMenuBuilder implements LocalMenuBuilderInterface { public function __construct(private Security $security) { diff --git a/src/Bundle/ChillBudgetBundle/Repository/ChargeKindRepository.php b/src/Bundle/ChillBudgetBundle/Repository/ChargeKindRepository.php index 9aaf68ddf..a0c23a4ad 100644 --- a/src/Bundle/ChillBudgetBundle/Repository/ChargeKindRepository.php +++ b/src/Bundle/ChillBudgetBundle/Repository/ChargeKindRepository.php @@ -17,7 +17,7 @@ use Doctrine\ORM\EntityRepository; final class ChargeKindRepository implements ChargeKindRepositoryInterface { - private EntityRepository $repository; + private readonly EntityRepository $repository; public function __construct(EntityManagerInterface $entityManager) { diff --git a/src/Bundle/ChillBudgetBundle/Repository/ResourceKindRepository.php b/src/Bundle/ChillBudgetBundle/Repository/ResourceKindRepository.php index 1f9f99753..1ac419e30 100644 --- a/src/Bundle/ChillBudgetBundle/Repository/ResourceKindRepository.php +++ b/src/Bundle/ChillBudgetBundle/Repository/ResourceKindRepository.php @@ -17,7 +17,7 @@ use Doctrine\ORM\EntityRepository; final class ResourceKindRepository implements ResourceKindRepositoryInterface { - private EntityRepository $repository; + private readonly EntityRepository $repository; public function __construct(EntityManagerInterface $entityManager) { diff --git a/src/Bundle/ChillBudgetBundle/Security/Authorization/BudgetElementVoter.php b/src/Bundle/ChillBudgetBundle/Security/Authorization/BudgetElementVoter.php index 5203f9092..11d465421 100644 --- a/src/Bundle/ChillBudgetBundle/Security/Authorization/BudgetElementVoter.php +++ b/src/Bundle/ChillBudgetBundle/Security/Authorization/BudgetElementVoter.php @@ -24,20 +24,20 @@ use UnexpectedValueException; class BudgetElementVoter extends AbstractChillVoter implements ProvideRoleHierarchyInterface { - public const CREATE = 'CHILL_BUDGET_ELEMENT_CREATE'; + final public const CREATE = 'CHILL_BUDGET_ELEMENT_CREATE'; - public const DELETE = 'CHILL_BUDGET_ELEMENT_DELETE'; + final public const DELETE = 'CHILL_BUDGET_ELEMENT_DELETE'; - public const ROLES = [ + final public const ROLES = [ self::CREATE, self::DELETE, self::SEE, self::UPDATE, ]; - public const SEE = 'CHILL_BUDGET_ELEMENT_SEE'; + final public const SEE = 'CHILL_BUDGET_ELEMENT_SEE'; - public const UPDATE = 'CHILL_BUDGET_ELEMENT_UPDATE'; + final public const UPDATE = 'CHILL_BUDGET_ELEMENT_UPDATE'; protected VoterHelperInterface $voter; diff --git a/src/Bundle/ChillBudgetBundle/Service/Summary/SummaryBudget.php b/src/Bundle/ChillBudgetBundle/Service/Summary/SummaryBudget.php index 17e80bd63..70348da30 100644 --- a/src/Bundle/ChillBudgetBundle/Service/Summary/SummaryBudget.php +++ b/src/Bundle/ChillBudgetBundle/Service/Summary/SummaryBudget.php @@ -27,7 +27,7 @@ use function count; /** * Helps to find a summary of the budget: the sum of resources and charges. */ -final class SummaryBudget implements SummaryBudgetInterface +final readonly class SummaryBudget implements SummaryBudgetInterface { private const QUERY_CHARGE_BY_HOUSEHOLD = 'select SUM(amount) AS sum, string_agg(comment, \'|\') AS comment, charge_id AS kind_id FROM chill_budget.charge WHERE (person_id IN (_ids_) OR household_id = ?) AND NOW() BETWEEN startdate AND COALESCE(enddate, \'infinity\'::timestamp) GROUP BY charge_id'; diff --git a/src/Bundle/ChillBudgetBundle/Templating/BudgetElementTypeRender.php b/src/Bundle/ChillBudgetBundle/Templating/BudgetElementTypeRender.php index 336d69c66..c48c952a1 100644 --- a/src/Bundle/ChillBudgetBundle/Templating/BudgetElementTypeRender.php +++ b/src/Bundle/ChillBudgetBundle/Templating/BudgetElementTypeRender.php @@ -20,7 +20,7 @@ use Symfony\Component\Templating\EngineInterface; /** * @implements ChillEntityRenderInterface */ -final class BudgetElementTypeRender implements ChillEntityRenderInterface +final readonly class BudgetElementTypeRender implements ChillEntityRenderInterface { public function __construct(private TranslatableStringHelperInterface $translatableStringHelper, private EngineInterface $engine) { diff --git a/src/Bundle/ChillBudgetBundle/Tests/Service/Summary/SummaryBudgetTest.php b/src/Bundle/ChillBudgetBundle/Tests/Service/Summary/SummaryBudgetTest.php index 4190341d0..7d90bf575 100644 --- a/src/Bundle/ChillBudgetBundle/Tests/Service/Summary/SummaryBudgetTest.php +++ b/src/Bundle/ChillBudgetBundle/Tests/Service/Summary/SummaryBudgetTest.php @@ -66,11 +66,11 @@ final class SummaryBudgetTest extends TestCase $em = $this->prophesize(EntityManagerInterface::class); $em->createNativeQuery(Argument::type('string'), Argument::type(Query\ResultSetMapping::class)) ->will(static function ($args) use ($queryResources, $queryCharges) { - if (str_contains($args[0], 'chill_budget.resource')) { + if (str_contains((string) $args[0], 'chill_budget.resource')) { return $queryResources->reveal(); } - if (str_contains($args[0], 'chill_budget.charge')) { + if (str_contains((string) $args[0], 'chill_budget.charge')) { return $queryCharges->reveal(); } diff --git a/src/Bundle/ChillCalendarBundle/Command/AzureGrantAdminConsentAndAcquireToken.php b/src/Bundle/ChillCalendarBundle/Command/AzureGrantAdminConsentAndAcquireToken.php index d71439314..de9b5477f 100644 --- a/src/Bundle/ChillCalendarBundle/Command/AzureGrantAdminConsentAndAcquireToken.php +++ b/src/Bundle/ChillCalendarBundle/Command/AzureGrantAdminConsentAndAcquireToken.php @@ -29,7 +29,7 @@ use TheNetworg\OAuth2\Client\Provider\Azure; class AzureGrantAdminConsentAndAcquireToken extends Command { - public function __construct(private Azure $azure, private ClientRegistry $clientRegistry, private MachineTokenStorage $machineTokenStorage) + public function __construct(private readonly Azure $azure, private readonly ClientRegistry $clientRegistry, private readonly MachineTokenStorage $machineTokenStorage) { parent::__construct('chill:calendar:msgraph-grant-admin-consent'); } diff --git a/src/Bundle/ChillCalendarBundle/Command/MapAndSubscribeUserCalendarCommand.php b/src/Bundle/ChillCalendarBundle/Command/MapAndSubscribeUserCalendarCommand.php index 48b9242fd..35517ec9e 100644 --- a/src/Bundle/ChillCalendarBundle/Command/MapAndSubscribeUserCalendarCommand.php +++ b/src/Bundle/ChillCalendarBundle/Command/MapAndSubscribeUserCalendarCommand.php @@ -33,11 +33,11 @@ use Symfony\Component\Console\Output\OutputInterface; class MapAndSubscribeUserCalendarCommand extends Command { public function __construct( - private EntityManagerInterface $em, - private EventsOnUserSubscriptionCreator $eventsOnUserSubscriptionCreator, - private LoggerInterface $logger, - private MapCalendarToUser $mapCalendarToUser, - private MSGraphUserRepository $userRepository + private readonly EntityManagerInterface $em, + private readonly EventsOnUserSubscriptionCreator $eventsOnUserSubscriptionCreator, + private readonly LoggerInterface $logger, + private readonly MapCalendarToUser $mapCalendarToUser, + private readonly MSGraphUserRepository $userRepository ) { parent::__construct('chill:calendar:msgraph-user-map-subscribe'); } diff --git a/src/Bundle/ChillCalendarBundle/Command/SendShortMessageOnEligibleCalendar.php b/src/Bundle/ChillCalendarBundle/Command/SendShortMessageOnEligibleCalendar.php index de5f43102..8222d0ace 100644 --- a/src/Bundle/ChillCalendarBundle/Command/SendShortMessageOnEligibleCalendar.php +++ b/src/Bundle/ChillCalendarBundle/Command/SendShortMessageOnEligibleCalendar.php @@ -25,7 +25,7 @@ use Symfony\Component\Console\Output\OutputInterface; class SendShortMessageOnEligibleCalendar extends Command { - public function __construct(private BulkCalendarShortMessageSender $messageSender) + public function __construct(private readonly BulkCalendarShortMessageSender $messageSender) { parent::__construct(); } diff --git a/src/Bundle/ChillCalendarBundle/Command/SendTestShortMessageOnCalendarCommand.php b/src/Bundle/ChillCalendarBundle/Command/SendTestShortMessageOnCalendarCommand.php index 882277c91..e39ff2d75 100644 --- a/src/Bundle/ChillCalendarBundle/Command/SendTestShortMessageOnCalendarCommand.php +++ b/src/Bundle/ChillCalendarBundle/Command/SendTestShortMessageOnCalendarCommand.php @@ -44,12 +44,12 @@ use function count; class SendTestShortMessageOnCalendarCommand extends Command { public function __construct( - private PersonRepository $personRepository, - private PhoneNumberUtil $phoneNumberUtil, - private PhoneNumberHelperInterface $phoneNumberHelper, - private ShortMessageForCalendarBuilderInterface $messageForCalendarBuilder, - private ShortMessageTransporterInterface $transporter, - private UserRepositoryInterface $userRepository + private readonly PersonRepository $personRepository, + private readonly PhoneNumberUtil $phoneNumberUtil, + private readonly PhoneNumberHelperInterface $phoneNumberHelper, + private readonly ShortMessageForCalendarBuilderInterface $messageForCalendarBuilder, + private readonly ShortMessageTransporterInterface $transporter, + private readonly UserRepositoryInterface $userRepository ) { parent::__construct(); } diff --git a/src/Bundle/ChillCalendarBundle/Controller/CalendarAPIController.php b/src/Bundle/ChillCalendarBundle/Controller/CalendarAPIController.php index b426dabd8..65d8301a8 100644 --- a/src/Bundle/ChillCalendarBundle/Controller/CalendarAPIController.php +++ b/src/Bundle/ChillCalendarBundle/Controller/CalendarAPIController.php @@ -24,7 +24,7 @@ use Symfony\Component\Routing\Annotation\Route; class CalendarAPIController extends ApiController { - public function __construct(private CalendarRepository $calendarRepository) + public function __construct(private readonly CalendarRepository $calendarRepository) { } diff --git a/src/Bundle/ChillCalendarBundle/Controller/CalendarController.php b/src/Bundle/ChillCalendarBundle/Controller/CalendarController.php index 34481facb..aaa4d7832 100644 --- a/src/Bundle/ChillCalendarBundle/Controller/CalendarController.php +++ b/src/Bundle/ChillCalendarBundle/Controller/CalendarController.php @@ -49,7 +49,7 @@ use Symfony\Contracts\Translation\TranslatorInterface; class CalendarController extends AbstractController { - public function __construct(private CalendarACLAwareRepositoryInterface $calendarACLAwareRepository, private DocGeneratorTemplateRepository $docGeneratorTemplateRepository, private FilterOrderHelperFactoryInterface $filterOrderHelperFactory, private LoggerInterface $logger, private PaginatorFactory $paginator, private RemoteCalendarConnectorInterface $remoteCalendarConnector, private SerializerInterface $serializer, private TranslatableStringHelperInterface $translatableStringHelper, private PersonRepository $personRepository, private AccompanyingPeriodRepository $accompanyingPeriodRepository, private UserRepositoryInterface $userRepository, private TranslatorInterface $translator) + public function __construct(private readonly CalendarACLAwareRepositoryInterface $calendarACLAwareRepository, private readonly DocGeneratorTemplateRepository $docGeneratorTemplateRepository, private readonly FilterOrderHelperFactoryInterface $filterOrderHelperFactory, private readonly LoggerInterface $logger, private readonly PaginatorFactory $paginator, private readonly RemoteCalendarConnectorInterface $remoteCalendarConnector, private readonly SerializerInterface $serializer, private readonly TranslatableStringHelperInterface $translatableStringHelper, private readonly PersonRepository $personRepository, private readonly AccompanyingPeriodRepository $accompanyingPeriodRepository, private readonly UserRepositoryInterface $userRepository, private readonly TranslatorInterface $translator) { } diff --git a/src/Bundle/ChillCalendarBundle/Controller/CalendarDocController.php b/src/Bundle/ChillCalendarBundle/Controller/CalendarDocController.php index 16d1c942c..6542f5c97 100644 --- a/src/Bundle/ChillCalendarBundle/Controller/CalendarDocController.php +++ b/src/Bundle/ChillCalendarBundle/Controller/CalendarDocController.php @@ -33,9 +33,7 @@ use UnexpectedValueException; class CalendarDocController { - private SerializerInterface $serializer; - - public function __construct(private DocGeneratorTemplateRepository $docGeneratorTemplateRepository, private EngineInterface $engine, private EntityManagerInterface $entityManager, private FormFactoryInterface $formFactory, private Security $security, private UrlGeneratorInterface $urlGenerator) + public function __construct(private readonly DocGeneratorTemplateRepository $docGeneratorTemplateRepository, private readonly EngineInterface $engine, private readonly EntityManagerInterface $entityManager, private readonly FormFactoryInterface $formFactory, private readonly Security $security, private readonly UrlGeneratorInterface $urlGenerator) { } diff --git a/src/Bundle/ChillCalendarBundle/Controller/CalendarRangeAPIController.php b/src/Bundle/ChillCalendarBundle/Controller/CalendarRangeAPIController.php index 1b967a9ee..443c88e7e 100644 --- a/src/Bundle/ChillCalendarBundle/Controller/CalendarRangeAPIController.php +++ b/src/Bundle/ChillCalendarBundle/Controller/CalendarRangeAPIController.php @@ -25,7 +25,7 @@ use Symfony\Component\Routing\Annotation\Route; class CalendarRangeAPIController extends ApiController { - public function __construct(private CalendarRangeRepository $calendarRangeRepository) + public function __construct(private readonly CalendarRangeRepository $calendarRangeRepository) { } diff --git a/src/Bundle/ChillCalendarBundle/Controller/InviteApiController.php b/src/Bundle/ChillCalendarBundle/Controller/InviteApiController.php index 6e4930cdb..b230010e3 100644 --- a/src/Bundle/ChillCalendarBundle/Controller/InviteApiController.php +++ b/src/Bundle/ChillCalendarBundle/Controller/InviteApiController.php @@ -35,7 +35,7 @@ use function in_array; class InviteApiController { - public function __construct(private EntityManagerInterface $entityManager, private MessageBusInterface $messageBus, private Security $security) + public function __construct(private readonly EntityManagerInterface $entityManager, private readonly MessageBusInterface $messageBus, private readonly Security $security) { } diff --git a/src/Bundle/ChillCalendarBundle/Controller/RemoteCalendarConnectAzureController.php b/src/Bundle/ChillCalendarBundle/Controller/RemoteCalendarConnectAzureController.php index d10b5d41a..a8339137a 100644 --- a/src/Bundle/ChillCalendarBundle/Controller/RemoteCalendarConnectAzureController.php +++ b/src/Bundle/ChillCalendarBundle/Controller/RemoteCalendarConnectAzureController.php @@ -30,7 +30,7 @@ use TheNetworg\OAuth2\Client\Token\AccessToken; class RemoteCalendarConnectAzureController { - public function __construct(private ClientRegistry $clientRegistry, private OnBehalfOfUserTokenStorage $MSGraphTokenStorage) + public function __construct(private readonly ClientRegistry $clientRegistry, private readonly OnBehalfOfUserTokenStorage $MSGraphTokenStorage) { } diff --git a/src/Bundle/ChillCalendarBundle/Controller/RemoteCalendarMSGraphSyncController.php b/src/Bundle/ChillCalendarBundle/Controller/RemoteCalendarMSGraphSyncController.php index 33e549b37..9abed89c0 100644 --- a/src/Bundle/ChillCalendarBundle/Controller/RemoteCalendarMSGraphSyncController.php +++ b/src/Bundle/ChillCalendarBundle/Controller/RemoteCalendarMSGraphSyncController.php @@ -29,7 +29,7 @@ use const JSON_THROW_ON_ERROR; class RemoteCalendarMSGraphSyncController { - public function __construct(private MessageBusInterface $messageBus) + public function __construct(private readonly MessageBusInterface $messageBus) { } diff --git a/src/Bundle/ChillCalendarBundle/Controller/RemoteCalendarProxyController.php b/src/Bundle/ChillCalendarBundle/Controller/RemoteCalendarProxyController.php index a2143922f..102157447 100644 --- a/src/Bundle/ChillCalendarBundle/Controller/RemoteCalendarProxyController.php +++ b/src/Bundle/ChillCalendarBundle/Controller/RemoteCalendarProxyController.php @@ -36,7 +36,7 @@ use function count; */ class RemoteCalendarProxyController { - public function __construct(private PaginatorFactory $paginatorFactory, private RemoteCalendarConnectorInterface $remoteCalendarConnector, private SerializerInterface $serializer) + public function __construct(private readonly PaginatorFactory $paginatorFactory, private readonly RemoteCalendarConnectorInterface $remoteCalendarConnector, private readonly SerializerInterface $serializer) { } diff --git a/src/Bundle/ChillCalendarBundle/DataFixtures/ORM/LoadCalendarRange.php b/src/Bundle/ChillCalendarBundle/DataFixtures/ORM/LoadCalendarRange.php index 493a97dec..5dc0cd9f0 100644 --- a/src/Bundle/ChillCalendarBundle/DataFixtures/ORM/LoadCalendarRange.php +++ b/src/Bundle/ChillCalendarBundle/DataFixtures/ORM/LoadCalendarRange.php @@ -29,7 +29,7 @@ class LoadCalendarRange extends Fixture implements FixtureGroupInterface, Ordere { public static array $references = []; - public function __construct(private UserRepository $userRepository) + public function __construct(private readonly UserRepository $userRepository) { } diff --git a/src/Bundle/ChillCalendarBundle/Entity/Calendar.php b/src/Bundle/ChillCalendarBundle/Entity/Calendar.php index dc98c47d9..9fb449115 100644 --- a/src/Bundle/ChillCalendarBundle/Entity/Calendar.php +++ b/src/Bundle/ChillCalendarBundle/Entity/Calendar.php @@ -58,20 +58,20 @@ class Calendar implements TrackCreationInterface, TrackUpdateInterface, HasCente use TrackUpdateTrait; - public const SMS_CANCEL_PENDING = 'sms_cancel_pending'; + final public const SMS_CANCEL_PENDING = 'sms_cancel_pending'; - public const SMS_PENDING = 'sms_pending'; + final public const SMS_PENDING = 'sms_pending'; - public const SMS_SENT = 'sms_sent'; + final public const SMS_SENT = 'sms_sent'; - public const STATUS_CANCELED = 'canceled'; + final public const STATUS_CANCELED = 'canceled'; /** * @deprecated */ - public const STATUS_MOVED = 'moved'; + final public const STATUS_MOVED = 'moved'; - public const STATUS_VALID = 'valid'; + final public const STATUS_VALID = 'valid'; /** * a list of invite which have been added during this session. diff --git a/src/Bundle/ChillCalendarBundle/Entity/CancelReason.php b/src/Bundle/ChillCalendarBundle/Entity/CancelReason.php index a262842c2..3c4d80c94 100644 --- a/src/Bundle/ChillCalendarBundle/Entity/CancelReason.php +++ b/src/Bundle/ChillCalendarBundle/Entity/CancelReason.php @@ -20,11 +20,11 @@ use Doctrine\ORM\Mapping as ORM; */ class CancelReason { - public const CANCELEDBY_DONOTCOUNT = 'CANCELEDBY_DONOTCOUNT'; + final public const CANCELEDBY_DONOTCOUNT = 'CANCELEDBY_DONOTCOUNT'; - public const CANCELEDBY_PERSON = 'CANCELEDBY_PERSON'; + final public const CANCELEDBY_PERSON = 'CANCELEDBY_PERSON'; - public const CANCELEDBY_USER = 'CANCELEDBY_USER'; + final public const CANCELEDBY_USER = 'CANCELEDBY_USER'; /** * @ORM\Column(type="boolean") diff --git a/src/Bundle/ChillCalendarBundle/Entity/Invite.php b/src/Bundle/ChillCalendarBundle/Entity/Invite.php index c2d79aff2..da1b9bb9e 100644 --- a/src/Bundle/ChillCalendarBundle/Entity/Invite.php +++ b/src/Bundle/ChillCalendarBundle/Entity/Invite.php @@ -40,23 +40,23 @@ class Invite implements TrackUpdateInterface, TrackCreationInterface use TrackUpdateTrait; - public const ACCEPTED = 'accepted'; + final public const ACCEPTED = 'accepted'; - public const DECLINED = 'declined'; + final public const DECLINED = 'declined'; - public const PENDING = 'pending'; + final public const PENDING = 'pending'; /** * all statuses in one const. */ - public const STATUSES = [ + final public const STATUSES = [ self::ACCEPTED, self::DECLINED, self::PENDING, self::TENTATIVELY_ACCEPTED, ]; - public const TENTATIVELY_ACCEPTED = 'tentative'; + final public const TENTATIVELY_ACCEPTED = 'tentative'; /** * @ORM\ManyToOne(targetEntity=Calendar::class, inversedBy="invites") diff --git a/src/Bundle/ChillCalendarBundle/Event/ListenToActivityCreate.php b/src/Bundle/ChillCalendarBundle/Event/ListenToActivityCreate.php index b781615ef..6870b5292 100644 --- a/src/Bundle/ChillCalendarBundle/Event/ListenToActivityCreate.php +++ b/src/Bundle/ChillCalendarBundle/Event/ListenToActivityCreate.php @@ -19,7 +19,7 @@ use function array_key_exists; class ListenToActivityCreate { - public function __construct(private RequestStack $requestStack) + public function __construct(private readonly RequestStack $requestStack) { } diff --git a/src/Bundle/ChillCalendarBundle/Export/Aggregator/AgentAggregator.php b/src/Bundle/ChillCalendarBundle/Export/Aggregator/AgentAggregator.php index bc76dc021..132fbfeed 100644 --- a/src/Bundle/ChillCalendarBundle/Export/Aggregator/AgentAggregator.php +++ b/src/Bundle/ChillCalendarBundle/Export/Aggregator/AgentAggregator.php @@ -20,7 +20,7 @@ use Doctrine\ORM\QueryBuilder; use Symfony\Component\Form\FormBuilderInterface; use function in_array; -final class AgentAggregator implements AggregatorInterface +final readonly class AgentAggregator implements AggregatorInterface { public function __construct(private UserRepository $userRepository, private UserRender $userRender) { diff --git a/src/Bundle/ChillCalendarBundle/Export/Aggregator/CancelReasonAggregator.php b/src/Bundle/ChillCalendarBundle/Export/Aggregator/CancelReasonAggregator.php index 051150378..5501215b7 100644 --- a/src/Bundle/ChillCalendarBundle/Export/Aggregator/CancelReasonAggregator.php +++ b/src/Bundle/ChillCalendarBundle/Export/Aggregator/CancelReasonAggregator.php @@ -22,7 +22,7 @@ use function in_array; class CancelReasonAggregator implements AggregatorInterface { - public function __construct(private CancelReasonRepository $cancelReasonRepository, private TranslatableStringHelper $translatableStringHelper) + public function __construct(private readonly CancelReasonRepository $cancelReasonRepository, private readonly TranslatableStringHelper $translatableStringHelper) { } diff --git a/src/Bundle/ChillCalendarBundle/Export/Aggregator/JobAggregator.php b/src/Bundle/ChillCalendarBundle/Export/Aggregator/JobAggregator.php index dbda0ad61..5094e05d0 100644 --- a/src/Bundle/ChillCalendarBundle/Export/Aggregator/JobAggregator.php +++ b/src/Bundle/ChillCalendarBundle/Export/Aggregator/JobAggregator.php @@ -20,7 +20,7 @@ use Doctrine\ORM\QueryBuilder; use Symfony\Component\Form\FormBuilderInterface; use function in_array; -final class JobAggregator implements AggregatorInterface +final readonly class JobAggregator implements AggregatorInterface { public function __construct(private UserJobRepository $jobRepository, private TranslatableStringHelper $translatableStringHelper) { diff --git a/src/Bundle/ChillCalendarBundle/Export/Aggregator/LocationAggregator.php b/src/Bundle/ChillCalendarBundle/Export/Aggregator/LocationAggregator.php index 954175935..36c224603 100644 --- a/src/Bundle/ChillCalendarBundle/Export/Aggregator/LocationAggregator.php +++ b/src/Bundle/ChillCalendarBundle/Export/Aggregator/LocationAggregator.php @@ -19,7 +19,7 @@ use Doctrine\ORM\QueryBuilder; use Symfony\Component\Form\FormBuilderInterface; use function in_array; -final class LocationAggregator implements AggregatorInterface +final readonly class LocationAggregator implements AggregatorInterface { public function __construct(private LocationRepository $locationRepository) { diff --git a/src/Bundle/ChillCalendarBundle/Export/Aggregator/LocationTypeAggregator.php b/src/Bundle/ChillCalendarBundle/Export/Aggregator/LocationTypeAggregator.php index 489bda8cb..b716fd4e7 100644 --- a/src/Bundle/ChillCalendarBundle/Export/Aggregator/LocationTypeAggregator.php +++ b/src/Bundle/ChillCalendarBundle/Export/Aggregator/LocationTypeAggregator.php @@ -20,7 +20,7 @@ use Doctrine\ORM\QueryBuilder; use Symfony\Component\Form\FormBuilderInterface; use function in_array; -final class LocationTypeAggregator implements AggregatorInterface +final readonly class LocationTypeAggregator implements AggregatorInterface { public function __construct(private LocationTypeRepository $locationTypeRepository, private TranslatableStringHelper $translatableStringHelper) { diff --git a/src/Bundle/ChillCalendarBundle/Export/Aggregator/ScopeAggregator.php b/src/Bundle/ChillCalendarBundle/Export/Aggregator/ScopeAggregator.php index 6f72648e0..529fa2e92 100644 --- a/src/Bundle/ChillCalendarBundle/Export/Aggregator/ScopeAggregator.php +++ b/src/Bundle/ChillCalendarBundle/Export/Aggregator/ScopeAggregator.php @@ -20,7 +20,7 @@ use Doctrine\ORM\QueryBuilder; use Symfony\Component\Form\FormBuilderInterface; use function in_array; -final class ScopeAggregator implements AggregatorInterface +final readonly class ScopeAggregator implements AggregatorInterface { public function __construct(private ScopeRepository $scopeRepository, private TranslatableStringHelper $translatableStringHelper) { diff --git a/src/Bundle/ChillCalendarBundle/Export/Aggregator/UrgencyAggregator.php b/src/Bundle/ChillCalendarBundle/Export/Aggregator/UrgencyAggregator.php index c7b03a146..53c6b2cb9 100644 --- a/src/Bundle/ChillCalendarBundle/Export/Aggregator/UrgencyAggregator.php +++ b/src/Bundle/ChillCalendarBundle/Export/Aggregator/UrgencyAggregator.php @@ -28,7 +28,7 @@ use Symfony\Contracts\Translation\TranslatorInterface; class UrgencyAggregator implements AggregatorInterface { - public function __construct(private TranslatorInterface $translator) + public function __construct(private readonly TranslatorInterface $translator) { } diff --git a/src/Bundle/ChillCalendarBundle/Export/Declarations.php b/src/Bundle/ChillCalendarBundle/Export/Declarations.php index 0df90749c..a007424e5 100644 --- a/src/Bundle/ChillCalendarBundle/Export/Declarations.php +++ b/src/Bundle/ChillCalendarBundle/Export/Declarations.php @@ -16,5 +16,5 @@ namespace Chill\CalendarBundle\Export; */ abstract class Declarations { - public const CALENDAR_TYPE = 'calendar'; + final public const CALENDAR_TYPE = 'calendar'; } diff --git a/src/Bundle/ChillCalendarBundle/Export/Export/CountCalendars.php b/src/Bundle/ChillCalendarBundle/Export/Export/CountCalendars.php index 50367ece7..81d519063 100644 --- a/src/Bundle/ChillCalendarBundle/Export/Export/CountCalendars.php +++ b/src/Bundle/ChillCalendarBundle/Export/Export/CountCalendars.php @@ -25,7 +25,7 @@ use Symfony\Component\Validator\Exception\LogicException; class CountCalendars implements ExportInterface, GroupedExportInterface { - public function __construct(private CalendarRepository $calendarRepository) + public function __construct(private readonly CalendarRepository $calendarRepository) { } diff --git a/src/Bundle/ChillCalendarBundle/Export/Export/StatCalendarAvgDuration.php b/src/Bundle/ChillCalendarBundle/Export/Export/StatCalendarAvgDuration.php index 68ab4fdd3..9964b8638 100644 --- a/src/Bundle/ChillCalendarBundle/Export/Export/StatCalendarAvgDuration.php +++ b/src/Bundle/ChillCalendarBundle/Export/Export/StatCalendarAvgDuration.php @@ -24,7 +24,7 @@ use Symfony\Component\Form\FormBuilderInterface; class StatCalendarAvgDuration implements ExportInterface, GroupedExportInterface { - public function __construct(private CalendarRepository $calendarRepository) + public function __construct(private readonly CalendarRepository $calendarRepository) { } diff --git a/src/Bundle/ChillCalendarBundle/Export/Export/StatCalendarSumDuration.php b/src/Bundle/ChillCalendarBundle/Export/Export/StatCalendarSumDuration.php index fe94cc4e0..2d372f898 100644 --- a/src/Bundle/ChillCalendarBundle/Export/Export/StatCalendarSumDuration.php +++ b/src/Bundle/ChillCalendarBundle/Export/Export/StatCalendarSumDuration.php @@ -24,7 +24,7 @@ use Symfony\Component\Form\FormBuilderInterface; class StatCalendarSumDuration implements ExportInterface, GroupedExportInterface { - public function __construct(private CalendarRepository $calendarRepository) + public function __construct(private readonly CalendarRepository $calendarRepository) { } diff --git a/src/Bundle/ChillCalendarBundle/Export/Filter/AgentFilter.php b/src/Bundle/ChillCalendarBundle/Export/Filter/AgentFilter.php index 6ae9d8236..2e31388d2 100644 --- a/src/Bundle/ChillCalendarBundle/Export/Filter/AgentFilter.php +++ b/src/Bundle/ChillCalendarBundle/Export/Filter/AgentFilter.php @@ -22,7 +22,7 @@ use Symfony\Component\Form\FormBuilderInterface; class AgentFilter implements FilterInterface { - public function __construct(private UserRender $userRender) + public function __construct(private readonly UserRender $userRender) { } diff --git a/src/Bundle/ChillCalendarBundle/Export/Filter/BetweenDatesFilter.php b/src/Bundle/ChillCalendarBundle/Export/Filter/BetweenDatesFilter.php index 9a316208c..62eb1418c 100644 --- a/src/Bundle/ChillCalendarBundle/Export/Filter/BetweenDatesFilter.php +++ b/src/Bundle/ChillCalendarBundle/Export/Filter/BetweenDatesFilter.php @@ -21,7 +21,7 @@ use Symfony\Component\Form\FormBuilderInterface; class BetweenDatesFilter implements FilterInterface { - public function __construct(private RollingDateConverterInterface $rollingDateConverter) + public function __construct(private readonly RollingDateConverterInterface $rollingDateConverter) { } diff --git a/src/Bundle/ChillCalendarBundle/Export/Filter/CalendarRangeFilter.php b/src/Bundle/ChillCalendarBundle/Export/Filter/CalendarRangeFilter.php index 6795457d9..bee70238a 100644 --- a/src/Bundle/ChillCalendarBundle/Export/Filter/CalendarRangeFilter.php +++ b/src/Bundle/ChillCalendarBundle/Export/Filter/CalendarRangeFilter.php @@ -35,7 +35,7 @@ class CalendarRangeFilter implements FilterInterface private const DEFAULT_CHOICE = false; - public function __construct(private TranslatorInterface $translator) + public function __construct(private readonly TranslatorInterface $translator) { } diff --git a/src/Bundle/ChillCalendarBundle/Export/Filter/JobFilter.php b/src/Bundle/ChillCalendarBundle/Export/Filter/JobFilter.php index 47482c732..e27de7633 100644 --- a/src/Bundle/ChillCalendarBundle/Export/Filter/JobFilter.php +++ b/src/Bundle/ChillCalendarBundle/Export/Filter/JobFilter.php @@ -24,7 +24,7 @@ use function in_array; class JobFilter implements FilterInterface { - public function __construct(protected TranslatorInterface $translator, private TranslatableStringHelper $translatableStringHelper) + public function __construct(protected TranslatorInterface $translator, private readonly TranslatableStringHelper $translatableStringHelper) { } diff --git a/src/Bundle/ChillCalendarBundle/Export/Filter/ScopeFilter.php b/src/Bundle/ChillCalendarBundle/Export/Filter/ScopeFilter.php index 80cbdec37..1f4f82a8e 100644 --- a/src/Bundle/ChillCalendarBundle/Export/Filter/ScopeFilter.php +++ b/src/Bundle/ChillCalendarBundle/Export/Filter/ScopeFilter.php @@ -24,7 +24,7 @@ use function in_array; class ScopeFilter implements FilterInterface { - public function __construct(protected TranslatorInterface $translator, private TranslatableStringHelper $translatableStringHelper) + public function __construct(protected TranslatorInterface $translator, private readonly TranslatableStringHelper $translatableStringHelper) { } diff --git a/src/Bundle/ChillCalendarBundle/Form/CalendarType.php b/src/Bundle/ChillCalendarBundle/Form/CalendarType.php index e54517ef3..a67d48b0b 100644 --- a/src/Bundle/ChillCalendarBundle/Form/CalendarType.php +++ b/src/Bundle/ChillCalendarBundle/Form/CalendarType.php @@ -32,7 +32,7 @@ use Symfony\Component\OptionsResolver\OptionsResolver; class CalendarType extends AbstractType { - public function __construct(private PersonsToIdDataTransformer $personsToIdDataTransformer, private IdToUserDataTransformer $idToUserDataTransformer, private IdToUsersDataTransformer $idToUsersDataTransformer, private IdToLocationDataTransformer $idToLocationDataTransformer, private ThirdPartiesToIdDataTransformer $partiesToIdDataTransformer, private IdToCalendarRangeDataTransformer $calendarRangeDataTransformer) + public function __construct(private readonly PersonsToIdDataTransformer $personsToIdDataTransformer, private readonly IdToUserDataTransformer $idToUserDataTransformer, private readonly IdToUsersDataTransformer $idToUsersDataTransformer, private readonly IdToLocationDataTransformer $idToLocationDataTransformer, private readonly ThirdPartiesToIdDataTransformer $partiesToIdDataTransformer, private readonly IdToCalendarRangeDataTransformer $calendarRangeDataTransformer) { } diff --git a/src/Bundle/ChillCalendarBundle/Menu/AccompanyingCourseMenuBuilder.php b/src/Bundle/ChillCalendarBundle/Menu/AccompanyingCourseMenuBuilder.php index a81fbdedd..3997c4dad 100644 --- a/src/Bundle/ChillCalendarBundle/Menu/AccompanyingCourseMenuBuilder.php +++ b/src/Bundle/ChillCalendarBundle/Menu/AccompanyingCourseMenuBuilder.php @@ -19,7 +19,7 @@ use Symfony\Contracts\Translation\TranslatorInterface; class AccompanyingCourseMenuBuilder implements LocalMenuBuilderInterface { - public function __construct(private Security $security, protected TranslatorInterface $translator) + public function __construct(private readonly Security $security, protected TranslatorInterface $translator) { } diff --git a/src/Bundle/ChillCalendarBundle/Menu/PersonMenuBuilder.php b/src/Bundle/ChillCalendarBundle/Menu/PersonMenuBuilder.php index fb1a60a7b..c7bbc756c 100644 --- a/src/Bundle/ChillCalendarBundle/Menu/PersonMenuBuilder.php +++ b/src/Bundle/ChillCalendarBundle/Menu/PersonMenuBuilder.php @@ -19,7 +19,7 @@ use Symfony\Contracts\Translation\TranslatorInterface; class PersonMenuBuilder implements LocalMenuBuilderInterface { - public function __construct(private Security $security, protected TranslatorInterface $translator) + public function __construct(private readonly Security $security, protected TranslatorInterface $translator) { } diff --git a/src/Bundle/ChillCalendarBundle/Menu/UserMenuBuilder.php b/src/Bundle/ChillCalendarBundle/Menu/UserMenuBuilder.php index f8c804519..90b94b08e 100644 --- a/src/Bundle/ChillCalendarBundle/Menu/UserMenuBuilder.php +++ b/src/Bundle/ChillCalendarBundle/Menu/UserMenuBuilder.php @@ -18,7 +18,7 @@ use Symfony\Contracts\Translation\TranslatorInterface; class UserMenuBuilder implements LocalMenuBuilderInterface { - public function __construct(private Security $security, public TranslatorInterface $translator) + public function __construct(private readonly Security $security, public TranslatorInterface $translator) { } diff --git a/src/Bundle/ChillCalendarBundle/Messenger/Doctrine/CalendarEntityListener.php b/src/Bundle/ChillCalendarBundle/Messenger/Doctrine/CalendarEntityListener.php index d940cbeca..6b51b3793 100644 --- a/src/Bundle/ChillCalendarBundle/Messenger/Doctrine/CalendarEntityListener.php +++ b/src/Bundle/ChillCalendarBundle/Messenger/Doctrine/CalendarEntityListener.php @@ -30,7 +30,7 @@ use Symfony\Component\Security\Core\Security; class CalendarEntityListener { - public function __construct(private MessageBusInterface $messageBus, private Security $security) + public function __construct(private readonly MessageBusInterface $messageBus, private readonly Security $security) { } diff --git a/src/Bundle/ChillCalendarBundle/Messenger/Doctrine/CalendarRangeEntityListener.php b/src/Bundle/ChillCalendarBundle/Messenger/Doctrine/CalendarRangeEntityListener.php index cb3d9a763..40da612e5 100644 --- a/src/Bundle/ChillCalendarBundle/Messenger/Doctrine/CalendarRangeEntityListener.php +++ b/src/Bundle/ChillCalendarBundle/Messenger/Doctrine/CalendarRangeEntityListener.php @@ -30,7 +30,7 @@ use Symfony\Component\Security\Core\Security; class CalendarRangeEntityListener { - public function __construct(private MessageBusInterface $messageBus, private Security $security) + public function __construct(private readonly MessageBusInterface $messageBus, private readonly Security $security) { } diff --git a/src/Bundle/ChillCalendarBundle/Messenger/Handler/CalendarRangeRemoveToRemoteHandler.php b/src/Bundle/ChillCalendarBundle/Messenger/Handler/CalendarRangeRemoveToRemoteHandler.php index b814d4cb8..c55bd8144 100644 --- a/src/Bundle/ChillCalendarBundle/Messenger/Handler/CalendarRangeRemoveToRemoteHandler.php +++ b/src/Bundle/ChillCalendarBundle/Messenger/Handler/CalendarRangeRemoveToRemoteHandler.php @@ -31,7 +31,7 @@ use Symfony\Component\Messenger\Handler\MessageHandlerInterface; */ class CalendarRangeRemoveToRemoteHandler implements MessageHandlerInterface { - public function __construct(private RemoteCalendarConnectorInterface $remoteCalendarConnector, private UserRepository $userRepository) + public function __construct(private readonly RemoteCalendarConnectorInterface $remoteCalendarConnector, private readonly UserRepository $userRepository) { } diff --git a/src/Bundle/ChillCalendarBundle/Messenger/Handler/CalendarRangeToRemoteHandler.php b/src/Bundle/ChillCalendarBundle/Messenger/Handler/CalendarRangeToRemoteHandler.php index b94ab6d9d..950ca526d 100644 --- a/src/Bundle/ChillCalendarBundle/Messenger/Handler/CalendarRangeToRemoteHandler.php +++ b/src/Bundle/ChillCalendarBundle/Messenger/Handler/CalendarRangeToRemoteHandler.php @@ -32,7 +32,7 @@ use Symfony\Component\Messenger\Handler\MessageHandlerInterface; */ class CalendarRangeToRemoteHandler implements MessageHandlerInterface { - public function __construct(private CalendarRangeRepository $calendarRangeRepository, private RemoteCalendarConnectorInterface $remoteCalendarConnector, private EntityManagerInterface $entityManager) + public function __construct(private readonly CalendarRangeRepository $calendarRangeRepository, private readonly RemoteCalendarConnectorInterface $remoteCalendarConnector, private readonly EntityManagerInterface $entityManager) { } diff --git a/src/Bundle/ChillCalendarBundle/Messenger/Handler/CalendarRemoveHandler.php b/src/Bundle/ChillCalendarBundle/Messenger/Handler/CalendarRemoveHandler.php index ccc8d0a06..6838d3147 100644 --- a/src/Bundle/ChillCalendarBundle/Messenger/Handler/CalendarRemoveHandler.php +++ b/src/Bundle/ChillCalendarBundle/Messenger/Handler/CalendarRemoveHandler.php @@ -31,7 +31,7 @@ use Symfony\Component\Messenger\Handler\MessageHandlerInterface; */ class CalendarRemoveHandler implements MessageHandlerInterface { - public function __construct(private RemoteCalendarConnectorInterface $remoteCalendarConnector, private CalendarRangeRepository $calendarRangeRepository, private UserRepositoryInterface $userRepository) + public function __construct(private readonly RemoteCalendarConnectorInterface $remoteCalendarConnector, private readonly CalendarRangeRepository $calendarRangeRepository, private readonly UserRepositoryInterface $userRepository) { } diff --git a/src/Bundle/ChillCalendarBundle/Messenger/Handler/CalendarToRemoteHandler.php b/src/Bundle/ChillCalendarBundle/Messenger/Handler/CalendarToRemoteHandler.php index 2698921fc..310e8734b 100644 --- a/src/Bundle/ChillCalendarBundle/Messenger/Handler/CalendarToRemoteHandler.php +++ b/src/Bundle/ChillCalendarBundle/Messenger/Handler/CalendarToRemoteHandler.php @@ -37,7 +37,7 @@ use Symfony\Component\Messenger\Handler\MessageHandlerInterface; */ class CalendarToRemoteHandler implements MessageHandlerInterface { - public function __construct(private CalendarRangeRepository $calendarRangeRepository, private CalendarRepository $calendarRepository, private EntityManagerInterface $entityManager, private InviteRepository $inviteRepository, private RemoteCalendarConnectorInterface $calendarConnector, private UserRepository $userRepository) + public function __construct(private readonly CalendarRangeRepository $calendarRangeRepository, private readonly CalendarRepository $calendarRepository, private readonly EntityManagerInterface $entityManager, private readonly InviteRepository $inviteRepository, private readonly RemoteCalendarConnectorInterface $calendarConnector, private readonly UserRepository $userRepository) { } diff --git a/src/Bundle/ChillCalendarBundle/Messenger/Handler/InviteUpdateHandler.php b/src/Bundle/ChillCalendarBundle/Messenger/Handler/InviteUpdateHandler.php index b917a13ae..1d987c19e 100644 --- a/src/Bundle/ChillCalendarBundle/Messenger/Handler/InviteUpdateHandler.php +++ b/src/Bundle/ChillCalendarBundle/Messenger/Handler/InviteUpdateHandler.php @@ -31,7 +31,7 @@ use Symfony\Component\Messenger\Handler\MessageHandlerInterface; */ class InviteUpdateHandler implements MessageHandlerInterface { - public function __construct(private EntityManagerInterface $em, private InviteRepository $inviteRepository, private RemoteCalendarConnectorInterface $remoteCalendarConnector) + public function __construct(private readonly EntityManagerInterface $em, private readonly InviteRepository $inviteRepository, private readonly RemoteCalendarConnectorInterface $remoteCalendarConnector) { } diff --git a/src/Bundle/ChillCalendarBundle/Messenger/Handler/MSGraphChangeNotificationHandler.php b/src/Bundle/ChillCalendarBundle/Messenger/Handler/MSGraphChangeNotificationHandler.php index f6debd2d5..342180cf1 100644 --- a/src/Bundle/ChillCalendarBundle/Messenger/Handler/MSGraphChangeNotificationHandler.php +++ b/src/Bundle/ChillCalendarBundle/Messenger/Handler/MSGraphChangeNotificationHandler.php @@ -36,7 +36,7 @@ use Symfony\Component\Messenger\Handler\MessageHandlerInterface; */ class MSGraphChangeNotificationHandler implements MessageHandlerInterface { - public function __construct(private CalendarRangeRepository $calendarRangeRepository, private CalendarRangeSyncer $calendarRangeSyncer, private CalendarRepository $calendarRepository, private CalendarSyncer $calendarSyncer, private EntityManagerInterface $em, private LoggerInterface $logger, private MapCalendarToUser $mapCalendarToUser, private UserRepository $userRepository) + public function __construct(private readonly CalendarRangeRepository $calendarRangeRepository, private readonly CalendarRangeSyncer $calendarRangeSyncer, private readonly CalendarRepository $calendarRepository, private readonly CalendarSyncer $calendarSyncer, private readonly EntityManagerInterface $em, private readonly LoggerInterface $logger, private readonly MapCalendarToUser $mapCalendarToUser, private readonly UserRepository $userRepository) { } diff --git a/src/Bundle/ChillCalendarBundle/Messenger/Message/CalendarMessage.php b/src/Bundle/ChillCalendarBundle/Messenger/Message/CalendarMessage.php index 53b20e49e..9bcd81c67 100644 --- a/src/Bundle/ChillCalendarBundle/Messenger/Message/CalendarMessage.php +++ b/src/Bundle/ChillCalendarBundle/Messenger/Message/CalendarMessage.php @@ -24,13 +24,13 @@ use Chill\MainBundle\Entity\User; class CalendarMessage { - public const CALENDAR_PERSIST = 'CHILL_CALENDAR_CALENDAR_PERSIST'; + final public const CALENDAR_PERSIST = 'CHILL_CALENDAR_CALENDAR_PERSIST'; - public const CALENDAR_UPDATE = 'CHILL_CALENDAR_CALENDAR_UPDATE'; + final public const CALENDAR_UPDATE = 'CHILL_CALENDAR_CALENDAR_UPDATE'; - private int $byUserId; + private readonly int $byUserId; - private int $calendarId; + private readonly int $calendarId; private array $newInvitesIds = []; @@ -45,7 +45,7 @@ class CalendarMessage public function __construct( Calendar $calendar, - private string $action, + private readonly string $action, User $byUser ) { $this->calendarId = $calendar->getId(); diff --git a/src/Bundle/ChillCalendarBundle/Messenger/Message/CalendarRangeMessage.php b/src/Bundle/ChillCalendarBundle/Messenger/Message/CalendarRangeMessage.php index 61d006a79..13669a0a2 100644 --- a/src/Bundle/ChillCalendarBundle/Messenger/Message/CalendarRangeMessage.php +++ b/src/Bundle/ChillCalendarBundle/Messenger/Message/CalendarRangeMessage.php @@ -23,15 +23,15 @@ use Chill\MainBundle\Entity\User; class CalendarRangeMessage { - public const CALENDAR_RANGE_PERSIST = 'CHILL_CALENDAR_CALENDAR_RANGE_PERSIST'; + final public const CALENDAR_RANGE_PERSIST = 'CHILL_CALENDAR_CALENDAR_RANGE_PERSIST'; - public const CALENDAR_RANGE_UPDATE = 'CHILL_CALENDAR_CALENDAR_RANGE_UPDATE'; + final public const CALENDAR_RANGE_UPDATE = 'CHILL_CALENDAR_CALENDAR_RANGE_UPDATE'; private ?int $byUserId = null; - private int $calendarRangeId; + private readonly int $calendarRangeId; - public function __construct(CalendarRange $calendarRange, private string $action, ?User $byUser) + public function __construct(CalendarRange $calendarRange, private readonly string $action, ?User $byUser) { $this->calendarRangeId = $calendarRange->getId(); diff --git a/src/Bundle/ChillCalendarBundle/Messenger/Message/CalendarRangeRemovedMessage.php b/src/Bundle/ChillCalendarBundle/Messenger/Message/CalendarRangeRemovedMessage.php index 783484592..eb8be6838 100644 --- a/src/Bundle/ChillCalendarBundle/Messenger/Message/CalendarRangeRemovedMessage.php +++ b/src/Bundle/ChillCalendarBundle/Messenger/Message/CalendarRangeRemovedMessage.php @@ -25,11 +25,11 @@ class CalendarRangeRemovedMessage { private ?int $byUserId = null; - private int $calendarRangeUserId; + private readonly int $calendarRangeUserId; - private array $remoteAttributes; + private readonly array $remoteAttributes; - private string $remoteId; + private readonly string $remoteId; public function __construct(CalendarRange $calendarRange, ?User $byUser) { diff --git a/src/Bundle/ChillCalendarBundle/Messenger/Message/CalendarRemovedMessage.php b/src/Bundle/ChillCalendarBundle/Messenger/Message/CalendarRemovedMessage.php index 65831ebe0..53dcea28c 100644 --- a/src/Bundle/ChillCalendarBundle/Messenger/Message/CalendarRemovedMessage.php +++ b/src/Bundle/ChillCalendarBundle/Messenger/Message/CalendarRemovedMessage.php @@ -27,11 +27,11 @@ class CalendarRemovedMessage private ?int $byUserId = null; - private int $calendarUserId; + private readonly int $calendarUserId; - private array $remoteAttributes; + private readonly array $remoteAttributes; - private string $remoteId; + private readonly string $remoteId; public function __construct(Calendar $calendar, ?User $byUser) { diff --git a/src/Bundle/ChillCalendarBundle/Messenger/Message/InviteUpdateMessage.php b/src/Bundle/ChillCalendarBundle/Messenger/Message/InviteUpdateMessage.php index 35f78fc7d..d18ab8db1 100644 --- a/src/Bundle/ChillCalendarBundle/Messenger/Message/InviteUpdateMessage.php +++ b/src/Bundle/ChillCalendarBundle/Messenger/Message/InviteUpdateMessage.php @@ -23,9 +23,9 @@ use Chill\MainBundle\Entity\User; class InviteUpdateMessage { - private int $byUserId; + private readonly int $byUserId; - private int $inviteId; + private readonly int $inviteId; public function __construct(Invite $invite, User $byUser) { diff --git a/src/Bundle/ChillCalendarBundle/Messenger/Message/MSGraphChangeNotificationMessage.php b/src/Bundle/ChillCalendarBundle/Messenger/Message/MSGraphChangeNotificationMessage.php index 8288787cb..682369e03 100644 --- a/src/Bundle/ChillCalendarBundle/Messenger/Message/MSGraphChangeNotificationMessage.php +++ b/src/Bundle/ChillCalendarBundle/Messenger/Message/MSGraphChangeNotificationMessage.php @@ -20,7 +20,7 @@ namespace Chill\CalendarBundle\Messenger\Message; class MSGraphChangeNotificationMessage { - public function __construct(private array $content, private int $userId) + public function __construct(private readonly array $content, private readonly int $userId) { } diff --git a/src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/MSGraph/AddressConverter.php b/src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/MSGraph/AddressConverter.php index 05f116c6b..2764a46e3 100644 --- a/src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/MSGraph/AddressConverter.php +++ b/src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/MSGraph/AddressConverter.php @@ -24,7 +24,7 @@ use Chill\MainBundle\Templating\TranslatableStringHelperInterface; class AddressConverter { - public function __construct(private AddressRender $addressRender, private TranslatableStringHelperInterface $translatableStringHelper) + public function __construct(private readonly AddressRender $addressRender, private readonly TranslatableStringHelperInterface $translatableStringHelper) { } diff --git a/src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/MSGraph/EventsOnUserSubscriptionCreator.php b/src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/MSGraph/EventsOnUserSubscriptionCreator.php index 3bbe22161..f6d8cba5a 100644 --- a/src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/MSGraph/EventsOnUserSubscriptionCreator.php +++ b/src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/MSGraph/EventsOnUserSubscriptionCreator.php @@ -30,7 +30,7 @@ use Symfony\Contracts\HttpClient\Exception\ClientExceptionInterface; */ class EventsOnUserSubscriptionCreator { - public function __construct(private LoggerInterface $logger, private MachineHttpClient $machineHttpClient, private MapCalendarToUser $mapCalendarToUser, private UrlGeneratorInterface $urlGenerator) + public function __construct(private readonly LoggerInterface $logger, private readonly MachineHttpClient $machineHttpClient, private readonly MapCalendarToUser $mapCalendarToUser, private readonly UrlGeneratorInterface $urlGenerator) { } diff --git a/src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/MSGraph/LocationConverter.php b/src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/MSGraph/LocationConverter.php index 5de500b52..cbf97806e 100644 --- a/src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/MSGraph/LocationConverter.php +++ b/src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/MSGraph/LocationConverter.php @@ -22,7 +22,7 @@ use Chill\MainBundle\Entity\Location; class LocationConverter { - public function __construct(private AddressConverter $addressConverter) + public function __construct(private readonly AddressConverter $addressConverter) { } diff --git a/src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/MSGraph/MSGraphUserRepository.php b/src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/MSGraph/MSGraphUserRepository.php index 39fbf6c15..840ecd40f 100644 --- a/src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/MSGraph/MSGraphUserRepository.php +++ b/src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/MSGraph/MSGraphUserRepository.php @@ -42,7 +42,7 @@ class MSGraphUserRepository ; SQL; - public function __construct(private EntityManagerInterface $entityManager) + public function __construct(private readonly EntityManagerInterface $entityManager) { } diff --git a/src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/MSGraph/MachineHttpClient.php b/src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/MSGraph/MachineHttpClient.php index 8a3f37678..b7b9b4e73 100644 --- a/src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/MSGraph/MachineHttpClient.php +++ b/src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/MSGraph/MachineHttpClient.php @@ -28,12 +28,12 @@ class MachineHttpClient implements HttpClientInterface { use BearerAuthorizationTrait; - private HttpClientInterface $decoratedClient; + private readonly HttpClientInterface $decoratedClient; /** * @param HttpClientInterface $decoratedClient */ - public function __construct(private MachineTokenStorage $machineTokenStorage, ?HttpClientInterface $decoratedClient = null) + public function __construct(private readonly MachineTokenStorage $machineTokenStorage, ?HttpClientInterface $decoratedClient = null) { $this->decoratedClient = $decoratedClient ?? \Symfony\Component\HttpClient\HttpClient::create(); } diff --git a/src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/MSGraph/MachineTokenStorage.php b/src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/MSGraph/MachineTokenStorage.php index ad7060c1a..f5d25caaf 100644 --- a/src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/MSGraph/MachineTokenStorage.php +++ b/src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/MSGraph/MachineTokenStorage.php @@ -29,7 +29,7 @@ class MachineTokenStorage private ?AccessTokenInterface $accessToken = null; - public function __construct(private Azure $azure, private ChillRedis $chillRedis) + public function __construct(private readonly Azure $azure, private readonly ChillRedis $chillRedis) { } diff --git a/src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/MSGraph/MapCalendarToUser.php b/src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/MSGraph/MapCalendarToUser.php index 6fcc9d20f..6abe11120 100644 --- a/src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/MSGraph/MapCalendarToUser.php +++ b/src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/MSGraph/MapCalendarToUser.php @@ -31,15 +31,15 @@ use function array_key_exists; */ class MapCalendarToUser { - public const EXPIRATION_SUBSCRIPTION_EVENT = 'subscription_events_expiration'; + final public const EXPIRATION_SUBSCRIPTION_EVENT = 'subscription_events_expiration'; - public const ID_SUBSCRIPTION_EVENT = 'subscription_events_id'; + final public const ID_SUBSCRIPTION_EVENT = 'subscription_events_id'; - public const METADATA_KEY = 'msgraph'; + final public const METADATA_KEY = 'msgraph'; - public const SECRET_SUBSCRIPTION_EVENT = 'subscription_events_secret'; + final public const SECRET_SUBSCRIPTION_EVENT = 'subscription_events_secret'; - public function __construct(private HttpClientInterface $machineHttpClient, private LoggerInterface $logger) + public function __construct(private readonly HttpClientInterface $machineHttpClient, private readonly LoggerInterface $logger) { } diff --git a/src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/MSGraph/OnBehalfOfUserHttpClient.php b/src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/MSGraph/OnBehalfOfUserHttpClient.php index 70a7f1ca0..32f0e5dec 100644 --- a/src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/MSGraph/OnBehalfOfUserHttpClient.php +++ b/src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/MSGraph/OnBehalfOfUserHttpClient.php @@ -28,12 +28,12 @@ class OnBehalfOfUserHttpClient { use BearerAuthorizationTrait; - private HttpClientInterface $decoratedClient; + private readonly HttpClientInterface $decoratedClient; /** * @param HttpClientInterface $decoratedClient */ - public function __construct(private OnBehalfOfUserTokenStorage $tokenStorage, ?HttpClientInterface $decoratedClient = null) + public function __construct(private readonly OnBehalfOfUserTokenStorage $tokenStorage, ?HttpClientInterface $decoratedClient = null) { $this->decoratedClient = $decoratedClient ?? \Symfony\Component\HttpClient\HttpClient::create(); } diff --git a/src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/MSGraph/OnBehalfOfUserTokenStorage.php b/src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/MSGraph/OnBehalfOfUserTokenStorage.php index 6bb171248..c40c46fbe 100644 --- a/src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/MSGraph/OnBehalfOfUserTokenStorage.php +++ b/src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/MSGraph/OnBehalfOfUserTokenStorage.php @@ -28,9 +28,9 @@ use TheNetworg\OAuth2\Client\Token\AccessToken; */ class OnBehalfOfUserTokenStorage { - public const MS_GRAPH_ACCESS_TOKEN = 'msgraph_access_token'; + final public const MS_GRAPH_ACCESS_TOKEN = 'msgraph_access_token'; - public function __construct(private Azure $azure, private SessionInterface $session) + public function __construct(private readonly Azure $azure, private readonly SessionInterface $session) { } diff --git a/src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/MSGraph/RemoteEventConverter.php b/src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/MSGraph/RemoteEventConverter.php index 9d96357cd..c4d8e0b70 100644 --- a/src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/MSGraph/RemoteEventConverter.php +++ b/src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/MSGraph/RemoteEventConverter.php @@ -41,27 +41,27 @@ class RemoteEventConverter * valid when the remote string contains also a timezone, like in * lastModifiedDate. */ - public const REMOTE_DATETIMEZONE_FORMAT = 'Y-m-d\\TH:i:s.u?P'; + final public const REMOTE_DATETIMEZONE_FORMAT = 'Y-m-d\\TH:i:s.u?P'; /** * Same as above, but sometimes the date is expressed with only 6 milliseconds. */ - public const REMOTE_DATETIMEZONE_FORMAT_ALT = 'Y-m-d\\TH:i:s.uP'; + final public const REMOTE_DATETIMEZONE_FORMAT_ALT = 'Y-m-d\\TH:i:s.uP'; private const REMOTE_DATE_FORMAT = 'Y-m-d\TH:i:s.u0'; private const REMOTE_DATETIME_WITHOUT_TZ_FORMAT = 'Y-m-d\TH:i:s.u?'; - private DateTimeZone $defaultDateTimeZone; + private readonly DateTimeZone $defaultDateTimeZone; - private DateTimeZone $remoteDateTimeZone; + private readonly DateTimeZone $remoteDateTimeZone; public function __construct( - private EngineInterface $engine, - private LocationConverter $locationConverter, - private LoggerInterface $logger, - private PersonRenderInterface $personRender, - private TranslatorInterface $translator + private readonly EngineInterface $engine, + private readonly LocationConverter $locationConverter, + private readonly LoggerInterface $logger, + private readonly PersonRenderInterface $personRender, + private readonly TranslatorInterface $translator ) { $this->defaultDateTimeZone = (new DateTimeImmutable())->getTimezone(); $this->remoteDateTimeZone = self::getRemoteTimeZone(); diff --git a/src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/MSGraph/RemoteToLocalSync/CalendarRangeSyncer.php b/src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/MSGraph/RemoteToLocalSync/CalendarRangeSyncer.php index add82d5d9..8df0d8a0b 100644 --- a/src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/MSGraph/RemoteToLocalSync/CalendarRangeSyncer.php +++ b/src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/MSGraph/RemoteToLocalSync/CalendarRangeSyncer.php @@ -33,7 +33,7 @@ class CalendarRangeSyncer /** * @param MachineHttpClient $machineHttpClient */ - public function __construct(private EntityManagerInterface $em, private LoggerInterface $logger, private HttpClientInterface $machineHttpClient) + public function __construct(private readonly EntityManagerInterface $em, private readonly LoggerInterface $logger, private readonly HttpClientInterface $machineHttpClient) { } diff --git a/src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/MSGraph/RemoteToLocalSync/CalendarSyncer.php b/src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/MSGraph/RemoteToLocalSync/CalendarSyncer.php index 7767c0a8b..470e5d30a 100644 --- a/src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/MSGraph/RemoteToLocalSync/CalendarSyncer.php +++ b/src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/MSGraph/RemoteToLocalSync/CalendarSyncer.php @@ -32,7 +32,7 @@ use function in_array; class CalendarSyncer { - public function __construct(private LoggerInterface $logger, private HttpClientInterface $machineHttpClient, private UserRepositoryInterface $userRepository) + public function __construct(private readonly LoggerInterface $logger, private readonly HttpClientInterface $machineHttpClient, private readonly UserRepositoryInterface $userRepository) { } @@ -119,7 +119,7 @@ class CalendarSyncer } $email = $attendee['emailAddress']['address']; - $emails[] = strtolower($email); + $emails[] = strtolower((string) $email); $user = $this->userRepository->findOneByUsernameOrEmail($email); if (null === $user) { diff --git a/src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/MSGraphRemoteCalendarConnector.php b/src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/MSGraphRemoteCalendarConnector.php index 9d6dcd65c..0d47eaec4 100644 --- a/src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/MSGraphRemoteCalendarConnector.php +++ b/src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/MSGraphRemoteCalendarConnector.php @@ -45,7 +45,7 @@ class MSGraphRemoteCalendarConnector implements RemoteCalendarConnectorInterface { private array $cacheScheduleTimeForUser = []; - public function __construct(private CalendarRepository $calendarRepository, private CalendarRangeRepository $calendarRangeRepository, private HttpClientInterface $machineHttpClient, private MapCalendarToUser $mapCalendarToUser, private LoggerInterface $logger, private OnBehalfOfUserTokenStorage $tokenStorage, private OnBehalfOfUserHttpClient $userHttpClient, private RemoteEventConverter $remoteEventConverter, private TranslatorInterface $translator, private UrlGeneratorInterface $urlGenerator, private Security $security) + public function __construct(private readonly CalendarRepository $calendarRepository, private readonly CalendarRangeRepository $calendarRangeRepository, private readonly HttpClientInterface $machineHttpClient, private readonly MapCalendarToUser $mapCalendarToUser, private readonly LoggerInterface $logger, private readonly OnBehalfOfUserTokenStorage $tokenStorage, private readonly OnBehalfOfUserHttpClient $userHttpClient, private readonly RemoteEventConverter $remoteEventConverter, private readonly TranslatorInterface $translator, private readonly UrlGeneratorInterface $urlGenerator, private readonly Security $security) { } diff --git a/src/Bundle/ChillCalendarBundle/Repository/CalendarACLAwareRepository.php b/src/Bundle/ChillCalendarBundle/Repository/CalendarACLAwareRepository.php index 1fc5dd351..6981f0a4c 100644 --- a/src/Bundle/ChillCalendarBundle/Repository/CalendarACLAwareRepository.php +++ b/src/Bundle/ChillCalendarBundle/Repository/CalendarACLAwareRepository.php @@ -29,7 +29,7 @@ use Doctrine\ORM\QueryBuilder; class CalendarACLAwareRepository implements CalendarACLAwareRepositoryInterface { - public function __construct(private AccompanyingPeriodACLAwareRepositoryInterface $accompanyingPeriodACLAwareRepository, private EntityManagerInterface $em) + public function __construct(private readonly AccompanyingPeriodACLAwareRepositoryInterface $accompanyingPeriodACLAwareRepository, private readonly EntityManagerInterface $em) { } diff --git a/src/Bundle/ChillCalendarBundle/Repository/CalendarDocRepository.php b/src/Bundle/ChillCalendarBundle/Repository/CalendarDocRepository.php index bd1074b5f..dd593bf3c 100644 --- a/src/Bundle/ChillCalendarBundle/Repository/CalendarDocRepository.php +++ b/src/Bundle/ChillCalendarBundle/Repository/CalendarDocRepository.php @@ -18,7 +18,7 @@ use Doctrine\Persistence\ObjectRepository; class CalendarDocRepository implements ObjectRepository, CalendarDocRepositoryInterface { - private EntityRepository $repository; + private readonly EntityRepository $repository; public function __construct(EntityManagerInterface $entityManager) { diff --git a/src/Bundle/ChillCalendarBundle/Repository/CalendarRangeRepository.php b/src/Bundle/ChillCalendarBundle/Repository/CalendarRangeRepository.php index 69a077e47..b74110c96 100644 --- a/src/Bundle/ChillCalendarBundle/Repository/CalendarRangeRepository.php +++ b/src/Bundle/ChillCalendarBundle/Repository/CalendarRangeRepository.php @@ -24,9 +24,9 @@ use function count; class CalendarRangeRepository implements ObjectRepository { - private EntityRepository $repository; + private readonly EntityRepository $repository; - public function __construct(private EntityManagerInterface $em) + public function __construct(private readonly EntityManagerInterface $em) { $this->repository = $em->getRepository(CalendarRange::class); } diff --git a/src/Bundle/ChillCalendarBundle/Repository/CalendarRepository.php b/src/Bundle/ChillCalendarBundle/Repository/CalendarRepository.php index 4fd9b8a29..91a64c5ec 100644 --- a/src/Bundle/ChillCalendarBundle/Repository/CalendarRepository.php +++ b/src/Bundle/ChillCalendarBundle/Repository/CalendarRepository.php @@ -25,9 +25,9 @@ use function count; class CalendarRepository implements ObjectRepository { - private EntityManagerInterface $em; + private readonly EntityManagerInterface $em; - private EntityRepository $repository; + private readonly EntityRepository $repository; public function __construct(EntityManagerInterface $entityManager) { diff --git a/src/Bundle/ChillCalendarBundle/Repository/InviteRepository.php b/src/Bundle/ChillCalendarBundle/Repository/InviteRepository.php index f0bd8fe88..8778330f8 100644 --- a/src/Bundle/ChillCalendarBundle/Repository/InviteRepository.php +++ b/src/Bundle/ChillCalendarBundle/Repository/InviteRepository.php @@ -18,7 +18,7 @@ use Doctrine\Persistence\ObjectRepository; class InviteRepository implements ObjectRepository { - private EntityRepository $entityRepository; + private readonly EntityRepository $entityRepository; public function __construct(EntityManagerInterface $em) { diff --git a/src/Bundle/ChillCalendarBundle/Security/Voter/CalendarDocVoter.php b/src/Bundle/ChillCalendarBundle/Security/Voter/CalendarDocVoter.php index 7cd815961..a3e1b91ff 100644 --- a/src/Bundle/ChillCalendarBundle/Security/Voter/CalendarDocVoter.php +++ b/src/Bundle/ChillCalendarBundle/Security/Voter/CalendarDocVoter.php @@ -20,16 +20,16 @@ use function in_array; class CalendarDocVoter extends Voter { - public const EDIT = 'CHILL_CALENDAR_DOC_EDIT'; + final public const EDIT = 'CHILL_CALENDAR_DOC_EDIT'; - public const SEE = 'CHILL_CALENDAR_DOC_SEE'; + final public const SEE = 'CHILL_CALENDAR_DOC_SEE'; private const ALL = [ 'CHILL_CALENDAR_DOC_EDIT', 'CHILL_CALENDAR_DOC_SEE', ]; - public function __construct(private Security $security) + public function __construct(private readonly Security $security) { } diff --git a/src/Bundle/ChillCalendarBundle/Security/Voter/CalendarVoter.php b/src/Bundle/ChillCalendarBundle/Security/Voter/CalendarVoter.php index faf6fb5c8..10370ebbb 100644 --- a/src/Bundle/ChillCalendarBundle/Security/Voter/CalendarVoter.php +++ b/src/Bundle/ChillCalendarBundle/Security/Voter/CalendarVoter.php @@ -34,22 +34,18 @@ use Symfony\Component\Security\Core\Security; class CalendarVoter extends AbstractChillVoter implements ProvideRoleHierarchyInterface { - public const CREATE = 'CHILL_CALENDAR_CALENDAR_CREATE'; + final public const CREATE = 'CHILL_CALENDAR_CALENDAR_CREATE'; - public const DELETE = 'CHILL_CALENDAR_CALENDAR_DELETE'; + final public const DELETE = 'CHILL_CALENDAR_CALENDAR_DELETE'; - public const EDIT = 'CHILL_CALENDAR_CALENDAR_EDIT'; + final public const EDIT = 'CHILL_CALENDAR_CALENDAR_EDIT'; - public const SEE = 'CHILL_CALENDAR_CALENDAR_SEE'; + final public const SEE = 'CHILL_CALENDAR_CALENDAR_SEE'; - private AuthorizationHelperInterface $authorizationHelper; - - private CenterResolverManagerInterface $centerResolverManager; - - private VoterHelperInterface $voterHelper; + private readonly VoterHelperInterface $voterHelper; public function __construct( - private Security $security, + private readonly Security $security, VoterHelperFactoryInterface $voterHelperFactory ) { $this->voterHelper = $voterHelperFactory diff --git a/src/Bundle/ChillCalendarBundle/Security/Voter/InviteVoter.php b/src/Bundle/ChillCalendarBundle/Security/Voter/InviteVoter.php index 36ca66d05..72aa806e6 100644 --- a/src/Bundle/ChillCalendarBundle/Security/Voter/InviteVoter.php +++ b/src/Bundle/ChillCalendarBundle/Security/Voter/InviteVoter.php @@ -24,7 +24,7 @@ use Symfony\Component\Security\Core\Authorization\Voter\Voter; class InviteVoter extends Voter { - public const ANSWER = 'CHILL_CALENDAR_INVITE_ANSWER'; + final public const ANSWER = 'CHILL_CALENDAR_INVITE_ANSWER'; protected function supports($attribute, $subject): bool { diff --git a/src/Bundle/ChillCalendarBundle/Service/DocGenerator/CalendarContext.php b/src/Bundle/ChillCalendarBundle/Service/DocGenerator/CalendarContext.php index cb8bb5f7a..88ab41e91 100644 --- a/src/Bundle/ChillCalendarBundle/Service/DocGenerator/CalendarContext.php +++ b/src/Bundle/ChillCalendarBundle/Service/DocGenerator/CalendarContext.php @@ -31,7 +31,7 @@ use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; use function count; -final class CalendarContext implements CalendarContextInterface +final readonly class CalendarContext implements CalendarContextInterface { public function __construct(private BaseContextData $baseContextData, private EntityManagerInterface $entityManager, private NormalizerInterface $normalizer, private PersonRender $personRender, private PersonRepository $personRepository, private ThirdPartyRender $thirdPartyRender, private ThirdPartyRepository $thirdPartyRepository, private TranslatableStringHelperInterface $translatableStringHelper) { diff --git a/src/Bundle/ChillCalendarBundle/Service/ShortMessageNotification/BulkCalendarShortMessageSender.php b/src/Bundle/ChillCalendarBundle/Service/ShortMessageNotification/BulkCalendarShortMessageSender.php index f5fc86373..ad558b774 100644 --- a/src/Bundle/ChillCalendarBundle/Service/ShortMessageNotification/BulkCalendarShortMessageSender.php +++ b/src/Bundle/ChillCalendarBundle/Service/ShortMessageNotification/BulkCalendarShortMessageSender.php @@ -26,7 +26,7 @@ use Symfony\Component\Messenger\MessageBusInterface; class BulkCalendarShortMessageSender { - public function __construct(private CalendarForShortMessageProvider $provider, private EntityManagerInterface $em, private LoggerInterface $logger, private MessageBusInterface $messageBus, private ShortMessageForCalendarBuilderInterface $messageForCalendarBuilder) + public function __construct(private readonly CalendarForShortMessageProvider $provider, private readonly EntityManagerInterface $em, private readonly LoggerInterface $logger, private readonly MessageBusInterface $messageBus, private readonly ShortMessageForCalendarBuilderInterface $messageForCalendarBuilder) { } diff --git a/src/Bundle/ChillCalendarBundle/Service/ShortMessageNotification/CalendarForShortMessageProvider.php b/src/Bundle/ChillCalendarBundle/Service/ShortMessageNotification/CalendarForShortMessageProvider.php index a6a8134ae..d460e6715 100644 --- a/src/Bundle/ChillCalendarBundle/Service/ShortMessageNotification/CalendarForShortMessageProvider.php +++ b/src/Bundle/ChillCalendarBundle/Service/ShortMessageNotification/CalendarForShortMessageProvider.php @@ -26,7 +26,7 @@ use function count; class CalendarForShortMessageProvider { - public function __construct(private CalendarRepository $calendarRepository, private EntityManagerInterface $em, private RangeGeneratorInterface $rangeGenerator) + public function __construct(private readonly CalendarRepository $calendarRepository, private readonly EntityManagerInterface $em, private readonly RangeGeneratorInterface $rangeGenerator) { } diff --git a/src/Bundle/ChillCalendarBundle/Service/ShortMessageNotification/DefaultShortMessageForCalendarBuilder.php b/src/Bundle/ChillCalendarBundle/Service/ShortMessageNotification/DefaultShortMessageForCalendarBuilder.php index 66de8781c..8177be31a 100644 --- a/src/Bundle/ChillCalendarBundle/Service/ShortMessageNotification/DefaultShortMessageForCalendarBuilder.php +++ b/src/Bundle/ChillCalendarBundle/Service/ShortMessageNotification/DefaultShortMessageForCalendarBuilder.php @@ -24,7 +24,7 @@ use Symfony\Component\Templating\EngineInterface; class DefaultShortMessageForCalendarBuilder implements ShortMessageForCalendarBuilderInterface { - public function __construct(private EngineInterface $engine) + public function __construct(private readonly EngineInterface $engine) { } diff --git a/src/Bundle/ChillCalendarBundle/Tests/Form/CalendarTypeTest.php b/src/Bundle/ChillCalendarBundle/Tests/Form/CalendarTypeTest.php index 9195d5eac..f9392ba57 100644 --- a/src/Bundle/ChillCalendarBundle/Tests/Form/CalendarTypeTest.php +++ b/src/Bundle/ChillCalendarBundle/Tests/Form/CalendarTypeTest.php @@ -170,7 +170,7 @@ final class CalendarTypeTest extends TypeTestCase return $obj; }, - explode(',', $args[0]) + explode(',', (string) $args[0]) ); }); diff --git a/src/Bundle/ChillCustomFieldsBundle/Command/CreateFieldsOnGroupCommand.php b/src/Bundle/ChillCustomFieldsBundle/Command/CreateFieldsOnGroupCommand.php index 739cc6c6e..40a946bd2 100644 --- a/src/Bundle/ChillCustomFieldsBundle/Command/CreateFieldsOnGroupCommand.php +++ b/src/Bundle/ChillCustomFieldsBundle/Command/CreateFieldsOnGroupCommand.php @@ -34,9 +34,9 @@ use function count; */ class CreateFieldsOnGroupCommand extends Command { - public const ARG_DELETE = 'delete'; + final public const ARG_DELETE = 'delete'; - public const ARG_PATH = 'path'; + final public const ARG_PATH = 'path'; /** * CreateFieldsOnGroupCommand constructor. @@ -45,9 +45,9 @@ class CreateFieldsOnGroupCommand extends Command * @param $customizablesEntities */ public function __construct( - private CustomFieldProvider $customFieldProvider, - private EntityManager $entityManager, - private ValidatorInterface $validator, + private readonly CustomFieldProvider $customFieldProvider, + private readonly EntityManager $entityManager, + private readonly ValidatorInterface $validator, private $availableLanguages, private $customizablesEntities ) { diff --git a/src/Bundle/ChillCustomFieldsBundle/Controller/CustomFieldsGroupController.php b/src/Bundle/ChillCustomFieldsBundle/Controller/CustomFieldsGroupController.php index 2ae552b01..75935afe7 100644 --- a/src/Bundle/ChillCustomFieldsBundle/Controller/CustomFieldsGroupController.php +++ b/src/Bundle/ChillCustomFieldsBundle/Controller/CustomFieldsGroupController.php @@ -36,7 +36,7 @@ class CustomFieldsGroupController extends AbstractController /** * CustomFieldsGroupController constructor. */ - public function __construct(private CustomFieldProvider $customFieldProvider, private TranslatorInterface $translator) + public function __construct(private readonly CustomFieldProvider $customFieldProvider, private readonly TranslatorInterface $translator) { } diff --git a/src/Bundle/ChillCustomFieldsBundle/CustomFields/CustomFieldChoice.php b/src/Bundle/ChillCustomFieldsBundle/CustomFields/CustomFieldChoice.php index 8add4b995..f5a7b0f03 100644 --- a/src/Bundle/ChillCustomFieldsBundle/CustomFields/CustomFieldChoice.php +++ b/src/Bundle/ChillCustomFieldsBundle/CustomFields/CustomFieldChoice.php @@ -32,15 +32,15 @@ use function LogicException; class CustomFieldChoice extends AbstractCustomField { - public const ALLOW_OTHER = 'other'; + final public const ALLOW_OTHER = 'other'; - public const CHOICES = 'choices'; + final public const CHOICES = 'choices'; - public const EXPANDED = 'expanded'; + final public const EXPANDED = 'expanded'; - public const MULTIPLE = 'multiple'; + final public const MULTIPLE = 'multiple'; - public const OTHER_VALUE_LABEL = 'otherValueLabel'; + final public const OTHER_VALUE_LABEL = 'otherValueLabel'; private $defaultLocales; @@ -49,11 +49,11 @@ class CustomFieldChoice extends AbstractCustomField */ public function __construct( TranslatorInterface $translator, - private TwigEngine $templating, + private readonly TwigEngine $templating, /** * @var TranslatableStringHelper Helper that find the string in current locale from an array of translation */ - private TranslatableStringHelper $translatableStringHelper + private readonly TranslatableStringHelper $translatableStringHelper ) { $this->defaultLocales = $translator->getFallbackLocales(); } diff --git a/src/Bundle/ChillCustomFieldsBundle/CustomFields/CustomFieldDate.php b/src/Bundle/ChillCustomFieldsBundle/CustomFields/CustomFieldDate.php index b8688efb1..ccdbcb199 100644 --- a/src/Bundle/ChillCustomFieldsBundle/CustomFields/CustomFieldDate.php +++ b/src/Bundle/ChillCustomFieldsBundle/CustomFields/CustomFieldDate.php @@ -33,18 +33,18 @@ use Symfony\Component\Validator\Context\ExecutionContextInterface; */ class CustomFieldDate extends AbstractCustomField { - public const DATE_FORMAT = DateTime::RFC3339; + final public const DATE_FORMAT = DateTime::RFC3339; - public const FORMAT = 'format'; + final public const FORMAT = 'format'; - public const MAX = 'max'; + final public const MAX = 'max'; /** * key for the minimal value of the field. */ - public const MIN = 'min'; + final public const MIN = 'min'; - public function __construct(private TwigEngine $templating, private TranslatableStringHelper $translatableStringHelper) + public function __construct(private readonly TwigEngine $templating, private readonly TranslatableStringHelper $translatableStringHelper) { } diff --git a/src/Bundle/ChillCustomFieldsBundle/CustomFields/CustomFieldLongChoice.php b/src/Bundle/ChillCustomFieldsBundle/CustomFields/CustomFieldLongChoice.php index aa73af462..5f7351372 100644 --- a/src/Bundle/ChillCustomFieldsBundle/CustomFields/CustomFieldLongChoice.php +++ b/src/Bundle/ChillCustomFieldsBundle/CustomFields/CustomFieldLongChoice.php @@ -30,12 +30,12 @@ use function is_object; class CustomFieldLongChoice extends AbstractCustomField { - public const KEY = 'key'; + final public const KEY = 'key'; public function __construct( - private OptionRepository $optionRepository, - private TranslatableStringHelper $translatableStringHelper, - private EngineInterface $templating, + private readonly OptionRepository $optionRepository, + private readonly TranslatableStringHelper $translatableStringHelper, + private readonly EngineInterface $templating, ) { } diff --git a/src/Bundle/ChillCustomFieldsBundle/CustomFields/CustomFieldNumber.php b/src/Bundle/ChillCustomFieldsBundle/CustomFields/CustomFieldNumber.php index 7c0e17931..69b856db1 100644 --- a/src/Bundle/ChillCustomFieldsBundle/CustomFields/CustomFieldNumber.php +++ b/src/Bundle/ChillCustomFieldsBundle/CustomFields/CustomFieldNumber.php @@ -28,18 +28,18 @@ use Symfony\Component\Validator\Constraints\LessThanOrEqual; */ class CustomFieldNumber extends AbstractCustomField { - public const MAX = 'max'; + final public const MAX = 'max'; /** * key for the minimal value of the field. */ - public const MIN = 'min'; + final public const MIN = 'min'; - public const POST_TEXT = 'post_text'; + final public const POST_TEXT = 'post_text'; - public const SCALE = 'scale'; + final public const SCALE = 'scale'; - public function __construct(private TwigEngine $templating, private TranslatableStringHelper $translatableStringHelper) + public function __construct(private readonly TwigEngine $templating, private readonly TranslatableStringHelper $translatableStringHelper) { } diff --git a/src/Bundle/ChillCustomFieldsBundle/CustomFields/CustomFieldText.php b/src/Bundle/ChillCustomFieldsBundle/CustomFields/CustomFieldText.php index 389303906..3be0886f6 100644 --- a/src/Bundle/ChillCustomFieldsBundle/CustomFields/CustomFieldText.php +++ b/src/Bundle/ChillCustomFieldsBundle/CustomFields/CustomFieldText.php @@ -25,17 +25,17 @@ use function array_key_exists; class CustomFieldText extends AbstractCustomField { - public const MAX_LENGTH = 'maxLength'; + final public const MAX_LENGTH = 'maxLength'; - public const MULTIPLE_CF_INLINE = 'multipleCFInline'; + final public const MULTIPLE_CF_INLINE = 'multipleCFInline'; public function __construct( - private RequestStack $requestStack, - private TwigEngine $templating, + private readonly RequestStack $requestStack, + private readonly TwigEngine $templating, /** * @var TranslatableStringHelper Helper that find the string in current locale from an array of translation */ - private TranslatableStringHelper $translatableStringHelper + private readonly TranslatableStringHelper $translatableStringHelper ) { } diff --git a/src/Bundle/ChillCustomFieldsBundle/CustomFields/CustomFieldTitle.php b/src/Bundle/ChillCustomFieldsBundle/CustomFields/CustomFieldTitle.php index 59114a4a5..4fbfe51d9 100644 --- a/src/Bundle/ChillCustomFieldsBundle/CustomFields/CustomFieldTitle.php +++ b/src/Bundle/ChillCustomFieldsBundle/CustomFields/CustomFieldTitle.php @@ -21,19 +21,19 @@ use Symfony\Component\HttpFoundation\RequestStack; class CustomFieldTitle extends AbstractCustomField { - public const TYPE = 'type'; + final public const TYPE = 'type'; - public const TYPE_SUBTITLE = 'subtitle'; + final public const TYPE_SUBTITLE = 'subtitle'; - public const TYPE_TITLE = 'title'; + final public const TYPE_TITLE = 'title'; public function __construct( - private RequestStack $requestStack, - private TwigEngine $templating, + private readonly RequestStack $requestStack, + private readonly TwigEngine $templating, /** * @var TranslatableStringHelper Helper that find the string in current locale from an array of translation */ - private TranslatableStringHelper $translatableStringHelper + private readonly TranslatableStringHelper $translatableStringHelper ) { } diff --git a/src/Bundle/ChillCustomFieldsBundle/Entity/CustomField.php b/src/Bundle/ChillCustomFieldsBundle/Entity/CustomField.php index d9f43ed3b..06aeb9f4f 100644 --- a/src/Bundle/ChillCustomFieldsBundle/Entity/CustomField.php +++ b/src/Bundle/ChillCustomFieldsBundle/Entity/CustomField.php @@ -22,9 +22,9 @@ use Doctrine\ORM\Mapping as ORM; */ class CustomField { - public const ONE_TO_MANY = 2; + final public const ONE_TO_MANY = 2; - public const ONE_TO_ONE = 1; + final public const ONE_TO_ONE = 1; /** * @var bool diff --git a/src/Bundle/ChillCustomFieldsBundle/Form/CustomFieldType.php b/src/Bundle/ChillCustomFieldsBundle/Form/CustomFieldType.php index df4e82d5b..29a70bbca 100644 --- a/src/Bundle/ChillCustomFieldsBundle/Form/CustomFieldType.php +++ b/src/Bundle/ChillCustomFieldsBundle/Form/CustomFieldType.php @@ -30,7 +30,7 @@ use Symfony\Component\OptionsResolver\OptionsResolver; class CustomFieldType extends AbstractType { - public function __construct(private CustomFieldProvider $customFieldProvider, private ObjectManager $om, private TranslatableStringHelper $translatableStringHelper) + public function __construct(private readonly CustomFieldProvider $customFieldProvider, private readonly ObjectManager $om, private readonly TranslatableStringHelper $translatableStringHelper) { } diff --git a/src/Bundle/ChillCustomFieldsBundle/Form/CustomFieldsGroupType.php b/src/Bundle/ChillCustomFieldsBundle/Form/CustomFieldsGroupType.php index e62e85c04..bf0e680c6 100644 --- a/src/Bundle/ChillCustomFieldsBundle/Form/CustomFieldsGroupType.php +++ b/src/Bundle/ChillCustomFieldsBundle/Form/CustomFieldsGroupType.php @@ -26,9 +26,9 @@ use function count; class CustomFieldsGroupType extends AbstractType { public function __construct( - private array $customizableEntities, + private readonly array $customizableEntities, //TODO : add comment about this variable - private TranslatorInterface $translator + private readonly TranslatorInterface $translator ) { } diff --git a/src/Bundle/ChillCustomFieldsBundle/Form/DataTransformer/CustomFieldDataTransformer.php b/src/Bundle/ChillCustomFieldsBundle/Form/DataTransformer/CustomFieldDataTransformer.php index f1df42ff7..3091ea66f 100644 --- a/src/Bundle/ChillCustomFieldsBundle/Form/DataTransformer/CustomFieldDataTransformer.php +++ b/src/Bundle/ChillCustomFieldsBundle/Form/DataTransformer/CustomFieldDataTransformer.php @@ -17,7 +17,7 @@ use Symfony\Component\Form\DataTransformerInterface; class CustomFieldDataTransformer implements DataTransformerInterface { - public function __construct(private CustomFieldInterface $customFieldDefinition, private CustomField $customField) + public function __construct(private readonly CustomFieldInterface $customFieldDefinition, private readonly CustomField $customField) { } diff --git a/src/Bundle/ChillCustomFieldsBundle/Form/DataTransformer/CustomFieldsGroupToIdTransformer.php b/src/Bundle/ChillCustomFieldsBundle/Form/DataTransformer/CustomFieldsGroupToIdTransformer.php index 5cba21068..2364a8087 100644 --- a/src/Bundle/ChillCustomFieldsBundle/Form/DataTransformer/CustomFieldsGroupToIdTransformer.php +++ b/src/Bundle/ChillCustomFieldsBundle/Form/DataTransformer/CustomFieldsGroupToIdTransformer.php @@ -20,7 +20,7 @@ use function gettype; class CustomFieldsGroupToIdTransformer implements DataTransformerInterface { - public function __construct(private ObjectManager $om) + public function __construct(private readonly ObjectManager $om) { } diff --git a/src/Bundle/ChillCustomFieldsBundle/Form/DataTransformer/JsonCustomFieldToArrayTransformer.php b/src/Bundle/ChillCustomFieldsBundle/Form/DataTransformer/JsonCustomFieldToArrayTransformer.php index 1ac3ace19..2827c0a73 100644 --- a/src/Bundle/ChillCustomFieldsBundle/Form/DataTransformer/JsonCustomFieldToArrayTransformer.php +++ b/src/Bundle/ChillCustomFieldsBundle/Form/DataTransformer/JsonCustomFieldToArrayTransformer.php @@ -24,9 +24,9 @@ use const JSON_THROW_ON_ERROR; */ class JsonCustomFieldToArrayTransformer implements DataTransformerInterface { - private array $customField; + private readonly array $customField; - public function __construct(private ObjectManager $om) + public function __construct(private readonly ObjectManager $om) { $customFields = $this->om ->getRepository(CustomField::class) @@ -68,13 +68,13 @@ class JsonCustomFieldToArrayTransformer implements DataTransformerInterface if (array_key_exists($key, $this->customField)) { $type = $this->customField[$key]->getType(); - if (str_starts_with($type, 'ManyToOne')) { + if (str_starts_with((string) $type, 'ManyToOne')) { // pour le manytoone() faire // un update du form en js ? : http://symfony.com/fr/doc/current/cookbook/form/form_collections.html // //$entityClass = substr($type, 10, -1); //echo $entityClasss; - if (str_starts_with($type, 'ManyToOnePersist')) { + if (str_starts_with((string) $type, 'ManyToOnePersist')) { // PEUT ETRE A FAIRE SI SEULEMENT $value->getId() ne renvoie rien... // // @@ -112,7 +112,7 @@ class JsonCustomFieldToArrayTransformer implements DataTransformerInterface if (null === $customFieldsJSON) { $customFieldsArray = []; } else { - $customFieldsArray = json_decode($customFieldsJSON, true, 512, JSON_THROW_ON_ERROR); + $customFieldsArray = json_decode((string) $customFieldsJSON, true, 512, JSON_THROW_ON_ERROR); } $customFieldsArrayRet = []; @@ -123,11 +123,11 @@ class JsonCustomFieldToArrayTransformer implements DataTransformerInterface if (array_key_exists($key, $this->customField)) { $type = $this->customField[$key]->getType(); - if (str_starts_with($type, 'ManyToOne')) { - if (str_starts_with($type, 'ManyToOnePersist')) { - $entityClass = substr($type, 17, -1); + if (str_starts_with((string) $type, 'ManyToOne')) { + if (str_starts_with((string) $type, 'ManyToOnePersist')) { + $entityClass = substr((string) $type, 17, -1); } else { - $entityClass = substr($type, 10, -1); + $entityClass = substr((string) $type, 10, -1); } $customFieldsArrayRet[$key] = $this->om diff --git a/src/Bundle/ChillCustomFieldsBundle/Form/Type/CustomFieldType.php b/src/Bundle/ChillCustomFieldsBundle/Form/Type/CustomFieldType.php index 93e969e1f..e9da23858 100644 --- a/src/Bundle/ChillCustomFieldsBundle/Form/Type/CustomFieldType.php +++ b/src/Bundle/ChillCustomFieldsBundle/Form/Type/CustomFieldType.php @@ -24,7 +24,7 @@ class CustomFieldType extends AbstractType */ private $customFieldCompiler; - public function __construct(private ObjectManager $om, CustomFieldProvider $compiler) + public function __construct(private readonly ObjectManager $om, CustomFieldProvider $compiler) { $this->customFieldCompiler = $compiler; } diff --git a/src/Bundle/ChillCustomFieldsBundle/Form/Type/LinkedCustomFieldsType.php b/src/Bundle/ChillCustomFieldsBundle/Form/Type/LinkedCustomFieldsType.php index 5f87bbab0..bd75e58b4 100644 --- a/src/Bundle/ChillCustomFieldsBundle/Form/Type/LinkedCustomFieldsType.php +++ b/src/Bundle/ChillCustomFieldsBundle/Form/Type/LinkedCustomFieldsType.php @@ -46,7 +46,7 @@ class LinkedCustomFieldsType extends AbstractType */ private $options = []; - public function __construct(private TranslatableStringHelper $translatableStringHelper) + public function __construct(private readonly TranslatableStringHelper $translatableStringHelper) { } @@ -93,7 +93,7 @@ class LinkedCustomFieldsType extends AbstractType $builder->addEventListener( FormEvents::POST_SET_DATA, - [$this, 'appendChoice'] + $this->appendChoice(...) ); } diff --git a/src/Bundle/ChillCustomFieldsBundle/Service/CustomFieldsHelper.php b/src/Bundle/ChillCustomFieldsBundle/Service/CustomFieldsHelper.php index be26cd6f3..c0bee2301 100644 --- a/src/Bundle/ChillCustomFieldsBundle/Service/CustomFieldsHelper.php +++ b/src/Bundle/ChillCustomFieldsBundle/Service/CustomFieldsHelper.php @@ -29,7 +29,7 @@ class CustomFieldsHelper * @param CustomFieldProvider $provider The customfield provider that * contains all the declared custom fields */ - public function __construct(private EntityManagerInterface $em, private CustomFieldProvider $provider) + public function __construct(private readonly EntityManagerInterface $em, private readonly CustomFieldProvider $provider) { } diff --git a/src/Bundle/ChillCustomFieldsBundle/Templating/Twig/CustomFieldRenderingTwig.php b/src/Bundle/ChillCustomFieldsBundle/Templating/Twig/CustomFieldRenderingTwig.php index 021999b1d..a7949de25 100644 --- a/src/Bundle/ChillCustomFieldsBundle/Templating/Twig/CustomFieldRenderingTwig.php +++ b/src/Bundle/ChillCustomFieldsBundle/Templating/Twig/CustomFieldRenderingTwig.php @@ -38,7 +38,7 @@ class CustomFieldRenderingTwig extends AbstractExtension implements ContainerAwa 'label_layout' => 'ChillCustomFieldsBundle:CustomField:render_label.html.twig', ]; - public function __construct(private CustomFieldsHelper $customFieldsHelper) + public function __construct(private readonly CustomFieldsHelper $customFieldsHelper) { } @@ -50,26 +50,17 @@ class CustomFieldRenderingTwig extends AbstractExtension implements ContainerAwa public function getFunctions() { return [ - new TwigFunction('chill_custom_field_widget', [ - $this, - 'renderWidget', - ], [ + new TwigFunction('chill_custom_field_widget', $this->renderWidget(...), [ 'is_safe' => [ 'html', ], ]), - new TwigFunction('chill_custom_field_label', [ - $this, - 'renderLabel', - ], [ + new TwigFunction('chill_custom_field_label', $this->renderLabel(...), [ 'is_safe' => [ 'html', ], ]), - new TwigFunction('chill_custom_field_is_empty', [ - $this, - 'isEmptyValue', - ]), + new TwigFunction('chill_custom_field_is_empty', $this->isEmptyValue(...)), ]; } diff --git a/src/Bundle/ChillCustomFieldsBundle/Templating/Twig/CustomFieldsGroupRenderingTwig.php b/src/Bundle/ChillCustomFieldsBundle/Templating/Twig/CustomFieldsGroupRenderingTwig.php index 1291f0849..cf6a55604 100644 --- a/src/Bundle/ChillCustomFieldsBundle/Templating/Twig/CustomFieldsGroupRenderingTwig.php +++ b/src/Bundle/ChillCustomFieldsBundle/Templating/Twig/CustomFieldsGroupRenderingTwig.php @@ -53,10 +53,7 @@ class CustomFieldsGroupRenderingTwig extends AbstractExtension implements Contai public function getFunctions() { return [ - new TwigFunction('chill_custom_fields_group_widget', [ - $this, - 'renderWidget', - ], [ + new TwigFunction('chill_custom_fields_group_widget', $this->renderWidget(...), [ 'is_safe' => [ 'html', ], diff --git a/src/Bundle/ChillDocGeneratorBundle/Context/ContextManager.php b/src/Bundle/ChillDocGeneratorBundle/Context/ContextManager.php index 2e2c9a9fd..95419e001 100644 --- a/src/Bundle/ChillDocGeneratorBundle/Context/ContextManager.php +++ b/src/Bundle/ChillDocGeneratorBundle/Context/ContextManager.php @@ -14,7 +14,7 @@ namespace Chill\DocGeneratorBundle\Context; use Chill\DocGeneratorBundle\Context\Exception\ContextNotFoundException; use Chill\DocGeneratorBundle\Entity\DocGeneratorTemplate; -final class ContextManager implements ContextManagerInterface +final readonly class ContextManager implements ContextManagerInterface { /** * @param \Chill\DocGeneratorBundle\Context\DocGeneratorContextInterface[] $contexts diff --git a/src/Bundle/ChillDocGeneratorBundle/Controller/AdminDocGeneratorTemplateController.php b/src/Bundle/ChillDocGeneratorBundle/Controller/AdminDocGeneratorTemplateController.php index 58c2b4e57..ebce55957 100644 --- a/src/Bundle/ChillDocGeneratorBundle/Controller/AdminDocGeneratorTemplateController.php +++ b/src/Bundle/ChillDocGeneratorBundle/Controller/AdminDocGeneratorTemplateController.php @@ -22,7 +22,7 @@ use Symfony\Component\Routing\Annotation\Route; class AdminDocGeneratorTemplateController extends CRUDController { - public function __construct(private ContextManager $contextManager) + public function __construct(private readonly ContextManager $contextManager) { } diff --git a/src/Bundle/ChillDocGeneratorBundle/Controller/DocGeneratorTemplateController.php b/src/Bundle/ChillDocGeneratorBundle/Controller/DocGeneratorTemplateController.php index 7ad660260..a007ff8ff 100644 --- a/src/Bundle/ChillDocGeneratorBundle/Controller/DocGeneratorTemplateController.php +++ b/src/Bundle/ChillDocGeneratorBundle/Controller/DocGeneratorTemplateController.php @@ -43,7 +43,7 @@ use const JSON_PRETTY_PRINT; final class DocGeneratorTemplateController extends AbstractController { - public function __construct(private ContextManager $contextManager, private DocGeneratorTemplateRepository $docGeneratorTemplateRepository, private GeneratorInterface $generator, private MessageBusInterface $messageBus, private PaginatorFactory $paginatorFactory, private EntityManagerInterface $entityManager) + public function __construct(private readonly ContextManager $contextManager, private readonly DocGeneratorTemplateRepository $docGeneratorTemplateRepository, private readonly GeneratorInterface $generator, private readonly MessageBusInterface $messageBus, private readonly PaginatorFactory $paginatorFactory, private readonly EntityManagerInterface $entityManager) { } diff --git a/src/Bundle/ChillDocGeneratorBundle/Form/DocGeneratorTemplateType.php b/src/Bundle/ChillDocGeneratorBundle/Form/DocGeneratorTemplateType.php index a92dc67f2..8f698cb97 100644 --- a/src/Bundle/ChillDocGeneratorBundle/Form/DocGeneratorTemplateType.php +++ b/src/Bundle/ChillDocGeneratorBundle/Form/DocGeneratorTemplateType.php @@ -24,7 +24,7 @@ use Symfony\Component\OptionsResolver\OptionsResolver; class DocGeneratorTemplateType extends AbstractType { - public function __construct(private ContextManager $contextManager) + public function __construct(private readonly ContextManager $contextManager) { } diff --git a/src/Bundle/ChillDocGeneratorBundle/GeneratorDriver/Exception/TemplateException.php b/src/Bundle/ChillDocGeneratorBundle/GeneratorDriver/Exception/TemplateException.php index 90de02914..5e7227a00 100644 --- a/src/Bundle/ChillDocGeneratorBundle/GeneratorDriver/Exception/TemplateException.php +++ b/src/Bundle/ChillDocGeneratorBundle/GeneratorDriver/Exception/TemplateException.php @@ -20,7 +20,7 @@ use Throwable; */ class TemplateException extends RuntimeException { - public function __construct(private 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 2166032e1..7dd1dccf0 100644 --- a/src/Bundle/ChillDocGeneratorBundle/GeneratorDriver/RelatorioDriver.php +++ b/src/Bundle/ChillDocGeneratorBundle/GeneratorDriver/RelatorioDriver.php @@ -24,12 +24,12 @@ use Throwable; final class RelatorioDriver implements DriverInterface { - private string $url; + private readonly string $url; public function __construct( - private HttpClientInterface $client, + private readonly HttpClientInterface $client, ParameterBagInterface $parameterBag, - private LoggerInterface $logger + private readonly LoggerInterface $logger ) { $this->url = $parameterBag->get('chill_doc_generator')['driver']['relatorio']['url']; } diff --git a/src/Bundle/ChillDocGeneratorBundle/Menu/AdminMenuBuilder.php b/src/Bundle/ChillDocGeneratorBundle/Menu/AdminMenuBuilder.php index 6f048ae66..a021e1495 100644 --- a/src/Bundle/ChillDocGeneratorBundle/Menu/AdminMenuBuilder.php +++ b/src/Bundle/ChillDocGeneratorBundle/Menu/AdminMenuBuilder.php @@ -18,7 +18,7 @@ use Symfony\Contracts\Translation\TranslatorInterface; class AdminMenuBuilder implements LocalMenuBuilderInterface { - public function __construct(private TranslatorInterface $translator, private Security $security) + public function __construct(private readonly TranslatorInterface $translator, private readonly Security $security) { } diff --git a/src/Bundle/ChillDocGeneratorBundle/Repository/DocGeneratorTemplateRepository.php b/src/Bundle/ChillDocGeneratorBundle/Repository/DocGeneratorTemplateRepository.php index 850f9a862..0f2771b4e 100644 --- a/src/Bundle/ChillDocGeneratorBundle/Repository/DocGeneratorTemplateRepository.php +++ b/src/Bundle/ChillDocGeneratorBundle/Repository/DocGeneratorTemplateRepository.php @@ -19,9 +19,9 @@ use Symfony\Component\HttpFoundation\RequestStack; final class DocGeneratorTemplateRepository implements ObjectRepository { - private EntityRepository $repository; + private readonly EntityRepository $repository; - public function __construct(EntityManagerInterface $entityManager, private RequestStack $requestStack) + public function __construct(EntityManagerInterface $entityManager, private readonly RequestStack $requestStack) { $this->repository = $entityManager->getRepository(DocGeneratorTemplate::class); } diff --git a/src/Bundle/ChillDocGeneratorBundle/Serializer/Helper/NormalizeNullValueHelper.php b/src/Bundle/ChillDocGeneratorBundle/Serializer/Helper/NormalizeNullValueHelper.php index f35736635..0b898d59c 100644 --- a/src/Bundle/ChillDocGeneratorBundle/Serializer/Helper/NormalizeNullValueHelper.php +++ b/src/Bundle/ChillDocGeneratorBundle/Serializer/Helper/NormalizeNullValueHelper.php @@ -19,7 +19,7 @@ use function is_array; class NormalizeNullValueHelper { - public function __construct(private NormalizerInterface $normalizer, private ?string $discriminatorType = null, private ?string $discriminatorValue = null) + public function __construct(private readonly NormalizerInterface $normalizer, private ?string $discriminatorType = null, private readonly ?string $discriminatorValue = null) { } diff --git a/src/Bundle/ChillDocGeneratorBundle/Serializer/Normalizer/DocGenObjectNormalizer.php b/src/Bundle/ChillDocGeneratorBundle/Serializer/Normalizer/DocGenObjectNormalizer.php index bda1fda5c..ef02e0073 100644 --- a/src/Bundle/ChillDocGeneratorBundle/Serializer/Normalizer/DocGenObjectNormalizer.php +++ b/src/Bundle/ChillDocGeneratorBundle/Serializer/Normalizer/DocGenObjectNormalizer.php @@ -40,11 +40,11 @@ class DocGenObjectNormalizer implements NormalizerAwareInterface, NormalizerInte { use NormalizerAwareTrait; - private PropertyAccessor $propertyAccess; + private readonly PropertyAccessor $propertyAccess; public function __construct( - private ClassMetadataFactoryInterface $classMetadataFactory, - private TranslatableStringHelperInterface $translatableStringHelper + private readonly ClassMetadataFactoryInterface $classMetadataFactory, + private readonly TranslatableStringHelperInterface $translatableStringHelper ) { $this->propertyAccess = PropertyAccess::createPropertyAccessor(); } diff --git a/src/Bundle/ChillDocGeneratorBundle/Service/Context/BaseContextData.php b/src/Bundle/ChillDocGeneratorBundle/Service/Context/BaseContextData.php index ad546a97f..afe53c6f9 100644 --- a/src/Bundle/ChillDocGeneratorBundle/Service/Context/BaseContextData.php +++ b/src/Bundle/ChillDocGeneratorBundle/Service/Context/BaseContextData.php @@ -19,7 +19,7 @@ use Symfony\Component\Serializer\Normalizer\NormalizerInterface; class BaseContextData { - public function __construct(private NormalizerInterface $normalizer) + public function __construct(private readonly NormalizerInterface $normalizer) { } diff --git a/src/Bundle/ChillDocGeneratorBundle/Service/Generator/Generator.php b/src/Bundle/ChillDocGeneratorBundle/Service/Generator/Generator.php index 66136639f..2d5108b74 100644 --- a/src/Bundle/ChillDocGeneratorBundle/Service/Generator/Generator.php +++ b/src/Bundle/ChillDocGeneratorBundle/Service/Generator/Generator.php @@ -27,7 +27,7 @@ class Generator implements GeneratorInterface { private const LOG_PREFIX = '[docgen generator] '; - public function __construct(private ContextManagerInterface $contextManager, private DriverInterface $driver, private EntityManagerInterface $entityManager, private LoggerInterface $logger, private StoredObjectManagerInterface $storedObjectManager) + public function __construct(private readonly ContextManagerInterface $contextManager, private readonly DriverInterface $driver, private readonly EntityManagerInterface $entityManager, private readonly LoggerInterface $logger, private readonly StoredObjectManagerInterface $storedObjectManager) { } diff --git a/src/Bundle/ChillDocGeneratorBundle/Service/Generator/GeneratorException.php b/src/Bundle/ChillDocGeneratorBundle/Service/Generator/GeneratorException.php index 9024db235..abed586af 100644 --- a/src/Bundle/ChillDocGeneratorBundle/Service/Generator/GeneratorException.php +++ b/src/Bundle/ChillDocGeneratorBundle/Service/Generator/GeneratorException.php @@ -19,7 +19,7 @@ class GeneratorException extends RuntimeException /** * @param string[] $errors */ - public function __construct(private 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/Messenger/OnGenerationFails.php b/src/Bundle/ChillDocGeneratorBundle/Service/Messenger/OnGenerationFails.php index 7ea3a1dc7..06d396af2 100644 --- a/src/Bundle/ChillDocGeneratorBundle/Service/Messenger/OnGenerationFails.php +++ b/src/Bundle/ChillDocGeneratorBundle/Service/Messenger/OnGenerationFails.php @@ -24,7 +24,7 @@ use Symfony\Component\Mailer\MailerInterface; use Symfony\Component\Messenger\Event\WorkerMessageFailedEvent; use Symfony\Contracts\Translation\TranslatorInterface; -final class OnGenerationFails implements EventSubscriberInterface +final readonly class OnGenerationFails implements EventSubscriberInterface { public const LOG_PREFIX = '[docgen failed] '; diff --git a/src/Bundle/ChillDocGeneratorBundle/Service/Messenger/RequestGenerationHandler.php b/src/Bundle/ChillDocGeneratorBundle/Service/Messenger/RequestGenerationHandler.php index 99f0854cd..e0f95834b 100644 --- a/src/Bundle/ChillDocGeneratorBundle/Service/Messenger/RequestGenerationHandler.php +++ b/src/Bundle/ChillDocGeneratorBundle/Service/Messenger/RequestGenerationHandler.php @@ -26,11 +26,11 @@ use Symfony\Component\Messenger\Handler\MessageHandlerInterface; */ class RequestGenerationHandler implements MessageHandlerInterface { - public const AUTHORIZED_TRIALS = 5; + final public const AUTHORIZED_TRIALS = 5; private const LOG_PREFIX = '[docgen message handler] '; - public function __construct(private DocGeneratorTemplateRepository $docGeneratorTemplateRepository, private EntityManagerInterface $entityManager, private Generator $generator, private LoggerInterface $logger, private StoredObjectRepository $storedObjectRepository, private UserRepositoryInterface $userRepository) + public function __construct(private readonly DocGeneratorTemplateRepository $docGeneratorTemplateRepository, private readonly EntityManagerInterface $entityManager, private readonly Generator $generator, private readonly LoggerInterface $logger, private readonly StoredObjectRepository $storedObjectRepository, private readonly UserRepositoryInterface $userRepository) { } diff --git a/src/Bundle/ChillDocGeneratorBundle/Service/Messenger/RequestGenerationMessage.php b/src/Bundle/ChillDocGeneratorBundle/Service/Messenger/RequestGenerationMessage.php index 0bc0ec850..092073817 100644 --- a/src/Bundle/ChillDocGeneratorBundle/Service/Messenger/RequestGenerationMessage.php +++ b/src/Bundle/ChillDocGeneratorBundle/Service/Messenger/RequestGenerationMessage.php @@ -17,20 +17,20 @@ use Chill\MainBundle\Entity\User; class RequestGenerationMessage { - private int $creatorId; + private readonly int $creatorId; - private int $templateId; + private readonly int $templateId; - private int $destinationStoredObjectId; + private readonly int $destinationStoredObjectId; - private \DateTimeImmutable $createdAt; + private readonly \DateTimeImmutable $createdAt; public function __construct( User $creator, DocGeneratorTemplate $template, - private int $entityId, + private readonly int $entityId, StoredObject $destinationStoredObject, - private array $contextGenerationData + private readonly array $contextGenerationData ) { $this->creatorId = $creator->getId(); $this->templateId = $template->getId(); diff --git a/src/Bundle/ChillDocGeneratorBundle/tests/Serializer/Normalizer/DocGenObjectNormalizerTest.php b/src/Bundle/ChillDocGeneratorBundle/tests/Serializer/Normalizer/DocGenObjectNormalizerTest.php index 3250d4d5a..4ea289a8c 100644 --- a/src/Bundle/ChillDocGeneratorBundle/tests/Serializer/Normalizer/DocGenObjectNormalizerTest.php +++ b/src/Bundle/ChillDocGeneratorBundle/tests/Serializer/Normalizer/DocGenObjectNormalizerTest.php @@ -135,7 +135,7 @@ final class DocGenObjectNormalizerTest extends KernelTestCase $this->assertEquals($expected, $actual, 'test normalization for a null scope'); } - public function testNormalizeNullObjectWithObjectEmbedded() + public function testNormalizeNullObjectWithObjectEmbedded(): never { $this->markTestIncomplete('test to implement'); $normalized = $this->normalizer->normalize(null, 'docgen', [ @@ -154,7 +154,7 @@ final class DocGenObjectNormalizerTest extends KernelTestCase $this->assertEquals($expected, $normalized, 'test normalization for a null user'); } - public function testNormalizeWithNullValueEmbedded() + public function testNormalizeWithNullValueEmbedded(): never { $this->markTestIncomplete('test to write'); $user = new User(); diff --git a/src/Bundle/ChillDocStoreBundle/Controller/DocumentAccompanyingCourseController.php b/src/Bundle/ChillDocStoreBundle/Controller/DocumentAccompanyingCourseController.php index 2c70454b0..0a3a56fdf 100644 --- a/src/Bundle/ChillDocStoreBundle/Controller/DocumentAccompanyingCourseController.php +++ b/src/Bundle/ChillDocStoreBundle/Controller/DocumentAccompanyingCourseController.php @@ -36,7 +36,7 @@ class DocumentAccompanyingCourseController extends AbstractController /** * DocumentAccompanyingCourseController constructor. */ - public function __construct(protected TranslatorInterface $translator, protected EventDispatcherInterface $eventDispatcher, protected AuthorizationHelper $authorizationHelper, private PaginatorFactory $paginatorFactory, private AccompanyingCourseDocumentRepository $courseRepository) + public function __construct(protected TranslatorInterface $translator, protected EventDispatcherInterface $eventDispatcher, protected AuthorizationHelper $authorizationHelper, private readonly PaginatorFactory $paginatorFactory, private readonly AccompanyingCourseDocumentRepository $courseRepository) { } diff --git a/src/Bundle/ChillDocStoreBundle/Controller/DocumentPersonController.php b/src/Bundle/ChillDocStoreBundle/Controller/DocumentPersonController.php index 79fb401ea..469e5bf7e 100644 --- a/src/Bundle/ChillDocStoreBundle/Controller/DocumentPersonController.php +++ b/src/Bundle/ChillDocStoreBundle/Controller/DocumentPersonController.php @@ -42,7 +42,7 @@ class DocumentPersonController extends AbstractController /** * DocumentPersonController constructor. */ - public function __construct(protected TranslatorInterface $translator, protected EventDispatcherInterface $eventDispatcher, protected AuthorizationHelper $authorizationHelper, private PaginatorFactory $paginatorFactory, private PersonDocumentACLAwareRepositoryInterface $personDocumentACLAwareRepository) + public function __construct(protected TranslatorInterface $translator, protected EventDispatcherInterface $eventDispatcher, protected AuthorizationHelper $authorizationHelper, private readonly PaginatorFactory $paginatorFactory, private readonly PersonDocumentACLAwareRepositoryInterface $personDocumentACLAwareRepository) { } diff --git a/src/Bundle/ChillDocStoreBundle/Controller/StoredObjectApiController.php b/src/Bundle/ChillDocStoreBundle/Controller/StoredObjectApiController.php index b675d6246..6bfb05bfc 100644 --- a/src/Bundle/ChillDocStoreBundle/Controller/StoredObjectApiController.php +++ b/src/Bundle/ChillDocStoreBundle/Controller/StoredObjectApiController.php @@ -20,7 +20,7 @@ use Symfony\Component\Security\Core\Security; class StoredObjectApiController { - public function __construct(private Security $security) + public function __construct(private readonly Security $security) { } diff --git a/src/Bundle/ChillDocStoreBundle/Entity/StoredObject.php b/src/Bundle/ChillDocStoreBundle/Entity/StoredObject.php index fbfd4ef54..bf2808c19 100644 --- a/src/Bundle/ChillDocStoreBundle/Entity/StoredObject.php +++ b/src/Bundle/ChillDocStoreBundle/Entity/StoredObject.php @@ -36,9 +36,9 @@ use Symfony\Component\Serializer\Annotation as Serializer; class StoredObject implements AsyncFileInterface, Document, TrackCreationInterface { use TrackCreationTrait; - public const STATUS_READY = "ready"; - public const STATUS_PENDING = "pending"; - public const STATUS_FAILURE = "failure"; + final public const STATUS_READY = "ready"; + final public const STATUS_PENDING = "pending"; + final public const STATUS_FAILURE = "failure"; /** * @ORM\Column(type="json", name="datas") diff --git a/src/Bundle/ChillDocStoreBundle/Form/DocumentCategoryType.php b/src/Bundle/ChillDocStoreBundle/Form/DocumentCategoryType.php index 8ae67be51..f3506d631 100644 --- a/src/Bundle/ChillDocStoreBundle/Form/DocumentCategoryType.php +++ b/src/Bundle/ChillDocStoreBundle/Form/DocumentCategoryType.php @@ -26,7 +26,7 @@ class DocumentCategoryType extends AbstractType { // TODO faire un service dans CHillMain foreach ($kernelBundles as $key => $value) { - if (str_starts_with($key, 'Chill')) { + if (str_starts_with((string) $key, 'Chill')) { $this->chillBundlesFlipped[$value] = $key; } } diff --git a/src/Bundle/ChillDocStoreBundle/Form/PersonDocumentType.php b/src/Bundle/ChillDocStoreBundle/Form/PersonDocumentType.php index cfe5d5156..5c0b7d501 100644 --- a/src/Bundle/ChillDocStoreBundle/Form/PersonDocumentType.php +++ b/src/Bundle/ChillDocStoreBundle/Form/PersonDocumentType.php @@ -30,7 +30,7 @@ use Symfony\Component\OptionsResolver\OptionsResolver; class PersonDocumentType extends AbstractType { - public function __construct(private TranslatableStringHelperInterface $translatableStringHelper, private ScopeResolverDispatcher $scopeResolverDispatcher, private ParameterBagInterface $parameterBag, private CenterResolverDispatcher $centerResolverDispatcher) + public function __construct(private readonly TranslatableStringHelperInterface $translatableStringHelper, private readonly ScopeResolverDispatcher $scopeResolverDispatcher, private readonly ParameterBagInterface $parameterBag, private readonly CenterResolverDispatcher $centerResolverDispatcher) { } diff --git a/src/Bundle/ChillDocStoreBundle/Form/StoredObjectType.php b/src/Bundle/ChillDocStoreBundle/Form/StoredObjectType.php index 4f3cd315f..c153efae5 100644 --- a/src/Bundle/ChillDocStoreBundle/Form/StoredObjectType.php +++ b/src/Bundle/ChillDocStoreBundle/Form/StoredObjectType.php @@ -57,20 +57,20 @@ class StoredObjectType extends AbstractType $builder ->get('keyInfos') ->addModelTransformer(new CallbackTransformer( - [$this, 'transform'], - [$this, 'reverseTransform'] + $this->transform(...), + $this->reverseTransform(...) )); $builder ->get('iv') ->addModelTransformer(new CallbackTransformer( - [$this, 'transform'], - [$this, 'reverseTransform'] + $this->transform(...), + $this->reverseTransform(...) )); $builder ->addModelTransformer(new CallbackTransformer( - [$this, 'transformObject'], - [$this, 'reverseTransformObject'] + $this->transformObject(...), + $this->reverseTransformObject(...) )); } @@ -95,7 +95,7 @@ class StoredObjectType extends AbstractType return null; } - return json_decode($value, true, 512, JSON_THROW_ON_ERROR); + return json_decode((string) $value, true, 512, JSON_THROW_ON_ERROR); } public function reverseTransformObject($object) diff --git a/src/Bundle/ChillDocStoreBundle/Menu/MenuBuilder.php b/src/Bundle/ChillDocStoreBundle/Menu/MenuBuilder.php index 49f7723ce..1f9268bf1 100644 --- a/src/Bundle/ChillDocStoreBundle/Menu/MenuBuilder.php +++ b/src/Bundle/ChillDocStoreBundle/Menu/MenuBuilder.php @@ -19,7 +19,7 @@ use LogicException; use Symfony\Component\Security\Core\Security; use Symfony\Contracts\Translation\TranslatorInterface; -final class MenuBuilder implements LocalMenuBuilderInterface +final readonly class MenuBuilder implements LocalMenuBuilderInterface { public function __construct(private Security $security, private TranslatorInterface $translator) { diff --git a/src/Bundle/ChillDocStoreBundle/Repository/AccompanyingCourseDocumentRepository.php b/src/Bundle/ChillDocStoreBundle/Repository/AccompanyingCourseDocumentRepository.php index 3231bfd79..2679993c4 100644 --- a/src/Bundle/ChillDocStoreBundle/Repository/AccompanyingCourseDocumentRepository.php +++ b/src/Bundle/ChillDocStoreBundle/Repository/AccompanyingCourseDocumentRepository.php @@ -20,9 +20,9 @@ use Doctrine\Persistence\ObjectRepository; class AccompanyingCourseDocumentRepository implements ObjectRepository { - private EntityRepository $repository; + private readonly EntityRepository $repository; - public function __construct(private EntityManagerInterface $em) + public function __construct(private readonly EntityManagerInterface $em) { $this->repository = $em->getRepository(AccompanyingCourseDocument::class); } diff --git a/src/Bundle/ChillDocStoreBundle/Repository/DocumentCategoryRepository.php b/src/Bundle/ChillDocStoreBundle/Repository/DocumentCategoryRepository.php index 9025afd09..22aeb24d2 100644 --- a/src/Bundle/ChillDocStoreBundle/Repository/DocumentCategoryRepository.php +++ b/src/Bundle/ChillDocStoreBundle/Repository/DocumentCategoryRepository.php @@ -21,9 +21,9 @@ use Doctrine\Persistence\ObjectRepository; */ class DocumentCategoryRepository implements ObjectRepository { - private EntityRepository $repository; + private readonly EntityRepository $repository; - public function __construct(private EntityManagerInterface $em) + public function __construct(private readonly EntityManagerInterface $em) { $this->repository = $em->getRepository(DocumentCategory::class); } diff --git a/src/Bundle/ChillDocStoreBundle/Repository/PersonDocumentACLAwareRepository.php b/src/Bundle/ChillDocStoreBundle/Repository/PersonDocumentACLAwareRepository.php index da1809dbb..128a552a8 100644 --- a/src/Bundle/ChillDocStoreBundle/Repository/PersonDocumentACLAwareRepository.php +++ b/src/Bundle/ChillDocStoreBundle/Repository/PersonDocumentACLAwareRepository.php @@ -22,7 +22,7 @@ use Symfony\Component\Security\Core\Security; class PersonDocumentACLAwareRepository implements PersonDocumentACLAwareRepositoryInterface { - public function __construct(private EntityManagerInterface $em, private AuthorizationHelperInterface $authorizationHelper, private CenterResolverDispatcher $centerResolverDispatcher, private Security $security) + public function __construct(private readonly EntityManagerInterface $em, private readonly AuthorizationHelperInterface $authorizationHelper, private readonly CenterResolverDispatcher $centerResolverDispatcher, private readonly Security $security) { } diff --git a/src/Bundle/ChillDocStoreBundle/Repository/StoredObjectRepository.php b/src/Bundle/ChillDocStoreBundle/Repository/StoredObjectRepository.php index 82e658620..d2e715f7e 100644 --- a/src/Bundle/ChillDocStoreBundle/Repository/StoredObjectRepository.php +++ b/src/Bundle/ChillDocStoreBundle/Repository/StoredObjectRepository.php @@ -18,7 +18,7 @@ use Doctrine\Persistence\ObjectRepository; final class StoredObjectRepository implements ObjectRepository { - private EntityRepository $repository; + private readonly EntityRepository $repository; public function __construct(EntityManagerInterface $entityManager) { diff --git a/src/Bundle/ChillDocStoreBundle/Security/Authorization/AccompanyingCourseDocumentVoter.php b/src/Bundle/ChillDocStoreBundle/Security/Authorization/AccompanyingCourseDocumentVoter.php index 60bc7060c..f04a6dbf8 100644 --- a/src/Bundle/ChillDocStoreBundle/Security/Authorization/AccompanyingCourseDocumentVoter.php +++ b/src/Bundle/ChillDocStoreBundle/Security/Authorization/AccompanyingCourseDocumentVoter.php @@ -27,15 +27,15 @@ use function in_array; class AccompanyingCourseDocumentVoter extends AbstractChillVoter implements ProvideRoleHierarchyInterface { - public const CREATE = 'CHILL_ACCOMPANYING_COURSE_DOCUMENT_CREATE'; + final public const CREATE = 'CHILL_ACCOMPANYING_COURSE_DOCUMENT_CREATE'; - public const DELETE = 'CHILL_ACCOMPANYING_COURSE_DOCUMENT_DELETE'; + final public const DELETE = 'CHILL_ACCOMPANYING_COURSE_DOCUMENT_DELETE'; - public const SEE = 'CHILL_ACCOMPANYING_COURSE_DOCUMENT_SEE'; + final public const SEE = 'CHILL_ACCOMPANYING_COURSE_DOCUMENT_SEE'; - public const SEE_DETAILS = 'CHILL_ACCOMPANYING_COURSE_DOCUMENT_SEE_DETAILS'; + final public const SEE_DETAILS = 'CHILL_ACCOMPANYING_COURSE_DOCUMENT_SEE_DETAILS'; - public const UPDATE = 'CHILL_ACCOMPANYING_COURSE_DOCUMENT_UPDATE'; + final public const UPDATE = 'CHILL_ACCOMPANYING_COURSE_DOCUMENT_UPDATE'; protected VoterHelperInterface $voterHelper; diff --git a/src/Bundle/ChillDocStoreBundle/Security/Authorization/PersonDocumentVoter.php b/src/Bundle/ChillDocStoreBundle/Security/Authorization/PersonDocumentVoter.php index b4a5de4c5..c1c6b1211 100644 --- a/src/Bundle/ChillDocStoreBundle/Security/Authorization/PersonDocumentVoter.php +++ b/src/Bundle/ChillDocStoreBundle/Security/Authorization/PersonDocumentVoter.php @@ -25,15 +25,15 @@ use Symfony\Component\Security\Core\Security; class PersonDocumentVoter extends AbstractChillVoter implements ProvideRoleHierarchyInterface { - public const CREATE = 'CHILL_PERSON_DOCUMENT_CREATE'; + final public const CREATE = 'CHILL_PERSON_DOCUMENT_CREATE'; - public const DELETE = 'CHILL_PERSON_DOCUMENT_DELETE'; + final public const DELETE = 'CHILL_PERSON_DOCUMENT_DELETE'; - public const SEE = 'CHILL_PERSON_DOCUMENT_SEE'; + final public const SEE = 'CHILL_PERSON_DOCUMENT_SEE'; - public const SEE_DETAILS = 'CHILL_PERSON_DOCUMENT_SEE_DETAILS'; + final public const SEE_DETAILS = 'CHILL_PERSON_DOCUMENT_SEE_DETAILS'; - public const UPDATE = 'CHILL_PERSON_DOCUMENT_UPDATE'; + final public const UPDATE = 'CHILL_PERSON_DOCUMENT_UPDATE'; protected VoterHelperInterface $voterHelper; diff --git a/src/Bundle/ChillDocStoreBundle/Serializer/Normalizer/StoredObjectDenormalizer.php b/src/Bundle/ChillDocStoreBundle/Serializer/Normalizer/StoredObjectDenormalizer.php index d277c7ec9..822a70597 100644 --- a/src/Bundle/ChillDocStoreBundle/Serializer/Normalizer/StoredObjectDenormalizer.php +++ b/src/Bundle/ChillDocStoreBundle/Serializer/Normalizer/StoredObjectDenormalizer.php @@ -22,7 +22,7 @@ class StoredObjectDenormalizer implements DenormalizerInterface { use ObjectToPopulateTrait; - public function __construct(private StoredObjectRepository $storedObjectRepository) + public function __construct(private readonly StoredObjectRepository $storedObjectRepository) { } diff --git a/src/Bundle/ChillDocStoreBundle/Service/StoredObjectManager.php b/src/Bundle/ChillDocStoreBundle/Service/StoredObjectManager.php index 5e7a54410..56c1e0d9f 100644 --- a/src/Bundle/ChillDocStoreBundle/Service/StoredObjectManager.php +++ b/src/Bundle/ChillDocStoreBundle/Service/StoredObjectManager.php @@ -35,7 +35,7 @@ final class StoredObjectManager implements StoredObjectManagerInterface private array $inMemory = []; - public function __construct(private HttpClientInterface $client, private TempUrlGeneratorInterface $tempUrlGenerator) + public function __construct(private readonly HttpClientInterface $client, private readonly TempUrlGeneratorInterface $tempUrlGenerator) { } diff --git a/src/Bundle/ChillDocStoreBundle/Templating/WopiEditTwigExtensionRuntime.php b/src/Bundle/ChillDocStoreBundle/Templating/WopiEditTwigExtensionRuntime.php index 89655fc35..ad491674d 100644 --- a/src/Bundle/ChillDocStoreBundle/Templating/WopiEditTwigExtensionRuntime.php +++ b/src/Bundle/ChillDocStoreBundle/Templating/WopiEditTwigExtensionRuntime.php @@ -20,7 +20,7 @@ use Twig\Extension\RuntimeExtensionInterface; use function in_array; -final class WopiEditTwigExtensionRuntime implements RuntimeExtensionInterface +final readonly class WopiEditTwigExtensionRuntime implements RuntimeExtensionInterface { public const SUPPORTED_MIMES = [ 'image/svg+xml', @@ -151,7 +151,7 @@ final class WopiEditTwigExtensionRuntime implements RuntimeExtensionInterface 'document_json' => $this->normalizer->normalize($document, 'json', [AbstractNormalizer::GROUPS => ['read']]), 'title' => $title, 'can_edit' => $canEdit, - 'options' => array_merge(self::DEFAULT_OPTIONS_TEMPLATE_BUTTON_GROUP, $options), + 'options' => [...self::DEFAULT_OPTIONS_TEMPLATE_BUTTON_GROUP, ...$options], ]); } diff --git a/src/Bundle/ChillDocStoreBundle/Workflow/AccompanyingCourseDocumentWorkflowHandler.php b/src/Bundle/ChillDocStoreBundle/Workflow/AccompanyingCourseDocumentWorkflowHandler.php index 5a7ce406c..328585c62 100644 --- a/src/Bundle/ChillDocStoreBundle/Workflow/AccompanyingCourseDocumentWorkflowHandler.php +++ b/src/Bundle/ChillDocStoreBundle/Workflow/AccompanyingCourseDocumentWorkflowHandler.php @@ -22,14 +22,14 @@ use Symfony\Contracts\Translation\TranslatorInterface; class AccompanyingCourseDocumentWorkflowHandler implements EntityWorkflowHandlerInterface { - private EntityRepository $repository; + private readonly EntityRepository $repository; /** * TODO: injecter le repository directement. */ public function __construct( EntityManagerInterface $em, - private TranslatorInterface $translator + private readonly TranslatorInterface $translator ) { $this->repository = $em->getRepository(AccompanyingCourseDocument::class); } diff --git a/src/Bundle/ChillEventBundle/Controller/ParticipationController.php b/src/Bundle/ChillEventBundle/Controller/ParticipationController.php index 9cd807479..17550758b 100644 --- a/src/Bundle/ChillEventBundle/Controller/ParticipationController.php +++ b/src/Bundle/ChillEventBundle/Controller/ParticipationController.php @@ -36,7 +36,7 @@ class ParticipationController extends AbstractController /** * ParticipationController constructor. */ - public function __construct(private LoggerInterface $logger) + public function __construct(private readonly LoggerInterface $logger) { } @@ -582,7 +582,7 @@ class ParticipationController extends AbstractController $persons_ids = $request->query->has('person_id') ? [$request->query->getInt('person_id', 0)] // sf4 check: // prevent error: `Argument 2 passed to ::getInt() must be of the type int, null given` - : explode(',', $request->query->get('persons_ids')); + : explode(',', (string) $request->query->get('persons_ids')); $participations = []; foreach ($persons_ids as $person_id) { @@ -746,7 +746,7 @@ class ParticipationController extends AbstractController if (true === $multiple) { $persons_ids = $request->query->get('persons_ids'); - if (!preg_match('/^([0-9]{1,},{0,1}){1,}[0-9]{0,}$/', $persons_ids)) { + if (!preg_match('/^([0-9]{1,},{0,1}){1,}[0-9]{0,}$/', (string) $persons_ids)) { throw new RuntimeException('The persons_ids value should ' . "contains int separated by ','"); } diff --git a/src/Bundle/ChillEventBundle/Entity/Event.php b/src/Bundle/ChillEventBundle/Entity/Event.php index ca1379657..c5a8f953f 100644 --- a/src/Bundle/ChillEventBundle/Entity/Event.php +++ b/src/Bundle/ChillEventBundle/Entity/Event.php @@ -176,7 +176,7 @@ class Event implements HasCenterInterface, HasScopeInterface { $iterator = $this->participations->getIterator(); - $iterator->uasort(static fn ($first, $second) => strnatcasecmp($first->getPerson()->getFirstName(), $second->getPerson()->getFirstName())); + $iterator->uasort(static fn ($first, $second) => strnatcasecmp((string) $first->getPerson()->getFirstName(), (string) $second->getPerson()->getFirstName())); return $iterator; } diff --git a/src/Bundle/ChillEventBundle/Search/EventSearch.php b/src/Bundle/ChillEventBundle/Search/EventSearch.php index 8a396e5cb..6b4192004 100644 --- a/src/Bundle/ChillEventBundle/Search/EventSearch.php +++ b/src/Bundle/ChillEventBundle/Search/EventSearch.php @@ -38,7 +38,7 @@ use function count; */ class EventSearch extends AbstractSearch { - public const NAME = 'event_regular'; + final public const NAME = 'event_regular'; /** * @var \Chill\MainBundle\Entity\User @@ -47,10 +47,10 @@ class EventSearch extends AbstractSearch public function __construct( TokenStorageInterface $tokenStorage, - private EntityRepository $er, - private AuthorizationHelper $helper, - private TemplatingEngine $templating, - private PaginatorFactory $paginationFactory + private readonly EntityRepository $er, + private readonly AuthorizationHelper $helper, + private readonly TemplatingEngine $templating, + private readonly PaginatorFactory $paginationFactory ) { $this->user = $tokenStorage->getToken()->getUser(); } diff --git a/src/Bundle/ChillEventBundle/Security/Authorization/EventVoter.php b/src/Bundle/ChillEventBundle/Security/Authorization/EventVoter.php index ade1b48de..691939120 100644 --- a/src/Bundle/ChillEventBundle/Security/Authorization/EventVoter.php +++ b/src/Bundle/ChillEventBundle/Security/Authorization/EventVoter.php @@ -31,20 +31,20 @@ use function in_array; */ class EventVoter extends AbstractChillVoter implements ProvideRoleHierarchyInterface { - public const CREATE = 'CHILL_EVENT_CREATE'; + final public const CREATE = 'CHILL_EVENT_CREATE'; - public const ROLES = [ + final public const ROLES = [ self::SEE, self::SEE_DETAILS, self::CREATE, self::UPDATE, ]; - public const SEE = 'CHILL_EVENT_SEE'; + final public const SEE = 'CHILL_EVENT_SEE'; - public const SEE_DETAILS = 'CHILL_EVENT_SEE_DETAILS'; + final public const SEE_DETAILS = 'CHILL_EVENT_SEE_DETAILS'; - public const UPDATE = 'CHILL_EVENT_UPDATE'; + final public const UPDATE = 'CHILL_EVENT_UPDATE'; /** * @var AccessDecisionManagerInterface diff --git a/src/Bundle/ChillEventBundle/Security/Authorization/ParticipationVoter.php b/src/Bundle/ChillEventBundle/Security/Authorization/ParticipationVoter.php index 12c01ca60..b0c588560 100644 --- a/src/Bundle/ChillEventBundle/Security/Authorization/ParticipationVoter.php +++ b/src/Bundle/ChillEventBundle/Security/Authorization/ParticipationVoter.php @@ -28,20 +28,20 @@ use function in_array; class ParticipationVoter extends AbstractChillVoter implements ProvideRoleHierarchyInterface { - public const CREATE = 'CHILL_EVENT_PARTICIPATION_CREATE'; + final public const CREATE = 'CHILL_EVENT_PARTICIPATION_CREATE'; - public const ROLES = [ + final public const ROLES = [ self::SEE, self::SEE_DETAILS, self::CREATE, self::UPDATE, ]; - public const SEE = 'CHILL_EVENT_PARTICIPATION_SEE'; + final public const SEE = 'CHILL_EVENT_PARTICIPATION_SEE'; - public const SEE_DETAILS = 'CHILL_EVENT_PARTICIPATION_SEE_DETAILS'; + final public const SEE_DETAILS = 'CHILL_EVENT_PARTICIPATION_SEE_DETAILS'; - public const UPDATE = 'CHILL_EVENT_PARTICIPATION_UPDATE'; + final public const UPDATE = 'CHILL_EVENT_PARTICIPATION_UPDATE'; /** * @var AccessDecisionManagerInterface diff --git a/src/Bundle/ChillEventBundle/Tests/Controller/EventControllerTest.php b/src/Bundle/ChillEventBundle/Tests/Controller/EventControllerTest.php index 01f5e1b1a..cece09a99 100644 --- a/src/Bundle/ChillEventBundle/Tests/Controller/EventControllerTest.php +++ b/src/Bundle/ChillEventBundle/Tests/Controller/EventControllerTest.php @@ -19,7 +19,7 @@ use Symfony\Bundle\FrameworkBundle\Test\WebTestCase; */ final class EventControllerTest extends WebTestCase { - public function testSkipped() + public function testSkipped(): never { $this->markTestSkipped(); } diff --git a/src/Bundle/ChillEventBundle/Tests/Controller/EventTypeControllerTest.php b/src/Bundle/ChillEventBundle/Tests/Controller/EventTypeControllerTest.php index 23394d43c..8e351066d 100644 --- a/src/Bundle/ChillEventBundle/Tests/Controller/EventTypeControllerTest.php +++ b/src/Bundle/ChillEventBundle/Tests/Controller/EventTypeControllerTest.php @@ -19,7 +19,7 @@ use Symfony\Bundle\FrameworkBundle\Test\WebTestCase; */ final class EventTypeControllerTest extends WebTestCase { - public function testSkipped() + public function testSkipped(): never { $this->markTestSkipped(); } diff --git a/src/Bundle/ChillEventBundle/Tests/Controller/RoleControllerTest.php b/src/Bundle/ChillEventBundle/Tests/Controller/RoleControllerTest.php index 937bf8e49..3839a1647 100644 --- a/src/Bundle/ChillEventBundle/Tests/Controller/RoleControllerTest.php +++ b/src/Bundle/ChillEventBundle/Tests/Controller/RoleControllerTest.php @@ -19,7 +19,7 @@ use Symfony\Bundle\FrameworkBundle\Test\WebTestCase; */ final class RoleControllerTest extends WebTestCase { - public function testSkipped() + public function testSkipped(): never { $this->markTestSkipped(); } diff --git a/src/Bundle/ChillEventBundle/Tests/Controller/StatusControllerTest.php b/src/Bundle/ChillEventBundle/Tests/Controller/StatusControllerTest.php index 04a6e6270..e573edaab 100644 --- a/src/Bundle/ChillEventBundle/Tests/Controller/StatusControllerTest.php +++ b/src/Bundle/ChillEventBundle/Tests/Controller/StatusControllerTest.php @@ -19,7 +19,7 @@ use Symfony\Bundle\FrameworkBundle\Test\WebTestCase; */ final class StatusControllerTest extends WebTestCase { - public function testSkipped() + public function testSkipped(): never { $this->markTestSkipped(); } diff --git a/src/Bundle/ChillEventBundle/Tests/Search/EventSearchTest.php b/src/Bundle/ChillEventBundle/Tests/Search/EventSearchTest.php index 131d6051d..f81804b1b 100644 --- a/src/Bundle/ChillEventBundle/Tests/Search/EventSearchTest.php +++ b/src/Bundle/ChillEventBundle/Tests/Search/EventSearchTest.php @@ -373,7 +373,7 @@ final class EventSearchTest extends WebTestCase // get the second node, which should contains a date $tdDate = $tr->filter('td')->eq(1); // transform the date, which should be in french, into a DateTime object - $parts = explode(' ', $tdDate->text()); + $parts = explode(' ', (string) $tdDate->text()); return DateTime::createFromFormat('Y-m-d', $parts[2] . '-' . $months[$parts[1]] . '-' . $parts[0]); diff --git a/src/Bundle/ChillFamilyMembersBundle/Controller/FamilyMemberController.php b/src/Bundle/ChillFamilyMembersBundle/Controller/FamilyMemberController.php index 34a83dfcb..a886294bb 100644 --- a/src/Bundle/ChillFamilyMembersBundle/Controller/FamilyMemberController.php +++ b/src/Bundle/ChillFamilyMembersBundle/Controller/FamilyMemberController.php @@ -28,7 +28,7 @@ use Symfony\Contracts\Translation\TranslatorInterface; class FamilyMemberController extends AbstractController { - public function __construct(private EntityManagerInterface $em, protected TranslatorInterface $translator, protected LoggerInterface $chillMainLogger, private FamilyMemberRepository $familyMemberRepository) + public function __construct(private readonly EntityManagerInterface $em, protected TranslatorInterface $translator, protected LoggerInterface $chillMainLogger, private readonly FamilyMemberRepository $familyMemberRepository) { } diff --git a/src/Bundle/ChillFamilyMembersBundle/Form/FamilyMemberType.php b/src/Bundle/ChillFamilyMembersBundle/Form/FamilyMemberType.php index 4c45691e5..c317633e7 100644 --- a/src/Bundle/ChillFamilyMembersBundle/Form/FamilyMemberType.php +++ b/src/Bundle/ChillFamilyMembersBundle/Form/FamilyMemberType.php @@ -25,7 +25,7 @@ use Symfony\Component\OptionsResolver\OptionsResolver; class FamilyMemberType extends AbstractType { - public function __construct(private ConfigRepository $configRepository, private TranslatableStringHelper $translatableStringHelper) + public function __construct(private readonly ConfigRepository $configRepository, private readonly TranslatableStringHelper $translatableStringHelper) { } diff --git a/src/Bundle/ChillFamilyMembersBundle/Security/Voter/FamilyMemberVoter.php b/src/Bundle/ChillFamilyMembersBundle/Security/Voter/FamilyMemberVoter.php index 027597cc9..68fd332ff 100644 --- a/src/Bundle/ChillFamilyMembersBundle/Security/Voter/FamilyMemberVoter.php +++ b/src/Bundle/ChillFamilyMembersBundle/Security/Voter/FamilyMemberVoter.php @@ -23,20 +23,20 @@ use function in_array; class FamilyMemberVoter extends AbstractChillVoter implements ProvideRoleHierarchyInterface { - public const CREATE = 'CHILL_FAMILY_MEMBERS_FAMILY_MEMBERS_CREATE'; + final public const CREATE = 'CHILL_FAMILY_MEMBERS_FAMILY_MEMBERS_CREATE'; - public const DELETE = 'CHILL_FAMILY_MEMBERS_FAMILY_MEMBERS_DELETE'; + final public const DELETE = 'CHILL_FAMILY_MEMBERS_FAMILY_MEMBERS_DELETE'; - public const ROLES = [ + final public const ROLES = [ self::CREATE, self::DELETE, self::SHOW, self::UPDATE, ]; - public const SHOW = 'CHILL_FAMILY_MEMBERS_FAMILY_MEMBERS_SHOW'; + final public const SHOW = 'CHILL_FAMILY_MEMBERS_FAMILY_MEMBERS_SHOW'; - public const UPDATE = 'CHILL_FAMILY_MEMBERS_FAMILY_MEMBERS_UPDATE'; + final public const UPDATE = 'CHILL_FAMILY_MEMBERS_FAMILY_MEMBERS_UPDATE'; /** * @var AuthorizationHelper diff --git a/src/Bundle/ChillFamilyMembersBundle/Templating/Twig.php b/src/Bundle/ChillFamilyMembersBundle/Templating/Twig.php index a2bed6319..05ccdc493 100644 --- a/src/Bundle/ChillFamilyMembersBundle/Templating/Twig.php +++ b/src/Bundle/ChillFamilyMembersBundle/Templating/Twig.php @@ -73,17 +73,17 @@ class Twig extends AbstractExtension public function getFilters() { return [ - new TwigFilter('chill_family_member_link_display', [$this, 'displayLink'], ['is_safe' => ['html']]), - new TwigFilter('chill_family_member_professional_situation_display', [$this, 'displayProfessionalSituation'], ['is_safe' => ['html']]), - new TwigFilter('chill_family_member_familial_situation_display', [$this, 'displayFamilialSituation'], ['is_safe' => ['html']]), + new TwigFilter('chill_family_member_link_display', $this->displayLink(...), ['is_safe' => ['html']]), + new TwigFilter('chill_family_member_professional_situation_display', $this->displayProfessionalSituation(...), ['is_safe' => ['html']]), + new TwigFilter('chill_family_member_familial_situation_display', $this->displayFamilialSituation(...), ['is_safe' => ['html']]), ]; } public function getFunctions() { return [ - new TwigFunction('chill_family_members_has_professionnal_situation', [$this, 'hasProfessionnalSituation']), - new TwigFunction('chill_family_members_has_familial_situation', [$this, 'hasFamilialSituation']), + new TwigFunction('chill_family_members_has_professionnal_situation', $this->hasProfessionnalSituation(...)), + new TwigFunction('chill_family_members_has_familial_situation', $this->hasFamilialSituation(...)), ]; } diff --git a/src/Bundle/ChillMainBundle/CRUD/Resolver/Resolver.php b/src/Bundle/ChillMainBundle/CRUD/Resolver/Resolver.php index aa06fbf2d..6068a5391 100644 --- a/src/Bundle/ChillMainBundle/CRUD/Resolver/Resolver.php +++ b/src/Bundle/ChillMainBundle/CRUD/Resolver/Resolver.php @@ -25,17 +25,17 @@ class Resolver /** * The key to get the role necessary for the action. */ - public const ROLE = 'role'; + final public const ROLE = 'role'; /** * @deprecated */ - public const ROLE_EDIT = 'role.edit'; + final public const ROLE_EDIT = 'role.edit'; /** * @deprecated */ - public const ROLE_VIEW = 'role.view'; + final public const ROLE_VIEW = 'role.view'; /** * @var array diff --git a/src/Bundle/ChillMainBundle/CRUD/Templating/TwigCRUDResolver.php b/src/Bundle/ChillMainBundle/CRUD/Templating/TwigCRUDResolver.php index afa3eab30..845bc145b 100644 --- a/src/Bundle/ChillMainBundle/CRUD/Templating/TwigCRUDResolver.php +++ b/src/Bundle/ChillMainBundle/CRUD/Templating/TwigCRUDResolver.php @@ -54,12 +54,12 @@ class TwigCRUDResolver extends AbstractExtension return [ new TwigFunction( 'chill_crud_config', - [$this, 'getConfig'], + $this->getConfig(...), ['is_safe' => 'html'] ), new TwigFunction( 'chill_crud_action_exists', - [$this, 'hasAction'], + $this->hasAction(...), [] ), ]; diff --git a/src/Bundle/ChillMainBundle/Command/ChillImportUsersCommand.php b/src/Bundle/ChillMainBundle/Command/ChillImportUsersCommand.php index d4c3dcb42..48d460875 100644 --- a/src/Bundle/ChillMainBundle/Command/ChillImportUsersCommand.php +++ b/src/Bundle/ChillMainBundle/Command/ChillImportUsersCommand.php @@ -138,8 +138,8 @@ class ChillImportUsersCommand extends Command { $user = new User(); $user - ->setEmail(trim($data['email'])) - ->setUsername(trim($data['username'])) + ->setEmail(trim((string) $data['email'])) + ->setUsername(trim((string) $data['username'])) ->setEnabled(true) ->setPassword($this->passwordEncoder->encodePassword( $user, diff --git a/src/Bundle/ChillMainBundle/Command/ChillUserSendRenewPasswordCodeCommand.php b/src/Bundle/ChillMainBundle/Command/ChillUserSendRenewPasswordCodeCommand.php index 5f62d39ed..b7ef472a4 100644 --- a/src/Bundle/ChillMainBundle/Command/ChillUserSendRenewPasswordCodeCommand.php +++ b/src/Bundle/ChillMainBundle/Command/ChillUserSendRenewPasswordCodeCommand.php @@ -160,7 +160,7 @@ class ChillUserSendRenewPasswordCodeCommand extends Command try { if (array_key_exists('email', $row)) { - return $userRepository->findOneByUsernameOrEmail(trim($row['email'])); + return $userRepository->findOneByUsernameOrEmail(trim((string) $row['email'])); } } catch (\Doctrine\ORM\NoResultException) { // continue, we will try username @@ -168,7 +168,7 @@ class ChillUserSendRenewPasswordCodeCommand extends Command try { if (array_key_exists('username', $row)) { - return $userRepository->findOneByUsernameOrEmail(trim($row['username'])); + return $userRepository->findOneByUsernameOrEmail(trim((string) $row['username'])); } } catch (\Doctrine\ORM\NoResultException) { return null; diff --git a/src/Bundle/ChillMainBundle/Command/ExecuteCronJobCommand.php b/src/Bundle/ChillMainBundle/Command/ExecuteCronJobCommand.php index e2d7bd6dd..b3f9a9f4d 100644 --- a/src/Bundle/ChillMainBundle/Command/ExecuteCronJobCommand.php +++ b/src/Bundle/ChillMainBundle/Command/ExecuteCronJobCommand.php @@ -20,7 +20,7 @@ use Symfony\Component\Console\Output\OutputInterface; class ExecuteCronJobCommand extends Command { public function __construct( - private CronManagerInterface $cronManager + private readonly CronManagerInterface $cronManager ) { parent::__construct('chill:cron-job:execute'); } diff --git a/src/Bundle/ChillMainBundle/Command/LoadAddressesBEFromBestAddressCommand.php b/src/Bundle/ChillMainBundle/Command/LoadAddressesBEFromBestAddressCommand.php index 0335f11ee..710dedb8f 100644 --- a/src/Bundle/ChillMainBundle/Command/LoadAddressesBEFromBestAddressCommand.php +++ b/src/Bundle/ChillMainBundle/Command/LoadAddressesBEFromBestAddressCommand.php @@ -21,8 +21,8 @@ use Symfony\Component\Console\Output\OutputInterface; class LoadAddressesBEFromBestAddressCommand extends Command { public function __construct( - private AddressReferenceBEFromBestAddress $addressImporter, - private PostalCodeBEFromBestAddress $postalCodeBEFromBestAddressImporter + private readonly AddressReferenceBEFromBestAddress $addressImporter, + private readonly PostalCodeBEFromBestAddress $postalCodeBEFromBestAddressImporter ) { parent::__construct(); } diff --git a/src/Bundle/ChillMainBundle/Command/LoadAddressesFRFromBANOCommand.php b/src/Bundle/ChillMainBundle/Command/LoadAddressesFRFromBANOCommand.php index 732355a44..8f51a7335 100644 --- a/src/Bundle/ChillMainBundle/Command/LoadAddressesFRFromBANOCommand.php +++ b/src/Bundle/ChillMainBundle/Command/LoadAddressesFRFromBANOCommand.php @@ -19,7 +19,7 @@ use Symfony\Component\Console\Output\OutputInterface; class LoadAddressesFRFromBANOCommand extends Command { - public function __construct(private AddressReferenceFromBano $addressReferenceFromBano) + public function __construct(private readonly AddressReferenceFromBano $addressReferenceFromBano) { parent::__construct(); } diff --git a/src/Bundle/ChillMainBundle/Command/LoadAndUpdateLanguagesCommand.php b/src/Bundle/ChillMainBundle/Command/LoadAndUpdateLanguagesCommand.php index 702a71403..729051ea3 100644 --- a/src/Bundle/ChillMainBundle/Command/LoadAndUpdateLanguagesCommand.php +++ b/src/Bundle/ChillMainBundle/Command/LoadAndUpdateLanguagesCommand.php @@ -26,9 +26,9 @@ use function in_array; */ class LoadAndUpdateLanguagesCommand extends Command { - public const INCLUDE_ANCIENT = 'include_ancient'; + final public const INCLUDE_ANCIENT = 'include_ancient'; - public const INCLUDE_REGIONAL_VERSION = 'include_regional'; + final public const INCLUDE_REGIONAL_VERSION = 'include_regional'; // Array of ancien languages (to exclude) private $ancientToExclude = ['ang', 'egy', 'fro', 'goh', 'grc', 'la', 'non', 'peo', 'pro', 'sga', @@ -43,7 +43,7 @@ class LoadAndUpdateLanguagesCommand extends Command * * @param $availableLanguages */ - public function __construct(private EntityManager $entityManager, private $availableLanguages) + public function __construct(private readonly EntityManager $entityManager, private $availableLanguages) { parent::__construct(); } diff --git a/src/Bundle/ChillMainBundle/Command/LoadCountriesCommand.php b/src/Bundle/ChillMainBundle/Command/LoadCountriesCommand.php index 01400a9ad..c5cbdd78a 100644 --- a/src/Bundle/ChillMainBundle/Command/LoadCountriesCommand.php +++ b/src/Bundle/ChillMainBundle/Command/LoadCountriesCommand.php @@ -25,7 +25,7 @@ class LoadCountriesCommand extends Command * * @param $availableLanguages */ - public function __construct(private EntityManager $entityManager, private $availableLanguages) + public function __construct(private readonly EntityManager $entityManager, private $availableLanguages) { parent::__construct(); } diff --git a/src/Bundle/ChillMainBundle/Command/LoadPostalCodeFR.php b/src/Bundle/ChillMainBundle/Command/LoadPostalCodeFR.php index 6d1999127..be29cad9f 100644 --- a/src/Bundle/ChillMainBundle/Command/LoadPostalCodeFR.php +++ b/src/Bundle/ChillMainBundle/Command/LoadPostalCodeFR.php @@ -18,7 +18,7 @@ use Symfony\Component\Console\Output\OutputInterface; class LoadPostalCodeFR extends Command { - public function __construct(private PostalCodeFRFromOpenData $loader) + public function __construct(private readonly PostalCodeFRFromOpenData $loader) { parent::__construct(); } diff --git a/src/Bundle/ChillMainBundle/Command/LoadPostalCodesCommand.php b/src/Bundle/ChillMainBundle/Command/LoadPostalCodesCommand.php index 208f67cab..7bda1d672 100644 --- a/src/Bundle/ChillMainBundle/Command/LoadPostalCodesCommand.php +++ b/src/Bundle/ChillMainBundle/Command/LoadPostalCodesCommand.php @@ -30,7 +30,7 @@ use function strlen; class LoadPostalCodesCommand extends Command { - public function __construct(private EntityManagerInterface $entityManager, private ValidatorInterface $validator) + public function __construct(private readonly EntityManagerInterface $entityManager, private readonly ValidatorInterface $validator) { parent::__construct(); } @@ -90,7 +90,7 @@ class LoadPostalCodesCommand extends Command 0, $input->getOption('delimiter'), $input->getOption('enclosure'), - $input->getOption('escape') + (string) $input->getOption('escape') )) ) { try { @@ -109,7 +109,7 @@ class LoadPostalCodesCommand extends Command private function addPostalCode($row, OutputInterface $output) { - if ('FR' === $row[2] && strlen($row[0]) === 4) { + if ('FR' === $row[2] && strlen((string) $row[0]) === 4) { // CP in FRANCE are on 5 digit // For CP starting with a zero, the starting zero can be remove if stored as number in a csv // add a zero if CP from FR and on 4 digit diff --git a/src/Bundle/ChillMainBundle/Command/SetPasswordCommand.php b/src/Bundle/ChillMainBundle/Command/SetPasswordCommand.php index 16619bf54..c5eec91be 100644 --- a/src/Bundle/ChillMainBundle/Command/SetPasswordCommand.php +++ b/src/Bundle/ChillMainBundle/Command/SetPasswordCommand.php @@ -29,7 +29,7 @@ class SetPasswordCommand extends Command /** * SetPasswordCommand constructor. */ - public function __construct(private EntityManager $entityManager) + public function __construct(private readonly EntityManager $entityManager) { parent::__construct(); } diff --git a/src/Bundle/ChillMainBundle/Controller/AddressReferenceAPIController.php b/src/Bundle/ChillMainBundle/Controller/AddressReferenceAPIController.php index 68a0afdb6..b80bc2524 100644 --- a/src/Bundle/ChillMainBundle/Controller/AddressReferenceAPIController.php +++ b/src/Bundle/ChillMainBundle/Controller/AddressReferenceAPIController.php @@ -28,7 +28,7 @@ use function trim; final class AddressReferenceAPIController extends ApiController { - public function __construct(private AddressReferenceRepository $addressReferenceRepository, private PaginatorFactory $paginatorFactory) + public function __construct(private readonly AddressReferenceRepository $addressReferenceRepository, private readonly PaginatorFactory $paginatorFactory) { } @@ -45,7 +45,7 @@ final class AddressReferenceAPIController extends ApiController $pattern = $request->query->get('q'); - if ('' === trim($pattern)) { + if ('' === trim((string) $pattern)) { throw new BadRequestHttpException('the search pattern is empty'); } diff --git a/src/Bundle/ChillMainBundle/Controller/AddressToReferenceMatcherController.php b/src/Bundle/ChillMainBundle/Controller/AddressToReferenceMatcherController.php index fc92cd299..079f4783b 100644 --- a/src/Bundle/ChillMainBundle/Controller/AddressToReferenceMatcherController.php +++ b/src/Bundle/ChillMainBundle/Controller/AddressToReferenceMatcherController.php @@ -23,7 +23,7 @@ use Symfony\Component\Serializer\SerializerInterface; class AddressToReferenceMatcherController { - public function __construct(private Security $security, private EntityManagerInterface $entityManager, private SerializerInterface $serializer) + public function __construct(private readonly Security $security, private readonly EntityManagerInterface $entityManager, private readonly SerializerInterface $serializer) { } diff --git a/src/Bundle/ChillMainBundle/Controller/ExportController.php b/src/Bundle/ChillMainBundle/Controller/ExportController.php index 9e62cacf6..07d7907f6 100644 --- a/src/Bundle/ChillMainBundle/Controller/ExportController.php +++ b/src/Bundle/ChillMainBundle/Controller/ExportController.php @@ -47,7 +47,7 @@ use function unserialize; */ class ExportController extends AbstractController { - public function __construct(private ChillRedis $redis, private ExportManager $exportManager, private FormFactoryInterface $formFactory, private LoggerInterface $logger, private SessionInterface $session, private TranslatorInterface $translator, private EntityManagerInterface $entityManager) + public function __construct(private readonly ChillRedis $redis, private readonly ExportManager $exportManager, private readonly FormFactoryInterface $formFactory, private readonly LoggerInterface $logger, private readonly SessionInterface $session, private readonly TranslatorInterface $translator, private readonly EntityManagerInterface $entityManager) { } @@ -234,7 +234,7 @@ class ExportController extends AbstractController { /** @var \Chill\MainBundle\Export\ExportManager $exportManager */ $exportManager = $this->exportManager; - $isGenerate = str_starts_with($step, 'generate_'); + $isGenerate = str_starts_with((string) $step, 'generate_'); $builder = $this->formFactory ->createNamedBuilder(null, FormType::class, [], [ diff --git a/src/Bundle/ChillMainBundle/Controller/GeographicalUnitByAddressApiController.php b/src/Bundle/ChillMainBundle/Controller/GeographicalUnitByAddressApiController.php index 6ab4a6e3e..a8a9c0610 100644 --- a/src/Bundle/ChillMainBundle/Controller/GeographicalUnitByAddressApiController.php +++ b/src/Bundle/ChillMainBundle/Controller/GeographicalUnitByAddressApiController.php @@ -24,7 +24,7 @@ use Symfony\Component\Serializer\SerializerInterface; class GeographicalUnitByAddressApiController { - public function __construct(private PaginatorFactory $paginatorFactory, private GeographicalUnitRepositoryInterface $geographicalUnitRepository, private Security $security, private SerializerInterface $serializer) + public function __construct(private readonly PaginatorFactory $paginatorFactory, private readonly GeographicalUnitRepositoryInterface $geographicalUnitRepository, private readonly Security $security, private readonly SerializerInterface $serializer) { } diff --git a/src/Bundle/ChillMainBundle/Controller/NotificationApiController.php b/src/Bundle/ChillMainBundle/Controller/NotificationApiController.php index 52810cd97..1e371b970 100644 --- a/src/Bundle/ChillMainBundle/Controller/NotificationApiController.php +++ b/src/Bundle/ChillMainBundle/Controller/NotificationApiController.php @@ -33,7 +33,7 @@ use UnexpectedValueException; */ class NotificationApiController { - public function __construct(private EntityManagerInterface $entityManager, private NotificationRepository $notificationRepository, private PaginatorFactory $paginatorFactory, private Security $security, private SerializerInterface $serializer) + public function __construct(private readonly EntityManagerInterface $entityManager, private readonly NotificationRepository $notificationRepository, private readonly PaginatorFactory $paginatorFactory, private readonly Security $security, private readonly SerializerInterface $serializer) { } diff --git a/src/Bundle/ChillMainBundle/Controller/NotificationController.php b/src/Bundle/ChillMainBundle/Controller/NotificationController.php index d2d37ad77..5715b2f56 100644 --- a/src/Bundle/ChillMainBundle/Controller/NotificationController.php +++ b/src/Bundle/ChillMainBundle/Controller/NotificationController.php @@ -41,7 +41,7 @@ use function in_array; */ class NotificationController extends AbstractController { - public function __construct(private EntityManagerInterface $em, private LoggerInterface $chillLogger, private LoggerInterface $logger, private Security $security, private NotificationRepository $notificationRepository, private NotificationHandlerManager $notificationHandlerManager, private PaginatorFactory $paginatorFactory, private TranslatorInterface $translator, private UserRepository $userRepository) + public function __construct(private readonly EntityManagerInterface $em, private readonly LoggerInterface $chillLogger, private readonly LoggerInterface $logger, private readonly Security $security, private readonly NotificationRepository $notificationRepository, private readonly NotificationHandlerManager $notificationHandlerManager, private readonly PaginatorFactory $paginatorFactory, private readonly TranslatorInterface $translator, private readonly UserRepository $userRepository) { } diff --git a/src/Bundle/ChillMainBundle/Controller/PermissionApiController.php b/src/Bundle/ChillMainBundle/Controller/PermissionApiController.php index a28ca46f4..60f2d1ffb 100644 --- a/src/Bundle/ChillMainBundle/Controller/PermissionApiController.php +++ b/src/Bundle/ChillMainBundle/Controller/PermissionApiController.php @@ -24,7 +24,7 @@ use function json_decode; class PermissionApiController extends AbstractController { - public function __construct(private DenormalizerInterface $denormalizer, private Security $security) + public function __construct(private readonly DenormalizerInterface $denormalizer, private readonly Security $security) { } diff --git a/src/Bundle/ChillMainBundle/Controller/PermissionsGroupController.php b/src/Bundle/ChillMainBundle/Controller/PermissionsGroupController.php index f1b485870..bdcaf861a 100644 --- a/src/Bundle/ChillMainBundle/Controller/PermissionsGroupController.php +++ b/src/Bundle/ChillMainBundle/Controller/PermissionsGroupController.php @@ -37,7 +37,7 @@ class PermissionsGroupController extends AbstractController /** * PermissionsGroupController constructor. */ - public function __construct(private TranslatableStringHelper $translatableStringHelper, private RoleProvider $roleProvider, private RoleHierarchy $roleHierarchy, private TranslatorInterface $translator, private ValidatorInterface $validator) + public function __construct(private readonly TranslatableStringHelper $translatableStringHelper, private readonly RoleProvider $roleProvider, private readonly RoleHierarchy $roleHierarchy, private readonly TranslatorInterface $translator, private readonly ValidatorInterface $validator) { } diff --git a/src/Bundle/ChillMainBundle/Controller/PostalCodeAPIController.php b/src/Bundle/ChillMainBundle/Controller/PostalCodeAPIController.php index 945ad8fcf..e51f74e40 100644 --- a/src/Bundle/ChillMainBundle/Controller/PostalCodeAPIController.php +++ b/src/Bundle/ChillMainBundle/Controller/PostalCodeAPIController.php @@ -26,7 +26,7 @@ use Symfony\Component\Serializer\Normalizer\AbstractNormalizer; final class PostalCodeAPIController extends ApiController { - public function __construct(private CountryRepository $countryRepository, private PostalCodeRepositoryInterface $postalCodeRepository, private PaginatorFactory $paginatorFactory) + public function __construct(private readonly CountryRepository $countryRepository, private readonly PostalCodeRepositoryInterface $postalCodeRepository, private readonly PaginatorFactory $paginatorFactory) { } @@ -43,7 +43,7 @@ final class PostalCodeAPIController extends ApiController $pattern = $request->query->get('q'); - if ('' === trim($pattern)) { + if ('' === trim((string) $pattern)) { throw new BadRequestHttpException('the search pattern is empty'); } diff --git a/src/Bundle/ChillMainBundle/Controller/SavedExportController.php b/src/Bundle/ChillMainBundle/Controller/SavedExportController.php index f5e84c1b3..923394da9 100644 --- a/src/Bundle/ChillMainBundle/Controller/SavedExportController.php +++ b/src/Bundle/ChillMainBundle/Controller/SavedExportController.php @@ -36,7 +36,7 @@ use function count; class SavedExportController { - public function __construct(private EngineInterface $templating, private EntityManagerInterface $entityManager, private ExportManager $exportManager, private FormFactoryInterface $formFactory, private SavedExportRepositoryInterface $savedExportRepository, private Security $security, private SessionInterface $session, private TranslatorInterface $translator, private UrlGeneratorInterface $urlGenerator) + public function __construct(private readonly EngineInterface $templating, private readonly EntityManagerInterface $entityManager, private readonly ExportManager $exportManager, private readonly FormFactoryInterface $formFactory, private readonly SavedExportRepositoryInterface $savedExportRepository, private readonly Security $security, private readonly SessionInterface $session, private readonly TranslatorInterface $translator, private readonly UrlGeneratorInterface $urlGenerator) { } diff --git a/src/Bundle/ChillMainBundle/Controller/SearchController.php b/src/Bundle/ChillMainBundle/Controller/SearchController.php index dfaaa50d4..097b71d0e 100644 --- a/src/Bundle/ChillMainBundle/Controller/SearchController.php +++ b/src/Bundle/ChillMainBundle/Controller/SearchController.php @@ -103,7 +103,7 @@ class SearchController extends AbstractController public function searchAction(Request $request, $_format) { - $pattern = trim($request->query->get('q', '')); + $pattern = trim((string) $request->query->get('q', '')); if ('' === $pattern) { switch ($_format) { diff --git a/src/Bundle/ChillMainBundle/Controller/TimelineCenterController.php b/src/Bundle/ChillMainBundle/Controller/TimelineCenterController.php index fdb521882..f031c8ef1 100644 --- a/src/Bundle/ChillMainBundle/Controller/TimelineCenterController.php +++ b/src/Bundle/ChillMainBundle/Controller/TimelineCenterController.php @@ -22,7 +22,7 @@ use function count; class TimelineCenterController extends AbstractController { - public function __construct(protected TimelineBuilder $timelineBuilder, protected PaginatorFactory $paginatorFactory, private Security $security) + public function __construct(protected TimelineBuilder $timelineBuilder, protected PaginatorFactory $paginatorFactory, private readonly Security $security) { } diff --git a/src/Bundle/ChillMainBundle/Controller/UserController.php b/src/Bundle/ChillMainBundle/Controller/UserController.php index f8e512f78..af7620356 100644 --- a/src/Bundle/ChillMainBundle/Controller/UserController.php +++ b/src/Bundle/ChillMainBundle/Controller/UserController.php @@ -36,9 +36,9 @@ use Symfony\Component\Validator\Validator\ValidatorInterface; class UserController extends CRUDController { - public const FORM_GROUP_CENTER_COMPOSED = 'composed_groupcenter'; + final public const FORM_GROUP_CENTER_COMPOSED = 'composed_groupcenter'; - public function __construct(private LoggerInterface $logger, private ValidatorInterface $validator, private UserPasswordEncoderInterface $passwordEncoder, private UserRepository $userRepository, protected ParameterBagInterface $parameterBag) + public function __construct(private readonly LoggerInterface $logger, private readonly ValidatorInterface $validator, private readonly UserPasswordEncoderInterface $passwordEncoder, private readonly UserRepository $userRepository, protected ParameterBagInterface $parameterBag) { } diff --git a/src/Bundle/ChillMainBundle/Controller/WorkflowApiController.php b/src/Bundle/ChillMainBundle/Controller/WorkflowApiController.php index dfb06d3df..5de0e1252 100644 --- a/src/Bundle/ChillMainBundle/Controller/WorkflowApiController.php +++ b/src/Bundle/ChillMainBundle/Controller/WorkflowApiController.php @@ -30,7 +30,7 @@ use Symfony\Component\Serializer\SerializerInterface; class WorkflowApiController { - public function __construct(private EntityManagerInterface $entityManager, private EntityWorkflowRepository $entityWorkflowRepository, private PaginatorFactory $paginatorFactory, private Security $security, private SerializerInterface $serializer) + public function __construct(private readonly EntityManagerInterface $entityManager, private readonly EntityWorkflowRepository $entityWorkflowRepository, private readonly PaginatorFactory $paginatorFactory, private readonly Security $security, private readonly SerializerInterface $serializer) { } diff --git a/src/Bundle/ChillMainBundle/Controller/WorkflowController.php b/src/Bundle/ChillMainBundle/Controller/WorkflowController.php index b3d2ad475..6b3680b51 100644 --- a/src/Bundle/ChillMainBundle/Controller/WorkflowController.php +++ b/src/Bundle/ChillMainBundle/Controller/WorkflowController.php @@ -39,7 +39,7 @@ use function count; class WorkflowController extends AbstractController { - public function __construct(private EntityWorkflowManager $entityWorkflowManager, private EntityWorkflowRepository $entityWorkflowRepository, private ValidatorInterface $validator, private PaginatorFactory $paginatorFactory, private Registry $registry, private EntityManagerInterface $entityManager, private TranslatorInterface $translator, private Security $security) + public function __construct(private readonly EntityWorkflowManager $entityWorkflowManager, private readonly EntityWorkflowRepository $entityWorkflowRepository, private readonly ValidatorInterface $validator, private readonly PaginatorFactory $paginatorFactory, private readonly Registry $registry, private readonly EntityManagerInterface $entityManager, private readonly TranslatorInterface $translator, private readonly Security $security) { } diff --git a/src/Bundle/ChillMainBundle/Cron/CronManager.php b/src/Bundle/ChillMainBundle/Cron/CronManager.php index 0bf928ee1..da3316b11 100644 --- a/src/Bundle/ChillMainBundle/Cron/CronManager.php +++ b/src/Bundle/ChillMainBundle/Cron/CronManager.php @@ -49,7 +49,7 @@ class CronManager implements CronManagerInterface /** * @param CronJobInterface[] $jobs */ - public function __construct(private CronJobExecutionRepositoryInterface $cronJobExecutionRepository, private EntityManagerInterface $entityManager, private iterable $jobs, private LoggerInterface $logger) + public function __construct(private readonly CronJobExecutionRepositoryInterface $cronJobExecutionRepository, private readonly EntityManagerInterface $entityManager, private readonly iterable $jobs, private readonly LoggerInterface $logger) { } diff --git a/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadUsers.php b/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadUsers.php index 0d3b79fa0..8b6862364 100644 --- a/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadUsers.php +++ b/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadUsers.php @@ -84,7 +84,7 @@ class LoadUsers extends AbstractFixture implements ContainerAwareInterface, Orde ->getEncoder($user) ->encodePassword('password', $user->getSalt()) ) - ->setEmail(sprintf('%s@chill.social', str_replace(' ', '', $username))); + ->setEmail(sprintf('%s@chill.social', str_replace(' ', '', (string) $username))); foreach ($params['groupCenterRefs'] as $groupCenterRef) { $user->addGroupCenter($this->getReference($groupCenterRef)); diff --git a/src/Bundle/ChillMainBundle/DependencyInjection/CompilerPass/ShortMessageCompilerPass.php b/src/Bundle/ChillMainBundle/DependencyInjection/CompilerPass/ShortMessageCompilerPass.php index f9fdb80d0..88d72bddf 100644 --- a/src/Bundle/ChillMainBundle/DependencyInjection/CompilerPass/ShortMessageCompilerPass.php +++ b/src/Bundle/ChillMainBundle/DependencyInjection/CompilerPass/ShortMessageCompilerPass.php @@ -36,7 +36,7 @@ class ShortMessageCompilerPass implements CompilerPassInterface { $config = $container->resolveEnvPlaceholders($container->getParameter('chill_main.short_messages'), true); // weird fix for special characters - $config['dsn'] = str_replace(['%%'], ['%'], $config['dsn']); + $config['dsn'] = str_replace(['%%'], ['%'], (string) $config['dsn']); $dsn = parse_url($config['dsn']); parse_str($dsn['query'] ?? '', $dsn['queries']); diff --git a/src/Bundle/ChillMainBundle/DependencyInjection/Configuration.php b/src/Bundle/ChillMainBundle/DependencyInjection/Configuration.php index 0c5fd56c9..7cfe8cfb6 100644 --- a/src/Bundle/ChillMainBundle/DependencyInjection/Configuration.php +++ b/src/Bundle/ChillMainBundle/DependencyInjection/Configuration.php @@ -26,7 +26,7 @@ class Configuration implements ConfigurationInterface public function __construct( array $widgetFactories, - private ContainerBuilder $containerBuilder + private readonly ContainerBuilder $containerBuilder ) { $this->setWidgetFactories($widgetFactories); } diff --git a/src/Bundle/ChillMainBundle/Doctrine/Event/TrackCreateUpdateSubscriber.php b/src/Bundle/ChillMainBundle/Doctrine/Event/TrackCreateUpdateSubscriber.php index 0c8159df3..624167fec 100644 --- a/src/Bundle/ChillMainBundle/Doctrine/Event/TrackCreateUpdateSubscriber.php +++ b/src/Bundle/ChillMainBundle/Doctrine/Event/TrackCreateUpdateSubscriber.php @@ -22,7 +22,7 @@ use Symfony\Component\Security\Core\Security; class TrackCreateUpdateSubscriber implements EventSubscriber { - public function __construct(private Security $security) + public function __construct(private readonly Security $security) { } diff --git a/src/Bundle/ChillMainBundle/Doctrine/Model/Point.php b/src/Bundle/ChillMainBundle/Doctrine/Model/Point.php index de73bdf5a..03f1e7a8e 100644 --- a/src/Bundle/ChillMainBundle/Doctrine/Model/Point.php +++ b/src/Bundle/ChillMainBundle/Doctrine/Model/Point.php @@ -20,7 +20,7 @@ class Point implements JsonSerializable { public static string $SRID = '4326'; - private function __construct(private ?float $lon, private ?float $lat) + private function __construct(private readonly ?float $lon, private readonly ?float $lat) { } diff --git a/src/Bundle/ChillMainBundle/Doctrine/Type/NativeDateIntervalType.php b/src/Bundle/ChillMainBundle/Doctrine/Type/NativeDateIntervalType.php index 91033ec0b..c060dec60 100644 --- a/src/Bundle/ChillMainBundle/Doctrine/Type/NativeDateIntervalType.php +++ b/src/Bundle/ChillMainBundle/Doctrine/Type/NativeDateIntervalType.php @@ -29,7 +29,7 @@ use function reset; */ class NativeDateIntervalType extends DateIntervalType { - public const FORMAT = '%rP%YY%MM%DDT%HH%IM%SS'; + final public const FORMAT = '%rP%YY%MM%DDT%HH%IM%SS'; public function convertToDatabaseValue($value, AbstractPlatform $platform) { @@ -51,7 +51,7 @@ class NativeDateIntervalType extends DateIntervalType } try { - $strings = explode(' ', $value); + $strings = explode(' ', (string) $value); if (count($strings) === 0) { return null; @@ -101,8 +101,8 @@ class NativeDateIntervalType extends DateIntervalType return $current . $unit; } - if (preg_match('/([0-9]{2}\:[0-9]{2}:[0-9]{2})/', $current) === 1) { - $tExploded = explode(':', $current); + if (preg_match('/([0-9]{2}\:[0-9]{2}:[0-9]{2})/', (string) $current) === 1) { + $tExploded = explode(':', (string) $current); $intervalSpec = 'T'; $intervalSpec .= $tExploded[0] . 'H'; $intervalSpec .= $tExploded[1] . 'M'; diff --git a/src/Bundle/ChillMainBundle/Doctrine/Type/PointType.php b/src/Bundle/ChillMainBundle/Doctrine/Type/PointType.php index e1849574b..ce9074592 100644 --- a/src/Bundle/ChillMainBundle/Doctrine/Type/PointType.php +++ b/src/Bundle/ChillMainBundle/Doctrine/Type/PointType.php @@ -21,7 +21,7 @@ use Doctrine\DBAL\Types\Type; */ class PointType extends Type { - public const POINT = 'point'; + final public const POINT = 'point'; public function canRequireSQLConversion() { diff --git a/src/Bundle/ChillMainBundle/Entity/Address.php b/src/Bundle/ChillMainBundle/Entity/Address.php index 52e8d7c62..f753a048a 100644 --- a/src/Bundle/ChillMainBundle/Entity/Address.php +++ b/src/Bundle/ChillMainBundle/Entity/Address.php @@ -40,19 +40,19 @@ class Address implements TrackCreationInterface, TrackUpdateInterface /** * When an Address does match with the AddressReference */ - public const ADDR_REFERENCE_STATUS_MATCH = 'match'; + final public const ADDR_REFERENCE_STATUS_MATCH = 'match'; /** * When an Address does not match with the AddressReference, and * is pending for a review */ - public const ADDR_REFERENCE_STATUS_TO_REVIEW = 'to_review'; + final public const ADDR_REFERENCE_STATUS_TO_REVIEW = 'to_review'; /** * When an Address does not match with the AddressReference, but * is reviewed */ - public const ADDR_REFERENCE_STATUS_REVIEWED = 'reviewed'; + final public const ADDR_REFERENCE_STATUS_REVIEWED = 'reviewed'; /** * @ORM\ManyToOne(targetEntity=AddressReference::class) diff --git a/src/Bundle/ChillMainBundle/Entity/CronJobExecution.php b/src/Bundle/ChillMainBundle/Entity/CronJobExecution.php index ea3d47f72..5b80f41be 100644 --- a/src/Bundle/ChillMainBundle/Entity/CronJobExecution.php +++ b/src/Bundle/ChillMainBundle/Entity/CronJobExecution.php @@ -20,9 +20,9 @@ use Doctrine\ORM\Mapping as ORM; */ class CronJobExecution { - public const FAILURE = 100; + final public const FAILURE = 100; - public const SUCCESS = 1; + final public const SUCCESS = 1; /** * @var DateTimeImmutable diff --git a/src/Bundle/ChillMainBundle/Entity/LocationType.php b/src/Bundle/ChillMainBundle/Entity/LocationType.php index 42d1aa960..902ffce4d 100644 --- a/src/Bundle/ChillMainBundle/Entity/LocationType.php +++ b/src/Bundle/ChillMainBundle/Entity/LocationType.php @@ -27,15 +27,15 @@ use Symfony\Component\Serializer\Annotation\DiscriminatorMap; */ class LocationType { - public const DEFAULT_FOR_3PARTY = 'thirdparty'; + final public const DEFAULT_FOR_3PARTY = 'thirdparty'; - public const DEFAULT_FOR_PERSON = 'person'; + final public const DEFAULT_FOR_PERSON = 'person'; - public const STATUS_NEVER = 'never'; + final public const STATUS_NEVER = 'never'; - public const STATUS_OPTIONAL = 'optional'; + final public const STATUS_OPTIONAL = 'optional'; - public const STATUS_REQUIRED = 'required'; + final public const STATUS_REQUIRED = 'required'; /** * @ORM\Column(type="boolean", nullable=true) diff --git a/src/Bundle/ChillMainBundle/Export/ExportManager.php b/src/Bundle/ChillMainBundle/Export/ExportManager.php index 9b8fb340e..d3295e956 100644 --- a/src/Bundle/ChillMainBundle/Export/ExportManager.php +++ b/src/Bundle/ChillMainBundle/Export/ExportManager.php @@ -71,9 +71,9 @@ class ExportManager private $user; public function __construct( - private LoggerInterface $logger, - private AuthorizationCheckerInterface $authorizationChecker, - private AuthorizationHelperInterface $authorizationHelper, + private readonly LoggerInterface $logger, + private readonly AuthorizationCheckerInterface $authorizationChecker, + private readonly AuthorizationHelperInterface $authorizationHelper, TokenStorageInterface $tokenStorage, iterable $exports, iterable $aggregators, diff --git a/src/Bundle/ChillMainBundle/Export/Helper/DateTimeHelper.php b/src/Bundle/ChillMainBundle/Export/Helper/DateTimeHelper.php index 6b780715b..5c5e24318 100644 --- a/src/Bundle/ChillMainBundle/Export/Helper/DateTimeHelper.php +++ b/src/Bundle/ChillMainBundle/Export/Helper/DateTimeHelper.php @@ -18,7 +18,7 @@ use Symfony\Contracts\Translation\TranslatorInterface; class DateTimeHelper { - public function __construct(private TranslatorInterface $translator) + public function __construct(private readonly TranslatorInterface $translator) { } diff --git a/src/Bundle/ChillMainBundle/Export/Helper/ExportAddressHelper.php b/src/Bundle/ChillMainBundle/Export/Helper/ExportAddressHelper.php index 465fe6608..e96987760 100644 --- a/src/Bundle/ChillMainBundle/Export/Helper/ExportAddressHelper.php +++ b/src/Bundle/ChillMainBundle/Export/Helper/ExportAddressHelper.php @@ -32,25 +32,25 @@ class ExportAddressHelper /** * Compute all the F_* constants. */ - public const F_ALL = + final public const F_ALL = self::F_ATTRIBUTES | self::F_BUILDING | self::F_COUNTRY | self::F_GEOM | self::F_POSTAL_CODE | self::F_STREET | self::F_GEOGRAPHICAL_UNITS; - public const F_AS_STRING = 0b00010000; + final public const F_AS_STRING = 0b00010000; - public const F_ATTRIBUTES = 0b01000000; + final public const F_ATTRIBUTES = 0b01000000; - public const F_BUILDING = 0b00001000; + final public const F_BUILDING = 0b00001000; - public const F_COUNTRY = 0b00000001; + final public const F_COUNTRY = 0b00000001; - public const F_GEOGRAPHICAL_UNITS = 0b1000000000; + final public const F_GEOGRAPHICAL_UNITS = 0b1000000000; - public const F_GEOM = 0b00100000; + final public const F_GEOM = 0b00100000; - public const F_POSTAL_CODE = 0b00000010; + final public const F_POSTAL_CODE = 0b00000010; - public const F_STREET = 0b00000100; + final public const F_STREET = 0b00000100; private const ALL = [ 'country' => self::F_COUNTRY, @@ -84,7 +84,7 @@ class ExportAddressHelper */ private ?array $unitRefsKeysCache = []; - public function __construct(private AddressRender $addressRender, private AddressRepository $addressRepository, private GeographicalUnitLayerRepositoryInterface $geographicalUnitLayerRepository, private TranslatableStringHelperInterface $translatableStringHelper) + public function __construct(private readonly AddressRender $addressRender, private readonly AddressRepository $addressRepository, private readonly GeographicalUnitLayerRepositoryInterface $geographicalUnitLayerRepository, private readonly TranslatableStringHelperInterface $translatableStringHelper) { } @@ -253,7 +253,7 @@ class ExportAddressHelper public function getLabel($key, array $values, $data, string $prefix = '', string $translationPrefix = 'export.address_helper.'): callable { - $sanitizedKey = substr($key, strlen($prefix)); + $sanitizedKey = substr((string) $key, strlen($prefix)); switch ($sanitizedKey) { case 'id': @@ -333,7 +333,7 @@ class ExportAddressHelper }; default: - $layerNamesKeys = array_merge($this->generateKeysForUnitsNames($prefix), $this->generateKeysForUnitsRefs($prefix)); + $layerNamesKeys = [...$this->generateKeysForUnitsNames($prefix), ...$this->generateKeysForUnitsRefs($prefix)]; if (array_key_exists($key, $layerNamesKeys)) { return function ($value) use ($key, $layerNamesKeys) { diff --git a/src/Bundle/ChillMainBundle/Export/Helper/TranslatableStringExportLabelHelper.php b/src/Bundle/ChillMainBundle/Export/Helper/TranslatableStringExportLabelHelper.php index 37a41325e..9077ad8b0 100644 --- a/src/Bundle/ChillMainBundle/Export/Helper/TranslatableStringExportLabelHelper.php +++ b/src/Bundle/ChillMainBundle/Export/Helper/TranslatableStringExportLabelHelper.php @@ -21,7 +21,7 @@ use Chill\MainBundle\Templating\TranslatableStringHelperInterface; */ class TranslatableStringExportLabelHelper { - public function __construct(private TranslatableStringHelperInterface $translatableStringHelper) + public function __construct(private readonly TranslatableStringHelperInterface $translatableStringHelper) { } diff --git a/src/Bundle/ChillMainBundle/Export/Helper/UserHelper.php b/src/Bundle/ChillMainBundle/Export/Helper/UserHelper.php index cb13ac1c9..d77e7190e 100644 --- a/src/Bundle/ChillMainBundle/Export/Helper/UserHelper.php +++ b/src/Bundle/ChillMainBundle/Export/Helper/UserHelper.php @@ -18,7 +18,7 @@ use const SORT_NUMERIC; class UserHelper { - public function __construct(private UserRender $userRender, private UserRepositoryInterface $userRepository) + public function __construct(private readonly UserRender $userRender, private readonly UserRepositoryInterface $userRepository) { } diff --git a/src/Bundle/ChillMainBundle/Form/DataMapper/PrivateCommentDataMapper.php b/src/Bundle/ChillMainBundle/Form/DataMapper/PrivateCommentDataMapper.php index 18fceeb5c..10f9c26e3 100644 --- a/src/Bundle/ChillMainBundle/Form/DataMapper/PrivateCommentDataMapper.php +++ b/src/Bundle/ChillMainBundle/Form/DataMapper/PrivateCommentDataMapper.php @@ -19,7 +19,7 @@ use Symfony\Component\Security\Core\Security; final class PrivateCommentDataMapper extends AbstractType implements DataMapperInterface { - public function __construct(private Security $security) + public function __construct(private readonly Security $security) { } diff --git a/src/Bundle/ChillMainBundle/Form/DataMapper/ScopePickerDataMapper.php b/src/Bundle/ChillMainBundle/Form/DataMapper/ScopePickerDataMapper.php index bb5f64895..267927ff1 100644 --- a/src/Bundle/ChillMainBundle/Form/DataMapper/ScopePickerDataMapper.php +++ b/src/Bundle/ChillMainBundle/Form/DataMapper/ScopePickerDataMapper.php @@ -16,7 +16,7 @@ use Symfony\Component\Form\DataMapperInterface; class ScopePickerDataMapper implements DataMapperInterface { - public function __construct(private ?Scope $scope = null) + public function __construct(private readonly ?Scope $scope = null) { } diff --git a/src/Bundle/ChillMainBundle/Form/DataTransformer/IdToEntityDataTransformer.php b/src/Bundle/ChillMainBundle/Form/DataTransformer/IdToEntityDataTransformer.php index 48dd0dc7c..d392fb90a 100644 --- a/src/Bundle/ChillMainBundle/Form/DataTransformer/IdToEntityDataTransformer.php +++ b/src/Bundle/ChillMainBundle/Form/DataTransformer/IdToEntityDataTransformer.php @@ -29,12 +29,12 @@ use function call_user_func; */ class IdToEntityDataTransformer implements DataTransformerInterface { - private Closure $getId; + private readonly Closure $getId; /** * @param Closure $getId */ - public function __construct(private ObjectRepository $repository, private bool $multiple = false, ?callable $getId = null) + public function __construct(private readonly ObjectRepository $repository, private readonly bool $multiple = false, ?callable $getId = null) { $this->getId = $getId ?? static fn (object $o) => $o->getId(); } diff --git a/src/Bundle/ChillMainBundle/Form/Event/CustomizeFormEvent.php b/src/Bundle/ChillMainBundle/Form/Event/CustomizeFormEvent.php index 2f64f0699..a816e7371 100644 --- a/src/Bundle/ChillMainBundle/Form/Event/CustomizeFormEvent.php +++ b/src/Bundle/ChillMainBundle/Form/Event/CustomizeFormEvent.php @@ -15,7 +15,7 @@ use Symfony\Component\Form\FormBuilderInterface; class CustomizeFormEvent extends \Symfony\Component\EventDispatcher\Event { - public const NAME = 'chill_main.customize_form'; + final public const NAME = 'chill_main.customize_form'; public function __construct(protected string $type, protected FormBuilderInterface $builder) { diff --git a/src/Bundle/ChillMainBundle/Form/LocationFormType.php b/src/Bundle/ChillMainBundle/Form/LocationFormType.php index dd102dfc6..e4748d850 100644 --- a/src/Bundle/ChillMainBundle/Form/LocationFormType.php +++ b/src/Bundle/ChillMainBundle/Form/LocationFormType.php @@ -24,7 +24,7 @@ use Symfony\Component\OptionsResolver\OptionsResolver; final class LocationFormType extends AbstractType { - public function __construct(private TranslatableStringHelper $translatableStringHelper) + public function __construct(private readonly TranslatableStringHelper $translatableStringHelper) { } diff --git a/src/Bundle/ChillMainBundle/Form/PermissionsGroupType.php b/src/Bundle/ChillMainBundle/Form/PermissionsGroupType.php index 16aafeb41..1ff8b2647 100644 --- a/src/Bundle/ChillMainBundle/Form/PermissionsGroupType.php +++ b/src/Bundle/ChillMainBundle/Form/PermissionsGroupType.php @@ -24,7 +24,7 @@ use function count; class PermissionsGroupType extends AbstractType { - public const FLAG_SCOPE = 'permissions_group'; + final public const FLAG_SCOPE = 'permissions_group'; /** * @var PermissionsGroupFlagProvider[] diff --git a/src/Bundle/ChillMainBundle/Form/Type/ChillPhoneNumberType.php b/src/Bundle/ChillMainBundle/Form/Type/ChillPhoneNumberType.php index 159d2ec1e..700726619 100644 --- a/src/Bundle/ChillMainBundle/Form/Type/ChillPhoneNumberType.php +++ b/src/Bundle/ChillMainBundle/Form/Type/ChillPhoneNumberType.php @@ -20,9 +20,9 @@ use Symfony\Component\OptionsResolver\OptionsResolver; class ChillPhoneNumberType extends AbstractType { - private string $defaultCarrierCode; + private readonly string $defaultCarrierCode; - private PhoneNumberUtil $phoneNumberUtil; + private readonly PhoneNumberUtil $phoneNumberUtil; public function __construct(ParameterBagInterface $parameterBag) { diff --git a/src/Bundle/ChillMainBundle/Form/Type/ComposedRoleScopeType.php b/src/Bundle/ChillMainBundle/Form/Type/ComposedRoleScopeType.php index d9a469dec..4b9b95031 100644 --- a/src/Bundle/ChillMainBundle/Form/Type/ComposedRoleScopeType.php +++ b/src/Bundle/ChillMainBundle/Form/Type/ComposedRoleScopeType.php @@ -44,7 +44,7 @@ class ComposedRoleScopeType extends AbstractType private $rolesWithoutScope = []; public function __construct( - private TranslatableStringHelper $translatableStringHelper, + private readonly TranslatableStringHelper $translatableStringHelper, RoleProvider $roleProvider ) { $this->roles = $roleProvider->getRoles(); diff --git a/src/Bundle/ChillMainBundle/Form/Type/DataTransformer/AddressToIdDataTransformer.php b/src/Bundle/ChillMainBundle/Form/Type/DataTransformer/AddressToIdDataTransformer.php index a9774d06e..c04a4b158 100644 --- a/src/Bundle/ChillMainBundle/Form/Type/DataTransformer/AddressToIdDataTransformer.php +++ b/src/Bundle/ChillMainBundle/Form/Type/DataTransformer/AddressToIdDataTransformer.php @@ -15,7 +15,7 @@ use Chill\MainBundle\Repository\AddressRepository; use Symfony\Component\Form\DataTransformerInterface; use Symfony\Component\Form\Exception\TransformationFailedException; -final class AddressToIdDataTransformer implements DataTransformerInterface +final readonly class AddressToIdDataTransformer implements DataTransformerInterface { public function __construct(private AddressRepository $addressRepository) { diff --git a/src/Bundle/ChillMainBundle/Form/Type/DataTransformer/CenterTransformer.php b/src/Bundle/ChillMainBundle/Form/Type/DataTransformer/CenterTransformer.php index b195a5905..e9c745118 100644 --- a/src/Bundle/ChillMainBundle/Form/Type/DataTransformer/CenterTransformer.php +++ b/src/Bundle/ChillMainBundle/Form/Type/DataTransformer/CenterTransformer.php @@ -23,7 +23,7 @@ use function count; class CenterTransformer implements DataTransformerInterface { - public function __construct(private CenterRepository $centerRepository, private bool $multiple = false) + public function __construct(private readonly CenterRepository $centerRepository, private readonly bool $multiple = false) { } @@ -40,7 +40,7 @@ class CenterTransformer implements DataTransformerInterface $ids = []; if ($this->multiple) { - $ids = explode(',', $id); + $ids = explode(',', (string) $id); } else { $ids[] = (int) $id; } diff --git a/src/Bundle/ChillMainBundle/Form/Type/DataTransformer/EntityToJsonTransformer.php b/src/Bundle/ChillMainBundle/Form/Type/DataTransformer/EntityToJsonTransformer.php index 9ab91222c..044946716 100644 --- a/src/Bundle/ChillMainBundle/Form/Type/DataTransformer/EntityToJsonTransformer.php +++ b/src/Bundle/ChillMainBundle/Form/Type/DataTransformer/EntityToJsonTransformer.php @@ -25,7 +25,7 @@ use function array_key_exists; class EntityToJsonTransformer implements DataTransformerInterface { - public function __construct(private DenormalizerInterface $denormalizer, private SerializerInterface $serializer, private bool $multiple, private string $type) + public function __construct(private readonly DenormalizerInterface $denormalizer, private readonly SerializerInterface $serializer, private readonly bool $multiple, private readonly string $type) { } @@ -35,7 +35,7 @@ class EntityToJsonTransformer implements DataTransformerInterface return null; } - $denormalized = json_decode($value, true, 512, JSON_THROW_ON_ERROR); + $denormalized = json_decode((string) $value, true, 512, JSON_THROW_ON_ERROR); if ($this->multiple) { if (null === $denormalized) { diff --git a/src/Bundle/ChillMainBundle/Form/Type/DataTransformer/MultipleObjectsToIdTransformer.php b/src/Bundle/ChillMainBundle/Form/Type/DataTransformer/MultipleObjectsToIdTransformer.php index 345df74bd..1284cbaa8 100644 --- a/src/Bundle/ChillMainBundle/Form/Type/DataTransformer/MultipleObjectsToIdTransformer.php +++ b/src/Bundle/ChillMainBundle/Form/Type/DataTransformer/MultipleObjectsToIdTransformer.php @@ -17,7 +17,7 @@ use Symfony\Component\Form\DataTransformerInterface; class MultipleObjectsToIdTransformer implements DataTransformerInterface { - public function __construct(private EntityManagerInterface $em, private ?string $class = null) + public function __construct(private readonly EntityManagerInterface $em, private readonly ?string $class = null) { } diff --git a/src/Bundle/ChillMainBundle/Form/Type/DataTransformer/ObjectToIdTransformer.php b/src/Bundle/ChillMainBundle/Form/Type/DataTransformer/ObjectToIdTransformer.php index fe87fdb6c..23bc4c5ca 100644 --- a/src/Bundle/ChillMainBundle/Form/Type/DataTransformer/ObjectToIdTransformer.php +++ b/src/Bundle/ChillMainBundle/Form/Type/DataTransformer/ObjectToIdTransformer.php @@ -17,7 +17,7 @@ use Symfony\Component\Form\Exception\TransformationFailedException; class ObjectToIdTransformer implements DataTransformerInterface { - public function __construct(private EntityManagerInterface $em, private ?string $class = null) + public function __construct(private readonly EntityManagerInterface $em, private readonly ?string $class = null) { } diff --git a/src/Bundle/ChillMainBundle/Form/Type/DataTransformer/PostalCodeToIdTransformer.php b/src/Bundle/ChillMainBundle/Form/Type/DataTransformer/PostalCodeToIdTransformer.php index d18e3de8c..643ac0e62 100644 --- a/src/Bundle/ChillMainBundle/Form/Type/DataTransformer/PostalCodeToIdTransformer.php +++ b/src/Bundle/ChillMainBundle/Form/Type/DataTransformer/PostalCodeToIdTransformer.php @@ -20,7 +20,7 @@ use function is_int; class PostalCodeToIdTransformer implements DataTransformerInterface { - public function __construct(private PostalCodeRepositoryInterface $postalCodeRepository) + public function __construct(private readonly PostalCodeRepositoryInterface $postalCodeRepository) { } diff --git a/src/Bundle/ChillMainBundle/Form/Type/DataTransformer/ScopeTransformer.php b/src/Bundle/ChillMainBundle/Form/Type/DataTransformer/ScopeTransformer.php index bdd981706..81179c0be 100644 --- a/src/Bundle/ChillMainBundle/Form/Type/DataTransformer/ScopeTransformer.php +++ b/src/Bundle/ChillMainBundle/Form/Type/DataTransformer/ScopeTransformer.php @@ -18,7 +18,7 @@ use Symfony\Component\Form\Exception\TransformationFailedException; class ScopeTransformer implements DataTransformerInterface { - public function __construct(private EntityManagerInterface $em) + public function __construct(private readonly EntityManagerInterface $em) { } diff --git a/src/Bundle/ChillMainBundle/Form/Type/Export/ExportType.php b/src/Bundle/ChillMainBundle/Form/Type/Export/ExportType.php index bfb408cca..cf47d528b 100644 --- a/src/Bundle/ChillMainBundle/Form/Type/Export/ExportType.php +++ b/src/Bundle/ChillMainBundle/Form/Type/Export/ExportType.php @@ -20,13 +20,13 @@ use Symfony\Component\OptionsResolver\OptionsResolver; class ExportType extends AbstractType { - public const AGGREGATOR_KEY = 'aggregators'; + final public const AGGREGATOR_KEY = 'aggregators'; - public const EXPORT_KEY = 'export'; + final public const EXPORT_KEY = 'export'; - public const FILTER_KEY = 'filters'; + final public const FILTER_KEY = 'filters'; - public const PICK_FORMATTER_KEY = 'pick_formatter'; + final public const PICK_FORMATTER_KEY = 'pick_formatter'; /** * @var ExportManager diff --git a/src/Bundle/ChillMainBundle/Form/Type/Export/FilterType.php b/src/Bundle/ChillMainBundle/Form/Type/Export/FilterType.php index 153f8946b..6446304a6 100644 --- a/src/Bundle/ChillMainBundle/Form/Type/Export/FilterType.php +++ b/src/Bundle/ChillMainBundle/Form/Type/Export/FilterType.php @@ -19,7 +19,7 @@ use Symfony\Component\OptionsResolver\OptionsResolver; class FilterType extends AbstractType { - public const ENABLED_FIELD = 'enabled'; + final public const ENABLED_FIELD = 'enabled'; public function __construct() { diff --git a/src/Bundle/ChillMainBundle/Form/Type/Export/PickCenterType.php b/src/Bundle/ChillMainBundle/Form/Type/Export/PickCenterType.php index ef8dfb62e..598d983fb 100644 --- a/src/Bundle/ChillMainBundle/Form/Type/Export/PickCenterType.php +++ b/src/Bundle/ChillMainBundle/Form/Type/Export/PickCenterType.php @@ -33,13 +33,13 @@ final class PickCenterType extends AbstractType { public const CENTERS_IDENTIFIERS = 'c'; - private UserInterface $user; + private readonly UserInterface $user; public function __construct( TokenStorageInterface $tokenStorage, - private ExportManager $exportManager, - private RegroupmentRepository $regroupmentRepository, - private AuthorizationHelperInterface $authorizationHelper + private readonly ExportManager $exportManager, + private readonly RegroupmentRepository $regroupmentRepository, + private readonly AuthorizationHelperInterface $authorizationHelper ) { $this->user = $tokenStorage->getToken()->getUser(); } diff --git a/src/Bundle/ChillMainBundle/Form/Type/Listing/FilterOrderType.php b/src/Bundle/ChillMainBundle/Form/Type/Listing/FilterOrderType.php index d0dbfbe53..6a9c57420 100644 --- a/src/Bundle/ChillMainBundle/Form/Type/Listing/FilterOrderType.php +++ b/src/Bundle/ChillMainBundle/Form/Type/Listing/FilterOrderType.php @@ -27,7 +27,7 @@ use function count; final class FilterOrderType extends \Symfony\Component\Form\AbstractType { - public function __construct(private RequestStack $requestStack) + public function __construct(private readonly RequestStack $requestStack) { } diff --git a/src/Bundle/ChillMainBundle/Form/Type/PickAddressType.php b/src/Bundle/ChillMainBundle/Form/Type/PickAddressType.php index dbbdf502f..2bb1dad0e 100644 --- a/src/Bundle/ChillMainBundle/Form/Type/PickAddressType.php +++ b/src/Bundle/ChillMainBundle/Form/Type/PickAddressType.php @@ -43,7 +43,7 @@ use function uniqid; */ final class PickAddressType extends AbstractType { - public function __construct(private AddressToIdDataTransformer $addressToIdDataTransformer, private TranslatorInterface $translator) + public function __construct(private readonly AddressToIdDataTransformer $addressToIdDataTransformer, private readonly TranslatorInterface $translator) { } diff --git a/src/Bundle/ChillMainBundle/Form/Type/PickCivilityType.php b/src/Bundle/ChillMainBundle/Form/Type/PickCivilityType.php index 2a7ab259c..abe190de5 100644 --- a/src/Bundle/ChillMainBundle/Form/Type/PickCivilityType.php +++ b/src/Bundle/ChillMainBundle/Form/Type/PickCivilityType.php @@ -21,7 +21,7 @@ use Symfony\Component\OptionsResolver\OptionsResolver; class PickCivilityType extends AbstractType { - public function __construct(private TranslatableStringHelper $translatableStringHelper) + public function __construct(private readonly TranslatableStringHelper $translatableStringHelper) { } diff --git a/src/Bundle/ChillMainBundle/Form/Type/PickLocationTypeType.php b/src/Bundle/ChillMainBundle/Form/Type/PickLocationTypeType.php index cc9737270..7fb50fd4a 100644 --- a/src/Bundle/ChillMainBundle/Form/Type/PickLocationTypeType.php +++ b/src/Bundle/ChillMainBundle/Form/Type/PickLocationTypeType.php @@ -19,7 +19,7 @@ use Symfony\Component\OptionsResolver\OptionsResolver; class PickLocationTypeType extends AbstractType { - public function __construct(private TranslatableStringHelper $translatableStringHelper) + public function __construct(private readonly TranslatableStringHelper $translatableStringHelper) { } diff --git a/src/Bundle/ChillMainBundle/Form/Type/PickPostalCodeType.php b/src/Bundle/ChillMainBundle/Form/Type/PickPostalCodeType.php index 2ef990704..041176905 100644 --- a/src/Bundle/ChillMainBundle/Form/Type/PickPostalCodeType.php +++ b/src/Bundle/ChillMainBundle/Form/Type/PickPostalCodeType.php @@ -21,7 +21,7 @@ use Symfony\Component\OptionsResolver\OptionsResolver; class PickPostalCodeType extends AbstractType { - public function __construct(private PostalCodeToIdTransformer $postalCodeToIdTransformer) + public function __construct(private readonly PostalCodeToIdTransformer $postalCodeToIdTransformer) { } diff --git a/src/Bundle/ChillMainBundle/Form/Type/PickRollingDateType.php b/src/Bundle/ChillMainBundle/Form/Type/PickRollingDateType.php index a4492526f..b60401a46 100644 --- a/src/Bundle/ChillMainBundle/Form/Type/PickRollingDateType.php +++ b/src/Bundle/ChillMainBundle/Form/Type/PickRollingDateType.php @@ -55,7 +55,7 @@ class PickRollingDateType extends AbstractType 'class' => RollingDate::class, 'empty_data' => new RollingDate(RollingDate::T_TODAY), 'constraints' => [ - new Callback([$this, 'validate']), + new Callback($this->validate(...)), ], ]); } diff --git a/src/Bundle/ChillMainBundle/Form/Type/PickUserDynamicType.php b/src/Bundle/ChillMainBundle/Form/Type/PickUserDynamicType.php index 1b0a3c6e0..a12042dab 100644 --- a/src/Bundle/ChillMainBundle/Form/Type/PickUserDynamicType.php +++ b/src/Bundle/ChillMainBundle/Form/Type/PickUserDynamicType.php @@ -27,7 +27,7 @@ use Symfony\Component\Serializer\SerializerInterface; */ class PickUserDynamicType extends AbstractType { - public function __construct(private DenormalizerInterface $denormalizer, private SerializerInterface $serializer, private NormalizerInterface $normalizer) + public function __construct(private readonly DenormalizerInterface $denormalizer, private readonly SerializerInterface $serializer, private readonly NormalizerInterface $normalizer) { } diff --git a/src/Bundle/ChillMainBundle/Form/Type/PickUserLocationType.php b/src/Bundle/ChillMainBundle/Form/Type/PickUserLocationType.php index cc8171c4a..2fb695e85 100644 --- a/src/Bundle/ChillMainBundle/Form/Type/PickUserLocationType.php +++ b/src/Bundle/ChillMainBundle/Form/Type/PickUserLocationType.php @@ -20,7 +20,7 @@ use Symfony\Component\OptionsResolver\OptionsResolver; class PickUserLocationType extends AbstractType { - public function __construct(private TranslatableStringHelper $translatableStringHelper, private LocationRepository $locationRepository) + public function __construct(private readonly TranslatableStringHelper $translatableStringHelper, private readonly LocationRepository $locationRepository) { } diff --git a/src/Bundle/ChillMainBundle/Form/Type/ScopePickerType.php b/src/Bundle/ChillMainBundle/Form/Type/ScopePickerType.php index 28894a421..8229d4074 100644 --- a/src/Bundle/ChillMainBundle/Form/Type/ScopePickerType.php +++ b/src/Bundle/ChillMainBundle/Form/Type/ScopePickerType.php @@ -42,7 +42,7 @@ use function count; */ class ScopePickerType extends AbstractType { - public function __construct(private AuthorizationHelperInterface $authorizationHelper, private Security $security, private TranslatableStringHelperInterface $translatableStringHelper) + public function __construct(private readonly AuthorizationHelperInterface $authorizationHelper, private readonly Security $security, private readonly TranslatableStringHelperInterface $translatableStringHelper) { } diff --git a/src/Bundle/ChillMainBundle/Form/Type/Select2CountryType.php b/src/Bundle/ChillMainBundle/Form/Type/Select2CountryType.php index c22c3f523..eaaf0e9b2 100644 --- a/src/Bundle/ChillMainBundle/Form/Type/Select2CountryType.php +++ b/src/Bundle/ChillMainBundle/Form/Type/Select2CountryType.php @@ -29,7 +29,7 @@ use const SORT_STRING; */ class Select2CountryType extends AbstractType { - public function __construct(private RequestStack $requestStack, private ObjectManager $em, protected TranslatableStringHelper $translatableStringHelper, protected ParameterBagInterface $parameterBag) + public function __construct(private readonly RequestStack $requestStack, private readonly ObjectManager $em, protected TranslatableStringHelper $translatableStringHelper, protected ParameterBagInterface $parameterBag) { } diff --git a/src/Bundle/ChillMainBundle/Form/Type/Select2LanguageType.php b/src/Bundle/ChillMainBundle/Form/Type/Select2LanguageType.php index 7e5adb0cf..7e6d1589a 100644 --- a/src/Bundle/ChillMainBundle/Form/Type/Select2LanguageType.php +++ b/src/Bundle/ChillMainBundle/Form/Type/Select2LanguageType.php @@ -29,7 +29,7 @@ use const SORT_STRING; */ class Select2LanguageType extends AbstractType { - public function __construct(private RequestStack $requestStack, private ObjectManager $em, protected TranslatableStringHelper $translatableStringHelper, protected ParameterBagInterface $parameterBag) + public function __construct(private readonly RequestStack $requestStack, private readonly ObjectManager $em, protected TranslatableStringHelper $translatableStringHelper, protected ParameterBagInterface $parameterBag) { } diff --git a/src/Bundle/ChillMainBundle/Form/Type/TranslatableStringFormType.php b/src/Bundle/ChillMainBundle/Form/Type/TranslatableStringFormType.php index 580f2ca09..118b91226 100644 --- a/src/Bundle/ChillMainBundle/Form/Type/TranslatableStringFormType.php +++ b/src/Bundle/ChillMainBundle/Form/Type/TranslatableStringFormType.php @@ -28,7 +28,7 @@ class TranslatableStringFormType extends AbstractType private $frameworkTranslatorFallback; // The langagues used for the translation - public function __construct(private array $availableLanguages, Translator $translator) + public function __construct(private readonly array $availableLanguages, Translator $translator) { $this->frameworkTranslatorFallback = $translator->getFallbackLocales(); } diff --git a/src/Bundle/ChillMainBundle/Form/Type/UserPickerType.php b/src/Bundle/ChillMainBundle/Form/Type/UserPickerType.php index 38987d8fb..791063f0a 100644 --- a/src/Bundle/ChillMainBundle/Form/Type/UserPickerType.php +++ b/src/Bundle/ChillMainBundle/Form/Type/UserPickerType.php @@ -49,7 +49,7 @@ class UserPickerType extends AbstractType TokenStorageInterface $tokenStorage, protected UserRepository $userRepository, protected UserACLAwareRepositoryInterface $userACLAwareRepository, - private UserRender $userRender + private readonly UserRender $userRender ) { $this->authorizationHelper = $authorizationHelper; $this->tokenStorage = $tokenStorage; diff --git a/src/Bundle/ChillMainBundle/Form/UserType.php b/src/Bundle/ChillMainBundle/Form/UserType.php index 63f319de4..c787b1207 100644 --- a/src/Bundle/ChillMainBundle/Form/UserType.php +++ b/src/Bundle/ChillMainBundle/Form/UserType.php @@ -35,7 +35,7 @@ use Symfony\Component\Validator\Constraints\Regex; class UserType extends AbstractType { - public function __construct(private TranslatableStringHelper $translatableStringHelper, protected ParameterBagInterface $parameterBag) + public function __construct(private readonly TranslatableStringHelper $translatableStringHelper, protected ParameterBagInterface $parameterBag) { } diff --git a/src/Bundle/ChillMainBundle/Form/WorkflowStepType.php b/src/Bundle/ChillMainBundle/Form/WorkflowStepType.php index e967d299f..54b1a9fd7 100644 --- a/src/Bundle/ChillMainBundle/Form/WorkflowStepType.php +++ b/src/Bundle/ChillMainBundle/Form/WorkflowStepType.php @@ -36,7 +36,7 @@ use function array_key_exists; class WorkflowStepType extends AbstractType { - public function __construct(private EntityWorkflowManager $entityWorkflowManager, private Registry $registry, private TranslatableStringHelperInterface $translatableStringHelper) + public function __construct(private readonly EntityWorkflowManager $entityWorkflowManager, private readonly Registry $registry, private readonly TranslatableStringHelperInterface $translatableStringHelper) { } diff --git a/src/Bundle/ChillMainBundle/Notification/Counter/NotificationByUserCounter.php b/src/Bundle/ChillMainBundle/Notification/Counter/NotificationByUserCounter.php index cbafdcfaf..50da55240 100644 --- a/src/Bundle/ChillMainBundle/Notification/Counter/NotificationByUserCounter.php +++ b/src/Bundle/ChillMainBundle/Notification/Counter/NotificationByUserCounter.php @@ -23,7 +23,7 @@ use Doctrine\ORM\Event\PreFlushEventArgs; use Psr\Cache\CacheItemPoolInterface; use Symfony\Component\Security\Core\User\UserInterface; -final class NotificationByUserCounter implements NotificationCounterInterface +final readonly class NotificationByUserCounter implements NotificationCounterInterface { public function __construct(private CacheItemPoolInterface $cacheItemPool, private NotificationRepository $notificationRepository) { diff --git a/src/Bundle/ChillMainBundle/Notification/Email/NotificationMailer.php b/src/Bundle/ChillMainBundle/Notification/Email/NotificationMailer.php index 3d63c28a9..0850e1e4a 100644 --- a/src/Bundle/ChillMainBundle/Notification/Email/NotificationMailer.php +++ b/src/Bundle/ChillMainBundle/Notification/Email/NotificationMailer.php @@ -25,7 +25,7 @@ use Symfony\Contracts\Translation\TranslatorInterface; class NotificationMailer { - public function __construct(private MailerInterface $mailer, private LoggerInterface $logger, private TranslatorInterface $translator) + public function __construct(private readonly MailerInterface $mailer, private readonly LoggerInterface $logger, private readonly TranslatorInterface $translator) { } diff --git a/src/Bundle/ChillMainBundle/Notification/EventListener/PersistNotificationOnTerminateEventSubscriber.php b/src/Bundle/ChillMainBundle/Notification/EventListener/PersistNotificationOnTerminateEventSubscriber.php index 0601f0141..7051ee05e 100644 --- a/src/Bundle/ChillMainBundle/Notification/EventListener/PersistNotificationOnTerminateEventSubscriber.php +++ b/src/Bundle/ChillMainBundle/Notification/EventListener/PersistNotificationOnTerminateEventSubscriber.php @@ -19,7 +19,7 @@ use function count; class PersistNotificationOnTerminateEventSubscriber implements EventSubscriberInterface { - public function __construct(private EntityManagerInterface $em, private NotificationPersisterInterface $persister) + public function __construct(private readonly EntityManagerInterface $em, private readonly NotificationPersisterInterface $persister) { } diff --git a/src/Bundle/ChillMainBundle/Notification/Mailer.php b/src/Bundle/ChillMainBundle/Notification/Mailer.php index b65d29c8d..082bff84c 100644 --- a/src/Bundle/ChillMainBundle/Notification/Mailer.php +++ b/src/Bundle/ChillMainBundle/Notification/Mailer.php @@ -40,7 +40,7 @@ class Mailer * @param $routeParameters * @param mixed[] $routeParameters */ - public function __construct(private MailerInterface $mailer, private LoggerInterface $logger, private EngineInterface $twig, private RouterInterface $router, private TranslatorInterface $translator, protected $routeParameters) + public function __construct(private readonly MailerInterface $mailer, private readonly LoggerInterface $logger, private readonly EngineInterface $twig, private readonly RouterInterface $router, private readonly TranslatorInterface $translator, protected $routeParameters) { } diff --git a/src/Bundle/ChillMainBundle/Notification/NotificationHandlerManager.php b/src/Bundle/ChillMainBundle/Notification/NotificationHandlerManager.php index d39bc8a00..04116a434 100644 --- a/src/Bundle/ChillMainBundle/Notification/NotificationHandlerManager.php +++ b/src/Bundle/ChillMainBundle/Notification/NotificationHandlerManager.php @@ -15,7 +15,7 @@ use Chill\MainBundle\Entity\Notification; use Chill\MainBundle\Notification\Exception\NotificationHandlerNotFound; use Doctrine\ORM\EntityManagerInterface; -final class NotificationHandlerManager +final readonly class NotificationHandlerManager { public function __construct(private iterable $handlers, private EntityManagerInterface $em) { diff --git a/src/Bundle/ChillMainBundle/Notification/NotificationPresence.php b/src/Bundle/ChillMainBundle/Notification/NotificationPresence.php index 51cb73ccf..ad926d4be 100644 --- a/src/Bundle/ChillMainBundle/Notification/NotificationPresence.php +++ b/src/Bundle/ChillMainBundle/Notification/NotificationPresence.php @@ -24,7 +24,7 @@ class NotificationPresence { private array $cache = []; - public function __construct(private Security $security, private NotificationRepository $notificationRepository) + public function __construct(private readonly Security $security, private readonly NotificationRepository $notificationRepository) { } diff --git a/src/Bundle/ChillMainBundle/Notification/Templating/NotificationTwigExtensionRuntime.php b/src/Bundle/ChillMainBundle/Notification/Templating/NotificationTwigExtensionRuntime.php index 3c31b7201..d0f3b0930 100644 --- a/src/Bundle/ChillMainBundle/Notification/Templating/NotificationTwigExtensionRuntime.php +++ b/src/Bundle/ChillMainBundle/Notification/Templating/NotificationTwigExtensionRuntime.php @@ -21,7 +21,7 @@ use Twig\Extension\RuntimeExtensionInterface; class NotificationTwigExtensionRuntime implements RuntimeExtensionInterface { - public function __construct(private FormFactoryInterface $formFactory, private NotificationPresence $notificationPresence, private UrlGeneratorInterface $urlGenerator) + public function __construct(private readonly FormFactoryInterface $formFactory, private readonly NotificationPresence $notificationPresence, private readonly UrlGeneratorInterface $urlGenerator) { } diff --git a/src/Bundle/ChillMainBundle/Pagination/ChillItemsPerPageTwig.php b/src/Bundle/ChillMainBundle/Pagination/ChillItemsPerPageTwig.php index 97d4629c7..d66adb974 100644 --- a/src/Bundle/ChillMainBundle/Pagination/ChillItemsPerPageTwig.php +++ b/src/Bundle/ChillMainBundle/Pagination/ChillItemsPerPageTwig.php @@ -25,7 +25,7 @@ class ChillItemsPerPageTwig extends AbstractExtension return [ new TwigFunction( 'chill_items_per_page', - [$this, 'paginationRender'], + $this->paginationRender(...), [ 'needs_environment' => true, 'is_safe' => ['html'], diff --git a/src/Bundle/ChillMainBundle/Pagination/ChillPaginationTwig.php b/src/Bundle/ChillMainBundle/Pagination/ChillPaginationTwig.php index 2c75ad41a..e5883d593 100644 --- a/src/Bundle/ChillMainBundle/Pagination/ChillPaginationTwig.php +++ b/src/Bundle/ChillMainBundle/Pagination/ChillPaginationTwig.php @@ -20,16 +20,16 @@ use Twig\TwigFunction; */ class ChillPaginationTwig extends AbstractExtension { - public const LONG_TEMPLATE = '@ChillMain/Pagination/long.html.twig'; + final public const LONG_TEMPLATE = '@ChillMain/Pagination/long.html.twig'; - public const SHORT_TEMPLATE = '@ChillMain/Pagination/short.html.twig'; + final public const SHORT_TEMPLATE = '@ChillMain/Pagination/short.html.twig'; public function getFunctions() { return [ new TwigFunction( 'chill_pagination', - [$this, 'paginationRender'], + $this->paginationRender(...), [ 'needs_environment' => true, 'is_safe' => ['html'], diff --git a/src/Bundle/ChillMainBundle/Pagination/PaginatorFactory.php b/src/Bundle/ChillMainBundle/Pagination/PaginatorFactory.php index 60f9a6bc0..c75348910 100644 --- a/src/Bundle/ChillMainBundle/Pagination/PaginatorFactory.php +++ b/src/Bundle/ChillMainBundle/Pagination/PaginatorFactory.php @@ -19,11 +19,11 @@ use Symfony\Component\Routing\RouterInterface; */ class PaginatorFactory { - public const DEFAULT_CURRENT_PAGE_KEY = 'page'; + final public const DEFAULT_CURRENT_PAGE_KEY = 'page'; - public const DEFAULT_ITEM_PER_NUMBER_KEY = 'item_per_page'; + final public const DEFAULT_ITEM_PER_NUMBER_KEY = 'item_per_page'; - public const DEFAULT_PAGE_NUMBER = 1; + final public const DEFAULT_PAGE_NUMBER = 1; /** * @param int $itemPerPage @@ -32,11 +32,11 @@ class PaginatorFactory /** * the request stack. */ - private RequestStack $requestStack, + private readonly RequestStack $requestStack, /** * the router and generator for url. */ - private RouterInterface $router, + private readonly RouterInterface $router, /** * the default item per page. This may be overriden by * the request or inside the paginator. diff --git a/src/Bundle/ChillMainBundle/Phonenumber/PhonenumberHelper.php b/src/Bundle/ChillMainBundle/Phonenumber/PhonenumberHelper.php index 0c6fbbf03..27bd7051d 100644 --- a/src/Bundle/ChillMainBundle/Phonenumber/PhonenumberHelper.php +++ b/src/Bundle/ChillMainBundle/Phonenumber/PhonenumberHelper.php @@ -35,28 +35,28 @@ final class PhonenumberHelper implements PhoneNumberHelperInterface public const LOOKUP_URI = 'https://lookups.twilio.com/v1/PhoneNumbers/%s'; - private array $config; + private readonly array $config; private bool $isConfigured = false; - private PhonenumberUtil $phoneNumberUtil; + private readonly PhonenumberUtil $phoneNumberUtil; private Client $twilioClient; public function __construct( - private CacheItemPoolInterface $cachePool, + private readonly CacheItemPoolInterface $cachePool, ParameterBagInterface $parameterBag, - private LoggerInterface $logger + private readonly LoggerInterface $logger ) { $this->config = $config = $parameterBag->get('chill_main.phone_helper'); if ( array_key_exists('twilio_sid', $config) && !empty($config['twilio_sid']) - && strlen($config['twilio_sid']) > 2 + && strlen((string) $config['twilio_sid']) > 2 && array_key_exists('twilio_secret', $config) && !empty($config['twilio_secret']) - && strlen($config['twilio_secret']) > 2 + && strlen((string) $config['twilio_secret']) > 2 ) { $this->twilioClient = new Client([ 'auth' => [$config['twilio_sid'], $config['twilio_secret']], diff --git a/src/Bundle/ChillMainBundle/Phonenumber/Templating.php b/src/Bundle/ChillMainBundle/Phonenumber/Templating.php index 6f4f09bfd..69da56eca 100644 --- a/src/Bundle/ChillMainBundle/Phonenumber/Templating.php +++ b/src/Bundle/ChillMainBundle/Phonenumber/Templating.php @@ -28,7 +28,7 @@ class Templating extends AbstractExtension public function getFilters() { return [ - new TwigFilter('chill_format_phonenumber', [$this, 'formatPhonenumber']), + new TwigFilter('chill_format_phonenumber', $this->formatPhonenumber(...)), ]; } } diff --git a/src/Bundle/ChillMainBundle/Redis/RedisConnectionFactory.php b/src/Bundle/ChillMainBundle/Redis/RedisConnectionFactory.php index f5a2515c8..fdf81d441 100644 --- a/src/Bundle/ChillMainBundle/Redis/RedisConnectionFactory.php +++ b/src/Bundle/ChillMainBundle/Redis/RedisConnectionFactory.php @@ -16,13 +16,13 @@ use Symfony\Component\EventDispatcher\EventSubscriberInterface; final class RedisConnectionFactory implements EventSubscriberInterface { - private string $host; + private readonly string $host; - private int $port; + private readonly int $port; - private ChillRedis $redis; + private readonly ChillRedis $redis; - private int $timeout; + private readonly int $timeout; public function __construct($parameters) { diff --git a/src/Bundle/ChillMainBundle/Repository/AddressReferenceRepository.php b/src/Bundle/ChillMainBundle/Repository/AddressReferenceRepository.php index d301940ae..8cb4b2084 100644 --- a/src/Bundle/ChillMainBundle/Repository/AddressReferenceRepository.php +++ b/src/Bundle/ChillMainBundle/Repository/AddressReferenceRepository.php @@ -28,9 +28,9 @@ use function trim; final class AddressReferenceRepository implements ObjectRepository { - private EntityManagerInterface $entityManager; + private readonly EntityManagerInterface $entityManager; - private EntityRepository $repository; + private readonly EntityRepository $repository; public function __construct(EntityManagerInterface $entityManager) { diff --git a/src/Bundle/ChillMainBundle/Repository/AddressRepository.php b/src/Bundle/ChillMainBundle/Repository/AddressRepository.php index 622a9cb65..074b1fc32 100644 --- a/src/Bundle/ChillMainBundle/Repository/AddressRepository.php +++ b/src/Bundle/ChillMainBundle/Repository/AddressRepository.php @@ -19,7 +19,7 @@ use Doctrine\Persistence\ObjectRepository; final class AddressRepository implements ObjectRepository { - private EntityRepository $repository; + private readonly EntityRepository $repository; public function __construct(EntityManagerInterface $entityManager) { diff --git a/src/Bundle/ChillMainBundle/Repository/CenterRepository.php b/src/Bundle/ChillMainBundle/Repository/CenterRepository.php index eaa0a6b1e..1f498a666 100644 --- a/src/Bundle/ChillMainBundle/Repository/CenterRepository.php +++ b/src/Bundle/ChillMainBundle/Repository/CenterRepository.php @@ -17,7 +17,7 @@ use Doctrine\ORM\EntityRepository; final class CenterRepository implements CenterRepositoryInterface { - private EntityRepository $repository; + private readonly EntityRepository $repository; public function __construct(EntityManagerInterface $entityManager) { diff --git a/src/Bundle/ChillMainBundle/Repository/CivilityRepository.php b/src/Bundle/ChillMainBundle/Repository/CivilityRepository.php index 70b4a2bc4..982d3dd4c 100644 --- a/src/Bundle/ChillMainBundle/Repository/CivilityRepository.php +++ b/src/Bundle/ChillMainBundle/Repository/CivilityRepository.php @@ -17,7 +17,7 @@ use Doctrine\ORM\EntityRepository; class CivilityRepository implements CivilityRepositoryInterface { - private EntityRepository $repository; + private readonly EntityRepository $repository; public function __construct(EntityManagerInterface $entityManager) { diff --git a/src/Bundle/ChillMainBundle/Repository/CountryRepository.php b/src/Bundle/ChillMainBundle/Repository/CountryRepository.php index 699303bc8..701019dba 100644 --- a/src/Bundle/ChillMainBundle/Repository/CountryRepository.php +++ b/src/Bundle/ChillMainBundle/Repository/CountryRepository.php @@ -19,7 +19,7 @@ use Doctrine\Persistence\ObjectRepository; final class CountryRepository implements ObjectRepository { - private EntityRepository $repository; + private readonly EntityRepository $repository; public function __construct(EntityManagerInterface $entityManager) { diff --git a/src/Bundle/ChillMainBundle/Repository/CronJobExecutionRepository.php b/src/Bundle/ChillMainBundle/Repository/CronJobExecutionRepository.php index a3c495d7d..1f369ef4e 100644 --- a/src/Bundle/ChillMainBundle/Repository/CronJobExecutionRepository.php +++ b/src/Bundle/ChillMainBundle/Repository/CronJobExecutionRepository.php @@ -17,7 +17,7 @@ use Doctrine\ORM\EntityRepository; class CronJobExecutionRepository implements CronJobExecutionRepositoryInterface { - private EntityRepository $repository; + private readonly EntityRepository $repository; public function __construct(EntityManagerInterface $entityManager) { diff --git a/src/Bundle/ChillMainBundle/Repository/GeographicalUnitLayerLayerRepository.php b/src/Bundle/ChillMainBundle/Repository/GeographicalUnitLayerLayerRepository.php index 3f7f96407..11a03c209 100644 --- a/src/Bundle/ChillMainBundle/Repository/GeographicalUnitLayerLayerRepository.php +++ b/src/Bundle/ChillMainBundle/Repository/GeographicalUnitLayerLayerRepository.php @@ -17,7 +17,7 @@ use Doctrine\ORM\EntityRepository; final class GeographicalUnitLayerLayerRepository implements GeographicalUnitLayerRepositoryInterface { - private EntityRepository $repository; + private readonly EntityRepository $repository; public function __construct(EntityManagerInterface $em) { diff --git a/src/Bundle/ChillMainBundle/Repository/GeographicalUnitRepository.php b/src/Bundle/ChillMainBundle/Repository/GeographicalUnitRepository.php index f5e646dba..a59ac9a8c 100644 --- a/src/Bundle/ChillMainBundle/Repository/GeographicalUnitRepository.php +++ b/src/Bundle/ChillMainBundle/Repository/GeographicalUnitRepository.php @@ -20,7 +20,7 @@ use Doctrine\ORM\QueryBuilder; final class GeographicalUnitRepository implements GeographicalUnitRepositoryInterface { - private EntityRepository $repository; + private readonly EntityRepository $repository; public function __construct(EntityManagerInterface $em) { diff --git a/src/Bundle/ChillMainBundle/Repository/GroupCenterRepository.php b/src/Bundle/ChillMainBundle/Repository/GroupCenterRepository.php index 07bf728a2..2d9ad8c5a 100644 --- a/src/Bundle/ChillMainBundle/Repository/GroupCenterRepository.php +++ b/src/Bundle/ChillMainBundle/Repository/GroupCenterRepository.php @@ -18,7 +18,7 @@ use Doctrine\Persistence\ObjectRepository; final class GroupCenterRepository implements ObjectRepository { - private EntityRepository $repository; + private readonly EntityRepository $repository; public function __construct(EntityManagerInterface $entityManager) { diff --git a/src/Bundle/ChillMainBundle/Repository/LanguageRepository.php b/src/Bundle/ChillMainBundle/Repository/LanguageRepository.php index 2e972442e..d8c5d54f8 100644 --- a/src/Bundle/ChillMainBundle/Repository/LanguageRepository.php +++ b/src/Bundle/ChillMainBundle/Repository/LanguageRepository.php @@ -17,7 +17,7 @@ use Doctrine\ORM\EntityRepository; final class LanguageRepository implements LanguageRepositoryInterface { - private EntityRepository $repository; + private readonly EntityRepository $repository; public function __construct(EntityManagerInterface $entityManager) { diff --git a/src/Bundle/ChillMainBundle/Repository/NotificationRepository.php b/src/Bundle/ChillMainBundle/Repository/NotificationRepository.php index 5677adedb..045610f54 100644 --- a/src/Bundle/ChillMainBundle/Repository/NotificationRepository.php +++ b/src/Bundle/ChillMainBundle/Repository/NotificationRepository.php @@ -25,9 +25,9 @@ final class NotificationRepository implements ObjectRepository { private ?Statement $notificationByRelatedEntityAndUserAssociatedStatement = null; - private EntityRepository $repository; + private readonly EntityRepository $repository; - public function __construct(private EntityManagerInterface $em) + public function __construct(private readonly EntityManagerInterface $em) { $this->repository = $em->getRepository(Notification::class); } diff --git a/src/Bundle/ChillMainBundle/Repository/PermissionsGroupRepository.php b/src/Bundle/ChillMainBundle/Repository/PermissionsGroupRepository.php index 64863bf8c..0af942c75 100644 --- a/src/Bundle/ChillMainBundle/Repository/PermissionsGroupRepository.php +++ b/src/Bundle/ChillMainBundle/Repository/PermissionsGroupRepository.php @@ -18,7 +18,7 @@ use Doctrine\Persistence\ObjectRepository; final class PermissionsGroupRepository implements ObjectRepository { - private EntityRepository $repository; + private readonly EntityRepository $repository; public function __construct(EntityManagerInterface $entityManager) { diff --git a/src/Bundle/ChillMainBundle/Repository/PostalCodeRepository.php b/src/Bundle/ChillMainBundle/Repository/PostalCodeRepository.php index 32c1322be..3d2b2bb11 100644 --- a/src/Bundle/ChillMainBundle/Repository/PostalCodeRepository.php +++ b/src/Bundle/ChillMainBundle/Repository/PostalCodeRepository.php @@ -22,9 +22,9 @@ use RuntimeException; final class PostalCodeRepository implements PostalCodeRepositoryInterface { - private EntityManagerInterface $entityManager; + private readonly EntityManagerInterface $entityManager; - private EntityRepository $repository; + private readonly EntityRepository $repository; public function __construct(EntityManagerInterface $entityManager) { diff --git a/src/Bundle/ChillMainBundle/Repository/RegroupmentRepository.php b/src/Bundle/ChillMainBundle/Repository/RegroupmentRepository.php index a28f2f341..d05ceb699 100644 --- a/src/Bundle/ChillMainBundle/Repository/RegroupmentRepository.php +++ b/src/Bundle/ChillMainBundle/Repository/RegroupmentRepository.php @@ -18,7 +18,7 @@ use Doctrine\Persistence\ObjectRepository; final class RegroupmentRepository implements ObjectRepository { - private EntityRepository $repository; + private readonly EntityRepository $repository; public function __construct(EntityManagerInterface $entityManager) { diff --git a/src/Bundle/ChillMainBundle/Repository/RoleScopeRepository.php b/src/Bundle/ChillMainBundle/Repository/RoleScopeRepository.php index 49162310c..ddf52af5b 100644 --- a/src/Bundle/ChillMainBundle/Repository/RoleScopeRepository.php +++ b/src/Bundle/ChillMainBundle/Repository/RoleScopeRepository.php @@ -18,7 +18,7 @@ use Doctrine\Persistence\ObjectRepository; final class RoleScopeRepository implements ObjectRepository { - private EntityRepository $repository; + private readonly EntityRepository $repository; public function __construct(EntityManagerInterface $entityManager) { diff --git a/src/Bundle/ChillMainBundle/Repository/SavedExportRepository.php b/src/Bundle/ChillMainBundle/Repository/SavedExportRepository.php index 0011c5c43..c56e9927d 100644 --- a/src/Bundle/ChillMainBundle/Repository/SavedExportRepository.php +++ b/src/Bundle/ChillMainBundle/Repository/SavedExportRepository.php @@ -22,7 +22,7 @@ use Doctrine\Persistence\ObjectRepository; */ class SavedExportRepository implements SavedExportRepositoryInterface { - private EntityRepository $repository; + private readonly EntityRepository $repository; public function __construct(EntityManagerInterface $entityManager) { diff --git a/src/Bundle/ChillMainBundle/Repository/ScopeRepository.php b/src/Bundle/ChillMainBundle/Repository/ScopeRepository.php index 158678fb6..ba4ddae9b 100644 --- a/src/Bundle/ChillMainBundle/Repository/ScopeRepository.php +++ b/src/Bundle/ChillMainBundle/Repository/ScopeRepository.php @@ -18,7 +18,7 @@ use Doctrine\ORM\QueryBuilder; final class ScopeRepository implements ScopeRepositoryInterface { - private EntityRepository $repository; + private readonly EntityRepository $repository; public function __construct(EntityManagerInterface $entityManager) { diff --git a/src/Bundle/ChillMainBundle/Repository/UserACLAwareRepository.php b/src/Bundle/ChillMainBundle/Repository/UserACLAwareRepository.php index a64c77f10..5b830ce27 100644 --- a/src/Bundle/ChillMainBundle/Repository/UserACLAwareRepository.php +++ b/src/Bundle/ChillMainBundle/Repository/UserACLAwareRepository.php @@ -19,7 +19,7 @@ use Doctrine\ORM\EntityManagerInterface; class UserACLAwareRepository implements UserACLAwareRepositoryInterface { - public function __construct(private ParentRoleHelper $parentRoleHelper, private EntityManagerInterface $em) + public function __construct(private readonly ParentRoleHelper $parentRoleHelper, private readonly EntityManagerInterface $em) { } diff --git a/src/Bundle/ChillMainBundle/Repository/UserJobRepository.php b/src/Bundle/ChillMainBundle/Repository/UserJobRepository.php index 0be3e1b9c..302830cdc 100644 --- a/src/Bundle/ChillMainBundle/Repository/UserJobRepository.php +++ b/src/Bundle/ChillMainBundle/Repository/UserJobRepository.php @@ -17,7 +17,7 @@ use Doctrine\ORM\EntityRepository; class UserJobRepository implements UserJobRepositoryInterface { - private EntityRepository $repository; + private readonly EntityRepository $repository; public function __construct(EntityManagerInterface $em) { diff --git a/src/Bundle/ChillMainBundle/Repository/UserRepository.php b/src/Bundle/ChillMainBundle/Repository/UserRepository.php index 360171f58..672add512 100644 --- a/src/Bundle/ChillMainBundle/Repository/UserRepository.php +++ b/src/Bundle/ChillMainBundle/Repository/UserRepository.php @@ -22,7 +22,7 @@ use Doctrine\ORM\QueryBuilder; use function count; -final class UserRepository implements UserRepositoryInterface +final readonly class UserRepository implements UserRepositoryInterface { private EntityRepository $repository; diff --git a/src/Bundle/ChillMainBundle/Repository/Workflow/EntityWorkflowRepository.php b/src/Bundle/ChillMainBundle/Repository/Workflow/EntityWorkflowRepository.php index a304ff6d7..3ca56a2a0 100644 --- a/src/Bundle/ChillMainBundle/Repository/Workflow/EntityWorkflowRepository.php +++ b/src/Bundle/ChillMainBundle/Repository/Workflow/EntityWorkflowRepository.php @@ -20,7 +20,7 @@ use Doctrine\Persistence\ObjectRepository; class EntityWorkflowRepository implements ObjectRepository { - private EntityRepository $repository; + private readonly EntityRepository $repository; public function __construct(EntityManagerInterface $entityManager) { diff --git a/src/Bundle/ChillMainBundle/Repository/Workflow/EntityWorkflowStepRepository.php b/src/Bundle/ChillMainBundle/Repository/Workflow/EntityWorkflowStepRepository.php index d8c3619c3..545ec2873 100644 --- a/src/Bundle/ChillMainBundle/Repository/Workflow/EntityWorkflowStepRepository.php +++ b/src/Bundle/ChillMainBundle/Repository/Workflow/EntityWorkflowStepRepository.php @@ -20,7 +20,7 @@ use Doctrine\Persistence\ObjectRepository; class EntityWorkflowStepRepository implements ObjectRepository { - private EntityRepository $repository; + private readonly EntityRepository $repository; public function __construct(EntityManagerInterface $entityManager) { diff --git a/src/Bundle/ChillMainBundle/Routing/Loader/ChillRoutesLoader.php b/src/Bundle/ChillMainBundle/Routing/Loader/ChillRoutesLoader.php index ebfb263aa..37faf98ab 100644 --- a/src/Bundle/ChillMainBundle/Routing/Loader/ChillRoutesLoader.php +++ b/src/Bundle/ChillMainBundle/Routing/Loader/ChillRoutesLoader.php @@ -22,7 +22,7 @@ use Symfony\Component\Routing\RouteCollection; */ class ChillRoutesLoader extends Loader { - public function __construct(private array $routes) + public function __construct(private readonly array $routes) { parent::__construct(); } diff --git a/src/Bundle/ChillMainBundle/Routing/MenuBuilder/UserMenuBuilder.php b/src/Bundle/ChillMainBundle/Routing/MenuBuilder/UserMenuBuilder.php index 81c84a7a8..c203df335 100644 --- a/src/Bundle/ChillMainBundle/Routing/MenuBuilder/UserMenuBuilder.php +++ b/src/Bundle/ChillMainBundle/Routing/MenuBuilder/UserMenuBuilder.php @@ -22,7 +22,7 @@ use Symfony\Contracts\Translation\TranslatorInterface; class UserMenuBuilder implements LocalMenuBuilderInterface { - public function __construct(private NotificationByUserCounter $notificationByUserCounter, private WorkflowByUserCounter $workflowByUserCounter, private Security $security, private TranslatorInterface $translator, protected ParameterBagInterface $parameterBag, private RequestStack $requestStack) + public function __construct(private readonly NotificationByUserCounter $notificationByUserCounter, private readonly WorkflowByUserCounter $workflowByUserCounter, private readonly Security $security, private readonly TranslatorInterface $translator, protected ParameterBagInterface $parameterBag, private readonly RequestStack $requestStack) { } diff --git a/src/Bundle/ChillMainBundle/Routing/MenuComposer.php b/src/Bundle/ChillMainBundle/Routing/MenuComposer.php index ed9ff5169..f82ee2eae 100644 --- a/src/Bundle/ChillMainBundle/Routing/MenuComposer.php +++ b/src/Bundle/ChillMainBundle/Routing/MenuComposer.php @@ -33,7 +33,7 @@ class MenuComposer private RouteCollection $routeCollection; - public function __construct(private RouterInterface $router, private FactoryInterface $menuFactory, private TranslatorInterface $translator) + public function __construct(private readonly RouterInterface $router, private readonly FactoryInterface $menuFactory, private readonly TranslatorInterface $translator) { } diff --git a/src/Bundle/ChillMainBundle/Routing/MenuTwig.php b/src/Bundle/ChillMainBundle/Routing/MenuTwig.php index b77d4343f..c46ce9500 100644 --- a/src/Bundle/ChillMainBundle/Routing/MenuTwig.php +++ b/src/Bundle/ChillMainBundle/Routing/MenuTwig.php @@ -38,7 +38,7 @@ class MenuTwig extends AbstractExtension implements ContainerAwareInterface 'activeRouteKey' => null, ]; - public function __construct(private MenuComposer $menuComposer) + public function __construct(private readonly MenuComposer $menuComposer) { } @@ -76,7 +76,7 @@ class MenuTwig extends AbstractExtension implements ContainerAwareInterface { return [new TwigFunction( 'chill_menu', - [$this, 'chillMenu'], + $this->chillMenu(...), [ 'is_safe' => ['html'], 'needs_environment' => true, diff --git a/src/Bundle/ChillMainBundle/Search/AbstractSearch.php b/src/Bundle/ChillMainBundle/Search/AbstractSearch.php index f65319a09..9cd2cbd77 100644 --- a/src/Bundle/ChillMainBundle/Search/AbstractSearch.php +++ b/src/Bundle/ChillMainBundle/Search/AbstractSearch.php @@ -65,12 +65,12 @@ abstract class AbstractSearch implements SearchInterface foreach ($supportedTerms as $term) { if (array_key_exists($term, $terms) && '_default' !== $term) { $recomposed .= ' ' . $term . ':'; - $containsSpace = str_contains($terms[$term], ' '); + $containsSpace = str_contains((string) $terms[$term], ' '); if ($containsSpace) { $recomposed .= '"'; } - $recomposed .= (mb_stristr(' ', $terms[$term]) === false) ? $terms[$term] : '(' . $terms[$term] . ')'; + $recomposed .= (mb_stristr(' ', (string) $terms[$term]) === false) ? $terms[$term] : '(' . $terms[$term] . ')'; if ($containsSpace) { $recomposed .= '"'; diff --git a/src/Bundle/ChillMainBundle/Search/Entity/SearchUserApiProvider.php b/src/Bundle/ChillMainBundle/Search/Entity/SearchUserApiProvider.php index 397e0b589..5928911d9 100644 --- a/src/Bundle/ChillMainBundle/Search/Entity/SearchUserApiProvider.php +++ b/src/Bundle/ChillMainBundle/Search/Entity/SearchUserApiProvider.php @@ -20,7 +20,7 @@ use function in_array; class SearchUserApiProvider implements SearchApiInterface { - public function __construct(private UserRepository $userRepository) + public function __construct(private readonly UserRepository $userRepository) { } diff --git a/src/Bundle/ChillMainBundle/Search/Model/Result.php b/src/Bundle/ChillMainBundle/Search/Model/Result.php index 1ef249c1f..4f20924eb 100644 --- a/src/Bundle/ChillMainBundle/Search/Model/Result.php +++ b/src/Bundle/ChillMainBundle/Search/Model/Result.php @@ -17,7 +17,7 @@ class Result * @param $result */ public function __construct( - private float $relevance, + private readonly float $relevance, /** * mixed an arbitrary result. */ diff --git a/src/Bundle/ChillMainBundle/Search/SearchApi.php b/src/Bundle/ChillMainBundle/Search/SearchApi.php index e7159db06..83cd83194 100644 --- a/src/Bundle/ChillMainBundle/Search/SearchApi.php +++ b/src/Bundle/ChillMainBundle/Search/SearchApi.php @@ -26,7 +26,7 @@ use function strtr; class SearchApi { - public function __construct(private EntityManagerInterface $em, private iterable $providers, private PaginatorFactory $paginator) + public function __construct(private readonly EntityManagerInterface $em, private readonly iterable $providers, private readonly PaginatorFactory $paginator) { } diff --git a/src/Bundle/ChillMainBundle/Search/SearchApiNoQueryException.php b/src/Bundle/ChillMainBundle/Search/SearchApiNoQueryException.php index 542e18d7c..c006b4bee 100644 --- a/src/Bundle/ChillMainBundle/Search/SearchApiNoQueryException.php +++ b/src/Bundle/ChillMainBundle/Search/SearchApiNoQueryException.php @@ -18,11 +18,11 @@ use function implode; class SearchApiNoQueryException extends RuntimeException { - private string $pattern; + private readonly string $pattern; - private array $types; + private readonly array $types; - public function __construct(string $pattern = '', array $types = [], private array $parameters = [], $code = 0, ?Throwable $previous = null) + public function __construct(string $pattern = '', array $types = [], private readonly array $parameters = [], $code = 0, ?Throwable $previous = null) { $typesStr = implode(', ', $types); $message = "No query for this search: pattern : {$pattern}, types: {$typesStr}"; diff --git a/src/Bundle/ChillMainBundle/Search/SearchApiResult.php b/src/Bundle/ChillMainBundle/Search/SearchApiResult.php index b49c01565..218f4697e 100644 --- a/src/Bundle/ChillMainBundle/Search/SearchApiResult.php +++ b/src/Bundle/ChillMainBundle/Search/SearchApiResult.php @@ -15,11 +15,9 @@ use Symfony\Component\Serializer\Annotation as Serializer; class SearchApiResult { - private float $pertinence; - private $result; - public function __construct(private float $relevance) + public function __construct(private readonly float $relevance) { } diff --git a/src/Bundle/ChillMainBundle/Search/SearchProvider.php b/src/Bundle/ChillMainBundle/Search/SearchProvider.php index 52b484c2d..81c3a3969 100644 --- a/src/Bundle/ChillMainBundle/Search/SearchProvider.php +++ b/src/Bundle/ChillMainBundle/Search/SearchProvider.php @@ -252,17 +252,17 @@ class SearchProvider { $terms = []; $matches = []; - preg_match_all('/([a-z\-]+):(([^"][\S\-]+)|"[^"]*")/', $subject, $matches); + preg_match_all('/([a-z\-]+):(([^"][\S\-]+)|"[^"]*")/', (string) $subject, $matches); foreach ($matches[2] as $key => $match) { //remove from search pattern $this->mustBeExtracted[] = $matches[0][$key]; //strip parenthesis if ( - mb_substr($match, 0, 1) === '"' - && mb_substr($match, mb_strlen($match) - 1) === '"' + mb_substr((string) $match, 0, 1) === '"' + && mb_substr((string) $match, mb_strlen((string) $match) - 1) === '"' ) { - $match = trim(mb_substr($match, 1, mb_strlen($match) - 2)); + $match = trim(mb_substr((string) $match, 1, mb_strlen((string) $match) - 2)); } $terms[$matches[1][$key]] = $match; } diff --git a/src/Bundle/ChillMainBundle/Search/Utils/ExtractPhonenumberFromPattern.php b/src/Bundle/ChillMainBundle/Search/Utils/ExtractPhonenumberFromPattern.php index df9934570..ce79a637b 100644 --- a/src/Bundle/ChillMainBundle/Search/Utils/ExtractPhonenumberFromPattern.php +++ b/src/Bundle/ChillMainBundle/Search/Utils/ExtractPhonenumberFromPattern.php @@ -26,7 +26,7 @@ class ExtractPhonenumberFromPattern { private const PATTERN = '([\\+]{0,1}[0-9\\ ]{5,})'; - private string $defaultCarrierCode; + private readonly string $defaultCarrierCode; public function __construct(ParameterBagInterface $parameterBag) { diff --git a/src/Bundle/ChillMainBundle/Search/Utils/SearchExtractionResult.php b/src/Bundle/ChillMainBundle/Search/Utils/SearchExtractionResult.php index 20d5948a3..c753013cb 100644 --- a/src/Bundle/ChillMainBundle/Search/Utils/SearchExtractionResult.php +++ b/src/Bundle/ChillMainBundle/Search/Utils/SearchExtractionResult.php @@ -13,7 +13,7 @@ namespace Chill\MainBundle\Search\Utils; class SearchExtractionResult { - public function __construct(private string $filteredSubject, private array $found) + public function __construct(private readonly string $filteredSubject, private readonly array $found) { } diff --git a/src/Bundle/ChillMainBundle/Security/Authorization/AuthorizationHelper.php b/src/Bundle/ChillMainBundle/Security/Authorization/AuthorizationHelper.php index c431c4492..50cbf3f8d 100644 --- a/src/Bundle/ChillMainBundle/Security/Authorization/AuthorizationHelper.php +++ b/src/Bundle/ChillMainBundle/Security/Authorization/AuthorizationHelper.php @@ -34,7 +34,7 @@ use function get_class; */ class AuthorizationHelper implements AuthorizationHelperInterface { - public function __construct(private CenterResolverManagerInterface $centerResolverManager, private LoggerInterface $logger, private ScopeResolverDispatcher $scopeResolverDispatcher, private UserACLAwareRepositoryInterface $userACLAwareRepository, private ParentRoleHelper $parentRoleHelper) + public function __construct(private readonly CenterResolverManagerInterface $centerResolverManager, private readonly LoggerInterface $logger, private readonly ScopeResolverDispatcher $scopeResolverDispatcher, private readonly UserACLAwareRepositoryInterface $userACLAwareRepository, private readonly ParentRoleHelper $parentRoleHelper) { } diff --git a/src/Bundle/ChillMainBundle/Security/Authorization/AuthorizationHelperForCurrentUser.php b/src/Bundle/ChillMainBundle/Security/Authorization/AuthorizationHelperForCurrentUser.php index 45a1f3095..0a9d837a6 100644 --- a/src/Bundle/ChillMainBundle/Security/Authorization/AuthorizationHelperForCurrentUser.php +++ b/src/Bundle/ChillMainBundle/Security/Authorization/AuthorizationHelperForCurrentUser.php @@ -17,7 +17,7 @@ use Symfony\Component\Security\Core\Security; class AuthorizationHelperForCurrentUser implements AuthorizationHelperForCurrentUserInterface { - public function __construct(private AuthorizationHelperInterface $authorizationHelper, private Security $security) + public function __construct(private readonly AuthorizationHelperInterface $authorizationHelper, private readonly Security $security) { } diff --git a/src/Bundle/ChillMainBundle/Security/Authorization/ChillExportVoter.php b/src/Bundle/ChillMainBundle/Security/Authorization/ChillExportVoter.php index 62ac2b81b..10552d1f7 100644 --- a/src/Bundle/ChillMainBundle/Security/Authorization/ChillExportVoter.php +++ b/src/Bundle/ChillMainBundle/Security/Authorization/ChillExportVoter.php @@ -16,9 +16,9 @@ use Symfony\Component\Security\Core\Authorization\Voter\Voter; class ChillExportVoter extends Voter { - public const EXPORT = 'chill_export'; + final public const EXPORT = 'chill_export'; - private VoterHelperInterface $helper; + private readonly VoterHelperInterface $helper; public function __construct(VoterHelperFactoryInterface $voterHelperFactory) { diff --git a/src/Bundle/ChillMainBundle/Security/Authorization/DefaultVoterHelper.php b/src/Bundle/ChillMainBundle/Security/Authorization/DefaultVoterHelper.php index c6ae44d9f..a9c9f7445 100644 --- a/src/Bundle/ChillMainBundle/Security/Authorization/DefaultVoterHelper.php +++ b/src/Bundle/ChillMainBundle/Security/Authorization/DefaultVoterHelper.php @@ -16,7 +16,7 @@ use Chill\MainBundle\Security\Resolver\CenterResolverDispatcherInterface; use function in_array; -final class DefaultVoterHelper implements VoterHelperInterface +final readonly class DefaultVoterHelper implements VoterHelperInterface { public function __construct(private AuthorizationHelper $authorizationHelper, private CenterResolverDispatcherInterface $centerResolverDispatcher, private array $configuration) { diff --git a/src/Bundle/ChillMainBundle/Security/Authorization/DefaultVoterHelperGenerator.php b/src/Bundle/ChillMainBundle/Security/Authorization/DefaultVoterHelperGenerator.php index 7844632d8..cea60b931 100644 --- a/src/Bundle/ChillMainBundle/Security/Authorization/DefaultVoterHelperGenerator.php +++ b/src/Bundle/ChillMainBundle/Security/Authorization/DefaultVoterHelperGenerator.php @@ -17,7 +17,7 @@ final class DefaultVoterHelperGenerator implements VoterGeneratorInterface { private array $configuration = []; - public function __construct(private AuthorizationHelper $authorizationHelper, private CenterResolverDispatcherInterface $centerResolverDispatcher) + public function __construct(private readonly AuthorizationHelper $authorizationHelper, private readonly CenterResolverDispatcherInterface $centerResolverDispatcher) { } diff --git a/src/Bundle/ChillMainBundle/Security/Authorization/EntityWorkflowVoter.php b/src/Bundle/ChillMainBundle/Security/Authorization/EntityWorkflowVoter.php index 5d2bc72a7..11871b0b3 100644 --- a/src/Bundle/ChillMainBundle/Security/Authorization/EntityWorkflowVoter.php +++ b/src/Bundle/ChillMainBundle/Security/Authorization/EntityWorkflowVoter.php @@ -21,15 +21,15 @@ use function in_array; class EntityWorkflowVoter extends Voter { - public const CREATE = 'CHILL_MAIN_WORKFLOW_CREATE'; + final public const CREATE = 'CHILL_MAIN_WORKFLOW_CREATE'; - public const DELETE = 'CHILL_MAIN_WORKFLOW_DELETE'; + final public const DELETE = 'CHILL_MAIN_WORKFLOW_DELETE'; - public const SEE = 'CHILL_MAIN_WORKFLOW_SEE'; + final public const SEE = 'CHILL_MAIN_WORKFLOW_SEE'; - public const SHOW_ENTITY_LINK = 'CHILL_MAIN_WORKFLOW_LINK_SHOW'; + final public const SHOW_ENTITY_LINK = 'CHILL_MAIN_WORKFLOW_LINK_SHOW'; - public function __construct(private EntityWorkflowManager $manager, private Security $security) + public function __construct(private readonly EntityWorkflowManager $manager, private readonly Security $security) { } diff --git a/src/Bundle/ChillMainBundle/Security/Authorization/SavedExportVoter.php b/src/Bundle/ChillMainBundle/Security/Authorization/SavedExportVoter.php index 179cada57..32281f6dc 100644 --- a/src/Bundle/ChillMainBundle/Security/Authorization/SavedExportVoter.php +++ b/src/Bundle/ChillMainBundle/Security/Authorization/SavedExportVoter.php @@ -19,11 +19,11 @@ use function in_array; class SavedExportVoter extends Voter { - public const DELETE = 'CHLL_MAIN_EXPORT_SAVED_DELETE'; + final public const DELETE = 'CHLL_MAIN_EXPORT_SAVED_DELETE'; - public const EDIT = 'CHLL_MAIN_EXPORT_SAVED_EDIT'; + final public const EDIT = 'CHLL_MAIN_EXPORT_SAVED_EDIT'; - public const GENERATE = 'CHLL_MAIN_EXPORT_SAVED_GENERATE'; + final public const GENERATE = 'CHLL_MAIN_EXPORT_SAVED_GENERATE'; private const ALL = [ self::DELETE, diff --git a/src/Bundle/ChillMainBundle/Security/Authorization/WorkflowEntityDeletionVoter.php b/src/Bundle/ChillMainBundle/Security/Authorization/WorkflowEntityDeletionVoter.php index 23265306d..875288e90 100644 --- a/src/Bundle/ChillMainBundle/Security/Authorization/WorkflowEntityDeletionVoter.php +++ b/src/Bundle/ChillMainBundle/Security/Authorization/WorkflowEntityDeletionVoter.php @@ -24,7 +24,7 @@ class WorkflowEntityDeletionVoter extends Voter /** * @param \Chill\MainBundle\Workflow\EntityWorkflowHandlerInterface[] $handlers */ - public function __construct(private $handlers, private EntityWorkflowRepository $entityWorkflowRepository) + public function __construct(private $handlers, private readonly EntityWorkflowRepository $entityWorkflowRepository) { } diff --git a/src/Bundle/ChillMainBundle/Security/PasswordRecover/PasswordRecoverEvent.php b/src/Bundle/ChillMainBundle/Security/PasswordRecover/PasswordRecoverEvent.php index 5c8a01e1d..96ba1c74f 100644 --- a/src/Bundle/ChillMainBundle/Security/PasswordRecover/PasswordRecoverEvent.php +++ b/src/Bundle/ChillMainBundle/Security/PasswordRecover/PasswordRecoverEvent.php @@ -16,22 +16,21 @@ use Symfony\Component\EventDispatcher\Event; class PasswordRecoverEvent extends Event { - public const ASK_TOKEN_INVALID_FORM = 'chill_main.ask_token_invalid_form'; + final public const ASK_TOKEN_INVALID_FORM = 'chill_main.ask_token_invalid_form'; - public const ASK_TOKEN_SUCCESS = 'chill_main.ask_token_success'; + final public const ASK_TOKEN_SUCCESS = 'chill_main.ask_token_success'; - public const INVALID_TOKEN = 'chill_main.password_recover_invalid_token'; + final public const INVALID_TOKEN = 'chill_main.password_recover_invalid_token'; /** * @param bool $safelyGenerated true if generated safely (from console command, etc.) */ public function __construct( - private ?string $token = null, - private ?User $user = null, + private readonly ?string $token = null, + private readonly ?User $user = null, private $ip = null, - private bool $safelyGenerated = false, - ) - { + private readonly bool $safelyGenerated = false, + ) { } public function getIp() diff --git a/src/Bundle/ChillMainBundle/Security/PasswordRecover/PasswordRecoverLocker.php b/src/Bundle/ChillMainBundle/Security/PasswordRecover/PasswordRecoverLocker.php index 53be72874..1266453e7 100644 --- a/src/Bundle/ChillMainBundle/Security/PasswordRecover/PasswordRecoverLocker.php +++ b/src/Bundle/ChillMainBundle/Security/PasswordRecover/PasswordRecoverLocker.php @@ -18,28 +18,28 @@ use UnexpectedValueException; class PasswordRecoverLocker { - public const ASK_TOKEN_INVALID_FORM_TTL = 3600; + final public const ASK_TOKEN_INVALID_FORM_TTL = 3600; /** * TTL to keep invalid token recorded. */ - public const INVALID_TOKEN_TTL = 3600; + final public const INVALID_TOKEN_TTL = 3600; - public const MAX_ASK_TOKEN_BY_USER = 10; + final public const MAX_ASK_TOKEN_BY_USER = 10; - public const MAX_ASK_TOKEN_INVALID_FORM_BY_IP = 10; + final public const MAX_ASK_TOKEN_INVALID_FORM_BY_IP = 10; - public const MAX_ASK_TOKEN_INVALID_FORM_GLOBAL = 50; + final public const MAX_ASK_TOKEN_INVALID_FORM_GLOBAL = 50; /** * The maximum of invalid token by ip. */ - public const MAX_INVALID_TOKEN_BY_IP = 10; + final public const MAX_INVALID_TOKEN_BY_IP = 10; /** * The maximum of invalid token globally (across all ip). */ - public const MAX_INVALID_TOKEN_GLOBAL = 50; + final public const MAX_INVALID_TOKEN_GLOBAL = 50; /** * @var ChillRedis diff --git a/src/Bundle/ChillMainBundle/Security/PasswordRecover/PasswordRecoverVoter.php b/src/Bundle/ChillMainBundle/Security/PasswordRecover/PasswordRecoverVoter.php index 7ba724618..b2a17d2da 100644 --- a/src/Bundle/ChillMainBundle/Security/PasswordRecover/PasswordRecoverVoter.php +++ b/src/Bundle/ChillMainBundle/Security/PasswordRecover/PasswordRecoverVoter.php @@ -20,9 +20,9 @@ use function in_array; class PasswordRecoverVoter extends Voter { - public const ASK_TOKEN = 'CHILL_PASSWORD_ASK_TOKEN'; + final public const ASK_TOKEN = 'CHILL_PASSWORD_ASK_TOKEN'; - public const TRY_TOKEN = 'CHILL_PASSWORD_TRY_TOKEN'; + final public const TRY_TOKEN = 'CHILL_PASSWORD_TRY_TOKEN'; /** * @var PasswordRecoverLocker diff --git a/src/Bundle/ChillMainBundle/Security/PasswordRecover/RecoverPasswordHelper.php b/src/Bundle/ChillMainBundle/Security/PasswordRecover/RecoverPasswordHelper.php index 4598f6199..a8f8b4300 100644 --- a/src/Bundle/ChillMainBundle/Security/PasswordRecover/RecoverPasswordHelper.php +++ b/src/Bundle/ChillMainBundle/Security/PasswordRecover/RecoverPasswordHelper.php @@ -22,9 +22,9 @@ use function array_merge; class RecoverPasswordHelper { - public const RECOVER_PASSWORD_ROUTE = 'password_recover'; + final public const RECOVER_PASSWORD_ROUTE = 'password_recover'; - public function __construct(private TokenManager $tokenManager, private UrlGeneratorInterface $urlGenerator, private MailerInterface $mailer) + public function __construct(private readonly TokenManager $tokenManager, private readonly UrlGeneratorInterface $urlGenerator, private readonly MailerInterface $mailer) { } diff --git a/src/Bundle/ChillMainBundle/Security/PasswordRecover/TokenManager.php b/src/Bundle/ChillMainBundle/Security/PasswordRecover/TokenManager.php index 370c1c521..f442ae4a7 100644 --- a/src/Bundle/ChillMainBundle/Security/PasswordRecover/TokenManager.php +++ b/src/Bundle/ChillMainBundle/Security/PasswordRecover/TokenManager.php @@ -27,15 +27,15 @@ use function trim; class TokenManager { - public const HASH = 'h'; + final public const HASH = 'h'; - public const TIMESTAMP = 'ts'; + final public const TIMESTAMP = 'ts'; - public const TOKEN = 't'; + final public const TOKEN = 't'; - public const TOKEN_LENGTH = 24; + final public const TOKEN_LENGTH = 24; - public const USERNAME_CANONICAL = 'u'; + final public const USERNAME_CANONICAL = 'u'; /** * @var LoggerInterface @@ -72,7 +72,7 @@ class TokenManager public function verify($hash, $token, User $user, string $timestamp) { - $token = hex2bin(trim($token)); + $token = hex2bin(trim((string) $token)); if (strlen($token) !== self::TOKEN_LENGTH) { return false; diff --git a/src/Bundle/ChillMainBundle/Security/Resolver/CenterResolverDispatcher.php b/src/Bundle/ChillMainBundle/Security/Resolver/CenterResolverDispatcher.php index d01ba6665..9855477fd 100644 --- a/src/Bundle/ChillMainBundle/Security/Resolver/CenterResolverDispatcher.php +++ b/src/Bundle/ChillMainBundle/Security/Resolver/CenterResolverDispatcher.php @@ -11,7 +11,7 @@ declare(strict_types=1); namespace Chill\MainBundle\Security\Resolver; -final class CenterResolverDispatcher implements CenterResolverDispatcherInterface +final readonly class CenterResolverDispatcher implements CenterResolverDispatcherInterface { /** * @param \Chill\MainBundle\Security\Resolver\CenterResolverInterface[] $resolvers diff --git a/src/Bundle/ChillMainBundle/Security/Resolver/CenterResolverManager.php b/src/Bundle/ChillMainBundle/Security/Resolver/CenterResolverManager.php index 3ccdd3746..9c6dc841d 100644 --- a/src/Bundle/ChillMainBundle/Security/Resolver/CenterResolverManager.php +++ b/src/Bundle/ChillMainBundle/Security/Resolver/CenterResolverManager.php @@ -17,7 +17,7 @@ use UnexpectedValueException; use function get_class; use function is_array; -final class CenterResolverManager implements CenterResolverManagerInterface +final readonly class CenterResolverManager implements CenterResolverManagerInterface { /** * @param \Chill\MainBundle\Security\Resolver\CenterResolverInterface[] $resolvers diff --git a/src/Bundle/ChillMainBundle/Security/Resolver/ResolverTwigExtension.php b/src/Bundle/ChillMainBundle/Security/Resolver/ResolverTwigExtension.php index 299d8dd2b..c3c328bd2 100644 --- a/src/Bundle/ChillMainBundle/Security/Resolver/ResolverTwigExtension.php +++ b/src/Bundle/ChillMainBundle/Security/Resolver/ResolverTwigExtension.php @@ -15,16 +15,16 @@ use Twig\TwigFilter; final class ResolverTwigExtension extends \Twig\Extension\AbstractExtension { - public function __construct(private CenterResolverManagerInterface $centerResolverDispatcher, private ScopeResolverDispatcher $scopeResolverDispatcher) + public function __construct(private readonly CenterResolverManagerInterface $centerResolverDispatcher, private readonly ScopeResolverDispatcher $scopeResolverDispatcher) { } public function getFilters() { return [ - new TwigFilter('chill_resolve_center', [$this, 'resolveCenter']), - new TwigFilter('chill_resolve_scope', [$this, 'resolveScope']), - new TwigFilter('chill_is_scope_concerned', [$this, 'isScopeConcerned']), + new TwigFilter('chill_resolve_center', $this->resolveCenter(...)), + new TwigFilter('chill_resolve_scope', $this->resolveScope(...)), + new TwigFilter('chill_is_scope_concerned', $this->isScopeConcerned(...)), ]; } diff --git a/src/Bundle/ChillMainBundle/Security/Resolver/ScopeResolverDispatcher.php b/src/Bundle/ChillMainBundle/Security/Resolver/ScopeResolverDispatcher.php index 151754ae7..e8207406a 100644 --- a/src/Bundle/ChillMainBundle/Security/Resolver/ScopeResolverDispatcher.php +++ b/src/Bundle/ChillMainBundle/Security/Resolver/ScopeResolverDispatcher.php @@ -14,7 +14,7 @@ namespace Chill\MainBundle\Security\Resolver; use Chill\MainBundle\Entity\Scope; use Doctrine\Common\Collections\Collection; -final class ScopeResolverDispatcher +final readonly class ScopeResolverDispatcher { /** * @param \Chill\MainBundle\Security\Resolver\ScopeResolverInterface[] $resolvers diff --git a/src/Bundle/ChillMainBundle/Serializer/Model/Collection.php b/src/Bundle/ChillMainBundle/Serializer/Model/Collection.php index 4f6248621..9d80eabe9 100644 --- a/src/Bundle/ChillMainBundle/Serializer/Model/Collection.php +++ b/src/Bundle/ChillMainBundle/Serializer/Model/Collection.php @@ -15,7 +15,7 @@ use Chill\MainBundle\Pagination\PaginatorInterface; class Collection { - public function __construct(private $items, private PaginatorInterface $paginator) + public function __construct(private $items, private readonly PaginatorInterface $paginator) { } diff --git a/src/Bundle/ChillMainBundle/Serializer/Normalizer/AddressNormalizer.php b/src/Bundle/ChillMainBundle/Serializer/Normalizer/AddressNormalizer.php index 5e6c8cc05..ac3304767 100644 --- a/src/Bundle/ChillMainBundle/Serializer/Normalizer/AddressNormalizer.php +++ b/src/Bundle/ChillMainBundle/Serializer/Normalizer/AddressNormalizer.php @@ -48,7 +48,7 @@ class AddressNormalizer implements ContextAwareNormalizerInterface, NormalizerAw 'confidential', ]; - public function __construct(private AddressRender $addressRender) + public function __construct(private readonly AddressRender $addressRender) { } diff --git a/src/Bundle/ChillMainBundle/Serializer/Normalizer/CenterNormalizer.php b/src/Bundle/ChillMainBundle/Serializer/Normalizer/CenterNormalizer.php index cfb53e1a1..6a4355a08 100644 --- a/src/Bundle/ChillMainBundle/Serializer/Normalizer/CenterNormalizer.php +++ b/src/Bundle/ChillMainBundle/Serializer/Normalizer/CenterNormalizer.php @@ -22,7 +22,7 @@ use function array_key_exists; class CenterNormalizer implements DenormalizerInterface, NormalizerInterface { - public function __construct(private CenterRepository $repository) + public function __construct(private readonly CenterRepository $repository) { } diff --git a/src/Bundle/ChillMainBundle/Serializer/Normalizer/CommentEmbeddableDocGenNormalizer.php b/src/Bundle/ChillMainBundle/Serializer/Normalizer/CommentEmbeddableDocGenNormalizer.php index 10c865608..ba29093ce 100644 --- a/src/Bundle/ChillMainBundle/Serializer/Normalizer/CommentEmbeddableDocGenNormalizer.php +++ b/src/Bundle/ChillMainBundle/Serializer/Normalizer/CommentEmbeddableDocGenNormalizer.php @@ -25,7 +25,7 @@ class CommentEmbeddableDocGenNormalizer implements ContextAwareNormalizerInterfa { use NormalizerAwareTrait; - public function __construct(private UserRepository $userRepository) + public function __construct(private readonly UserRepository $userRepository) { } diff --git a/src/Bundle/ChillMainBundle/Serializer/Normalizer/DateNormalizer.php b/src/Bundle/ChillMainBundle/Serializer/Normalizer/DateNormalizer.php index c5032a7b9..cbd12e15f 100644 --- a/src/Bundle/ChillMainBundle/Serializer/Normalizer/DateNormalizer.php +++ b/src/Bundle/ChillMainBundle/Serializer/Normalizer/DateNormalizer.php @@ -26,7 +26,7 @@ use function is_array; class DateNormalizer implements ContextAwareNormalizerInterface, DenormalizerInterface { - public function __construct(private RequestStack $requestStack, private ParameterBagInterface $parameterBag) + public function __construct(private readonly RequestStack $requestStack, private readonly ParameterBagInterface $parameterBag) { } diff --git a/src/Bundle/ChillMainBundle/Serializer/Normalizer/DiscriminatedObjectDenormalizer.php b/src/Bundle/ChillMainBundle/Serializer/Normalizer/DiscriminatedObjectDenormalizer.php index da2b63faa..58dc7e839 100644 --- a/src/Bundle/ChillMainBundle/Serializer/Normalizer/DiscriminatedObjectDenormalizer.php +++ b/src/Bundle/ChillMainBundle/Serializer/Normalizer/DiscriminatedObjectDenormalizer.php @@ -32,12 +32,12 @@ class DiscriminatedObjectDenormalizer implements ContextAwareDenormalizerInterfa * Should be present in context and contains an array of * allowed types. */ - public const ALLOWED_TYPES = 'denormalize_multi.allowed_types'; + final public const ALLOWED_TYPES = 'denormalize_multi.allowed_types'; /** * The type to set for enabling this type. */ - public const TYPE = '@multi'; + final public const TYPE = '@multi'; public function denormalize($data, $type, $format = null, array $context = []) { diff --git a/src/Bundle/ChillMainBundle/Serializer/Normalizer/DoctrineExistingEntityNormalizer.php b/src/Bundle/ChillMainBundle/Serializer/Normalizer/DoctrineExistingEntityNormalizer.php index 94c5d400e..9c9081ae9 100644 --- a/src/Bundle/ChillMainBundle/Serializer/Normalizer/DoctrineExistingEntityNormalizer.php +++ b/src/Bundle/ChillMainBundle/Serializer/Normalizer/DoctrineExistingEntityNormalizer.php @@ -23,7 +23,7 @@ use function is_array; class DoctrineExistingEntityNormalizer implements DenormalizerInterface { - public function __construct(private EntityManagerInterface $em, private ClassMetadataFactoryInterface $serializerMetadataFactory) + public function __construct(private readonly EntityManagerInterface $em, private readonly ClassMetadataFactoryInterface $serializerMetadataFactory) { } diff --git a/src/Bundle/ChillMainBundle/Serializer/Normalizer/EntityWorkflowNormalizer.php b/src/Bundle/ChillMainBundle/Serializer/Normalizer/EntityWorkflowNormalizer.php index 16553ab29..83e84f7a0 100644 --- a/src/Bundle/ChillMainBundle/Serializer/Normalizer/EntityWorkflowNormalizer.php +++ b/src/Bundle/ChillMainBundle/Serializer/Normalizer/EntityWorkflowNormalizer.php @@ -23,7 +23,7 @@ class EntityWorkflowNormalizer implements NormalizerInterface, NormalizerAwareIn { use NormalizerAwareTrait; - public function __construct(private EntityWorkflowManager $entityWorkflowManager, private MetadataExtractor $metadataExtractor, private Registry $registry) + public function __construct(private readonly EntityWorkflowManager $entityWorkflowManager, private readonly MetadataExtractor $metadataExtractor, private readonly Registry $registry) { } diff --git a/src/Bundle/ChillMainBundle/Serializer/Normalizer/EntityWorkflowStepNormalizer.php b/src/Bundle/ChillMainBundle/Serializer/Normalizer/EntityWorkflowStepNormalizer.php index 874faf9c9..46dbd00cc 100644 --- a/src/Bundle/ChillMainBundle/Serializer/Normalizer/EntityWorkflowStepNormalizer.php +++ b/src/Bundle/ChillMainBundle/Serializer/Normalizer/EntityWorkflowStepNormalizer.php @@ -21,7 +21,7 @@ class EntityWorkflowStepNormalizer implements NormalizerAwareInterface, Normaliz { use NormalizerAwareTrait; - public function __construct(private MetadataExtractor $metadataExtractor) + public function __construct(private readonly MetadataExtractor $metadataExtractor) { } diff --git a/src/Bundle/ChillMainBundle/Serializer/Normalizer/NotificationNormalizer.php b/src/Bundle/ChillMainBundle/Serializer/Normalizer/NotificationNormalizer.php index 98101a86d..241cd83a9 100644 --- a/src/Bundle/ChillMainBundle/Serializer/Normalizer/NotificationNormalizer.php +++ b/src/Bundle/ChillMainBundle/Serializer/Normalizer/NotificationNormalizer.php @@ -24,7 +24,7 @@ class NotificationNormalizer implements NormalizerAwareInterface, NormalizerInte { use NormalizerAwareTrait; - public function __construct(private NotificationHandlerManager $notificationHandlerManager, private EntityManagerInterface $entityManager, private Security $security) + public function __construct(private readonly NotificationHandlerManager $notificationHandlerManager, private readonly EntityManagerInterface $entityManager, private readonly Security $security) { } diff --git a/src/Bundle/ChillMainBundle/Serializer/Normalizer/PhonenumberNormalizer.php b/src/Bundle/ChillMainBundle/Serializer/Normalizer/PhonenumberNormalizer.php index 349f2dace..ec6e3d5e6 100644 --- a/src/Bundle/ChillMainBundle/Serializer/Normalizer/PhonenumberNormalizer.php +++ b/src/Bundle/ChillMainBundle/Serializer/Normalizer/PhonenumberNormalizer.php @@ -21,9 +21,9 @@ use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; class PhonenumberNormalizer implements ContextAwareNormalizerInterface, DenormalizerInterface { - private string $defaultCarrierCode; + private readonly string $defaultCarrierCode; - private PhoneNumberUtil $phoneNumberUtil; + private readonly PhoneNumberUtil $phoneNumberUtil; public function __construct(ParameterBagInterface $parameterBag) { diff --git a/src/Bundle/ChillMainBundle/Serializer/Normalizer/PrivateCommentEmbeddableNormalizer.php b/src/Bundle/ChillMainBundle/Serializer/Normalizer/PrivateCommentEmbeddableNormalizer.php index 6a98bc428..1d7ee43ce 100644 --- a/src/Bundle/ChillMainBundle/Serializer/Normalizer/PrivateCommentEmbeddableNormalizer.php +++ b/src/Bundle/ChillMainBundle/Serializer/Normalizer/PrivateCommentEmbeddableNormalizer.php @@ -18,7 +18,7 @@ use Symfony\Component\Serializer\Normalizer\NormalizerInterface; class PrivateCommentEmbeddableNormalizer implements NormalizerInterface, DenormalizerInterface { - public function __construct(private Security $security) + public function __construct(private readonly Security $security) { } diff --git a/src/Bundle/ChillMainBundle/Serializer/Normalizer/UserNormalizer.php b/src/Bundle/ChillMainBundle/Serializer/Normalizer/UserNormalizer.php index 5f68454fd..5211ff505 100644 --- a/src/Bundle/ChillMainBundle/Serializer/Normalizer/UserNormalizer.php +++ b/src/Bundle/ChillMainBundle/Serializer/Normalizer/UserNormalizer.php @@ -26,7 +26,7 @@ class UserNormalizer implements ContextAwareNormalizerInterface, NormalizerAware { use NormalizerAwareTrait; - public const NULL_USER = [ + final public const NULL_USER = [ 'type' => 'user', 'id' => '', 'username' => '', @@ -36,7 +36,7 @@ class UserNormalizer implements ContextAwareNormalizerInterface, NormalizerAware 'email' => '', ]; - public function __construct(private UserRender $userRender) + public function __construct(private readonly UserRender $userRender) { } @@ -65,14 +65,7 @@ class UserNormalizer implements ContextAwareNormalizerInterface, NormalizerAware ); if (null === $object && 'docgen' === $format) { - return array_merge(self::NULL_USER, [ - 'civility' => $this->normalizer->normalize(null, $format, $civilityContext), - 'user_job' => $this->normalizer->normalize(null, $format, $userJobContext), - 'main_center' => $this->normalizer->normalize(null, $format, $centerContext), - 'main_scope' => $this->normalizer->normalize(null, $format, $scopeContext), - 'current_location' => $this->normalizer->normalize(null, $format, $locationContext), - 'main_location' => $this->normalizer->normalize(null, $format, $locationContext), - ]); + return [...self::NULL_USER, 'civility' => $this->normalizer->normalize(null, $format, $civilityContext), 'user_job' => $this->normalizer->normalize(null, $format, $userJobContext), 'main_center' => $this->normalizer->normalize(null, $format, $centerContext), 'main_scope' => $this->normalizer->normalize(null, $format, $scopeContext), 'current_location' => $this->normalizer->normalize(null, $format, $locationContext), 'main_location' => $this->normalizer->normalize(null, $format, $locationContext)]; } $data = [ diff --git a/src/Bundle/ChillMainBundle/Service/AddressGeographicalUnit/RefreshAddressToGeographicalUnitMaterializedViewCronJob.php b/src/Bundle/ChillMainBundle/Service/AddressGeographicalUnit/RefreshAddressToGeographicalUnitMaterializedViewCronJob.php index b64891695..d17d02f54 100644 --- a/src/Bundle/ChillMainBundle/Service/AddressGeographicalUnit/RefreshAddressToGeographicalUnitMaterializedViewCronJob.php +++ b/src/Bundle/ChillMainBundle/Service/AddressGeographicalUnit/RefreshAddressToGeographicalUnitMaterializedViewCronJob.php @@ -20,7 +20,7 @@ use UnexpectedValueException; class RefreshAddressToGeographicalUnitMaterializedViewCronJob implements CronJobInterface { - public function __construct(private Connection $connection) + public function __construct(private readonly Connection $connection) { } diff --git a/src/Bundle/ChillMainBundle/Service/Import/AddressReferenceBEFromBestAddress.php b/src/Bundle/ChillMainBundle/Service/Import/AddressReferenceBEFromBestAddress.php index 09bc5e3f8..fce6116a8 100644 --- a/src/Bundle/ChillMainBundle/Service/Import/AddressReferenceBEFromBestAddress.php +++ b/src/Bundle/ChillMainBundle/Service/Import/AddressReferenceBEFromBestAddress.php @@ -22,7 +22,7 @@ class AddressReferenceBEFromBestAddress { private const RELEASE = 'https://gitea.champs-libres.be/api/v1/repos/Chill-project/belgian-bestaddresses-transform/releases/tags/v1.0.0'; - public function __construct(private HttpClientInterface $client, private AddressReferenceBaseImporter $baseImporter, private AddressToReferenceMatcher $addressToReferenceMatcher) + public function __construct(private readonly HttpClientInterface $client, private readonly AddressReferenceBaseImporter $baseImporter, private readonly AddressToReferenceMatcher $addressToReferenceMatcher) { } diff --git a/src/Bundle/ChillMainBundle/Service/Import/AddressReferenceBaseImporter.php b/src/Bundle/ChillMainBundle/Service/Import/AddressReferenceBaseImporter.php index 9c8f2f705..68f6287e6 100644 --- a/src/Bundle/ChillMainBundle/Service/Import/AddressReferenceBaseImporter.php +++ b/src/Bundle/ChillMainBundle/Service/Import/AddressReferenceBaseImporter.php @@ -50,7 +50,7 @@ final class AddressReferenceBaseImporter private array $waitingForInsert = []; - public function __construct(private Connection $defaultConnection, private LoggerInterface $logger) + public function __construct(private readonly Connection $defaultConnection, private readonly LoggerInterface $logger) { } diff --git a/src/Bundle/ChillMainBundle/Service/Import/AddressReferenceFromBano.php b/src/Bundle/ChillMainBundle/Service/Import/AddressReferenceFromBano.php index 657463dc7..a908bc31e 100644 --- a/src/Bundle/ChillMainBundle/Service/Import/AddressReferenceFromBano.php +++ b/src/Bundle/ChillMainBundle/Service/Import/AddressReferenceFromBano.php @@ -20,7 +20,7 @@ use function is_int; class AddressReferenceFromBano { - public function __construct(private HttpClientInterface $client, private AddressReferenceBaseImporter $baseImporter, private AddressToReferenceMatcher $addressToReferenceMatcher) + public function __construct(private readonly HttpClientInterface $client, private readonly AddressReferenceBaseImporter $baseImporter, private readonly AddressToReferenceMatcher $addressToReferenceMatcher) { } diff --git a/src/Bundle/ChillMainBundle/Service/Import/AddressToReferenceMatcher.php b/src/Bundle/ChillMainBundle/Service/Import/AddressToReferenceMatcher.php index bf9b57a1a..67ad25fbb 100644 --- a/src/Bundle/ChillMainBundle/Service/Import/AddressToReferenceMatcher.php +++ b/src/Bundle/ChillMainBundle/Service/Import/AddressToReferenceMatcher.php @@ -19,7 +19,7 @@ use Psr\Log\LoggerInterface; * Mark existing addresses as to be reviewed regarding the * address reference */ -final class AddressToReferenceMatcher +final readonly class AddressToReferenceMatcher { private const LOG_PREFIX = '[address_to_reference_matcher] '; diff --git a/src/Bundle/ChillMainBundle/Service/Import/GeographicalUnitBaseImporter.php b/src/Bundle/ChillMainBundle/Service/Import/GeographicalUnitBaseImporter.php index c8a229cd7..ec3203de2 100644 --- a/src/Bundle/ChillMainBundle/Service/Import/GeographicalUnitBaseImporter.php +++ b/src/Bundle/ChillMainBundle/Service/Import/GeographicalUnitBaseImporter.php @@ -47,7 +47,7 @@ final class GeographicalUnitBaseImporter private array $waitingForInsert = []; - public function __construct(private Connection $defaultConnection, private LoggerInterface $logger) + public function __construct(private readonly Connection $defaultConnection, private readonly LoggerInterface $logger) { } diff --git a/src/Bundle/ChillMainBundle/Service/Import/PostalCodeBEFromBestAddress.php b/src/Bundle/ChillMainBundle/Service/Import/PostalCodeBEFromBestAddress.php index 41672e421..b1b5563ec 100644 --- a/src/Bundle/ChillMainBundle/Service/Import/PostalCodeBEFromBestAddress.php +++ b/src/Bundle/ChillMainBundle/Service/Import/PostalCodeBEFromBestAddress.php @@ -21,7 +21,7 @@ class PostalCodeBEFromBestAddress { private const RELEASE = 'https://gitea.champs-libres.be/api/v1/repos/Chill-project/belgian-bestaddresses-transform/releases/tags/v1.0.0'; - public function __construct(private PostalCodeBaseImporter $baseImporter, private HttpClientInterface $client, private LoggerInterface $logger) + public function __construct(private readonly PostalCodeBaseImporter $baseImporter, private readonly HttpClientInterface $client, private readonly LoggerInterface $logger) { } @@ -82,8 +82,8 @@ class PostalCodeBEFromBestAddress { $this->baseImporter->importCode( 'BE', - trim($record['municipality_name']), - trim($record['postal_info_objectid']), + trim((string) $record['municipality_name']), + trim((string) $record['postal_info_objectid']), $record['municipality_objectid'], 'bestaddress', (float) $record['Y'], diff --git a/src/Bundle/ChillMainBundle/Service/Import/PostalCodeBaseImporter.php b/src/Bundle/ChillMainBundle/Service/Import/PostalCodeBaseImporter.php index 8b5e6d4e1..86f00193a 100644 --- a/src/Bundle/ChillMainBundle/Service/Import/PostalCodeBaseImporter.php +++ b/src/Bundle/ChillMainBundle/Service/Import/PostalCodeBaseImporter.php @@ -57,7 +57,7 @@ class PostalCodeBaseImporter private array $waitingForInsert = []; - public function __construct(private Connection $defaultConnection) + public function __construct(private readonly Connection $defaultConnection) { } diff --git a/src/Bundle/ChillMainBundle/Service/Import/PostalCodeFRFromOpenData.php b/src/Bundle/ChillMainBundle/Service/Import/PostalCodeFRFromOpenData.php index 23687d558..3eb178b01 100644 --- a/src/Bundle/ChillMainBundle/Service/Import/PostalCodeFRFromOpenData.php +++ b/src/Bundle/ChillMainBundle/Service/Import/PostalCodeFRFromOpenData.php @@ -26,7 +26,7 @@ class PostalCodeFRFromOpenData { private const CSV = 'https://datanova.legroupe.laposte.fr/explore/dataset/laposte_hexasmal/download/?format=csv&timezone=Europe/Berlin&lang=fr&use_labels_for_header=true&csv_separator=%3B'; - public function __construct(private PostalCodeBaseImporter $baseImporter, private HttpClientInterface $client, private LoggerInterface $logger) + public function __construct(private readonly PostalCodeBaseImporter $baseImporter, private readonly HttpClientInterface $client, private readonly LoggerInterface $logger) { } @@ -72,17 +72,17 @@ class PostalCodeFRFromOpenData $lat = $lon = 0.0; } - $ref = trim($record['Code_commune_INSEE']); + $ref = trim((string) $record['Code_commune_INSEE']); if (str_starts_with($ref, '987')) { // some differences in French Polynesia - $ref .= '.' . trim($record['Libellé_d_acheminement']); + $ref .= '.' . trim((string) $record['Libellé_d_acheminement']); } $this->baseImporter->importCode( 'FR', - trim($record['Libellé_d_acheminement']), - trim($record['Code_postal']), + trim((string) $record['Libellé_d_acheminement']), + trim((string) $record['Code_postal']), $ref, 'INSEE', $lat, diff --git a/src/Bundle/ChillMainBundle/Service/Mailer/ChillMailer.php b/src/Bundle/ChillMainBundle/Service/Mailer/ChillMailer.php index 6474ccf9c..b9b2f026d 100644 --- a/src/Bundle/ChillMainBundle/Service/Mailer/ChillMailer.php +++ b/src/Bundle/ChillMainBundle/Service/Mailer/ChillMailer.php @@ -22,7 +22,7 @@ class ChillMailer implements MailerInterface { private string $prefix = '[Chill] '; - public function __construct(private MailerInterface $initial, private LoggerInterface $chillLogger) + public function __construct(private readonly MailerInterface $initial, private readonly LoggerInterface $chillLogger) { } diff --git a/src/Bundle/ChillMainBundle/Service/RollingDate/RollingDate.php b/src/Bundle/ChillMainBundle/Service/RollingDate/RollingDate.php index 32aa7030a..cc02dc822 100644 --- a/src/Bundle/ChillMainBundle/Service/RollingDate/RollingDate.php +++ b/src/Bundle/ChillMainBundle/Service/RollingDate/RollingDate.php @@ -15,7 +15,7 @@ use DateTimeImmutable; class RollingDate { - public const ALL_T = [ + final public const ALL_T = [ self::T_YEAR_PREVIOUS_START, self::T_QUARTER_PREVIOUS_START, self::T_MONTH_PREVIOUS_START, @@ -35,47 +35,41 @@ class RollingDate /** * A given fixed date. */ - public const T_FIXED_DATE = 'fixed_date'; + final public const T_FIXED_DATE = 'fixed_date'; - public const T_MONTH_CURRENT_START = 'month_current_start'; + final public const T_MONTH_CURRENT_START = 'month_current_start'; - public const T_MONTH_NEXT_START = 'month_next_start'; + final public const T_MONTH_NEXT_START = 'month_next_start'; - public const T_MONTH_PREVIOUS_START = 'month_previous_start'; + final public const T_MONTH_PREVIOUS_START = 'month_previous_start'; - public const T_QUARTER_CURRENT_START = 'quarter_current_start'; + final public const T_QUARTER_CURRENT_START = 'quarter_current_start'; - public const T_QUARTER_NEXT_START = 'quarter_next_start'; + final public const T_QUARTER_NEXT_START = 'quarter_next_start'; - public const T_QUARTER_PREVIOUS_START = 'quarter_previous_start'; + final public const T_QUARTER_PREVIOUS_START = 'quarter_previous_start'; - public const T_TODAY = 'today'; + final public const T_TODAY = 'today'; - public const T_WEEK_CURRENT_START = 'week_current_start'; + final public const T_WEEK_CURRENT_START = 'week_current_start'; - public const T_WEEK_NEXT_START = 'week_next_start'; + final public const T_WEEK_NEXT_START = 'week_next_start'; - public const T_WEEK_PREVIOUS_START = 'week_previous_start'; + final public const T_WEEK_PREVIOUS_START = 'week_previous_start'; - public const T_YEAR_CURRENT_START = 'year_current_start'; + final public const T_YEAR_CURRENT_START = 'year_current_start'; - public const T_YEAR_NEXT_START = 'year_next_start'; + final public const T_YEAR_NEXT_START = 'year_next_start'; - public const T_YEAR_PREVIOUS_START = 'year_previous_start'; + final public const T_YEAR_PREVIOUS_START = 'year_previous_start'; /** - * The pivot date is the date from the rolling is computed. By default, it is "now". - */ - private DateTimeImmutable $pivotDate; - - /** - * @param string|self::T_* $roll - * @param DateTimeImmutable|null $pivotDate Will be "now" if null is given + * @param string $roll * @param DateTimeImmutable|null $fixedDate Only to insert if $roll equals @see{self::T_FIXED_DATE} + * @param DateTimeImmutable $pivotDate Will be "now" if null is given */ - public function __construct(private string $roll, private ?\DateTimeImmutable $fixedDate = null, ?DateTimeImmutable $pivotDate = null) + public function __construct(private readonly string $roll, private readonly ?DateTimeImmutable $fixedDate = null, private readonly DateTimeImmutable $pivotDate = new DateTimeImmutable('now')) { - $this->pivotDate = $pivotDate ?? new DateTimeImmutable('now'); } public function getFixedDate(): ?DateTimeImmutable diff --git a/src/Bundle/ChillMainBundle/Service/ShortMessage/ShortMessage.php b/src/Bundle/ChillMainBundle/Service/ShortMessage/ShortMessage.php index 2a86ddab4..e028cf3c4 100644 --- a/src/Bundle/ChillMainBundle/Service/ShortMessage/ShortMessage.php +++ b/src/Bundle/ChillMainBundle/Service/ShortMessage/ShortMessage.php @@ -22,9 +22,9 @@ use libphonenumber\PhoneNumber; class ShortMessage { - public const PRIORITY_LOW = 'low'; + final public const PRIORITY_LOW = 'low'; - public const PRIORITY_MEDIUM = 'medium'; + final public const PRIORITY_MEDIUM = 'medium'; public function __construct(private string $content, private PhoneNumber $phoneNumber, private string $priority = 'low') { diff --git a/src/Bundle/ChillMainBundle/Service/ShortMessage/ShortMessageHandler.php b/src/Bundle/ChillMainBundle/Service/ShortMessage/ShortMessageHandler.php index 6f8b5427d..55490b2eb 100644 --- a/src/Bundle/ChillMainBundle/Service/ShortMessage/ShortMessageHandler.php +++ b/src/Bundle/ChillMainBundle/Service/ShortMessage/ShortMessageHandler.php @@ -25,7 +25,7 @@ use Symfony\Component\Messenger\Handler\MessageHandlerInterface; */ class ShortMessageHandler implements MessageHandlerInterface { - public function __construct(private ShortMessageTransporterInterface $messageTransporter) + public function __construct(private readonly ShortMessageTransporterInterface $messageTransporter) { } diff --git a/src/Bundle/ChillMainBundle/Service/ShortMessage/ShortMessageTransporter.php b/src/Bundle/ChillMainBundle/Service/ShortMessage/ShortMessageTransporter.php index 5dfbc9fc0..76e45acbd 100644 --- a/src/Bundle/ChillMainBundle/Service/ShortMessage/ShortMessageTransporter.php +++ b/src/Bundle/ChillMainBundle/Service/ShortMessage/ShortMessageTransporter.php @@ -20,7 +20,7 @@ namespace Chill\MainBundle\Service\ShortMessage; class ShortMessageTransporter implements ShortMessageTransporterInterface { - public function __construct(private ShortMessageSenderInterface $sender) + public function __construct(private readonly ShortMessageSenderInterface $sender) { } diff --git a/src/Bundle/ChillMainBundle/Service/ShortMessageOvh/OvhShortMessageSender.php b/src/Bundle/ChillMainBundle/Service/ShortMessageOvh/OvhShortMessageSender.php index 72ef53b85..bf43d76d4 100644 --- a/src/Bundle/ChillMainBundle/Service/ShortMessageOvh/OvhShortMessageSender.php +++ b/src/Bundle/ChillMainBundle/Service/ShortMessageOvh/OvhShortMessageSender.php @@ -28,14 +28,14 @@ use Psr\Log\LoggerInterface; class OvhShortMessageSender implements ShortMessageSenderInterface { public function __construct( - private Api $api, + private readonly Api $api, // for DI, must remains as first argument - private string $serviceName, + private readonly string $serviceName, // for di, must remains as second argument - private string $sender, + private readonly string $sender, // for DI, must remains as third argument - private LoggerInterface $logger, - private PhoneNumberUtil $phoneNumberUtil + private readonly LoggerInterface $logger, + private readonly PhoneNumberUtil $phoneNumberUtil ) { } diff --git a/src/Bundle/ChillMainBundle/Templating/CSVCellTwig.php b/src/Bundle/ChillMainBundle/Templating/CSVCellTwig.php index f5f91c361..7aaa33c7c 100644 --- a/src/Bundle/ChillMainBundle/Templating/CSVCellTwig.php +++ b/src/Bundle/ChillMainBundle/Templating/CSVCellTwig.php @@ -46,7 +46,7 @@ class CSVCellTwig extends AbstractExtension return [ new TwigFilter( 'csv_cell', - [$this, 'csvCellFilter'], + $this->csvCellFilter(...), ['is_safe' => ['html']] ), ]; diff --git a/src/Bundle/ChillMainBundle/Templating/ChillMarkdownRenderExtension.php b/src/Bundle/ChillMainBundle/Templating/ChillMarkdownRenderExtension.php index d277c0f41..690188704 100644 --- a/src/Bundle/ChillMainBundle/Templating/ChillMarkdownRenderExtension.php +++ b/src/Bundle/ChillMainBundle/Templating/ChillMarkdownRenderExtension.php @@ -34,7 +34,7 @@ final class ChillMarkdownRenderExtension extends AbstractExtension public function getFilters(): array { return [ - new TwigFilter('chill_markdown_to_html', [$this, 'renderMarkdownToHtml'], [ + new TwigFilter('chill_markdown_to_html', $this->renderMarkdownToHtml(...), [ 'is_safe' => ['html'], ]), ]; diff --git a/src/Bundle/ChillMainBundle/Templating/ChillTwigHelper.php b/src/Bundle/ChillMainBundle/Templating/ChillTwigHelper.php index 95b307ed7..56a729071 100644 --- a/src/Bundle/ChillMainBundle/Templating/ChillTwigHelper.php +++ b/src/Bundle/ChillMainBundle/Templating/ChillTwigHelper.php @@ -23,7 +23,7 @@ class ChillTwigHelper extends AbstractExtension public function getFilters() { return [ - new TwigFilter('chill_print_or_message', [$this, 'printOrMessage'], [ + new TwigFilter('chill_print_or_message', $this->printOrMessage(...), [ 'needs_environment' => true, 'is_safe' => ['html', 'html_attrs'], ]), diff --git a/src/Bundle/ChillMainBundle/Templating/ChillTwigRoutingHelper.php b/src/Bundle/ChillMainBundle/Templating/ChillTwigRoutingHelper.php index a01398210..1e55a8d74 100644 --- a/src/Bundle/ChillMainBundle/Templating/ChillTwigRoutingHelper.php +++ b/src/Bundle/ChillMainBundle/Templating/ChillTwigRoutingHelper.php @@ -46,16 +46,16 @@ class ChillTwigRoutingHelper extends AbstractExtension public function getFilters() { return [ - new TwigFilter('chill_return_path_label', [$this, 'getLabelReturnPath']), + new TwigFilter('chill_return_path_label', $this->getLabelReturnPath(...)), ]; } public function getFunctions() { return [ - new TwigFunction('chill_return_path_or', [$this, 'getReturnPathOr'], ['is_safe_callback' => [$this, 'isUrlGenerationSafe']]), - new TwigFunction('chill_path_add_return_path', [$this, 'getPathAddReturnPath'], ['is_safe_callback' => [$this, 'isUrlGenerationSafe']]), - new TwigFunction('chill_path_forward_return_path', [$this, 'getPathForwardReturnPath'], ['is_safe_callback' => [$this, 'isUrlGenerationSafe']]), + new TwigFunction('chill_return_path_or', $this->getReturnPathOr(...), ['is_safe_callback' => $this->isUrlGenerationSafe(...)]), + new TwigFunction('chill_path_add_return_path', $this->getPathAddReturnPath(...), ['is_safe_callback' => $this->isUrlGenerationSafe(...)]), + new TwigFunction('chill_path_forward_return_path', $this->getPathForwardReturnPath(...), ['is_safe_callback' => $this->isUrlGenerationSafe(...)]), ]; } diff --git a/src/Bundle/ChillMainBundle/Templating/Entity/AddressRender.php b/src/Bundle/ChillMainBundle/Templating/Entity/AddressRender.php index 668f7875a..c952bb5aa 100644 --- a/src/Bundle/ChillMainBundle/Templating/Entity/AddressRender.php +++ b/src/Bundle/ChillMainBundle/Templating/Entity/AddressRender.php @@ -25,7 +25,7 @@ use function strtr; */ class AddressRender implements ChillEntityRenderInterface { - public const DEFAULT_OPTIONS = [ + final public const DEFAULT_OPTIONS = [ 'with_valid_from' => false, 'with_valid_to' => false, 'with_picto' => false, @@ -36,7 +36,7 @@ class AddressRender implements ChillEntityRenderInterface 'extended_infos' => false, ]; - public function __construct(private EngineInterface $templating, private TranslatableStringHelperInterface $translatableStringHelper) + public function __construct(private readonly EngineInterface $templating, private readonly TranslatableStringHelperInterface $translatableStringHelper) { } diff --git a/src/Bundle/ChillMainBundle/Templating/Entity/ChillEntityRenderExtension.php b/src/Bundle/ChillMainBundle/Templating/Entity/ChillEntityRenderExtension.php index 967b3ca78..2a1c91fa2 100644 --- a/src/Bundle/ChillMainBundle/Templating/Entity/ChillEntityRenderExtension.php +++ b/src/Bundle/ChillMainBundle/Templating/Entity/ChillEntityRenderExtension.php @@ -44,10 +44,10 @@ class ChillEntityRenderExtension extends AbstractExtension public function getFilters() { return [ - new TwigFilter('chill_entity_render_string', [$this, 'renderString'], [ + new TwigFilter('chill_entity_render_string', $this->renderString(...), [ 'is_safe' => ['html'], ]), - new TwigFilter('chill_entity_render_box', [$this, 'renderBox'], [ + new TwigFilter('chill_entity_render_box', $this->renderBox(...), [ 'is_safe' => ['html'], ]), ]; diff --git a/src/Bundle/ChillMainBundle/Templating/Entity/CommentRender.php b/src/Bundle/ChillMainBundle/Templating/Entity/CommentRender.php index 464415848..ff8ea0dc3 100644 --- a/src/Bundle/ChillMainBundle/Templating/Entity/CommentRender.php +++ b/src/Bundle/ChillMainBundle/Templating/Entity/CommentRender.php @@ -25,7 +25,7 @@ class CommentRender implements ChillEntityRenderInterface { use BoxUtilsChillEntityRenderTrait; - public function __construct(private UserRepositoryInterface $userRepository, private EngineInterface $engine) + public function __construct(private readonly UserRepositoryInterface $userRepository, private readonly EngineInterface $engine) { } diff --git a/src/Bundle/ChillMainBundle/Templating/Entity/UserRender.php b/src/Bundle/ChillMainBundle/Templating/Entity/UserRender.php index e34440491..880ee8587 100644 --- a/src/Bundle/ChillMainBundle/Templating/Entity/UserRender.php +++ b/src/Bundle/ChillMainBundle/Templating/Entity/UserRender.php @@ -24,13 +24,13 @@ use function array_merge; */ class UserRender implements ChillEntityRenderInterface { - public const DEFAULT_OPTIONS = [ + final public const DEFAULT_OPTIONS = [ 'main_scope' => true, 'user_job' => true, 'absence' => true, ]; - public function __construct(private TranslatableStringHelper $translatableStringHelper, private EngineInterface $engine, private TranslatorInterface $translator) + public function __construct(private readonly TranslatableStringHelper $translatableStringHelper, private readonly EngineInterface $engine, private readonly TranslatorInterface $translator) { } diff --git a/src/Bundle/ChillMainBundle/Templating/Events/DelegatedBlockRenderingEvent.php b/src/Bundle/ChillMainBundle/Templating/Events/DelegatedBlockRenderingEvent.php index ce02789fd..c7a31b042 100644 --- a/src/Bundle/ChillMainBundle/Templating/Events/DelegatedBlockRenderingEvent.php +++ b/src/Bundle/ChillMainBundle/Templating/Events/DelegatedBlockRenderingEvent.php @@ -80,13 +80,13 @@ class DelegatedBlockRenderingEvent extends Event implements ArrayAccess return $this->context[$offset]; } - public function offsetSet($offset, $value): void + public function offsetSet($offset, $value): never { throw new RuntimeException('The event context is read-only, you are not ' . 'allowed to update it.'); } - public function offsetUnset($offset): void + public function offsetUnset($offset): never { throw new RuntimeException('The event context is read-only, you are not ' . 'allowed to update it.'); diff --git a/src/Bundle/ChillMainBundle/Templating/Listing/FilterOrderHelper.php b/src/Bundle/ChillMainBundle/Templating/Listing/FilterOrderHelper.php index c8b3839c9..e9e5065b2 100644 --- a/src/Bundle/ChillMainBundle/Templating/Listing/FilterOrderHelper.php +++ b/src/Bundle/ChillMainBundle/Templating/Listing/FilterOrderHelper.php @@ -36,7 +36,7 @@ class FilterOrderHelper private ?array $submitted = null; - public function __construct(private FormFactoryInterface $formFactory, private RequestStack $requestStack) + public function __construct(private readonly FormFactoryInterface $formFactory, private readonly RequestStack $requestStack) { } diff --git a/src/Bundle/ChillMainBundle/Templating/Listing/FilterOrderHelperBuilder.php b/src/Bundle/ChillMainBundle/Templating/Listing/FilterOrderHelperBuilder.php index 770b42cae..206e57cea 100644 --- a/src/Bundle/ChillMainBundle/Templating/Listing/FilterOrderHelperBuilder.php +++ b/src/Bundle/ChillMainBundle/Templating/Listing/FilterOrderHelperBuilder.php @@ -23,7 +23,7 @@ class FilterOrderHelperBuilder private ?array $searchBoxFields = null; - public function __construct(private FormFactoryInterface $formFactory, private RequestStack $requestStack) + public function __construct(private readonly FormFactoryInterface $formFactory, private readonly RequestStack $requestStack) { } diff --git a/src/Bundle/ChillMainBundle/Templating/Listing/FilterOrderHelperFactory.php b/src/Bundle/ChillMainBundle/Templating/Listing/FilterOrderHelperFactory.php index 930da454c..c9c094a15 100644 --- a/src/Bundle/ChillMainBundle/Templating/Listing/FilterOrderHelperFactory.php +++ b/src/Bundle/ChillMainBundle/Templating/Listing/FilterOrderHelperFactory.php @@ -16,7 +16,7 @@ use Symfony\Component\HttpFoundation\RequestStack; class FilterOrderHelperFactory implements FilterOrderHelperFactoryInterface { - public function __construct(private FormFactoryInterface $formFactory, private RequestStack $requestStack) + public function __construct(private readonly FormFactoryInterface $formFactory, private readonly RequestStack $requestStack) { } diff --git a/src/Bundle/ChillMainBundle/Templating/Listing/Templating.php b/src/Bundle/ChillMainBundle/Templating/Listing/Templating.php index bc256e24f..4c3a1f3eb 100644 --- a/src/Bundle/ChillMainBundle/Templating/Listing/Templating.php +++ b/src/Bundle/ChillMainBundle/Templating/Listing/Templating.php @@ -20,7 +20,7 @@ class Templating extends AbstractExtension public function getFilters() { return [ - new TwigFilter('chill_render_filter_order_helper', [$this, 'renderFilterOrderHelper'], [ + new TwigFilter('chill_render_filter_order_helper', $this->renderFilterOrderHelper(...), [ 'needs_environment' => true, 'is_safe' => ['html'], ]), ]; diff --git a/src/Bundle/ChillMainBundle/Templating/TranslatableStringHelper.php b/src/Bundle/ChillMainBundle/Templating/TranslatableStringHelper.php index 6136ffc3e..924e1a2be 100644 --- a/src/Bundle/ChillMainBundle/Templating/TranslatableStringHelper.php +++ b/src/Bundle/ChillMainBundle/Templating/TranslatableStringHelper.php @@ -19,9 +19,9 @@ use function array_key_exists; final class TranslatableStringHelper implements TranslatableStringHelperInterface { - private string $defaultLocale; + private readonly string $defaultLocale; - public function __construct(private RequestStack $requestStack, private TranslatorInterface $translator, ParameterBagInterface $parameterBag) + public function __construct(private readonly RequestStack $requestStack, private readonly TranslatorInterface $translator, ParameterBagInterface $parameterBag) { $this->defaultLocale = $parameterBag->get('kernel.default_locale'); } diff --git a/src/Bundle/ChillMainBundle/Templating/TranslatableStringTwig.php b/src/Bundle/ChillMainBundle/Templating/TranslatableStringTwig.php index aaefdeeae..512d8bd2a 100644 --- a/src/Bundle/ChillMainBundle/Templating/TranslatableStringTwig.php +++ b/src/Bundle/ChillMainBundle/Templating/TranslatableStringTwig.php @@ -22,7 +22,7 @@ class TranslatableStringTwig extends AbstractExtension /** * TranslatableStringTwig constructor. */ - public function __construct(private TranslatableStringHelper $helper) + public function __construct(private readonly TranslatableStringHelper $helper) { } @@ -38,7 +38,7 @@ class TranslatableStringTwig extends AbstractExtension return [ new TwigFilter( 'localize_translatable_string', - [$this, 'localize'] + $this->localize(...) ), ]; } diff --git a/src/Bundle/ChillMainBundle/Templating/Widget/WidgetRenderingTwig.php b/src/Bundle/ChillMainBundle/Templating/Widget/WidgetRenderingTwig.php index 9b752c439..c38f410d4 100644 --- a/src/Bundle/ChillMainBundle/Templating/Widget/WidgetRenderingTwig.php +++ b/src/Bundle/ChillMainBundle/Templating/Widget/WidgetRenderingTwig.php @@ -92,7 +92,7 @@ class WidgetRenderingTwig extends AbstractExtension return [ new TwigFunction( 'chill_delegated_block', - [$this, 'renderingWidget'], + $this->renderingWidget(...), [ 'is_safe' => ['html'], 'needs_environment' => true, @@ -101,7 +101,7 @@ class WidgetRenderingTwig extends AbstractExtension ), new TwigFunction( 'chill_widget', - [$this, 'renderingWidget'], + $this->renderingWidget(...), ['is_safe' => ['html'], 'needs_environment' => true] ), ]; diff --git a/src/Bundle/ChillMainBundle/Tests/Controller/PermissionsGroupControllerTest.php b/src/Bundle/ChillMainBundle/Tests/Controller/PermissionsGroupControllerTest.php index cbb3e3601..1c2ffe4d3 100644 --- a/src/Bundle/ChillMainBundle/Tests/Controller/PermissionsGroupControllerTest.php +++ b/src/Bundle/ChillMainBundle/Tests/Controller/PermissionsGroupControllerTest.php @@ -19,7 +19,7 @@ use Symfony\Bundle\FrameworkBundle\Test\WebTestCase; */ final class PermissionsGroupControllerTest extends WebTestCase { - public function testEmpty() + public function testEmpty(): never { $this->markTestSkipped(); } diff --git a/src/Bundle/ChillMainBundle/Tests/Cron/CronManagerTest.php b/src/Bundle/ChillMainBundle/Tests/Cron/CronManagerTest.php index 98de6891f..20a3027b3 100644 --- a/src/Bundle/ChillMainBundle/Tests/Cron/CronManagerTest.php +++ b/src/Bundle/ChillMainBundle/Tests/Cron/CronManagerTest.php @@ -161,7 +161,7 @@ final class CronManagerTest extends TestCase class JobCanRun implements CronJobInterface { - public function __construct(private string $key) + public function __construct(private readonly string $key) { } diff --git a/src/Bundle/ChillMainBundle/Tests/Form/Type/PickCenterTypeTest.php b/src/Bundle/ChillMainBundle/Tests/Form/Type/PickCenterTypeTest.php index ffb7c6bed..db1d701f6 100644 --- a/src/Bundle/ChillMainBundle/Tests/Form/Type/PickCenterTypeTest.php +++ b/src/Bundle/ChillMainBundle/Tests/Form/Type/PickCenterTypeTest.php @@ -28,7 +28,7 @@ final class PickCenterTypeTest extends TypeTestCase * Test that a user which can reach multiple center * make CenterType render as "entity" type. */ - public function testUserCanReachMultipleCenters() + public function testUserCanReachMultipleCenters(): never { $this->markTestSkipped(); //prepare user @@ -51,7 +51,7 @@ final class PickCenterTypeTest extends TypeTestCase * Test that a user which can reach only one center * render as an hidden field. */ - public function testUserCanReachMultipleSameCenter() + public function testUserCanReachMultipleSameCenter(): never { $this->markTestSkipped(); //prepare user @@ -73,7 +73,7 @@ final class PickCenterTypeTest extends TypeTestCase * Test that a user which can reach only one center * render as an hidden field. */ - public function testUserCanReachSingleCenter() + public function testUserCanReachSingleCenter(): never { $this->markTestSkipped(); //prepare user diff --git a/src/Bundle/ChillMainBundle/Tests/Search/AbstractSearchTest.php b/src/Bundle/ChillMainBundle/Tests/Search/AbstractSearchTest.php index 9348c6fe2..afe10b4ec 100644 --- a/src/Bundle/ChillMainBundle/Tests/Search/AbstractSearchTest.php +++ b/src/Bundle/ChillMainBundle/Tests/Search/AbstractSearchTest.php @@ -38,7 +38,7 @@ final class AbstractSearchTest extends \PHPUnit\Framework\TestCase $this->assertEquals('01', $date->format('d')); } - public function testRecompose() + public function testRecompose(): never { $this->markTestSkipped(); } diff --git a/src/Bundle/ChillMainBundle/Tests/Services/Import/GeographicalUnitBaseImporterTest.php b/src/Bundle/ChillMainBundle/Tests/Services/Import/GeographicalUnitBaseImporterTest.php index b3bd856ff..757e13c2f 100644 --- a/src/Bundle/ChillMainBundle/Tests/Services/Import/GeographicalUnitBaseImporterTest.php +++ b/src/Bundle/ChillMainBundle/Tests/Services/Import/GeographicalUnitBaseImporterTest.php @@ -64,7 +64,7 @@ final class GeographicalUnitBaseImporterTest extends KernelTestCase $this->assertEquals($results['unitrefid'], 'layer_one'); $this->assertEquals($results['unitname'], 'Layer one'); - $this->assertEquals(json_decode($results['layername'], true, 512, JSON_THROW_ON_ERROR), ['fr' => 'Test Layer']); + $this->assertEquals(json_decode((string) $results['layername'], true, 512, JSON_THROW_ON_ERROR), ['fr' => 'Test Layer']); $this->assertEquals($results['layerrefid'], 'test'); $this->assertEquals($results['geom'], 'MULTIPOLYGON(((30 20,45 40,10 40,30 20)),((15 5,40 10,10 20,5 10,15 5)))'); @@ -93,7 +93,7 @@ final class GeographicalUnitBaseImporterTest extends KernelTestCase $this->assertEquals($results['unitrefid'], 'layer_one'); $this->assertEquals($results['unitname'], 'Layer one fixed'); - $this->assertEquals(json_decode($results['layername'], true, 512, JSON_THROW_ON_ERROR), ['fr' => 'Test Layer fixed']); + $this->assertEquals(json_decode((string) $results['layername'], true, 512, JSON_THROW_ON_ERROR), ['fr' => 'Test Layer fixed']); $this->assertEquals($results['layerrefid'], 'test'); $this->assertEquals($results['geom'], 'MULTIPOLYGON(((130 120,45 40,10 40,130 120)),((0 0,15 5,40 10,10 20,0 0)))'); } diff --git a/src/Bundle/ChillMainBundle/Timeline/TimelineBuilder.php b/src/Bundle/ChillMainBundle/Timeline/TimelineBuilder.php index c223bc375..df700324b 100644 --- a/src/Bundle/ChillMainBundle/Timeline/TimelineBuilder.php +++ b/src/Bundle/ChillMainBundle/Timeline/TimelineBuilder.php @@ -47,7 +47,7 @@ class TimelineBuilder implements ContainerAwareInterface */ private $providersByContext = []; - public function __construct(private EntityManagerInterface $em) + public function __construct(private readonly EntityManagerInterface $em) { } diff --git a/src/Bundle/ChillMainBundle/Util/DateRangeCovering.php b/src/Bundle/ChillMainBundle/Util/DateRangeCovering.php index 7ddecf70c..e5d3de41a 100644 --- a/src/Bundle/ChillMainBundle/Util/DateRangeCovering.php +++ b/src/Bundle/ChillMainBundle/Util/DateRangeCovering.php @@ -65,7 +65,7 @@ class DateRangeCovering private array $metadatas = []; - private int $minCover; + private readonly int $minCover; private array $sequence = []; @@ -74,7 +74,7 @@ class DateRangeCovering /** * @param int $minCover the minimum of covering required */ - public function __construct(int $minCover, private DateTimeZone $tz) + public function __construct(int $minCover, private readonly DateTimeZone $tz) { if (0 > $minCover) { throw new LogicException('argument minCover cannot be lower than 0'); diff --git a/src/Bundle/ChillMainBundle/Validation/Validator/RoleScopeScopePresence.php b/src/Bundle/ChillMainBundle/Validation/Validator/RoleScopeScopePresence.php index 1ffb767e3..cff4d34c7 100644 --- a/src/Bundle/ChillMainBundle/Validation/Validator/RoleScopeScopePresence.php +++ b/src/Bundle/ChillMainBundle/Validation/Validator/RoleScopeScopePresence.php @@ -24,7 +24,7 @@ use function in_array; class RoleScopeScopePresence extends ConstraintValidator { - public function __construct(private RoleProvider $roleProvider, private LoggerInterface $logger, private TranslatorInterface $translator) + public function __construct(private readonly RoleProvider $roleProvider, private readonly LoggerInterface $logger, private readonly TranslatorInterface $translator) { } diff --git a/src/Bundle/ChillMainBundle/Validation/Validator/ValidPhonenumber.php b/src/Bundle/ChillMainBundle/Validation/Validator/ValidPhonenumber.php index 0c9eae2c4..ab38e5081 100644 --- a/src/Bundle/ChillMainBundle/Validation/Validator/ValidPhonenumber.php +++ b/src/Bundle/ChillMainBundle/Validation/Validator/ValidPhonenumber.php @@ -19,7 +19,7 @@ use Symfony\Component\Validator\ConstraintValidator; final class ValidPhonenumber extends ConstraintValidator { - public function __construct(private LoggerInterface $logger, private PhoneNumberHelperInterface $phonenumberHelper) + public function __construct(private readonly LoggerInterface $logger, private readonly PhoneNumberHelperInterface $phonenumberHelper) { } diff --git a/src/Bundle/ChillMainBundle/Workflow/Counter/WorkflowByUserCounter.php b/src/Bundle/ChillMainBundle/Workflow/Counter/WorkflowByUserCounter.php index 3dc5928d6..2735a265f 100644 --- a/src/Bundle/ChillMainBundle/Workflow/Counter/WorkflowByUserCounter.php +++ b/src/Bundle/ChillMainBundle/Workflow/Counter/WorkflowByUserCounter.php @@ -20,7 +20,7 @@ use Symfony\Component\EventDispatcher\EventSubscriberInterface; use Symfony\Component\Security\Core\User\UserInterface; use Symfony\Component\Workflow\Event\Event; -final class WorkflowByUserCounter implements NotificationCounterInterface, EventSubscriberInterface +final readonly class WorkflowByUserCounter implements NotificationCounterInterface, EventSubscriberInterface { public function __construct(private EntityWorkflowStepRepository $workflowStepRepository, private CacheItemPoolInterface $cacheItemPool) { diff --git a/src/Bundle/ChillMainBundle/Workflow/EntityWorkflowManager.php b/src/Bundle/ChillMainBundle/Workflow/EntityWorkflowManager.php index 2f5356e6e..6c45cef3d 100644 --- a/src/Bundle/ChillMainBundle/Workflow/EntityWorkflowManager.php +++ b/src/Bundle/ChillMainBundle/Workflow/EntityWorkflowManager.php @@ -20,7 +20,7 @@ class EntityWorkflowManager /** * @param \Chill\MainBundle\Workflow\EntityWorkflowHandlerInterface[] $handlers */ - public function __construct(private iterable $handlers, private Registry $registry) + public function __construct(private readonly iterable $handlers, private readonly Registry $registry) { } diff --git a/src/Bundle/ChillMainBundle/Workflow/EventSubscriber/EntityWorkflowTransitionEventSubscriber.php b/src/Bundle/ChillMainBundle/Workflow/EventSubscriber/EntityWorkflowTransitionEventSubscriber.php index 3657e4f53..981c798dd 100644 --- a/src/Bundle/ChillMainBundle/Workflow/EventSubscriber/EntityWorkflowTransitionEventSubscriber.php +++ b/src/Bundle/ChillMainBundle/Workflow/EventSubscriber/EntityWorkflowTransitionEventSubscriber.php @@ -25,7 +25,7 @@ use function array_key_exists; class EntityWorkflowTransitionEventSubscriber implements EventSubscriberInterface { - public function __construct(private LoggerInterface $chillLogger, private Security $security, private UserRender $userRender) + public function __construct(private readonly LoggerInterface $chillLogger, private readonly Security $security, private readonly UserRender $userRender) { } diff --git a/src/Bundle/ChillMainBundle/Workflow/EventSubscriber/NotificationOnTransition.php b/src/Bundle/ChillMainBundle/Workflow/EventSubscriber/NotificationOnTransition.php index ceeb3023f..78b165a85 100644 --- a/src/Bundle/ChillMainBundle/Workflow/EventSubscriber/NotificationOnTransition.php +++ b/src/Bundle/ChillMainBundle/Workflow/EventSubscriber/NotificationOnTransition.php @@ -25,7 +25,7 @@ use function in_array; class NotificationOnTransition implements EventSubscriberInterface { - public function __construct(private EntityManagerInterface $entityManager, private EngineInterface $engine, private MetadataExtractor $metadataExtractor, private Security $security, private Registry $registry) + public function __construct(private readonly EntityManagerInterface $entityManager, private readonly EngineInterface $engine, private readonly MetadataExtractor $metadataExtractor, private readonly Security $security, private readonly Registry $registry) { } diff --git a/src/Bundle/ChillMainBundle/Workflow/EventSubscriber/SendAccessKeyEventSubscriber.php b/src/Bundle/ChillMainBundle/Workflow/EventSubscriber/SendAccessKeyEventSubscriber.php index b1ce5074c..adf19fb92 100644 --- a/src/Bundle/ChillMainBundle/Workflow/EventSubscriber/SendAccessKeyEventSubscriber.php +++ b/src/Bundle/ChillMainBundle/Workflow/EventSubscriber/SendAccessKeyEventSubscriber.php @@ -21,7 +21,7 @@ use Symfony\Component\Workflow\Registry; class SendAccessKeyEventSubscriber { - public function __construct(private EngineInterface $engine, private MetadataExtractor $metadataExtractor, private Registry $registry, private EntityWorkflowManager $entityWorkflowManager, private MailerInterface $mailer) + public function __construct(private readonly EngineInterface $engine, private readonly MetadataExtractor $metadataExtractor, private readonly Registry $registry, private readonly EntityWorkflowManager $entityWorkflowManager, private readonly MailerInterface $mailer) { } diff --git a/src/Bundle/ChillMainBundle/Workflow/Helper/MetadataExtractor.php b/src/Bundle/ChillMainBundle/Workflow/Helper/MetadataExtractor.php index 87026e920..9adffec8e 100644 --- a/src/Bundle/ChillMainBundle/Workflow/Helper/MetadataExtractor.php +++ b/src/Bundle/ChillMainBundle/Workflow/Helper/MetadataExtractor.php @@ -20,7 +20,7 @@ use function array_key_exists; class MetadataExtractor { - public function __construct(private Registry $registry, private TranslatableStringHelperInterface $translatableStringHelper) + public function __construct(private readonly Registry $registry, private readonly TranslatableStringHelperInterface $translatableStringHelper) { } diff --git a/src/Bundle/ChillMainBundle/Workflow/Notification/WorkflowNotificationHandler.php b/src/Bundle/ChillMainBundle/Workflow/Notification/WorkflowNotificationHandler.php index 9f286508c..bf55d8542 100644 --- a/src/Bundle/ChillMainBundle/Workflow/Notification/WorkflowNotificationHandler.php +++ b/src/Bundle/ChillMainBundle/Workflow/Notification/WorkflowNotificationHandler.php @@ -20,7 +20,7 @@ use Symfony\Component\Security\Core\Security; class WorkflowNotificationHandler implements NotificationHandlerInterface { - public function __construct(private EntityWorkflowRepository $entityWorkflowRepository, private EntityWorkflowManager $entityWorkflowManager, private Security $security) + public function __construct(private readonly EntityWorkflowRepository $entityWorkflowRepository, private readonly EntityWorkflowManager $entityWorkflowManager, private readonly Security $security) { } diff --git a/src/Bundle/ChillMainBundle/Workflow/Templating/WorkflowTwigExtensionRuntime.php b/src/Bundle/ChillMainBundle/Workflow/Templating/WorkflowTwigExtensionRuntime.php index d1381a397..e9edb11d9 100644 --- a/src/Bundle/ChillMainBundle/Workflow/Templating/WorkflowTwigExtensionRuntime.php +++ b/src/Bundle/ChillMainBundle/Workflow/Templating/WorkflowTwigExtensionRuntime.php @@ -23,7 +23,7 @@ use Twig\Extension\RuntimeExtensionInterface; class WorkflowTwigExtensionRuntime implements RuntimeExtensionInterface { - public function __construct(private EntityWorkflowManager $entityWorkflowManager, private Registry $registry, private EntityWorkflowRepository $repository, private MetadataExtractor $metadataExtractor, private NormalizerInterface $normalizer) + public function __construct(private readonly EntityWorkflowManager $entityWorkflowManager, private readonly Registry $registry, private readonly EntityWorkflowRepository $repository, private readonly MetadataExtractor $metadataExtractor, private readonly NormalizerInterface $normalizer) { } diff --git a/src/Bundle/ChillMainBundle/Workflow/Validator/EntityWorkflowCreationValidator.php b/src/Bundle/ChillMainBundle/Workflow/Validator/EntityWorkflowCreationValidator.php index eb035358d..e55eb6915 100644 --- a/src/Bundle/ChillMainBundle/Workflow/Validator/EntityWorkflowCreationValidator.php +++ b/src/Bundle/ChillMainBundle/Workflow/Validator/EntityWorkflowCreationValidator.php @@ -22,7 +22,7 @@ use function count; class EntityWorkflowCreationValidator extends \Symfony\Component\Validator\ConstraintValidator { - public function __construct(private EntityWorkflowManager $entityWorkflowManager) + public function __construct(private readonly EntityWorkflowManager $entityWorkflowManager) { } diff --git a/src/Bundle/ChillPersonBundle/AccompanyingPeriod/Events/PersonAddressMoveEventSubscriber.php b/src/Bundle/ChillPersonBundle/AccompanyingPeriod/Events/PersonAddressMoveEventSubscriber.php index a24d8adb4..ce26780a4 100644 --- a/src/Bundle/ChillPersonBundle/AccompanyingPeriod/Events/PersonAddressMoveEventSubscriber.php +++ b/src/Bundle/ChillPersonBundle/AccompanyingPeriod/Events/PersonAddressMoveEventSubscriber.php @@ -24,7 +24,7 @@ use Symfony\Contracts\Translation\TranslatorInterface; class PersonAddressMoveEventSubscriber implements EventSubscriberInterface { - public function __construct(private EngineInterface $engine, private NotificationPersisterInterface $notificationPersister, private Security $security, private TranslatorInterface $translator) + public function __construct(private readonly EngineInterface $engine, private readonly NotificationPersisterInterface $notificationPersister, private readonly Security $security, private readonly TranslatorInterface $translator) { } diff --git a/src/Bundle/ChillPersonBundle/AccompanyingPeriod/Events/UserRefEventSubscriber.php b/src/Bundle/ChillPersonBundle/AccompanyingPeriod/Events/UserRefEventSubscriber.php index cefc348c2..b8ca31835 100644 --- a/src/Bundle/ChillPersonBundle/AccompanyingPeriod/Events/UserRefEventSubscriber.php +++ b/src/Bundle/ChillPersonBundle/AccompanyingPeriod/Events/UserRefEventSubscriber.php @@ -24,7 +24,7 @@ use Symfony\Contracts\Translation\TranslatorInterface; class UserRefEventSubscriber implements EventSubscriberInterface { - public function __construct(private Security $security, private TranslatorInterface $translator, private EngineInterface $engine, private NotificationPersisterInterface $notificationPersister) + public function __construct(private readonly Security $security, private readonly TranslatorInterface $translator, private readonly EngineInterface $engine, private readonly NotificationPersisterInterface $notificationPersister) { } diff --git a/src/Bundle/ChillPersonBundle/Actions/ActionEvent.php b/src/Bundle/ChillPersonBundle/Actions/ActionEvent.php index b3a335ce7..c0935b995 100644 --- a/src/Bundle/ChillPersonBundle/Actions/ActionEvent.php +++ b/src/Bundle/ChillPersonBundle/Actions/ActionEvent.php @@ -18,9 +18,9 @@ use Symfony\Component\EventDispatcher\Event; */ class ActionEvent extends Event { - public const DELETE = 'CHILL_PERSON.DELETE_ASSOCIATED_ENTITY'; + final public const DELETE = 'CHILL_PERSON.DELETE_ASSOCIATED_ENTITY'; - public const MOVE = 'CHILL_PERSON.MOVE_ASSOCIATED_ENTITY'; + final public const MOVE = 'CHILL_PERSON.MOVE_ASSOCIATED_ENTITY'; /** * @var string[] diff --git a/src/Bundle/ChillPersonBundle/CRUD/Controller/OneToOneEntityPersonCRUDController.php b/src/Bundle/ChillPersonBundle/CRUD/Controller/OneToOneEntityPersonCRUDController.php index f9c53712a..52599e162 100644 --- a/src/Bundle/ChillPersonBundle/CRUD/Controller/OneToOneEntityPersonCRUDController.php +++ b/src/Bundle/ChillPersonBundle/CRUD/Controller/OneToOneEntityPersonCRUDController.php @@ -22,7 +22,7 @@ use Symfony\Component\HttpFoundation\Response; class OneToOneEntityPersonCRUDController extends CRUDController { - protected function generateRedirectOnCreateRoute($action, Request $request, $entity) + protected function generateRedirectOnCreateRoute($action, Request $request, $entity): never { throw new BadMethodCallException('Not implemented yet.'); } diff --git a/src/Bundle/ChillPersonBundle/Command/ChillPersonMoveCommand.php b/src/Bundle/ChillPersonBundle/Command/ChillPersonMoveCommand.php index 42b8f6cac..4817e3819 100644 --- a/src/Bundle/ChillPersonBundle/Command/ChillPersonMoveCommand.php +++ b/src/Bundle/ChillPersonBundle/Command/ChillPersonMoveCommand.php @@ -26,9 +26,9 @@ use function ctype_digit; final class ChillPersonMoveCommand extends Command { public function __construct( - private PersonMove $mover, - private EntityManagerInterface $em, - private LoggerInterface $chillLogger + private readonly PersonMove $mover, + private readonly EntityManagerInterface $em, + private readonly LoggerInterface $chillLogger ) { parent::__construct('chill:person:move'); } @@ -116,7 +116,7 @@ final class ChillPersonMoveCommand extends Command } $id = $input->getOption($name); - if (ctype_digit($id) === false) { + if (ctype_digit((string) $id) === false) { throw new RuntimeException("The id in \"{$name}\" field does not contains " . "only digits: {$id}"); } diff --git a/src/Bundle/ChillPersonBundle/Command/RemoveOldDraftAccompanyingPeriodCommand.php b/src/Bundle/ChillPersonBundle/Command/RemoveOldDraftAccompanyingPeriodCommand.php index ac6551bd2..b903b84b3 100644 --- a/src/Bundle/ChillPersonBundle/Command/RemoveOldDraftAccompanyingPeriodCommand.php +++ b/src/Bundle/ChillPersonBundle/Command/RemoveOldDraftAccompanyingPeriodCommand.php @@ -22,7 +22,7 @@ use Symfony\Component\Console\Output\OutputInterface; class RemoveOldDraftAccompanyingPeriodCommand extends Command { - public function __construct(private LoggerInterface $logger, private OldDraftAccompanyingPeriodRemoverInterface $remover) + public function __construct(private readonly LoggerInterface $logger, private readonly OldDraftAccompanyingPeriodRemoverInterface $remover) { parent::__construct('chill:person:remove-old-draft-period'); } diff --git a/src/Bundle/ChillPersonBundle/Controller/AccompanyingCourseApiController.php b/src/Bundle/ChillPersonBundle/Controller/AccompanyingCourseApiController.php index 10329a87c..027279d04 100644 --- a/src/Bundle/ChillPersonBundle/Controller/AccompanyingCourseApiController.php +++ b/src/Bundle/ChillPersonBundle/Controller/AccompanyingCourseApiController.php @@ -51,7 +51,7 @@ use function count; final class AccompanyingCourseApiController extends ApiController { - public function __construct(private AccompanyingPeriodRepository $accompanyingPeriodRepository, private AccompanyingPeriodACLAwareRepository $accompanyingPeriodACLAwareRepository, private EventDispatcherInterface $eventDispatcher, private ReferralsSuggestionInterface $referralAvailable, private Registry $registry, private ValidatorInterface $validator) + public function __construct(private readonly AccompanyingPeriodRepository $accompanyingPeriodRepository, private readonly AccompanyingPeriodACLAwareRepository $accompanyingPeriodACLAwareRepository, private readonly EventDispatcherInterface $eventDispatcher, private readonly ReferralsSuggestionInterface $referralAvailable, private readonly Registry $registry, private readonly ValidatorInterface $validator) { } diff --git a/src/Bundle/ChillPersonBundle/Controller/AccompanyingCourseCommentController.php b/src/Bundle/ChillPersonBundle/Controller/AccompanyingCourseCommentController.php index 99608d640..73c018052 100644 --- a/src/Bundle/ChillPersonBundle/Controller/AccompanyingCourseCommentController.php +++ b/src/Bundle/ChillPersonBundle/Controller/AccompanyingCourseCommentController.php @@ -32,7 +32,7 @@ use Symfony\Contracts\Translation\TranslatorInterface; class AccompanyingCourseCommentController extends AbstractController { - public function __construct(private EntityManagerInterface $entityManager, private FormFactoryInterface $formFactory, private TranslatorInterface $translator) + public function __construct(private readonly EntityManagerInterface $entityManager, private readonly FormFactoryInterface $formFactory, private readonly TranslatorInterface $translator) { } diff --git a/src/Bundle/ChillPersonBundle/Controller/AccompanyingCourseController.php b/src/Bundle/ChillPersonBundle/Controller/AccompanyingCourseController.php index 41e4a9b90..344b52642 100644 --- a/src/Bundle/ChillPersonBundle/Controller/AccompanyingCourseController.php +++ b/src/Bundle/ChillPersonBundle/Controller/AccompanyingCourseController.php @@ -41,7 +41,7 @@ use function is_array; */ class AccompanyingCourseController extends Controller { - public function __construct(protected SerializerInterface $serializer, protected EventDispatcherInterface $dispatcher, protected ValidatorInterface $validator, private AccompanyingPeriodWorkRepository $workRepository, private Registry $registry, private TranslatorInterface $translator) + public function __construct(protected SerializerInterface $serializer, protected EventDispatcherInterface $dispatcher, protected ValidatorInterface $validator, private readonly AccompanyingPeriodWorkRepository $workRepository, private readonly Registry $registry, private readonly TranslatorInterface $translator) { } diff --git a/src/Bundle/ChillPersonBundle/Controller/AccompanyingCourseWorkApiController.php b/src/Bundle/ChillPersonBundle/Controller/AccompanyingCourseWorkApiController.php index f57ad0c56..8573f547b 100644 --- a/src/Bundle/ChillPersonBundle/Controller/AccompanyingCourseWorkApiController.php +++ b/src/Bundle/ChillPersonBundle/Controller/AccompanyingCourseWorkApiController.php @@ -23,7 +23,7 @@ use Symfony\Component\Routing\Annotation\Route; class AccompanyingCourseWorkApiController extends ApiController { - public function __construct(private AccompanyingPeriodWorkRepository $accompanyingPeriodWorkRepository) + public function __construct(private readonly AccompanyingPeriodWorkRepository $accompanyingPeriodWorkRepository) { } diff --git a/src/Bundle/ChillPersonBundle/Controller/AccompanyingCourseWorkController.php b/src/Bundle/ChillPersonBundle/Controller/AccompanyingCourseWorkController.php index a36ad67b0..d4f316068 100644 --- a/src/Bundle/ChillPersonBundle/Controller/AccompanyingCourseWorkController.php +++ b/src/Bundle/ChillPersonBundle/Controller/AccompanyingCourseWorkController.php @@ -28,7 +28,7 @@ use Symfony\Contracts\Translation\TranslatorInterface; class AccompanyingCourseWorkController extends AbstractController { - public function __construct(private TranslatorInterface $trans, private SerializerInterface $serializer, private AccompanyingPeriodWorkRepository $workRepository, private PaginatorFactory $paginator, private LoggerInterface $chillLogger) + public function __construct(private readonly TranslatorInterface $trans, private readonly SerializerInterface $serializer, private readonly AccompanyingPeriodWorkRepository $workRepository, private readonly PaginatorFactory $paginator, private readonly LoggerInterface $chillLogger) { } diff --git a/src/Bundle/ChillPersonBundle/Controller/AccompanyingPeriodRegulationListController.php b/src/Bundle/ChillPersonBundle/Controller/AccompanyingPeriodRegulationListController.php index 34aeb835a..5ce844a90 100644 --- a/src/Bundle/ChillPersonBundle/Controller/AccompanyingPeriodRegulationListController.php +++ b/src/Bundle/ChillPersonBundle/Controller/AccompanyingPeriodRegulationListController.php @@ -32,7 +32,7 @@ use Symfony\Component\Templating\EngineInterface; class AccompanyingPeriodRegulationListController { - public function __construct(private AccompanyingPeriodACLAwareRepositoryInterface $accompanyingPeriodACLAwareRepository, private EngineInterface $engine, private FormFactoryInterface $formFactory, private PaginatorFactory $paginatorFactory, private Security $security, private TranslatableStringHelperInterface $translatableStringHelper) + public function __construct(private readonly AccompanyingPeriodACLAwareRepositoryInterface $accompanyingPeriodACLAwareRepository, private readonly EngineInterface $engine, private readonly FormFactoryInterface $formFactory, private readonly PaginatorFactory $paginatorFactory, private readonly Security $security, private readonly TranslatableStringHelperInterface $translatableStringHelper) { } diff --git a/src/Bundle/ChillPersonBundle/Controller/AccompanyingPeriodWorkEvaluationApiController.php b/src/Bundle/ChillPersonBundle/Controller/AccompanyingPeriodWorkEvaluationApiController.php index 9a4b5e15a..914c8afde 100644 --- a/src/Bundle/ChillPersonBundle/Controller/AccompanyingPeriodWorkEvaluationApiController.php +++ b/src/Bundle/ChillPersonBundle/Controller/AccompanyingPeriodWorkEvaluationApiController.php @@ -32,7 +32,7 @@ use function in_array; class AccompanyingPeriodWorkEvaluationApiController { - public function __construct(private AccompanyingPeriodWorkEvaluationRepository $accompanyingPeriodWorkEvaluationRepository, private DocGeneratorTemplateRepository $docGeneratorTemplateRepository, private SerializerInterface $serializer, private PaginatorFactory $paginatorFactory, private Security $security) + public function __construct(private readonly AccompanyingPeriodWorkEvaluationRepository $accompanyingPeriodWorkEvaluationRepository, private readonly DocGeneratorTemplateRepository $docGeneratorTemplateRepository, private readonly SerializerInterface $serializer, private readonly PaginatorFactory $paginatorFactory, private readonly Security $security) { } diff --git a/src/Bundle/ChillPersonBundle/Controller/HouseholdApiController.php b/src/Bundle/ChillPersonBundle/Controller/HouseholdApiController.php index 695caa976..8d6072132 100644 --- a/src/Bundle/ChillPersonBundle/Controller/HouseholdApiController.php +++ b/src/Bundle/ChillPersonBundle/Controller/HouseholdApiController.php @@ -35,7 +35,7 @@ use function array_values; class HouseholdApiController extends ApiController { - public function __construct(private EventDispatcherInterface $eventDispatcher, private HouseholdRepository $householdRepository, private HouseholdACLAwareRepositoryInterface $householdACLAwareRepository) + public function __construct(private readonly EventDispatcherInterface $eventDispatcher, private readonly HouseholdRepository $householdRepository, private readonly HouseholdACLAwareRepositoryInterface $householdACLAwareRepository) { } diff --git a/src/Bundle/ChillPersonBundle/Controller/HouseholdCompositionController.php b/src/Bundle/ChillPersonBundle/Controller/HouseholdCompositionController.php index 1abb6290f..01810feeb 100644 --- a/src/Bundle/ChillPersonBundle/Controller/HouseholdCompositionController.php +++ b/src/Bundle/ChillPersonBundle/Controller/HouseholdCompositionController.php @@ -36,7 +36,7 @@ use Symfony\Contracts\Translation\TranslatorInterface; class HouseholdCompositionController extends AbstractController { - public function __construct(private Security $security, private HouseholdCompositionRepository $householdCompositionRepository, private HouseholdRepository $householdRepository, private PaginatorFactory $paginatorFactory, private FormFactoryInterface $formFactory, private EntityManagerInterface $entityManager, private TranslatorInterface $translator, private EngineInterface $engine, private UrlGeneratorInterface $urlGenerator) + public function __construct(private readonly Security $security, private readonly HouseholdCompositionRepository $householdCompositionRepository, private readonly HouseholdRepository $householdRepository, private readonly PaginatorFactory $paginatorFactory, private readonly FormFactoryInterface $formFactory, private readonly EntityManagerInterface $entityManager, private readonly TranslatorInterface $translator, private readonly EngineInterface $engine, private readonly UrlGeneratorInterface $urlGenerator) { } diff --git a/src/Bundle/ChillPersonBundle/Controller/HouseholdController.php b/src/Bundle/ChillPersonBundle/Controller/HouseholdController.php index 9c4ae1441..ea120920c 100644 --- a/src/Bundle/ChillPersonBundle/Controller/HouseholdController.php +++ b/src/Bundle/ChillPersonBundle/Controller/HouseholdController.php @@ -37,7 +37,7 @@ use function count; */ class HouseholdController extends AbstractController { - public function __construct(private TranslatorInterface $translator, private PositionRepository $positionRepository, private SerializerInterface $serializer, private Security $security) + public function __construct(private readonly TranslatorInterface $translator, private readonly PositionRepository $positionRepository, private readonly SerializerInterface $serializer, private readonly Security $security) { } diff --git a/src/Bundle/ChillPersonBundle/Controller/HouseholdMemberController.php b/src/Bundle/ChillPersonBundle/Controller/HouseholdMemberController.php index 24cda5fc1..0506feda1 100644 --- a/src/Bundle/ChillPersonBundle/Controller/HouseholdMemberController.php +++ b/src/Bundle/ChillPersonBundle/Controller/HouseholdMemberController.php @@ -32,7 +32,7 @@ use function count; class HouseholdMemberController extends ApiController { - public function __construct(private UrlGeneratorInterface $generator, private TranslatorInterface $translator, private AccompanyingPeriodRepository $periodRepository) + public function __construct(private readonly UrlGeneratorInterface $generator, private readonly TranslatorInterface $translator, private readonly AccompanyingPeriodRepository $periodRepository) { } diff --git a/src/Bundle/ChillPersonBundle/Controller/PersonApiController.php b/src/Bundle/ChillPersonBundle/Controller/PersonApiController.php index a3513fc1a..f7265537d 100644 --- a/src/Bundle/ChillPersonBundle/Controller/PersonApiController.php +++ b/src/Bundle/ChillPersonBundle/Controller/PersonApiController.php @@ -27,11 +27,11 @@ use function in_array; class PersonApiController extends ApiController { - private bool $showCenters; + private readonly bool $showCenters; public function __construct( - private AuthorizedCenterOnPersonCreationInterface $authorizedCenterOnPersonCreation, - private ConfigPersonAltNamesHelper $configPersonAltNameHelper, + private readonly AuthorizedCenterOnPersonCreationInterface $authorizedCenterOnPersonCreation, + private readonly ConfigPersonAltNamesHelper $configPersonAltNameHelper, ParameterBagInterface $parameterBag ) { $this->showCenters = $parameterBag->get('chill_main')['acl']['form_show_centers']; diff --git a/src/Bundle/ChillPersonBundle/Controller/PersonController.php b/src/Bundle/ChillPersonBundle/Controller/PersonController.php index 016577130..448eb4f01 100644 --- a/src/Bundle/ChillPersonBundle/Controller/PersonController.php +++ b/src/Bundle/ChillPersonBundle/Controller/PersonController.php @@ -48,7 +48,7 @@ use function is_array; final class PersonController extends AbstractController { public function __construct( - private AuthorizationHelperInterface $authorizationHelper, + private readonly AuthorizationHelperInterface $authorizationHelper, protected SimilarPersonMatcher $similarPersonMatcher, protected TranslatorInterface $translator, protected EventDispatcherInterface $eventDispatcher, @@ -57,9 +57,9 @@ final class PersonController extends AbstractController */ protected PersonRepository $personRepository, protected ConfigPersonAltNamesHelper $configPersonAltNameHelper, - private LoggerInterface $logger, - private ValidatorInterface $validator, - private EntityManagerInterface $em + private readonly LoggerInterface $logger, + private readonly ValidatorInterface $validator, + private readonly EntityManagerInterface $em ) { } diff --git a/src/Bundle/ChillPersonBundle/Controller/PersonDuplicateController.php b/src/Bundle/ChillPersonBundle/Controller/PersonDuplicateController.php index d699937f4..aa7171639 100644 --- a/src/Bundle/ChillPersonBundle/Controller/PersonDuplicateController.php +++ b/src/Bundle/ChillPersonBundle/Controller/PersonDuplicateController.php @@ -34,7 +34,7 @@ use function count; class PersonDuplicateController extends Controller { - public function __construct(private SimilarPersonMatcher $similarPersonMatcher, private TranslatorInterface $translator, private PersonRepository $personRepository, private PersonMove $personMove, private EventDispatcherInterface $eventDispatcher) + public function __construct(private readonly SimilarPersonMatcher $similarPersonMatcher, private readonly TranslatorInterface $translator, private readonly PersonRepository $personRepository, private readonly PersonMove $personMove, private readonly EventDispatcherInterface $eventDispatcher) { } diff --git a/src/Bundle/ChillPersonBundle/Controller/PersonResourceController.php b/src/Bundle/ChillPersonBundle/Controller/PersonResourceController.php index a1b852ba0..432852331 100644 --- a/src/Bundle/ChillPersonBundle/Controller/PersonResourceController.php +++ b/src/Bundle/ChillPersonBundle/Controller/PersonResourceController.php @@ -25,7 +25,7 @@ use Symfony\Contracts\Translation\TranslatorInterface; final class PersonResourceController extends AbstractController { - public function __construct(private PersonResourceRepository $personResourceRepository, private PersonRepository $personRepository, private EntityManagerInterface $em, private TranslatorInterface $translator) + public function __construct(private readonly PersonResourceRepository $personResourceRepository, private readonly PersonRepository $personRepository, private readonly EntityManagerInterface $em, private readonly TranslatorInterface $translator) { } diff --git a/src/Bundle/ChillPersonBundle/Controller/ReassignAccompanyingPeriodController.php b/src/Bundle/ChillPersonBundle/Controller/ReassignAccompanyingPeriodController.php index 2a90c57a8..6bfd7ac86 100644 --- a/src/Bundle/ChillPersonBundle/Controller/ReassignAccompanyingPeriodController.php +++ b/src/Bundle/ChillPersonBundle/Controller/ReassignAccompanyingPeriodController.php @@ -40,7 +40,7 @@ use function is_int; class ReassignAccompanyingPeriodController extends AbstractController { - public function __construct(private AccompanyingPeriodACLAwareRepositoryInterface $accompanyingPeriodACLAwareRepository, private UserRepository $userRepository, private AccompanyingPeriodRepository $courseRepository, private EngineInterface $engine, private FormFactoryInterface $formFactory, private PaginatorFactory $paginatorFactory, private Security $security, private UserRender $userRender, private EntityManagerInterface $em) + public function __construct(private readonly AccompanyingPeriodACLAwareRepositoryInterface $accompanyingPeriodACLAwareRepository, private readonly UserRepository $userRepository, private readonly AccompanyingPeriodRepository $courseRepository, private readonly EngineInterface $engine, private readonly FormFactoryInterface $formFactory, private readonly PaginatorFactory $paginatorFactory, private readonly Security $security, private readonly UserRender $userRender, private readonly EntityManagerInterface $em) { } @@ -84,7 +84,7 @@ class ReassignAccompanyingPeriodController extends AbstractController $assignForm->handleRequest($request); if ($assignForm->isSubmitted() && $assignForm->isValid()) { - $assignPeriodIds = json_decode($assignForm->get('periods')->getData(), true, 512, JSON_THROW_ON_ERROR); + $assignPeriodIds = json_decode((string) $assignForm->get('periods')->getData(), true, 512, JSON_THROW_ON_ERROR); $userTo = $assignForm->get('userTo')->getData(); $userFrom = $assignForm->get('userFrom')->getData(); diff --git a/src/Bundle/ChillPersonBundle/Controller/RelationshipApiController.php b/src/Bundle/ChillPersonBundle/Controller/RelationshipApiController.php index 4d11e2620..eac149245 100644 --- a/src/Bundle/ChillPersonBundle/Controller/RelationshipApiController.php +++ b/src/Bundle/ChillPersonBundle/Controller/RelationshipApiController.php @@ -21,7 +21,7 @@ use Symfony\Component\Validator\Validator\ValidatorInterface; class RelationshipApiController extends ApiController { - public function __construct(private ValidatorInterface $validator, private RelationshipRepository $repository) + public function __construct(private readonly ValidatorInterface $validator, private readonly RelationshipRepository $repository) { } diff --git a/src/Bundle/ChillPersonBundle/Controller/ResidentialAddressController.php b/src/Bundle/ChillPersonBundle/Controller/ResidentialAddressController.php index 7daf926fc..6d2b92438 100644 --- a/src/Bundle/ChillPersonBundle/Controller/ResidentialAddressController.php +++ b/src/Bundle/ChillPersonBundle/Controller/ResidentialAddressController.php @@ -27,7 +27,7 @@ use Symfony\Contracts\Translation\TranslatorInterface; final class ResidentialAddressController extends AbstractController { - public function __construct(private UrlGeneratorInterface $generator, private TranslatorInterface $translator, private ResidentialAddressRepository $residentialAddressRepository) + public function __construct(private readonly UrlGeneratorInterface $generator, private readonly TranslatorInterface $translator, private readonly ResidentialAddressRepository $residentialAddressRepository) { } diff --git a/src/Bundle/ChillPersonBundle/Controller/SocialWorkEvaluationApiController.php b/src/Bundle/ChillPersonBundle/Controller/SocialWorkEvaluationApiController.php index 8bfc90c0b..56ca54564 100644 --- a/src/Bundle/ChillPersonBundle/Controller/SocialWorkEvaluationApiController.php +++ b/src/Bundle/ChillPersonBundle/Controller/SocialWorkEvaluationApiController.php @@ -22,7 +22,7 @@ use Symfony\Component\Routing\Annotation\Route; class SocialWorkEvaluationApiController extends AbstractController { - public function __construct(private PaginatorFactory $paginatorFactory) + public function __construct(private readonly PaginatorFactory $paginatorFactory) { } diff --git a/src/Bundle/ChillPersonBundle/Controller/SocialWorkGoalApiController.php b/src/Bundle/ChillPersonBundle/Controller/SocialWorkGoalApiController.php index 45165eec4..cbbd9a748 100644 --- a/src/Bundle/ChillPersonBundle/Controller/SocialWorkGoalApiController.php +++ b/src/Bundle/ChillPersonBundle/Controller/SocialWorkGoalApiController.php @@ -21,7 +21,7 @@ use Symfony\Component\HttpFoundation\Response; class SocialWorkGoalApiController extends ApiController { - public function __construct(private GoalRepository $goalRepository, private PaginatorFactory $paginator) + public function __construct(private readonly GoalRepository $goalRepository, private readonly PaginatorFactory $paginator) { } diff --git a/src/Bundle/ChillPersonBundle/Controller/SocialWorkResultApiController.php b/src/Bundle/ChillPersonBundle/Controller/SocialWorkResultApiController.php index 397164707..aaedfd330 100644 --- a/src/Bundle/ChillPersonBundle/Controller/SocialWorkResultApiController.php +++ b/src/Bundle/ChillPersonBundle/Controller/SocialWorkResultApiController.php @@ -21,7 +21,7 @@ use Symfony\Component\HttpFoundation\Response; class SocialWorkResultApiController extends ApiController { - public function __construct(private ResultRepository $resultRepository) + public function __construct(private readonly ResultRepository $resultRepository) { } diff --git a/src/Bundle/ChillPersonBundle/Controller/SocialWorkSocialActionApiController.php b/src/Bundle/ChillPersonBundle/Controller/SocialWorkSocialActionApiController.php index 09f34dce9..dc28d0f1b 100644 --- a/src/Bundle/ChillPersonBundle/Controller/SocialWorkSocialActionApiController.php +++ b/src/Bundle/ChillPersonBundle/Controller/SocialWorkSocialActionApiController.php @@ -23,7 +23,7 @@ use function count; class SocialWorkSocialActionApiController extends ApiController { - public function __construct(private SocialIssueRepository $socialIssueRepository, private PaginatorFactory $paginator) + public function __construct(private readonly SocialIssueRepository $socialIssueRepository, private readonly PaginatorFactory $paginator) { } diff --git a/src/Bundle/ChillPersonBundle/Controller/UserAccompanyingPeriodController.php b/src/Bundle/ChillPersonBundle/Controller/UserAccompanyingPeriodController.php index 4a8580d30..bee1c6262 100644 --- a/src/Bundle/ChillPersonBundle/Controller/UserAccompanyingPeriodController.php +++ b/src/Bundle/ChillPersonBundle/Controller/UserAccompanyingPeriodController.php @@ -19,7 +19,7 @@ use Symfony\Component\Routing\Annotation\Route; class UserAccompanyingPeriodController extends AbstractController { - public function __construct(private AccompanyingPeriodRepository $accompanyingPeriodRepository, private PaginatorFactory $paginatorFactory) + public function __construct(private readonly AccompanyingPeriodRepository $accompanyingPeriodRepository, private readonly PaginatorFactory $paginatorFactory) { } diff --git a/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadAccompanyingPeriodOrigin.php b/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadAccompanyingPeriodOrigin.php index e55acc13b..84a2d835c 100644 --- a/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadAccompanyingPeriodOrigin.php +++ b/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadAccompanyingPeriodOrigin.php @@ -21,7 +21,7 @@ use Doctrine\Persistence\ObjectManager; */ class LoadAccompanyingPeriodOrigin extends AbstractFixture implements OrderedFixtureInterface { - public const ACCOMPANYING_PERIOD_ORIGIN = 'accompanying_period_origin'; + final public const ACCOMPANYING_PERIOD_ORIGIN = 'accompanying_period_origin'; public static $references = []; diff --git a/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadAccompanyingPeriodWork.php b/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadAccompanyingPeriodWork.php index 06e1aab71..64fc73d3e 100644 --- a/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadAccompanyingPeriodWork.php +++ b/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadAccompanyingPeriodWork.php @@ -31,7 +31,7 @@ class LoadAccompanyingPeriodWork extends \Doctrine\Bundle\FixturesBundle\Fixture */ private array $cacheEvaluations = []; - public function __construct(private AccompanyingPeriodRepository $periodRepository, private EvaluationRepository $evaluationRepository) + public function __construct(private readonly AccompanyingPeriodRepository $periodRepository, private readonly EvaluationRepository $evaluationRepository) { } diff --git a/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadCustomFields.php b/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadCustomFields.php index e229fb877..e200bc1f8 100644 --- a/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadCustomFields.php +++ b/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadCustomFields.php @@ -49,7 +49,7 @@ class LoadCustomFields extends AbstractFixture implements /** * LoadCustomFields constructor. */ - public function __construct(private TranslatableStringHelper $translatableStringHelper, private TranslatorInterface $translator) + public function __construct(private readonly TranslatableStringHelper $translatableStringHelper, private readonly TranslatorInterface $translator) { } diff --git a/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadHousehold.php b/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadHousehold.php index b619de76d..274aa7638 100644 --- a/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadHousehold.php +++ b/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadHousehold.php @@ -37,11 +37,11 @@ class LoadHousehold extends Fixture implements DependentFixtureInterface { private const NUMBER_OF_HOUSEHOLD = 10; - private NativeLoader $loader; + private readonly NativeLoader $loader; private array $personIds; - public function __construct(private MembersEditorFactory $editorFactory, private EntityManagerInterface $em) + public function __construct(private readonly MembersEditorFactory $editorFactory, private readonly EntityManagerInterface $em) { $this->loader = new NativeLoader(); } diff --git a/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadHouseholdCompositionType.php b/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadHouseholdCompositionType.php index 720e7ca38..c985f26d3 100644 --- a/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadHouseholdCompositionType.php +++ b/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadHouseholdCompositionType.php @@ -18,7 +18,7 @@ use Doctrine\Persistence\ObjectManager; class LoadHouseholdCompositionType extends AbstractFixture implements FixtureGroupInterface { - public const TYPES = [ + final public const TYPES = [ ['fr' => 'Couple avec enfant(s)'], ['fr' => 'Couple sans enfant'], ['fr' => 'Mère seule'], diff --git a/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadHouseholdPosition.php b/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadHouseholdPosition.php index cb1affa85..f5c28c8c2 100644 --- a/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadHouseholdPosition.php +++ b/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadHouseholdPosition.php @@ -17,13 +17,13 @@ use Doctrine\Persistence\ObjectManager; class LoadHouseholdPosition extends Fixture { - public const ADULT = 'position_adulte'; + final public const ADULT = 'position_adulte'; - public const CHILD = 'position_enfant'; + final public const CHILD = 'position_enfant'; - public const CHILD_OUT = 'position_enfant_hors'; + final public const CHILD_OUT = 'position_enfant_hors'; - public const POSITIONS_DATA = [ + final public const POSITIONS_DATA = [ ['Adulte', true, true, 1.0, self::ADULT], ['Enfant', true, false, 2.0, self::CHILD], ['Enfant hors ménage', false, false, 3.0, self::CHILD_OUT], diff --git a/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadPeople.php b/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadPeople.php index c658a6510..4ef2fde7f 100644 --- a/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadPeople.php +++ b/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadPeople.php @@ -54,7 +54,7 @@ class LoadPeople extends AbstractFixture implements ContainerAwareInterface, Ord { use \Symfony\Component\DependencyInjection\ContainerAwareTrait; - public const PERSON = 'person'; + final public const PERSON = 'person'; /** * @var array|Center[] diff --git a/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadRelations.php b/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadRelations.php index 480238639..7a05f7f6a 100644 --- a/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadRelations.php +++ b/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadRelations.php @@ -18,9 +18,9 @@ use Doctrine\Persistence\ObjectManager; class LoadRelations extends Fixture implements FixtureGroupInterface { - public const RELATION_KEY = 'relations'; + final public const RELATION_KEY = 'relations'; - public const RELATIONS = [ + final public const RELATIONS = [ ['title' => ['fr' => 'Parent'], 'reverseTitle' => ['fr' => 'Enfant']], ['title' => ['fr' => 'En couple'], 'reverseTitle' => ['fr' => 'En couple']], ['title' => ['fr' => 'Beau parent'], 'reverseTitle' => ['fr' => 'Belle-fille·beau-fils']], diff --git a/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadRelationships.php b/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadRelationships.php index 65d79b243..151ecf0c2 100644 --- a/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadRelationships.php +++ b/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadRelationships.php @@ -28,7 +28,7 @@ class LoadRelationships extends Fixture implements DependentFixtureInterface { use PersonRandomHelper; - public function __construct(private EntityManagerInterface $em) + public function __construct(private readonly EntityManagerInterface $em) { } diff --git a/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadSocialWorkMetadata.php b/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadSocialWorkMetadata.php index 9605ce6f6..2ad47fc20 100644 --- a/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadSocialWorkMetadata.php +++ b/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadSocialWorkMetadata.php @@ -21,7 +21,7 @@ use Throwable; class LoadSocialWorkMetadata extends Fixture implements OrderedFixtureInterface { - public function __construct(private SocialWorkMetadata $importer) + public function __construct(private readonly SocialWorkMetadata $importer) { } diff --git a/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod.php b/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod.php index f4c36e7b7..6b3d9c078 100644 --- a/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod.php +++ b/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod.php @@ -77,21 +77,21 @@ class AccompanyingPeriod implements TrackCreationInterface, TrackUpdateInterface { - public const INTENSITIES = [self::INTENSITY_OCCASIONAL, self::INTENSITY_REGULAR]; + final public const INTENSITIES = [self::INTENSITY_OCCASIONAL, self::INTENSITY_REGULAR]; /** * Mark an accompanying period as "occasional". * * used in INTENSITY */ - public const INTENSITY_OCCASIONAL = 'occasional'; + final public const INTENSITY_OCCASIONAL = 'occasional'; /** * Mark an accompanying period as "regular". * * used in INTENSITY */ - public const INTENSITY_REGULAR = 'regular'; + final public const INTENSITY_REGULAR = 'regular'; /** * Mark an accompanying period as "closed". @@ -99,7 +99,7 @@ class AccompanyingPeriod implements * This means that the accompanying period **is** * closed by the creator */ - public const STEP_CLOSED = 'CLOSED'; + final public const STEP_CLOSED = 'CLOSED'; /** * Mark an accompanying period as "confirmed". @@ -107,7 +107,7 @@ class AccompanyingPeriod implements * This means that the accompanying period **is** * confirmed by the creator */ - public const STEP_CONFIRMED = 'CONFIRMED'; + final public const STEP_CONFIRMED = 'CONFIRMED'; /** * Mark an accompanying period as "draft". @@ -115,7 +115,7 @@ class AccompanyingPeriod implements * This means that the accompanying period is not yet * confirmed by the creator */ - public const STEP_DRAFT = 'DRAFT'; + final public const STEP_DRAFT = 'DRAFT'; /** * @ORM\ManyToOne( diff --git a/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/UserHistory.php b/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/UserHistory.php index e2325aaa0..5224722e7 100644 --- a/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/UserHistory.php +++ b/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/UserHistory.php @@ -38,23 +38,19 @@ class UserHistory implements TrackCreationInterface */ private ?int $id = null; - /** - * @ORM\Column(type="datetime_immutable", nullable=false) - */ - private DateTimeImmutable $startDate; - - public function __construct(/** - * @ORM\ManyToOne(targetEntity=AccompanyingPeriod::class, inversedBy="userHistories") - * @ORM\JoinColumn(nullable=false) - */ - private ?\Chill\PersonBundle\Entity\AccompanyingPeriod $accompanyingPeriod, /** - * @ORM\ManyToOne(targetEntity=User::class) - * @ORM\JoinColumn(nullable=false) - */ + public function __construct( + /** + * @ORM\ManyToOne(targetEntity=AccompanyingPeriod::class, inversedBy="userHistories") + * @ORM\JoinColumn(nullable=false) + */ + private ?\Chill\PersonBundle\Entity\AccompanyingPeriod $accompanyingPeriod, + /** + * @ORM\ManyToOne(targetEntity=User::class) + * @ORM\JoinColumn(nullable=false) + */ private User $user, - ?DateTimeImmutable $startDate = null + private DateTimeImmutable $startDate = new DateTimeImmutable('now') ) { - $this->startDate = $startDate ?? new DateTimeImmutable('now'); } public function getAccompanyingPeriod(): AccompanyingPeriod diff --git a/src/Bundle/ChillPersonBundle/Entity/Person.php b/src/Bundle/ChillPersonBundle/Entity/Person.php index ac8988c26..89996a18e 100644 --- a/src/Bundle/ChillPersonBundle/Entity/Person.php +++ b/src/Bundle/ChillPersonBundle/Entity/Person.php @@ -76,18 +76,18 @@ use function in_array; */ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateInterface, \Stringable { - public const BOTH_GENDER = 'both'; + final public const BOTH_GENDER = 'both'; // have days in commun - public const ERROR_ADDIND_PERIOD_AFTER_AN_OPEN_PERIOD = 2; // where there exist + final public const ERROR_ADDIND_PERIOD_AFTER_AN_OPEN_PERIOD = 2; // where there exist - public const ERROR_PERIODS_ARE_COLLAPSING = 1; // when two different periods + final public const ERROR_PERIODS_ARE_COLLAPSING = 1; // when two different periods - public const FEMALE_GENDER = 'woman'; + final public const FEMALE_GENDER = 'woman'; - public const MALE_GENDER = 'man'; + final public const MALE_GENDER = 'man'; - public const NO_INFORMATION = 'unknown'; + final public const NO_INFORMATION = 'unknown'; /** * Accept receiving email. diff --git a/src/Bundle/ChillPersonBundle/Event/Person/PersonAddressMoveEvent.php b/src/Bundle/ChillPersonBundle/Event/Person/PersonAddressMoveEvent.php index 1242e61ef..5968832c2 100644 --- a/src/Bundle/ChillPersonBundle/Event/Person/PersonAddressMoveEvent.php +++ b/src/Bundle/ChillPersonBundle/Event/Person/PersonAddressMoveEvent.php @@ -21,7 +21,7 @@ use Symfony\Contracts\EventDispatcher\Event; class PersonAddressMoveEvent extends Event { - public const PERSON_MOVE_POST = 'chill_person.person_move_post'; + final public const PERSON_MOVE_POST = 'chill_person.person_move_post'; private ?Address $nextAddress = null; @@ -31,7 +31,7 @@ class PersonAddressMoveEvent extends Event private ?HouseholdMember $previousMembership = null; - public function __construct(private Person $person) + public function __construct(private readonly Person $person) { } diff --git a/src/Bundle/ChillPersonBundle/EventListener/AccompanyingPeriodWorkEventListener.php b/src/Bundle/ChillPersonBundle/EventListener/AccompanyingPeriodWorkEventListener.php index 2776faf43..60d521424 100644 --- a/src/Bundle/ChillPersonBundle/EventListener/AccompanyingPeriodWorkEventListener.php +++ b/src/Bundle/ChillPersonBundle/EventListener/AccompanyingPeriodWorkEventListener.php @@ -17,7 +17,7 @@ use Symfony\Component\Security\Core\Security; class AccompanyingPeriodWorkEventListener { - public function __construct(private Security $security) + public function __construct(private readonly Security $security) { } diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/AdministrativeLocationAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/AdministrativeLocationAggregator.php index d01190ba4..27b0c9b93 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/AdministrativeLocationAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/AdministrativeLocationAggregator.php @@ -21,7 +21,7 @@ use function in_array; class AdministrativeLocationAggregator implements AggregatorInterface { - public function __construct(private LocationRepository $locationRepository, private TranslatableStringHelper $translatableStringHelper) + public function __construct(private readonly LocationRepository $locationRepository, private readonly TranslatableStringHelper $translatableStringHelper) { } diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/ClosingMotiveAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/ClosingMotiveAggregator.php index b2703836e..758e93a9d 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/ClosingMotiveAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/ClosingMotiveAggregator.php @@ -20,7 +20,7 @@ use Symfony\Component\Form\FormBuilderInterface; class ClosingMotiveAggregator implements AggregatorInterface { - public function __construct(private ClosingMotiveRepositoryInterface $motiveRepository, private TranslatableStringHelper $translatableStringHelper) + public function __construct(private readonly ClosingMotiveRepositoryInterface $motiveRepository, private readonly TranslatableStringHelper $translatableStringHelper) { } diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/ConfidentialAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/ConfidentialAggregator.php index a4279fc05..ed1f2727c 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/ConfidentialAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/ConfidentialAggregator.php @@ -20,7 +20,7 @@ use Symfony\Contracts\Translation\TranslatorInterface; class ConfidentialAggregator implements AggregatorInterface { - public function __construct(private TranslatorInterface $translator) + public function __construct(private readonly TranslatorInterface $translator) { } diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/CreatorJobAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/CreatorJobAggregator.php index 87e119419..edd6239f5 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/CreatorJobAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/CreatorJobAggregator.php @@ -21,7 +21,7 @@ use function in_array; class CreatorJobAggregator implements AggregatorInterface { - public function __construct(private UserJobRepository $jobRepository, private TranslatableStringHelper $translatableStringHelper) + public function __construct(private readonly UserJobRepository $jobRepository, private readonly TranslatableStringHelper $translatableStringHelper) { } diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/DurationAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/DurationAggregator.php index ce61739f0..a5eba39fa 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/DurationAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/DurationAggregator.php @@ -20,7 +20,7 @@ use Symfony\Component\Form\Extension\Core\Type\ChoiceType; use Symfony\Component\Form\FormBuilderInterface; use Symfony\Contracts\Translation\TranslatorInterface; -final class DurationAggregator implements AggregatorInterface +final readonly class DurationAggregator implements AggregatorInterface { private const CHOICES = [ 'month', diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/EmergencyAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/EmergencyAggregator.php index aeb369b5a..6a791b8ab 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/EmergencyAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/EmergencyAggregator.php @@ -20,7 +20,7 @@ use Symfony\Contracts\Translation\TranslatorInterface; class EmergencyAggregator implements AggregatorInterface { - public function __construct(private TranslatorInterface $translator) + public function __construct(private readonly TranslatorInterface $translator) { } diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/EvaluationAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/EvaluationAggregator.php index 47656c1d0..d9f873225 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/EvaluationAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/EvaluationAggregator.php @@ -19,7 +19,7 @@ use Doctrine\ORM\QueryBuilder; use Symfony\Component\Form\FormBuilderInterface; use function in_array; -final class EvaluationAggregator implements AggregatorInterface +final readonly class EvaluationAggregator implements AggregatorInterface { public function __construct(private EvaluationRepository $evaluationRepository, private TranslatableStringHelper $translatableStringHelper) { diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/GeographicalUnitStatAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/GeographicalUnitStatAggregator.php index 3395247de..b05e9557c 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/GeographicalUnitStatAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/GeographicalUnitStatAggregator.php @@ -27,7 +27,7 @@ use Symfony\Bridge\Doctrine\Form\Type\EntityType; use Symfony\Component\Form\FormBuilderInterface; use UnexpectedValueException; -final class GeographicalUnitStatAggregator implements AggregatorInterface +final readonly class GeographicalUnitStatAggregator implements AggregatorInterface { public function __construct(private GeographicalUnitLayerRepositoryInterface $geographicalUnitLayerRepository, private TranslatableStringHelperInterface $translatableStringHelper, private RollingDateConverterInterface $rollingDateConverter) { diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/IntensityAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/IntensityAggregator.php index 2d9adc801..88ad95fb2 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/IntensityAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/IntensityAggregator.php @@ -20,7 +20,7 @@ use Symfony\Contracts\Translation\TranslatorInterface; class IntensityAggregator implements AggregatorInterface { - public function __construct(private TranslatorInterface $translator) + public function __construct(private readonly TranslatorInterface $translator) { } diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/OriginAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/OriginAggregator.php index e6cb9cac6..c0e92eca9 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/OriginAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/OriginAggregator.php @@ -23,11 +23,11 @@ use function in_array; final class OriginAggregator implements AggregatorInterface { - private EntityRepository $repository; + private readonly EntityRepository $repository; public function __construct( EntityManagerInterface $em, - private TranslatableStringHelper $translatableStringHelper + private readonly TranslatableStringHelper $translatableStringHelper ) { $this->repository = $em->getRepository(Origin::class); } diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/ReferrerAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/ReferrerAggregator.php index db12bbb0c..1e1b24aae 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/ReferrerAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/ReferrerAggregator.php @@ -21,7 +21,7 @@ use Chill\PersonBundle\Export\Declarations; use Doctrine\ORM\QueryBuilder; use Symfony\Component\Form\FormBuilderInterface; -final class ReferrerAggregator implements AggregatorInterface +final readonly class ReferrerAggregator implements AggregatorInterface { private const A = 'acp_ref_agg_uhistory'; diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/ReferrerScopeAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/ReferrerScopeAggregator.php index 6e788d714..84670ee01 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/ReferrerScopeAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/ReferrerScopeAggregator.php @@ -26,7 +26,7 @@ class ReferrerScopeAggregator implements AggregatorInterface { private const SCOPE_KEY = 'acp_agg_refscope_user_history_ref_scope_name'; - public function __construct(private ScopeRepositoryInterface $scopeRepository, private TranslatableStringHelperInterface $translatableStringHelper, private RollingDateConverterInterface $rollingDateConverter) + public function __construct(private readonly ScopeRepositoryInterface $scopeRepository, private readonly TranslatableStringHelperInterface $translatableStringHelper, private readonly RollingDateConverterInterface $rollingDateConverter) { } diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/RequestorAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/RequestorAggregator.php index 5555671d3..0c3292d68 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/RequestorAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/RequestorAggregator.php @@ -18,7 +18,7 @@ use Symfony\Component\Form\FormBuilderInterface; use Symfony\Contracts\Translation\TranslatorInterface; use function in_array; -final class RequestorAggregator implements AggregatorInterface +final readonly class RequestorAggregator implements AggregatorInterface { public function __construct(private TranslatorInterface $translator) { diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/ScopeAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/ScopeAggregator.php index d3f7783f3..3ee220255 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/ScopeAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/ScopeAggregator.php @@ -19,7 +19,7 @@ use Doctrine\ORM\QueryBuilder; use Symfony\Component\Form\FormBuilderInterface; use function in_array; -final class ScopeAggregator implements AggregatorInterface +final readonly class ScopeAggregator implements AggregatorInterface { public function __construct(private ScopeRepository $scopeRepository, private TranslatableStringHelper $translatableStringHelper) { diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/SocialActionAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/SocialActionAggregator.php index e088be7ce..771e29396 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/SocialActionAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/SocialActionAggregator.php @@ -19,7 +19,7 @@ use Doctrine\ORM\QueryBuilder; use Symfony\Component\Form\FormBuilderInterface; use function in_array; -final class SocialActionAggregator implements AggregatorInterface +final readonly class SocialActionAggregator implements AggregatorInterface { public function __construct(private SocialActionRender $actionRender, private SocialActionRepository $actionRepository) { diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/SocialIssueAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/SocialIssueAggregator.php index 4ce7dfcd0..ad3197d38 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/SocialIssueAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/SocialIssueAggregator.php @@ -19,7 +19,7 @@ use Doctrine\ORM\QueryBuilder; use Symfony\Component\Form\FormBuilderInterface; use function in_array; -final class SocialIssueAggregator implements AggregatorInterface +final readonly class SocialIssueAggregator implements AggregatorInterface { public function __construct(private SocialIssueRepository $issueRepository, private SocialIssueRender $issueRender) { diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/StepAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/StepAggregator.php index 4fb7a38b8..5a49df05c 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/StepAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/StepAggregator.php @@ -22,7 +22,7 @@ use Symfony\Component\Form\FormBuilderInterface; use Symfony\Contracts\Translation\TranslatorInterface; use function in_array; -final class StepAggregator implements AggregatorInterface +final readonly class StepAggregator implements AggregatorInterface { private const A = 'acpstephistories'; diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/UserJobAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/UserJobAggregator.php index 97a8b228e..e75482bff 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/UserJobAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/UserJobAggregator.php @@ -19,7 +19,7 @@ use Doctrine\ORM\QueryBuilder; use Symfony\Component\Form\FormBuilderInterface; use function in_array; -final class UserJobAggregator implements AggregatorInterface +final readonly class UserJobAggregator implements AggregatorInterface { public function __construct(private UserJobRepository $jobRepository, private TranslatableStringHelper $translatableStringHelper) { diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/EvaluationAggregators/ByEndDateAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/EvaluationAggregators/ByEndDateAggregator.php index c8dd3b611..0113de714 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/EvaluationAggregators/ByEndDateAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/EvaluationAggregators/ByEndDateAggregator.php @@ -29,8 +29,6 @@ class ByEndDateAggregator implements AggregatorInterface private const DEFAULT_CHOICE = 'year'; - private TranslatorInterface $translator; - public function addRole(): ?string { return null; diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/EvaluationAggregators/ByMaxDateAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/EvaluationAggregators/ByMaxDateAggregator.php index 07498f026..56f71c297 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/EvaluationAggregators/ByMaxDateAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/EvaluationAggregators/ByMaxDateAggregator.php @@ -29,8 +29,6 @@ class ByMaxDateAggregator implements AggregatorInterface private const DEFAULT_CHOICE = 'year'; - private TranslatorInterface $translator; - public function addRole(): ?string { return null; diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/EvaluationAggregators/ByStartDateAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/EvaluationAggregators/ByStartDateAggregator.php index d5317feb6..d2ea6a559 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/EvaluationAggregators/ByStartDateAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/EvaluationAggregators/ByStartDateAggregator.php @@ -29,8 +29,6 @@ class ByStartDateAggregator implements AggregatorInterface private const DEFAULT_CHOICE = 'year'; - private TranslatorInterface $translator; - public function addRole(): ?string { return null; diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/EvaluationAggregators/EvaluationTypeAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/EvaluationAggregators/EvaluationTypeAggregator.php index 2201cd747..2980e3d90 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/EvaluationAggregators/EvaluationTypeAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/EvaluationAggregators/EvaluationTypeAggregator.php @@ -20,7 +20,7 @@ use Symfony\Component\Form\FormBuilderInterface; class EvaluationTypeAggregator implements AggregatorInterface { - public function __construct(private EvaluationRepository $evaluationRepository, private TranslatableStringHelper $translatableStringHelper) + public function __construct(private readonly EvaluationRepository $evaluationRepository, private readonly TranslatableStringHelper $translatableStringHelper) { } diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/EvaluationAggregators/HavingEndDateAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/EvaluationAggregators/HavingEndDateAggregator.php index 9bc91f099..c0c31a5fd 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/EvaluationAggregators/HavingEndDateAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/EvaluationAggregators/HavingEndDateAggregator.php @@ -20,7 +20,7 @@ use Symfony\Contracts\Translation\TranslatorInterface; class HavingEndDateAggregator implements AggregatorInterface { - public function __construct(private TranslatorInterface $translator) + public function __construct(private readonly TranslatorInterface $translator) { } diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/HouseholdAggregators/ChildrenNumberAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/HouseholdAggregators/ChildrenNumberAggregator.php index 7b4b3c646..2037716aa 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/HouseholdAggregators/ChildrenNumberAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/HouseholdAggregators/ChildrenNumberAggregator.php @@ -24,7 +24,7 @@ use function in_array; class ChildrenNumberAggregator implements AggregatorInterface { - public function __construct(private TranslatorInterface $translator, private RollingDateConverterInterface $rollingDateConverter) + public function __construct(private readonly TranslatorInterface $translator, private readonly RollingDateConverterInterface $rollingDateConverter) { } diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/HouseholdAggregators/CompositionAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/HouseholdAggregators/CompositionAggregator.php index 1d38dddd4..946844f4b 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/HouseholdAggregators/CompositionAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/HouseholdAggregators/CompositionAggregator.php @@ -25,7 +25,7 @@ use function in_array; class CompositionAggregator implements AggregatorInterface { - public function __construct(private HouseholdCompositionTypeRepository $typeRepository, private TranslatableStringHelper $translatableStringHelper, private RollingDateConverterInterface $rollingDateConverter) + public function __construct(private readonly HouseholdCompositionTypeRepository $typeRepository, private readonly TranslatableStringHelper $translatableStringHelper, private readonly RollingDateConverterInterface $rollingDateConverter) { } diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/AgeAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/AgeAggregator.php index 88cf2363a..5d361fc8f 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/AgeAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/AgeAggregator.php @@ -20,7 +20,7 @@ use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\Validator\Context\ExecutionContextInterface; use Symfony\Contracts\Translation\TranslatorInterface; -final class AgeAggregator implements AggregatorInterface, ExportElementValidatedInterface +final readonly class AgeAggregator implements AggregatorInterface, ExportElementValidatedInterface { public function __construct(private TranslatorInterface $translator) { diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/ByHouseholdCompositionAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/ByHouseholdCompositionAggregator.php index ccb4710e0..8f4191352 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/ByHouseholdCompositionAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/ByHouseholdCompositionAggregator.php @@ -27,7 +27,7 @@ class ByHouseholdCompositionAggregator implements AggregatorInterface { private const PREFIX = 'acp_by_household_compo_agg'; - public function __construct(private RollingDateConverterInterface $rollingDateConverter, private HouseholdCompositionTypeRepositoryInterface $householdCompositionTypeRepository, private TranslatableStringHelperInterface $translatableStringHelper) + public function __construct(private readonly RollingDateConverterInterface $rollingDateConverter, private readonly HouseholdCompositionTypeRepositoryInterface $householdCompositionTypeRepository, private readonly TranslatableStringHelperInterface $translatableStringHelper) { } diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/CountryOfBirthAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/CountryOfBirthAggregator.php index 25b01b3f7..de3747582 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/CountryOfBirthAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/CountryOfBirthAggregator.php @@ -25,7 +25,7 @@ use Symfony\Component\Validator\Context\ExecutionContextInterface; use Symfony\Contracts\Translation\TranslatorInterface; use function in_array; -final class CountryOfBirthAggregator implements AggregatorInterface, ExportElementValidatedInterface +final readonly class CountryOfBirthAggregator implements AggregatorInterface, ExportElementValidatedInterface { public function __construct(private CountryRepository $countriesRepository, private TranslatableStringHelper $translatableStringHelper, private TranslatorInterface $translator) { diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/GenderAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/GenderAggregator.php index 60ab87fed..988639571 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/GenderAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/GenderAggregator.php @@ -19,7 +19,7 @@ use LogicException; use Symfony\Component\Form\FormBuilderInterface; use Symfony\Contracts\Translation\TranslatorInterface; -final class GenderAggregator implements AggregatorInterface +final readonly class GenderAggregator implements AggregatorInterface { public function __construct(private TranslatorInterface $translator) { diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/GeographicalUnitAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/GeographicalUnitAggregator.php index e86524670..2911fc868 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/GeographicalUnitAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/GeographicalUnitAggregator.php @@ -26,7 +26,7 @@ use Symfony\Component\Form\FormBuilderInterface; class GeographicalUnitAggregator implements AggregatorInterface { - public function __construct(private GeographicalUnitLayerRepositoryInterface $geographicalUnitLayerRepository, private TranslatableStringHelperInterface $translatableStringHelper, private RollingDateConverterInterface $rollingDateConverter) + public function __construct(private readonly GeographicalUnitLayerRepositoryInterface $geographicalUnitLayerRepository, private readonly TranslatableStringHelperInterface $translatableStringHelper, private readonly RollingDateConverterInterface $rollingDateConverter) { } diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/HouseholdPositionAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/HouseholdPositionAggregator.php index 48a08b190..120f50722 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/HouseholdPositionAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/HouseholdPositionAggregator.php @@ -27,7 +27,7 @@ use Symfony\Component\Validator\Context\ExecutionContextInterface; use Symfony\Contracts\Translation\TranslatorInterface; use function in_array; -final class HouseholdPositionAggregator implements AggregatorInterface, ExportElementValidatedInterface +final readonly class HouseholdPositionAggregator implements AggregatorInterface, ExportElementValidatedInterface { public function __construct(private TranslatorInterface $translator, private TranslatableStringHelper $translatableStringHelper, private PositionRepository $positionRepository, private RollingDateConverterInterface $rollingDateConverter) { diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/MaritalStatusAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/MaritalStatusAggregator.php index 98049357a..96615a29d 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/MaritalStatusAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/MaritalStatusAggregator.php @@ -19,7 +19,7 @@ use Doctrine\ORM\QueryBuilder; use Symfony\Component\Form\FormBuilderInterface; use function in_array; -final class MaritalStatusAggregator implements AggregatorInterface +final readonly class MaritalStatusAggregator implements AggregatorInterface { public function __construct(private MaritalStatusRepository $maritalStatusRepository, private TranslatableStringHelper $translatableStringHelper) { diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/NationalityAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/NationalityAggregator.php index 14f5a5dd5..22c3e9ce7 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/NationalityAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/NationalityAggregator.php @@ -23,7 +23,7 @@ use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\Validator\Context\ExecutionContextInterface; use Symfony\Contracts\Translation\TranslatorInterface; -final class NationalityAggregator implements AggregatorInterface, ExportElementValidatedInterface +final readonly class NationalityAggregator implements AggregatorInterface, ExportElementValidatedInterface { public function __construct(private CountryRepository $countriesRepository, private TranslatableStringHelper $translatableStringHelper, private TranslatorInterface $translator) { diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/ActionTypeAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/ActionTypeAggregator.php index a1b384ffa..a5be01391 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/ActionTypeAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/ActionTypeAggregator.php @@ -22,7 +22,7 @@ use LogicException; use Symfony\Component\Form\FormBuilderInterface; use function in_array; -final class ActionTypeAggregator implements AggregatorInterface +final readonly class ActionTypeAggregator implements AggregatorInterface { public function __construct(private SocialActionRepository $socialActionRepository, private SocialActionRender $actionRender, private SocialIssueRender $socialIssueRender, private SocialIssueRepository $socialIssueRepository) { diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/CurrentActionAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/CurrentActionAggregator.php index 30d272c15..9bb252f07 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/CurrentActionAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/CurrentActionAggregator.php @@ -20,7 +20,7 @@ use Symfony\Contracts\Translation\TranslatorInterface; class CurrentActionAggregator implements AggregatorInterface { - public function __construct(private TranslatorInterface $translator) + public function __construct(private readonly TranslatorInterface $translator) { } diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/GoalAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/GoalAggregator.php index a63580cf7..9ac183b0d 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/GoalAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/GoalAggregator.php @@ -19,7 +19,7 @@ use Doctrine\ORM\QueryBuilder; use Symfony\Component\Form\FormBuilderInterface; use function in_array; -final class GoalAggregator implements AggregatorInterface +final readonly class GoalAggregator implements AggregatorInterface { public function __construct(private GoalRepository $goalRepository, private TranslatableStringHelper $translatableStringHelper) { diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/GoalResultAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/GoalResultAggregator.php index 7d3610c71..c6894ab8b 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/GoalResultAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/GoalResultAggregator.php @@ -23,7 +23,7 @@ use function in_array; class GoalResultAggregator implements AggregatorInterface { - public function __construct(private ResultRepository $resultRepository, private GoalRepository $goalRepository, private TranslatableStringHelper $translatableStringHelper) + public function __construct(private readonly ResultRepository $resultRepository, private readonly GoalRepository $goalRepository, private readonly TranslatableStringHelper $translatableStringHelper) { } diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/JobAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/JobAggregator.php index 314149829..eae7e8789 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/JobAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/JobAggregator.php @@ -19,7 +19,7 @@ use Doctrine\ORM\QueryBuilder; use Symfony\Component\Form\FormBuilderInterface; use function in_array; -final class JobAggregator implements AggregatorInterface +final readonly class JobAggregator implements AggregatorInterface { public function __construct(private UserJobRepository $jobRepository, private TranslatableStringHelper $translatableStringHelper) { diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/ReferrerAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/ReferrerAggregator.php index a7adf6802..5d301c5be 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/ReferrerAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/ReferrerAggregator.php @@ -19,7 +19,7 @@ use Doctrine\ORM\QueryBuilder; use Symfony\Component\Form\FormBuilderInterface; use function in_array; -final class ReferrerAggregator implements AggregatorInterface +final readonly class ReferrerAggregator implements AggregatorInterface { public function __construct(private UserRepository $userRepository, private UserRender $userRender) { diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/ResultAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/ResultAggregator.php index c621b0899..3a8b10581 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/ResultAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/ResultAggregator.php @@ -19,7 +19,7 @@ use Doctrine\ORM\QueryBuilder; use Symfony\Component\Form\FormBuilderInterface; use function in_array; -final class ResultAggregator implements AggregatorInterface +final readonly class ResultAggregator implements AggregatorInterface { public function __construct(private ResultRepository $resultRepository, private TranslatableStringHelper $translatableStringHelper) { diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/ScopeAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/ScopeAggregator.php index 1a085828f..9ec248caa 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/ScopeAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/ScopeAggregator.php @@ -19,7 +19,7 @@ use Doctrine\ORM\QueryBuilder; use Symfony\Component\Form\FormBuilderInterface; use function in_array; -final class ScopeAggregator implements AggregatorInterface +final readonly class ScopeAggregator implements AggregatorInterface { public function __construct(private ScopeRepository $scopeRepository, private TranslatableStringHelper $translatableStringHelper) { diff --git a/src/Bundle/ChillPersonBundle/Export/Declarations.php b/src/Bundle/ChillPersonBundle/Export/Declarations.php index 507f02041..a512700ee 100644 --- a/src/Bundle/ChillPersonBundle/Export/Declarations.php +++ b/src/Bundle/ChillPersonBundle/Export/Declarations.php @@ -16,15 +16,15 @@ namespace Chill\PersonBundle\Export; */ abstract class Declarations { - public const ACP_TYPE = 'accompanying_period'; + final public const ACP_TYPE = 'accompanying_period'; - public const EVAL_TYPE = 'evaluation'; + final public const EVAL_TYPE = 'evaluation'; - public const HOUSEHOLD_TYPE = 'household'; + final public const HOUSEHOLD_TYPE = 'household'; - public const PERSON_IMPLIED_IN = 'person_implied_in'; + final public const PERSON_IMPLIED_IN = 'person_implied_in'; - public const PERSON_TYPE = 'person'; + final public const PERSON_TYPE = 'person'; - public const SOCIAL_WORK_ACTION_TYPE = 'social_actions'; + final public const SOCIAL_WORK_ACTION_TYPE = 'social_actions'; } diff --git a/src/Bundle/ChillPersonBundle/Export/Export/CountEvaluation.php b/src/Bundle/ChillPersonBundle/Export/Export/CountEvaluation.php index 74d4bb4ff..b25f24c8c 100644 --- a/src/Bundle/ChillPersonBundle/Export/Export/CountEvaluation.php +++ b/src/Bundle/ChillPersonBundle/Export/Export/CountEvaluation.php @@ -25,7 +25,7 @@ use Symfony\Component\Form\FormBuilderInterface; class CountEvaluation implements ExportInterface, GroupedExportInterface { - public function __construct(private EntityManagerInterface $entityManager) + public function __construct(private readonly EntityManagerInterface $entityManager) { } diff --git a/src/Bundle/ChillPersonBundle/Export/Export/CountHousehold.php b/src/Bundle/ChillPersonBundle/Export/Export/CountHousehold.php index 778f19812..823ea703e 100644 --- a/src/Bundle/ChillPersonBundle/Export/Export/CountHousehold.php +++ b/src/Bundle/ChillPersonBundle/Export/Export/CountHousehold.php @@ -30,7 +30,7 @@ class CountHousehold implements ExportInterface, GroupedExportInterface { private const TR_PREFIX = 'export.export.nb_household_with_course.'; - public function __construct(private EntityManagerInterface $entityManager, private RollingDateConverterInterface $rollingDateConverter) + public function __construct(private readonly EntityManagerInterface $entityManager, private readonly RollingDateConverterInterface $rollingDateConverter) { } diff --git a/src/Bundle/ChillPersonBundle/Export/Export/CountPersonWithAccompanyingCourse.php b/src/Bundle/ChillPersonBundle/Export/Export/CountPersonWithAccompanyingCourse.php index e52cc83b1..c887a9468 100644 --- a/src/Bundle/ChillPersonBundle/Export/Export/CountPersonWithAccompanyingCourse.php +++ b/src/Bundle/ChillPersonBundle/Export/Export/CountPersonWithAccompanyingCourse.php @@ -27,7 +27,7 @@ use function in_array; class CountPersonWithAccompanyingCourse implements ExportInterface, GroupedExportInterface { - private EntityRepository $repository; + private readonly EntityRepository $repository; public function __construct( EntityManagerInterface $em diff --git a/src/Bundle/ChillPersonBundle/Export/Export/ListAccompanyingPeriod.php b/src/Bundle/ChillPersonBundle/Export/Export/ListAccompanyingPeriod.php index 57e92f818..6c78f1494 100644 --- a/src/Bundle/ChillPersonBundle/Export/Export/ListAccompanyingPeriod.php +++ b/src/Bundle/ChillPersonBundle/Export/Export/ListAccompanyingPeriod.php @@ -78,7 +78,7 @@ class ListAccompanyingPeriod implements ListInterface, GroupedExportInterface 'updatedBy', ]; - public function __construct(private ExportAddressHelper $addressHelper, private DateTimeHelper $dateTimeHelper, private EntityManagerInterface $entityManager, private PersonRenderInterface $personRender, private PersonRepository $personRepository, private ThirdPartyRepository $thirdPartyRepository, private ThirdPartyRender $thirdPartyRender, private SocialIssueRepository $socialIssueRepository, private SocialIssueRender $socialIssueRender, private TranslatableStringHelperInterface $translatableStringHelper, private RollingDateConverterInterface $rollingDateConverter, private UserHelper $userHelper) + public function __construct(private readonly ExportAddressHelper $addressHelper, private readonly DateTimeHelper $dateTimeHelper, private readonly EntityManagerInterface $entityManager, private readonly PersonRenderInterface $personRender, private readonly PersonRepository $personRepository, private readonly ThirdPartyRepository $thirdPartyRepository, private readonly ThirdPartyRender $thirdPartyRender, private readonly SocialIssueRepository $socialIssueRepository, private readonly SocialIssueRender $socialIssueRender, private readonly TranslatableStringHelperInterface $translatableStringHelper, private readonly RollingDateConverterInterface $rollingDateConverter, private readonly UserHelper $userHelper) { } diff --git a/src/Bundle/ChillPersonBundle/Export/Export/ListAccompanyingPeriodWork.php b/src/Bundle/ChillPersonBundle/Export/Export/ListAccompanyingPeriodWork.php index 0625d1552..33761de88 100644 --- a/src/Bundle/ChillPersonBundle/Export/Export/ListAccompanyingPeriodWork.php +++ b/src/Bundle/ChillPersonBundle/Export/Export/ListAccompanyingPeriodWork.php @@ -76,7 +76,7 @@ class ListAccompanyingPeriodWork implements ListInterface, GroupedExportInterfac 'updatedBy', ]; - public function __construct(private EntityManagerInterface $entityManager, private DateTimeHelper $dateTimeHelper, private UserHelper $userHelper, private LabelPersonHelper $personHelper, private LabelThirdPartyHelper $thirdPartyHelper, private TranslatableStringExportLabelHelper $translatableStringExportLabelHelper, private SocialIssueRender $socialIssueRender, private SocialIssueRepository $socialIssueRepository, private SocialActionRender $socialActionRender, private RollingDateConverterInterface $rollingDateConverter, private AggregateStringHelper $aggregateStringHelper, private SocialActionRepository $socialActionRepository) + public function __construct(private readonly EntityManagerInterface $entityManager, private readonly DateTimeHelper $dateTimeHelper, private readonly UserHelper $userHelper, private readonly LabelPersonHelper $personHelper, private readonly LabelThirdPartyHelper $thirdPartyHelper, private readonly TranslatableStringExportLabelHelper $translatableStringExportLabelHelper, private readonly SocialIssueRender $socialIssueRender, private readonly SocialIssueRepository $socialIssueRepository, private readonly SocialActionRender $socialActionRender, private readonly RollingDateConverterInterface $rollingDateConverter, private readonly AggregateStringHelper $aggregateStringHelper, private readonly SocialActionRepository $socialActionRepository) { } diff --git a/src/Bundle/ChillPersonBundle/Export/Export/ListEvaluation.php b/src/Bundle/ChillPersonBundle/Export/Export/ListEvaluation.php index ebe3911a9..548054c58 100644 --- a/src/Bundle/ChillPersonBundle/Export/Export/ListEvaluation.php +++ b/src/Bundle/ChillPersonBundle/Export/Export/ListEvaluation.php @@ -68,7 +68,7 @@ class ListEvaluation implements ListInterface, GroupedExportInterface 'updatedBy', ]; - public function __construct(private EntityManagerInterface $entityManager, private SocialIssueRender $socialIssueRender, private SocialIssueRepository $socialIssueRepository, private SocialActionRender $socialActionRender, private SocialActionRepository $socialActionRepository, private UserHelper $userHelper, private LabelPersonHelper $personHelper, private DateTimeHelper $dateTimeHelper, private TranslatableStringExportLabelHelper $translatableStringExportLabelHelper, private AggregateStringHelper $aggregateStringHelper, private RollingDateConverterInterface $rollingDateConverter) + public function __construct(private readonly EntityManagerInterface $entityManager, private readonly SocialIssueRender $socialIssueRender, private readonly SocialIssueRepository $socialIssueRepository, private readonly SocialActionRender $socialActionRender, private readonly SocialActionRepository $socialActionRepository, private readonly UserHelper $userHelper, private readonly LabelPersonHelper $personHelper, private readonly DateTimeHelper $dateTimeHelper, private readonly TranslatableStringExportLabelHelper $translatableStringExportLabelHelper, private readonly AggregateStringHelper $aggregateStringHelper, private readonly RollingDateConverterInterface $rollingDateConverter) { } diff --git a/src/Bundle/ChillPersonBundle/Export/Export/ListHouseholdInPeriod.php b/src/Bundle/ChillPersonBundle/Export/Export/ListHouseholdInPeriod.php index 06d79d6fc..a140d166e 100644 --- a/src/Bundle/ChillPersonBundle/Export/Export/ListHouseholdInPeriod.php +++ b/src/Bundle/ChillPersonBundle/Export/Export/ListHouseholdInPeriod.php @@ -45,7 +45,7 @@ class ListHouseholdInPeriod implements ListInterface, GroupedExportInterface 'compositionType', ]; - public function __construct(private ExportAddressHelper $addressHelper, private AggregateStringHelper $aggregateStringHelper, private EntityManagerInterface $entityManager, private RollingDateConverterInterface $rollingDateConverter, private TranslatableStringExportLabelHelper $translatableStringHelper) + public function __construct(private readonly ExportAddressHelper $addressHelper, private readonly AggregateStringHelper $aggregateStringHelper, private readonly EntityManagerInterface $entityManager, private readonly RollingDateConverterInterface $rollingDateConverter, private readonly TranslatableStringExportLabelHelper $translatableStringHelper) { } diff --git a/src/Bundle/ChillPersonBundle/Export/Export/ListPerson.php b/src/Bundle/ChillPersonBundle/Export/Export/ListPerson.php index 02c0722d4..919e83049 100644 --- a/src/Bundle/ChillPersonBundle/Export/Export/ListPerson.php +++ b/src/Bundle/ChillPersonBundle/Export/Export/ListPerson.php @@ -50,7 +50,7 @@ class ListPerson implements ExportElementValidatedInterface, ListInterface, Grou { private $slugs = []; - public function __construct(private ExportAddressHelper $addressHelper, private CustomFieldProvider $customFieldProvider, private ListPersonHelper $listPersonHelper, private EntityManagerInterface $entityManager, private TranslatableStringHelper $translatableStringHelper) + public function __construct(private readonly ExportAddressHelper $addressHelper, private readonly CustomFieldProvider $customFieldProvider, private readonly ListPersonHelper $listPersonHelper, private readonly EntityManagerInterface $entityManager, private readonly TranslatableStringHelper $translatableStringHelper) { } diff --git a/src/Bundle/ChillPersonBundle/Export/Export/ListPersonDuplicate.php b/src/Bundle/ChillPersonBundle/Export/Export/ListPersonDuplicate.php index 4181098b2..e986ef43c 100644 --- a/src/Bundle/ChillPersonBundle/Export/Export/ListPersonDuplicate.php +++ b/src/Bundle/ChillPersonBundle/Export/Export/ListPersonDuplicate.php @@ -49,8 +49,8 @@ class ListPersonDuplicate implements DirectExportInterface, ExportElementValidat public function __construct( EntityManagerInterface $em, - private TranslatorInterface $translator, - private UrlGeneratorInterface $router, + private readonly TranslatorInterface $translator, + private readonly UrlGeneratorInterface $router, $routeParameters ) { $this->entityManager = $em; diff --git a/src/Bundle/ChillPersonBundle/Export/Export/ListPersonWithAccompanyingPeriod.php b/src/Bundle/ChillPersonBundle/Export/Export/ListPersonWithAccompanyingPeriod.php index 9676a9437..57e943bc0 100644 --- a/src/Bundle/ChillPersonBundle/Export/Export/ListPersonWithAccompanyingPeriod.php +++ b/src/Bundle/ChillPersonBundle/Export/Export/ListPersonWithAccompanyingPeriod.php @@ -37,7 +37,7 @@ use function strlen; class ListPersonWithAccompanyingPeriod implements ExportElementValidatedInterface, ListInterface, GroupedExportInterface { - public function __construct(private ExportAddressHelper $addressHelper, private ListPersonHelper $listPersonHelper, private EntityManagerInterface $entityManager) + public function __construct(private readonly ExportAddressHelper $addressHelper, private readonly ListPersonHelper $listPersonHelper, private readonly EntityManagerInterface $entityManager) { } diff --git a/src/Bundle/ChillPersonBundle/Export/Export/StatAccompanyingCourseDuration.php b/src/Bundle/ChillPersonBundle/Export/Export/StatAccompanyingCourseDuration.php index 1d0161b24..5b6bea62a 100644 --- a/src/Bundle/ChillPersonBundle/Export/Export/StatAccompanyingCourseDuration.php +++ b/src/Bundle/ChillPersonBundle/Export/Export/StatAccompanyingCourseDuration.php @@ -29,7 +29,7 @@ use Symfony\Component\Form\FormBuilderInterface; class StatAccompanyingCourseDuration implements ExportInterface, GroupedExportInterface { - private EntityRepository $repository; + private readonly EntityRepository $repository; public function __construct( EntityManagerInterface $em diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/ActiveOnDateFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/ActiveOnDateFilter.php index 3f5a25053..3ca897e61 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/ActiveOnDateFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/ActiveOnDateFilter.php @@ -22,7 +22,7 @@ use Symfony\Component\Form\FormBuilderInterface; class ActiveOnDateFilter implements FilterInterface { - public function __construct(private RollingDateConverterInterface $rollingDateConverter) + public function __construct(private readonly RollingDateConverterInterface $rollingDateConverter) { } diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/ActiveOneDayBetweenDatesFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/ActiveOneDayBetweenDatesFilter.php index ff1ac7653..cf1703254 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/ActiveOneDayBetweenDatesFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/ActiveOneDayBetweenDatesFilter.php @@ -21,7 +21,7 @@ use Symfony\Component\Form\FormBuilderInterface; class ActiveOneDayBetweenDatesFilter implements FilterInterface { - public function __construct(private RollingDateConverterInterface $rollingDateConverter) + public function __construct(private readonly RollingDateConverterInterface $rollingDateConverter) { } diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/AdministrativeLocationFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/AdministrativeLocationFilter.php index d4e74d165..871d56ce7 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/AdministrativeLocationFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/AdministrativeLocationFilter.php @@ -20,7 +20,7 @@ use Symfony\Component\Form\FormBuilderInterface; class AdministrativeLocationFilter implements FilterInterface { - public function __construct(private TranslatableStringHelper $translatableStringHelper) + public function __construct(private readonly TranslatableStringHelper $translatableStringHelper) { } diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/ClosingMotiveFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/ClosingMotiveFilter.php index a8fb0b48e..59d7a7f38 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/ClosingMotiveFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/ClosingMotiveFilter.php @@ -22,7 +22,7 @@ use Symfony\Component\Form\FormBuilderInterface; class ClosingMotiveFilter implements FilterInterface { - public function __construct(private TranslatableStringHelper $translatableStringHelper) + public function __construct(private readonly TranslatableStringHelper $translatableStringHelper) { } diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/ConfidentialFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/ConfidentialFilter.php index 1803e8067..e8f5c76da 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/ConfidentialFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/ConfidentialFilter.php @@ -28,7 +28,7 @@ class ConfidentialFilter implements FilterInterface private const DEFAULT_CHOICE = false; - public function __construct(private TranslatorInterface $translator) + public function __construct(private readonly TranslatorInterface $translator) { } diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/CreatorJobFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/CreatorJobFilter.php index 79412bb61..9f77729d2 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/CreatorJobFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/CreatorJobFilter.php @@ -23,7 +23,7 @@ use function in_array; class CreatorJobFilter implements FilterInterface { - public function __construct(private TranslatableStringHelper $translatableStringHelper, private UserJobRepositoryInterface $userJobRepository) + public function __construct(private readonly TranslatableStringHelper $translatableStringHelper, private readonly UserJobRepositoryInterface $userJobRepository) { } diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/EmergencyFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/EmergencyFilter.php index b680299a1..04a9d5e0e 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/EmergencyFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/EmergencyFilter.php @@ -28,7 +28,7 @@ class EmergencyFilter implements FilterInterface private const DEFAULT_CHOICE = false; - public function __construct(private TranslatorInterface $translator) + public function __construct(private readonly TranslatorInterface $translator) { } diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/EvaluationFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/EvaluationFilter.php index e4e895555..c762db932 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/EvaluationFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/EvaluationFilter.php @@ -23,7 +23,7 @@ use function in_array; class EvaluationFilter implements FilterInterface { - public function __construct(private EvaluationRepositoryInterface $evaluationRepository, private TranslatableStringHelper $translatableStringHelper) + public function __construct(private readonly EvaluationRepositoryInterface $evaluationRepository, private readonly TranslatableStringHelper $translatableStringHelper) { } diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/GeographicalUnitStatFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/GeographicalUnitStatFilter.php index 31a449a35..83ba64949 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/GeographicalUnitStatFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/GeographicalUnitStatFilter.php @@ -32,7 +32,7 @@ use Symfony\Component\Form\FormBuilderInterface; */ class GeographicalUnitStatFilter implements FilterInterface { - public function __construct(private GeographicalUnitRepositoryInterface $geographicalUnitRepository, private GeographicalUnitLayerRepositoryInterface $geographicalUnitLayerRepository, private TranslatableStringHelperInterface $translatableStringHelper, private RollingDateConverterInterface $rollingDateConverter) + public function __construct(private readonly GeographicalUnitRepositoryInterface $geographicalUnitRepository, private readonly GeographicalUnitLayerRepositoryInterface $geographicalUnitLayerRepository, private readonly TranslatableStringHelperInterface $translatableStringHelper, private readonly RollingDateConverterInterface $rollingDateConverter) { } diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/HasNoReferrerFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/HasNoReferrerFilter.php index 43503a6b9..b20ef28e7 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/HasNoReferrerFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/HasNoReferrerFilter.php @@ -22,7 +22,7 @@ use Symfony\Component\Form\FormBuilderInterface; class HasNoReferrerFilter implements FilterInterface { - public function __construct(private RollingDateConverterInterface $rollingDateConverter) + public function __construct(private readonly RollingDateConverterInterface $rollingDateConverter) { } diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/HasTemporaryLocationFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/HasTemporaryLocationFilter.php index 9ef7f012f..36aa711bd 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/HasTemporaryLocationFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/HasTemporaryLocationFilter.php @@ -23,7 +23,7 @@ use Symfony\Component\Form\FormBuilderInterface; class HasTemporaryLocationFilter implements FilterInterface { - public function __construct(private RollingDateConverterInterface $rollingDateConverter) + public function __construct(private readonly RollingDateConverterInterface $rollingDateConverter) { } diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/IntensityFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/IntensityFilter.php index 1f215bce9..3bdadb75d 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/IntensityFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/IntensityFilter.php @@ -28,7 +28,7 @@ class IntensityFilter implements FilterInterface private const DEFAULT_CHOICE = 'occasional'; - public function __construct(private TranslatorInterface $translator) + public function __construct(private readonly TranslatorInterface $translator) { } diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/OpenBetweenDatesFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/OpenBetweenDatesFilter.php index 23823467f..d74b7d433 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/OpenBetweenDatesFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/OpenBetweenDatesFilter.php @@ -22,7 +22,7 @@ use Symfony\Component\Form\FormBuilderInterface; class OpenBetweenDatesFilter implements FilterInterface { - public function __construct(private RollingDateConverterInterface $rollingDateConverter) + public function __construct(private readonly RollingDateConverterInterface $rollingDateConverter) { } diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/OriginFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/OriginFilter.php index f3b927f68..97390621b 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/OriginFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/OriginFilter.php @@ -22,7 +22,7 @@ use Symfony\Component\Form\FormBuilderInterface; class OriginFilter implements FilterInterface { - public function __construct(private TranslatableStringHelper $translatableStringHelper) + public function __construct(private readonly TranslatableStringHelper $translatableStringHelper) { } diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/ReferrerFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/ReferrerFilter.php index ee79ca8f8..9bb0e8f45 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/ReferrerFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/ReferrerFilter.php @@ -29,7 +29,7 @@ class ReferrerFilter implements FilterInterface private const PU = 'acp_referrer_filter_users'; - public function __construct(private RollingDateConverterInterface $rollingDateConverter) + public function __construct(private readonly RollingDateConverterInterface $rollingDateConverter) { } diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/RequestorFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/RequestorFilter.php index 60fc9e5ec..7e8aa2de4 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/RequestorFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/RequestorFilter.php @@ -22,7 +22,7 @@ use Symfony\Component\Form\FormBuilderInterface; use Symfony\Contracts\Translation\TranslatorInterface; use function in_array; -final class RequestorFilter implements FilterInterface +final readonly class RequestorFilter implements FilterInterface { private const DEFAULT_CHOICE = 'participation'; diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/SocialActionFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/SocialActionFilter.php index fd4d4ac64..64d7c4848 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/SocialActionFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/SocialActionFilter.php @@ -23,7 +23,7 @@ use function in_array; class SocialActionFilter implements FilterInterface { - public function __construct(private TranslatableStringHelper $translatableStringHelper, private SocialActionRender $actionRender) + public function __construct(private readonly TranslatableStringHelper $translatableStringHelper, private readonly SocialActionRender $actionRender) { } diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/SocialIssueFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/SocialIssueFilter.php index ee9ebfc79..88b45e7be 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/SocialIssueFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/SocialIssueFilter.php @@ -30,7 +30,7 @@ class SocialIssueFilter implements FilterInterface public function __construct( TranslatorInterface $translator, - private SocialIssueRender $socialIssueRender + private readonly SocialIssueRender $socialIssueRender ) { $this->translator = $translator; } diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/StepFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/StepFilter.php index e217cdab0..0549bc7a1 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/StepFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/StepFilter.php @@ -37,7 +37,7 @@ class StepFilter implements FilterInterface 'Closed' => AccompanyingPeriod::STEP_CLOSED, ]; - public function __construct(private RollingDateConverterInterface $rollingDateConverter, private TranslatorInterface $translator) + public function __construct(private readonly RollingDateConverterInterface $rollingDateConverter, private readonly TranslatorInterface $translator) { } diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/UserJobFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/UserJobFilter.php index 7e8a3ecc3..b63c5c8f0 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/UserJobFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/UserJobFilter.php @@ -34,7 +34,7 @@ class UserJobFilter implements FilterInterface private const PJ = 'acp_ujob_filter_job'; - public function __construct(private TranslatableStringHelper $translatableStringHelper, private UserJobRepositoryInterface $userJobRepository, private RollingDateConverterInterface $rollingDateConverter) + public function __construct(private readonly TranslatableStringHelper $translatableStringHelper, private readonly UserJobRepositoryInterface $userJobRepository, private readonly RollingDateConverterInterface $rollingDateConverter) { } diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/UserScopeFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/UserScopeFilter.php index 58a935a0e..5abbdeec4 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/UserScopeFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/UserScopeFilter.php @@ -35,7 +35,7 @@ class UserScopeFilter implements FilterInterface private const PS = 'acp_uscope_filter_scopes'; - public function __construct(private ScopeRepositoryInterface $scopeRepository, private Security $security, private TranslatableStringHelper $translatableStringHelper, private RollingDateConverterInterface $rollingDateConverter) + public function __construct(private readonly ScopeRepositoryInterface $scopeRepository, private readonly Security $security, private readonly TranslatableStringHelper $translatableStringHelper, private readonly RollingDateConverterInterface $rollingDateConverter) { } diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/EvaluationFilters/ByEndDateFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/EvaluationFilters/ByEndDateFilter.php index 553e58a39..41e2ffc0a 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/EvaluationFilters/ByEndDateFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/EvaluationFilters/ByEndDateFilter.php @@ -21,7 +21,7 @@ use Symfony\Component\Form\FormBuilderInterface; class ByEndDateFilter implements FilterInterface { - public function __construct(private RollingDateConverterInterface $rollingDateConverter) + public function __construct(private readonly RollingDateConverterInterface $rollingDateConverter) { } diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/EvaluationFilters/ByStartDateFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/EvaluationFilters/ByStartDateFilter.php index 7485020ce..f44acf6cc 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/EvaluationFilters/ByStartDateFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/EvaluationFilters/ByStartDateFilter.php @@ -21,7 +21,7 @@ use Symfony\Component\Form\FormBuilderInterface; class ByStartDateFilter implements FilterInterface { - public function __construct(private RollingDateConverterInterface $rollingDateConverter) + public function __construct(private readonly RollingDateConverterInterface $rollingDateConverter) { } diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/EvaluationFilters/EvaluationTypeFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/EvaluationFilters/EvaluationTypeFilter.php index 1062b8a12..5a4f3a2e0 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/EvaluationFilters/EvaluationTypeFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/EvaluationFilters/EvaluationTypeFilter.php @@ -20,7 +20,7 @@ use Doctrine\ORM\QueryBuilder; use Symfony\Bridge\Doctrine\Form\Type\EntityType; use Symfony\Component\Form\FormBuilderInterface; -final class EvaluationTypeFilter implements FilterInterface +final readonly class EvaluationTypeFilter implements FilterInterface { public function __construct(private TranslatableStringHelper $translatableStringHelper) { diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/EvaluationFilters/MaxDateFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/EvaluationFilters/MaxDateFilter.php index 1ca3f3f99..f020e24f0 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/EvaluationFilters/MaxDateFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/EvaluationFilters/MaxDateFilter.php @@ -25,7 +25,7 @@ class MaxDateFilter implements FilterInterface 'maxdate is not specified' => false, ]; - public function __construct(private TranslatorInterface $translator) + public function __construct(private readonly TranslatorInterface $translator) { } diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/HouseholdFilters/CompositionFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/HouseholdFilters/CompositionFilter.php index dcf98f307..4e18e0adc 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/HouseholdFilters/CompositionFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/HouseholdFilters/CompositionFilter.php @@ -26,7 +26,7 @@ use function in_array; class CompositionFilter implements FilterInterface { - public function __construct(private TranslatableStringHelper $translatableStringHelper, private RollingDateConverterInterface $rollingDateConverter) + public function __construct(private readonly TranslatableStringHelper $translatableStringHelper, private readonly RollingDateConverterInterface $rollingDateConverter) { } diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/AddressRefStatusFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/AddressRefStatusFilter.php index b4001b3c4..9d0568f02 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/AddressRefStatusFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/AddressRefStatusFilter.php @@ -24,7 +24,7 @@ use Symfony\Component\Form\FormBuilderInterface; class AddressRefStatusFilter implements \Chill\MainBundle\Export\FilterInterface { - public function __construct(private RollingDateConverterInterface $rollingDateConverter) + public function __construct(private readonly RollingDateConverterInterface $rollingDateConverter) { } diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/AgeFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/AgeFilter.php index da3c4a7f2..89a4dac56 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/AgeFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/AgeFilter.php @@ -26,7 +26,7 @@ use Symfony\Component\Validator\Context\ExecutionContextInterface; class AgeFilter implements ExportElementValidatedInterface, FilterInterface { - public function __construct(private RollingDateConverterInterface $rollingDateConverter) + public function __construct(private readonly RollingDateConverterInterface $rollingDateConverter) { } diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/BirthdateFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/BirthdateFilter.php index 46946e41e..4724b2987 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/BirthdateFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/BirthdateFilter.php @@ -24,7 +24,7 @@ use Symfony\Component\Validator\Context\ExecutionContextInterface; class BirthdateFilter implements ExportElementValidatedInterface, FilterInterface { - public function __construct(private RollingDateConverterInterface $rollingDateConverter) + public function __construct(private readonly RollingDateConverterInterface $rollingDateConverter) { } diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/ByHouseholdCompositionFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/ByHouseholdCompositionFilter.php index 63ee441af..8307d7d70 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/ByHouseholdCompositionFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/ByHouseholdCompositionFilter.php @@ -28,7 +28,7 @@ use Symfony\Component\Form\FormBuilderInterface; class ByHouseholdCompositionFilter implements FilterInterface { - public function __construct(private HouseholdCompositionTypeRepositoryInterface $householdCompositionTypeRepository, private RollingDateConverterInterface $rollingDateConverter, private TranslatableStringHelperInterface $translatableStringHelper) + public function __construct(private readonly HouseholdCompositionTypeRepositoryInterface $householdCompositionTypeRepository, private readonly RollingDateConverterInterface $rollingDateConverter, private readonly TranslatableStringHelperInterface $translatableStringHelper) { } diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/DeadOrAliveFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/DeadOrAliveFilter.php index 7daf1c9e1..c37d06da9 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/DeadOrAliveFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/DeadOrAliveFilter.php @@ -23,7 +23,7 @@ use Symfony\Component\Form\FormBuilderInterface; class DeadOrAliveFilter implements FilterInterface { - public function __construct(private RollingDateConverterInterface $rollingDateConverter) + public function __construct(private readonly RollingDateConverterInterface $rollingDateConverter) { } diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/DeathdateFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/DeathdateFilter.php index 04675054f..a47893316 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/DeathdateFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/DeathdateFilter.php @@ -24,7 +24,7 @@ use Symfony\Component\Validator\Context\ExecutionContextInterface; class DeathdateFilter implements ExportElementValidatedInterface, FilterInterface { - public function __construct(private RollingDateConverterInterface $rollingDateConverter) + public function __construct(private readonly RollingDateConverterInterface $rollingDateConverter) { } diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/GeographicalUnitFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/GeographicalUnitFilter.php index 509bb3ab0..5776d0588 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/GeographicalUnitFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/GeographicalUnitFilter.php @@ -26,7 +26,7 @@ use Symfony\Component\Form\FormBuilderInterface; class GeographicalUnitFilter implements \Chill\MainBundle\Export\FilterInterface { - public function __construct(private GeographicalUnitRepositoryInterface $geographicalUnitRepository, private GeographicalUnitLayerRepositoryInterface $geographicalUnitLayerRepository, private TranslatableStringHelperInterface $translatableStringHelper, private RollingDateConverterInterface $rollingDateConverter) + public function __construct(private readonly GeographicalUnitRepositoryInterface $geographicalUnitRepository, private readonly GeographicalUnitLayerRepositoryInterface $geographicalUnitLayerRepository, private readonly TranslatableStringHelperInterface $translatableStringHelper, private readonly RollingDateConverterInterface $rollingDateConverter) { } diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/MaritalStatusFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/MaritalStatusFilter.php index 279b693f6..6fa4987bb 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/MaritalStatusFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/MaritalStatusFilter.php @@ -19,7 +19,7 @@ use Symfony\Bridge\Doctrine\Form\Type\EntityType; class MaritalStatusFilter implements FilterInterface { - public function __construct(private TranslatableStringHelper $translatableStringHelper) + public function __construct(private readonly TranslatableStringHelper $translatableStringHelper) { } diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/NationalityFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/NationalityFilter.php index 4463f433f..75fe4e2d4 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/NationalityFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/NationalityFilter.php @@ -26,7 +26,7 @@ class NationalityFilter implements ExportElementValidatedInterface, FilterInterface { - public function __construct(private TranslatableStringHelper $translatableStringHelper) + public function __construct(private readonly TranslatableStringHelper $translatableStringHelper) { } diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/ResidentialAddressAtThirdpartyFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/ResidentialAddressAtThirdpartyFilter.php index 4afc3fd71..2418671cd 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/ResidentialAddressAtThirdpartyFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/ResidentialAddressAtThirdpartyFilter.php @@ -27,7 +27,7 @@ use function in_array; class ResidentialAddressAtThirdpartyFilter implements FilterInterface { - public function __construct(private RollingDateConverterInterface $rollingDateConverter, private TranslatableStringHelper $translatableStringHelper) + public function __construct(private readonly RollingDateConverterInterface $rollingDateConverter, private readonly TranslatableStringHelper $translatableStringHelper) { } diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/ResidentialAddressAtUserFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/ResidentialAddressAtUserFilter.php index e6b55904e..05e7cc630 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/ResidentialAddressAtUserFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/ResidentialAddressAtUserFilter.php @@ -24,7 +24,7 @@ use function in_array; class ResidentialAddressAtUserFilter implements FilterInterface { - public function __construct(private RollingDateConverterInterface $rollingDateConverter) + public function __construct(private readonly RollingDateConverterInterface $rollingDateConverter) { } diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/WithoutHouseholdComposition.php b/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/WithoutHouseholdComposition.php index 702b8a7b0..d1ed0bbf2 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/WithoutHouseholdComposition.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/WithoutHouseholdComposition.php @@ -24,7 +24,7 @@ use Symfony\Component\Form\FormBuilderInterface; class WithoutHouseholdComposition implements FilterInterface { - public function __construct(private RollingDateConverterInterface $rollingDateConverter) + public function __construct(private readonly RollingDateConverterInterface $rollingDateConverter) { } diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/SocialWorkFilters/JobFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/SocialWorkFilters/JobFilter.php index 36b671d54..cd65f16a5 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/SocialWorkFilters/JobFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/SocialWorkFilters/JobFilter.php @@ -24,7 +24,7 @@ use function in_array; class JobFilter implements FilterInterface { - public function __construct(protected TranslatorInterface $translator, private TranslatableStringHelper $translatableStringHelper) + public function __construct(protected TranslatorInterface $translator, private readonly TranslatableStringHelper $translatableStringHelper) { } diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/SocialWorkFilters/ScopeFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/SocialWorkFilters/ScopeFilter.php index f393354b1..2d75c1ae2 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/SocialWorkFilters/ScopeFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/SocialWorkFilters/ScopeFilter.php @@ -24,7 +24,7 @@ use function in_array; class ScopeFilter implements FilterInterface { - public function __construct(protected TranslatorInterface $translator, private TranslatableStringHelper $translatableStringHelper) + public function __construct(protected TranslatorInterface $translator, private readonly TranslatableStringHelper $translatableStringHelper) { } diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/SocialWorkFilters/SocialWorkTypeFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/SocialWorkFilters/SocialWorkTypeFilter.php index 83fea8223..c717372d8 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/SocialWorkFilters/SocialWorkTypeFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/SocialWorkFilters/SocialWorkTypeFilter.php @@ -28,7 +28,7 @@ use function in_array; class SocialWorkTypeFilter implements FilterInterface { - public function __construct(private SocialActionRender $socialActionRender, private TranslatableStringHelper $translatableStringHelper, private EntityManagerInterface $em) + public function __construct(private readonly SocialActionRender $socialActionRender, private readonly TranslatableStringHelper $translatableStringHelper, private readonly EntityManagerInterface $em) { } diff --git a/src/Bundle/ChillPersonBundle/Export/Helper/LabelPersonHelper.php b/src/Bundle/ChillPersonBundle/Export/Helper/LabelPersonHelper.php index 5afde9986..20029b296 100644 --- a/src/Bundle/ChillPersonBundle/Export/Helper/LabelPersonHelper.php +++ b/src/Bundle/ChillPersonBundle/Export/Helper/LabelPersonHelper.php @@ -18,7 +18,7 @@ use const SORT_NUMERIC; class LabelPersonHelper { - public function __construct(private PersonRepository $personRepository, private PersonRenderInterface $personRender) + public function __construct(private readonly PersonRepository $personRepository, private readonly PersonRenderInterface $personRender) { } diff --git a/src/Bundle/ChillPersonBundle/Export/Helper/ListPersonHelper.php b/src/Bundle/ChillPersonBundle/Export/Helper/ListPersonHelper.php index 600aaa60b..0f8d6d4ae 100644 --- a/src/Bundle/ChillPersonBundle/Export/Helper/ListPersonHelper.php +++ b/src/Bundle/ChillPersonBundle/Export/Helper/ListPersonHelper.php @@ -41,7 +41,7 @@ use function strlen; */ class ListPersonHelper { - public const FIELDS = [ + final public const FIELDS = [ 'id', 'civility', 'firstName', @@ -73,7 +73,7 @@ class ListPersonHelper 'lifecycleUpdate', ]; - public function __construct(private ExportAddressHelper $addressHelper, private CenterRepositoryInterface $centerRepository, private CivilityRepositoryInterface $civilityRepository, private CountryRepository $countryRepository, private LanguageRepositoryInterface $languageRepository, private MaritalStatusRepositoryInterface $maritalStatusRepository, private TranslatableStringHelper $translatableStringHelper, private TranslatorInterface $translator, private UserRepositoryInterface $userRepository) + public function __construct(private readonly ExportAddressHelper $addressHelper, private readonly CenterRepositoryInterface $centerRepository, private readonly CivilityRepositoryInterface $civilityRepository, private readonly CountryRepository $countryRepository, private readonly LanguageRepositoryInterface $languageRepository, private readonly MaritalStatusRepositoryInterface $maritalStatusRepository, private readonly TranslatableStringHelper $translatableStringHelper, private readonly TranslatorInterface $translator, private readonly UserRepositoryInterface $userRepository) { } @@ -201,7 +201,7 @@ class ListPersonHelper public function getLabels($key, array $values, $data): callable { - if (str_starts_with($key, 'address_fields')) { + if (str_starts_with((string) $key, 'address_fields')) { return $this->addressHelper->getLabel($key, $values, $data, 'address_fields'); } diff --git a/src/Bundle/ChillPersonBundle/Form/CreationPersonType.php b/src/Bundle/ChillPersonBundle/Form/CreationPersonType.php index 8f1f0ba43..01814af38 100644 --- a/src/Bundle/ChillPersonBundle/Form/CreationPersonType.php +++ b/src/Bundle/ChillPersonBundle/Form/CreationPersonType.php @@ -40,11 +40,11 @@ final class CreationPersonType extends AbstractType // TODO: See if this is still valid and update accordingly. public const NAME = 'chill_personbundle_person_creation'; - private bool $askCenters; + private readonly bool $askCenters; public function __construct( - private ConfigPersonAltNamesHelper $configPersonAltNamesHelper, - private EventDispatcherInterface $dispatcher, + private readonly ConfigPersonAltNamesHelper $configPersonAltNamesHelper, + private readonly EventDispatcherInterface $dispatcher, ParameterBagInterface $parameterBag ) { $this->askCenters = $parameterBag->get('chill_main')['acl']['form_show_centers']; @@ -114,7 +114,7 @@ final class CreationPersonType extends AbstractType $resolver->setDefaults([ 'data_class' => Person::class, 'constraints' => [ - new Callback([$this, 'validateCheckedAddress']), + new Callback($this->validateCheckedAddress(...)), ], ]); } diff --git a/src/Bundle/ChillPersonBundle/Form/HouseholdCompositionType.php b/src/Bundle/ChillPersonBundle/Form/HouseholdCompositionType.php index 4dc2e1a73..0fe60cbe9 100644 --- a/src/Bundle/ChillPersonBundle/Form/HouseholdCompositionType.php +++ b/src/Bundle/ChillPersonBundle/Form/HouseholdCompositionType.php @@ -22,7 +22,7 @@ use Symfony\Component\Form\FormBuilderInterface; class HouseholdCompositionType extends AbstractType { - public function __construct(private HouseholdCompositionTypeRepository $householdCompositionTypeRepository, private TranslatableStringHelperInterface $translatableStringHelper) + public function __construct(private readonly HouseholdCompositionTypeRepository $householdCompositionTypeRepository, private readonly TranslatableStringHelperInterface $translatableStringHelper) { } diff --git a/src/Bundle/ChillPersonBundle/Form/PersonResourceType.php b/src/Bundle/ChillPersonBundle/Form/PersonResourceType.php index 3790cb03a..a4946b52d 100644 --- a/src/Bundle/ChillPersonBundle/Form/PersonResourceType.php +++ b/src/Bundle/ChillPersonBundle/Form/PersonResourceType.php @@ -29,7 +29,7 @@ use Symfony\Contracts\Translation\TranslatorInterface; final class PersonResourceType extends AbstractType { - public function __construct(private ResourceKindRender $resourceKindRender, private PersonRenderInterface $personRender, private ThirdPartyRender $thirdPartyRender, private TranslatorInterface $translator) + public function __construct(private readonly ResourceKindRender $resourceKindRender, private readonly PersonRenderInterface $personRender, private readonly ThirdPartyRender $thirdPartyRender, private readonly TranslatorInterface $translator) { } diff --git a/src/Bundle/ChillPersonBundle/Form/PersonType.php b/src/Bundle/ChillPersonBundle/Form/PersonType.php index db5635f97..6ba4cafaf 100644 --- a/src/Bundle/ChillPersonBundle/Form/PersonType.php +++ b/src/Bundle/ChillPersonBundle/Form/PersonType.php @@ -64,7 +64,7 @@ class PersonType extends AbstractType array $personFieldsConfiguration, ConfigPersonAltNamesHelper $configAltNamesHelper, protected TranslatableStringHelperInterface $translatableStringHelper, - private ParameterBagInterface $parameterBag + private readonly ParameterBagInterface $parameterBag ) { $this->config = $personFieldsConfiguration; $this->configAltNamesHelper = $configAltNamesHelper; diff --git a/src/Bundle/ChillPersonBundle/Form/Type/PersonAltNameType.php b/src/Bundle/ChillPersonBundle/Form/Type/PersonAltNameType.php index 0c7efe647..17aad8bd0 100644 --- a/src/Bundle/ChillPersonBundle/Form/Type/PersonAltNameType.php +++ b/src/Bundle/ChillPersonBundle/Form/Type/PersonAltNameType.php @@ -21,7 +21,7 @@ use Symfony\Component\OptionsResolver\OptionsResolver; class PersonAltNameType extends AbstractType { - public function __construct(private ConfigPersonAltNamesHelper $configHelper, private TranslatableStringHelper $translatableStringHelper) + public function __construct(private readonly ConfigPersonAltNamesHelper $configHelper, private readonly TranslatableStringHelper $translatableStringHelper) { } diff --git a/src/Bundle/ChillPersonBundle/Form/Type/PersonPhoneType.php b/src/Bundle/ChillPersonBundle/Form/Type/PersonPhoneType.php index db51d507a..a55721011 100644 --- a/src/Bundle/ChillPersonBundle/Form/Type/PersonPhoneType.php +++ b/src/Bundle/ChillPersonBundle/Form/Type/PersonPhoneType.php @@ -24,7 +24,7 @@ use Symfony\Component\OptionsResolver\OptionsResolver; class PersonPhoneType extends AbstractType { - public function __construct(private PhonenumberHelper $phonenumberHelper, private EntityManagerInterface $em) + public function __construct(private readonly PhonenumberHelper $phonenumberHelper, private readonly EntityManagerInterface $em) { } diff --git a/src/Bundle/ChillPersonBundle/Form/Type/PickPersonDynamicType.php b/src/Bundle/ChillPersonBundle/Form/Type/PickPersonDynamicType.php index 4c3139c8e..440b6568c 100644 --- a/src/Bundle/ChillPersonBundle/Form/Type/PickPersonDynamicType.php +++ b/src/Bundle/ChillPersonBundle/Form/Type/PickPersonDynamicType.php @@ -26,7 +26,7 @@ use Symfony\Component\Serializer\SerializerInterface; */ class PickPersonDynamicType extends AbstractType { - public function __construct(private DenormalizerInterface $denormalizer, private SerializerInterface $serializer, private NormalizerInterface $normalizer) + public function __construct(private readonly DenormalizerInterface $denormalizer, private readonly SerializerInterface $serializer, private readonly NormalizerInterface $normalizer) { } diff --git a/src/Bundle/ChillPersonBundle/Form/Type/PickSocialActionType.php b/src/Bundle/ChillPersonBundle/Form/Type/PickSocialActionType.php index b2e3c6d9b..0fe09e56a 100644 --- a/src/Bundle/ChillPersonBundle/Form/Type/PickSocialActionType.php +++ b/src/Bundle/ChillPersonBundle/Form/Type/PickSocialActionType.php @@ -20,7 +20,7 @@ use Symfony\Component\OptionsResolver\OptionsResolver; class PickSocialActionType extends AbstractType { - public function __construct(private SocialActionRender $actionRender, private SocialActionRepository $actionRepository) + public function __construct(private readonly SocialActionRender $actionRender, private readonly SocialActionRepository $actionRepository) { } diff --git a/src/Bundle/ChillPersonBundle/Form/Type/PickSocialIssueType.php b/src/Bundle/ChillPersonBundle/Form/Type/PickSocialIssueType.php index 31cd44ab1..3e6ae1e97 100644 --- a/src/Bundle/ChillPersonBundle/Form/Type/PickSocialIssueType.php +++ b/src/Bundle/ChillPersonBundle/Form/Type/PickSocialIssueType.php @@ -20,7 +20,7 @@ use Symfony\Component\OptionsResolver\OptionsResolver; class PickSocialIssueType extends AbstractType { - public function __construct(private SocialIssueRender $issueRender, private SocialIssueRepository $issueRepository) + public function __construct(private readonly SocialIssueRender $issueRender, private readonly SocialIssueRepository $issueRepository) { } diff --git a/src/Bundle/ChillPersonBundle/Form/Type/Select2MaritalStatusType.php b/src/Bundle/ChillPersonBundle/Form/Type/Select2MaritalStatusType.php index a4e6c46c9..69823c07c 100644 --- a/src/Bundle/ChillPersonBundle/Form/Type/Select2MaritalStatusType.php +++ b/src/Bundle/ChillPersonBundle/Form/Type/Select2MaritalStatusType.php @@ -28,7 +28,7 @@ use const SORT_STRING; */ class Select2MaritalStatusType extends AbstractType { - public function __construct(private TranslatableStringHelper $translatableStringHelper, private EntityManagerInterface $em) + public function __construct(private readonly TranslatableStringHelper $translatableStringHelper, private readonly EntityManagerInterface $em) { } diff --git a/src/Bundle/ChillPersonBundle/Household/MembersEditor.php b/src/Bundle/ChillPersonBundle/Household/MembersEditor.php index 92f1bba5c..50807bcff 100644 --- a/src/Bundle/ChillPersonBundle/Household/MembersEditor.php +++ b/src/Bundle/ChillPersonBundle/Household/MembersEditor.php @@ -28,11 +28,11 @@ use function spl_object_hash; class MembersEditor { - public const VALIDATION_GROUP_AFFECTED = 'household_memberships'; + final public const VALIDATION_GROUP_AFFECTED = 'household_memberships'; - public const VALIDATION_GROUP_COMPOSITION = 'household_composition'; + final public const VALIDATION_GROUP_COMPOSITION = 'household_composition'; - public const VALIDATION_GROUP_CREATED = 'household_memberships_created'; + final public const VALIDATION_GROUP_CREATED = 'household_memberships_created'; private array $events = []; @@ -42,7 +42,7 @@ class MembersEditor private array $persistables = []; - public function __construct(private ValidatorInterface $validator, private ?\Chill\PersonBundle\Entity\Household\Household $household, private EventDispatcherInterface $eventDispatcher) + public function __construct(private readonly ValidatorInterface $validator, private readonly ?\Chill\PersonBundle\Entity\Household\Household $household, private readonly EventDispatcherInterface $eventDispatcher) { } diff --git a/src/Bundle/ChillPersonBundle/Household/MembersEditorFactory.php b/src/Bundle/ChillPersonBundle/Household/MembersEditorFactory.php index 9fae0dc82..cb6f7d4ea 100644 --- a/src/Bundle/ChillPersonBundle/Household/MembersEditorFactory.php +++ b/src/Bundle/ChillPersonBundle/Household/MembersEditorFactory.php @@ -17,7 +17,7 @@ use Symfony\Contracts\EventDispatcher\EventDispatcherInterface; class MembersEditorFactory { - public function __construct(private EventDispatcherInterface $eventDispatcher, private ValidatorInterface $validator) + public function __construct(private readonly EventDispatcherInterface $eventDispatcher, private readonly ValidatorInterface $validator) { } diff --git a/src/Bundle/ChillPersonBundle/Menu/PersonMenuBuilder.php b/src/Bundle/ChillPersonBundle/Menu/PersonMenuBuilder.php index dde404de0..2bbd47527 100644 --- a/src/Bundle/ChillPersonBundle/Menu/PersonMenuBuilder.php +++ b/src/Bundle/ChillPersonBundle/Menu/PersonMenuBuilder.php @@ -40,9 +40,9 @@ class PersonMenuBuilder implements LocalMenuBuilderInterface public function __construct( ParameterBagInterface $parameterBag, - private Security $security, + private readonly Security $security, protected TranslatorInterface $translator, - private ResidentialAddressRepository $residentialAddressRepo + private readonly ResidentialAddressRepository $residentialAddressRepo ) { $this->showAccompanyingPeriod = $parameterBag->get('chill_person.accompanying_period'); } diff --git a/src/Bundle/ChillPersonBundle/Menu/SectionMenuBuilder.php b/src/Bundle/ChillPersonBundle/Menu/SectionMenuBuilder.php index acbdd6d3c..c562545bb 100644 --- a/src/Bundle/ChillPersonBundle/Menu/SectionMenuBuilder.php +++ b/src/Bundle/ChillPersonBundle/Menu/SectionMenuBuilder.php @@ -28,7 +28,7 @@ class SectionMenuBuilder implements LocalMenuBuilderInterface /** * SectionMenuBuilder constructor. */ - public function __construct(protected ParameterBagInterface $parameterBag, private Security $security, protected TranslatorInterface $translator) + public function __construct(protected ParameterBagInterface $parameterBag, private readonly Security $security, protected TranslatorInterface $translator) { } diff --git a/src/Bundle/ChillPersonBundle/Notification/AccompanyingPeriodNotificationHandler.php b/src/Bundle/ChillPersonBundle/Notification/AccompanyingPeriodNotificationHandler.php index 85e18633d..ddcae7d97 100644 --- a/src/Bundle/ChillPersonBundle/Notification/AccompanyingPeriodNotificationHandler.php +++ b/src/Bundle/ChillPersonBundle/Notification/AccompanyingPeriodNotificationHandler.php @@ -16,7 +16,7 @@ use Chill\MainBundle\Notification\NotificationHandlerInterface; use Chill\PersonBundle\Entity\AccompanyingPeriod; use Chill\PersonBundle\Repository\AccompanyingPeriodRepository; -final class AccompanyingPeriodNotificationHandler implements NotificationHandlerInterface +final readonly class AccompanyingPeriodNotificationHandler implements NotificationHandlerInterface { public function __construct(private AccompanyingPeriodRepository $accompanyingPeriodRepository) { diff --git a/src/Bundle/ChillPersonBundle/Privacy/AccompanyingPeriodPrivacyEvent.php b/src/Bundle/ChillPersonBundle/Privacy/AccompanyingPeriodPrivacyEvent.php index 957461b55..1475c35ec 100644 --- a/src/Bundle/ChillPersonBundle/Privacy/AccompanyingPeriodPrivacyEvent.php +++ b/src/Bundle/ChillPersonBundle/Privacy/AccompanyingPeriodPrivacyEvent.php @@ -36,7 +36,7 @@ use Symfony\Component\EventDispatcher\Event; class AccompanyingPeriodPrivacyEvent extends Event { - public const ACCOMPANYING_PERIOD_PRIVACY_EVENT = 'chill_person.accompanying_period_privacy_event'; + final public const ACCOMPANYING_PERIOD_PRIVACY_EVENT = 'chill_person.accompanying_period_privacy_event'; public function __construct(protected $period, protected $args = []) { diff --git a/src/Bundle/ChillPersonBundle/Privacy/PrivacyEvent.php b/src/Bundle/ChillPersonBundle/Privacy/PrivacyEvent.php index 27861944c..c021a0b8f 100644 --- a/src/Bundle/ChillPersonBundle/Privacy/PrivacyEvent.php +++ b/src/Bundle/ChillPersonBundle/Privacy/PrivacyEvent.php @@ -44,7 +44,7 @@ use function count; */ class PrivacyEvent extends Event { - public const PERSON_PRIVACY_EVENT = 'chill_person.privacy_event'; + final public const PERSON_PRIVACY_EVENT = 'chill_person.privacy_event'; /** * @var array @@ -54,7 +54,7 @@ class PrivacyEvent extends Event /** * PrivacyEvent constructor. */ - public function __construct(private Person $person, private array $args = ['action' => 'show']) + public function __construct(private readonly Person $person, private readonly array $args = ['action' => 'show']) { } diff --git a/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriod/AccompanyingPeriodWorkEvaluationDocumentRepository.php b/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriod/AccompanyingPeriodWorkEvaluationDocumentRepository.php index 7aa8fde00..193509890 100644 --- a/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriod/AccompanyingPeriodWorkEvaluationDocumentRepository.php +++ b/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriod/AccompanyingPeriodWorkEvaluationDocumentRepository.php @@ -18,7 +18,7 @@ use Doctrine\Persistence\ObjectRepository; class AccompanyingPeriodWorkEvaluationDocumentRepository implements ObjectRepository { - private EntityRepository $repository; + private readonly EntityRepository $repository; public function __construct(EntityManagerInterface $em) { diff --git a/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriod/AccompanyingPeriodWorkEvaluationRepository.php b/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriod/AccompanyingPeriodWorkEvaluationRepository.php index 3cd9284df..28cbca270 100644 --- a/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriod/AccompanyingPeriodWorkEvaluationRepository.php +++ b/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriod/AccompanyingPeriodWorkEvaluationRepository.php @@ -21,7 +21,7 @@ use Doctrine\Persistence\ObjectRepository; class AccompanyingPeriodWorkEvaluationRepository implements ObjectRepository { - private EntityRepository $repository; + private readonly EntityRepository $repository; public function __construct(EntityManagerInterface $entityManager) { diff --git a/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriod/AccompanyingPeriodWorkGoalRepository.php b/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriod/AccompanyingPeriodWorkGoalRepository.php index a80964325..4e092beb0 100644 --- a/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriod/AccompanyingPeriodWorkGoalRepository.php +++ b/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriod/AccompanyingPeriodWorkGoalRepository.php @@ -23,7 +23,7 @@ use Doctrine\ORM\EntityRepository; */ final class AccompanyingPeriodWorkGoalRepository { - private EntityRepository $repository; + private readonly EntityRepository $repository; public function __construct(EntityManagerInterface $entityManager) { diff --git a/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriod/AccompanyingPeriodWorkRepository.php b/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriod/AccompanyingPeriodWorkRepository.php index 85c382a49..eaacaf333 100644 --- a/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriod/AccompanyingPeriodWorkRepository.php +++ b/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriod/AccompanyingPeriodWorkRepository.php @@ -23,7 +23,7 @@ use Doctrine\ORM\Query\ResultSetMappingBuilder; use Doctrine\ORM\QueryBuilder; use Doctrine\Persistence\ObjectRepository; -final class AccompanyingPeriodWorkRepository implements ObjectRepository +final readonly class AccompanyingPeriodWorkRepository implements ObjectRepository { private EntityRepository $repository; diff --git a/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriod/ClosingMotiveRepository.php b/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriod/ClosingMotiveRepository.php index 7983596c7..4a50de12b 100644 --- a/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriod/ClosingMotiveRepository.php +++ b/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriod/ClosingMotiveRepository.php @@ -16,7 +16,7 @@ use Doctrine\ORM\EntityManagerInterface; use Doctrine\ORM\EntityRepository; use Doctrine\ORM\Query\ResultSetMappingBuilder; -final class ClosingMotiveRepository implements ClosingMotiveRepositoryInterface +final readonly class ClosingMotiveRepository implements ClosingMotiveRepositoryInterface { private EntityRepository $repository; diff --git a/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriod/CommentRepository.php b/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriod/CommentRepository.php index 207864ae2..3759cf2cd 100644 --- a/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriod/CommentRepository.php +++ b/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriod/CommentRepository.php @@ -17,7 +17,7 @@ use Doctrine\ORM\EntityRepository; final class CommentRepository { - private EntityRepository $repository; + private readonly EntityRepository $repository; public function __construct(EntityManagerInterface $entityManager) { diff --git a/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriod/OriginRepository.php b/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriod/OriginRepository.php index 3b3b6283d..1668b456e 100644 --- a/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriod/OriginRepository.php +++ b/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriod/OriginRepository.php @@ -17,7 +17,7 @@ use Doctrine\ORM\EntityRepository; final class OriginRepository { - private EntityRepository $repository; + private readonly EntityRepository $repository; public function __construct(EntityManagerInterface $entityManager) { diff --git a/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriod/ResourceRepository.php b/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriod/ResourceRepository.php index d8bc4e306..a5dbf4b69 100644 --- a/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriod/ResourceRepository.php +++ b/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriod/ResourceRepository.php @@ -17,7 +17,7 @@ use Doctrine\ORM\EntityRepository; final class ResourceRepository { - private EntityRepository $repository; + private readonly EntityRepository $repository; public function __construct(EntityManagerInterface $entityManager) { diff --git a/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriodACLAwareRepository.php b/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriodACLAwareRepository.php index 2b70da0a1..0c65a4e5a 100644 --- a/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriodACLAwareRepository.php +++ b/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriodACLAwareRepository.php @@ -33,7 +33,7 @@ use Doctrine\ORM\QueryBuilder; use Symfony\Component\Security\Core\Security; use function count; -final class AccompanyingPeriodACLAwareRepository implements AccompanyingPeriodACLAwareRepositoryInterface +final readonly class AccompanyingPeriodACLAwareRepository implements AccompanyingPeriodACLAwareRepositoryInterface { public function __construct(private AccompanyingPeriodRepository $accompanyingPeriodRepository, private Security $security, private AuthorizationHelper $authorizationHelper, private CenterResolverDispatcherInterface $centerResolverDispatcher) { diff --git a/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriodParticipationRepository.php b/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriodParticipationRepository.php index 5384a1cdd..616c56eb0 100644 --- a/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriodParticipationRepository.php +++ b/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriodParticipationRepository.php @@ -17,7 +17,7 @@ use Doctrine\ORM\EntityRepository; final class AccompanyingPeriodParticipationRepository { - private EntityRepository $repository; + private readonly EntityRepository $repository; public function __construct(EntityManagerInterface $entityManager) { diff --git a/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriodRepository.php b/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriodRepository.php index 6b7311207..36af2c763 100644 --- a/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriodRepository.php +++ b/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriodRepository.php @@ -21,7 +21,7 @@ use Doctrine\Persistence\ObjectRepository; final class AccompanyingPeriodRepository implements ObjectRepository { - private EntityRepository $repository; + private readonly EntityRepository $repository; public function __construct(EntityManagerInterface $entityManager) { diff --git a/src/Bundle/ChillPersonBundle/Repository/Household/HouseholdACLAwareRepository.php b/src/Bundle/ChillPersonBundle/Repository/Household/HouseholdACLAwareRepository.php index 33a17dfa1..7cc9e7dbe 100644 --- a/src/Bundle/ChillPersonBundle/Repository/Household/HouseholdACLAwareRepository.php +++ b/src/Bundle/ChillPersonBundle/Repository/Household/HouseholdACLAwareRepository.php @@ -20,7 +20,7 @@ use Doctrine\ORM\EntityManagerInterface; use Doctrine\ORM\QueryBuilder; use Symfony\Component\Security\Core\Security; -final class HouseholdACLAwareRepository implements HouseholdACLAwareRepositoryInterface +final readonly class HouseholdACLAwareRepository implements HouseholdACLAwareRepositoryInterface { public function __construct(private EntityManagerInterface $em, private AuthorizationHelper $authorizationHelper, private Security $security) { diff --git a/src/Bundle/ChillPersonBundle/Repository/Household/HouseholdCompositionRepository.php b/src/Bundle/ChillPersonBundle/Repository/Household/HouseholdCompositionRepository.php index e25d0c867..5a0dee15d 100644 --- a/src/Bundle/ChillPersonBundle/Repository/Household/HouseholdCompositionRepository.php +++ b/src/Bundle/ChillPersonBundle/Repository/Household/HouseholdCompositionRepository.php @@ -18,7 +18,7 @@ use Doctrine\ORM\EntityRepository; final class HouseholdCompositionRepository implements HouseholdCompositionRepositoryInterface { - private EntityRepository $repository; + private readonly EntityRepository $repository; public function __construct(EntityManagerInterface $entityManager) { diff --git a/src/Bundle/ChillPersonBundle/Repository/Household/HouseholdCompositionTypeRepository.php b/src/Bundle/ChillPersonBundle/Repository/Household/HouseholdCompositionTypeRepository.php index 04110942b..1e2c4a67f 100644 --- a/src/Bundle/ChillPersonBundle/Repository/Household/HouseholdCompositionTypeRepository.php +++ b/src/Bundle/ChillPersonBundle/Repository/Household/HouseholdCompositionTypeRepository.php @@ -17,7 +17,7 @@ use Doctrine\ORM\EntityRepository; final class HouseholdCompositionTypeRepository implements HouseholdCompositionTypeRepositoryInterface { - private EntityRepository $repository; + private readonly EntityRepository $repository; public function __construct(EntityManagerInterface $entityManager) { diff --git a/src/Bundle/ChillPersonBundle/Repository/Household/HouseholdMembersRepository.php b/src/Bundle/ChillPersonBundle/Repository/Household/HouseholdMembersRepository.php index 564c17732..e76e88fc3 100644 --- a/src/Bundle/ChillPersonBundle/Repository/Household/HouseholdMembersRepository.php +++ b/src/Bundle/ChillPersonBundle/Repository/Household/HouseholdMembersRepository.php @@ -17,7 +17,7 @@ use Doctrine\ORM\EntityRepository; final class HouseholdMembersRepository { - private EntityRepository $repository; + private readonly EntityRepository $repository; public function __construct(EntityManagerInterface $entityManager) { diff --git a/src/Bundle/ChillPersonBundle/Repository/Household/HouseholdRepository.php b/src/Bundle/ChillPersonBundle/Repository/Household/HouseholdRepository.php index 5123e8eb1..95fbda3ee 100644 --- a/src/Bundle/ChillPersonBundle/Repository/Household/HouseholdRepository.php +++ b/src/Bundle/ChillPersonBundle/Repository/Household/HouseholdRepository.php @@ -42,9 +42,9 @@ final class HouseholdRepository implements ObjectRepository SELECT {select} FROM households {limits} SQL; - private EntityManagerInterface $em; + private readonly EntityManagerInterface $em; - private EntityRepository $repository; + private readonly EntityRepository $repository; public function __construct(EntityManagerInterface $entityManager) { diff --git a/src/Bundle/ChillPersonBundle/Repository/Household/PersonHouseholdAddressRepository.php b/src/Bundle/ChillPersonBundle/Repository/Household/PersonHouseholdAddressRepository.php index bc8fddf4e..ebcfabe4f 100644 --- a/src/Bundle/ChillPersonBundle/Repository/Household/PersonHouseholdAddressRepository.php +++ b/src/Bundle/ChillPersonBundle/Repository/Household/PersonHouseholdAddressRepository.php @@ -18,7 +18,7 @@ use Doctrine\Persistence\ObjectRepository; final class PersonHouseholdAddressRepository implements ObjectRepository { - private EntityRepository $repository; + private readonly EntityRepository $repository; public function __construct(EntityManagerInterface $em) { diff --git a/src/Bundle/ChillPersonBundle/Repository/Household/PositionRepository.php b/src/Bundle/ChillPersonBundle/Repository/Household/PositionRepository.php index 734d83156..99e7338f9 100644 --- a/src/Bundle/ChillPersonBundle/Repository/Household/PositionRepository.php +++ b/src/Bundle/ChillPersonBundle/Repository/Household/PositionRepository.php @@ -20,7 +20,7 @@ use Doctrine\Persistence\ObjectRepository; final class PositionRepository implements ObjectRepository { - private EntityRepository $repository; + private readonly EntityRepository $repository; public function __construct(EntityManagerInterface $entityManager) { diff --git a/src/Bundle/ChillPersonBundle/Repository/MaritalStatusRepository.php b/src/Bundle/ChillPersonBundle/Repository/MaritalStatusRepository.php index 8697f9346..3324ee444 100644 --- a/src/Bundle/ChillPersonBundle/Repository/MaritalStatusRepository.php +++ b/src/Bundle/ChillPersonBundle/Repository/MaritalStatusRepository.php @@ -17,7 +17,7 @@ use Doctrine\ORM\EntityRepository; class MaritalStatusRepository implements MaritalStatusRepositoryInterface { - private EntityRepository $repository; + private readonly EntityRepository $repository; public function __construct(EntityManagerInterface $entityManager) { diff --git a/src/Bundle/ChillPersonBundle/Repository/Person/PersonCenterHistoryRepository.php b/src/Bundle/ChillPersonBundle/Repository/Person/PersonCenterHistoryRepository.php index a29c4f93a..b6d80a721 100644 --- a/src/Bundle/ChillPersonBundle/Repository/Person/PersonCenterHistoryRepository.php +++ b/src/Bundle/ChillPersonBundle/Repository/Person/PersonCenterHistoryRepository.php @@ -17,7 +17,7 @@ use Doctrine\ORM\EntityRepository; class PersonCenterHistoryRepository implements PersonCenterHistoryInterface { - private EntityRepository $repository; + private readonly EntityRepository $repository; public function __construct(EntityManagerInterface $em) { diff --git a/src/Bundle/ChillPersonBundle/Repository/PersonACLAwareRepository.php b/src/Bundle/ChillPersonBundle/Repository/PersonACLAwareRepository.php index dd82b6b96..cd68796f0 100644 --- a/src/Bundle/ChillPersonBundle/Repository/PersonACLAwareRepository.php +++ b/src/Bundle/ChillPersonBundle/Repository/PersonACLAwareRepository.php @@ -32,7 +32,7 @@ use function count; use function explode; use function implode; -final class PersonACLAwareRepository implements PersonACLAwareRepositoryInterface +final readonly class PersonACLAwareRepository implements PersonACLAwareRepositoryInterface { public function __construct(private Security $security, private EntityManagerInterface $em, private CountryRepository $countryRepository, private AuthorizationHelperInterface $authorizationHelper) { diff --git a/src/Bundle/ChillPersonBundle/Repository/PersonAltNameRepository.php b/src/Bundle/ChillPersonBundle/Repository/PersonAltNameRepository.php index 41a9efe63..4a1ee1dd6 100644 --- a/src/Bundle/ChillPersonBundle/Repository/PersonAltNameRepository.php +++ b/src/Bundle/ChillPersonBundle/Repository/PersonAltNameRepository.php @@ -17,7 +17,7 @@ use Doctrine\ORM\EntityRepository; final class PersonAltNameRepository { - private EntityRepository $repository; + private readonly EntityRepository $repository; public function __construct(EntityManagerInterface $entityManager) { diff --git a/src/Bundle/ChillPersonBundle/Repository/PersonNotDuplicateRepository.php b/src/Bundle/ChillPersonBundle/Repository/PersonNotDuplicateRepository.php index 146357715..6694f0e32 100644 --- a/src/Bundle/ChillPersonBundle/Repository/PersonNotDuplicateRepository.php +++ b/src/Bundle/ChillPersonBundle/Repository/PersonNotDuplicateRepository.php @@ -18,7 +18,7 @@ use Doctrine\ORM\EntityRepository; final class PersonNotDuplicateRepository { - private EntityRepository $repository; + private readonly EntityRepository $repository; public function __construct(EntityManagerInterface $entityManager) { diff --git a/src/Bundle/ChillPersonBundle/Repository/PersonRepository.php b/src/Bundle/ChillPersonBundle/Repository/PersonRepository.php index a38df8787..39b4dc306 100644 --- a/src/Bundle/ChillPersonBundle/Repository/PersonRepository.php +++ b/src/Bundle/ChillPersonBundle/Repository/PersonRepository.php @@ -24,7 +24,7 @@ use function str_replace; final class PersonRepository implements ObjectRepository { - private EntityRepository $repository; + private readonly EntityRepository $repository; public function __construct(EntityManagerInterface $entityManager) { diff --git a/src/Bundle/ChillPersonBundle/Repository/PersonResourceRepository.php b/src/Bundle/ChillPersonBundle/Repository/PersonResourceRepository.php index 75f205cbc..9280ade69 100644 --- a/src/Bundle/ChillPersonBundle/Repository/PersonResourceRepository.php +++ b/src/Bundle/ChillPersonBundle/Repository/PersonResourceRepository.php @@ -18,7 +18,7 @@ use Doctrine\Persistence\ObjectRepository; final class PersonResourceRepository implements ObjectRepository { - private EntityRepository $repository; + private readonly EntityRepository $repository; public function __construct(EntityManagerInterface $entityManager) { diff --git a/src/Bundle/ChillPersonBundle/Repository/Relationships/RelationRepository.php b/src/Bundle/ChillPersonBundle/Repository/Relationships/RelationRepository.php index 111f122a7..d3fe813dc 100644 --- a/src/Bundle/ChillPersonBundle/Repository/Relationships/RelationRepository.php +++ b/src/Bundle/ChillPersonBundle/Repository/Relationships/RelationRepository.php @@ -18,7 +18,7 @@ use Doctrine\Persistence\ObjectRepository; class RelationRepository implements ObjectRepository { - private EntityRepository $repository; + private readonly EntityRepository $repository; public function __construct(EntityManagerInterface $entityManager) { diff --git a/src/Bundle/ChillPersonBundle/Repository/Relationships/RelationshipRepository.php b/src/Bundle/ChillPersonBundle/Repository/Relationships/RelationshipRepository.php index 442ce1c55..932b872c5 100644 --- a/src/Bundle/ChillPersonBundle/Repository/Relationships/RelationshipRepository.php +++ b/src/Bundle/ChillPersonBundle/Repository/Relationships/RelationshipRepository.php @@ -20,9 +20,9 @@ use Doctrine\Persistence\ObjectRepository; class RelationshipRepository implements ObjectRepository { - private EntityManagerInterface $em; + private readonly EntityManagerInterface $em; - private EntityRepository $repository; + private readonly EntityRepository $repository; public function __construct(EntityManagerInterface $em) { diff --git a/src/Bundle/ChillPersonBundle/Repository/SocialWork/EvaluationRepository.php b/src/Bundle/ChillPersonBundle/Repository/SocialWork/EvaluationRepository.php index e8de5a278..a7b739f7d 100644 --- a/src/Bundle/ChillPersonBundle/Repository/SocialWork/EvaluationRepository.php +++ b/src/Bundle/ChillPersonBundle/Repository/SocialWork/EvaluationRepository.php @@ -17,7 +17,7 @@ use Doctrine\ORM\EntityRepository; final class EvaluationRepository implements EvaluationRepositoryInterface { - private EntityRepository $repository; + private readonly EntityRepository $repository; public function __construct(EntityManagerInterface $entityManager) { diff --git a/src/Bundle/ChillPersonBundle/Repository/SocialWork/GoalRepository.php b/src/Bundle/ChillPersonBundle/Repository/SocialWork/GoalRepository.php index c667eafbf..a798c8388 100644 --- a/src/Bundle/ChillPersonBundle/Repository/SocialWork/GoalRepository.php +++ b/src/Bundle/ChillPersonBundle/Repository/SocialWork/GoalRepository.php @@ -21,7 +21,7 @@ use Doctrine\Persistence\ObjectRepository; final class GoalRepository implements ObjectRepository { - private EntityRepository $repository; + private readonly EntityRepository $repository; public function __construct(EntityManagerInterface $entityManager) { diff --git a/src/Bundle/ChillPersonBundle/Repository/SocialWork/ResultRepository.php b/src/Bundle/ChillPersonBundle/Repository/SocialWork/ResultRepository.php index 747611500..407626afe 100644 --- a/src/Bundle/ChillPersonBundle/Repository/SocialWork/ResultRepository.php +++ b/src/Bundle/ChillPersonBundle/Repository/SocialWork/ResultRepository.php @@ -21,7 +21,7 @@ use Doctrine\Persistence\ObjectRepository; final class ResultRepository implements ObjectRepository { - private EntityRepository $repository; + private readonly EntityRepository $repository; public function __construct(EntityManagerInterface $entityManager) { diff --git a/src/Bundle/ChillPersonBundle/Repository/SocialWork/SocialActionRepository.php b/src/Bundle/ChillPersonBundle/Repository/SocialWork/SocialActionRepository.php index 62ca3d853..b4df922a1 100644 --- a/src/Bundle/ChillPersonBundle/Repository/SocialWork/SocialActionRepository.php +++ b/src/Bundle/ChillPersonBundle/Repository/SocialWork/SocialActionRepository.php @@ -20,7 +20,7 @@ use Doctrine\Persistence\ObjectRepository; final class SocialActionRepository implements ObjectRepository { - private EntityRepository $repository; + private readonly EntityRepository $repository; public function __construct(EntityManagerInterface $entityManager) { diff --git a/src/Bundle/ChillPersonBundle/Repository/SocialWork/SocialIssueRepository.php b/src/Bundle/ChillPersonBundle/Repository/SocialWork/SocialIssueRepository.php index 63dfcc510..f645a4ac4 100644 --- a/src/Bundle/ChillPersonBundle/Repository/SocialWork/SocialIssueRepository.php +++ b/src/Bundle/ChillPersonBundle/Repository/SocialWork/SocialIssueRepository.php @@ -20,7 +20,7 @@ use Doctrine\Persistence\ObjectRepository; final class SocialIssueRepository implements ObjectRepository { - private EntityRepository $repository; + private readonly EntityRepository $repository; public function __construct(EntityManagerInterface $entityManager) { diff --git a/src/Bundle/ChillPersonBundle/Search/PersonSearch.php b/src/Bundle/ChillPersonBundle/Search/PersonSearch.php index 05b55dd23..205023f19 100644 --- a/src/Bundle/ChillPersonBundle/Search/PersonSearch.php +++ b/src/Bundle/ChillPersonBundle/Search/PersonSearch.php @@ -38,14 +38,14 @@ use function array_merge; class PersonSearch extends AbstractSearch implements HasAdvancedSearchFormInterface { - public const NAME = 'person_regular'; + final public const NAME = 'person_regular'; private const POSSIBLE_KEYS = [ '_default', 'firstname', 'lastname', 'birthdate', 'birthdate-before', 'birthdate-after', 'gender', 'nationality', 'phonenumber', 'city', ]; - public function __construct(private EngineInterface $templating, private ExtractDateFromPattern $extractDateFromPattern, private ExtractPhonenumberFromPattern $extractPhonenumberFromPattern, private PaginatorFactory $paginatorFactory, private PersonACLAwareRepositoryInterface $personACLAwareRepository) + public function __construct(private readonly EngineInterface $templating, private readonly ExtractDateFromPattern $extractDateFromPattern, private readonly ExtractPhonenumberFromPattern $extractPhonenumberFromPattern, private readonly PaginatorFactory $paginatorFactory, private readonly PersonACLAwareRepositoryInterface $personACLAwareRepository) { } @@ -101,7 +101,7 @@ class PersonSearch extends AbstractSearch implements HasAdvancedSearchFormInterf foreach (['firstname', 'lastname', 'gender', 'city'] as $key) { $string .= !isset($data[$key]) ? '' : $key . ':' . // add quote if contains spaces - (str_contains($data[$key], ' ') ? '"' . $data[$key] . '"' : $data[$key]) + (str_contains((string) $data[$key], ' ') ? '"' . $data[$key] . '"' : $data[$key]) . ' '; } diff --git a/src/Bundle/ChillPersonBundle/Search/SearchHouseholdApiProvider.php b/src/Bundle/ChillPersonBundle/Search/SearchHouseholdApiProvider.php index 5dcb3e7b3..fd8bc9557 100644 --- a/src/Bundle/ChillPersonBundle/Search/SearchHouseholdApiProvider.php +++ b/src/Bundle/ChillPersonBundle/Search/SearchHouseholdApiProvider.php @@ -26,7 +26,7 @@ use function in_array; class SearchHouseholdApiProvider implements SearchApiInterface { - public function __construct(private HouseholdRepository $householdRepository, private PersonACLAwareRepositoryInterface $personACLAwareRepository, private Security $security, private AuthorizationHelperInterface $authorizationHelper, private ExtractDateFromPattern $extractDateFromPattern, private ExtractPhonenumberFromPattern $extractPhonenumberFromPattern) + public function __construct(private readonly HouseholdRepository $householdRepository, private readonly PersonACLAwareRepositoryInterface $personACLAwareRepository, private readonly Security $security, private readonly AuthorizationHelperInterface $authorizationHelper, private readonly ExtractDateFromPattern $extractDateFromPattern, private readonly ExtractPhonenumberFromPattern $extractPhonenumberFromPattern) { } diff --git a/src/Bundle/ChillPersonBundle/Search/SearchPersonApiProvider.php b/src/Bundle/ChillPersonBundle/Search/SearchPersonApiProvider.php index 9e2e9d6f5..5ad51f842 100644 --- a/src/Bundle/ChillPersonBundle/Search/SearchPersonApiProvider.php +++ b/src/Bundle/ChillPersonBundle/Search/SearchPersonApiProvider.php @@ -26,7 +26,7 @@ use function in_array; class SearchPersonApiProvider implements SearchApiInterface { - public function __construct(private PersonRepository $personRepository, private PersonACLAwareRepositoryInterface $personACLAwareRepository, private Security $security, private AuthorizationHelperInterface $authorizationHelper, private ExtractDateFromPattern $extractDateFromPattern, private ExtractPhonenumberFromPattern $extractPhonenumberFromPattern) + public function __construct(private readonly PersonRepository $personRepository, private readonly PersonACLAwareRepositoryInterface $personACLAwareRepository, private readonly Security $security, private readonly AuthorizationHelperInterface $authorizationHelper, private readonly ExtractDateFromPattern $extractDateFromPattern, private readonly ExtractPhonenumberFromPattern $extractPhonenumberFromPattern) { } diff --git a/src/Bundle/ChillPersonBundle/Search/SimilarPersonMatcher.php b/src/Bundle/ChillPersonBundle/Search/SimilarPersonMatcher.php index 4da00c5fa..03b46957c 100644 --- a/src/Bundle/ChillPersonBundle/Search/SimilarPersonMatcher.php +++ b/src/Bundle/ChillPersonBundle/Search/SimilarPersonMatcher.php @@ -23,9 +23,9 @@ use function count; class SimilarPersonMatcher { - public const SIMILAR_SEARCH_ORDER_BY_ALPHABETICAL = 'alphabetical'; + final public const SIMILAR_SEARCH_ORDER_BY_ALPHABETICAL = 'alphabetical'; - public const SIMILAR_SEARCH_ORDER_BY_SIMILARITY = 'similarity'; + final public const SIMILAR_SEARCH_ORDER_BY_SIMILARITY = 'similarity'; /** * @var AuthorizationHelper diff --git a/src/Bundle/ChillPersonBundle/Security/Authorization/AccompanyingPeriodCommentVoter.php b/src/Bundle/ChillPersonBundle/Security/Authorization/AccompanyingPeriodCommentVoter.php index e8a06a8b3..613a3a514 100644 --- a/src/Bundle/ChillPersonBundle/Security/Authorization/AccompanyingPeriodCommentVoter.php +++ b/src/Bundle/ChillPersonBundle/Security/Authorization/AccompanyingPeriodCommentVoter.php @@ -19,11 +19,11 @@ use UnexpectedValueException; class AccompanyingPeriodCommentVoter extends Voter { - public const DELETE = 'CHILL_PERSON_ACCOMPANYING_PERIOD_COMMENT_DELETE'; + final public const DELETE = 'CHILL_PERSON_ACCOMPANYING_PERIOD_COMMENT_DELETE'; - public const EDIT = 'CHILL_PERSON_ACCOMPANYING_PERIOD_COMMENT_EDIT'; + final public const EDIT = 'CHILL_PERSON_ACCOMPANYING_PERIOD_COMMENT_EDIT'; - public function __construct(private Security $security) + public function __construct(private readonly Security $security) { } diff --git a/src/Bundle/ChillPersonBundle/Security/Authorization/AccompanyingPeriodResourceVoter.php b/src/Bundle/ChillPersonBundle/Security/Authorization/AccompanyingPeriodResourceVoter.php index 432c142fe..38c3c8633 100644 --- a/src/Bundle/ChillPersonBundle/Security/Authorization/AccompanyingPeriodResourceVoter.php +++ b/src/Bundle/ChillPersonBundle/Security/Authorization/AccompanyingPeriodResourceVoter.php @@ -19,9 +19,9 @@ use UnexpectedValueException; class AccompanyingPeriodResourceVoter extends Voter { - public const EDIT = 'CHILL_PERSON_ACCOMPANYING_PERIOD_RESOURCE_EDIT'; + final public const EDIT = 'CHILL_PERSON_ACCOMPANYING_PERIOD_RESOURCE_EDIT'; - public function __construct(private AccessDecisionManagerInterface $accessDecisionManager) + public function __construct(private readonly AccessDecisionManagerInterface $accessDecisionManager) { } diff --git a/src/Bundle/ChillPersonBundle/Security/Authorization/AccompanyingPeriodVoter.php b/src/Bundle/ChillPersonBundle/Security/Authorization/AccompanyingPeriodVoter.php index 817873738..c99ee0da4 100644 --- a/src/Bundle/ChillPersonBundle/Security/Authorization/AccompanyingPeriodVoter.php +++ b/src/Bundle/ChillPersonBundle/Security/Authorization/AccompanyingPeriodVoter.php @@ -29,7 +29,7 @@ class AccompanyingPeriodVoter extends AbstractChillVoter implements ProvideRoleH /** * all the roles that are linked to an accompanying period. */ - public const ALL = [ + final public const ALL = [ self::SEE, self::SEE_DETAILS, self::CREATE, @@ -44,28 +44,28 @@ class AccompanyingPeriodVoter extends AbstractChillVoter implements ProvideRoleH /** * Give the ability to see all confidential courses. */ - public const CONFIDENTIAL_CRUD = 'CHILL_PERSON_ACCOMPANYING_PERIOD_CRUD_CONFIDENTIAL'; + final public const CONFIDENTIAL_CRUD = 'CHILL_PERSON_ACCOMPANYING_PERIOD_CRUD_CONFIDENTIAL'; - public const CREATE = 'CHILL_PERSON_ACCOMPANYING_PERIOD_CREATE'; + final public const CREATE = 'CHILL_PERSON_ACCOMPANYING_PERIOD_CREATE'; /** * role to DELETE the course. * * Will be true only for the creator, and if the course is still at DRAFT step. */ - public const DELETE = 'CHILL_PERSON_ACCOMPANYING_PERIOD_DELETE'; + final public const DELETE = 'CHILL_PERSON_ACCOMPANYING_PERIOD_DELETE'; /** * role to EDIT the course. * * If the course is closed, it will be always false. */ - public const EDIT = 'CHILL_PERSON_ACCOMPANYING_PERIOD_UPDATE'; + final public const EDIT = 'CHILL_PERSON_ACCOMPANYING_PERIOD_UPDATE'; /** * Give all the right above. */ - public const FULL = 'CHILL_PERSON_ACCOMPANYING_PERIOD_FULL'; + final public const FULL = 'CHILL_PERSON_ACCOMPANYING_PERIOD_FULL'; /** * Reopen a closed course. @@ -73,43 +73,43 @@ class AccompanyingPeriodVoter extends AbstractChillVoter implements ProvideRoleH * This forward to the EDIT role, without taking into account that the course * is closed */ - public const RE_OPEN_COURSE = 'CHILL_PERSON_ACCOMPANYING_PERIOD_REOPEN'; + final public const RE_OPEN_COURSE = 'CHILL_PERSON_ACCOMPANYING_PERIOD_REOPEN'; /** * Allow user to bulk reassign the courses. */ - public const REASSIGN_BULK = 'CHILL_PERSON_ACCOMPANYING_COURSE_REASSIGN_BULK'; + final public const REASSIGN_BULK = 'CHILL_PERSON_ACCOMPANYING_COURSE_REASSIGN_BULK'; - public const SEE = 'CHILL_PERSON_ACCOMPANYING_PERIOD_SEE'; + final public const SEE = 'CHILL_PERSON_ACCOMPANYING_PERIOD_SEE'; /** * details are for seeing:. * * * SocialIssues */ - public const SEE_DETAILS = 'CHILL_PERSON_ACCOMPANYING_PERIOD_SEE_DETAILS'; + final public const SEE_DETAILS = 'CHILL_PERSON_ACCOMPANYING_PERIOD_SEE_DETAILS'; /** * Give the ability to see statistics. */ - public const STATS = 'CHILL_PERSON_ACCOMPANYING_PERIOD_STATS'; + final public const STATS = 'CHILL_PERSON_ACCOMPANYING_PERIOD_STATS'; /** * Right to toggle confidentiality. */ - public const TOGGLE_CONFIDENTIAL = 'CHILL_PERSON_ACCOMPANYING_PERIOD_TOGGLE_CONFIDENTIAL'; + final public const TOGGLE_CONFIDENTIAL = 'CHILL_PERSON_ACCOMPANYING_PERIOD_TOGGLE_CONFIDENTIAL'; - public const TOGGLE_CONFIDENTIAL_ALL = 'CHILL_PERSON_ACCOMPANYING_PERIOD_TOGGLE_CONFIDENTIAL_ALL'; + final public const TOGGLE_CONFIDENTIAL_ALL = 'CHILL_PERSON_ACCOMPANYING_PERIOD_TOGGLE_CONFIDENTIAL_ALL'; /** * Right to toggle urgency of parcours. */ - public const TOGGLE_INTENSITY = 'CHILL_PERSON_ACCOMPANYING_PERIOD_TOGGLE_INTENSITY'; + final public const TOGGLE_INTENSITY = 'CHILL_PERSON_ACCOMPANYING_PERIOD_TOGGLE_INTENSITY'; - private VoterHelperInterface $voterHelper; + private readonly VoterHelperInterface $voterHelper; public function __construct( - private Security $security, + private readonly Security $security, VoterHelperFactoryInterface $voterHelperFactory ) { $this->voterHelper = $voterHelperFactory diff --git a/src/Bundle/ChillPersonBundle/Security/Authorization/AccompanyingPeriodWorkEvaluationDocumentVoter.php b/src/Bundle/ChillPersonBundle/Security/Authorization/AccompanyingPeriodWorkEvaluationDocumentVoter.php index 8591a044f..dffe3a89c 100644 --- a/src/Bundle/ChillPersonBundle/Security/Authorization/AccompanyingPeriodWorkEvaluationDocumentVoter.php +++ b/src/Bundle/ChillPersonBundle/Security/Authorization/AccompanyingPeriodWorkEvaluationDocumentVoter.php @@ -24,9 +24,9 @@ use UnexpectedValueException; */ class AccompanyingPeriodWorkEvaluationDocumentVoter extends Voter { - public const SEE = 'CHILL_MAIN_ACCOMPANYING_PERIOD_WORK_EVALUATION_DOCUMENT_SHOW'; + final public const SEE = 'CHILL_MAIN_ACCOMPANYING_PERIOD_WORK_EVALUATION_DOCUMENT_SHOW'; - public function __construct(private AccessDecisionManagerInterface $accessDecisionManager) + public function __construct(private readonly AccessDecisionManagerInterface $accessDecisionManager) { } diff --git a/src/Bundle/ChillPersonBundle/Security/Authorization/AccompanyingPeriodWorkEvaluationVoter.php b/src/Bundle/ChillPersonBundle/Security/Authorization/AccompanyingPeriodWorkEvaluationVoter.php index 955d199ff..2588443cb 100644 --- a/src/Bundle/ChillPersonBundle/Security/Authorization/AccompanyingPeriodWorkEvaluationVoter.php +++ b/src/Bundle/ChillPersonBundle/Security/Authorization/AccompanyingPeriodWorkEvaluationVoter.php @@ -21,16 +21,16 @@ use function in_array; class AccompanyingPeriodWorkEvaluationVoter extends Voter implements ChillVoterInterface { - public const ALL = [ + final public const ALL = [ self::SEE, self::STATS, ]; - public const SEE = 'CHILL_MAIN_ACCOMPANYING_PERIOD_WORK_EVALUATION_SHOW'; + final public const SEE = 'CHILL_MAIN_ACCOMPANYING_PERIOD_WORK_EVALUATION_SHOW'; - public const STATS = 'CHILL_MAIN_ACCOMPANYING_PERIOD_WORK_EVALUATION_STATS'; + final public const STATS = 'CHILL_MAIN_ACCOMPANYING_PERIOD_WORK_EVALUATION_STATS'; - public function __construct(private Security $security) + public function __construct(private readonly Security $security) { } diff --git a/src/Bundle/ChillPersonBundle/Security/Authorization/AccompanyingPeriodWorkVoter.php b/src/Bundle/ChillPersonBundle/Security/Authorization/AccompanyingPeriodWorkVoter.php index 43a99e7e1..69f90fa12 100644 --- a/src/Bundle/ChillPersonBundle/Security/Authorization/AccompanyingPeriodWorkVoter.php +++ b/src/Bundle/ChillPersonBundle/Security/Authorization/AccompanyingPeriodWorkVoter.php @@ -27,25 +27,25 @@ use function in_array; class AccompanyingPeriodWorkVoter extends Voter implements ProvideRoleHierarchyInterface, ChillVoterInterface { - public const ALL = [ + final public const ALL = [ self::SEE, self::CREATE, self::UPDATE, self::DELETE, ]; - public const CREATE = 'CHILL_MAIN_ACCOMPANYING_PERIOD_WORK_CREATE'; + final public const CREATE = 'CHILL_MAIN_ACCOMPANYING_PERIOD_WORK_CREATE'; - public const DELETE = 'CHILL_MAIN_ACCOMPANYING_PERIOD_WORK_DELETE'; + final public const DELETE = 'CHILL_MAIN_ACCOMPANYING_PERIOD_WORK_DELETE'; - public const SEE = 'CHILL_MAIN_ACCOMPANYING_PERIOD_WORK_SEE'; + final public const SEE = 'CHILL_MAIN_ACCOMPANYING_PERIOD_WORK_SEE'; - public const UPDATE = 'CHILL_MAIN_ACCOMPANYING_PERIOD_WORK_UPDATE'; + final public const UPDATE = 'CHILL_MAIN_ACCOMPANYING_PERIOD_WORK_UPDATE'; - private VoterHelperInterface $voterHelper; + private readonly VoterHelperInterface $voterHelper; public function __construct( - private Security $security, + private readonly Security $security, VoterHelperFactoryInterface $voterHelperFactory ) { $this->voterHelper = $voterHelperFactory diff --git a/src/Bundle/ChillPersonBundle/Security/Authorization/HouseholdVoter.php b/src/Bundle/ChillPersonBundle/Security/Authorization/HouseholdVoter.php index 74eee07f6..7000730a7 100644 --- a/src/Bundle/ChillPersonBundle/Security/Authorization/HouseholdVoter.php +++ b/src/Bundle/ChillPersonBundle/Security/Authorization/HouseholdVoter.php @@ -26,16 +26,16 @@ use function in_array; class HouseholdVoter extends Voter implements ProvideRoleHierarchyInterface, ChillVoterInterface { - public const EDIT = 'CHILL_PERSON_HOUSEHOLD_EDIT'; + final public const EDIT = 'CHILL_PERSON_HOUSEHOLD_EDIT'; - public const SEE = 'CHILL_PERSON_HOUSEHOLD_SEE'; + final public const SEE = 'CHILL_PERSON_HOUSEHOLD_SEE'; /** * @deprecated use @see{self::SEE} instead */ - public const SHOW = self::SEE; + final public const SHOW = self::SEE; - public const STATS = 'CHILL_PERSON_HOUSEHOLD_STATS'; + final public const STATS = 'CHILL_PERSON_HOUSEHOLD_STATS'; private const ALL = [ self::SEE, @@ -43,9 +43,9 @@ class HouseholdVoter extends Voter implements ProvideRoleHierarchyInterface, Chi self::STATS, ]; - private VoterHelperInterface $helper; + private readonly VoterHelperInterface $helper; - public function __construct(private Security $security, VoterHelperFactoryInterface $voterHelperFactory) + public function __construct(private readonly Security $security, VoterHelperFactoryInterface $voterHelperFactory) { $this->helper = $voterHelperFactory ->generate(self::class) diff --git a/src/Bundle/ChillPersonBundle/Security/Authorization/PersonVoter.php b/src/Bundle/ChillPersonBundle/Security/Authorization/PersonVoter.php index 95f10458b..2de8a1554 100644 --- a/src/Bundle/ChillPersonBundle/Security/Authorization/PersonVoter.php +++ b/src/Bundle/ChillPersonBundle/Security/Authorization/PersonVoter.php @@ -21,17 +21,17 @@ use Symfony\Component\Security\Core\Authentication\Token\TokenInterface; class PersonVoter extends AbstractChillVoter implements ProvideRoleHierarchyInterface { - public const CREATE = 'CHILL_PERSON_CREATE'; + final public const CREATE = 'CHILL_PERSON_CREATE'; - public const DUPLICATE = 'CHILL_PERSON_DUPLICATE'; + final public const DUPLICATE = 'CHILL_PERSON_DUPLICATE'; - public const LISTS = 'CHILL_PERSON_LISTS'; + final public const LISTS = 'CHILL_PERSON_LISTS'; - public const SEE = 'CHILL_PERSON_SEE'; + final public const SEE = 'CHILL_PERSON_SEE'; - public const STATS = 'CHILL_PERSON_STATS'; + final public const STATS = 'CHILL_PERSON_STATS'; - public const UPDATE = 'CHILL_PERSON_UPDATE'; + final public const UPDATE = 'CHILL_PERSON_UPDATE'; protected VoterHelperInterface $voter; diff --git a/src/Bundle/ChillPersonBundle/Security/AuthorizedCenterOnPersonCreation.php b/src/Bundle/ChillPersonBundle/Security/AuthorizedCenterOnPersonCreation.php index 8b649f8f0..ae5f5281b 100644 --- a/src/Bundle/ChillPersonBundle/Security/AuthorizedCenterOnPersonCreation.php +++ b/src/Bundle/ChillPersonBundle/Security/AuthorizedCenterOnPersonCreation.php @@ -17,9 +17,9 @@ use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface; class AuthorizedCenterOnPersonCreation implements AuthorizedCenterOnPersonCreationInterface { - private bool $showCenters; + private readonly bool $showCenters; - public function __construct(private AuthorizationHelperForCurrentUserInterface $authorizationHelperForCurrentUser, ParameterBagInterface $parameterBag) + public function __construct(private readonly AuthorizationHelperForCurrentUserInterface $authorizationHelperForCurrentUser, ParameterBagInterface $parameterBag) { $this->showCenters = $parameterBag->get('chill_main')['acl']['form_show_centers']; } diff --git a/src/Bundle/ChillPersonBundle/Serializer/Normalizer/AccompanyingPeriodDocGenNormalizer.php b/src/Bundle/ChillPersonBundle/Serializer/Normalizer/AccompanyingPeriodDocGenNormalizer.php index 0bb3d68b6..c4257e04d 100644 --- a/src/Bundle/ChillPersonBundle/Serializer/Normalizer/AccompanyingPeriodDocGenNormalizer.php +++ b/src/Bundle/ChillPersonBundle/Serializer/Normalizer/AccompanyingPeriodDocGenNormalizer.php @@ -74,7 +74,7 @@ class AccompanyingPeriodDocGenNormalizer implements ContextAwareNormalizerInterf 'pinnedComment' => AccompanyingPeriod\Comment::class, ]; - public function __construct(private TranslatorInterface $translator, private TranslatableStringHelper $translatableStringHelper, private SocialIssueRender $socialIssueRender, private ClosingMotiveRender $closingMotiveRender, private ScopeResolverDispatcher $scopeResolverDispatcher) + public function __construct(private readonly TranslatorInterface $translator, private readonly TranslatableStringHelper $translatableStringHelper, private readonly SocialIssueRender $socialIssueRender, private readonly ClosingMotiveRender $closingMotiveRender, private readonly ScopeResolverDispatcher $scopeResolverDispatcher) { } diff --git a/src/Bundle/ChillPersonBundle/Serializer/Normalizer/AccompanyingPeriodResourceNormalizer.php b/src/Bundle/ChillPersonBundle/Serializer/Normalizer/AccompanyingPeriodResourceNormalizer.php index c2a723274..29912618f 100644 --- a/src/Bundle/ChillPersonBundle/Serializer/Normalizer/AccompanyingPeriodResourceNormalizer.php +++ b/src/Bundle/ChillPersonBundle/Serializer/Normalizer/AccompanyingPeriodResourceNormalizer.php @@ -32,7 +32,7 @@ class AccompanyingPeriodResourceNormalizer implements DenormalizerAwareInterface use ObjectToPopulateTrait; - public function __construct(private ResourceRepository $repository) + public function __construct(private readonly ResourceRepository $repository) { } diff --git a/src/Bundle/ChillPersonBundle/Serializer/Normalizer/AccompanyingPeriodWorkDenormalizer.php b/src/Bundle/ChillPersonBundle/Serializer/Normalizer/AccompanyingPeriodWorkDenormalizer.php index e0697a6fd..1dfed604f 100644 --- a/src/Bundle/ChillPersonBundle/Serializer/Normalizer/AccompanyingPeriodWorkDenormalizer.php +++ b/src/Bundle/ChillPersonBundle/Serializer/Normalizer/AccompanyingPeriodWorkDenormalizer.php @@ -36,11 +36,11 @@ class AccompanyingPeriodWorkDenormalizer implements ContextAwareDenormalizerInte use ObjectToPopulateTrait; - public const GROUP_CREATE = 'accompanying_period_work:create'; + final public const GROUP_CREATE = 'accompanying_period_work:create'; - public const GROUP_EDIT = 'accompanying_period_work:edit'; + final public const GROUP_EDIT = 'accompanying_period_work:edit'; - public function __construct(private AccompanyingPeriodWorkRepository $workRepository, private EntityManagerInterface $em) + public function __construct(private readonly AccompanyingPeriodWorkRepository $workRepository, private readonly EntityManagerInterface $em) { } diff --git a/src/Bundle/ChillPersonBundle/Serializer/Normalizer/AccompanyingPeriodWorkEvaluationDocumentNormalizer.php b/src/Bundle/ChillPersonBundle/Serializer/Normalizer/AccompanyingPeriodWorkEvaluationDocumentNormalizer.php index 7850cc1c8..768e8e45f 100644 --- a/src/Bundle/ChillPersonBundle/Serializer/Normalizer/AccompanyingPeriodWorkEvaluationDocumentNormalizer.php +++ b/src/Bundle/ChillPersonBundle/Serializer/Normalizer/AccompanyingPeriodWorkEvaluationDocumentNormalizer.php @@ -26,7 +26,7 @@ class AccompanyingPeriodWorkEvaluationDocumentNormalizer implements ContextAware private const SKIP = 'accompanying_period_work_evaluation_document_skip'; - public function __construct(private EntityWorkflowRepository $entityWorkflowRepository, private MetadataExtractor $metadataExtractor, private Registry $registry) + public function __construct(private readonly EntityWorkflowRepository $entityWorkflowRepository, private readonly MetadataExtractor $metadataExtractor, private readonly Registry $registry) { } diff --git a/src/Bundle/ChillPersonBundle/Serializer/Normalizer/AccompanyingPeriodWorkEvaluationNormalizer.php b/src/Bundle/ChillPersonBundle/Serializer/Normalizer/AccompanyingPeriodWorkEvaluationNormalizer.php index 512dc6370..1c1076620 100644 --- a/src/Bundle/ChillPersonBundle/Serializer/Normalizer/AccompanyingPeriodWorkEvaluationNormalizer.php +++ b/src/Bundle/ChillPersonBundle/Serializer/Normalizer/AccompanyingPeriodWorkEvaluationNormalizer.php @@ -27,7 +27,7 @@ class AccompanyingPeriodWorkEvaluationNormalizer implements ContextAwareNormaliz private const IGNORE_EVALUATION = 'evaluation:ignore'; - public function __construct(private Registry $registry, private EntityWorkflowRepository $entityWorkflowRepository, private MetadataExtractor $metadataExtractor) + public function __construct(private readonly Registry $registry, private readonly EntityWorkflowRepository $entityWorkflowRepository, private readonly MetadataExtractor $metadataExtractor) { } diff --git a/src/Bundle/ChillPersonBundle/Serializer/Normalizer/AccompanyingPeriodWorkNormalizer.php b/src/Bundle/ChillPersonBundle/Serializer/Normalizer/AccompanyingPeriodWorkNormalizer.php index 12652ce2a..8dc4fc726 100644 --- a/src/Bundle/ChillPersonBundle/Serializer/Normalizer/AccompanyingPeriodWorkNormalizer.php +++ b/src/Bundle/ChillPersonBundle/Serializer/Normalizer/AccompanyingPeriodWorkNormalizer.php @@ -30,7 +30,7 @@ class AccompanyingPeriodWorkNormalizer implements ContextAwareNormalizerInterfac private const IGNORE_WORK = 'ignore:work'; - public function __construct(private Registry $registry, private EntityWorkflowRepository $entityWorkflowRepository, private MetadataExtractor $metadataExtractor) + public function __construct(private readonly Registry $registry, private readonly EntityWorkflowRepository $entityWorkflowRepository, private readonly MetadataExtractor $metadataExtractor) { } diff --git a/src/Bundle/ChillPersonBundle/Serializer/Normalizer/MembersEditorNormalizer.php b/src/Bundle/ChillPersonBundle/Serializer/Normalizer/MembersEditorNormalizer.php index 6185c018d..ad5ef161a 100644 --- a/src/Bundle/ChillPersonBundle/Serializer/Normalizer/MembersEditorNormalizer.php +++ b/src/Bundle/ChillPersonBundle/Serializer/Normalizer/MembersEditorNormalizer.php @@ -31,7 +31,7 @@ class MembersEditorNormalizer implements DenormalizerAwareInterface, Denormalize { use DenormalizerAwareTrait; - public function __construct(private MembersEditorFactory $factory) + public function __construct(private readonly MembersEditorFactory $factory) { } diff --git a/src/Bundle/ChillPersonBundle/Serializer/Normalizer/PersonDocGenNormalizer.php b/src/Bundle/ChillPersonBundle/Serializer/Normalizer/PersonDocGenNormalizer.php index 390d938d9..121c7fedf 100644 --- a/src/Bundle/ChillPersonBundle/Serializer/Normalizer/PersonDocGenNormalizer.php +++ b/src/Bundle/ChillPersonBundle/Serializer/Normalizer/PersonDocGenNormalizer.php @@ -47,7 +47,7 @@ class PersonDocGenNormalizer implements private const CIRCULAR_KEY = 'person:circular'; - public function __construct(private PersonRenderInterface $personRender, private RelationshipRepository $relationshipRepository, private TranslatorInterface $translator, private TranslatableStringHelper $translatableStringHelper, private SummaryBudgetInterface $summaryBudget) + public function __construct(private readonly PersonRenderInterface $personRender, private readonly RelationshipRepository $relationshipRepository, private readonly TranslatorInterface $translator, private readonly TranslatableStringHelper $translatableStringHelper, private readonly SummaryBudgetInterface $summaryBudget) { } diff --git a/src/Bundle/ChillPersonBundle/Serializer/Normalizer/PersonJsonNormalizer.php b/src/Bundle/ChillPersonBundle/Serializer/Normalizer/PersonJsonNormalizer.php index 57f666f05..1420a5bf9 100644 --- a/src/Bundle/ChillPersonBundle/Serializer/Normalizer/PersonJsonNormalizer.php +++ b/src/Bundle/ChillPersonBundle/Serializer/Normalizer/PersonJsonNormalizer.php @@ -48,12 +48,12 @@ class PersonJsonNormalizer implements DenormalizerAwareInterface, NormalizerAwar use ObjectToPopulateTrait; public function __construct( - private ChillEntityRenderExtension $render, + private readonly ChillEntityRenderExtension $render, /* TODO: replace by PersonRenderInterface, as sthis is the only one required */ - private PersonRepository $repository, - private CenterResolverManagerInterface $centerResolverManager, - private ResidentialAddressRepository $residentialAddressRepository, - private PhoneNumberHelperInterface $phoneNumberHelper + private readonly PersonRepository $repository, + private readonly CenterResolverManagerInterface $centerResolverManager, + private readonly ResidentialAddressRepository $residentialAddressRepository, + private readonly PhoneNumberHelperInterface $phoneNumberHelper ) { } @@ -214,14 +214,9 @@ class PersonJsonNormalizer implements DenormalizerAwareInterface, NormalizerAwar return $data; } - return array_merge($data, [ - 'centers' => $this->normalizer->normalize($this->centerResolverManager->resolveCenters($person), $format, $context), - 'altNames' => $this->normalizeAltNames($person->getAltNames()), - 'current_household_id' => $household ? $this->normalizer->normalize($household->getId(), $format, $context) : null, - 'current_residential_addresses' => $currentResidentialAddresses ? - $this->normalizer->normalize($currentResidentialAddresses, $format, $context) : - null, - ]); + return [...$data, 'centers' => $this->normalizer->normalize($this->centerResolverManager->resolveCenters($person), $format, $context), 'altNames' => $this->normalizeAltNames($person->getAltNames()), 'current_household_id' => $household ? $this->normalizer->normalize($household->getId(), $format, $context) : null, 'current_residential_addresses' => $currentResidentialAddresses ? + $this->normalizer->normalize($currentResidentialAddresses, $format, $context) : + null]; } public function supportsDenormalization($data, $type, $format = null) diff --git a/src/Bundle/ChillPersonBundle/Serializer/Normalizer/RelationshipDocGenNormalizer.php b/src/Bundle/ChillPersonBundle/Serializer/Normalizer/RelationshipDocGenNormalizer.php index 42bccba06..23ee8aeb0 100644 --- a/src/Bundle/ChillPersonBundle/Serializer/Normalizer/RelationshipDocGenNormalizer.php +++ b/src/Bundle/ChillPersonBundle/Serializer/Normalizer/RelationshipDocGenNormalizer.php @@ -22,7 +22,7 @@ class RelationshipDocGenNormalizer implements ContextAwareNormalizerInterface, N { use NormalizerAwareTrait; - public function __construct(private TranslatableStringHelperInterface $translatableStringHelper) + public function __construct(private readonly TranslatableStringHelperInterface $translatableStringHelper) { } diff --git a/src/Bundle/ChillPersonBundle/Serializer/Normalizer/SocialActionNormalizer.php b/src/Bundle/ChillPersonBundle/Serializer/Normalizer/SocialActionNormalizer.php index 494c82735..12c36b286 100644 --- a/src/Bundle/ChillPersonBundle/Serializer/Normalizer/SocialActionNormalizer.php +++ b/src/Bundle/ChillPersonBundle/Serializer/Normalizer/SocialActionNormalizer.php @@ -21,7 +21,7 @@ class SocialActionNormalizer implements NormalizerAwareInterface, NormalizerInte { use NormalizerAwareTrait; - public function __construct(private SocialActionRender $render) + public function __construct(private readonly SocialActionRender $render) { } diff --git a/src/Bundle/ChillPersonBundle/Serializer/Normalizer/SocialIssueNormalizer.php b/src/Bundle/ChillPersonBundle/Serializer/Normalizer/SocialIssueNormalizer.php index 7c8c8b226..1882ef7d6 100644 --- a/src/Bundle/ChillPersonBundle/Serializer/Normalizer/SocialIssueNormalizer.php +++ b/src/Bundle/ChillPersonBundle/Serializer/Normalizer/SocialIssueNormalizer.php @@ -21,7 +21,7 @@ class SocialIssueNormalizer implements ContextAwareNormalizerInterface, Normaliz { use NormalizerAwareTrait; - public function __construct(private SocialIssueRender $render) + public function __construct(private readonly SocialIssueRender $render) { } diff --git a/src/Bundle/ChillPersonBundle/Serializer/Normalizer/WorkflowNormalizer.php b/src/Bundle/ChillPersonBundle/Serializer/Normalizer/WorkflowNormalizer.php index b5cbeda07..bce0e3423 100644 --- a/src/Bundle/ChillPersonBundle/Serializer/Normalizer/WorkflowNormalizer.php +++ b/src/Bundle/ChillPersonBundle/Serializer/Normalizer/WorkflowNormalizer.php @@ -27,7 +27,7 @@ class WorkflowNormalizer implements ContextAwareNormalizerInterface, NormalizerA private const IGNORE_ENTITY_WORKFLOW = 'ignore:entity_workflow'; - public function __construct(private Registry $registry, private MetadataExtractor $metadataExtractor) + public function __construct(private readonly Registry $registry, private readonly MetadataExtractor $metadataExtractor) { } diff --git a/src/Bundle/ChillPersonBundle/Service/AccompanyingPeriod/OldDraftAccompanyingPeriodRemover.php b/src/Bundle/ChillPersonBundle/Service/AccompanyingPeriod/OldDraftAccompanyingPeriodRemover.php index 745568ed7..cfc765548 100644 --- a/src/Bundle/ChillPersonBundle/Service/AccompanyingPeriod/OldDraftAccompanyingPeriodRemover.php +++ b/src/Bundle/ChillPersonBundle/Service/AccompanyingPeriod/OldDraftAccompanyingPeriodRemover.php @@ -22,7 +22,7 @@ use Psr\Log\LoggerInterface; class OldDraftAccompanyingPeriodRemover implements OldDraftAccompanyingPeriodRemoverInterface { - public function __construct(private EntityManagerInterface $em, private LoggerInterface $logger) + public function __construct(private readonly EntityManagerInterface $em, private readonly LoggerInterface $logger) { } diff --git a/src/Bundle/ChillPersonBundle/Service/DocGenerator/AccompanyingPeriodContext.php b/src/Bundle/ChillPersonBundle/Service/DocGenerator/AccompanyingPeriodContext.php index f4c161a98..eff9c2636 100644 --- a/src/Bundle/ChillPersonBundle/Service/DocGenerator/AccompanyingPeriodContext.php +++ b/src/Bundle/ChillPersonBundle/Service/DocGenerator/AccompanyingPeriodContext.php @@ -46,7 +46,7 @@ class AccompanyingPeriodContext implements DocGeneratorContextWithAdminFormInterface, DocGeneratorContextWithPublicFormInterface { - public function __construct(private DocumentCategoryRepository $documentCategoryRepository, private NormalizerInterface $normalizer, private TranslatableStringHelperInterface $translatableStringHelper, private EntityManagerInterface $em, private PersonRenderInterface $personRender, private PersonRepository $personRepository, private TranslatorInterface $translator, private BaseContextData $baseContextData) + public function __construct(private readonly DocumentCategoryRepository $documentCategoryRepository, private readonly NormalizerInterface $normalizer, private readonly TranslatableStringHelperInterface $translatableStringHelper, private readonly EntityManagerInterface $em, private readonly PersonRenderInterface $personRender, private readonly PersonRepository $personRepository, private readonly TranslatorInterface $translator, private readonly BaseContextData $baseContextData) { } diff --git a/src/Bundle/ChillPersonBundle/Service/DocGenerator/AccompanyingPeriodWorkContext.php b/src/Bundle/ChillPersonBundle/Service/DocGenerator/AccompanyingPeriodWorkContext.php index 0bc61d19f..e8a81012e 100644 --- a/src/Bundle/ChillPersonBundle/Service/DocGenerator/AccompanyingPeriodWorkContext.php +++ b/src/Bundle/ChillPersonBundle/Service/DocGenerator/AccompanyingPeriodWorkContext.php @@ -29,7 +29,7 @@ use Symfony\Component\Serializer\Normalizer\NormalizerInterface; */ class AccompanyingPeriodWorkContext implements DocGeneratorContextWithPublicFormInterface { - public function __construct(private AccompanyingPeriodContext $periodContext, private NormalizerInterface $normalizer) + public function __construct(private readonly AccompanyingPeriodContext $periodContext, private readonly NormalizerInterface $normalizer) { } diff --git a/src/Bundle/ChillPersonBundle/Service/DocGenerator/AccompanyingPeriodWorkEvaluationContext.php b/src/Bundle/ChillPersonBundle/Service/DocGenerator/AccompanyingPeriodWorkEvaluationContext.php index 209251cd0..5a06acdbf 100644 --- a/src/Bundle/ChillPersonBundle/Service/DocGenerator/AccompanyingPeriodWorkEvaluationContext.php +++ b/src/Bundle/ChillPersonBundle/Service/DocGenerator/AccompanyingPeriodWorkEvaluationContext.php @@ -33,7 +33,7 @@ class AccompanyingPeriodWorkEvaluationContext implements DocGeneratorContextWithAdminFormInterface, DocGeneratorContextWithPublicFormInterface { - public function __construct(private AccompanyingPeriodWorkContext $accompanyingPeriodWorkContext, private EntityManagerInterface $em, private EvaluationRepository $evaluationRepository, private NormalizerInterface $normalizer, private TranslatableStringHelperInterface $translatableStringHelper) + public function __construct(private readonly AccompanyingPeriodWorkContext $accompanyingPeriodWorkContext, private readonly EntityManagerInterface $em, private readonly EvaluationRepository $evaluationRepository, private readonly NormalizerInterface $normalizer, private readonly TranslatableStringHelperInterface $translatableStringHelper) { } diff --git a/src/Bundle/ChillPersonBundle/Service/DocGenerator/PersonContext.php b/src/Bundle/ChillPersonBundle/Service/DocGenerator/PersonContext.php index ecbbe28db..b894f7e55 100644 --- a/src/Bundle/ChillPersonBundle/Service/DocGenerator/PersonContext.php +++ b/src/Bundle/ChillPersonBundle/Service/DocGenerator/PersonContext.php @@ -45,20 +45,20 @@ use function count; final class PersonContext implements PersonContextInterface { - private bool $showScopes; + private readonly bool $showScopes; public function __construct( - private AuthorizationHelperInterface $authorizationHelper, - private BaseContextData $baseContextData, - private CenterResolverManagerInterface $centerResolverManager, - private DocumentCategoryRepository $documentCategoryRepository, - private EntityManagerInterface $em, - private NormalizerInterface $normalizer, + private readonly AuthorizationHelperInterface $authorizationHelper, + private readonly BaseContextData $baseContextData, + private readonly CenterResolverManagerInterface $centerResolverManager, + private readonly DocumentCategoryRepository $documentCategoryRepository, + private readonly EntityManagerInterface $em, + private readonly NormalizerInterface $normalizer, ParameterBagInterface $parameterBag, - private ScopeRepositoryInterface $scopeRepository, - private Security $security, - private TranslatorInterface $translator, - private TranslatableStringHelperInterface $translatableStringHelper + private readonly ScopeRepositoryInterface $scopeRepository, + private readonly Security $security, + private readonly TranslatorInterface $translator, + private readonly TranslatableStringHelperInterface $translatableStringHelper ) { $this->showScopes = $parameterBag->get('chill_main')['acl']['form_show_scopes']; } diff --git a/src/Bundle/ChillPersonBundle/Service/DocGenerator/PersonContextWithThirdParty.php b/src/Bundle/ChillPersonBundle/Service/DocGenerator/PersonContextWithThirdParty.php index c8e15be12..662984011 100644 --- a/src/Bundle/ChillPersonBundle/Service/DocGenerator/PersonContextWithThirdParty.php +++ b/src/Bundle/ChillPersonBundle/Service/DocGenerator/PersonContextWithThirdParty.php @@ -27,7 +27,7 @@ use Symfony\Component\Serializer\Normalizer\NormalizerInterface; */ class PersonContextWithThirdParty implements DocGeneratorContextWithAdminFormInterface, DocGeneratorContextWithPublicFormInterface { - public function __construct(private PersonContextInterface $personContext, private NormalizerInterface $normalizer, private ThirdPartyRepository $thirdPartyRepository) + public function __construct(private readonly PersonContextInterface $personContext, private readonly NormalizerInterface $normalizer, private readonly ThirdPartyRepository $thirdPartyRepository) { } diff --git a/src/Bundle/ChillPersonBundle/Service/Import/SocialWorkMetadata.php b/src/Bundle/ChillPersonBundle/Service/Import/SocialWorkMetadata.php index 017c90b73..80197f769 100644 --- a/src/Bundle/ChillPersonBundle/Service/Import/SocialWorkMetadata.php +++ b/src/Bundle/ChillPersonBundle/Service/Import/SocialWorkMetadata.php @@ -28,7 +28,7 @@ use Exception; use function count; -final class SocialWorkMetadata implements SocialWorkMetadataInterface +final readonly class SocialWorkMetadata implements SocialWorkMetadataInterface { public function __construct(private SocialIssueRepository $socialIssueRepository, private SocialActionRepository $socialActionRepository, private GoalRepository $goalRepository, private ResultRepository $resultRepository, private EvaluationRepository $evaluationRepository, private EntityManagerInterface $entityManager) { diff --git a/src/Bundle/ChillPersonBundle/Templating/Entity/ClosingMotiveRender.php b/src/Bundle/ChillPersonBundle/Templating/Entity/ClosingMotiveRender.php index 8ebc89c04..67171aaba 100644 --- a/src/Bundle/ChillPersonBundle/Templating/Entity/ClosingMotiveRender.php +++ b/src/Bundle/ChillPersonBundle/Templating/Entity/ClosingMotiveRender.php @@ -27,7 +27,7 @@ class ClosingMotiveRender implements ChillEntityRenderInterface use BoxUtilsChillEntityRenderTrait; private const SEPARATOR = ' > '; - public function __construct(private TranslatableStringHelper $translatableStringHelper) + public function __construct(private readonly TranslatableStringHelper $translatableStringHelper) { } diff --git a/src/Bundle/ChillPersonBundle/Templating/Entity/PersonRender.php b/src/Bundle/ChillPersonBundle/Templating/Entity/PersonRender.php index 8d50f03ac..c41a94779 100644 --- a/src/Bundle/ChillPersonBundle/Templating/Entity/PersonRender.php +++ b/src/Bundle/ChillPersonBundle/Templating/Entity/PersonRender.php @@ -28,7 +28,7 @@ class PersonRender implements PersonRenderInterface { use BoxUtilsChillEntityRenderTrait; - public function __construct(private ConfigPersonAltNamesHelper $configAltNamesHelper, private EngineInterface $engine, private TranslatorInterface $translator) + public function __construct(private readonly ConfigPersonAltNamesHelper $configAltNamesHelper, private readonly EngineInterface $engine, private readonly TranslatorInterface $translator) { } diff --git a/src/Bundle/ChillPersonBundle/Templating/Entity/ResourceKindRender.php b/src/Bundle/ChillPersonBundle/Templating/Entity/ResourceKindRender.php index 925c174cc..802ff6d8e 100644 --- a/src/Bundle/ChillPersonBundle/Templating/Entity/ResourceKindRender.php +++ b/src/Bundle/ChillPersonBundle/Templating/Entity/ResourceKindRender.php @@ -18,7 +18,7 @@ use Chill\PersonBundle\Entity\Person\PersonResourceKind; /** * @implements ChillEntityRenderInterface */ -final class ResourceKindRender implements ChillEntityRenderInterface +final readonly class ResourceKindRender implements ChillEntityRenderInterface { public function __construct(private TranslatableStringHelper $translatableStringHelper) { diff --git a/src/Bundle/ChillPersonBundle/Templating/Entity/SocialActionRender.php b/src/Bundle/ChillPersonBundle/Templating/Entity/SocialActionRender.php index 2d8b1ea92..e4253f52e 100644 --- a/src/Bundle/ChillPersonBundle/Templating/Entity/SocialActionRender.php +++ b/src/Bundle/ChillPersonBundle/Templating/Entity/SocialActionRender.php @@ -25,9 +25,9 @@ use function implode; */ class SocialActionRender implements ChillEntityRenderInterface { - public const AND_CHILDREN_MENTION = 'show_and_children_mention'; + final public const AND_CHILDREN_MENTION = 'show_and_children_mention'; - public const DEFAULT_ARGS = [ + final public const DEFAULT_ARGS = [ self::SEPARATOR_KEY => ' > ', self::NO_BADGE => false, self::SHOW_AND_CHILDREN => false, @@ -37,17 +37,17 @@ class SocialActionRender implements ChillEntityRenderInterface /** * if true, the action will not be encapsulated into a "badge". */ - public const NO_BADGE = 'no-badge'; + final public const NO_BADGE = 'no-badge'; - public const SEPARATOR_KEY = 'default.separator'; + final public const SEPARATOR_KEY = 'default.separator'; /** * Show a mention "and children" on each SocialAction, if the social action * has at least one child. */ - public const SHOW_AND_CHILDREN = 'show_and_children'; + final public const SHOW_AND_CHILDREN = 'show_and_children'; - public function __construct(private TranslatableStringHelper $translatableStringHelper, private EngineInterface $engine, private TranslatorInterface $translator) + public function __construct(private readonly TranslatableStringHelper $translatableStringHelper, private readonly EngineInterface $engine, private readonly TranslatorInterface $translator) { } diff --git a/src/Bundle/ChillPersonBundle/Templating/Entity/SocialIssueRender.php b/src/Bundle/ChillPersonBundle/Templating/Entity/SocialIssueRender.php index 381f80ef9..f815afc43 100644 --- a/src/Bundle/ChillPersonBundle/Templating/Entity/SocialIssueRender.php +++ b/src/Bundle/ChillPersonBundle/Templating/Entity/SocialIssueRender.php @@ -22,7 +22,7 @@ use function implode; /** * @implements ChillEntityRenderInterface */ -final class SocialIssueRender implements ChillEntityRenderInterface +final readonly class SocialIssueRender implements ChillEntityRenderInterface { public const AND_CHILDREN_MENTION = 'show_and_children_mention'; diff --git a/src/Bundle/ChillPersonBundle/Tests/AccompanyingPeriod/AccompanyingPeriodConfidentialTest.php b/src/Bundle/ChillPersonBundle/Tests/AccompanyingPeriod/AccompanyingPeriodConfidentialTest.php index dc5c5c2ce..93f773113 100644 --- a/src/Bundle/ChillPersonBundle/Tests/AccompanyingPeriod/AccompanyingPeriodConfidentialTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/AccompanyingPeriod/AccompanyingPeriodConfidentialTest.php @@ -86,7 +86,7 @@ final class AccompanyingPeriodConfidentialTest extends WebTestCase } } - public function testConfidentialValid() + public function testConfidentialValid(): never { $this->markTestIncomplete( 'Marked as incomplete because of a problem in the dataprovider, at line 81.' diff --git a/src/Bundle/ChillPersonBundle/Tests/Controller/AccompanyingCourseApiControllerTest.php b/src/Bundle/ChillPersonBundle/Tests/Controller/AccompanyingCourseApiControllerTest.php index 560928bff..60d29d8b0 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Controller/AccompanyingCourseApiControllerTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Controller/AccompanyingCourseApiControllerTest.php @@ -316,7 +316,7 @@ final class AccompanyingCourseApiControllerTest extends WebTestCase json_encode(['type' => 'person', 'id' => $personId], JSON_THROW_ON_ERROR) ); $response = $this->client->getResponse(); - $data = json_decode($response->getContent(), true, 512, JSON_THROW_ON_ERROR); + $data = json_decode((string) $response->getContent(), true, 512, JSON_THROW_ON_ERROR); $this->assertTrue(in_array($response->getStatusCode(), [200, 422], true)); @@ -338,7 +338,7 @@ final class AccompanyingCourseApiControllerTest extends WebTestCase } $response = $this->client->getResponse(); - $data = json_decode($response->getContent(), null, 512, JSON_THROW_ON_ERROR); + $data = json_decode((string) $response->getContent(), null, 512, JSON_THROW_ON_ERROR); // check that the person id is contained $participationsPersonsIds = array_map( @@ -358,7 +358,7 @@ final class AccompanyingCourseApiControllerTest extends WebTestCase json_encode(['type' => 'person', 'id' => $personId], JSON_THROW_ON_ERROR) ); $response = $this->client->getResponse(); - $data = json_decode($response->getContent(), true, 512, JSON_THROW_ON_ERROR); + $data = json_decode((string) $response->getContent(), true, 512, JSON_THROW_ON_ERROR); $this->assertTrue(in_array($response->getStatusCode(), [200, 422], true)); @@ -394,7 +394,7 @@ final class AccompanyingCourseApiControllerTest extends WebTestCase $this->markTestSkipped('the next tests should appears only on valid accompanying period'); } - $data = json_decode($this->client->getResponse()->getContent(), true, 512, JSON_THROW_ON_ERROR); + $data = json_decode((string) $this->client->getResponse()->getContent(), true, 512, JSON_THROW_ON_ERROR); $this->assertArrayHasKey('id', $data); $this->assertArrayHasKey('type', $data); $this->assertEquals('social_issue', $data['type']); @@ -425,7 +425,7 @@ final class AccompanyingCourseApiControllerTest extends WebTestCase $this->markTestSkipped('the next tests should appears only on valid accompanying period'); } - $data = json_decode($response->getContent(), null, 512, JSON_THROW_ON_ERROR); + $data = json_decode((string) $response->getContent(), null, 512, JSON_THROW_ON_ERROR); $this->assertEquals( $data->id, $periodId, @@ -487,7 +487,7 @@ final class AccompanyingCourseApiControllerTest extends WebTestCase json_encode(['type' => 'accompanying_period_comment', 'content' => 'this is a text']) ); $response = $this->client->getResponse(); - $data = json_decode($response->getContent(), true, 512, JSON_THROW_ON_ERROR); + $data = json_decode((string) $response->getContent(), true, 512, JSON_THROW_ON_ERROR); $this->assertTrue(in_array($response->getStatusCode(), [200, 422], true)); @@ -506,7 +506,7 @@ final class AccompanyingCourseApiControllerTest extends WebTestCase json_encode(['type' => 'accompanying_period_comment', 'id' => $data['id']], JSON_THROW_ON_ERROR) ); $response = $this->client->getResponse(); - $data = json_decode($response->getContent(), true, 512, JSON_THROW_ON_ERROR); + $data = json_decode((string) $response->getContent(), true, 512, JSON_THROW_ON_ERROR); $this->assertTrue(in_array($response->getStatusCode(), [200, 422], true)); } @@ -563,7 +563,7 @@ final class AccompanyingCourseApiControllerTest extends WebTestCase json_encode(['type' => 'person', 'id' => $personId], JSON_THROW_ON_ERROR) ); $response = $this->client->getResponse(); - $data = json_decode($response->getContent(), true, 512, JSON_THROW_ON_ERROR); + $data = json_decode((string) $response->getContent(), true, 512, JSON_THROW_ON_ERROR); $this->assertTrue(in_array($response->getStatusCode(), [200, 422], true)); @@ -590,7 +590,7 @@ final class AccompanyingCourseApiControllerTest extends WebTestCase json_encode(['type' => 'thirdparty', 'id' => $thirdPartyId], JSON_THROW_ON_ERROR) ); $response = $this->client->getResponse(); - $data = json_decode($response->getContent(), true, 512, JSON_THROW_ON_ERROR); + $data = json_decode((string) $response->getContent(), true, 512, JSON_THROW_ON_ERROR); $this->assertTrue(in_array($response->getStatusCode(), [200, 422], true)); @@ -644,7 +644,7 @@ final class AccompanyingCourseApiControllerTest extends WebTestCase json_encode(['type' => 'accompanying_period_resource', 'resource' => ['type' => 'person', 'id' => $personId]]) ); $response = $this->client->getResponse(); - $data = json_decode($response->getContent(), true, 512, JSON_THROW_ON_ERROR); + $data = json_decode((string) $response->getContent(), true, 512, JSON_THROW_ON_ERROR); $this->assertTrue(in_array($response->getStatusCode(), [200, 422], true)); @@ -688,7 +688,7 @@ final class AccompanyingCourseApiControllerTest extends WebTestCase json_encode(['type' => 'accompanying_period_resource', 'resource' => ['type' => 'thirdparty', 'id' => $thirdPartyId]]) ); $response = $this->client->getResponse(); - $data = json_decode($response->getContent(), true, 512, JSON_THROW_ON_ERROR); + $data = json_decode((string) $response->getContent(), true, 512, JSON_THROW_ON_ERROR); $this->assertTrue(in_array($response->getStatusCode(), [200, 422], true)); diff --git a/src/Bundle/ChillPersonBundle/Tests/Controller/AccompanyingCourseControllerTest.php b/src/Bundle/ChillPersonBundle/Tests/Controller/AccompanyingCourseControllerTest.php index a7d98bd97..a4b11fdb6 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Controller/AccompanyingCourseControllerTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Controller/AccompanyingCourseControllerTest.php @@ -70,7 +70,7 @@ final class AccompanyingCourseControllerTest extends WebTestCase $this->assertResponseRedirects(); $location = $this->client->getResponse()->headers->get('Location'); - $this->assertEquals(1, preg_match('|^\\/[^\\/]+\\/parcours/([\\d]+)/edit$|', $location)); + $this->assertEquals(1, preg_match('|^\\/[^\\/]+\\/parcours/([\\d]+)/edit$|', (string) $location)); } /** @@ -89,7 +89,7 @@ final class AccompanyingCourseControllerTest extends WebTestCase $location = $this->client->getResponse()->headers->get('Location'); $matches = []; - $this->assertEquals(1, preg_match('|^\\/[^\\/]+\\/parcours/([\\d]+)/edit$|', $location, $matches)); + $this->assertEquals(1, preg_match('|^\\/[^\\/]+\\/parcours/([\\d]+)/edit$|', (string) $location, $matches)); $id = $matches[1]; $period = self::$container->get(EntityManagerInterface::class) diff --git a/src/Bundle/ChillPersonBundle/Tests/Controller/AccompanyingPeriodControllerTest.php b/src/Bundle/ChillPersonBundle/Tests/Controller/AccompanyingPeriodControllerTest.php index 0fbdad9d8..79e803a13 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Controller/AccompanyingPeriodControllerTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Controller/AccompanyingPeriodControllerTest.php @@ -270,7 +270,7 @@ final class AccompanyingPeriodControllerTest extends WebTestCase * Then the response should not redirect to any page * and an error element is shown */ - public function testCreatePeriodWithClosingAfterCurrentFails() + public function testCreatePeriodWithClosingAfterCurrentFails(): never { $this->markTestSkipped('Multiple period may now cover. This test is kept ' . 'in case of a configuration may add this feature again'); @@ -438,7 +438,7 @@ final class AccompanyingPeriodControllerTest extends WebTestCase * Then the response should not redirect to any page * and an error element is shown */ - public function testCreatePeriodWithOpeningAndClosingAfterCurrentFails() + public function testCreatePeriodWithOpeningAndClosingAfterCurrentFails(): never { $this->markTestSkipped('Multiple period may now cover. This test is kept ' . 'in case of a configuration may add this feature again'); @@ -470,7 +470,7 @@ final class AccompanyingPeriodControllerTest extends WebTestCase /** * @group reopening */ - public function testReOpeningPeriod() + public function testReOpeningPeriod(): never { // test that re-opening a period which is opened does not work $this->client->request( diff --git a/src/Bundle/ChillPersonBundle/Tests/Controller/PersonControllerViewWithHiddenFieldsTest.php b/src/Bundle/ChillPersonBundle/Tests/Controller/PersonControllerViewWithHiddenFieldsTest.php index f4722d685..d6bbb461f 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Controller/PersonControllerViewWithHiddenFieldsTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Controller/PersonControllerViewWithHiddenFieldsTest.php @@ -69,7 +69,7 @@ final class PersonControllerViewWithHiddenFieldsTest extends WebTestCase * * @group configurable_fields */ - public function testViewPerson() + public function testViewPerson(): never { $this->markTestSkipped('This configuration does not allow multiple environnements'); $client = self::createClient( diff --git a/src/Bundle/ChillPersonBundle/Tests/Form/Type/PickPersonTypeTest.php b/src/Bundle/ChillPersonBundle/Tests/Form/Type/PickPersonTypeTest.php index 83071bcbd..f5e4639c2 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Form/Type/PickPersonTypeTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Form/Type/PickPersonTypeTest.php @@ -51,7 +51,7 @@ final class PickPersonTypeTest extends KernelTestCase /** * test with an invalid center type in the option 'centers' (in an array). */ - public function testWithInvalidOptionCenters() + public function testWithInvalidOptionCenters(): never { $this->expectException(RuntimeException::class); @@ -128,7 +128,7 @@ final class PickPersonTypeTest extends KernelTestCase ); } - public function testWithOptionRoleInvalid() + public function testWithOptionRoleInvalid(): never { $this->markTestSkipped('need to inject locale into url generator without request'); $form = $this->formFactory diff --git a/src/Bundle/ChillPersonBundle/Tests/Search/PersonSearchTest.php b/src/Bundle/ChillPersonBundle/Tests/Search/PersonSearchTest.php index 64143e7db..05ca5918d 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Search/PersonSearchTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Search/PersonSearchTest.php @@ -21,7 +21,7 @@ use Symfony\Bundle\FrameworkBundle\Test\WebTestCase; */ final class PersonSearchTest extends WebTestCase { - public function testDefaultAccented() + public function testDefaultAccented(): never { $this->markTestSkipped('skipped until adapted to new fixtures'); $crawlerSpecial = $this->generateCrawlerForSearch('@person manço'); @@ -135,7 +135,7 @@ final class PersonSearchTest extends WebTestCase $this->assertMatchesRegularExpression('/DEPARDIEU/', $crawler->filter('.list-with-period')->text()); } - public function testSearchCombineBirthdateAndLastName() + public function testSearchCombineBirthdateAndLastName(): never { $this->markTestSkipped('skipped until adapted to new fixtures'); $crawler = $this->generateCrawlerForSearch('@person birthdate:1948-12-27 lastname:(Van Snick)'); @@ -144,7 +144,7 @@ final class PersonSearchTest extends WebTestCase $this->assertDoesNotMatchRegularExpression('/DEPARDIEU/', $crawler->filter('.list-with-period')->text()); } - public function testSearchCombineGenderAndLastName() + public function testSearchCombineGenderAndLastName(): never { $this->markTestSkipped('skipped until adapted to new fixtures'); $crawler = $this->generateCrawlerForSearch('@person gender:woman lastname:(Depardieu)'); @@ -153,7 +153,7 @@ final class PersonSearchTest extends WebTestCase $this->assertDoesNotMatchRegularExpression('/Gérard/', $crawler->filter('.list-with-period')->text()); } - public function testSearchCombineLastnameAndFirstName() + public function testSearchCombineLastnameAndFirstName(): never { $this->markTestSkipped('skipped until adapted to new fixtures'); $crawler = $this->generateCrawlerForSearch('@person lastname:Depardieu firstname:Jean'); @@ -167,7 +167,7 @@ final class PersonSearchTest extends WebTestCase ); } - public function testSearchCombineLastnameAndNationality() + public function testSearchCombineLastnameAndNationality(): never { $this->markTestSkipped('skipped until adapted to new fixtures'); $crawler = $this->generateCrawlerForSearch('@person lastname:Depardieu nationality:RU'); @@ -181,7 +181,7 @@ final class PersonSearchTest extends WebTestCase ); } - public function testSearchMultipleTrigramUseAndClauseInDefault() + public function testSearchMultipleTrigramUseAndClauseInDefault(): never { $this->markTestSkipped('skipped until adapted to new fixtures'); $crawler = $this->generateCrawlerForSearch('@person cha dep'); diff --git a/src/Bundle/ChillPersonBundle/Tests/Serializer/Normalizer/AccompanyingPeriodWorkEvaluationDenormalizerTest.php b/src/Bundle/ChillPersonBundle/Tests/Serializer/Normalizer/AccompanyingPeriodWorkEvaluationDenormalizerTest.php index 8b2cf2ffb..b56cb1fd9 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Serializer/Normalizer/AccompanyingPeriodWorkEvaluationDenormalizerTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Serializer/Normalizer/AccompanyingPeriodWorkEvaluationDenormalizerTest.php @@ -96,7 +96,7 @@ final class AccompanyingPeriodWorkEvaluationDenormalizerTest extends TestCase "id": 382 }'; - public function testAssociatedDocumentIsTheSame() + public function testAssociatedDocumentIsTheSame(): never { $this->markTestIncomplete('not yet finished'); $evaluation = new AccompanyingPeriodWorkEvaluation(); diff --git a/src/Bundle/ChillPersonBundle/Tests/Serializer/Normalizer/HouseholdNormalizerTest.php b/src/Bundle/ChillPersonBundle/Tests/Serializer/Normalizer/HouseholdNormalizerTest.php index acd4119a1..5f29588c2 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Serializer/Normalizer/HouseholdNormalizerTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Serializer/Normalizer/HouseholdNormalizerTest.php @@ -30,7 +30,7 @@ final class HouseholdNormalizerTest extends KernelTestCase private ?NormalizerInterface $normalizer; - private array $toDelete; + private readonly array $toDelete; protected function setUp(): void { diff --git a/src/Bundle/ChillPersonBundle/Tests/Serializer/Normalizer/PersonDocGenNormalizerTest.php b/src/Bundle/ChillPersonBundle/Tests/Serializer/Normalizer/PersonDocGenNormalizerTest.php index 90ceddb04..bf4031970 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Serializer/Normalizer/PersonDocGenNormalizerTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Serializer/Normalizer/PersonDocGenNormalizerTest.php @@ -95,11 +95,7 @@ final class PersonDocGenNormalizerTest extends KernelTestCase ->setFirstName('Renaud') ->setLastName('Mégane'); - $expected = array_merge( - self::BLANK, - ['firstName' => 'Renaud', 'lastName' => 'Mégane', - 'text' => 'Renaud Mégane', ] - ); + $expected = [...self::BLANK, 'firstName' => 'Renaud', 'lastName' => 'Mégane', 'text' => 'Renaud Mégane']; yield [$person, $expected, 'partial normalization for a person']; diff --git a/src/Bundle/ChillPersonBundle/Tests/Timeline/TimelineAccompanyingPeriodTest.php b/src/Bundle/ChillPersonBundle/Tests/Timeline/TimelineAccompanyingPeriodTest.php index be368e28c..7560b8fb1 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Timeline/TimelineAccompanyingPeriodTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Timeline/TimelineAccompanyingPeriodTest.php @@ -59,7 +59,7 @@ final class TimelineAccompanyingPeriodTest extends WebTestCase /** * @dataProvider provideDataPersonWithAccompanyingPeriod */ - public function testEntriesAreShown(mixed $personId) + public function testEntriesAreShown(mixed $personId): never { $this->markTestSkipped('page does not work'); diff --git a/src/Bundle/ChillPersonBundle/Timeline/AbstractTimelineAccompanyingPeriod.php b/src/Bundle/ChillPersonBundle/Timeline/AbstractTimelineAccompanyingPeriod.php index 2e11a4f4f..03ebbb7a2 100644 --- a/src/Bundle/ChillPersonBundle/Timeline/AbstractTimelineAccompanyingPeriod.php +++ b/src/Bundle/ChillPersonBundle/Timeline/AbstractTimelineAccompanyingPeriod.php @@ -35,7 +35,7 @@ abstract class AbstractTimelineAccompanyingPeriod implements TimelineProviderInt { private const SUPPORTED_CONTEXTS = ['person', 'center']; - public function __construct(protected EntityManager $em, private Security $security, private AuthorizationHelper $authorizationHelper) + public function __construct(protected EntityManager $em, private readonly Security $security, private readonly AuthorizationHelper $authorizationHelper) { } diff --git a/src/Bundle/ChillPersonBundle/Validator/Constraints/AccompanyingPeriod/AccompanyingPeriodValidityValidator.php b/src/Bundle/ChillPersonBundle/Validator/Constraints/AccompanyingPeriod/AccompanyingPeriodValidityValidator.php index f7d533d0e..5e20a10f3 100644 --- a/src/Bundle/ChillPersonBundle/Validator/Constraints/AccompanyingPeriod/AccompanyingPeriodValidityValidator.php +++ b/src/Bundle/ChillPersonBundle/Validator/Constraints/AccompanyingPeriod/AccompanyingPeriodValidityValidator.php @@ -25,7 +25,7 @@ use function in_array; class AccompanyingPeriodValidityValidator extends ConstraintValidator { - public function __construct(private ActivityRepository $activityRepository, private SocialIssueRender $socialIssueRender, private TokenStorageInterface $token) + public function __construct(private readonly ActivityRepository $activityRepository, private readonly SocialIssueRender $socialIssueRender, private readonly TokenStorageInterface $token) { } diff --git a/src/Bundle/ChillPersonBundle/Validator/Constraints/AccompanyingPeriod/LocationValidityValidator.php b/src/Bundle/ChillPersonBundle/Validator/Constraints/AccompanyingPeriod/LocationValidityValidator.php index 50ef5059c..c01c02cc6 100644 --- a/src/Bundle/ChillPersonBundle/Validator/Constraints/AccompanyingPeriod/LocationValidityValidator.php +++ b/src/Bundle/ChillPersonBundle/Validator/Constraints/AccompanyingPeriod/LocationValidityValidator.php @@ -20,7 +20,7 @@ use Symfony\Component\Validator\Exception\UnexpectedValueException; class LocationValidityValidator extends ConstraintValidator { - public function __construct(private PersonRenderInterface $render) + public function __construct(private readonly PersonRenderInterface $render) { } diff --git a/src/Bundle/ChillPersonBundle/Validator/Constraints/AccompanyingPeriod/ParticipationOverlapValidator.php b/src/Bundle/ChillPersonBundle/Validator/Constraints/AccompanyingPeriod/ParticipationOverlapValidator.php index 2589a1751..5e3d5ba7c 100644 --- a/src/Bundle/ChillPersonBundle/Validator/Constraints/AccompanyingPeriod/ParticipationOverlapValidator.php +++ b/src/Bundle/ChillPersonBundle/Validator/Constraints/AccompanyingPeriod/ParticipationOverlapValidator.php @@ -26,7 +26,7 @@ class ParticipationOverlapValidator extends ConstraintValidator { private const MAX_PARTICIPATION = 1; - public function __construct(private PersonRenderInterface $personRender, private ThirdPartyRender $thirdpartyRender) + public function __construct(private readonly PersonRenderInterface $personRender, private readonly ThirdPartyRender $thirdpartyRender) { } diff --git a/src/Bundle/ChillPersonBundle/Validator/Constraints/AccompanyingPeriod/ResourceDuplicateCheckValidator.php b/src/Bundle/ChillPersonBundle/Validator/Constraints/AccompanyingPeriod/ResourceDuplicateCheckValidator.php index a9d339286..7333abf2c 100644 --- a/src/Bundle/ChillPersonBundle/Validator/Constraints/AccompanyingPeriod/ResourceDuplicateCheckValidator.php +++ b/src/Bundle/ChillPersonBundle/Validator/Constraints/AccompanyingPeriod/ResourceDuplicateCheckValidator.php @@ -24,7 +24,7 @@ use function in_array; class ResourceDuplicateCheckValidator extends ConstraintValidator { - public function __construct(private PersonRenderInterface $personRender, private ThirdPartyRender $thirdpartyRender) + public function __construct(private readonly PersonRenderInterface $personRender, private readonly ThirdPartyRender $thirdpartyRender) { } diff --git a/src/Bundle/ChillPersonBundle/Validator/Constraints/Household/HouseholdMembershipSequentialValidator.php b/src/Bundle/ChillPersonBundle/Validator/Constraints/Household/HouseholdMembershipSequentialValidator.php index edabface7..ebf87b12c 100644 --- a/src/Bundle/ChillPersonBundle/Validator/Constraints/Household/HouseholdMembershipSequentialValidator.php +++ b/src/Bundle/ChillPersonBundle/Validator/Constraints/Household/HouseholdMembershipSequentialValidator.php @@ -26,7 +26,7 @@ use function count; */ class HouseholdMembershipSequentialValidator extends ConstraintValidator { - public function __construct(private PersonRenderInterface $render) + public function __construct(private readonly PersonRenderInterface $render) { } diff --git a/src/Bundle/ChillPersonBundle/Validator/Constraints/Person/Birthdate.php b/src/Bundle/ChillPersonBundle/Validator/Constraints/Person/Birthdate.php index 15fb22728..c1c805adf 100644 --- a/src/Bundle/ChillPersonBundle/Validator/Constraints/Person/Birthdate.php +++ b/src/Bundle/ChillPersonBundle/Validator/Constraints/Person/Birthdate.php @@ -25,7 +25,7 @@ use Symfony\Component\Validator\Constraint; */ class Birthdate extends Constraint { - public const BIRTHDATE_INVALID_CODE = '3f42fd96-0b2d-11ec-8cf3-0f3b1b1ca1c4'; + final public const BIRTHDATE_INVALID_CODE = '3f42fd96-0b2d-11ec-8cf3-0f3b1b1ca1c4'; public $message = 'The birthdate must be before %date%'; } diff --git a/src/Bundle/ChillPersonBundle/Validator/Constraints/Person/PersonHasCenterValidator.php b/src/Bundle/ChillPersonBundle/Validator/Constraints/Person/PersonHasCenterValidator.php index 48fab3787..0d7ba3b17 100644 --- a/src/Bundle/ChillPersonBundle/Validator/Constraints/Person/PersonHasCenterValidator.php +++ b/src/Bundle/ChillPersonBundle/Validator/Constraints/Person/PersonHasCenterValidator.php @@ -20,9 +20,9 @@ use Symfony\Component\Validator\Exception\UnexpectedTypeException; class PersonHasCenterValidator extends ConstraintValidator { - private bool $centerRequired; + private readonly bool $centerRequired; - public function __construct(ParameterBagInterface $parameterBag, private CenterResolverManagerInterface $centerResolverManager) + public function __construct(ParameterBagInterface $parameterBag, private readonly CenterResolverManagerInterface $centerResolverManager) { $this->centerRequired = $parameterBag->get('chill_person')['validation']['center_required']; } diff --git a/src/Bundle/ChillPersonBundle/Validator/Constraints/Relationship/RelationshipNoDuplicateValidator.php b/src/Bundle/ChillPersonBundle/Validator/Constraints/Relationship/RelationshipNoDuplicateValidator.php index bec92b9c0..0a64aa891 100644 --- a/src/Bundle/ChillPersonBundle/Validator/Constraints/Relationship/RelationshipNoDuplicateValidator.php +++ b/src/Bundle/ChillPersonBundle/Validator/Constraints/Relationship/RelationshipNoDuplicateValidator.php @@ -20,7 +20,7 @@ use Symfony\Component\Validator\Exception\UnexpectedValueException; class RelationshipNoDuplicateValidator extends ConstraintValidator { - public function __construct(private RelationshipRepository $relationshipRepository) + public function __construct(private readonly RelationshipRepository $relationshipRepository) { } diff --git a/src/Bundle/ChillPersonBundle/Workflow/AccompanyingPeriodWorkEvaluationDocumentWorkflowHandler.php b/src/Bundle/ChillPersonBundle/Workflow/AccompanyingPeriodWorkEvaluationDocumentWorkflowHandler.php index c224cb166..1b85c3cb5 100644 --- a/src/Bundle/ChillPersonBundle/Workflow/AccompanyingPeriodWorkEvaluationDocumentWorkflowHandler.php +++ b/src/Bundle/ChillPersonBundle/Workflow/AccompanyingPeriodWorkEvaluationDocumentWorkflowHandler.php @@ -21,7 +21,7 @@ use Symfony\Contracts\Translation\TranslatorInterface; class AccompanyingPeriodWorkEvaluationDocumentWorkflowHandler implements EntityWorkflowHandlerInterface { - public function __construct(private AccompanyingPeriodWorkEvaluationDocumentRepository $repository, private TranslatableStringHelperInterface $translatableStringHelper, private TranslatorInterface $translator) + public function __construct(private readonly AccompanyingPeriodWorkEvaluationDocumentRepository $repository, private readonly TranslatableStringHelperInterface $translatableStringHelper, private readonly TranslatorInterface $translator) { } diff --git a/src/Bundle/ChillPersonBundle/Workflow/AccompanyingPeriodWorkEvaluationWorkflowHandler.php b/src/Bundle/ChillPersonBundle/Workflow/AccompanyingPeriodWorkEvaluationWorkflowHandler.php index b5869c35f..70b23f9f7 100644 --- a/src/Bundle/ChillPersonBundle/Workflow/AccompanyingPeriodWorkEvaluationWorkflowHandler.php +++ b/src/Bundle/ChillPersonBundle/Workflow/AccompanyingPeriodWorkEvaluationWorkflowHandler.php @@ -22,7 +22,7 @@ use Symfony\Contracts\Translation\TranslatorInterface; class AccompanyingPeriodWorkEvaluationWorkflowHandler implements EntityWorkflowHandlerInterface { - public function __construct(private AccompanyingPeriodWorkEvaluationRepository $repository, private TranslatableStringHelperInterface $translatableStringHelper, private TranslatorInterface $translator) + public function __construct(private readonly AccompanyingPeriodWorkEvaluationRepository $repository, private readonly TranslatableStringHelperInterface $translatableStringHelper, private readonly TranslatorInterface $translator) { } diff --git a/src/Bundle/ChillPersonBundle/Workflow/AccompanyingPeriodWorkWorkflowHandler.php b/src/Bundle/ChillPersonBundle/Workflow/AccompanyingPeriodWorkWorkflowHandler.php index 203fd60d2..0f9b05ac9 100644 --- a/src/Bundle/ChillPersonBundle/Workflow/AccompanyingPeriodWorkWorkflowHandler.php +++ b/src/Bundle/ChillPersonBundle/Workflow/AccompanyingPeriodWorkWorkflowHandler.php @@ -23,7 +23,7 @@ use Symfony\Contracts\Translation\TranslatorInterface; class AccompanyingPeriodWorkWorkflowHandler implements EntityWorkflowHandlerInterface { - public function __construct(private AccompanyingPeriodWorkRepository $repository, private TranslatableStringHelperInterface $translatableStringHelper, private TranslatorInterface $translator) + public function __construct(private readonly AccompanyingPeriodWorkRepository $repository, private readonly TranslatableStringHelperInterface $translatableStringHelper, private readonly TranslatorInterface $translator) { } diff --git a/src/Bundle/ChillReportBundle/Export/Export/ReportList.php b/src/Bundle/ChillReportBundle/Export/Export/ReportList.php index dbaa1abea..c893d084a 100644 --- a/src/Bundle/ChillReportBundle/Export/Export/ReportList.php +++ b/src/Bundle/ChillReportBundle/Export/Export/ReportList.php @@ -325,7 +325,7 @@ class ReportList implements ExportElementValidatedInterface, ListInterface switch ($f) { case 'person_countryOfBirth': case 'person_nationality': - $suffix = substr($f, 7); + $suffix = substr((string) $f, 7); $qb->addSelect(sprintf('IDENTITY(person.%s) as %s', $suffix, $f)); break; @@ -338,7 +338,7 @@ class ReportList implements ExportElementValidatedInterface, ListInterface case 'person_address_country_name': case 'person_address_country_code': // remove 'person_' - $suffix = substr($f, 7); + $suffix = substr((string) $f, 7); $qb->addSelect(sprintf( 'GET_PERSON_ADDRESS_%s(person.id, :address_date) AS %s', @@ -361,8 +361,8 @@ class ReportList implements ExportElementValidatedInterface, ListInterface break; default: - $prefix = substr($f, 0, 7); - $suffix = substr($f, 7); + $prefix = substr((string) $f, 0, 7); + $suffix = substr((string) $f, 7); match ($prefix) { 'person_' => $qb->addSelect(sprintf('person.%s as %s', $suffix, $f)), diff --git a/src/Bundle/ChillReportBundle/Export/Filter/ReportDateFilter.php b/src/Bundle/ChillReportBundle/Export/Filter/ReportDateFilter.php index 6117d2f48..d11c5cc70 100644 --- a/src/Bundle/ChillReportBundle/Export/Filter/ReportDateFilter.php +++ b/src/Bundle/ChillReportBundle/Export/Filter/ReportDateFilter.php @@ -19,7 +19,7 @@ use Doctrine\ORM\Query\Expr; class ReportDateFilter implements FilterInterface { - public function __construct(private RollingDateConverterInterface $rollingDateConverter) + public function __construct(private readonly RollingDateConverterInterface $rollingDateConverter) { } diff --git a/src/Bundle/ChillReportBundle/Search/ReportSearch.php b/src/Bundle/ChillReportBundle/Search/ReportSearch.php index 8fbc24e16..3c5e7f4ad 100644 --- a/src/Bundle/ChillReportBundle/Search/ReportSearch.php +++ b/src/Bundle/ChillReportBundle/Search/ReportSearch.php @@ -37,8 +37,8 @@ class ReportSearch extends AbstractSearch implements ContainerAwareInterface private $user; public function __construct( - private EntityManagerInterface $em, - private AuthorizationHelper $helper, + private readonly EntityManagerInterface $em, + private readonly AuthorizationHelper $helper, TokenStorageInterface $tokenStorage ) { if (!$tokenStorage->getToken()->getUser() instanceof \Chill\MainBundle\Entity\User) { diff --git a/src/Bundle/ChillReportBundle/Security/Authorization/ReportVoter.php b/src/Bundle/ChillReportBundle/Security/Authorization/ReportVoter.php index ae4d1be55..2caf57305 100644 --- a/src/Bundle/ChillReportBundle/Security/Authorization/ReportVoter.php +++ b/src/Bundle/ChillReportBundle/Security/Authorization/ReportVoter.php @@ -23,13 +23,13 @@ use function in_array; class ReportVoter extends AbstractChillVoter implements ProvideRoleHierarchyInterface { - public const CREATE = 'CHILL_REPORT_CREATE'; + final public const CREATE = 'CHILL_REPORT_CREATE'; - public const LISTS = 'CHILL_REPORT_LISTS'; + final public const LISTS = 'CHILL_REPORT_LISTS'; - public const SEE = 'CHILL_REPORT_SEE'; + final public const SEE = 'CHILL_REPORT_SEE'; - public const UPDATE = 'CHILL_REPORT_UPDATE'; + final public const UPDATE = 'CHILL_REPORT_UPDATE'; /** * @var AuthorizationHelper diff --git a/src/Bundle/ChillReportBundle/Tests/Controller/ReportControllerTest.php b/src/Bundle/ChillReportBundle/Tests/Controller/ReportControllerTest.php index 69ccd3d54..10f4f14c0 100644 --- a/src/Bundle/ChillReportBundle/Tests/Controller/ReportControllerTest.php +++ b/src/Bundle/ChillReportBundle/Tests/Controller/ReportControllerTest.php @@ -160,7 +160,7 @@ final class ReportControllerTest extends WebTestCase * * @depends testNewReportPage */ - public function testInvalidDate(Form $form) + public function testInvalidDate(Form $form): never { $client = $this->getAuthenticatedClient(); $this->markTestSkipped('This test raise an error since symfony 2.7. ' @@ -379,7 +379,7 @@ final class ReportControllerTest extends WebTestCase $matches = []; preg_match( '|/report/([0-9]*)/view$|', - $client->getHistory()->current()->getUri(), + (string) $client->getHistory()->current()->getUri(), $matches ); diff --git a/src/Bundle/ChillReportBundle/Timeline/TimelineReportProvider.php b/src/Bundle/ChillReportBundle/Timeline/TimelineReportProvider.php index d2e856131..a5f62debc 100644 --- a/src/Bundle/ChillReportBundle/Timeline/TimelineReportProvider.php +++ b/src/Bundle/ChillReportBundle/Timeline/TimelineReportProvider.php @@ -35,7 +35,7 @@ use function strtr; */ class TimelineReportProvider implements TimelineProviderInterface { - public function __construct(protected EntityManager $em, protected AuthorizationHelper $helper, private Security $security, protected CustomFieldsHelper $customFieldsHelper, protected $showEmptyValues) + public function __construct(protected EntityManager $em, protected AuthorizationHelper $helper, private readonly Security $security, protected CustomFieldsHelper $customFieldsHelper, protected $showEmptyValues) { } diff --git a/src/Bundle/ChillTaskBundle/Controller/SingleTaskController.php b/src/Bundle/ChillTaskBundle/Controller/SingleTaskController.php index a1085657a..d8afbc65d 100644 --- a/src/Bundle/ChillTaskBundle/Controller/SingleTaskController.php +++ b/src/Bundle/ChillTaskBundle/Controller/SingleTaskController.php @@ -47,7 +47,7 @@ use function array_merge; final class SingleTaskController extends AbstractController { - public function __construct(private CenterResolverDispatcherInterface $centerResolverDispatcher, private PaginatorFactory $paginatorFactory, private SingleTaskAclAwareRepositoryInterface $singleTaskAclAwareRepository, private TranslatorInterface $translator, private EventDispatcherInterface $eventDispatcher, private TimelineBuilder $timelineBuilder, private LoggerInterface $logger, private FilterOrderHelperFactoryInterface $filterOrderHelperFactory) + public function __construct(private readonly CenterResolverDispatcherInterface $centerResolverDispatcher, private readonly PaginatorFactory $paginatorFactory, private readonly SingleTaskAclAwareRepositoryInterface $singleTaskAclAwareRepository, private readonly TranslatorInterface $translator, private readonly EventDispatcherInterface $eventDispatcher, private readonly TimelineBuilder $timelineBuilder, private readonly LoggerInterface $logger, private readonly FilterOrderHelperFactoryInterface $filterOrderHelperFactory) { } diff --git a/src/Bundle/ChillTaskBundle/Event/TaskEvent.php b/src/Bundle/ChillTaskBundle/Event/TaskEvent.php index 57e8329c9..01cae799c 100644 --- a/src/Bundle/ChillTaskBundle/Event/TaskEvent.php +++ b/src/Bundle/ChillTaskBundle/Event/TaskEvent.php @@ -16,7 +16,7 @@ use Symfony\Component\EventDispatcher\Event; class TaskEvent extends Event { - public const PERSIST = 'chill_task.task_persist'; + final public const PERSIST = 'chill_task.task_persist'; /** * @var AbstractTask diff --git a/src/Bundle/ChillTaskBundle/Event/UI/UIEvent.php b/src/Bundle/ChillTaskBundle/Event/UI/UIEvent.php index ac88a1d3a..e0414948b 100644 --- a/src/Bundle/ChillTaskBundle/Event/UI/UIEvent.php +++ b/src/Bundle/ChillTaskBundle/Event/UI/UIEvent.php @@ -19,11 +19,11 @@ use Symfony\Component\Workflow\Transition; class UIEvent extends Event { - public const EDIT_FORM = 'chill_task.edit_form'; + final public const EDIT_FORM = 'chill_task.edit_form'; - public const EDIT_PAGE = 'chill_task.edit_page'; + final public const EDIT_PAGE = 'chill_task.edit_page'; - public const SHOW_TRANSITION_PAGE = 'chill_task.show_transition_page'; + final public const SHOW_TRANSITION_PAGE = 'chill_task.show_transition_page'; /** * @var FormInterface|null diff --git a/src/Bundle/ChillTaskBundle/Form/SingleTaskType.php b/src/Bundle/ChillTaskBundle/Form/SingleTaskType.php index 4378696d0..65417f21e 100644 --- a/src/Bundle/ChillTaskBundle/Form/SingleTaskType.php +++ b/src/Bundle/ChillTaskBundle/Form/SingleTaskType.php @@ -28,7 +28,7 @@ use Symfony\Component\Security\Core\Role\Role; class SingleTaskType extends AbstractType { - public function __construct(private ParameterBagInterface $parameterBag, private CenterResolverDispatcherInterface $centerResolverDispatcher, private ScopeResolverDispatcher $scopeResolverDispatcher) + public function __construct(private readonly ParameterBagInterface $parameterBag, private readonly CenterResolverDispatcherInterface $centerResolverDispatcher, private readonly ScopeResolverDispatcher $scopeResolverDispatcher) { } diff --git a/src/Bundle/ChillTaskBundle/Repository/SingleTaskAclAwareRepository.php b/src/Bundle/ChillTaskBundle/Repository/SingleTaskAclAwareRepository.php index 8c95aa9ee..5ae44c499 100644 --- a/src/Bundle/ChillTaskBundle/Repository/SingleTaskAclAwareRepository.php +++ b/src/Bundle/ChillTaskBundle/Repository/SingleTaskAclAwareRepository.php @@ -27,7 +27,7 @@ use Symfony\Component\Security\Core\Security; use function count; use function substr; -final class SingleTaskAclAwareRepository implements SingleTaskAclAwareRepositoryInterface +final readonly class SingleTaskAclAwareRepository implements SingleTaskAclAwareRepositoryInterface { public function __construct(private CenterResolverManagerInterface $centerResolverDispatcher, private EntityManagerInterface $em, private Security $security, private AuthorizationHelperInterface $authorizationHelper) { @@ -103,8 +103,8 @@ final class SingleTaskAclAwareRepository implements SingleTaskAclAwareRepository break; - case str_starts_with($flag, 'state_'): - $state = substr($flag, 6); + case str_starts_with((string) $flag, 'state_'): + $state = substr((string) $flag, 6); $orXState ->add( "JSONB_EXISTS_IN_ARRAY(t.currentStates, :state_{$key}) = 'TRUE'" diff --git a/src/Bundle/ChillTaskBundle/Repository/SingleTaskRepository.php b/src/Bundle/ChillTaskBundle/Repository/SingleTaskRepository.php index e3eb634cd..0a95e3b25 100644 --- a/src/Bundle/ChillTaskBundle/Repository/SingleTaskRepository.php +++ b/src/Bundle/ChillTaskBundle/Repository/SingleTaskRepository.php @@ -31,15 +31,15 @@ use function count; */ class SingleTaskRepository extends EntityRepository { - public const DATE_STATUS_CURRENT = 'current'; + final public const DATE_STATUS_CURRENT = 'current'; - public const DATE_STATUS_ENDED = 'ended'; + final public const DATE_STATUS_ENDED = 'ended'; - public const DATE_STATUS_NOT_STARTED = 'not_started'; + final public const DATE_STATUS_NOT_STARTED = 'not_started'; - public const DATE_STATUS_WARNING = 'warning'; + final public const DATE_STATUS_WARNING = 'warning'; - public const DATE_STATUSES = [ + final public const DATE_STATUSES = [ self::DATE_STATUS_ENDED, self::DATE_STATUS_WARNING, self::DATE_STATUS_CURRENT, diff --git a/src/Bundle/ChillTaskBundle/Security/Authorization/AuthorizationEvent.php b/src/Bundle/ChillTaskBundle/Security/Authorization/AuthorizationEvent.php index d7ccc0db9..60c7f3d5a 100644 --- a/src/Bundle/ChillTaskBundle/Security/Authorization/AuthorizationEvent.php +++ b/src/Bundle/ChillTaskBundle/Security/Authorization/AuthorizationEvent.php @@ -19,7 +19,7 @@ use Symfony\Component\Security\Core\Authentication\Token\TokenInterface; class AuthorizationEvent extends Event { - public const VOTE = 'chill_task.vote'; + final public const VOTE = 'chill_task.vote'; /** * @var bool @@ -27,9 +27,9 @@ class AuthorizationEvent extends Event protected $vote; public function __construct( - private Person|AbstractTask|AccompanyingPeriod|null $subject, - private string $attribute, - private TokenInterface $token + private readonly Person|AbstractTask|AccompanyingPeriod|null $subject, + private readonly string $attribute, + private readonly TokenInterface $token ) { } diff --git a/src/Bundle/ChillTaskBundle/Security/Authorization/TaskVoter.php b/src/Bundle/ChillTaskBundle/Security/Authorization/TaskVoter.php index 6031f64d1..9575bfcfa 100644 --- a/src/Bundle/ChillTaskBundle/Security/Authorization/TaskVoter.php +++ b/src/Bundle/ChillTaskBundle/Security/Authorization/TaskVoter.php @@ -48,12 +48,12 @@ final class TaskVoter extends AbstractChillVoter implements ProvideRoleHierarchy public const UPDATE = 'CHILL_TASK_TASK_UPDATE'; - private VoterHelperInterface $voter; + private readonly VoterHelperInterface $voter; public function __construct( - private AccessDecisionManagerInterface $accessDecisionManager, - private EventDispatcherInterface $eventDispatcher, - private LoggerInterface $logger, + private readonly AccessDecisionManagerInterface $accessDecisionManager, + private readonly EventDispatcherInterface $eventDispatcher, + private readonly LoggerInterface $logger, VoterHelperFactoryInterface $voterFactory ) { $this->voter = $voterFactory diff --git a/src/Bundle/ChillTaskBundle/Templating/TaskTwigExtension.php b/src/Bundle/ChillTaskBundle/Templating/TaskTwigExtension.php index 8b1646435..affaab8c7 100644 --- a/src/Bundle/ChillTaskBundle/Templating/TaskTwigExtension.php +++ b/src/Bundle/ChillTaskBundle/Templating/TaskTwigExtension.php @@ -31,7 +31,7 @@ class TaskTwigExtension extends AbstractExtension public function getFunctions() { return [ - new TwigFunction('task_workflow_metadata', [$this, 'getWorkflowMetadata']), + new TwigFunction('task_workflow_metadata', $this->getWorkflowMetadata(...)), ]; } diff --git a/src/Bundle/ChillTaskBundle/Templating/UI/CountNotificationTask.php b/src/Bundle/ChillTaskBundle/Templating/UI/CountNotificationTask.php index 08a4177e1..783f41529 100644 --- a/src/Bundle/ChillTaskBundle/Templating/UI/CountNotificationTask.php +++ b/src/Bundle/ChillTaskBundle/Templating/UI/CountNotificationTask.php @@ -22,7 +22,7 @@ use function array_merge; class CountNotificationTask implements NotificationCounterInterface { - public const CACHE_KEY = 'chill_task.count_notifications.user.%d.%s'; + final public const CACHE_KEY = 'chill_task.count_notifications.user.%d.%s'; /** * @var CacheItempPoolInterface @@ -104,7 +104,7 @@ class CountNotificationTask implements NotificationCounterInterface ]; $sum = $this->singleTaskRepository->countByParameters( - array_merge($params, ['date_status' => $status]) + [...$params, 'date_status' => $status] ); $sumCache->set($sum); diff --git a/src/Bundle/ChillTaskBundle/Tests/Repository/SingleTaskACLAwareRepositoryTest.php b/src/Bundle/ChillTaskBundle/Tests/Repository/SingleTaskACLAwareRepositoryTest.php index 0bab53764..4d5520ca5 100644 --- a/src/Bundle/ChillTaskBundle/Tests/Repository/SingleTaskACLAwareRepositoryTest.php +++ b/src/Bundle/ChillTaskBundle/Tests/Repository/SingleTaskACLAwareRepositoryTest.php @@ -40,7 +40,7 @@ final class SingleTaskACLAwareRepositoryTest extends KernelTestCase use ProphecyTrait; - private AuthorizationHelperInterface $authorizationHelper; + private readonly AuthorizationHelperInterface $authorizationHelper; private CenterRepositoryInterface $centerRepository; diff --git a/src/Bundle/ChillTaskBundle/Timeline/SingleTaskTaskLifeCycleEventTimelineProvider.php b/src/Bundle/ChillTaskBundle/Timeline/SingleTaskTaskLifeCycleEventTimelineProvider.php index 9a8fcf6bd..8b2e5c707 100644 --- a/src/Bundle/ChillTaskBundle/Timeline/SingleTaskTaskLifeCycleEventTimelineProvider.php +++ b/src/Bundle/ChillTaskBundle/Timeline/SingleTaskTaskLifeCycleEventTimelineProvider.php @@ -28,7 +28,7 @@ use function array_map; */ class SingleTaskTaskLifeCycleEventTimelineProvider implements TimelineProviderInterface { - public const TYPE = 'chill_task.transition'; + final public const TYPE = 'chill_task.transition'; /** * @var EntityManagerInterface diff --git a/src/Bundle/ChillTaskBundle/Timeline/TaskLifeCycleEventTimelineProvider.php b/src/Bundle/ChillTaskBundle/Timeline/TaskLifeCycleEventTimelineProvider.php index 4efe57c7c..1fa818f41 100644 --- a/src/Bundle/ChillTaskBundle/Timeline/TaskLifeCycleEventTimelineProvider.php +++ b/src/Bundle/ChillTaskBundle/Timeline/TaskLifeCycleEventTimelineProvider.php @@ -38,7 +38,7 @@ use function strtr; */ class TaskLifeCycleEventTimelineProvider implements TimelineProviderInterface { - public const TYPE = 'chill_task.transition'; + final public const TYPE = 'chill_task.transition'; public function __construct(protected EntityManagerInterface $em, protected Registry $registry, protected AuthorizationHelper $authorizationHelper, protected Security $security) { diff --git a/src/Bundle/ChillTaskBundle/Workflow/Definition/DefaultTaskDefinition.php b/src/Bundle/ChillTaskBundle/Workflow/Definition/DefaultTaskDefinition.php index a68e8c9b9..02d3facda 100644 --- a/src/Bundle/ChillTaskBundle/Workflow/Definition/DefaultTaskDefinition.php +++ b/src/Bundle/ChillTaskBundle/Workflow/Definition/DefaultTaskDefinition.php @@ -23,11 +23,11 @@ use function implode; class DefaultTaskDefinition implements \Chill\TaskBundle\Workflow\TaskWorkflowDefinition { - public const DEFINITION_METADATA = [ + final public const DEFINITION_METADATA = [ 'name' => 'Default task', ]; - public const TRANSITION_METADATA = [ + final public const TRANSITION_METADATA = [ 'close' => [ 'verb' => 'close', 'class' => 'btn btn-task-label btn-task-close', diff --git a/src/Bundle/ChillThirdPartyBundle/Controller/ThirdPartyController.php b/src/Bundle/ChillThirdPartyBundle/Controller/ThirdPartyController.php index da806a750..821f6c7ef 100644 --- a/src/Bundle/ChillThirdPartyBundle/Controller/ThirdPartyController.php +++ b/src/Bundle/ChillThirdPartyBundle/Controller/ThirdPartyController.php @@ -32,7 +32,7 @@ use function array_merge; final class ThirdPartyController extends CRUDController { - private bool $askCenter; + private readonly bool $askCenter; public function __construct( protected AuthorizationHelper $authorizationHelper, diff --git a/src/Bundle/ChillThirdPartyBundle/DataFixtures/ORM/LoadThirdParty.php b/src/Bundle/ChillThirdPartyBundle/DataFixtures/ORM/LoadThirdParty.php index e813cbd7f..119446f13 100644 --- a/src/Bundle/ChillThirdPartyBundle/DataFixtures/ORM/LoadThirdParty.php +++ b/src/Bundle/ChillThirdPartyBundle/DataFixtures/ORM/LoadThirdParty.php @@ -30,7 +30,7 @@ use function count; class LoadThirdParty extends Fixture implements DependentFixtureInterface { - private PhoneNumberUtil $phoneNumberUtil; + private readonly PhoneNumberUtil $phoneNumberUtil; public function __construct() { diff --git a/src/Bundle/ChillThirdPartyBundle/DependencyInjection/CompilerPass/ThirdPartyTypeCompilerPass.php b/src/Bundle/ChillThirdPartyBundle/DependencyInjection/CompilerPass/ThirdPartyTypeCompilerPass.php index f5fa9d05a..11095df7f 100644 --- a/src/Bundle/ChillThirdPartyBundle/DependencyInjection/CompilerPass/ThirdPartyTypeCompilerPass.php +++ b/src/Bundle/ChillThirdPartyBundle/DependencyInjection/CompilerPass/ThirdPartyTypeCompilerPass.php @@ -25,7 +25,7 @@ use function in_array; */ class ThirdPartyTypeCompilerPass implements CompilerPassInterface { - public const TAG = 'chill_3party.provider'; + final public const TAG = 'chill_3party.provider'; public function process(ContainerBuilder $container) { diff --git a/src/Bundle/ChillThirdPartyBundle/Entity/ThirdParty.php b/src/Bundle/ChillThirdPartyBundle/Entity/ThirdParty.php index b8ea8126c..2d4818ea6 100644 --- a/src/Bundle/ChillThirdPartyBundle/Entity/ThirdParty.php +++ b/src/Bundle/ChillThirdPartyBundle/Entity/ThirdParty.php @@ -90,11 +90,11 @@ use function spl_object_hash; */ class ThirdParty implements TrackCreationInterface, TrackUpdateInterface, \Stringable { - public const KIND_CHILD = 'child'; + final public const KIND_CHILD = 'child'; - public const KIND_COMPANY = 'company'; + final public const KIND_COMPANY = 'company'; - public const KIND_CONTACT = 'contact'; + final public const KIND_CONTACT = 'contact'; /** * [fr] Sigle. diff --git a/src/Bundle/ChillThirdPartyBundle/Export/Helper/LabelThirdPartyHelper.php b/src/Bundle/ChillThirdPartyBundle/Export/Helper/LabelThirdPartyHelper.php index 61fb03226..be275b22a 100644 --- a/src/Bundle/ChillThirdPartyBundle/Export/Helper/LabelThirdPartyHelper.php +++ b/src/Bundle/ChillThirdPartyBundle/Export/Helper/LabelThirdPartyHelper.php @@ -18,7 +18,7 @@ use const SORT_NUMERIC; class LabelThirdPartyHelper { - public function __construct(private ThirdPartyRender $thirdPartyRender, private ThirdPartyRepository $thirdPartyRepository) + public function __construct(private readonly ThirdPartyRender $thirdPartyRender, private readonly ThirdPartyRepository $thirdPartyRepository) { } diff --git a/src/Bundle/ChillThirdPartyBundle/Form/ThirdPartyType.php b/src/Bundle/ChillThirdPartyBundle/Form/ThirdPartyType.php index 91e915e09..e8a26d3fd 100644 --- a/src/Bundle/ChillThirdPartyBundle/Form/ThirdPartyType.php +++ b/src/Bundle/ChillThirdPartyBundle/Form/ThirdPartyType.php @@ -38,7 +38,7 @@ use function array_key_exists; class ThirdPartyType extends AbstractType { - private bool $askCenter; + private readonly bool $askCenter; public function __construct( protected AuthorizationHelper $authorizationHelper, diff --git a/src/Bundle/ChillThirdPartyBundle/Form/Type/PickThirdPartyTypeCategoryType.php b/src/Bundle/ChillThirdPartyBundle/Form/Type/PickThirdPartyTypeCategoryType.php index a02785545..4e0477bcc 100644 --- a/src/Bundle/ChillThirdPartyBundle/Form/Type/PickThirdPartyTypeCategoryType.php +++ b/src/Bundle/ChillThirdPartyBundle/Form/Type/PickThirdPartyTypeCategoryType.php @@ -30,7 +30,7 @@ class PickThirdPartyTypeCategoryType extends \Symfony\Component\Form\AbstractTyp { private const PREFIX_TYPE = 'chill_3party.key_label.'; - public function __construct(private ThirdPartyCategoryRepository $thirdPartyCategoryRepository, private ThirdPartyTypeManager $thirdPartyTypeManager, private TranslatableStringHelper $translatableStringHelper, private TranslatorInterface $translator) + public function __construct(private readonly ThirdPartyCategoryRepository $thirdPartyCategoryRepository, private readonly ThirdPartyTypeManager $thirdPartyTypeManager, private readonly TranslatableStringHelper $translatableStringHelper, private readonly TranslatorInterface $translator) { } diff --git a/src/Bundle/ChillThirdPartyBundle/Form/Type/PickThirdpartyDynamicType.php b/src/Bundle/ChillThirdPartyBundle/Form/Type/PickThirdpartyDynamicType.php index 8ae1702ce..9022fb6dc 100644 --- a/src/Bundle/ChillThirdPartyBundle/Form/Type/PickThirdpartyDynamicType.php +++ b/src/Bundle/ChillThirdPartyBundle/Form/Type/PickThirdpartyDynamicType.php @@ -26,7 +26,7 @@ use Symfony\Component\Serializer\SerializerInterface; */ class PickThirdpartyDynamicType extends AbstractType { - public function __construct(private DenormalizerInterface $denormalizer, private SerializerInterface $serializer, private NormalizerInterface $normalizer) + public function __construct(private readonly DenormalizerInterface $denormalizer, private readonly SerializerInterface $serializer, private readonly NormalizerInterface $normalizer) { } diff --git a/src/Bundle/ChillThirdPartyBundle/Repository/ThirdPartyACLAwareRepository.php b/src/Bundle/ChillThirdPartyBundle/Repository/ThirdPartyACLAwareRepository.php index 283622e56..30f9be556 100644 --- a/src/Bundle/ChillThirdPartyBundle/Repository/ThirdPartyACLAwareRepository.php +++ b/src/Bundle/ChillThirdPartyBundle/Repository/ThirdPartyACLAwareRepository.php @@ -15,7 +15,7 @@ use Chill\MainBundle\Security\Authorization\AuthorizationHelper; use Doctrine\ORM\QueryBuilder; use Symfony\Component\Security\Core\Security; -final class ThirdPartyACLAwareRepository implements ThirdPartyACLAwareRepositoryInterface +final readonly class ThirdPartyACLAwareRepository implements ThirdPartyACLAwareRepositoryInterface { public function __construct(private Security $security, private AuthorizationHelper $authorizationHelper, private ThirdPartyRepository $thirdPartyRepository) { diff --git a/src/Bundle/ChillThirdPartyBundle/Repository/ThirdPartyRepository.php b/src/Bundle/ChillThirdPartyBundle/Repository/ThirdPartyRepository.php index 76e15ef17..c9d1d856f 100644 --- a/src/Bundle/ChillThirdPartyBundle/Repository/ThirdPartyRepository.php +++ b/src/Bundle/ChillThirdPartyBundle/Repository/ThirdPartyRepository.php @@ -23,7 +23,7 @@ use function array_key_exists; final class ThirdPartyRepository implements ObjectRepository { - private EntityRepository $repository; + private readonly EntityRepository $repository; public function __construct(EntityManagerInterface $em) { diff --git a/src/Bundle/ChillThirdPartyBundle/Search/ThirdPartyApiSearch.php b/src/Bundle/ChillThirdPartyBundle/Search/ThirdPartyApiSearch.php index 8b0a26849..12d5ba95c 100644 --- a/src/Bundle/ChillThirdPartyBundle/Search/ThirdPartyApiSearch.php +++ b/src/Bundle/ChillThirdPartyBundle/Search/ThirdPartyApiSearch.php @@ -49,7 +49,7 @@ FROM rows, searches */ class ThirdPartyApiSearch implements SearchApiInterface { - public function __construct(private ThirdPartyRepository $thirdPartyRepository) + public function __construct(private readonly ThirdPartyRepository $thirdPartyRepository) { } diff --git a/src/Bundle/ChillThirdPartyBundle/Search/ThirdPartySearch.php b/src/Bundle/ChillThirdPartyBundle/Search/ThirdPartySearch.php index 0421d0f34..c60f97413 100644 --- a/src/Bundle/ChillThirdPartyBundle/Search/ThirdPartySearch.php +++ b/src/Bundle/ChillThirdPartyBundle/Search/ThirdPartySearch.php @@ -26,7 +26,7 @@ use Symfony\Component\Security\Core\Role\Role; */ class ThirdPartySearch implements SearchInterface { - public const NAME = '3party'; + final public const NAME = '3party'; /** * @var AuthorizationHelper @@ -53,7 +53,7 @@ class ThirdPartySearch implements SearchInterface TokenStorageInterface $tokenStorage, AuthorizationHelper $authorizationHelper, PaginatorFactory $paginatorFactory, - private ThirdPartyRepository $thirdPartyRepository + private readonly ThirdPartyRepository $thirdPartyRepository ) { $this->em = $em; $this->tokenStorage = $tokenStorage; diff --git a/src/Bundle/ChillThirdPartyBundle/Security/Voter/ThirdPartyVoter.php b/src/Bundle/ChillThirdPartyBundle/Security/Voter/ThirdPartyVoter.php index e1dae28b9..9e346ebf5 100644 --- a/src/Bundle/ChillThirdPartyBundle/Security/Voter/ThirdPartyVoter.php +++ b/src/Bundle/ChillThirdPartyBundle/Security/Voter/ThirdPartyVoter.php @@ -28,11 +28,11 @@ use function in_array; */ class ThirdPartyVoter extends AbstractChillVoter implements ProvideRoleHierarchyInterface { - public const CREATE = 'CHILL_3PARTY_3PARTY_CREATE'; + final public const CREATE = 'CHILL_3PARTY_3PARTY_CREATE'; - public const SHOW = 'CHILL_3PARTY_3PARTY_SHOW'; + final public const SHOW = 'CHILL_3PARTY_3PARTY_SHOW'; - public const UPDATE = 'CHILL_3PARTY_3PARTY_UPDATE'; + final public const UPDATE = 'CHILL_3PARTY_3PARTY_UPDATE'; /** * @var AuthorizationHelper diff --git a/src/Bundle/ChillThirdPartyBundle/Serializer/Normalizer/ThirdPartyNormalizer.php b/src/Bundle/ChillThirdPartyBundle/Serializer/Normalizer/ThirdPartyNormalizer.php index b3f898a76..b2271e8df 100644 --- a/src/Bundle/ChillThirdPartyBundle/Serializer/Normalizer/ThirdPartyNormalizer.php +++ b/src/Bundle/ChillThirdPartyBundle/Serializer/Normalizer/ThirdPartyNormalizer.php @@ -24,7 +24,7 @@ class ThirdPartyNormalizer implements NormalizerAwareInterface, NormalizerInterf { use NormalizerAwareTrait; - public function __construct(private ThirdPartyRender $thirdPartyRender, private TranslatableStringHelperInterface $translatableStringHelper) + public function __construct(private readonly ThirdPartyRender $thirdPartyRender, private readonly TranslatableStringHelperInterface $translatableStringHelper) { } diff --git a/src/Bundle/ChillThirdPartyBundle/ThirdPartyType/ThirdPartyTypeManager.php b/src/Bundle/ChillThirdPartyBundle/ThirdPartyType/ThirdPartyTypeManager.php index cc8081aaa..714cb6455 100644 --- a/src/Bundle/ChillThirdPartyBundle/ThirdPartyType/ThirdPartyTypeManager.php +++ b/src/Bundle/ChillThirdPartyBundle/ThirdPartyType/ThirdPartyTypeManager.php @@ -21,7 +21,7 @@ class ThirdPartyTypeManager /** * The prefix used to translate the key of provider. */ - public const THIRD_PARTY_TRANSLATOR_KEY = 'chill_3party.key_label.'; + final public const THIRD_PARTY_TRANSLATOR_KEY = 'chill_3party.key_label.'; /** * @var ThirdPartyTypeProviderInterface[] diff --git a/src/Bundle/ChillWopiBundle/src/Controller/Convert.php b/src/Bundle/ChillWopiBundle/src/Controller/Convert.php index d7e90e46a..665386ffe 100644 --- a/src/Bundle/ChillWopiBundle/src/Controller/Convert.php +++ b/src/Bundle/ChillWopiBundle/src/Controller/Convert.php @@ -35,17 +35,17 @@ class Convert { private const LOG_PREFIX = '[convert] '; - private string $collaboraDomain; + private readonly string $collaboraDomain; /** * @param StoredObjectManager $storedObjectManager */ public function __construct( - private HttpClientInterface $httpClient, - private RequestStack $requestStack, - private Security $security, - private StoredObjectManagerInterface $storedObjectManager, - private LoggerInterface $logger, + private readonly HttpClientInterface $httpClient, + private readonly RequestStack $requestStack, + private readonly Security $security, + private readonly StoredObjectManagerInterface $storedObjectManager, + private readonly LoggerInterface $logger, ParameterBagInterface $parameters ) { $this->collaboraDomain = $parameters->get('wopi')['server']; diff --git a/src/Bundle/ChillWopiBundle/src/Controller/Editor.php b/src/Bundle/ChillWopiBundle/src/Controller/Editor.php index ec10cc973..7280e7fca 100644 --- a/src/Bundle/ChillWopiBundle/src/Controller/Editor.php +++ b/src/Bundle/ChillWopiBundle/src/Controller/Editor.php @@ -36,7 +36,7 @@ use Twig\Environment; * @internal * @coversNothing */ -final class Editor +final readonly class Editor { public function __construct(private ConfigurationInterface $wopiConfiguration, private DiscoveryInterface $wopiDiscovery, private DocumentManagerInterface $documentManager, private EngineInterface $engine, private JWTTokenManagerInterface $JWTTokenManager, private NormalizerInterface $normalizer, private ResponderInterface $responder, private Security $security, private Psr17Interface $psr17, private RouterInterface $router) { diff --git a/src/Bundle/ChillWopiBundle/src/Service/Controller/Responder.php b/src/Bundle/ChillWopiBundle/src/Service/Controller/Responder.php index af22cf952..b85d1b8b3 100644 --- a/src/Bundle/ChillWopiBundle/src/Service/Controller/Responder.php +++ b/src/Bundle/ChillWopiBundle/src/Service/Controller/Responder.php @@ -20,7 +20,7 @@ use Symfony\Component\Routing\Generator\UrlGeneratorInterface; use Symfony\Component\Serializer\SerializerInterface; use Twig\Environment; -final class Responder implements ResponderInterface +final readonly class Responder implements ResponderInterface { public function __construct(private Environment $twig, private UrlGeneratorInterface $urlGenerator, private SerializerInterface $serializer) { @@ -51,12 +51,7 @@ final class Responder implements ResponderInterface ->serialize( $data, 'json', - array_merge( - [ - 'json_encode_options' => JsonResponse::DEFAULT_ENCODING_OPTIONS, - ], - $context - ) + ['json_encode_options' => JsonResponse::DEFAULT_ENCODING_OPTIONS, ...$context] ), $status, $headers, diff --git a/src/Bundle/ChillWopiBundle/src/Service/Wopi/AuthorizationManager.php b/src/Bundle/ChillWopiBundle/src/Service/Wopi/AuthorizationManager.php index 08cdec97e..53e9ad819 100644 --- a/src/Bundle/ChillWopiBundle/src/Service/Wopi/AuthorizationManager.php +++ b/src/Bundle/ChillWopiBundle/src/Service/Wopi/AuthorizationManager.php @@ -19,7 +19,7 @@ use Symfony\Component\Security\Core\Security; class AuthorizationManager implements \ChampsLibres\WopiBundle\Contracts\AuthorizationManagerInterface { - public function __construct(private JWTTokenManagerInterface $tokenManager, private Security $security) + public function __construct(private readonly JWTTokenManagerInterface $tokenManager, private readonly Security $security) { } diff --git a/src/Bundle/ChillWopiBundle/src/Service/Wopi/ChillDocumentLockManager.php b/src/Bundle/ChillWopiBundle/src/Service/Wopi/ChillDocumentLockManager.php index 358831f87..148b1fc8e 100644 --- a/src/Bundle/ChillWopiBundle/src/Service/Wopi/ChillDocumentLockManager.php +++ b/src/Bundle/ChillWopiBundle/src/Service/Wopi/ChillDocumentLockManager.php @@ -26,7 +26,7 @@ class ChillDocumentLockManager implements DocumentLockManagerInterface */ private const LOCK_GRACEFUL_DURATION_TIME = 3; - public function __construct(private ChillRedis $redis) + public function __construct(private readonly ChillRedis $redis) { } diff --git a/src/Bundle/ChillWopiBundle/src/Service/Wopi/ChillDocumentManager.php b/src/Bundle/ChillWopiBundle/src/Service/Wopi/ChillDocumentManager.php index 6084d4785..0963cf903 100644 --- a/src/Bundle/ChillWopiBundle/src/Service/Wopi/ChillDocumentManager.php +++ b/src/Bundle/ChillWopiBundle/src/Service/Wopi/ChillDocumentManager.php @@ -34,16 +34,16 @@ use function strlen; final class ChillDocumentManager implements DocumentManagerInterface { - private RequestInterface $request; + private readonly RequestInterface $request; public function __construct( - private DocumentLockManagerInterface $documentLockManager, - private EntityManagerInterface $entityManager, + private readonly DocumentLockManagerInterface $documentLockManager, + private readonly EntityManagerInterface $entityManager, HttpMessageFactoryInterface $httpMessageFactory, - private Psr17Interface $psr17, + private readonly Psr17Interface $psr17, RequestStack $requestStack, - private StoredObjectManagerInterface $storedObjectManager, - private StoredObjectRepository $storedObjectRepository + private readonly StoredObjectManagerInterface $storedObjectManager, + private readonly StoredObjectRepository $storedObjectRepository ) { $this->request = $httpMessageFactory->createRequest($requestStack->getCurrentRequest()); } diff --git a/src/Bundle/ChillWopiBundle/src/Service/Wopi/ChillWopi.php b/src/Bundle/ChillWopiBundle/src/Service/Wopi/ChillWopi.php index 88f863cd1..189b780b2 100644 --- a/src/Bundle/ChillWopiBundle/src/Service/Wopi/ChillWopi.php +++ b/src/Bundle/ChillWopiBundle/src/Service/Wopi/ChillWopi.php @@ -15,7 +15,7 @@ use ChampsLibres\WopiLib\Contract\Service\WopiInterface; use Psr\Http\Message\RequestInterface; use Psr\Http\Message\ResponseInterface; -final class ChillWopi implements WopiInterface +final readonly class ChillWopi implements WopiInterface { public function __construct(private WopiInterface $wopi) { diff --git a/src/Bundle/ChillWopiBundle/src/Service/Wopi/UserManager.php b/src/Bundle/ChillWopiBundle/src/Service/Wopi/UserManager.php index 96ed5c651..4a0857521 100644 --- a/src/Bundle/ChillWopiBundle/src/Service/Wopi/UserManager.php +++ b/src/Bundle/ChillWopiBundle/src/Service/Wopi/UserManager.php @@ -17,7 +17,7 @@ use Symfony\Component\Security\Core\Security; class UserManager implements \ChampsLibres\WopiBundle\Contracts\UserManagerInterface { - public function __construct(private Security $security) + public function __construct(private readonly Security $security) { }