From f3ac8642338e81e0f972ea550b3ea914372b7abf Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Tue, 13 Aug 2024 15:26:27 +0200 Subject: [PATCH] Upgrade php to v8.3 with rector --- composer.json | 8 ++++- .../_static/code/exports/BirthdateFilter.php | 8 +++++ .../_static/code/exports/CountPerson.php | 12 +++++++ .../widgets/ChillMainConfiguration.php | 1 + .../widgets/ChillMainExtension.php | 4 +++ ...ChillPersonAddAPersonListWidgetFactory.php | 3 ++ .../widgets/ChillPersonAddAPersonWidget.php | 1 + .../widgets/ChillPersonExtension.php | 2 ++ rector.php | 7 +++- .../AdminActivityPresenceController.php | 1 + .../AdminActivityTypeCategoryController.php | 1 + .../AdminActivityTypeController.php | 1 + .../DataFixtures/ORM/LoadActivity.php | 2 ++ .../ORM/LoadActivityNotifications.php | 1 + .../DataFixtures/ORM/LoadActivityReason.php | 2 ++ .../ORM/LoadActivityReasonCategory.php | 2 ++ .../DataFixtures/ORM/LoadActivityType.php | 2 ++ .../ORM/LoadActivityTypeCategory.php | 2 ++ .../DataFixtures/ORM/LoadActivitytACL.php | 2 ++ .../ChillActivityExtension.php | 2 ++ .../DependencyInjection/Configuration.php | 1 + .../ChillActivityBundle/Entity/Activity.php | 9 +++-- .../Entity/ActivityReasonCategory.php | 1 + .../Entity/ActivityType.php | 6 ++-- .../ByActivityNumberAggregator.php | 8 +++++ .../ByActivityTypeAggregator.php | 10 +++++- .../BySocialActionAggregator.php | 8 +++++ .../BySocialIssueAggregator.php | 8 +++++ .../Aggregator/ActivityLocationAggregator.php | 10 +++++- .../Aggregator/ActivityPresenceAggregator.php | 8 +++++ .../Aggregator/ActivityReasonAggregator.php | 9 +++++ .../Aggregator/ActivityTypeAggregator.php | 10 +++++- .../Aggregator/ActivityUserAggregator.php | 10 +++++- .../Aggregator/ActivityUsersAggregator.php | 8 +++++ .../Aggregator/ActivityUsersJobAggregator.php | 10 +++++- .../ActivityUsersScopeAggregator.php | 10 +++++- .../Export/Aggregator/ByCreatorAggregator.php | 8 +++++ .../Aggregator/ByThirdpartyAggregator.php | 8 +++++ .../Aggregator/CreatorJobAggregator.php | 10 +++++- .../Aggregator/CreatorScopeAggregator.php | 10 +++++- .../Export/Aggregator/DateAggregator.php | 12 +++++-- .../Aggregator/LocationTypeAggregator.php | 8 +++++ .../PersonAggregators/PersonAggregator.php | 8 +++++ .../Export/Aggregator/PersonsAggregator.php | 10 +++++- .../Aggregator/SentReceivedAggregator.php | 8 +++++ .../LinkedToACP/AvgActivityDuration.php | 13 ++++++++ .../LinkedToACP/AvgActivityVisitDuration.php | 13 ++++++++ .../Export/LinkedToACP/CountActivity.php | 13 ++++++++ .../LinkedToACP/CountHouseholdOnActivity.php | 13 ++++++++ .../LinkedToACP/CountPersonsOnActivity.php | 13 ++++++++ .../Export/LinkedToACP/ListActivity.php | 13 ++++++++ .../LinkedToACP/SumActivityDuration.php | 13 ++++++++ .../LinkedToACP/SumActivityVisitDuration.php | 13 ++++++++ .../Export/LinkedToPerson/CountActivity.php | 13 ++++++++ .../CountHouseholdOnActivity.php | 13 ++++++++ .../Export/LinkedToPerson/ListActivity.php | 13 ++++++++ .../LinkedToPerson/StatActivityDuration.php | 15 ++++++++- .../Export/Export/ListActivityHelper.php | 2 +- .../Filter/ACPFilters/ActivityTypeFilter.php | 9 ++++- .../ACPFilters/BySocialActionFilter.php | 7 ++++ .../Filter/ACPFilters/BySocialIssueFilter.php | 7 ++++ .../Filter/ACPFilters/HasNoActivityFilter.php | 7 ++++ ...PeriodHavingActivityBetweenDatesFilter.php | 7 ++++ .../Export/Filter/ActivityDateFilter.php | 7 ++++ .../Export/Filter/ActivityPresenceFilter.php | 7 ++++ .../Export/Filter/ActivityTypeFilter.php | 8 +++++ .../Export/Filter/ActivityUsersFilter.php | 7 ++++ .../Export/Filter/ByCreatorFilter.php | 7 ++++ .../Export/Filter/CreatorJobFilter.php | 9 ++++- .../Export/Filter/CreatorScopeFilter.php | 9 ++++- .../Export/Filter/EmergencyFilter.php | 11 +++++-- .../Export/Filter/LocationFilter.php | 7 ++++ .../Export/Filter/LocationTypeFilter.php | 7 ++++ .../PersonFilters/ActivityReasonFilter.php | 8 +++++ .../PersonHavingActivityBetweenDateFilter.php | 8 +++++ .../Export/Filter/PersonsFilter.php | 9 ++++- .../Export/Filter/SentReceivedFilter.php | 11 +++++-- .../Export/Filter/UserFilter.php | 7 ++++ .../Export/Filter/UsersJobFilter.php | 9 ++++- .../Export/Filter/UsersScopeFilter.php | 9 ++++- .../Form/ActivityPresenceType.php | 2 ++ .../Form/ActivityReasonCategoryType.php | 3 ++ .../Form/ActivityReasonType.php | 3 ++ .../ChillActivityBundle/Form/ActivityType.php | 3 ++ .../Form/ActivityTypeCategoryType.php | 2 ++ .../Form/ActivityTypeType.php | 2 ++ .../Form/Type/ActivityFieldPresence.php | 2 ++ .../Form/Type/PickActivityReasonType.php | 3 ++ ...TranslatableActivityReasonCategoryType.php | 2 ++ .../Form/Type/TranslatableActivityType.php | 3 ++ .../Menu/AccompanyingCourseMenuBuilder.php | 2 ++ .../AccompanyingCourseQuickMenuBuilder.php | 2 ++ .../Menu/AdminMenuBuilder.php | 2 ++ .../Menu/PersonMenuBuilder.php | 2 ++ .../ActivityNotificationHandler.php | 3 ++ .../Repository/ActivityACLAwareRepository.php | 7 ++++ .../ActivityDocumentACLAwareRepository.php | 2 ++ .../Repository/ActivityPresenceRepository.php | 5 +++ .../Repository/ActivityReasonRepository.php | 1 + .../Repository/ActivityTypeRepository.php | 6 ++++ .../Authorization/ActivityStatsVoter.php | 9 +++-- .../Security/Authorization/ActivityVoter.php | 23 ++++++++----- .../Service/DocGenerator/ActivityContext.php | 15 +++++++++ ...tActivitiesByAccompanyingPeriodContext.php | 15 +++++++++ ...DateQueryPartForAccompanyingPeriodInfo.php | 9 +++++ ...anyingPeriodActivityGenericDocProvider.php | 6 +++- .../PersonActivityGenericDocProvider.php | 4 ++- ...anyingPeriodActivityGenericDocRenderer.php | 3 ++ .../Entity/ActivityReasonRender.php | 3 ++ .../ByActivityTypeAggregatorTest.php | 4 +++ .../BySocialActionAggregatorTest.php | 4 +++ .../BySocialIssueAggregatorTest.php | 4 +++ .../ActivityPresenceAggregatorTest.php | 4 +++ .../ActivityReasonAggregatorTest.php | 4 +++ .../Aggregator/ActivityTypeAggregatorTest.php | 4 +++ .../Aggregator/ActivityUserAggregatorTest.php | 4 +++ .../Aggregator/ByThirdpartyAggregatorTest.php | 4 +++ .../Aggregator/ByUserAggregatorTest.php | 4 +++ .../Aggregator/CreatorJobAggregatorTest.php | 4 +++ .../Aggregator/CreatorScopeAggregatorTest.php | 4 +++ .../Export/Aggregator/DateAggregatorTest.php | 4 +++ .../Aggregator/LocationTypeAggregatorTest.php | 4 +++ .../PersonAggregatorTest.php | 4 +++ .../Aggregator/PersonsAggregatorTest.php | 4 +++ .../LinkedToACP/AvgActivityDurationTest.php | 4 +++ .../AvgActivityVisitDurationTest.php | 4 +++ .../Export/LinkedToACP/CountActivityTest.php | 4 +++ .../CountHouseholdOnActivityTest.php | 4 +++ .../CountPersonsOnActivityTest.php | 4 +++ .../LinkedToACP/SumActivityDurationTest.php | 4 +++ .../SumActivityVisitDurationTest.php | 4 +++ .../LinkedToPerson/CountActivityTest.php | 4 +++ .../CountHouseholdOnActivityTest.php | 4 +++ .../LinkedToPerson/ListActivityTest.php | 4 +++ .../StatActivityDurationTest.php | 4 +++ .../ACPFilters/ActivityTypeFilterTest.php | 4 +++ .../Filter/ACPFilters/ByCreatorFilterTest.php | 4 +++ .../ACPFilters/BySocialActionFilterTest.php | 4 +++ .../ACPFilters/BySocialIssueFilterTest.php | 4 +++ .../Export/Filter/ActivityDateFilterTest.php | 4 +++ .../Filter/ActivityPresenceFilterTest.php | 4 +++ .../Filter/ActivityReasonFilterTest.php | 4 +++ .../Export/Filter/ActivityTypeFilterTest.php | 4 +++ .../Export/Filter/ByCreatorFilterTest.php | 4 +++ .../Export/Filter/CreatorJobFilterTest.php | 4 +++ .../Export/Filter/CreatorScopeFilterTest.php | 4 +++ .../Export/Filter/EmergencyFilterTest.php | 4 +++ .../Export/Filter/LocationTypeFilterTest.php | 4 +++ .../ActivityReasonFilterTest.php | 4 +++ ...sonHavingActivityBetweenDateFilterTest.php | 4 +++ ...sonHavingActivityBetweenDateFilterTest.php | 4 +++ .../Tests/Export/Filter/PersonsFilterTest.php | 4 +++ .../Export/Filter/SentReceivedFilterTest.php | 4 +++ .../Tests/Export/Filter/UserFilterTest.php | 4 +++ .../Tests/Form/ActivityTypeTest.php | 1 + .../Type/TranslatableActivityReasonTest.php | 2 ++ .../Type/TranslatableActivityTypeTest.php | 1 + .../ActivityACLAwareRepositoryTest.php | 1 + ...ActivityDocumentACLAwareRepositoryTest.php | 1 + .../Authorization/ActivityVoterTest.php | 1 + ...ivitiesByAccompanyingPeriodContextTest.php | 1 + .../Timeline/TimelineActivityProvider.php | 6 +++- .../Constraints/ActivityValidity.php | 5 +-- .../Constraints/ActivityValidityValidator.php | 1 + .../migrations/Version20150701091248.php | 2 ++ .../migrations/Version20150702093317.php | 2 ++ .../migrations/Version20150704091347.php | 2 ++ .../migrations/Version20160222103457.php | 2 ++ .../migrations/Version20161114085659.php | 2 ++ .../migrations/Version20210304154629.php | 3 ++ .../migrations/Version20210311114250.php | 3 ++ .../migrations/Version20210401090853.php | 3 ++ .../migrations/Version20210408122329.php | 3 ++ .../migrations/Version20210415113216.php | 3 ++ .../migrations/Version20210422073711.php | 3 ++ .../migrations/Version20210422123846.php | 3 ++ .../migrations/Version20210506071150.php | 3 ++ .../migrations/Version20210506090417.php | 2 ++ .../migrations/Version20210506094520.php | 3 ++ .../migrations/Version20210506112500.php | 3 ++ .../migrations/Version20210520095626.php | 3 ++ .../migrations/Version20210528161250.php | 3 ++ .../migrations/Version20210602103243.php | 3 ++ .../migrations/Version20211119173555.php | 3 ++ .../migrations/Version20211207152023.php | 3 ++ .../migrations/Version20220425133027.php | 3 ++ .../migrations/Version20220527124438.php | 3 ++ .../migrations/Version20221014130554.php | 3 ++ .../AsideActivityCategoryController.php | 1 + .../Controller/AsideActivityController.php | 3 ++ .../DataFixtures/ORM/LoadAsideActivity.php | 2 ++ .../ORM/LoadAsideActivityCategory.php | 1 + .../ChillAsideActivityExtension.php | 2 ++ .../src/DependencyInjection/Configuration.php | 1 + .../src/Entity/AsideActivity.php | 4 +++ .../Aggregator/ByActivityTypeAggregator.php | 8 +++++ .../Aggregator/ByLocationAggregator.php | 8 +++++ .../Export/Aggregator/ByUserJobAggregator.php | 10 +++++- .../Aggregator/ByUserScopeAggregator.php | 10 +++++- .../Export/AvgAsideActivityDuration.php | 13 ++++++++ .../src/Export/Export/CountAsideActivity.php | 13 ++++++++ .../src/Export/Export/ListAsideActivity.php | 13 ++++++++ .../Export/SumAsideActivityDuration.php | 13 ++++++++ .../Export/Filter/ByActivityTypeFilter.php | 7 ++++ .../src/Export/Filter/ByDateFilter.php | 7 ++++ .../src/Export/Filter/ByLocationFilter.php | 7 ++++ .../src/Export/Filter/ByUserFilter.php | 7 ++++ .../src/Export/Filter/ByUserJobFilter.php | 9 ++++- .../src/Export/Filter/ByUserScopeFilter.php | 9 ++++- .../src/Form/AsideActivityCategoryType.php | 1 + .../src/Form/AsideActivityFormType.php | 3 ++ .../Type/PickAsideActivityCategoryType.php | 2 ++ .../src/Menu/AdminMenuBuilder.php | 2 ++ .../src/Menu/SectionMenuBuilder.php | 2 ++ .../src/Menu/UserMenuBuilder.php | 2 ++ .../AsideActivityCategoryRepository.php | 5 +++ .../Repository/AsideActivityRepository.php | 1 + .../src/Security/AsideActivityVoter.php | 7 +++- .../src/Templating/Entity/CategoryRender.php | 7 ++-- .../AsideActivityControllerTest.php | 1 + .../Export/Export/ListAsideActivityTest.php | 1 + .../src/migrations/Version20210706124644.php | 3 ++ .../src/migrations/Version20210804082249.php | 3 ++ .../src/migrations/Version20210806140343.php | 3 ++ .../src/migrations/Version20210806140710.php | 3 ++ .../src/migrations/Version20210810084456.php | 3 ++ .../src/migrations/Version20210922182907.php | 3 ++ .../src/migrations/Version20211004134012.php | 3 ++ .../src/migrations/Version20230816112809.php | 3 ++ .../Calculator/CalculatorResult.php | 6 ++-- .../ChillBudgetBundle/ChillBudgetBundle.php | 1 + .../Controller/Admin/ChargeKindController.php | 1 + .../Admin/ResourceKindController.php | 1 + .../Controller/ChargeController.php | 2 ++ .../Controller/ResourceController.php | 2 ++ .../ChillBudgetExtension.php | 2 ++ .../Compiler/CalculatorCompilerPass.php | 1 + .../DependencyInjection/Configuration.php | 1 + .../ChillBudgetBundle/Entity/Charge.php | 13 +++++--- .../ChillBudgetBundle/Entity/Resource.php | 3 ++ .../Form/Admin/ChargeKindType.php | 2 ++ .../Form/Admin/ResourceKindType.php | 2 ++ .../ChillBudgetBundle/Form/ChargeType.php | 3 ++ .../ChillBudgetBundle/Form/ResourceType.php | 3 ++ .../Menu/AdminMenuBuilder.php | 2 ++ .../Menu/HouseholdMenuBuilder.php | 2 ++ .../Menu/PersonMenuBuilder.php | 2 ++ .../Repository/ChargeKindRepository.php | 8 +++++ .../Repository/ResourceKindRepository.php | 8 +++++ .../Authorization/BudgetElementVoter.php | 15 ++++++--- .../Service/Summary/SummaryBudget.php | 10 +++--- .../Templating/BudgetElementTypeRender.php | 3 ++ .../migrations/Version20180522080432.php | 3 ++ .../migrations/Version20181219145631.php | 2 ++ .../migrations/Version20220224090319.php | 3 ++ .../migrations/Version20221116163445.php | 3 ++ .../migrations/Version20221130101659.php | 3 ++ .../migrations/Version20221202165608.php | 3 ++ .../migrations/Version20221207105407.php | 4 +++ .../migrations/Version20230201131008.php | 3 ++ .../migrations/Version20230209161546.php | 3 ++ .../migrations/Version20230328155010.php | 3 ++ .../ChillCalendarBundle.php | 1 + .../AzureGrantAdminConsentAndAcquireToken.php | 1 + .../MapAndSubscribeUserCalendarCommand.php | 2 ++ .../SendShortMessageOnEligibleCalendar.php | 1 + .../SendTestShortMessageOnCalendarCommand.php | 2 ++ .../Controller/CalendarAPIController.php | 2 ++ .../Controller/CancelReasonController.php | 1 + .../DataFixtures/ORM/LoadCalendarACL.php | 2 ++ .../DataFixtures/ORM/LoadCalendarRange.php | 3 ++ .../DataFixtures/ORM/LoadCancelReason.php | 2 ++ .../DataFixtures/ORM/LoadInvite.php | 2 ++ .../ChillCalendarExtension.php | 2 ++ .../DependencyInjection/Configuration.php | 1 + .../ChillCalendarBundle/Entity/Calendar.php | 13 ++++---- .../Entity/CancelReason.php | 6 ++-- .../ChillCalendarBundle/Entity/Invite.php | 10 +++--- .../Export/Aggregator/AgentAggregator.php | 8 +++++ .../Aggregator/CancelReasonAggregator.php | 8 +++++ .../Export/Aggregator/JobAggregator.php | 10 +++++- .../Export/Aggregator/LocationAggregator.php | 8 +++++ .../Aggregator/LocationTypeAggregator.php | 8 +++++ .../Export/Aggregator/MonthYearAggregator.php | 8 +++++ .../Export/Aggregator/ScopeAggregator.php | 10 +++++- .../Export/Aggregator/UrgencyAggregator.php | 8 +++++ .../Export/Export/CountCalendars.php | 13 ++++++++ .../Export/Export/StatCalendarAvgDuration.php | 13 ++++++++ .../Export/Export/StatCalendarSumDuration.php | 13 ++++++++ .../Export/Filter/AgentFilter.php | 7 ++++ .../Export/Filter/BetweenDatesFilter.php | 7 ++++ .../Export/Filter/CalendarRangeFilter.php | 11 +++++-- .../Export/Filter/JobFilter.php | 9 ++++- .../Export/Filter/ScopeFilter.php | 9 ++++- .../Form/CalendarDocCreateType.php | 2 ++ .../Form/CalendarDocEditType.php | 2 ++ .../ChillCalendarBundle/Form/CalendarType.php | 3 ++ .../Form/CancelReasonType.php | 2 ++ .../Menu/AccompanyingCourseMenuBuilder.php | 2 ++ .../AccompanyingCourseQuickMenuBuilder.php | 2 ++ .../Menu/AdminMenuBuilder.php | 2 ++ .../Menu/PersonMenuBuilder.php | 2 ++ .../Menu/UserMenuBuilder.php | 2 ++ .../Messenger/Message/CalendarMessage.php | 4 +-- .../Message/CalendarRangeMessage.php | 4 +-- .../Connector/MSGraph/MSUserAbsenceReader.php | 1 + .../Connector/MSGraph/MachineHttpClient.php | 2 ++ .../Connector/MSGraph/MachineTokenStorage.php | 2 +- .../Connector/MSGraph/MapCalendarToUser.php | 8 ++--- .../MSGraph/OnBehalfOfUserTokenStorage.php | 2 +- .../MSGraph/RemoteEventConverter.php | 8 ++--- .../MSGraphRemoteCalendarConnector.php | 9 +++++ .../Connector/NullRemoteCalendarConnector.php | 9 +++++ .../RemoteCalendarCompilerPass.php | 1 + .../Repository/CalendarACLAwareRepository.php | 6 ++++ .../Repository/CalendarDocRepository.php | 5 +++ .../Repository/CalendarRangeRepository.php | 5 +++ .../Repository/CalendarRepository.php | 5 +++ .../Repository/InviteRepository.php | 5 +++ .../Security/Voter/CalendarDocVoter.php | 8 +++-- .../Security/Voter/CalendarVoter.php | 13 +++++--- .../Security/Voter/InviteVoter.php | 4 ++- .../Service/DocGenerator/CalendarContext.php | 15 +++++++++ ...anyingPeriodCalendarGenericDocProvider.php | 6 +++- .../PersonCalendarGenericDocProvider.php | 4 ++- ...anyingPeriodCalendarGenericDocRenderer.php | 3 ++ .../DefaultRangeGenerator.php | 1 + .../DefaultShortMessageForCalendarBuilder.php | 1 + .../Controller/CalendarControllerTest.php | 2 ++ ...emoteCalendarMSGraphSyncControllerTest.php | 3 +- .../Export/Aggregator/AgentAggregatorTest.php | 4 +++ .../Aggregator/CancelReasonAggregatorTest.php | 4 +++ .../Export/Aggregator/JobAggregatorTest.php | 4 +++ .../Aggregator/LocationAggregatorTest.php | 4 +++ .../Aggregator/LocationTypeAggregatorTest.php | 4 +++ .../Aggregator/MonthYearAggregatorTest.php | 4 +++ .../Export/Aggregator/ScopeAggregatorTest.php | 4 +++ .../Tests/Export/Filter/AgentFilterTest.php | 4 +++ .../Export/Filter/BetweenDatesFilterTest.php | 4 +++ .../Tests/Export/Filter/JobFilterTest.php | 4 +++ .../Tests/Export/Filter/ScopeFilterTest.php | 4 +++ .../Tests/Form/CalendarTypeTest.php | 2 ++ .../MSGraph/CalendarRangeSyncerTest.php | 6 ++-- .../Connector/MSGraph/CalendarSyncerTest.php | 10 +++--- .../CalendarACLAwareRepositoryTest.php | 1 + .../Normalizer/CalendarNormalizerTest.php | 1 + .../BulkCalendarShortMessageSenderTest.php | 2 ++ ...aultShortMessageForCalendarBuilderTest.php | 1 + .../migrations/Version20210715141731.php | 3 ++ .../migrations/Version20210723074557.php | 3 ++ .../migrations/Version20210723142003.php | 3 ++ .../migrations/Version20210723142842.php | 3 ++ .../migrations/Version20211119173557.php | 3 ++ .../migrations/Version20220510155609.php | 3 ++ .../migrations/Version20220511134619.php | 3 ++ .../migrations/Version20220525080633.php | 3 ++ .../migrations/Version20220527124558.php | 3 ++ .../migrations/Version20220527234046.php | 3 ++ .../migrations/Version20220606153851.php | 3 ++ .../migrations/Version20220606154119.php | 3 ++ .../migrations/Version20220608084052.php | 3 ++ .../migrations/Version20220609200857.php | 3 ++ .../migrations/Version20220613202636.php | 3 ++ .../migrations/Version20220629095515.php | 3 ++ .../migrations/Version20220921101643.php | 3 ++ .../migrations/Version20221020101547.php | 3 ++ .../migrations/Version20221021092541.php | 3 ++ .../migrations/Version20221125144205.php | 3 ++ .../ChillCustomFieldsBundle.php | 1 + .../Command/CreateFieldsOnGroupCommand.php | 6 ++-- .../CustomFields/AbstractCustomField.php | 1 + .../CustomFields/CustomFieldChoice.php | 17 +++++++--- .../CustomFields/CustomFieldDate.php | 14 +++++--- .../CustomFields/CustomFieldLongChoice.php | 8 ++++- .../CustomFields/CustomFieldNumber.php | 14 +++++--- .../CustomFields/CustomFieldText.php | 10 ++++-- .../CustomFields/CustomFieldTitle.php | 13 ++++++-- .../DataFixtures/ORM/LoadOption.php | 2 ++ .../ChillCustomFieldsExtension.php | 2 ++ .../DependencyInjection/Configuration.php | 1 + .../CustomFieldCompilerPass.php | 1 + .../Entity/CustomField.php | 4 +-- .../Form/CustomFieldType.php | 3 ++ .../Form/CustomFieldsGroupType.php | 2 ++ .../CustomFieldDataTransformer.php | 2 ++ .../CustomFieldsGroupToIdTransformer.php | 2 ++ .../JsonCustomFieldToArrayTransformer.php | 2 ++ .../Form/Extension/PostTextExtension.php | 2 ++ .../Extension/PostTextIntegerExtension.php | 1 + .../Extension/PostTextNumberExtension.php | 1 + .../Form/Type/ChoiceWithOtherType.php | 2 ++ .../Form/Type/ChoicesListType.php | 2 ++ .../Form/Type/ChoicesType.php | 2 ++ .../Form/Type/CustomFieldType.php | 2 ++ .../Form/Type/CustomFieldsTitleType.php | 2 ++ .../Form/Type/LinkedCustomFieldsType.php | 3 ++ .../Menu/AdminMenuBuilder.php | 2 ++ .../Service/CustomFieldProvider.php | 1 + .../Twig/CustomFieldRenderingTwig.php | 1 + .../Twig/CustomFieldsGroupRenderingTwig.php | 1 + .../CustomFields/CustomFieldsChoiceTest.php | 2 ++ .../CustomFields/CustomFieldsNumberTest.php | 1 + .../CustomFields/CustomFieldsTextTest.php | 1 + .../PostTextIntegerExtensionTest.php | 1 + .../Extension/PostTextNumberExtensionTest.php | 1 + .../Tests/Service/CustomFieldsHelperTest.php | 1 + .../Twig/CustomFieldRenderingTwigTest.php | 1 + .../CustomFieldsGroupRenderingTwigTest.php | 1 + .../migrations/Version20141128195430.php | 2 ++ .../migrations/Version20150224164531.php | 2 ++ .../migrations/Version20151210155904.php | 2 ++ .../migrations/Version20151210205610.php | 2 ++ .../ChillDocGeneratorBundle.php | 1 + .../Context/ContextManager.php | 3 ++ .../AdminDocGeneratorTemplateController.php | 4 +++ .../ORM/LoadDocGeneratorTemplate.php | 1 + .../ChillDocGeneratorExtension.php | 2 ++ .../DependencyInjection/Configuration.php | 1 + .../Form/DocGeneratorTemplateType.php | 2 ++ .../GeneratorDriver/RelatorioDriver.php | 1 + .../Menu/AdminMenuBuilder.php | 2 ++ .../DocGeneratorTemplateRepository.php | 6 ++++ .../Serializer/Encoder/DocGenEncoder.php | 2 ++ .../Normalizer/CollectionDocGenNormalizer.php | 2 ++ .../Normalizer/DocGenObjectNormalizer.php | 2 ++ .../Service/Generator/Generator.php | 4 ++- ...erMessageHandledClearStoredObjectCache.php | 1 + .../Service/Messenger/OnGenerationFails.php | 3 +- .../Messenger/RequestGenerationHandler.php | 4 +-- .../migrations/Version20210805162522.php | 3 ++ .../migrations/Version20210812214310.php | 3 ++ .../migrations/Version20211103111010.php | 3 ++ .../migrations/Version20211119173556.php | 3 ++ .../migrations/Version20211201191757.php | 3 ++ .../migrations/Version20230214192558.php | 3 ++ .../Serializer/Encoder/DocGenEncoderTest.php | 1 + .../CollectionDocGenNormalizerTest.php | 1 + .../Normalizer/DocGenObjectNormalizerTest.php | 1 + .../Service/Context/BaseContextDataTest.php | 1 + ...ConfigureOpenstackObjectStorageCommand.php | 3 ++ .../TempUrlOpenstackGenerator.php | 4 ++- .../Event/TempUrlGenerateEvent.php | 2 +- .../Templating/AsyncUploadExtension.php | 1 + .../ChillDocStoreBundle.php | 1 + .../DataFixtures/ORM/LoadDocumentACL.php | 2 ++ .../DataFixtures/ORM/LoadDocumentCategory.php | 2 ++ .../Dav/Request/PropfindRequestAnalyzer.php | 2 +- .../ChillDocStoreExtension.php | 2 ++ .../DependencyInjection/Configuration.php | 1 + .../Entity/AccompanyingCourseDocument.php | 2 ++ .../Entity/PersonDocument.php | 2 ++ .../Entity/StoredObject.php | 7 ++-- .../Form/AccompanyingCourseDocumentType.php | 2 ++ .../Form/CollectionStoredObjectType.php | 2 ++ .../DataMapper/StoredObjectDataMapper.php | 2 ++ .../StoredObjectDataTransformer.php | 2 ++ .../Form/DocumentCategoryType.php | 2 ++ .../Form/PersonDocumentType.php | 2 ++ .../Form/StoredObjectType.php | 2 ++ .../Form/Type/AsyncUploaderType.php | 3 ++ .../GenericDoc/FetchQuery.php | 13 ++++++++ .../GenericDoc/FetchQueryToSqlBuilder.php | 2 +- ...anyingCourseDocumentGenericDocProvider.php | 6 +++- .../PersonDocumentGenericDocProvider.php | 6 +++- ...anyingCourseDocumentGenericDocRenderer.php | 3 ++ .../GenericDoc/Twig/GenericDocExtension.php | 1 + .../Menu/AdminMenuBuilder.php | 2 ++ .../ChillDocStoreBundle/Menu/MenuBuilder.php | 2 ++ .../AccompanyingCourseDocumentRepository.php | 5 +++ .../Repository/DocumentCategoryRepository.php | 5 +++ .../PersonDocumentACLAwareRepository.php | 4 +++ .../Repository/PersonDocumentRepository.php | 5 +++ .../Repository/StoredObjectRepository.php | 5 +++ .../AccompanyingCourseDocumentVoter.php | 15 ++++++--- .../Authorization/AsyncUploadVoter.php | 4 ++- .../Authorization/PersonDocumentVoter.php | 15 ++++++--- .../Authorization/StoredObjectVoter.php | 2 ++ .../Security/Guard/DavOnUrlTokenExtractor.php | 1 + .../DavTokenAuthenticationEventSubscriber.php | 5 +-- .../Security/Guard/JWTDavTokenProvider.php | 2 ++ .../Guard/JWTOnDavUrlAuthenticator.php | 1 + .../Normalizer/StoredObjectDenormalizer.php | 2 ++ .../Normalizer/StoredObjectNormalizer.php | 6 ++-- .../Service/StoredObjectManager.php | 8 ++++- .../Templating/WopiEditTwigExtension.php | 2 ++ .../WopiEditTwigExtensionRuntime.php | 8 ++--- .../Templating/AsyncUploadExtensionTest.php | 1 + .../Tests/Controller/WebdavControllerTest.php | 7 ++++ .../Tests/Form/StoredObjectTypeTest.php | 1 + .../Tests/GenericDoc/ManagerTest.php | 5 +++ ...ngCourseDocumentGenericDocProviderTest.php | 1 + .../PersonDocumentGenericDocProviderTest.php | 1 + .../PersonDocumentACLAwareRepositoryTest.php | 1 + .../Normalizer/SignedUrlNormalizerTest.php | 1 + .../SignedUrlPostNormalizerTest.php | 1 + .../AsyncFileExistsValidatorTest.php | 1 + .../Validator/Constraints/AsyncFileExists.php | 2 ++ .../Constraints/AsyncFileExistsValidator.php | 1 + ...ompanyingCourseDocumentWorkflowHandler.php | 12 +++++++ .../migrations/Version20180605102533.php | 2 ++ .../migrations/Version20180606133338.php | 2 ++ .../migrations/Version20210903091534.php | 3 ++ .../migrations/Version20210903123835.php | 3 ++ .../migrations/Version20210928182542.php | 3 ++ .../migrations/Version20211119173558.php | 3 ++ .../migrations/Version20220131093117.php | 3 ++ .../migrations/Version20220525141646.php | 3 ++ .../migrations/Version20230227161327.php | 3 ++ .../migrations/Version20240322100107.php | 3 ++ .../DataFixtures/ORM/LoadEventTypes.php | 2 ++ .../DataFixtures/ORM/LoadParticipation.php | 2 ++ .../DataFixtures/ORM/LoadRolesACL.php | 2 ++ .../ChillEventExtension.php | 2 ++ .../DependencyInjection/Configuration.php | 1 + src/Bundle/ChillEventBundle/Entity/Event.php | 2 ++ .../ChillEventBundle/Entity/Participation.php | 6 ++++ .../Export/Aggregator/EventDateAggregator.php | 12 +++++-- .../Export/Aggregator/EventTypeAggregator.php | 10 +++++- .../Export/Aggregator/RoleAggregator.php | 10 +++++- .../Export/CountEventParticipations.php | 13 ++++++++ .../Export/Export/CountEvents.php | 13 ++++++++ .../Export/Filter/EventDateFilter.php | 7 ++++ .../Export/Filter/EventTypeFilter.php | 8 +++++ .../Export/Filter/RoleFilter.php | 8 +++++ .../Form/ChoiceLoader/EventChoiceLoader.php | 3 ++ .../ChillEventBundle/Form/EventType.php | 3 ++ .../ChillEventBundle/Form/EventTypeType.php | 3 ++ .../Form/ParticipationType.php | 2 ++ src/Bundle/ChillEventBundle/Form/RoleType.php | 3 ++ .../ChillEventBundle/Form/StatusType.php | 3 ++ .../Form/Type/PickEventType.php | 3 ++ .../Form/Type/PickEventTypeType.php | 2 ++ .../Form/Type/PickRoleType.php | 3 ++ .../Form/Type/PickStatusType.php | 3 ++ .../Menu/AdminMenuBuilder.php | 2 ++ .../Menu/PersonMenuBuilder.php | 2 ++ .../Menu/SectionMenuBuilder.php | 2 ++ .../Repository/EventACLAwareRepository.php | 2 ++ .../Repository/RoleRepository.php | 5 +++ .../ChillEventBundle/Search/EventSearch.php | 6 +++- .../ChillEventBundle/Security/EventVoter.php | 17 ++++++---- .../Security/ParticipationVoter.php | 17 ++++++---- .../Controller/EventListControllerTest.php | 1 + .../ParticipationControllerTest.php | 1 + .../Export/CountEventParticipationsTest.php | 1 + .../Tests/Export/CountEventTest.php | 1 + .../aggregators/EventDateAggregatorTest.php | 4 +++ .../aggregators/EventTypeAggregatorTest.php | 4 +++ .../Export/aggregators/RoleAggregatorTest.php | 4 +++ .../Export/filters/EventDateFilterTest.php | 4 +++ .../Export/filters/EventTypeFilterTest.php | 4 +++ .../Tests/Export/filters/RoleFilterTest.php | 4 +++ .../EventACLAwareRepositoryTest.php | 1 + .../Tests/Search/EventSearchTest.php | 2 ++ .../Timeline/TimelineEventProvider.php | 4 +++ .../migrations/Version20160318111334.php | 3 ++ .../migrations/Version20190110140538.php | 3 ++ .../migrations/Version20190115140042.php | 3 ++ .../migrations/Version20190201143121.php | 3 ++ .../migrations/Version20231127134244.php | 3 ++ .../migrations/Version20231128114959.php | 3 ++ .../migrations/Version20231128122635.php | 3 ++ .../ApiHelper/PartenaireRomeAppellation.php | 2 +- .../ChillFranceTravailApiExtension.php | 2 ++ .../src/DependencyInjection/Configuration.php | 1 + .../PartenaireRomeAppellationTest.php | 1 + .../src/Controller/CSCrudReportController.php | 4 +++ .../src/Controller/CSPersonController.php | 5 +++ .../src/Controller/CVCrudController.php | 2 ++ .../src/Controller/FreinCrudController.php | 1 + .../Controller/ImmersionCrudController.php | 3 ++ .../ProjetProfessionnelCrudController.php | 2 ++ .../DependencyInjection/ChillJobExtension.php | 2 ++ .../src/DependencyInjection/Configuration.php | 1 + src/Bundle/ChillJobBundle/src/Entity/CV.php | 1 + .../ChillJobBundle/src/Entity/Frein.php | 3 ++ .../ChillJobBundle/src/Entity/Immersion.php | 1 + .../src/Entity/ProjetProfessionnel.php | 1 + .../src/Entity/Rome/Appellation.php | 1 + .../Export/AddCSPersonToPersonListHelper.php | 5 ++- .../ChillJobBundle/src/Export/ListCV.php | 13 ++++++++ .../ChillJobBundle/src/Export/ListFrein.php | 13 ++++++++ .../src/Export/ListProjetProfessionnel.php | 13 ++++++++ .../src/Form/CSPersonDispositifsType.php | 3 ++ .../Form/CSPersonPersonalSituationType.php | 3 ++ .../src/Form/CV/ExperienceType.php | 3 ++ .../src/Form/CV/FormationType.php | 3 ++ src/Bundle/ChillJobBundle/src/Form/CVType.php | 3 ++ .../RomeAppellationChoiceLoader.php | 3 ++ .../ChillJobBundle/src/Form/FreinType.php | 3 ++ .../ChillJobBundle/src/Form/ImmersionType.php | 3 ++ .../src/Form/ProjetProfessionnelType.php | 3 ++ .../src/Form/Type/PickRomeAppellationType.php | 4 +++ .../ChillJobBundle/src/Menu/MenuBuilder.php | 2 ++ .../Authorization/ExportsJobVoter.php | 5 +++ .../src/Security/Authorization/JobVoter.php | 5 +++ .../src/ThirdParty/EntrepriseType.php | 1 + .../src/ThirdParty/PrescripteurType.php | 1 + .../src/migrations/Version20240424095147.php | 3 ++ .../src/migrations/Version20240424140641.php | 3 ++ .../src/migrations/Version20240429111628.php | 3 ++ .../migrations/old/Version20191119172511.php | 2 ++ .../migrations/old/Version20191129112321.php | 2 ++ .../migrations/old/Version20200113104411.php | 2 ++ .../migrations/old/Version20200113142525.php | 2 ++ .../migrations/old/Version20200114081435.php | 2 ++ .../migrations/old/Version20200124130244.php | 2 ++ .../migrations/old/Version20200124132321.php | 2 ++ .../migrations/old/Version20200127132932.php | 2 ++ .../migrations/old/Version20200205132532.php | 2 ++ .../migrations/old/Version20200207224152.php | 2 ++ .../migrations/old/Version20200210105342.php | 2 ++ .../migrations/old/Version20200313124323.php | 2 ++ .../migrations/old/Version20200403114520.php | 2 ++ .../migrations/old/Version20200403123148.php | 2 ++ .../CRUDControllerCompilerPass.php | 1 + .../Controller/AbstractCRUDController.php | 1 + .../CRUD/Controller/CRUDController.php | 1 + .../CRUD/Resolver/Resolver.php | 6 ++-- .../CRUD/Routing/CRUDRoutesLoader.php | 6 ++-- .../CRUD/Templating/TwigCRUDResolver.php | 1 + .../ChillMainBundle/ChillMainBundle.php | 1 + .../Command/ChillImportUsersCommand.php | 2 ++ .../ChillUserSendRenewPasswordCodeCommand.php | 2 ++ .../Command/ExecuteCronJobCommand.php | 2 ++ .../LoadAddressesBEFromBestAddressCommand.php | 2 ++ .../LoadAddressesFRFromBANOCommand.php | 2 ++ .../LoadAddressesLUFromBDAddressCommand.php | 2 ++ .../Command/LoadAndUpdateLanguagesCommand.php | 6 ++-- .../Command/LoadCountriesCommand.php | 2 ++ .../Command/LoadPostalCodeFR.php | 2 ++ .../Command/LoadPostalCodesCommand.php | 2 ++ .../Command/SetPasswordCommand.php | 2 ++ .../SynchronizeEntityInfoViewsCommand.php | 2 ++ .../AddressReferenceAPIController.php | 2 ++ .../Controller/CenterController.php | 1 + .../Controller/CivilityApiController.php | 1 + .../Controller/CivilityController.php | 1 + .../Controller/CountryController.php | 1 + .../Controller/LanguageController.php | 1 + .../Controller/LocationApiController.php | 2 ++ .../Controller/LocationController.php | 3 ++ .../Controller/LocationTypeApiController.php | 1 + .../Controller/NewsItemController.php | 1 + .../Controller/PostalCodeAPIController.php | 1 + .../Controller/RegroupmentController.php | 1 + .../Controller/ScopeApiController.php | 1 + .../Controller/UserApiController.php | 2 ++ .../Controller/UserController.php | 10 +++++- .../Controller/UserJobApiController.php | 1 + .../Controller/UserJobController.php | 1 + .../ChillMainBundle/Cron/CronManager.php | 9 ++--- .../ORM/LoadAddressReferences.php | 3 ++ .../DataFixtures/ORM/LoadCenters.php | 2 ++ .../DataFixtures/ORM/LoadCivility.php | 2 ++ .../DataFixtures/ORM/LoadCountries.php | 3 ++ .../DataFixtures/ORM/LoadGroupCenters.php | 2 ++ .../DataFixtures/ORM/LoadLanguages.php | 3 ++ .../DataFixtures/ORM/LoadLocationType.php | 3 ++ .../DataFixtures/ORM/LoadPermissionsGroup.php | 2 ++ .../DataFixtures/ORM/LoadPostalCodes.php | 2 ++ .../DataFixtures/ORM/LoadRoleScopes.php | 2 ++ .../DataFixtures/ORM/LoadScopes.php | 2 ++ .../DataFixtures/ORM/LoadUsers.php | 3 ++ .../ChillMainExtension.php | 5 +++ .../CompilerPass/ACLFlagsCompilerPass.php | 1 + .../CompilerPass/ExportsCompilerPass.php | 1 + .../CompilerPass/MenuCompilerPass.php | 1 + .../NotificationCounterCompilerPass.php | 1 + .../SearchableServicesCompilerPass.php | 1 + .../CompilerPass/ShortMessageCompilerPass.php | 1 + .../CompilerPass/TimelineCompilerClass.php | 1 + .../CompilerPass/WidgetsCompilerPass.php | 1 + .../ConfigConsistencyCompilerPass.php | 1 + .../DependencyInjection/Configuration.php | 1 + .../Widget/Factory/AbstractWidgetFactory.php | 1 + .../ChillMainBundle/Doctrine/DQL/Age.php | 2 ++ .../ChillMainBundle/Doctrine/DQL/Extract.php | 2 ++ .../Doctrine/DQL/GetJsonFieldByKey.php | 2 ++ .../ChillMainBundle/Doctrine/DQL/Greatest.php | 2 ++ .../Doctrine/DQL/JsonAggregate.php | 2 ++ .../Doctrine/DQL/JsonBuildObject.php | 2 ++ .../Doctrine/DQL/JsonExtract.php | 2 ++ .../Doctrine/DQL/JsonbArrayLength.php | 2 ++ .../Doctrine/DQL/JsonbExistsInArray.php | 2 ++ .../ChillMainBundle/Doctrine/DQL/Least.php | 2 ++ .../Doctrine/DQL/OverlapsI.php | 2 ++ .../ChillMainBundle/Doctrine/DQL/Replace.php | 2 ++ .../Doctrine/DQL/STContains.php | 2 ++ .../ChillMainBundle/Doctrine/DQL/STX.php | 2 ++ .../ChillMainBundle/Doctrine/DQL/STY.php | 2 ++ .../Doctrine/DQL/Similarity.php | 2 ++ .../Doctrine/DQL/StrictWordSimilarityOPS.php | 2 ++ .../ChillMainBundle/Doctrine/DQL/ToChar.php | 2 ++ .../ChillMainBundle/Doctrine/DQL/Unaccent.php | 2 ++ .../Event/TrackCreateUpdateSubscriber.php | 1 + .../Doctrine/Migrations/VersionComparator.php | 1 + .../ChillMainBundle/Doctrine/Model/Point.php | 1 + .../Hydration/FlatHierarchyEntityHydrator.php | 3 +- .../Doctrine/Type/NativeDateIntervalType.php | 4 +++ .../Doctrine/Type/PointType.php | 9 ++++- src/Bundle/ChillMainBundle/Entity/Address.php | 6 ++-- src/Bundle/ChillMainBundle/Entity/Center.php | 2 ++ .../Entity/CronJobExecution.php | 4 +-- .../ChillMainBundle/Entity/Location.php | 4 +++ .../ChillMainBundle/Entity/LocationType.php | 10 +++--- .../ChillMainBundle/Entity/Notification.php | 2 ++ .../Entity/NotificationComment.php | 4 +++ src/Bundle/ChillMainBundle/Entity/User.php | 6 ++++ .../Export/Formatter/CSVFormatter.php | 5 +++ .../Export/Formatter/CSVListFormatter.php | 5 +++ .../Formatter/CSVPivotedListFormatter.php | 5 +++ .../Export/Formatter/SpreadSheetFormatter.php | 5 +++ .../Formatter/SpreadsheetListFormatter.php | 5 +++ .../Export/Helper/ExportAddressHelper.php | 20 +++++------ .../ChillMainBundle/Form/AbsenceType.php | 2 ++ .../ChillMainBundle/Form/CenterType.php | 2 ++ .../ChoiceLoader/PostalCodeChoiceLoader.php | 3 ++ .../ChillMainBundle/Form/CivilityType.php | 2 ++ .../ChillMainBundle/Form/CountryType.php | 2 ++ .../Form/DataMapper/AddressDataMapper.php | 2 ++ .../DataMapper/ExportPickCenterDataMapper.php | 2 ++ .../DataMapper/PrivateCommentDataMapper.php | 2 ++ .../Form/DataMapper/RollingDateDataMapper.php | 2 ++ .../Form/DataMapper/ScopePickerDataMapper.php | 2 ++ .../IdToEntityDataTransformer.php | 2 ++ .../Form/EntityWorkflowCommentType.php | 1 + .../Form/Event/CustomizeFormEvent.php | 2 +- .../ChillMainBundle/Form/LanguageType.php | 2 ++ .../ChillMainBundle/Form/LocationFormType.php | 3 ++ .../ChillMainBundle/Form/LocationTypeType.php | 1 + .../ChillMainBundle/Form/NewsItemType.php | 2 ++ .../Form/NotificationCommentType.php | 1 + .../ChillMainBundle/Form/NotificationType.php | 2 ++ .../Form/PermissionsGroupType.php | 5 ++- .../ChillMainBundle/Form/RegroupmentType.php | 2 ++ .../ChillMainBundle/Form/SavedExportType.php | 2 ++ src/Bundle/ChillMainBundle/Form/ScopeType.php | 3 ++ .../Form/Type/AddressDateType.php | 2 ++ .../ChillMainBundle/Form/Type/AddressType.php | 2 ++ .../Form/Type/ChillCollectionType.php | 3 ++ .../Form/Type/ChillDateTimeType.php | 2 ++ .../Form/Type/ChillDateType.php | 2 ++ .../Form/Type/ChillPhoneNumberType.php | 2 ++ .../Form/Type/ChillTextareaType.php | 3 ++ .../ChillMainBundle/Form/Type/CommentType.php | 3 ++ .../Form/Type/ComposedGroupCenterType.php | 3 ++ .../Form/Type/ComposedRoleScopeType.php | 2 ++ .../AddressToIdDataTransformer.php | 2 ++ .../DataTransformer/CenterTransformer.php | 2 ++ .../DateIntervalTransformer.php | 2 ++ .../EntityToJsonTransformer.php | 2 ++ .../MultipleObjectsToIdTransformer.php | 2 ++ .../DataTransformer/ObjectToIdTransformer.php | 2 ++ .../PostalCodeToIdTransformer.php | 2 ++ .../Type/DataTransformer/ScopeTransformer.php | 2 ++ .../Form/Type/DateIntervalType.php | 2 ++ .../Form/Type/Export/AggregatorType.php | 2 ++ .../Form/Type/Export/ExportType.php | 11 ++++--- .../Form/Type/Export/FilterType.php | 4 ++- .../Form/Type/Export/FormatterType.php | 2 ++ .../Form/Type/Export/PickCenterType.php | 4 ++- .../Form/Type/Export/PickFormatterType.php | 2 ++ .../Form/Type/Listing/FilterOrderType.php | 3 ++ .../Form/Type/PickAddressType.php | 4 +++ .../Form/Type/PickCenterType.php | 3 ++ .../Form/Type/PickCivilityType.php | 2 ++ .../Form/Type/PickLocationTypeType.php | 2 ++ .../Form/Type/PickPostalCodeType.php | 3 ++ .../Form/Type/PickRollingDateType.php | 3 ++ .../Form/Type/PickUserDynamicType.php | 4 +++ .../Form/Type/PickUserLocationType.php | 2 ++ .../Form/Type/PostalCodeType.php | 3 ++ .../Form/Type/PrivateCommentType.php | 3 ++ .../Form/Type/ScopePickerType.php | 3 ++ .../Form/Type/Select2ChoiceType.php | 2 ++ .../Form/Type/Select2CountryType.php | 4 +++ .../Form/Type/Select2EntityType.php | 2 ++ .../Form/Type/Select2LanguageType.php | 4 +++ .../Form/Type/TranslatableStringFormType.php | 2 ++ .../Form/Type/UserPickerType.php | 2 ++ .../Form/UserCurrentLocationType.php | 1 + .../ChillMainBundle/Form/UserJobType.php | 1 + .../ChillMainBundle/Form/UserPasswordType.php | 3 ++ .../Form/UserPhonenumberType.php | 2 ++ src/Bundle/ChillMainBundle/Form/UserType.php | 3 ++ .../ChillMainBundle/Form/WorkflowStepType.php | 2 ++ .../Form/WorkflowTransitionType.php | 2 ++ .../Counter/NotificationByUserCounter.php | 1 + ...NotificationOnTerminateEventSubscriber.php | 1 + .../Notification/NotificationPersister.php | 2 ++ .../Templating/NotificationTwigExtension.php | 1 + .../Pagination/ChillItemsPerPageTwig.php | 1 + .../Pagination/ChillPaginationTwig.php | 5 +-- .../ChillMainBundle/Pagination/Page.php | 4 +++ .../Pagination/PageGenerator.php | 5 +++ .../ChillMainBundle/Pagination/Paginator.php | 15 +++++++++ .../Pagination/PaginatorFactory.php | 10 ++++-- .../Phonenumber/PhonenumberHelper.php | 10 ++++-- .../Phonenumber/Templating.php | 1 + .../Redis/RedisConnectionFactory.php | 1 + .../Repository/AddressReferenceRepository.php | 5 +++ .../Repository/AddressRepository.php | 5 +++ .../Repository/CenterRepository.php | 6 ++++ .../Repository/CivilityRepository.php | 5 +++ .../Repository/CountryRepository.php | 5 +++ .../Repository/CronJobExecutionRepository.php | 5 +++ .../GeographicalUnitLayerLayerRepository.php | 6 ++++ .../Repository/GeographicalUnitRepository.php | 7 ++++ .../Repository/GroupCenterRepository.php | 5 +++ .../Repository/LanguageRepository.php | 5 +++ .../Repository/NewsItemRepository.php | 5 +++ .../Repository/NotificationRepository.php | 7 +++- .../Repository/PermissionsGroupRepository.php | 5 +++ .../Repository/PostalCodeRepository.php | 7 ++++ .../Repository/RegroupmentRepository.php | 5 +++ .../Repository/RoleScopeRepository.php | 5 +++ .../Repository/SavedExportRepository.php | 6 ++++ .../Repository/ScopeRepository.php | 7 ++++ .../Repository/UserACLAwareRepository.php | 1 + .../Repository/UserJobRepository.php | 7 ++++ .../Repository/UserRepository.php | 18 +++++++++- .../Workflow/EntityWorkflowRepository.php | 5 +++ .../Workflow/EntityWorkflowStepRepository.php | 5 +++ .../Routing/Loader/ChillRoutesLoader.php | 2 ++ .../MenuBuilder/AdminLanguageMenuBuilder.php | 2 ++ .../MenuBuilder/AdminLocationMenuBuilder.php | 2 ++ .../MenuBuilder/AdminNewsMenuBuilder.php | 2 ++ .../MenuBuilder/AdminUserMenuBuilder.php | 2 ++ .../MenuBuilder/SectionMenuBuilder.php | 2 ++ .../Routing/MenuBuilder/UserMenuBuilder.php | 2 ++ .../ChillMainBundle/Routing/MenuTwig.php | 1 + .../Search/Entity/SearchUserApiProvider.php | 5 +++ .../Search/Utils/ExtractDateFromPattern.php | 2 +- .../Utils/ExtractPhonenumberFromPattern.php | 2 +- .../Authorization/AuthorizationHelper.php | 2 ++ .../AuthorizationHelperForCurrentUser.php | 2 ++ .../Authorization/ChillExportVoter.php | 4 ++- .../Authorization/DefaultVoterHelper.php | 2 ++ .../DefaultVoterHelperFactory.php | 1 + .../DefaultVoterHelperGenerator.php | 2 ++ .../Authorization/EntityWorkflowVoter.php | 10 +++--- .../Authorization/NotificationVoter.php | 12 ++++--- .../Authorization/SavedExportVoter.php | 10 +++--- .../WorkflowEntityDeletionVoter.php | 2 ++ .../Security/ChillSecurity.php | 1 + .../PasswordRecover/PasswordRecoverEvent.php | 6 ++-- .../PasswordRecoverEventSubscriber.php | 1 + .../PasswordRecover/PasswordRecoverLocker.php | 14 ++++---- .../PasswordRecover/PasswordRecoverVoter.php | 6 ++-- .../PasswordRecover/RecoverPasswordHelper.php | 2 +- .../Security/PasswordRecover/TokenManager.php | 10 +++--- .../Resolver/CenterResolverDispatcher.php | 1 + .../Resolver/CenterResolverManager.php | 1 + .../Resolver/DefaultCenterResolver.php | 3 ++ .../Resolver/DefaultScopeResolver.php | 4 +++ .../Resolver/ResolverTwigExtension.php | 1 + .../Security/UserProvider/UserProvider.php | 3 ++ .../Serializer/Model/Counter.php | 1 + .../Normalizer/AddressNormalizer.php | 6 ++-- .../Normalizer/CenterNormalizer.php | 4 +++ .../Normalizer/CollectionNormalizer.php | 2 ++ .../CommentEmbeddableDocGenNormalizer.php | 2 ++ .../Serializer/Normalizer/DateNormalizer.php | 4 +++ .../DiscriminatedObjectDenormalizer.php | 6 ++-- .../DoctrineExistingEntityNormalizer.php | 2 ++ .../Normalizer/EntityWorkflowNormalizer.php | 2 ++ .../EntityWorkflowStepNormalizer.php | 2 ++ .../Normalizer/NotificationNormalizer.php | 2 ++ .../Normalizer/PhonenumberNormalizer.php | 4 +++ .../Serializer/Normalizer/PointNormalizer.php | 2 ++ .../PrivateCommentEmbeddableNormalizer.php | 4 +++ .../Serializer/Normalizer/UserNormalizer.php | 6 ++-- ...ollateAddressWithReferenceOrPostalCode.php | 11 ++++--- ...ddressWithReferenceOrPostalCodeCronJob.php | 5 ++- ...eographicalUnitMaterializedViewCronJob.php | 3 ++ .../AddressReferenceBEFromBestAddress.php | 2 +- .../Import/AddressReferenceBaseImporter.php | 6 ++-- .../Service/Import/AddressReferenceLU.php | 2 +- .../Import/AddressToReferenceMatcher.php | 8 ++--- .../Import/GeographicalUnitBaseImporter.php | 6 ++-- .../Import/PostalCodeBEFromBestAddress.php | 2 +- .../Service/Import/PostalCodeBaseImporter.php | 4 +-- .../Import/PostalCodeFRFromOpenData.php | 2 +- .../Service/Mailer/ChillMailer.php | 1 + .../Service/RollingDate/RollingDate.php | 30 ++++++++--------- .../RollingDate/RollingDateConverter.php | 1 + .../ShortMessage/NullShortMessageSender.php | 1 + .../Service/ShortMessage/ShortMessage.php | 4 +-- .../ShortMessage/ShortMessageTransporter.php | 1 + .../ShortMessageOvh/OvhShortMessageSender.php | 1 + .../Templating/CSVCellTwig.php | 1 + .../ChillMarkdownRenderExtension.php | 1 + .../Templating/ChillTwigHelper.php | 1 + .../Templating/ChillTwigRoutingHelper.php | 2 ++ .../Templating/Entity/AddressRender.php | 5 ++- .../Templating/Entity/ChillEntityRender.php | 3 ++ .../Entity/ChillEntityRenderExtension.php | 1 + .../Templating/Entity/CommentRender.php | 3 ++ .../Templating/Entity/NewsItemRender.php | 3 ++ .../Templating/Entity/UserRender.php | 5 ++- .../Events/DelegatedBlockRenderingEvent.php | 4 +++ .../Templating/Listing/FilterOrderHelper.php | 2 +- .../Listing/FilterOrderHelperFactory.php | 1 + .../Templating/Listing/Templating.php | 1 + .../Templating/TranslatableStringHelper.php | 1 + .../Templating/TranslatableStringTwig.php | 1 + .../Templating/Widget/WidgetRenderingTwig.php | 1 + .../ChillMainBundle/Test/DummyPaginator.php | 4 +++ .../Test/Export/AbstractAggregatorTest.php | 1 + .../Test/Export/AbstractFilterTest.php | 2 ++ .../Authorization/ParentRoleHelperTest.php | 1 + .../Controller/AddressControllerTest.php | 1 + ...ddressToReferenceMatcherControllerTest.php | 1 + .../Controller/NewsItemControllerTest.php | 2 ++ .../NewsItemsHistoryControllerTest.php | 2 ++ .../NotificationApiControllerTest.php | 1 + .../PermissionApiControllerTest.php | 1 + .../Cron/CronJobDatabaseInteractionTest.php | 5 +++ .../Tests/Cron/CronManagerTest.php | 6 ++++ .../Tests/Doctrine/DQL/AgeTest.php | 1 + .../Tests/Doctrine/DQL/GreatestTest.php | 1 + .../Doctrine/DQL/JsonBuildObjectTest.php | 1 + .../Tests/Doctrine/DQL/JsonExtractTest.php | 1 + .../Doctrine/DQL/JsonbExistsInArrayTest.php | 1 + .../Tests/Doctrine/DQL/LeastTest.php | 1 + .../Tests/Entity/NotificationTest.php | 2 ++ .../AccompanyingCourseExportHelperTest.php | 2 ++ .../Tests/Export/ExportManagerTest.php | 21 ++++++++++++ .../Tests/Export/SortExportElementTest.php | 1 + .../Form/Type/PickPostalCodeTypeTest.php | 1 + .../Form/Type/PickRollingDateTypeTest.php | 1 + .../Tests/Form/Type/ScopePickerTypeTest.php | 1 + .../Tests/Pagination/PageTest.php | 1 + .../Tests/Pagination/PaginatorTest.php | 1 + .../Repository/NewsItemRepositoryTest.php | 2 ++ .../Tests/Routing/Loader/RouteLoaderTest.php | 1 + .../Tests/Search/AbstractSearchTest.php | 1 + .../Tests/Search/SearchProviderTest.php | 1 + .../Authorization/AuthorizationHelperTest.php | 1 + .../PasswordRecover/TokenManagerTest.php | 1 + .../Resolver/CenterResolverDispatcherTest.php | 1 + .../Resolver/DefaultScopeResolverTest.php | 1 + .../Resolver/ScopeResolverDispatcherTest.php | 1 + .../Normalizer/DateNormalizerTest.php | 1 + .../DoctrineExistingEntityNormalizerTest.php | 1 + ...teAddressWithReferenceOrPostalCodeTest.php | 1 + .../AddressReferenceBaseImporterTest.php | 1 + .../Import/AddressToReferenceMatcherTest.php | 1 + .../GeographicalUnitBaseImporterTest.php | 1 + .../Import/PostalCodeBaseImporterTest.php | 1 + .../Tests/Services/MenuComposerTest.php | 1 + .../RollingDate/RollingDateConverterTest.php | 1 + .../ChillMarkdownRenderExtensionTest.php | 8 ++--- .../Templating/Entity/AddressRenderTest.php | 1 + .../Constraint/PhonenumberConstraint.php | 1 + .../RoleScopeScopePresenceConstraint.php | 2 ++ .../UserUniqueEmailAndUsernameConstraint.php | 2 ++ .../Validator/RoleScopeScopePresence.php | 1 + .../Validator/UserUniqueEmailAndUsername.php | 1 + .../Validation/Validator/ValidPhonenumber.php | 1 + .../Entity/UserCircleConsistency.php | 3 ++ .../Entity/UserCircleConsistencyValidator.php | 1 + .../Export/ExportElementConstraint.php | 3 ++ .../ExportElementConstraintValidator.php | 1 + .../Counter/WorkflowByUserCounter.php | 2 ++ ...ntityWorkflowTransitionEventSubscriber.php | 1 + .../NotificationOnTransition.php | 1 + .../WorkflowNotificationHandler.php | 3 ++ .../RelatedEntityWorkflowSupportsStrategy.php | 1 + .../Templating/WorkflowTwigExtension.php | 1 + .../Validator/EntityWorkflowCreation.php | 1 + .../EntityWorkflowCreationValidator.php | 1 + .../Workflow/Validator/StepDestValid.php | 1 + .../Validator/StepDestValidValidator.php | 1 + .../migrations/Version20100000000000.php | 2 ++ .../migrations/Version20141128194409.php | 2 ++ .../migrations/Version20150821105642.php | 2 ++ .../migrations/Version20150821122935.php | 2 ++ .../migrations/Version20160310122322.php | 2 ++ .../migrations/Version20180703191509.php | 2 ++ .../migrations/Version20180709181423.php | 2 ++ .../migrations/Version20180905101426.php | 2 ++ .../migrations/Version20180911093642.php | 2 ++ .../migrations/Version20200422122715.php | 2 ++ .../migrations/Version20210304085819.php | 3 ++ .../migrations/Version20210308111926.php | 3 ++ .../migrations/Version20210414091001.php | 3 ++ .../migrations/Version20210420115006.php | 3 ++ .../migrations/Version20210503085107.php | 3 ++ .../migrations/Version20210505153727.php | 3 ++ .../migrations/Version20210525144016.php | 3 ++ .../migrations/Version20210528090000.php | 3 ++ .../migrations/Version20210610140248.php | 3 ++ .../migrations/Version20210616134328.php | 3 ++ .../migrations/Version20210903144853.php | 3 ++ .../migrations/Version20210929192242.php | 3 ++ .../migrations/Version20211006151653.php | 3 ++ .../migrations/Version20211007150019.php | 3 ++ .../migrations/Version20211012141336.php | 3 ++ .../migrations/Version20211013124455.php | 3 ++ .../migrations/Version20211015084653.php | 3 ++ .../migrations/Version20211022094429.php | 3 ++ .../migrations/Version20211116162847.php | 3 ++ .../migrations/Version20211119173554.php | 3 ++ .../migrations/Version20211123093355.php | 3 ++ .../migrations/Version20211125142016.php | 3 ++ .../migrations/Version20211125142017.php | 3 ++ .../migrations/Version20211213112628.php | 3 ++ .../migrations/Version20211216213649.php | 3 ++ .../migrations/Version20211225231532.php | 3 ++ .../migrations/Version20211228183221.php | 3 ++ .../migrations/Version20211228215919.php | 3 ++ .../migrations/Version20211229140308.php | 3 ++ .../migrations/Version20211230003532.php | 3 ++ .../migrations/Version20220112123436.php | 3 ++ .../migrations/Version20220112150413.php | 3 ++ .../migrations/Version20220112161136.php | 3 ++ .../migrations/Version20220114132105.php | 3 ++ .../migrations/Version20220114165950.php | 3 ++ .../migrations/Version20220120155303.php | 3 ++ .../migrations/Version20220124085957.php | 3 ++ .../migrations/Version20220125134253.php | 3 ++ .../migrations/Version20220128211748.php | 3 ++ .../migrations/Version20220217133607.php | 3 ++ .../migrations/Version20220223171457.php | 3 ++ .../migrations/Version20220302132728.php | 3 ++ .../migrations/Version20220325134944.php | 3 ++ .../migrations/Version20220413154743.php | 3 ++ .../migrations/Version20220413225830.php | 3 ++ .../migrations/Version20220413230159.php | 3 ++ .../migrations/Version20220506131307.php | 3 ++ .../migrations/Version20220506145935.php | 3 ++ .../migrations/Version20220506223243.php | 3 ++ .../migrations/Version20220513151853.php | 3 ++ .../migrations/Version20220516085659.php | 3 ++ .../migrations/Version20220711150006.php | 3 ++ .../migrations/Version20220729205416.php | 3 ++ .../migrations/Version20220730204216.php | 3 ++ .../migrations/Version20220829132409.php | 3 ++ .../migrations/Version20220913174922.php | 3 ++ .../migrations/Version20221003112151.php | 3 ++ .../migrations/Version20221003132620.php | 3 ++ .../migrations/Version20221010142417.php | 3 ++ .../migrations/Version20221107212201.php | 3 ++ .../migrations/Version20221114105345.php | 3 ++ .../migrations/Version20221212163734.php | 3 ++ .../migrations/Version20230111104315.php | 3 ++ .../migrations/Version20230111160610.php | 3 ++ .../migrations/Version20230301155213.php | 3 ++ .../migrations/Version20230306142148.php | 3 ++ .../migrations/Version20230306145728.php | 3 ++ .../migrations/Version20230306151218.php | 3 ++ .../migrations/Version20230321134155.php | 3 ++ .../migrations/Version20230711152947.php | 3 ++ .../migrations/Version20230906134410.php | 3 ++ .../migrations/Version20230913114115.php | 3 ++ .../migrations/Version20231020075524.php | 3 ++ .../migrations/Version20231108141141.php | 3 ++ .../PersonAddressMoveEventSubscriber.php | 1 + .../Events/UserRefEventSubscriber.php | 1 + .../AccompanyingPeriodStepChangeCronjob.php | 3 ++ ...mpanyingPeriodStepChangeMessageHandler.php | 2 +- .../AccompanyingPeriodStepChanger.php | 2 +- .../Suggestion/ReferralsSuggestion.php | 2 ++ .../ChillPersonBundle/Actions/ActionEvent.php | 4 +-- ...AccompanyingPeriodParticipationHandler.php | 2 ++ .../PersonMoveCenterHistoryHandler.php | 2 ++ .../Handler/PersonMoveHouseholdHandler.php | 2 ++ .../Handler/PersonMoveRelationHandler.php | 2 ++ .../Controller/EntityPersonCRUDController.php | 5 +++ .../OneToOneEntityPersonCRUDController.php | 4 +++ .../ChillPersonBundle/ChillPersonBundle.php | 1 + .../Command/ChillPersonMoveCommand.php | 3 ++ .../Command/ImportSocialWorkMetadata.php | 2 ++ ...emoveOldDraftAccompanyingPeriodCommand.php | 2 ++ .../AccompanyingCourseApiController.php | 2 ++ .../AccompanyingCourseWorkApiController.php | 1 + .../Controller/ClosingMotiveController.php | 2 ++ .../HouseholdCompositionTypeApiController.php | 1 + .../HouseholdCompositionTypeController.php | 1 + .../HouseholdPositionController.php | 1 + .../Controller/MaritalStatusController.php | 1 + .../Controller/OpeningApiController.php | 1 + .../Controller/OriginController.php | 1 + .../PersonResourceKindController.php | 1 + .../Controller/RelationController.php | 1 + .../Controller/SocialIssueApiController.php | 2 ++ .../SocialWork/EvaluationController.php | 1 + .../Controller/SocialWork/GoalController.php | 1 + .../SocialWork/ResultController.php | 1 + .../SocialWork/SocialActionController.php | 1 + .../SocialWork/SocialIssueController.php | 2 ++ .../LoadAccompanyingPeriodClosingMotive.php | 2 ++ .../LoadAccompanyingPeriodNotifications.php | 1 + .../ORM/LoadAccompanyingPeriodOrigin.php | 4 ++- .../ORM/LoadAccompanyingPeriodWork.php | 2 ++ .../DataFixtures/ORM/LoadCustomFields.php | 2 ++ .../DataFixtures/ORM/LoadHousehold.php | 4 ++- .../ORM/LoadHouseholdCompositionType.php | 4 ++- .../ORM/LoadHouseholdPosition.php | 9 ++--- .../DataFixtures/ORM/LoadMaritalStatus.php | 2 ++ .../DataFixtures/ORM/LoadPeople.php | 4 ++- .../DataFixtures/ORM/LoadPersonACL.php | 2 ++ .../DataFixtures/ORM/LoadRelations.php | 6 ++-- .../DataFixtures/ORM/LoadRelationships.php | 2 ++ .../ORM/LoadSocialWorkMetadata.php | 2 ++ .../ChillPersonExtension.php | 2 ++ ...AccompanyingPeriodTimelineCompilerPass.php | 1 + .../DependencyInjection/Configuration.php | 1 + .../Doctrine/DQL/AddressPart.php | 2 ++ .../DQL/AddressPart/AddressPartAddressId.php | 1 + .../AddressPart/AddressPartCountryCode.php | 1 + .../DQL/AddressPart/AddressPartCountryId.php | 1 + .../AddressPart/AddressPartCountryName.php | 1 + .../AddressPart/AddressPartIsNoAddress.php | 1 + .../AddressPart/AddressPartPostCodeCode.php | 1 + .../DQL/AddressPart/AddressPartPostCodeId.php | 1 + .../AddressPart/AddressPartPostCodeLabel.php | 1 + .../AddressPart/AddressPartStreetAddress1.php | 1 + .../AddressPart/AddressPartStreetAddress2.php | 1 + .../DQL/AddressPart/AddressPartValidFrom.php | 1 + .../Entity/AccompanyingPeriod.php | 23 ++++++++----- .../AccompanyingPeriodWork.php | 7 ++++ .../AccompanyingPeriodWorkEvaluation.php | 4 +++ .../Entity/AccompanyingPeriod/Comment.php | 4 +++ .../Entity/Household/Household.php | 1 + .../ChillPersonBundle/Entity/Person.php | 18 ++++++---- .../Event/Person/PersonAddressMoveEvent.php | 2 +- .../AdministrativeLocationAggregator.php | 8 +++++ .../ByActionNumberAggregator.php | 8 +++++ .../ClosingDateAggregator.php | 10 +++++- .../ClosingMotiveAggregator.php | 8 +++++ .../ConfidentialAggregator.php | 8 +++++ .../CreatorJobAggregator.php | 10 +++++- .../DurationAggregator.php | 10 +++++- .../EmergencyAggregator.php | 8 +++++ .../EvaluationAggregator.php | 8 +++++ .../GeographicalUnitStatAggregator.php | 8 +++++ .../IntensityAggregator.php | 8 +++++ .../JobWorkingOnCourseAggregator.php | 10 +++++- .../OpeningDateAggregator.php | 10 +++++- .../OriginAggregator.php | 8 +++++ .../PersonParticipatingAggregator.php | 10 +++++- .../ReferrerAggregator.php | 13 ++++++-- .../ReferrerScopeAggregator.php | 11 ++++++- .../RequestorAggregator.php | 8 +++++ .../ScopeAggregator.php | 8 +++++ .../ScopeWorkingOnCourseAggregator.php | 10 +++++- .../SocialActionAggregator.php | 8 +++++ .../SocialIssueAggregator.php | 8 +++++ .../StepAggregator.php | 12 +++++-- .../UserJobAggregator.php | 11 ++++++- .../UserWorkingOnCourseAggregator.php | 10 +++++- .../ByClosingMotiveAggregator.php | 10 +++++- .../ByDateAggregator.php | 10 +++++- .../ByStepAggregator.php | 10 +++++- .../ByEndDateAggregator.php | 12 +++++-- .../ByMaxDateAggregator.php | 12 +++++-- .../ByStartDateAggregator.php | 12 +++++-- .../EvaluationTypeAggregator.php | 8 +++++ .../HavingEndDateAggregator.php | 8 +++++ .../ChildrenNumberAggregator.php | 8 +++++ .../CompositionAggregator.php | 8 +++++ .../PersonAggregators/AgeAggregator.php | 9 +++++ .../ByHouseholdCompositionAggregator.php | 10 +++++- .../PersonAggregators/CenterAggregator.php | 10 +++++- .../CountryOfBirthAggregator.php | 9 +++++ .../PersonAggregators/GenderAggregator.php | 8 +++++ .../GeographicalUnitAggregator.php | 8 +++++ .../HouseholdPositionAggregator.php | 9 +++++ .../MaritalStatusAggregator.php | 8 +++++ .../NationalityAggregator.php | 9 +++++ .../PostalCodeAggregator.php | 10 +++++- .../ActionTypeAggregator.php | 8 +++++ .../CreatorAggregator.php | 10 +++++- .../CreatorJobAggregator.php | 10 +++++- .../CreatorScopeAggregator.php | 10 +++++- .../CurrentActionAggregator.php | 8 +++++ .../SocialWorkAggregators/GoalAggregator.php | 8 +++++ .../GoalResultAggregator.php | 8 +++++ .../HandlingThirdPartyAggregator.php | 10 +++++- .../SocialWorkAggregators/JobAggregator.php | 10 +++++- .../ReferrerAggregator.php | 10 +++++- .../ResultAggregator.php | 8 +++++ .../SocialWorkAggregators/ScopeAggregator.php | 10 +++++- ...rkPersonAssociatedOnAccompanyingPeriod.php | 13 ++++++++ ...vgDurationAPWorkPersonAssociatedOnWork.php | 13 ++++++++ .../Export/Export/CountAccompanyingCourse.php | 13 ++++++++ .../CountAccompanyingCourseStepHistory.php | 13 ++++++++ ...orkAssociatePersonOnAccompanyingPeriod.php | 13 ++++++++ ...panyingPeriodWorkAssociatePersonOnWork.php | 13 ++++++++ .../Export/Export/CountEvaluation.php | 13 ++++++++ .../Export/Export/CountHouseholdInPeriod.php | 15 ++++++++- .../Export/Export/CountPerson.php | 13 ++++++++ ...panyingPeriodWorkAssociatePersonOnWork.php | 13 ++++++++ .../CountPersonWithAccompanyingCourse.php | 13 ++++++++ .../Export/Export/ListAccompanyingPeriod.php | 13 ++++++++ ...orkAssociatePersonOnAccompanyingPeriod.php | 15 ++++++++- ...panyingPeriodWorkAssociatePersonOnWork.php | 15 ++++++++- .../Export/Export/ListEvaluation.php | 15 ++++++++- .../Export/Export/ListHouseholdInPeriod.php | 15 ++++++++- .../Export/Export/ListPerson.php | 13 ++++++++ .../Export/Export/ListPersonDuplicate.php | 10 +++++- .../ListPersonHavingAccompanyingPeriod.php | 13 ++++++++ ...istPersonWithAccompanyingPeriodDetails.php | 13 ++++++++ .../Export/StatAccompanyingCourseDuration.php | 13 ++++++++ .../ActiveOnDateFilter.php | 7 ++++ .../ActiveOneDayBetweenDatesFilter.php | 7 ++++ .../AdministrativeLocationFilter.php | 7 ++++ .../ClosingMotiveFilter.php | 7 ++++ .../ConfidentialFilter.php | 11 +++++-- .../CreatorFilter.php | 7 ++++ .../CreatorJobFilter.php | 9 ++++- .../EmergencyFilter.php | 11 +++++-- .../EvaluationFilter.php | 7 ++++ .../GeographicalUnitStatFilter.php | 7 ++++ .../HandlingThirdPartyFilter.php | 9 ++++- .../HasNoActionFilter.php | 7 ++++ .../HasNoReferrerFilter.php | 7 ++++ .../HasTemporaryLocationFilter.php | 7 ++++ ...ccompanyingPeriodInfoWithinDatesFilter.php | 7 ++++ .../IntensityFilter.php | 11 +++++-- .../JobWorkingOnCourseFilter.php | 9 ++++- ...tAssociatedWithAReferenceAddressFilter.php | 7 ++++ .../OpenBetweenDatesFilter.php | 7 ++++ .../OriginFilter.php | 7 ++++ .../ReferrerFilter.php | 13 ++++++-- .../ReferrerFilterBetweenDates.php | 15 ++++++--- .../RequestorFilter.php | 11 +++++-- .../ScopeWorkingOnCourseFilter.php | 9 ++++- .../SocialActionFilter.php | 9 ++++- .../SocialIssueFilter.php | 7 ++++ .../StepFilterBetweenDates.php | 11 +++++-- .../StepFilterOnDate.php | 15 ++++++--- .../UserJobFilter.php | 10 +++++- .../UserScopeFilter.php | 10 +++++- .../UserWorkingOnCourseFilter.php | 7 ++++ .../ByDateFilter.php | 7 ++++ .../ByStepFilter.php | 7 ++++ .../EvaluationFilters/ByEndDateFilter.php | 7 ++++ .../EvaluationFilters/ByStartDateFilter.php | 7 ++++ .../CurrentEvaluationsFilter.php | 7 ++++ .../EvaluationTypeFilter.php | 7 ++++ .../EvaluationFilters/MaxDateFilter.php | 9 ++++- .../HouseholdFilters/CompositionFilter.php | 7 ++++ .../PersonFilters/AddressRefStatusFilter.php | 7 ++++ .../Export/Filter/PersonFilters/AgeFilter.php | 8 +++++ .../Filter/PersonFilters/BirthdateFilter.php | 8 +++++ .../ByHouseholdCompositionFilter.php | 7 ++++ .../PersonFilters/DeadOrAliveFilter.php | 7 ++++ .../Filter/PersonFilters/DeathdateFilter.php | 8 +++++ .../Filter/PersonFilters/GenderFilter.php | 8 +++++ .../PersonFilters/GeographicalUnitFilter.php | 7 ++++ .../PersonFilters/MaritalStatusFilter.php | 7 ++++ .../PersonFilters/NationalityFilter.php | 8 +++++ .../ResidentialAddressAtThirdpartyFilter.php | 7 ++++ .../ResidentialAddressAtUserFilter.php | 7 ++++ .../WithParticipationBetweenDatesFilter.php | 7 ++++ .../WithoutHouseholdComposition.php | 7 ++++ ...yingPeriodWorkEndDateBetweenDateFilter.php | 7 ++++ ...ngPeriodWorkStartDateBetweenDateFilter.php | 7 ++++ ...odWorkWithEvaluationBetweenDatesFilter.php | 7 ++++ .../SocialWorkFilters/CreatorFilter.php | 9 ++++- .../SocialWorkFilters/CreatorJobFilter.php | 9 ++++- .../SocialWorkFilters/CreatorScopeFilter.php | 9 ++++- .../SocialWorkFilters/CurrentActionFilter.php | 7 ++++ .../Filter/SocialWorkFilters/JobFilter.php | 9 ++++- .../SocialWorkFilters/ReferrerFilter.php | 9 ++++- .../Filter/SocialWorkFilters/ScopeFilter.php | 9 ++++- .../SocialWorkTypeFilter.php | 7 ++++ .../FilterListAccompanyingPeriodHelper.php | 1 + .../Helper/ListAccompanyingPeriodHelper.php | 2 +- .../Export/Helper/ListPersonHelper.php | 2 +- .../Form/AccompanyingCourseCommentType.php | 2 ++ .../Form/AccompanyingCourseType.php | 1 + .../Form/AccompanyingPeriodType.php | 4 +++ .../Form/ChoiceLoader/PersonChoiceLoader.php | 3 ++ .../Form/ClosingMotiveType.php | 2 ++ .../Form/CreationPersonType.php | 5 ++- .../DataMapper/PersonAltNameDataMapper.php | 2 ++ .../Form/HouseholdCompositionType.php | 1 + .../Form/HouseholdCompositionTypeType.php | 2 ++ .../Form/HouseholdMemberType.php | 1 + .../Form/HouseholdPositionType.php | 2 ++ .../ChillPersonBundle/Form/HouseholdType.php | 2 ++ .../Form/MaritalStatusType.php | 2 ++ .../ChillPersonBundle/Form/OriginType.php | 2 ++ .../Form/PersonConfimDuplicateType.php | 2 ++ .../Form/PersonFindManuallyDuplicateType.php | 2 ++ .../Form/PersonResourceKindType.php | 2 ++ .../Form/PersonResourceType.php | 3 ++ .../ChillPersonBundle/Form/PersonType.php | 3 ++ .../ChillPersonBundle/Form/RelationType.php | 2 ++ .../Form/ResidentialAddressType.php | 2 ++ .../Form/SocialWork/EvaluationType.php | 2 ++ .../Form/SocialWork/GoalType.php | 2 ++ .../Form/SocialWork/ResultType.php | 2 ++ .../Form/SocialWork/SocialActionType.php | 2 ++ .../Form/SocialWork/SocialIssueType.php | 2 ++ .../Form/Type/ClosingMotivePickerType.php | 3 ++ .../Form/Type/GenderType.php | 2 ++ .../Form/Type/PersonAltNameType.php | 2 ++ .../Form/Type/PersonPhoneType.php | 2 ++ .../Form/Type/PickPersonDynamicType.php | 4 +++ .../Form/Type/PickPersonType.php | 3 ++ .../Form/Type/PickSocialActionType.php | 2 ++ .../Form/Type/PickSocialIssueType.php | 2 ++ .../Form/Type/Select2MaritalStatusType.php | 4 +++ .../Household/MembersEditor.php | 6 ++-- .../Menu/AccompanyingCourseMenuBuilder.php | 2 ++ .../AdminAccompanyingCourseMenuBuilder.php | 2 ++ .../Menu/AdminHouseholdMenuBuilder.php | 2 ++ .../Menu/AdminPersonMenuBuilder.php | 2 ++ .../Menu/AdminSocialWorkMenuBuilder.php | 2 ++ .../Menu/HouseholdMenuBuilder.php | 2 ++ .../Menu/PersonMenuBuilder.php | 2 ++ .../Menu/PersonQuickMenuBuilder.php | 2 ++ .../Menu/SectionMenuBuilder.php | 2 ++ .../Menu/UserMenuBuilder.php | 2 ++ .../AccompanyingPeriodNotificationHandler.php | 3 ++ ...kEvaluationDocumentNotificationHandler.php | 3 ++ ...ompanyingPeriodWorkNotificationHandler.php | 3 ++ .../AccompanyingPeriodPrivacyEvent.php | 2 +- .../Privacy/PrivacyEvent.php | 2 +- .../Privacy/PrivacyEventSubscriber.php | 1 + .../AccompanyingPeriodInfoRepository.php | 7 ++++ ...PeriodWorkEvaluationDocumentRepository.php | 5 +++ ...mpanyingPeriodWorkEvaluationRepository.php | 5 +++ .../AccompanyingPeriodWorkRepository.php | 5 +++ .../ClosingMotiveRepository.php | 6 ++++ .../AccompanyingPeriodACLAwareRepository.php | 5 +++ .../AccompanyingPeriodRepository.php | 5 +++ .../Household/HouseholdACLAwareRepository.php | 2 ++ .../HouseholdCompositionRepository.php | 7 ++++ .../HouseholdCompositionTypeRepository.php | 6 ++++ .../Household/HouseholdRepository.php | 7 +++- .../PersonHouseholdAddressRepository.php | 5 +++ .../Household/PositionRepository.php | 5 +++ .../Repository/MaritalStatusRepository.php | 5 +++ .../Person/PersonCenterHistoryRepository.php | 5 +++ .../Repository/PersonACLAwareRepository.php | 3 ++ .../Repository/PersonRepository.php | 5 +++ .../Repository/PersonResourceRepository.php | 5 +++ .../Relationships/RelationRepository.php | 5 +++ .../Relationships/RelationshipRepository.php | 5 +++ .../SocialWork/EvaluationRepository.php | 6 ++++ .../Repository/SocialWork/GoalRepository.php | 5 +++ .../SocialWork/ResultRepository.php | 5 +++ .../SocialWork/SocialActionRepository.php | 5 +++ .../SocialWork/SocialIssueRepository.php | 5 +++ .../ChillPersonBundle/Search/PersonSearch.php | 12 +++++-- .../Search/SearchHouseholdApiProvider.php | 5 +++ .../Search/SearchPersonApiProvider.php | 5 +++ .../Search/SimilarPersonMatcher.php | 4 +-- .../AccompanyingPeriodCommentVoter.php | 6 ++-- .../AccompanyingPeriodResourceVoter.php | 4 ++- .../Authorization/AccompanyingPeriodVoter.php | 33 +++++++++++-------- ...nyingPeriodWorkEvaluationDocumentVoter.php | 4 ++- .../AccompanyingPeriodWorkEvaluationVoter.php | 8 +++-- .../AccompanyingPeriodWorkVoter.php | 15 ++++++--- .../Security/Authorization/HouseholdVoter.php | 15 ++++++--- .../Security/Authorization/PersonVoter.php | 17 ++++++---- .../AuthorizedCenterOnPersonCreation.php | 1 + .../AccompanyingPeriodDocGenNormalizer.php | 6 ++-- .../AccompanyingPeriodOriginNormalizer.php | 2 ++ ...ompanyingPeriodParticipationNormalizer.php | 3 ++ .../AccompanyingPeriodResourceNormalizer.php | 2 ++ .../AccompanyingPeriodWorkDenormalizer.php | 6 ++-- ...anyingPeriodWorkEvaluationDenormalizer.php | 2 ++ ...PeriodWorkEvaluationDocumentNormalizer.php | 4 ++- ...mpanyingPeriodWorkEvaluationNormalizer.php | 4 ++- .../AccompanyingPeriodWorkNormalizer.php | 4 ++- .../Normalizer/MembersEditorNormalizer.php | 2 ++ .../Normalizer/PersonDocGenNormalizer.php | 4 ++- .../Normalizer/PersonJsonNormalizer.php | 4 +++ .../RelationshipDocGenNormalizer.php | 2 ++ .../Normalizer/SocialActionNormalizer.php | 2 ++ .../Normalizer/SocialIssueNormalizer.php | 2 ++ .../Normalizer/WorkflowNormalizer.php | 4 ++- .../OldDraftAccompanyingPeriodRemover.php | 1 + .../AccompanyingPeriodContext.php | 15 +++++++++ .../AccompanyingPeriodWorkContext.php | 11 +++++++ ...ccompanyingPeriodWorkEvaluationContext.php | 15 +++++++++ .../Service/DocGenerator/PersonContext.php | 15 +++++++++ .../PersonContextWithThirdParty.php | 15 +++++++++ .../AccompanyingPeriodInfoQueryBuilder.php | 2 +- ...tartQueryPartForAccompanyingPeriodInfo.php | 9 +++++ ...kEndQueryPartForAccompanyingPeriodInfo.php | 9 +++++ ...tionQueryPartForAccompanyingPeriodInfo.php | 9 +++++ ...dateQueryPartForAccompanyingPeriodInfo.php | 9 +++++ ...nMaxQueryPartForAccompanyingPeriodInfo.php | 9 +++++ ...tartQueryPartForAccompanyingPeriodInfo.php | 9 +++++ ...dateQueryPartForAccompanyingPeriodInfo.php | 9 +++++ ...rrerQueryPartForAccompanyingPeriodInfo.php | 9 +++++ ...tartQueryPartForAccompanyingPeriodInfo.php | 9 +++++ ...companyingPeriodViewEntityInfoProvider.php | 2 ++ ...PeriodWorkEvaluationGenericDocProvider.php | 6 +++- ...PeriodWorkEvaluationGenericDocRenderer.php | 3 ++ .../Service/Import/SocialWorkMetadata.php | 1 + .../Templating/Entity/ClosingMotiveRender.php | 5 ++- .../Templating/Entity/PersonRender.php | 3 ++ .../Templating/Entity/ResourceKindRender.php | 3 ++ .../Templating/Entity/SocialActionRender.php | 13 +++++--- .../Templating/Entity/SocialIssueRender.php | 11 ++++--- .../AccompanyingPeriodConfidentialTest.php | 2 ++ .../Tests/Action/Remove/PersonMoveTest.php | 2 ++ .../ConflictTest.php | 2 ++ .../AccompanyingCourseApiControllerTest.php | 1 + .../AccompanyingCourseControllerTest.php | 2 ++ .../AccompanyingPeriodControllerTest.php | 9 +++-- .../Controller/HouseholdControllerTest.php | 2 ++ .../PersonAddressControllerTest.php | 2 ++ .../Controller/PersonControllerCreateTest.php | 16 +++++---- .../Controller/PersonControllerUpdateTest.php | 3 ++ ...onControllerUpdateWithHiddenFieldsTest.php | 2 ++ .../Controller/PersonControllerViewTest.php | 2 ++ ...rsonControllerViewWithHiddenFieldsTest.php | 2 ++ .../RelationshipApiControllerTest.php | 1 + .../SocialIssueApiControllerTest.php | 1 + .../SocialWorkEvaluationApiControllerTest.php | 1 + .../AdministrativeLocationAggregatorTest.php | 4 +++ .../ClosingDateAggregatorTest.php | 4 +++ .../ClosingMotiveAggregatorTest.php | 4 +++ .../ConfidentialAggregatorTest.php | 4 +++ .../DurationAggregatorTest.php | 4 +++ .../EmergencyAggregatorTest.php | 4 +++ .../EvaluationAggregatorTest.php | 4 +++ .../GeographicalUnitStatAggregatorTest.php | 4 +++ .../IntensityAggregatorTest.php | 4 +++ .../OpeningDateAggregatorTest.php | 4 +++ .../OriginAggregatorTest.php | 4 +++ .../PersonParticipatingAggregatorTest.php | 4 +++ .../ReferrerAggregatorTest.php | 4 +++ .../ReferrerScopeAggregatorTest.php | 3 ++ .../RequestorAggregatorTest.php | 4 +++ .../ScopeAggregatorTest.php | 4 +++ .../SocialActionAggregatorTest.php | 4 +++ .../SocialIssueAggregatorTest.php | 4 +++ .../StepAggregatorTest.php | 4 +++ .../UserJobAggregatorTest.php | 4 +++ .../ByClosingMotiveAggregatorTest.php | 4 +++ .../ByDateAggregatorTest.php | 3 ++ .../ByStepAggregatorTest.php | 3 ++ .../EvaluationTypeAggregatorTest.php | 4 +++ .../ChildrenNumberAggregatorTest.php | 4 +++ .../CompositionAggregatorTest.php | 4 +++ .../PersonAggregators/AgeAggregatorTest.php | 4 +++ .../CountryOfBirthAggregatorTest.php | 4 +++ .../GenderAggregatorTest.php | 4 +++ .../HouseholdPositionAggregatorTest.php | 4 +++ .../MaritalStatusAggregatorTest.php | 4 +++ .../NationalityAggregatorTest.php | 4 +++ .../PostalCodeAggregatorTest.php | 4 +++ .../ActionTypeAggregatorTest.php | 4 +++ .../CreatorAggregatorTest.php | 4 +++ .../CreatorJobAggregatorTest.php | 4 +++ .../CreatorScopeAggregatorTest.php | 4 +++ .../GoalAggregatorTest.php | 4 +++ .../GoalResultAggregatorTest.php | 4 +++ .../HandlingThirdPartyAggregatorTest.php | 4 +++ .../JobAggregatorTest.php | 4 +++ .../ReferrerAggregatorTest.php | 4 +++ .../ResultAggregatorTest.php | 4 +++ .../ScopeAggregatorTest.php | 4 +++ ...rsonAssociatedOnAccompanyingPeriodTest.php | 4 +++ ...rationAPWorkPersonAssociatedOnWorkTest.php | 4 +++ ...CountAccompanyingCourseStepHistoryTest.php | 4 +++ .../Export/CountAccompanyingCourseTest.php | 4 +++ ...ssociatePersonOnAccompanyingPeriodTest.php | 4 +++ ...ingPeriodWorkAssociatePersonOnWorkTest.php | 4 +++ .../Export/CountHouseholdInPeriodTest.php | 4 +++ ...ingPeriodWorkAssociatePersonOnWorkTest.php | 4 +++ .../Tests/Export/Export/CountPersonTest.php | 4 +++ .../CountPersonWithAccompanyingCourseTest.php | 4 +++ .../Export/ListAccompanyingPeriodTest.php | 4 +++ ...ssociatePersonOnAccompanyingPeriodTest.php | 4 +++ ...ingPeriodWorkAssociatePersonOnWorkTest.php | 4 +++ .../Export/Export/ListEvaluationTest.php | 4 +++ .../Export/ListHouseholdInPeriodTest.php | 4 +++ ...ListPersonHavingAccompanyingPeriodTest.php | 4 +++ .../Tests/Export/Export/ListPersonTest.php | 4 +++ ...ersonWithAccompanyingPeriodDetailsTest.php | 4 +++ .../StatAccompanyingCourseDurationTest.php | 4 +++ .../ActiveOnDateFilterTest.php | 4 +++ .../ActiveOneDayBetweenDatesFilterTest.php | 4 +++ .../AdministrativeLocationFilterTest.php | 4 +++ .../ClosingMotiveFilterTest.php | 4 +++ .../ConfidentialFilterTest.php | 4 +++ .../EmergencyFilterTest.php | 4 +++ .../EvaluationFilterTest.php | 4 +++ .../GeographicalUnitStatFilterTest.php | 4 +++ .../HasTemporaryLocationFilterTest.php | 4 +++ .../IntensityFilterTest.php | 4 +++ ...ociatedWithAReferenceAddressFilterTest.php | 3 ++ .../OpenBetweenDatesFilterTest.php | 4 +++ .../OriginFilterTest.php | 4 +++ .../ReferrerFilterBetweenDatesTest.php | 4 +++ .../ReferrerFilterTest.php | 4 +++ .../RequestorFilterTest.php | 4 +++ .../SocialActionFilterTest.php | 4 +++ .../SocialIssueFilterTest.php | 4 +++ .../StepFilterTest.php | 4 +++ .../UserJobFilterTest.php | 4 +++ .../UserScopeFilterTest.php | 4 +++ .../ByDateFilterTest.php | 4 +++ .../ByStepFilterTest.php | 3 ++ .../EvaluationTypeFilterTest.php | 4 +++ .../EvaluationFilters/MaxDateFilterTest.php | 4 +++ .../CompositionFilterTest.php | 4 +++ .../Filter/PersonFilters/AgeFilterTest.php | 4 +++ .../PersonFilters/BirthdateFilterTest.php | 4 +++ .../PersonFilters/DeadOrAliveFilterTest.php | 4 +++ .../PersonFilters/DeathdateFilterTest.php | 4 +++ .../Filter/PersonFilters/GenderFilterTest.php | 4 +++ .../PersonFilters/MaritalStatusFilterTest.php | 4 +++ .../PersonFilters/NationalityFilterTest.php | 4 +++ ...sidentialAddressAtThirdpartyFilterTest.php | 4 +++ .../ResidentialAddressAtUserFilterTest.php | 4 +++ ...ithParticipationBetweenDatesFilterTest.php | 4 +++ .../SocialWorkFilters/CreatorFilterTest.php | 4 +++ .../CreatorJobFilterTest.php | 4 +++ .../CreatorScopeFilterTest.php | 4 +++ .../HandlingThirdPartyFilterTest.php | 4 +++ .../SocialWorkFilters/JobFilterTest.php | 4 +++ .../SocialWorkFilters/ReferrerFilterTest.php | 4 +++ .../SocialWorkFilters/ScopeFilterTest.php | 4 +++ .../WithEvaluationBetweenDatesFilterTest.php | 4 +++ ...FilterListAccompanyingPeriodHelperTest.php | 1 + .../Tests/Form/Type/PickPersonTypeTest.php | 1 + .../Tests/Household/MembersEditorTest.php | 1 + ...companyingPeriodACLAwareRepositoryTest.php | 2 ++ .../PersonACLAwareRepositoryTest.php | 1 + .../Tests/Repository/UserRepositoryTest.php | 1 + .../Tests/Search/PersonSearchTest.php | 1 + .../Authorization/PersonVoterTest.php | 1 + ...AccompanyingPeriodDocGenNormalizerTest.php | 1 + ...AccompanyingPeriodOriginNormalizerTest.php | 1 + ...companyingPeriodResourceNormalizerTest.php | 1 + ...mpanyingPeriodWorkDocGenNormalizerTest.php | 4 +++ ...ngPeriodWorkEvaluationDenormalizerTest.php | 2 +- .../Normalizer/HouseholdNormalizerTest.php | 1 + .../Normalizer/PersonDocGenNormalizerTest.php | 3 +- .../Normalizer/PersonJsonNormalizerTest.php | 1 + .../Normalizer/ResourceJsonNormalizerTest.php | 1 + .../Normalizer/SocialActionNormalizerTest.php | 1 + .../Normalizer/SocialIssueNormalizerTest.php | 1 + .../AccompanyingPeriodContextTest.php | 1 + ...ngPeriodCalendarGenericDocProviderTest.php | 1 + ...odWorkEvaluationGenericDocProviderTest.php | 1 + .../PersonCalendarGenericDocProviderTest.php | 1 + .../Entity/ClosingMotiveRenderTest.php | 1 + .../Tests/Validation/PersonValidationTest.php | 1 + .../LocationValidityValidatorTest.php | 1 + .../ParticipationOverlapValidatorTest.php | 1 + ...eholdMembershipSequentialValidatorTest.php | 1 + .../Household/MaxHolderValidatorTest.php | 1 + .../Person/BirthdateValidatorTest.php | 1 + .../Person/PersonHasCenterValidatorTest.php | 1 + .../Validator/Person/PersonValidationTest.php | 1 + .../Workflows/AccompanyingPeriodLifecycle.php | 1 + .../AbstractTimelineAccompanyingPeriod.php | 1 + .../TimelineAccompanyingPeriodClosing.php | 4 +++ .../TimelineAccompanyingPeriodOpening.php | 3 ++ .../AccompanyingPeriodValidity.php | 1 + .../AccompanyingPeriodValidityValidator.php | 1 + .../ConfidentialCourseMustHaveReferrer.php | 1 + ...dentialCourseMustHaveReferrerValidator.php | 1 + .../AccompanyingPeriod/LocationValidity.php | 1 + .../LocationValidityValidator.php | 1 + .../ParticipationOverlapValidator.php | 3 +- .../ResourceDuplicateCheckValidator.php | 1 + .../HouseholdMembershipSequential.php | 1 + ...HouseholdMembershipSequentialValidator.php | 1 + .../Constraints/Household/MaxHolder.php | 1 + .../Household/MaxHolderValidator.php | 3 +- .../Constraints/Person/Birthdate.php | 2 +- .../Constraints/Person/BirthdateValidator.php | 1 + .../Constraints/Person/PersonHasCenter.php | 1 + .../Person/PersonHasCenterValidator.php | 1 + .../Relationship/RelationshipNoDuplicate.php | 1 + .../RelationshipNoDuplicateValidator.php | 1 + .../Widget/AddAPersonWidget.php | 1 + .../Widget/PersonListWidget.php | 1 + .../Widget/PersonListWidgetFactory.php | 3 ++ ...dWorkEvaluationDocumentWorkflowHandler.php | 12 +++++++ ...ingPeriodWorkEvaluationWorkflowHandler.php | 12 +++++++ .../AccompanyingPeriodWorkWorkflowHandler.php | 12 +++++++ .../migrations/Version20141129010948.php | 2 ++ .../migrations/Version20150212173934.php | 2 ++ .../migrations/Version20150607231010.php | 3 ++ .../migrations/Version20150811152608.php | 2 ++ .../migrations/Version20150812110708.php | 2 ++ .../migrations/Version20150820113409.php | 2 ++ .../migrations/Version20160310161006.php | 2 ++ .../migrations/Version20160422000000.php | 2 ++ .../migrations/Version20160818113633.php | 2 ++ .../migrations/Version20160818151130.php | 2 ++ .../migrations/Version20170117131924.php | 2 ++ .../migrations/Version20180518144221.php | 2 ++ .../migrations/Version20180820120000.php | 2 ++ .../migrations/Version20181005140249.php | 2 ++ .../migrations/Version20181023101621.php | 2 ++ .../migrations/Version20190701124238.php | 2 ++ .../migrations/Version20191106103452.php | 2 ++ .../migrations/Version20200128084445.php | 2 ++ .../migrations/Version20200130213446.php | 12 ++++--- .../migrations/Version20200310090632.php | 2 ++ .../migrations/Version20200422125935.php | 2 ++ .../migrations/Version20210128152747.php | 3 ++ .../migrations/Version20210318095831.php | 3 ++ .../migrations/Version20210325141540.php | 3 ++ .../migrations/Version20210326113045.php | 3 ++ .../migrations/Version20210329090904.php | 3 ++ .../migrations/Version20210329113152.php | 3 ++ .../migrations/Version20210329144338.php | 3 ++ .../migrations/Version20210330164922.php | 3 ++ .../migrations/Version20210331084527.php | 3 ++ .../migrations/Version20210419105054.php | 3 ++ .../migrations/Version20210419105940.php | 3 ++ .../migrations/Version20210419112619.php | 3 ++ .../migrations/Version20210426145930.php | 3 ++ .../migrations/Version20210427125700.php | 3 ++ .../migrations/Version20210505093408.php | 3 ++ .../migrations/Version20210505154316.php | 3 ++ .../migrations/Version20210518075908.php | 3 ++ .../migrations/Version20210518162439.php | 3 ++ .../migrations/Version20210519204938.php | 3 ++ .../migrations/Version20210525211214.php | 3 ++ .../migrations/Version20210528092625.php | 3 ++ .../migrations/Version20210528111624.php | 3 ++ .../migrations/Version20210528132405.php | 3 ++ .../migrations/Version20210528142121.php | 3 ++ .../migrations/Version20210614191600.php | 3 ++ .../migrations/Version20210615074857.php | 3 ++ .../migrations/Version20210616102900.php | 3 ++ .../migrations/Version20210617073504.php | 3 ++ .../migrations/Version20210618080702.php | 3 ++ .../migrations/Version20210620143757.php | 3 ++ .../migrations/Version20210623135043.php | 3 ++ .../migrations/Version20210623142046.php | 3 ++ .../migrations/Version20210624131722.php | 3 ++ .../migrations/Version20210624131723.php | 3 ++ .../migrations/Version20210727152826.php | 3 ++ .../migrations/Version20210729163023.php | 3 ++ .../migrations/Version20210730094514.php | 3 ++ .../migrations/Version20210730205407.php | 3 ++ .../migrations/Version20210802202838.php | 3 ++ .../migrations/Version20210820093927.php | 3 ++ .../migrations/Version20210820100407.php | 3 ++ .../migrations/Version20210831140339.php | 3 ++ .../migrations/Version20210910161858.php | 3 ++ .../migrations/Version20210915093624.php | 3 ++ .../migrations/Version20211020131133.php | 3 ++ .../migrations/Version20211021125359.php | 3 ++ .../migrations/Version20211025141226.php | 3 ++ .../migrations/Version20211029075117.php | 3 ++ .../migrations/Version20211108100849.php | 3 ++ .../migrations/Version20211112170027.php | 3 ++ .../migrations/Version20211119211101.php | 3 ++ .../migrations/Version20211119215630.php | 3 ++ .../migrations/Version20211213150253.php | 3 ++ .../migrations/Version20211213203147.php | 3 ++ .../migrations/Version20211213213755.php | 3 ++ .../migrations/Version20211216154008.php | 3 ++ .../migrations/Version20211223150721.php | 3 ++ .../migrations/Version20220104133334.php | 3 ++ .../migrations/Version20220119091025.php | 3 ++ .../migrations/Version20220119155944.php | 3 ++ .../migrations/Version20220121121310.php | 3 ++ .../migrations/Version20220128133039.php | 3 ++ .../migrations/Version20220214200327.php | 3 ++ .../migrations/Version20220215135509.php | 3 ++ .../migrations/Version20220224145951.php | 3 ++ .../migrations/Version20220303113855.php | 3 ++ .../migrations/Version20220310063629.php | 3 ++ .../migrations/Version20220310124318.php | 3 ++ .../migrations/Version20220425000000.php | 3 ++ .../migrations/Version20220427150431.php | 3 ++ .../migrations/Version20220429133023.php | 3 ++ .../migrations/Version20220527124737.php | 3 ++ .../migrations/Version20220926154347.php | 3 ++ .../migrations/Version20221013131221.php | 3 ++ .../migrations/Version20221014115500.php | 3 ++ .../migrations/Version20230117152610.php | 3 ++ .../migrations/Version20230210104424.php | 3 ++ .../migrations/Version20230427102309.php | 3 ++ .../migrations/Version20230627130331.php | 3 ++ .../migrations/Version20230628152138.php | 3 ++ .../migrations/Version20230918115305.php | 3 ++ .../migrations/Version20231002094521.php | 3 ++ .../migrations/Version20231004142738.php | 3 ++ .../migrations/Version20231121070151.php | 3 ++ .../migrations/Version20231128143534.php | 3 ++ .../migrations/Version20231129113816.php | 3 ++ .../migrations/Version20231207221700.php | 3 ++ .../migrations/Version20240123161457.php | 3 ++ .../DataFixtures/ORM/LoadCustomField.php | 2 ++ .../ORM/LoadCustomFieldsGroup.php | 2 ++ .../DataFixtures/ORM/LoadReportACL.php | 2 ++ .../DataFixtures/ORM/LoadReports.php | 2 ++ .../ChillReportExtension.php | 2 ++ .../DependencyInjection/Configuration.php | 1 + .../ChillReportBundle/Entity/Report.php | 2 ++ .../Export/Export/ReportList.php | 13 ++++++++ .../Export/Export/ReportListProvider.php | 1 + .../Export/Filter/ReportDateFilter.php | 7 ++++ .../ChillReportBundle/Form/ReportType.php | 3 ++ .../Security/Authorization/ReportVoter.php | 13 +++++--- .../Controller/ReportControllerNextTest.php | 1 + .../Tests/Controller/ReportControllerTest.php | 4 ++- .../Export/Filter/ReportDateFilterTest.php | 4 +++ .../Authorization/ReportVoterTest.php | 2 ++ .../Tests/Timeline/TimelineProviderTest.php | 2 ++ .../Timeline/TimelineReportProvider.php | 4 +++ .../migrations/Version20141129012050.php | 2 ++ .../migrations/Version20150622233319.php | 3 ++ .../ChillTaskBundle/ChillTaskBundle.php | 1 + .../DataFixtures/ORM/LoadTaskACL.php | 2 ++ .../ChillTaskExtension.php | 2 ++ .../TaskWorkflowDefinitionCompilerPass.php | 1 + .../DependencyInjection/Configuration.php | 1 + .../ChillTaskBundle/Entity/AbstractTask.php | 2 ++ .../Event/Lifecycle/TaskLifecycleEvent.php | 1 + .../ChillTaskBundle/Event/TaskEvent.php | 2 +- .../ChillTaskBundle/Event/UI/UIEvent.php | 6 ++-- .../Form/SingleTaskListType.php | 2 ++ .../ChillTaskBundle/Form/SingleTaskType.php | 2 ++ .../ChillTaskBundle/Menu/MenuBuilder.php | 2 ++ .../Menu/SectionMenuBuilder.php | 2 ++ .../ChillTaskBundle/Menu/UserMenuBuilder.php | 2 ++ .../SingleTaskAclAwareRepository.php | 8 +++++ .../Repository/SingleTaskRepository.php | 10 +++--- .../Repository/SingleTaskStateRepository.php | 2 +- .../Authorization/AuthorizationEvent.php | 2 +- .../Security/Authorization/TaskVoter.php | 17 ++++++---- .../Templating/TaskTwigExtension.php | 1 + .../Templating/UI/CountNotificationTask.php | 3 +- .../Controller/SingleTaskControllerTest.php | 1 + .../SingleTaskACLAwareRepositoryTest.php | 1 + ...TaskTaskLifeCycleEventTimelineProvider.php | 6 +++- .../TaskLifeCycleEventTimelineProvider.php | 6 +++- .../Definition/DefaultTaskDefinition.php | 4 +-- .../Workflow/Event/DefaultTaskGuardEvent.php | 1 + .../Workflow/TaskWorkflowManager.php | 1 + .../migrations/Version20180413135614.php | 2 ++ .../migrations/Version20180413201023.php | 2 ++ .../migrations/Version20180426093011.php | 2 ++ .../migrations/Version20180502194119.php | 2 ++ .../migrations/Version20181113161925.php | 2 ++ .../migrations/Version20181113164108.php | 2 ++ .../migrations/Version20210909153533.php | 3 ++ .../migrations/Version20211029213909.php | 3 ++ .../ChillThirdPartyBundle.php | 1 + .../ThirdPartyCategoryController.php | 1 + .../Controller/ThirdPartyController.php | 7 ++++ .../DataFixtures/ORM/LoadThirdParty.php | 2 ++ .../ORM/LoadThirdPartyCategory.php | 2 ++ .../ORM/LoadThirdPartyProfession.php | 2 ++ .../ChillThirdPartyExtension.php | 2 ++ .../ThirdPartyTypeCompilerPass.php | 3 +- .../DependencyInjection/Configuration.php | 1 + .../Entity/ThirdParty.php | 11 +++++-- .../ChoiceLoader/ThirdPartyChoiceLoader.php | 3 ++ .../Form/ThirdPartyCategoryType.php | 2 ++ .../Form/ThirdPartyType.php | 2 ++ .../Form/Type/PickThirdPartyType.php | 3 ++ .../Type/PickThirdPartyTypeCategoryType.php | 4 ++- .../Form/Type/PickThirdpartyDynamicType.php | 4 +++ .../Menu/AdminMenuBuilder.php | 2 ++ .../Menu/MenuBuilder.php | 2 ++ .../ThirdPartyACLAwareRepository.php | 2 ++ .../Repository/ThirdPartyRepository.php | 5 +++ .../Search/ThirdPartyApiSearch.php | 5 +++ .../Search/ThirdPartySearch.php | 6 +++- .../Security/Voter/ThirdPartyVoter.php | 11 +++++-- .../Normalizer/ThirdPartyNormalizer.php | 2 ++ .../Templating/Entity/ThirdPartyRender.php | 3 ++ .../ThirdPartyDocGenNormalizerTest.php | 1 + .../ThirdPartyJsonDenormalizerTest.php | 1 + .../ThirdPartyType/ThirdPartyTypeManager.php | 2 +- .../migrations/Version20190307111314.php | 2 ++ .../migrations/Version20190307131650.php | 2 ++ .../migrations/Version20190418090842.php | 2 ++ .../migrations/Version20190429171109.php | 2 ++ .../migrations/Version20190502144206.php | 2 ++ .../migrations/Version20210525211216.php | 3 ++ .../migrations/Version20210719105918.php | 3 ++ .../migrations/Version20211006200924.php | 3 ++ .../migrations/Version20211007150459.php | 3 ++ .../migrations/Version20211007165001.php | 3 ++ .../migrations/Version20211007194942.php | 3 ++ .../migrations/Version20220302143821.php | 3 ++ .../migrations/Version20220322095659.php | 3 ++ .../migrations/Version20220324175549.php | 3 ++ .../migrations/Version20230215175150.php | 3 ++ .../src/Controller/Convert.php | 2 +- .../ChillWopiExtension.php | 1 + .../src/DependencyInjection/Configuration.php | 1 + .../src/Service/Controller/Responder.php | 5 +++ .../src/Service/Wopi/AuthorizationManager.php | 9 +++++ .../Service/Wopi/ChillDocumentLockManager.php | 6 +++- .../src/Service/Wopi/ChillDocumentManager.php | 18 ++++++++++ .../src/Service/Wopi/ChillWopi.php | 14 ++++++++ .../src/Service/Wopi/UserManager.php | 3 ++ .../Wopi/ChillDocumentLockManagerTest.php | 1 + 1806 files changed, 6843 insertions(+), 568 deletions(-) diff --git a/composer.json b/composer.json index 026034121..f08279242 100644 --- a/composer.json +++ b/composer.json @@ -8,7 +8,7 @@ "social worker" ], "require": { - "php": "^8.2", + "php": "^8.3", "ext-dom": "*", "ext-json": "*", "ext-openssl": "*", @@ -152,5 +152,11 @@ "cache:clear": "symfony-cmd" }, "php-cs-fixer": "php-cs-fixer fix --config=./.php-cs-fixer.dist.php --show-progress=none" + }, + "extra": { + "symfony": { + "allow-contrib": false, + "require": "5.4.*" + } } } diff --git a/docs/source/_static/code/exports/BirthdateFilter.php b/docs/source/_static/code/exports/BirthdateFilter.php index fca768ab3..512f8fa7f 100644 --- a/docs/source/_static/code/exports/BirthdateFilter.php +++ b/docs/source/_static/code/exports/BirthdateFilter.php @@ -21,6 +21,7 @@ use Symfony\Component\Validator\Context\ExecutionContextInterface; class BirthdateFilter implements ExportElementValidatedInterface, FilterInterface { // add specific role for this filter + #[\Override] public function addRole(): ?string { // we do not need any new role for this filter, so we return null @@ -28,6 +29,7 @@ class BirthdateFilter implements ExportElementValidatedInterface, FilterInterfac } // here, we alter the query created by Export + #[\Override] public function alterQuery(\Doctrine\ORM\QueryBuilder $qb, $data) { $where = $qb->getDQLPart('where'); @@ -52,12 +54,14 @@ class BirthdateFilter implements ExportElementValidatedInterface, FilterInterfac } // we give information on which type of export this filter applies + #[\Override] public function applyOn() { return 'person'; } // we build a form to collect some parameters from the users + #[\Override] public function buildForm(\Symfony\Component\Form\FormBuilderInterface $builder) { $builder->add('date_from', DateType::class, [ @@ -74,6 +78,7 @@ class BirthdateFilter implements ExportElementValidatedInterface, FilterInterfac 'format' => 'dd-MM-yyyy', ]); } + #[\Override] public function getFormDefaultData(): array { return ['date_from' => new DateTime(), 'date_to' => new DateTime()]; @@ -81,6 +86,7 @@ class BirthdateFilter implements ExportElementValidatedInterface, FilterInterfac // here, we create a simple string which will describe the action of // the filter in the Response + #[\Override] public function describeAction($data, $format = 'string') { return ['Filtered by person\'s birtdate: ' @@ -90,6 +96,7 @@ class BirthdateFilter implements ExportElementValidatedInterface, FilterInterfac ], ]; } + #[\Override] public function getTitle() { return 'Filter by person\'s birthdate'; @@ -99,6 +106,7 @@ class BirthdateFilter implements ExportElementValidatedInterface, FilterInterfac // is executed here. This function is added by the interface // `ExportElementValidatedInterface`, and can be ignore if there is // no need for a validation + #[\Override] public function validateForm($data, ExecutionContextInterface $context) { $date_from = $data['date_from']; diff --git a/docs/source/_static/code/exports/CountPerson.php b/docs/source/_static/code/exports/CountPerson.php index a0f6931ac..3ebf5692e 100644 --- a/docs/source/_static/code/exports/CountPerson.php +++ b/docs/source/_static/code/exports/CountPerson.php @@ -32,25 +32,30 @@ class CountPerson implements ExportInterface $this->entityManager = $em; } + #[\Override] public function buildForm(FormBuilderInterface $builder) { // this export does not add any form } + #[\Override] public function getFormDefaultData(): array { return []; } + #[\Override] public function getAllowedFormattersTypes() { return [FormatterInterface::TYPE_TABULAR]; } + #[\Override] public function getDescription() { return 'Count peoples by various parameters.'; } + #[\Override] public function getLabels($key, array $values, $data) { // the Closure which will be executed by the formatter. @@ -60,6 +65,7 @@ class CountPerson implements ExportInterface }; } + #[\Override] public function getQueryKeys($data) { // this array match the result keys in the query. We have only @@ -67,21 +73,25 @@ class CountPerson implements ExportInterface return ['export_result']; } + #[\Override] public function getResult($query, $data) { return $query->getQuery()->getResult(Query::HYDRATE_SCALAR); } + #[\Override] public function getTitle() { return 'Count peoples'; } + #[\Override] public function getType() { return Declarations::PERSON_TYPE; } + #[\Override] public function initiateQuery(array $requiredModifiers, array $acl, array $data = []) { // we gather all center the user choose. @@ -98,11 +108,13 @@ class CountPerson implements ExportInterface return $qb; } + #[\Override] public function requiredRole(): string { return PersonVoter::STATS; } + #[\Override] public function supportsModifiers() { // explain the export manager which formatters and filters are allowed diff --git a/docs/source/development/user-interface/widgets/ChillMainConfiguration.php b/docs/source/development/user-interface/widgets/ChillMainConfiguration.php index c3a90dfee..01c775f2c 100644 --- a/docs/source/development/user-interface/widgets/ChillMainConfiguration.php +++ b/docs/source/development/user-interface/widgets/ChillMainConfiguration.php @@ -31,6 +31,7 @@ class ChillMainConfiguration implements ConfigurationInterface $this->setWidgetFactories($widgetFactories); } + #[\Override] public function getConfigTreeBuilder() { $treeBuilder = new TreeBuilder('chill_main'); diff --git a/docs/source/development/user-interface/widgets/ChillMainExtension.php b/docs/source/development/user-interface/widgets/ChillMainExtension.php index cadc560e9..7254df706 100644 --- a/docs/source/development/user-interface/widgets/ChillMainExtension.php +++ b/docs/source/development/user-interface/widgets/ChillMainExtension.php @@ -27,11 +27,13 @@ class ChillMainExtension extends Extension implements Widget\HasWidgetFactoriesE */ protected $widgetFactories = []; + #[\Override] public function addWidgetFactory(WidgetFactoryInterface $factory) { $this->widgetFactories[] = $factory; } + #[\Override] public function getConfiguration(array $config, ContainerBuilder $container) { return new Configuration($this->widgetFactories, $container); @@ -40,11 +42,13 @@ class ChillMainExtension extends Extension implements Widget\HasWidgetFactoriesE /** * @return WidgetFactoryInterface[] */ + #[\Override] public function getWidgetFactories() { return $this->widgetFactories; } + #[\Override] public function load(array $configs, ContainerBuilder $container) { // configuration for main bundle diff --git a/docs/source/development/user-interface/widgets/ChillPersonAddAPersonListWidgetFactory.php b/docs/source/development/user-interface/widgets/ChillPersonAddAPersonListWidgetFactory.php index 2859a12c2..cb386d90f 100644 --- a/docs/source/development/user-interface/widgets/ChillPersonAddAPersonListWidgetFactory.php +++ b/docs/source/development/user-interface/widgets/ChillPersonAddAPersonListWidgetFactory.php @@ -25,6 +25,7 @@ class ChillPersonAddAPersonListWidgetFactory extends AbstractWidgetFactory * see http://symfony.com/doc/current/components/config/definition.html * */ + #[\Override] public function configureOptions($place, NodeBuilder $node) { $node->booleanNode('only_active') @@ -56,6 +57,7 @@ class ChillPersonAddAPersonListWidgetFactory extends AbstractWidgetFactory * the service must exists in the container, and it is not required that the service * has the `chill_main` tag. */ + #[\Override] public function getServiceId(ContainerBuilder $containerBuilder, $place, $order, array $config) { return 'chill_person.widget.person_list'; @@ -66,6 +68,7 @@ class ChillPersonAddAPersonListWidgetFactory extends AbstractWidgetFactory * * @return string */ + #[\Override] public function getWidgetAlias() { return 'person_list'; diff --git a/docs/source/development/user-interface/widgets/ChillPersonAddAPersonWidget.php b/docs/source/development/user-interface/widgets/ChillPersonAddAPersonWidget.php index 0c3f2c182..793461d9f 100644 --- a/docs/source/development/user-interface/widgets/ChillPersonAddAPersonWidget.php +++ b/docs/source/development/user-interface/widgets/ChillPersonAddAPersonWidget.php @@ -79,6 +79,7 @@ class ChillPersonAddAPersonWidget implements WidgetInterface * * @return string */ + #[\Override] public function render(Twig_Environment $env, $place, array $context, array $config) { $qb = $this->personRepository diff --git a/docs/source/development/user-interface/widgets/ChillPersonExtension.php b/docs/source/development/user-interface/widgets/ChillPersonExtension.php index efb2b0e66..e25c169a0 100644 --- a/docs/source/development/user-interface/widgets/ChillPersonExtension.php +++ b/docs/source/development/user-interface/widgets/ChillPersonExtension.php @@ -22,6 +22,7 @@ use Symfony\Component\HttpKernel\DependencyInjection\Extension; */ class ChillPersonExtension extends Extension implements PrependExtensionInterface { + #[\Override] public function load(array $configs, ContainerBuilder $container) { // ... @@ -32,6 +33,7 @@ class ChillPersonExtension extends Extension implements PrependExtensionInterfac * * @param \Chill\PersonBundle\DependencyInjection\containerBuilder $container */ + #[\Override] public function prepend(ContainerBuilder $container) { $container->prependExtensionConfig('chill_main', [ diff --git a/rector.php b/rector.php index 4b38affb3..68cfd0bfe 100644 --- a/rector.php +++ b/rector.php @@ -39,12 +39,17 @@ return static function (RectorConfig $rectorConfig): void { //define sets of rules $rectorConfig->sets([ - LevelSetList::UP_TO_PHP_82, + LevelSetList::UP_TO_PHP_83, \Rector\Symfony\Set\SymfonySetList::SYMFONY_40, \Rector\Symfony\Set\SymfonySetList::SYMFONY_41, \Rector\Symfony\Set\SymfonySetList::SYMFONY_42, \Rector\Symfony\Set\SymfonySetList::SYMFONY_43, \Rector\Symfony\Set\SymfonySetList::SYMFONY_44, +// \Rector\Symfony\Set\SymfonySetList::SYMFONY_50, +// \Rector\Symfony\Set\SymfonySetList::SYMFONY_51, +// \Rector\Symfony\Set\SymfonySetList::SYMFONY_52, +// \Rector\Symfony\Set\SymfonySetList::SYMFONY_53, +// \Rector\Symfony\Set\SymfonySetList::SYMFONY_54, \Rector\Doctrine\Set\DoctrineSetList::DOCTRINE_CODE_QUALITY, \Rector\PHPUnit\Set\PHPUnitSetList::PHPUNIT_90, ]); diff --git a/src/Bundle/ChillActivityBundle/Controller/AdminActivityPresenceController.php b/src/Bundle/ChillActivityBundle/Controller/AdminActivityPresenceController.php index 8a1ccda44..9e2969ce2 100644 --- a/src/Bundle/ChillActivityBundle/Controller/AdminActivityPresenceController.php +++ b/src/Bundle/ChillActivityBundle/Controller/AdminActivityPresenceController.php @@ -22,6 +22,7 @@ class AdminActivityPresenceController extends CRUDController * * @return \Doctrine\ORM\QueryBuilder|mixed */ + #[\Override] protected function orderQuery(string $action, $query, Request $request, PaginatorInterface $paginator) { /* @var \Doctrine\ORM\QueryBuilder $query */ diff --git a/src/Bundle/ChillActivityBundle/Controller/AdminActivityTypeCategoryController.php b/src/Bundle/ChillActivityBundle/Controller/AdminActivityTypeCategoryController.php index 887749406..12865aa06 100644 --- a/src/Bundle/ChillActivityBundle/Controller/AdminActivityTypeCategoryController.php +++ b/src/Bundle/ChillActivityBundle/Controller/AdminActivityTypeCategoryController.php @@ -22,6 +22,7 @@ class AdminActivityTypeCategoryController extends CRUDController * * @return \Doctrine\ORM\QueryBuilder|mixed */ + #[\Override] protected function orderQuery(string $action, $query, Request $request, PaginatorInterface $paginator) { /* @var \Doctrine\ORM\QueryBuilder $query */ diff --git a/src/Bundle/ChillActivityBundle/Controller/AdminActivityTypeController.php b/src/Bundle/ChillActivityBundle/Controller/AdminActivityTypeController.php index ff75e5909..6f4d11b84 100644 --- a/src/Bundle/ChillActivityBundle/Controller/AdminActivityTypeController.php +++ b/src/Bundle/ChillActivityBundle/Controller/AdminActivityTypeController.php @@ -22,6 +22,7 @@ class AdminActivityTypeController extends CRUDController * * @return \Doctrine\ORM\QueryBuilder|mixed */ + #[\Override] protected function orderQuery(string $action, $query, Request $request, PaginatorInterface $paginator) { /* @var \Doctrine\ORM\QueryBuilder $query */ diff --git a/src/Bundle/ChillActivityBundle/DataFixtures/ORM/LoadActivity.php b/src/Bundle/ChillActivityBundle/DataFixtures/ORM/LoadActivity.php index a547ab21e..fddb04ffd 100644 --- a/src/Bundle/ChillActivityBundle/DataFixtures/ORM/LoadActivity.php +++ b/src/Bundle/ChillActivityBundle/DataFixtures/ORM/LoadActivity.php @@ -32,11 +32,13 @@ class LoadActivity extends AbstractFixture implements OrderedFixtureInterface $this->faker = FakerFactory::create('fr_FR'); } + #[\Override] public function getOrder() { return 16400; } + #[\Override] public function load(ObjectManager $manager) { $persons = $this->em diff --git a/src/Bundle/ChillActivityBundle/DataFixtures/ORM/LoadActivityNotifications.php b/src/Bundle/ChillActivityBundle/DataFixtures/ORM/LoadActivityNotifications.php index ee999d7f1..0a92a9206 100644 --- a/src/Bundle/ChillActivityBundle/DataFixtures/ORM/LoadActivityNotifications.php +++ b/src/Bundle/ChillActivityBundle/DataFixtures/ORM/LoadActivityNotifications.php @@ -38,6 +38,7 @@ class LoadActivityNotifications extends AbstractFixture implements DependentFixt ], ]; + #[\Override] public function getDependencies() { return [ diff --git a/src/Bundle/ChillActivityBundle/DataFixtures/ORM/LoadActivityReason.php b/src/Bundle/ChillActivityBundle/DataFixtures/ORM/LoadActivityReason.php index af674be9e..7bd45c59c 100644 --- a/src/Bundle/ChillActivityBundle/DataFixtures/ORM/LoadActivityReason.php +++ b/src/Bundle/ChillActivityBundle/DataFixtures/ORM/LoadActivityReason.php @@ -23,11 +23,13 @@ class LoadActivityReason extends AbstractFixture implements OrderedFixtureInterf { public static $references = []; + #[\Override] public function getOrder() { return 16300; } + #[\Override] public function load(ObjectManager $manager) { $reasons = [ diff --git a/src/Bundle/ChillActivityBundle/DataFixtures/ORM/LoadActivityReasonCategory.php b/src/Bundle/ChillActivityBundle/DataFixtures/ORM/LoadActivityReasonCategory.php index a78ae3972..72d9c1591 100644 --- a/src/Bundle/ChillActivityBundle/DataFixtures/ORM/LoadActivityReasonCategory.php +++ b/src/Bundle/ChillActivityBundle/DataFixtures/ORM/LoadActivityReasonCategory.php @@ -21,11 +21,13 @@ use Doctrine\Persistence\ObjectManager; */ class LoadActivityReasonCategory extends AbstractFixture implements OrderedFixtureInterface { + #[\Override] public function getOrder() { return 16200; } + #[\Override] public function load(ObjectManager $manager) { $categs = [ diff --git a/src/Bundle/ChillActivityBundle/DataFixtures/ORM/LoadActivityType.php b/src/Bundle/ChillActivityBundle/DataFixtures/ORM/LoadActivityType.php index 891f2c979..42e649aa3 100644 --- a/src/Bundle/ChillActivityBundle/DataFixtures/ORM/LoadActivityType.php +++ b/src/Bundle/ChillActivityBundle/DataFixtures/ORM/LoadActivityType.php @@ -23,11 +23,13 @@ class LoadActivityType extends Fixture implements OrderedFixtureInterface { public static $references = []; + #[\Override] public function getOrder() { return 16100; } + #[\Override] public function load(ObjectManager $manager) { $types = [ diff --git a/src/Bundle/ChillActivityBundle/DataFixtures/ORM/LoadActivityTypeCategory.php b/src/Bundle/ChillActivityBundle/DataFixtures/ORM/LoadActivityTypeCategory.php index 2f15a2676..f645a9537 100644 --- a/src/Bundle/ChillActivityBundle/DataFixtures/ORM/LoadActivityTypeCategory.php +++ b/src/Bundle/ChillActivityBundle/DataFixtures/ORM/LoadActivityTypeCategory.php @@ -23,11 +23,13 @@ class LoadActivityTypeCategory extends Fixture implements OrderedFixtureInterfac { public static $references = []; + #[\Override] public function getOrder() { return 16050; } + #[\Override] public function load(ObjectManager $manager) { $categories = [ diff --git a/src/Bundle/ChillActivityBundle/DataFixtures/ORM/LoadActivitytACL.php b/src/Bundle/ChillActivityBundle/DataFixtures/ORM/LoadActivitytACL.php index e7c893cd9..e91ae29aa 100644 --- a/src/Bundle/ChillActivityBundle/DataFixtures/ORM/LoadActivitytACL.php +++ b/src/Bundle/ChillActivityBundle/DataFixtures/ORM/LoadActivitytACL.php @@ -26,11 +26,13 @@ use Doctrine\Persistence\ObjectManager; */ class LoadActivitytACL extends AbstractFixture implements OrderedFixtureInterface { + #[\Override] public function getOrder() { return 16000; } + #[\Override] public function load(ObjectManager $manager) { foreach (LoadPermissionsGroup::$refs as $permissionsGroupRef) { diff --git a/src/Bundle/ChillActivityBundle/DependencyInjection/ChillActivityExtension.php b/src/Bundle/ChillActivityBundle/DependencyInjection/ChillActivityExtension.php index 15e7e7e4b..ec627b256 100644 --- a/src/Bundle/ChillActivityBundle/DependencyInjection/ChillActivityExtension.php +++ b/src/Bundle/ChillActivityBundle/DependencyInjection/ChillActivityExtension.php @@ -25,6 +25,7 @@ use Symfony\Component\HttpKernel\DependencyInjection\Extension; */ class ChillActivityExtension extends Extension implements PrependExtensionInterface { + #[\Override] public function load(array $configs, ContainerBuilder $container) { $configuration = new Configuration(); @@ -44,6 +45,7 @@ class ChillActivityExtension extends Extension implements PrependExtensionInterf $loader->load('services/doctrine.entitylistener.yaml'); } + #[\Override] public function prepend(ContainerBuilder $container) { $this->prependRoutes($container); diff --git a/src/Bundle/ChillActivityBundle/DependencyInjection/Configuration.php b/src/Bundle/ChillActivityBundle/DependencyInjection/Configuration.php index 112d49f60..2b68410e6 100644 --- a/src/Bundle/ChillActivityBundle/DependencyInjection/Configuration.php +++ b/src/Bundle/ChillActivityBundle/DependencyInjection/Configuration.php @@ -22,6 +22,7 @@ use function is_int; */ class Configuration implements ConfigurationInterface { + #[\Override] public function getConfigTreeBuilder() { $treeBuilder = new TreeBuilder('chill_activity'); diff --git a/src/Bundle/ChillActivityBundle/Entity/Activity.php b/src/Bundle/ChillActivityBundle/Entity/Activity.php index 2e7bede57..916cce44b 100644 --- a/src/Bundle/ChillActivityBundle/Entity/Activity.php +++ b/src/Bundle/ChillActivityBundle/Entity/Activity.php @@ -53,9 +53,9 @@ class Activity implements AccompanyingPeriodLinkedWithSocialIssuesEntityInterfac use TrackUpdateTrait; - final public const SENTRECEIVED_RECEIVED = 'received'; + final public const string SENTRECEIVED_RECEIVED = 'received'; - final public const SENTRECEIVED_SENT = 'sent'; + final public const string SENTRECEIVED_SENT = 'sent'; #[Groups(['read'])] #[ORM\ManyToOne(targetEntity: AccompanyingPeriod::class)] @@ -262,6 +262,7 @@ class Activity implements AccompanyingPeriodLinkedWithSocialIssuesEntityInterfac return $this; } + #[\Override] public function getAccompanyingPeriod(): ?AccompanyingPeriod { return $this->accompanyingPeriod; @@ -281,6 +282,7 @@ class Activity implements AccompanyingPeriodLinkedWithSocialIssuesEntityInterfac * get the center * center is extracted from person. */ + #[\Override] public function getCenters(): iterable { if ($this->person instanceof Person) { @@ -399,6 +401,7 @@ class Activity implements AccompanyingPeriodLinkedWithSocialIssuesEntityInterfac return $this->scope; } + #[\Override] public function getScopes(): iterable { if (null !== $this->getAccompanyingPeriod()) { @@ -422,6 +425,7 @@ class Activity implements AccompanyingPeriodLinkedWithSocialIssuesEntityInterfac return $this->socialActions; } + #[\Override] public function getSocialIssues(): Collection { return $this->socialIssues; @@ -492,6 +496,7 @@ class Activity implements AccompanyingPeriodLinkedWithSocialIssuesEntityInterfac return $this; } + #[\Override] public function removeSocialIssue(SocialIssue $socialIssue): self { $this->socialIssues->removeElement($socialIssue); diff --git a/src/Bundle/ChillActivityBundle/Entity/ActivityReasonCategory.php b/src/Bundle/ChillActivityBundle/Entity/ActivityReasonCategory.php index 9346d12a0..cafd07502 100644 --- a/src/Bundle/ChillActivityBundle/Entity/ActivityReasonCategory.php +++ b/src/Bundle/ChillActivityBundle/Entity/ActivityReasonCategory.php @@ -53,6 +53,7 @@ class ActivityReasonCategory implements \Stringable $this->reasons = new ArrayCollection(); } + #[\Override] public function __toString(): string { return 'ActivityReasonCategory('.$this->getName('x').')'; diff --git a/src/Bundle/ChillActivityBundle/Entity/ActivityType.php b/src/Bundle/ChillActivityBundle/Entity/ActivityType.php index f32dc5264..4b43d1cf1 100644 --- a/src/Bundle/ChillActivityBundle/Entity/ActivityType.php +++ b/src/Bundle/ChillActivityBundle/Entity/ActivityType.php @@ -25,11 +25,11 @@ use Symfony\Component\Validator\Context\ExecutionContextInterface; #[ORM\Table(name: 'activitytype')] class ActivityType { - final public const FIELD_INVISIBLE = 0; + final public const int FIELD_INVISIBLE = 0; - final public const FIELD_OPTIONAL = 1; + final public const int FIELD_OPTIONAL = 1; - final public const FIELD_REQUIRED = 2; + final public const int FIELD_REQUIRED = 2; /** * @deprecated not in use diff --git a/src/Bundle/ChillActivityBundle/Export/Aggregator/ACPAggregators/ByActivityNumberAggregator.php b/src/Bundle/ChillActivityBundle/Export/Aggregator/ACPAggregators/ByActivityNumberAggregator.php index e9e8fb474..d7ad7aa7c 100644 --- a/src/Bundle/ChillActivityBundle/Export/Aggregator/ACPAggregators/ByActivityNumberAggregator.php +++ b/src/Bundle/ChillActivityBundle/Export/Aggregator/ACPAggregators/ByActivityNumberAggregator.php @@ -19,11 +19,13 @@ use Symfony\Component\Form\FormBuilderInterface; class ByActivityNumberAggregator implements AggregatorInterface { + #[\Override] public function addRole(): ?string { return null; } + #[\Override] public function alterQuery(QueryBuilder $qb, $data): void { $qb @@ -31,21 +33,25 @@ class ByActivityNumberAggregator implements AggregatorInterface ->addGroupBy('activity_by_number_aggregator'); } + #[\Override] public function applyOn(): string { return Declarations::ACP_TYPE; } + #[\Override] public function buildForm(FormBuilderInterface $builder): void { // No form needed } + #[\Override] public function getFormDefaultData(): array { return []; } + #[\Override] public function getLabels($key, array $values, $data) { return static function ($value) { @@ -61,11 +67,13 @@ class ByActivityNumberAggregator implements AggregatorInterface }; } + #[\Override] public function getQueryKeys($data): array { return ['activity_by_number_aggregator']; } + #[\Override] public function getTitle(): string { return 'Group acp by activity number'; diff --git a/src/Bundle/ChillActivityBundle/Export/Aggregator/ACPAggregators/ByActivityTypeAggregator.php b/src/Bundle/ChillActivityBundle/Export/Aggregator/ACPAggregators/ByActivityTypeAggregator.php index 0097854d3..6aed46609 100644 --- a/src/Bundle/ChillActivityBundle/Export/Aggregator/ACPAggregators/ByActivityTypeAggregator.php +++ b/src/Bundle/ChillActivityBundle/Export/Aggregator/ACPAggregators/ByActivityTypeAggregator.php @@ -25,7 +25,7 @@ use Symfony\Component\Form\FormBuilderInterface; final readonly class ByActivityTypeAggregator implements AggregatorInterface { - private const PREFIX = 'acp_by_activity_type_agg'; + private const string PREFIX = 'acp_by_activity_type_agg'; public function __construct( private RollingDateConverterInterface $rollingDateConverter, @@ -33,6 +33,7 @@ final readonly class ByActivityTypeAggregator implements AggregatorInterface private TranslatableStringHelperInterface $translatableStringHelper, ) {} + #[\Override] public function buildForm(FormBuilderInterface $builder) { $builder @@ -46,6 +47,7 @@ final readonly class ByActivityTypeAggregator implements AggregatorInterface ]); } + #[\Override] public function getFormDefaultData(): array { return [ @@ -54,6 +56,7 @@ final readonly class ByActivityTypeAggregator implements AggregatorInterface ]; } + #[\Override] public function getLabels($key, array $values, mixed $data) { return function (int|string|null $value): string { @@ -69,21 +72,25 @@ final readonly class ByActivityTypeAggregator implements AggregatorInterface }; } + #[\Override] public function getQueryKeys($data) { return [self::PREFIX.'_actype_id']; } + #[\Override] public function getTitle() { return 'export.aggregator.acp.by_activity_type.title'; } + #[\Override] public function addRole(): ?string { return null; } + #[\Override] public function alterQuery(QueryBuilder $qb, $data) { $p = self::PREFIX; @@ -115,6 +122,7 @@ final readonly class ByActivityTypeAggregator implements AggregatorInterface ->addGroupBy("{$p}_actype_id"); } + #[\Override] public function applyOn() { return Declarations::ACP_TYPE; diff --git a/src/Bundle/ChillActivityBundle/Export/Aggregator/ACPAggregators/BySocialActionAggregator.php b/src/Bundle/ChillActivityBundle/Export/Aggregator/ACPAggregators/BySocialActionAggregator.php index 9282f92e4..698b7e6ef 100644 --- a/src/Bundle/ChillActivityBundle/Export/Aggregator/ACPAggregators/BySocialActionAggregator.php +++ b/src/Bundle/ChillActivityBundle/Export/Aggregator/ACPAggregators/BySocialActionAggregator.php @@ -22,11 +22,13 @@ class BySocialActionAggregator implements AggregatorInterface { public function __construct(private readonly SocialActionRender $actionRender, private readonly SocialActionRepository $actionRepository) {} + #[\Override] public function addRole(): ?string { return null; } + #[\Override] public function alterQuery(QueryBuilder $qb, $data) { if (!\in_array('actsocialaction', $qb->getAllAliases(), true)) { @@ -37,21 +39,25 @@ class BySocialActionAggregator implements AggregatorInterface $qb->addGroupBy('socialaction_aggregator'); } + #[\Override] public function applyOn(): string { return Declarations::ACTIVITY_ACP; } + #[\Override] public function buildForm(FormBuilderInterface $builder) { // no form } + #[\Override] public function getFormDefaultData(): array { return []; } + #[\Override] public function getLabels($key, array $values, $data) { return function ($value) { @@ -69,11 +75,13 @@ class BySocialActionAggregator implements AggregatorInterface }; } + #[\Override] public function getQueryKeys($data): array { return ['socialaction_aggregator']; } + #[\Override] public function getTitle(): string { return 'Group activity by linked socialaction'; diff --git a/src/Bundle/ChillActivityBundle/Export/Aggregator/ACPAggregators/BySocialIssueAggregator.php b/src/Bundle/ChillActivityBundle/Export/Aggregator/ACPAggregators/BySocialIssueAggregator.php index bbdadf4d6..b1018b787 100644 --- a/src/Bundle/ChillActivityBundle/Export/Aggregator/ACPAggregators/BySocialIssueAggregator.php +++ b/src/Bundle/ChillActivityBundle/Export/Aggregator/ACPAggregators/BySocialIssueAggregator.php @@ -22,11 +22,13 @@ class BySocialIssueAggregator implements AggregatorInterface { public function __construct(private readonly SocialIssueRepository $issueRepository, private readonly SocialIssueRender $issueRender) {} + #[\Override] public function addRole(): ?string { return null; } + #[\Override] public function alterQuery(QueryBuilder $qb, $data) { if (!\in_array('actsocialissue', $qb->getAllAliases(), true)) { @@ -37,21 +39,25 @@ class BySocialIssueAggregator implements AggregatorInterface $qb->addGroupBy('socialissue_aggregator'); } + #[\Override] public function applyOn(): string { return Declarations::ACTIVITY_ACP; } + #[\Override] public function buildForm(FormBuilderInterface $builder) { // no form } + #[\Override] public function getFormDefaultData(): array { return []; } + #[\Override] public function getLabels($key, array $values, $data) { return function ($value): string { @@ -69,11 +75,13 @@ class BySocialIssueAggregator implements AggregatorInterface }; } + #[\Override] public function getQueryKeys($data): array { return ['socialissue_aggregator']; } + #[\Override] public function getTitle(): string { return 'Group activity by linked socialissue'; diff --git a/src/Bundle/ChillActivityBundle/Export/Aggregator/ActivityLocationAggregator.php b/src/Bundle/ChillActivityBundle/Export/Aggregator/ActivityLocationAggregator.php index ab07afca7..daf135622 100644 --- a/src/Bundle/ChillActivityBundle/Export/Aggregator/ActivityLocationAggregator.php +++ b/src/Bundle/ChillActivityBundle/Export/Aggregator/ActivityLocationAggregator.php @@ -18,13 +18,15 @@ use Symfony\Component\Form\FormBuilderInterface; final readonly class ActivityLocationAggregator implements AggregatorInterface { - public const KEY = 'activity_location_aggregator'; + public const string KEY = 'activity_location_aggregator'; + #[\Override] public function addRole(): ?string { return null; } + #[\Override] public function alterQuery(QueryBuilder $qb, $data) { if (!\in_array('actloc', $qb->getAllAliases(), true)) { @@ -34,21 +36,25 @@ final readonly class ActivityLocationAggregator implements AggregatorInterface $qb->addGroupBy(self::KEY); } + #[\Override] public function applyOn(): string { return Declarations::ACTIVITY; } + #[\Override] public function buildForm(FormBuilderInterface $builder) { // no form required for this aggregator } + #[\Override] public function getFormDefaultData(): array { return []; } + #[\Override] public function getLabels($key, array $values, $data): \Closure { return function ($value): string { @@ -64,11 +70,13 @@ final readonly class ActivityLocationAggregator implements AggregatorInterface }; } + #[\Override] public function getQueryKeys($data): array { return [self::KEY]; } + #[\Override] public function getTitle() { return 'export.aggregator.activity.by_location.Title'; diff --git a/src/Bundle/ChillActivityBundle/Export/Aggregator/ActivityPresenceAggregator.php b/src/Bundle/ChillActivityBundle/Export/Aggregator/ActivityPresenceAggregator.php index 56a6d0249..31b6cbe26 100644 --- a/src/Bundle/ChillActivityBundle/Export/Aggregator/ActivityPresenceAggregator.php +++ b/src/Bundle/ChillActivityBundle/Export/Aggregator/ActivityPresenceAggregator.php @@ -22,13 +22,16 @@ final readonly class ActivityPresenceAggregator implements AggregatorInterface { public function __construct(private ActivityPresenceRepositoryInterface $activityPresenceRepository, private TranslatableStringHelperInterface $translatableStringHelper) {} + #[\Override] public function buildForm(FormBuilderInterface $builder) {} + #[\Override] public function getFormDefaultData(): array { return []; } + #[\Override] public function getLabels($key, array $values, mixed $data) { return function (int|string|null $value): string { @@ -44,27 +47,32 @@ final readonly class ActivityPresenceAggregator implements AggregatorInterface }; } + #[\Override] public function getQueryKeys($data) { return ['activity_presence_aggregator_attendee']; } + #[\Override] public function getTitle(): string { return 'export.aggregator.activity.by_activity_presence.Group activity by presence'; } + #[\Override] public function addRole(): ?string { return null; } + #[\Override] public function alterQuery(QueryBuilder $qb, $data): void { $qb->addSelect('IDENTITY(activity.attendee) AS activity_presence_aggregator_attendee'); $qb->addGroupBy('activity_presence_aggregator_attendee'); } + #[\Override] public function applyOn() { return Declarations::ACTIVITY; diff --git a/src/Bundle/ChillActivityBundle/Export/Aggregator/ActivityReasonAggregator.php b/src/Bundle/ChillActivityBundle/Export/Aggregator/ActivityReasonAggregator.php index 33090f297..63903b360 100644 --- a/src/Bundle/ChillActivityBundle/Export/Aggregator/ActivityReasonAggregator.php +++ b/src/Bundle/ChillActivityBundle/Export/Aggregator/ActivityReasonAggregator.php @@ -31,11 +31,13 @@ class ActivityReasonAggregator implements AggregatorInterface, ExportElementVali protected TranslatableStringHelper $translatableStringHelper ) {} + #[\Override] public function addRole(): ?string { return null; } + #[\Override] public function alterQuery(QueryBuilder $qb, $data) { // add select element @@ -67,11 +69,13 @@ class ActivityReasonAggregator implements AggregatorInterface, ExportElementVali $qb->addGroupBy($alias); } + #[\Override] public function applyOn(): string { return Declarations::ACTIVITY; } + #[\Override] public function buildForm(FormBuilderInterface $builder) { $builder->add( @@ -89,6 +93,7 @@ class ActivityReasonAggregator implements AggregatorInterface, ExportElementVali ); } + #[\Override] public function getFormDefaultData(): array { return [ @@ -96,6 +101,7 @@ class ActivityReasonAggregator implements AggregatorInterface, ExportElementVali ]; } + #[\Override] public function getLabels($key, array $values, $data) { return function ($value) use ($data) { @@ -125,6 +131,7 @@ class ActivityReasonAggregator implements AggregatorInterface, ExportElementVali }; } + #[\Override] public function getQueryKeys($data) { // add select element @@ -139,11 +146,13 @@ class ActivityReasonAggregator implements AggregatorInterface, ExportElementVali throw new \RuntimeException('The data provided are not recognised.'); } + #[\Override] public function getTitle() { return 'Aggregate by activity reason'; } + #[\Override] public function validateForm($data, ExecutionContextInterface $context) { if (null === $data['level']) { diff --git a/src/Bundle/ChillActivityBundle/Export/Aggregator/ActivityTypeAggregator.php b/src/Bundle/ChillActivityBundle/Export/Aggregator/ActivityTypeAggregator.php index dbdc982b6..f0e662e0d 100644 --- a/src/Bundle/ChillActivityBundle/Export/Aggregator/ActivityTypeAggregator.php +++ b/src/Bundle/ChillActivityBundle/Export/Aggregator/ActivityTypeAggregator.php @@ -20,15 +20,17 @@ use Symfony\Component\Form\FormBuilderInterface; class ActivityTypeAggregator implements AggregatorInterface { - final public const KEY = 'activity_type_aggregator'; + final public const string KEY = 'activity_type_aggregator'; public function __construct(protected ActivityTypeRepositoryInterface $activityTypeRepository, protected TranslatableStringHelperInterface $translatableStringHelper) {} + #[\Override] public function addRole(): ?string { return null; } + #[\Override] public function alterQuery(QueryBuilder $qb, $data) { if (!\in_array('acttype', $qb->getAllAliases(), true)) { @@ -39,21 +41,25 @@ class ActivityTypeAggregator implements AggregatorInterface $qb->addGroupBy(self::KEY); } + #[\Override] public function applyOn(): string { return Declarations::ACTIVITY; } + #[\Override] public function buildForm(FormBuilderInterface $builder) { // no form required for this aggregator } + #[\Override] public function getFormDefaultData(): array { return []; } + #[\Override] public function getLabels($key, array $values, $data): \Closure { return function (int|string|null $value): string { @@ -69,11 +75,13 @@ class ActivityTypeAggregator implements AggregatorInterface }; } + #[\Override] public function getQueryKeys($data): array { return [self::KEY]; } + #[\Override] public function getTitle() { return 'Aggregate by activity type'; diff --git a/src/Bundle/ChillActivityBundle/Export/Aggregator/ActivityUserAggregator.php b/src/Bundle/ChillActivityBundle/Export/Aggregator/ActivityUserAggregator.php index 61452af22..02f23623a 100644 --- a/src/Bundle/ChillActivityBundle/Export/Aggregator/ActivityUserAggregator.php +++ b/src/Bundle/ChillActivityBundle/Export/Aggregator/ActivityUserAggregator.php @@ -20,15 +20,17 @@ use Symfony\Component\Form\FormBuilderInterface; class ActivityUserAggregator implements AggregatorInterface { - final public const KEY = 'activity_user_id'; + final public const string KEY = 'activity_user_id'; public function __construct(private readonly UserRepository $userRepository, private readonly UserRender $userRender) {} + #[\Override] public function addRole(): ?string { return null; } + #[\Override] public function alterQuery(QueryBuilder $qb, $data) { // add select element @@ -38,21 +40,25 @@ class ActivityUserAggregator implements AggregatorInterface $qb->addGroupBy(self::KEY); } + #[\Override] public function applyOn(): string { return Declarations::ACTIVITY; } + #[\Override] public function buildForm(FormBuilderInterface $builder) { // nothing to add } + #[\Override] public function getFormDefaultData(): array { return []; } + #[\Override] public function getLabels($key, $values, $data): \Closure { return function ($value) { @@ -70,11 +76,13 @@ class ActivityUserAggregator implements AggregatorInterface }; } + #[\Override] public function getQueryKeys($data) { return [self::KEY]; } + #[\Override] public function getTitle(): string { return 'Aggregate by activity user'; diff --git a/src/Bundle/ChillActivityBundle/Export/Aggregator/ActivityUsersAggregator.php b/src/Bundle/ChillActivityBundle/Export/Aggregator/ActivityUsersAggregator.php index cc4ab9d14..0442549c5 100644 --- a/src/Bundle/ChillActivityBundle/Export/Aggregator/ActivityUsersAggregator.php +++ b/src/Bundle/ChillActivityBundle/Export/Aggregator/ActivityUsersAggregator.php @@ -22,11 +22,13 @@ class ActivityUsersAggregator implements AggregatorInterface { public function __construct(private readonly UserRepositoryInterface $userRepository, private readonly UserRender $userRender) {} + #[\Override] public function addRole(): ?string { return null; } + #[\Override] public function alterQuery(QueryBuilder $qb, $data) { if (!\in_array('actusers', $qb->getAllAliases(), true)) { @@ -38,21 +40,25 @@ class ActivityUsersAggregator implements AggregatorInterface ->addGroupBy('activity_users_aggregator'); } + #[\Override] public function applyOn(): string { return Declarations::ACTIVITY; } + #[\Override] public function buildForm(FormBuilderInterface $builder) { // nothing to add on the form } + #[\Override] public function getFormDefaultData(): array { return []; } + #[\Override] public function getLabels($key, array $values, $data) { return function ($value) { @@ -70,11 +76,13 @@ class ActivityUsersAggregator implements AggregatorInterface }; } + #[\Override] public function getQueryKeys($data) { return ['activity_users_aggregator']; } + #[\Override] public function getTitle() { return 'Aggregate by activity users'; diff --git a/src/Bundle/ChillActivityBundle/Export/Aggregator/ActivityUsersJobAggregator.php b/src/Bundle/ChillActivityBundle/Export/Aggregator/ActivityUsersJobAggregator.php index 3628206ec..4841198da 100644 --- a/src/Bundle/ChillActivityBundle/Export/Aggregator/ActivityUsersJobAggregator.php +++ b/src/Bundle/ChillActivityBundle/Export/Aggregator/ActivityUsersJobAggregator.php @@ -22,18 +22,20 @@ use Symfony\Component\Form\FormBuilderInterface; class ActivityUsersJobAggregator implements AggregatorInterface { - private const PREFIX = 'act_agg_user_job'; + private const string PREFIX = 'act_agg_user_job'; public function __construct( private readonly UserJobRepositoryInterface $userJobRepository, private readonly TranslatableStringHelperInterface $translatableStringHelper ) {} + #[\Override] public function addRole(): ?string { return null; } + #[\Override] public function alterQuery(QueryBuilder $qb, $data) { $p = self::PREFIX; @@ -60,18 +62,22 @@ class ActivityUsersJobAggregator implements AggregatorInterface ->addGroupBy("{$p}_select"); } + #[\Override] public function applyOn(): string { return Declarations::ACTIVITY; } + #[\Override] public function buildForm(FormBuilderInterface $builder) {} + #[\Override] public function getFormDefaultData(): array { return []; } + #[\Override] public function getLabels($key, array $values, $data) { return function ($value): string { @@ -91,11 +97,13 @@ class ActivityUsersJobAggregator implements AggregatorInterface }; } + #[\Override] public function getQueryKeys($data): array { return [self::PREFIX.'_select']; } + #[\Override] public function getTitle(): string { return 'export.aggregator.activity.by_user_job.Aggregate by users job'; diff --git a/src/Bundle/ChillActivityBundle/Export/Aggregator/ActivityUsersScopeAggregator.php b/src/Bundle/ChillActivityBundle/Export/Aggregator/ActivityUsersScopeAggregator.php index bffce629f..792db1f76 100644 --- a/src/Bundle/ChillActivityBundle/Export/Aggregator/ActivityUsersScopeAggregator.php +++ b/src/Bundle/ChillActivityBundle/Export/Aggregator/ActivityUsersScopeAggregator.php @@ -22,18 +22,20 @@ use Symfony\Component\Form\FormBuilderInterface; class ActivityUsersScopeAggregator implements AggregatorInterface { - private const PREFIX = 'act_agg_user_scope'; + private const string PREFIX = 'act_agg_user_scope'; public function __construct( private readonly ScopeRepositoryInterface $scopeRepository, private readonly TranslatableStringHelperInterface $translatableStringHelper ) {} + #[\Override] public function addRole(): ?string { return null; } + #[\Override] public function alterQuery(QueryBuilder $qb, $data) { $p = self::PREFIX; @@ -60,18 +62,22 @@ class ActivityUsersScopeAggregator implements AggregatorInterface ->addGroupBy("{$p}_select"); } + #[\Override] public function applyOn(): string { return Declarations::ACTIVITY; } + #[\Override] public function buildForm(FormBuilderInterface $builder) {} + #[\Override] public function getFormDefaultData(): array { return []; } + #[\Override] public function getLabels($key, array $values, $data) { return function ($value): string { @@ -91,11 +97,13 @@ class ActivityUsersScopeAggregator implements AggregatorInterface }; } + #[\Override] public function getQueryKeys($data): array { return [self::PREFIX.'_select']; } + #[\Override] public function getTitle(): string { return 'export.aggregator.activity.by_user_scope.Aggregate by users scope'; diff --git a/src/Bundle/ChillActivityBundle/Export/Aggregator/ByCreatorAggregator.php b/src/Bundle/ChillActivityBundle/Export/Aggregator/ByCreatorAggregator.php index 09bdab89e..51cdd4c5b 100644 --- a/src/Bundle/ChillActivityBundle/Export/Aggregator/ByCreatorAggregator.php +++ b/src/Bundle/ChillActivityBundle/Export/Aggregator/ByCreatorAggregator.php @@ -22,32 +22,38 @@ class ByCreatorAggregator implements AggregatorInterface { public function __construct(private readonly UserRepositoryInterface $userRepository, private readonly UserRender $userRender) {} + #[\Override] public function addRole(): ?string { return null; } + #[\Override] public function alterQuery(QueryBuilder $qb, $data) { $qb->addSelect('IDENTITY(activity.createdBy) AS creator_aggregator'); $qb->addGroupBy('creator_aggregator'); } + #[\Override] public function applyOn(): string { return Declarations::ACTIVITY; } + #[\Override] public function buildForm(FormBuilderInterface $builder) { // no form } + #[\Override] public function getFormDefaultData(): array { return []; } + #[\Override] public function getLabels($key, array $values, $data) { return function ($value): string { @@ -65,11 +71,13 @@ class ByCreatorAggregator implements AggregatorInterface }; } + #[\Override] public function getQueryKeys($data): array { return ['creator_aggregator']; } + #[\Override] public function getTitle(): string { return 'Group activity by creator'; diff --git a/src/Bundle/ChillActivityBundle/Export/Aggregator/ByThirdpartyAggregator.php b/src/Bundle/ChillActivityBundle/Export/Aggregator/ByThirdpartyAggregator.php index 13224bade..190b42ffd 100644 --- a/src/Bundle/ChillActivityBundle/Export/Aggregator/ByThirdpartyAggregator.php +++ b/src/Bundle/ChillActivityBundle/Export/Aggregator/ByThirdpartyAggregator.php @@ -22,11 +22,13 @@ class ByThirdpartyAggregator implements AggregatorInterface { public function __construct(private readonly ThirdPartyRepository $thirdPartyRepository, private readonly ThirdPartyRender $thirdPartyRender) {} + #[\Override] public function addRole(): ?string { return null; } + #[\Override] public function alterQuery(QueryBuilder $qb, $data) { if (!\in_array('acttparty', $qb->getAllAliases(), true)) { @@ -37,21 +39,25 @@ class ByThirdpartyAggregator implements AggregatorInterface $qb->addGroupBy('thirdparty_aggregator'); } + #[\Override] public function applyOn(): string { return Declarations::ACTIVITY; } + #[\Override] public function buildForm(FormBuilderInterface $builder) { // no form } + #[\Override] public function getFormDefaultData(): array { return []; } + #[\Override] public function getLabels($key, array $values, $data) { return function ($value): string { @@ -69,11 +75,13 @@ class ByThirdpartyAggregator implements AggregatorInterface }; } + #[\Override] public function getQueryKeys($data): array { return ['thirdparty_aggregator']; } + #[\Override] public function getTitle(): string { return 'Group activity by linked thirdparties'; diff --git a/src/Bundle/ChillActivityBundle/Export/Aggregator/CreatorJobAggregator.php b/src/Bundle/ChillActivityBundle/Export/Aggregator/CreatorJobAggregator.php index d57670e7f..11ff629df 100644 --- a/src/Bundle/ChillActivityBundle/Export/Aggregator/CreatorJobAggregator.php +++ b/src/Bundle/ChillActivityBundle/Export/Aggregator/CreatorJobAggregator.php @@ -22,18 +22,20 @@ use Symfony\Component\Form\FormBuilderInterface; class CreatorJobAggregator implements AggregatorInterface { - private const PREFIX = 'acp_agg_creator_job'; + private const string PREFIX = 'acp_agg_creator_job'; public function __construct( private readonly UserJobRepositoryInterface $userJobRepository, private readonly TranslatableStringHelper $translatableStringHelper ) {} + #[\Override] public function addRole(): ?string { return null; } + #[\Override] public function alterQuery(QueryBuilder $qb, $data) { $p = self::PREFIX; @@ -60,18 +62,22 @@ class CreatorJobAggregator implements AggregatorInterface ->addGroupBy("{$p}_select"); } + #[\Override] public function applyOn(): string { return Declarations::ACTIVITY; } + #[\Override] public function buildForm(FormBuilderInterface $builder) {} + #[\Override] public function getFormDefaultData(): array { return []; } + #[\Override] public function getLabels($key, array $values, $data) { return function ($value): string { @@ -89,11 +95,13 @@ class CreatorJobAggregator implements AggregatorInterface }; } + #[\Override] public function getQueryKeys($data): array { return [self::PREFIX.'_select']; } + #[\Override] public function getTitle(): string { return 'export.aggregator.activity.by_creator_job.Group activity by creator job'; diff --git a/src/Bundle/ChillActivityBundle/Export/Aggregator/CreatorScopeAggregator.php b/src/Bundle/ChillActivityBundle/Export/Aggregator/CreatorScopeAggregator.php index 6641f0807..279a7a460 100644 --- a/src/Bundle/ChillActivityBundle/Export/Aggregator/CreatorScopeAggregator.php +++ b/src/Bundle/ChillActivityBundle/Export/Aggregator/CreatorScopeAggregator.php @@ -22,18 +22,20 @@ use Symfony\Component\Form\FormBuilderInterface; class CreatorScopeAggregator implements AggregatorInterface { - private const PREFIX = 'acp_agg_creator_scope'; + private const string PREFIX = 'acp_agg_creator_scope'; public function __construct( private readonly ScopeRepository $scopeRepository, private readonly TranslatableStringHelper $translatableStringHelper ) {} + #[\Override] public function addRole(): ?string { return null; } + #[\Override] public function alterQuery(QueryBuilder $qb, $data) { $p = self::PREFIX; @@ -60,18 +62,22 @@ class CreatorScopeAggregator implements AggregatorInterface ->addGroupBy("{$p}_select"); } + #[\Override] public function applyOn(): string { return Declarations::ACTIVITY; } + #[\Override] public function buildForm(FormBuilderInterface $builder) {} + #[\Override] public function getFormDefaultData(): array { return []; } + #[\Override] public function getLabels($key, array $values, $data) { return function ($value): string { @@ -91,11 +97,13 @@ class CreatorScopeAggregator implements AggregatorInterface }; } + #[\Override] public function getQueryKeys($data): array { return [self::PREFIX.'_select']; } + #[\Override] public function getTitle(): string { return 'export.aggregator.activity.by_creator_scope.Group activity by creator scope'; diff --git a/src/Bundle/ChillActivityBundle/Export/Aggregator/DateAggregator.php b/src/Bundle/ChillActivityBundle/Export/Aggregator/DateAggregator.php index 9d9e5ed61..d62990277 100644 --- a/src/Bundle/ChillActivityBundle/Export/Aggregator/DateAggregator.php +++ b/src/Bundle/ChillActivityBundle/Export/Aggregator/DateAggregator.php @@ -19,19 +19,21 @@ use Symfony\Component\Form\FormBuilderInterface; class DateAggregator implements AggregatorInterface { - private const CHOICES = [ + private const array CHOICES = [ 'by month' => 'month', 'by week' => 'week', 'by year' => 'year', ]; - private const DEFAULT_CHOICE = 'year'; + private const string DEFAULT_CHOICE = 'year'; + #[\Override] public function addRole(): ?string { return null; } + #[\Override] public function alterQuery(QueryBuilder $qb, $data) { $order = null; @@ -62,11 +64,13 @@ class DateAggregator implements AggregatorInterface $qb->addOrderBy('date_aggregator', $order); } + #[\Override] public function applyOn(): string { return Declarations::ACTIVITY; } + #[\Override] public function buildForm(FormBuilderInterface $builder) { $builder->add('frequency', ChoiceType::class, [ @@ -76,11 +80,13 @@ class DateAggregator implements AggregatorInterface ]); } + #[\Override] public function getFormDefaultData(): array { return ['frequency' => self::DEFAULT_CHOICE]; } + #[\Override] public function getLabels($key, array $values, $data) { return static function ($value) use ($data): string { @@ -98,11 +104,13 @@ class DateAggregator implements AggregatorInterface }; } + #[\Override] public function getQueryKeys($data): array { return ['date_aggregator']; } + #[\Override] public function getTitle(): string { return 'Group activity by date'; diff --git a/src/Bundle/ChillActivityBundle/Export/Aggregator/LocationTypeAggregator.php b/src/Bundle/ChillActivityBundle/Export/Aggregator/LocationTypeAggregator.php index da2d74f64..3e94d7485 100644 --- a/src/Bundle/ChillActivityBundle/Export/Aggregator/LocationTypeAggregator.php +++ b/src/Bundle/ChillActivityBundle/Export/Aggregator/LocationTypeAggregator.php @@ -22,11 +22,13 @@ class LocationTypeAggregator implements AggregatorInterface { public function __construct(private readonly LocationTypeRepository $locationTypeRepository, private readonly TranslatableStringHelper $translatableStringHelper) {} + #[\Override] public function addRole(): ?string { return null; } + #[\Override] public function alterQuery(QueryBuilder $qb, $data) { if (!\in_array('actloc', $qb->getAllAliases(), true)) { @@ -37,21 +39,25 @@ class LocationTypeAggregator implements AggregatorInterface $qb->addGroupBy('locationtype_aggregator'); } + #[\Override] public function applyOn(): string { return Declarations::ACTIVITY; } + #[\Override] public function buildForm(FormBuilderInterface $builder) { // no form } + #[\Override] public function getFormDefaultData(): array { return []; } + #[\Override] public function getLabels($key, array $values, $data) { return function ($value): string { @@ -73,11 +79,13 @@ class LocationTypeAggregator implements AggregatorInterface }; } + #[\Override] public function getQueryKeys($data): array { return ['locationtype_aggregator']; } + #[\Override] public function getTitle(): string { return 'Group activity by locationtype'; diff --git a/src/Bundle/ChillActivityBundle/Export/Aggregator/PersonAggregators/PersonAggregator.php b/src/Bundle/ChillActivityBundle/Export/Aggregator/PersonAggregators/PersonAggregator.php index c7a3bd6b5..42b7f00e0 100644 --- a/src/Bundle/ChillActivityBundle/Export/Aggregator/PersonAggregators/PersonAggregator.php +++ b/src/Bundle/ChillActivityBundle/Export/Aggregator/PersonAggregators/PersonAggregator.php @@ -21,36 +21,43 @@ final readonly class PersonAggregator implements AggregatorInterface { public function __construct(private LabelPersonHelper $labelPersonHelper) {} + #[\Override] public function buildForm(FormBuilderInterface $builder) { // nothing to add here } + #[\Override] public function getFormDefaultData(): array { return []; } + #[\Override] public function getLabels($key, array $values, mixed $data) { return $this->labelPersonHelper->getLabel($key, $values, 'export.aggregator.person.by_person.person'); } + #[\Override] public function getQueryKeys($data) { return ['activity_by_person_agg']; } + #[\Override] public function getTitle() { return 'export.aggregator.person.by_person.title'; } + #[\Override] public function addRole(): ?string { return null; } + #[\Override] public function alterQuery(QueryBuilder $qb, $data) { $qb @@ -58,6 +65,7 @@ final readonly class PersonAggregator implements AggregatorInterface ->addGroupBy('activity_by_person_agg'); } + #[\Override] public function applyOn() { return Declarations::ACTIVITY_PERSON; diff --git a/src/Bundle/ChillActivityBundle/Export/Aggregator/PersonsAggregator.php b/src/Bundle/ChillActivityBundle/Export/Aggregator/PersonsAggregator.php index 8459741c5..a030bc6d8 100644 --- a/src/Bundle/ChillActivityBundle/Export/Aggregator/PersonsAggregator.php +++ b/src/Bundle/ChillActivityBundle/Export/Aggregator/PersonsAggregator.php @@ -23,20 +23,23 @@ use Symfony\Component\Form\FormBuilderInterface; */ final readonly class PersonsAggregator implements AggregatorInterface { - private const PREFIX = 'act_persons_agg'; + private const string PREFIX = 'act_persons_agg'; public function __construct(private LabelPersonHelper $labelPersonHelper) {} + #[\Override] public function buildForm(FormBuilderInterface $builder) { // nothing to add here } + #[\Override] public function getFormDefaultData(): array { return []; } + #[\Override] public function getLabels($key, array $values, mixed $data) { if ($key !== self::PREFIX.'_pid') { @@ -46,21 +49,25 @@ final readonly class PersonsAggregator implements AggregatorInterface return $this->labelPersonHelper->getLabel($key, $values, 'export.aggregator.activity.by_persons.Persons'); } + #[\Override] public function getQueryKeys($data) { return [self::PREFIX.'_pid']; } + #[\Override] public function getTitle() { return 'export.aggregator.activity.by_persons.Group activity by persons'; } + #[\Override] public function addRole(): ?string { return null; } + #[\Override] public function alterQuery(QueryBuilder $qb, $data) { $p = self::PREFIX; @@ -71,6 +78,7 @@ final readonly class PersonsAggregator implements AggregatorInterface ->addGroupBy("{$p}_pid"); } + #[\Override] public function applyOn() { return Declarations::ACTIVITY; diff --git a/src/Bundle/ChillActivityBundle/Export/Aggregator/SentReceivedAggregator.php b/src/Bundle/ChillActivityBundle/Export/Aggregator/SentReceivedAggregator.php index 774968544..d3e8df402 100644 --- a/src/Bundle/ChillActivityBundle/Export/Aggregator/SentReceivedAggregator.php +++ b/src/Bundle/ChillActivityBundle/Export/Aggregator/SentReceivedAggregator.php @@ -21,32 +21,38 @@ class SentReceivedAggregator implements AggregatorInterface { public function __construct(private readonly TranslatorInterface $translator) {} + #[\Override] public function addRole(): ?string { return null; } + #[\Override] public function alterQuery(QueryBuilder $qb, $data): void { $qb->addSelect('activity.sentReceived AS activity_sentreceived_aggregator') ->addGroupBy('activity_sentreceived_aggregator'); } + #[\Override] public function applyOn(): string { return Declarations::ACTIVITY; } + #[\Override] public function buildForm(FormBuilderInterface $builder): void { // No form needed } + #[\Override] public function getFormDefaultData(): array { return []; } + #[\Override] public function getLabels($key, array $values, $data): callable { return function (?string $value): string { @@ -71,11 +77,13 @@ class SentReceivedAggregator implements AggregatorInterface }; } + #[\Override] public function getQueryKeys($data): array { return ['activity_sentreceived_aggregator']; } + #[\Override] public function getTitle(): string { return 'export.aggregator.activity.by_sent_received.Group activity by sentreceived'; diff --git a/src/Bundle/ChillActivityBundle/Export/Export/LinkedToACP/AvgActivityDuration.php b/src/Bundle/ChillActivityBundle/Export/Export/LinkedToACP/AvgActivityDuration.php index d8b204e8c..b1d2cf50c 100644 --- a/src/Bundle/ChillActivityBundle/Export/Export/LinkedToACP/AvgActivityDuration.php +++ b/src/Bundle/ChillActivityBundle/Export/Export/LinkedToACP/AvgActivityDuration.php @@ -36,28 +36,34 @@ class AvgActivityDuration implements ExportInterface, GroupedExportInterface $this->filterStatsByCenters = $parameterBag->get('chill_main')['acl']['filter_stats_by_center']; } + #[\Override] public function buildForm(FormBuilderInterface $builder) {} + #[\Override] public function getFormDefaultData(): array { return []; } + #[\Override] public function getAllowedFormattersTypes(): array { return [FormatterInterface::TYPE_TABULAR]; } + #[\Override] public function getDescription(): string { return 'Average activities linked to an accompanying period duration by various parameters.'; } + #[\Override] public function getGroup(): string { return 'Exports of activities linked to an accompanying period'; } + #[\Override] public function getLabels($key, array $values, $data) { if ('export_avg_activity_duration' !== $key) { @@ -67,26 +73,31 @@ class AvgActivityDuration implements ExportInterface, GroupedExportInterface return static fn ($value) => '_header' === $value ? 'Average activities linked to an accompanying period duration' : $value; } + #[\Override] public function getQueryKeys($data): array { return ['export_avg_activity_duration']; } + #[\Override] public function getResult($query, $data) { return $query->getQuery()->getResult(Query::HYDRATE_SCALAR); } + #[\Override] public function getTitle(): string { return 'Average activity linked to an accompanying period duration'; } + #[\Override] public function getType(): string { return Declarations::ACTIVITY; } + #[\Override] public function initiateQuery(array $requiredModifiers, array $acl, array $data = []) { $centers = array_map(static fn ($el) => $el['center'], $acl); @@ -116,11 +127,13 @@ class AvgActivityDuration implements ExportInterface, GroupedExportInterface return $qb; } + #[\Override] public function requiredRole(): string { return ActivityStatsVoter::STATS; } + #[\Override] public function supportsModifiers(): array { return [ diff --git a/src/Bundle/ChillActivityBundle/Export/Export/LinkedToACP/AvgActivityVisitDuration.php b/src/Bundle/ChillActivityBundle/Export/Export/LinkedToACP/AvgActivityVisitDuration.php index acfb073f5..09e5358ee 100644 --- a/src/Bundle/ChillActivityBundle/Export/Export/LinkedToACP/AvgActivityVisitDuration.php +++ b/src/Bundle/ChillActivityBundle/Export/Export/LinkedToACP/AvgActivityVisitDuration.php @@ -41,31 +41,37 @@ class AvgActivityVisitDuration implements ExportInterface, GroupedExportInterfac $this->filterStatsByCenters = $parameterBag->get('chill_main')['acl']['filter_stats_by_center']; } + #[\Override] public function buildForm(FormBuilderInterface $builder) { // TODO: Implement buildForm() method. } + #[\Override] public function getFormDefaultData(): array { return []; } + #[\Override] public function getAllowedFormattersTypes(): array { return [FormatterInterface::TYPE_TABULAR]; } + #[\Override] public function getDescription(): string { return 'Average activities linked to an accompanying period visit duration by various parameters.'; } + #[\Override] public function getGroup(): string { return 'Exports of activities linked to an accompanying period'; } + #[\Override] public function getLabels($key, array $values, $data) { if ('export_avg_activity_visit_duration' !== $key) { @@ -75,26 +81,31 @@ class AvgActivityVisitDuration implements ExportInterface, GroupedExportInterfac return static fn ($value) => '_header' === $value ? 'Average activities linked to an accompanying period visit duration' : $value; } + #[\Override] public function getQueryKeys($data): array { return ['export_avg_activity_visit_duration']; } + #[\Override] public function getResult($query, $data) { return $query->getQuery()->getResult(Query::HYDRATE_SCALAR); } + #[\Override] public function getTitle(): string { return 'Average activity linked to an accompanying period visit duration'; } + #[\Override] public function getType(): string { return Declarations::ACTIVITY; } + #[\Override] public function initiateQuery(array $requiredModifiers, array $acl, array $data = []) { $centers = array_map(static fn ($el) => $el['center'], $acl); @@ -124,11 +135,13 @@ class AvgActivityVisitDuration implements ExportInterface, GroupedExportInterfac return $qb; } + #[\Override] public function requiredRole(): string { return ActivityStatsVoter::STATS; } + #[\Override] public function supportsModifiers(): array { return [ diff --git a/src/Bundle/ChillActivityBundle/Export/Export/LinkedToACP/CountActivity.php b/src/Bundle/ChillActivityBundle/Export/Export/LinkedToACP/CountActivity.php index dfd5d966f..269de84e1 100644 --- a/src/Bundle/ChillActivityBundle/Export/Export/LinkedToACP/CountActivity.php +++ b/src/Bundle/ChillActivityBundle/Export/Export/LinkedToACP/CountActivity.php @@ -41,28 +41,34 @@ class CountActivity implements ExportInterface, GroupedExportInterface $this->filterStatsByCenters = $parameterBag->get('chill_main')['acl']['filter_stats_by_center']; } + #[\Override] public function buildForm(FormBuilderInterface $builder) {} + #[\Override] public function getFormDefaultData(): array { return []; } + #[\Override] public function getAllowedFormattersTypes(): array { return [FormatterInterface::TYPE_TABULAR]; } + #[\Override] public function getDescription(): string { return 'Count activities linked to an accompanying period by various parameters.'; } + #[\Override] public function getGroup(): string { return 'Exports of activities linked to an accompanying period'; } + #[\Override] public function getLabels($key, array $values, $data) { if ('export_count_activity' !== $key) { @@ -72,26 +78,31 @@ class CountActivity implements ExportInterface, GroupedExportInterface return static fn ($value) => '_header' === $value ? 'Number of activities linked to an accompanying period' : $value; } + #[\Override] public function getQueryKeys($data): array { return ['export_count_activity']; } + #[\Override] public function getResult($query, $data) { return $query->getQuery()->getResult(Query::HYDRATE_SCALAR); } + #[\Override] public function getTitle(): string { return 'Count activities linked to an accompanying period'; } + #[\Override] public function getType(): string { return Declarations::ACTIVITY; } + #[\Override] public function initiateQuery(array $requiredModifiers, array $acl, array $data = []) { $centers = array_map(static fn ($el) => $el['center'], $acl); @@ -120,11 +131,13 @@ class CountActivity implements ExportInterface, GroupedExportInterface return $qb; } + #[\Override] public function requiredRole(): string { return ActivityStatsVoter::STATS; } + #[\Override] public function supportsModifiers(): array { return [ diff --git a/src/Bundle/ChillActivityBundle/Export/Export/LinkedToACP/CountHouseholdOnActivity.php b/src/Bundle/ChillActivityBundle/Export/Export/LinkedToACP/CountHouseholdOnActivity.php index 41c05494c..9294c7d64 100644 --- a/src/Bundle/ChillActivityBundle/Export/Export/LinkedToACP/CountHouseholdOnActivity.php +++ b/src/Bundle/ChillActivityBundle/Export/Export/LinkedToACP/CountHouseholdOnActivity.php @@ -42,28 +42,34 @@ final readonly class CountHouseholdOnActivity implements ExportInterface, Groupe $this->filterStatsByCenters = $parameterBag->get('chill_main')['acl']['filter_stats_by_center']; } + #[\Override] public function buildForm(FormBuilderInterface $builder) {} + #[\Override] public function getFormDefaultData(): array { return []; } + #[\Override] public function getAllowedFormattersTypes(): array { return [FormatterInterface::TYPE_TABULAR]; } + #[\Override] public function getDescription(): string { return 'export.export.count_household_on_activity.description'; } + #[\Override] public function getGroup(): string { return 'Exports of activities linked to an accompanying period'; } + #[\Override] public function getLabels($key, array $values, $data) { if ('export_count_activity' !== $key) { @@ -73,26 +79,31 @@ final readonly class CountHouseholdOnActivity implements ExportInterface, Groupe return static fn ($value) => '_header' === $value ? 'export.export.count_household_on_activity.header' : $value; } + #[\Override] public function getQueryKeys($data): array { return ['export_count_activity']; } + #[\Override] public function getResult($query, $data) { return $query->getQuery()->getResult(Query::HYDRATE_SCALAR); } + #[\Override] public function getTitle(): string { return 'export.export.count_household_on_activity.title'; } + #[\Override] public function getType(): string { return Declarations::ACTIVITY; } + #[\Override] public function initiateQuery(array $requiredModifiers, array $acl, array $data = []) { $centers = array_map(static fn ($el) => $el['center'], $acl); @@ -129,11 +140,13 @@ final readonly class CountHouseholdOnActivity implements ExportInterface, Groupe return $qb; } + #[\Override] public function requiredRole(): string { return ActivityStatsVoter::STATS; } + #[\Override] public function supportsModifiers(): array { return [ diff --git a/src/Bundle/ChillActivityBundle/Export/Export/LinkedToACP/CountPersonsOnActivity.php b/src/Bundle/ChillActivityBundle/Export/Export/LinkedToACP/CountPersonsOnActivity.php index c49b9d4ad..6f0eae30e 100644 --- a/src/Bundle/ChillActivityBundle/Export/Export/LinkedToACP/CountPersonsOnActivity.php +++ b/src/Bundle/ChillActivityBundle/Export/Export/LinkedToACP/CountPersonsOnActivity.php @@ -41,28 +41,34 @@ class CountPersonsOnActivity implements ExportInterface, GroupedExportInterface $this->filterStatsByCenters = $parameterBag->get('chill_main')['acl']['filter_stats_by_center']; } + #[\Override] public function buildForm(FormBuilderInterface $builder) {} + #[\Override] public function getFormDefaultData(): array { return []; } + #[\Override] public function getAllowedFormattersTypes(): array { return [FormatterInterface::TYPE_TABULAR]; } + #[\Override] public function getDescription(): string { return 'export.export.count_person_on_activity.description'; } + #[\Override] public function getGroup(): string { return 'Exports of activities linked to an accompanying period'; } + #[\Override] public function getLabels($key, array $values, $data) { if ('export_count_activity' !== $key) { @@ -72,26 +78,31 @@ class CountPersonsOnActivity implements ExportInterface, GroupedExportInterface return static fn ($value) => '_header' === $value ? 'export.export.count_person_on_activity.header' : $value; } + #[\Override] public function getQueryKeys($data): array { return ['export_count_activity']; } + #[\Override] public function getResult($query, $data) { return $query->getQuery()->getResult(Query::HYDRATE_SCALAR); } + #[\Override] public function getTitle(): string { return 'export.export.count_person_on_activity.title'; } + #[\Override] public function getType(): string { return Declarations::ACTIVITY; } + #[\Override] public function initiateQuery(array $requiredModifiers, array $acl, array $data = []) { $centers = array_map(static fn ($el) => $el['center'], $acl); @@ -121,11 +132,13 @@ class CountPersonsOnActivity implements ExportInterface, GroupedExportInterface return $qb; } + #[\Override] public function requiredRole(): string { return ActivityStatsVoter::STATS; } + #[\Override] public function supportsModifiers(): array { return [ diff --git a/src/Bundle/ChillActivityBundle/Export/Export/LinkedToACP/ListActivity.php b/src/Bundle/ChillActivityBundle/Export/Export/LinkedToACP/ListActivity.php index aab2d7db8..fd0f76069 100644 --- a/src/Bundle/ChillActivityBundle/Export/Export/LinkedToACP/ListActivity.php +++ b/src/Bundle/ChillActivityBundle/Export/Export/LinkedToACP/ListActivity.php @@ -33,31 +33,37 @@ final readonly class ListActivity implements ListInterface, GroupedExportInterfa private FilterListAccompanyingPeriodHelperInterface $filterListAccompanyingPeriodHelper, ) {} + #[\Override] public function buildForm(FormBuilderInterface $builder) { $this->helper->buildForm($builder); } + #[\Override] public function getFormDefaultData(): array { return []; } + #[\Override] public function getAllowedFormattersTypes() { return $this->helper->getAllowedFormattersTypes(); } + #[\Override] public function getDescription() { return ListActivityHelper::MSG_KEY.'List activities linked to an accompanying course'; } + #[\Override] public function getGroup(): string { return 'Exports of activities linked to an accompanying period'; } + #[\Override] public function getLabels($key, array $values, $data) { return match ($key) { @@ -73,6 +79,7 @@ final readonly class ListActivity implements ListInterface, GroupedExportInterfa }; } + #[\Override] public function getQueryKeys($data) { return @@ -85,21 +92,25 @@ final readonly class ListActivity implements ListInterface, GroupedExportInterfa ); } + #[\Override] public function getResult($query, $data) { return $this->helper->getResult($query, $data); } + #[\Override] public function getTitle() { return ListActivityHelper::MSG_KEY.'List activity linked to a course'; } + #[\Override] public function getType() { return $this->helper->getType(); } + #[\Override] public function initiateQuery(array $requiredModifiers, array $acl, array $data = []) { $centers = array_map(static fn ($el) => $el['center'], $acl); @@ -135,11 +146,13 @@ final readonly class ListActivity implements ListInterface, GroupedExportInterfa return $qb; } + #[\Override] public function requiredRole(): string { return ActivityStatsVoter::LISTS; } + #[\Override] public function supportsModifiers() { return array_merge( diff --git a/src/Bundle/ChillActivityBundle/Export/Export/LinkedToACP/SumActivityDuration.php b/src/Bundle/ChillActivityBundle/Export/Export/LinkedToACP/SumActivityDuration.php index 159fcf78d..b871d3e6a 100644 --- a/src/Bundle/ChillActivityBundle/Export/Export/LinkedToACP/SumActivityDuration.php +++ b/src/Bundle/ChillActivityBundle/Export/Export/LinkedToACP/SumActivityDuration.php @@ -40,31 +40,37 @@ class SumActivityDuration implements ExportInterface, GroupedExportInterface $this->filterStatsByCenters = $parameterBag->get('chill_main')['acl']['filter_stats_by_center']; } + #[\Override] public function buildForm(FormBuilderInterface $builder) { // TODO: Implement buildForm() method. } + #[\Override] public function getFormDefaultData(): array { return []; } + #[\Override] public function getAllowedFormattersTypes(): array { return [FormatterInterface::TYPE_TABULAR]; } + #[\Override] public function getDescription(): string { return 'Sum activities linked to an accompanying period duration by various parameters.'; } + #[\Override] public function getGroup(): string { return 'Exports of activities linked to an accompanying period'; } + #[\Override] public function getLabels($key, array $values, $data) { if ('export_sum_activity_duration' !== $key) { @@ -74,26 +80,31 @@ class SumActivityDuration implements ExportInterface, GroupedExportInterface return static fn ($value) => '_header' === $value ? 'Sum activities linked to an accompanying period duration' : $value; } + #[\Override] public function getQueryKeys($data): array { return ['export_sum_activity_duration']; } + #[\Override] public function getResult($query, $data) { return $query->getQuery()->getResult(Query::HYDRATE_SCALAR); } + #[\Override] public function getTitle(): string { return 'Sum activity linked to an accompanying period duration'; } + #[\Override] public function getType(): string { return Declarations::ACTIVITY; } + #[\Override] public function initiateQuery(array $requiredModifiers, array $acl, array $data = []) { $centers = array_map(static fn ($el) => $el['center'], $acl); @@ -123,11 +134,13 @@ class SumActivityDuration implements ExportInterface, GroupedExportInterface return $qb; } + #[\Override] public function requiredRole(): string { return ActivityStatsVoter::STATS; } + #[\Override] public function supportsModifiers(): array { return [ diff --git a/src/Bundle/ChillActivityBundle/Export/Export/LinkedToACP/SumActivityVisitDuration.php b/src/Bundle/ChillActivityBundle/Export/Export/LinkedToACP/SumActivityVisitDuration.php index 27502e2b0..82f7f1059 100644 --- a/src/Bundle/ChillActivityBundle/Export/Export/LinkedToACP/SumActivityVisitDuration.php +++ b/src/Bundle/ChillActivityBundle/Export/Export/LinkedToACP/SumActivityVisitDuration.php @@ -40,31 +40,37 @@ class SumActivityVisitDuration implements ExportInterface, GroupedExportInterfac $this->filterStatsByCenters = $parameterBag->get('chill_main')['acl']['filter_stats_by_center']; } + #[\Override] public function buildForm(FormBuilderInterface $builder) { // TODO: Implement buildForm() method. } + #[\Override] public function getFormDefaultData(): array { return []; } + #[\Override] public function getAllowedFormattersTypes(): array { return [FormatterInterface::TYPE_TABULAR]; } + #[\Override] public function getDescription(): string { return 'Sum activities linked to an accompanying period visit duration by various parameters.'; } + #[\Override] public function getGroup(): string { return 'Exports of activities linked to an accompanying period'; } + #[\Override] public function getLabels($key, array $values, $data) { if ('export_sum_activity_visit_duration' !== $key) { @@ -74,26 +80,31 @@ class SumActivityVisitDuration implements ExportInterface, GroupedExportInterfac return static fn ($value) => '_header' === $value ? 'Sum activities linked to an accompanying period visit duration' : $value; } + #[\Override] public function getQueryKeys($data): array { return ['export_sum_activity_visit_duration']; } + #[\Override] public function getResult($query, $data) { return $query->getQuery()->getResult(Query::HYDRATE_SCALAR); } + #[\Override] public function getTitle(): string { return 'Sum activity linked to an accompanying period visit duration'; } + #[\Override] public function getType(): string { return Declarations::ACTIVITY; } + #[\Override] public function initiateQuery(array $requiredModifiers, array $acl, array $data = []) { $centers = array_map(static fn ($el) => $el['center'], $acl); @@ -123,11 +134,13 @@ class SumActivityVisitDuration implements ExportInterface, GroupedExportInterfac return $qb; } + #[\Override] public function requiredRole(): string { return ActivityStatsVoter::STATS; } + #[\Override] public function supportsModifiers(): array { return [ diff --git a/src/Bundle/ChillActivityBundle/Export/Export/LinkedToPerson/CountActivity.php b/src/Bundle/ChillActivityBundle/Export/Export/LinkedToPerson/CountActivity.php index e0a95b1f5..59f7ab6f1 100644 --- a/src/Bundle/ChillActivityBundle/Export/Export/LinkedToPerson/CountActivity.php +++ b/src/Bundle/ChillActivityBundle/Export/Export/LinkedToPerson/CountActivity.php @@ -33,28 +33,34 @@ class CountActivity implements ExportInterface, GroupedExportInterface $this->filterStatsByCenters = $parameterBag->get('chill_main')['acl']['filter_stats_by_center']; } + #[\Override] public function buildForm(FormBuilderInterface $builder) {} + #[\Override] public function getFormDefaultData(): array { return []; } + #[\Override] public function getAllowedFormattersTypes() { return [FormatterInterface::TYPE_TABULAR]; } + #[\Override] public function getDescription() { return 'Count activities linked to a person by various parameters.'; } + #[\Override] public function getGroup(): string { return 'Exports of activities linked to a person'; } + #[\Override] public function getLabels($key, array $values, $data) { if ('export_count_activity' !== $key) { @@ -64,26 +70,31 @@ class CountActivity implements ExportInterface, GroupedExportInterface return static fn ($value) => '_header' === $value ? 'Number of activities linked to a person' : $value; } + #[\Override] public function getQueryKeys($data) { return ['export_count_activity']; } + #[\Override] public function getResult($query, $data) { return $query->getQuery()->getResult(Query::HYDRATE_SCALAR); } + #[\Override] public function getTitle() { return 'Count activities linked to a person'; } + #[\Override] public function getType(): string { return Declarations::ACTIVITY; } + #[\Override] public function initiateQuery(array $requiredModifiers, array $acl, array $data = []) { $centers = array_map(static fn ($el) => $el['center'], $acl); @@ -113,11 +124,13 @@ class CountActivity implements ExportInterface, GroupedExportInterface return $qb; } + #[\Override] public function requiredRole(): string { return ActivityStatsVoter::STATS; } + #[\Override] public function supportsModifiers() { return [ diff --git a/src/Bundle/ChillActivityBundle/Export/Export/LinkedToPerson/CountHouseholdOnActivity.php b/src/Bundle/ChillActivityBundle/Export/Export/LinkedToPerson/CountHouseholdOnActivity.php index 31111a083..5b62f5193 100644 --- a/src/Bundle/ChillActivityBundle/Export/Export/LinkedToPerson/CountHouseholdOnActivity.php +++ b/src/Bundle/ChillActivityBundle/Export/Export/LinkedToPerson/CountHouseholdOnActivity.php @@ -34,28 +34,34 @@ final readonly class CountHouseholdOnActivity implements ExportInterface, Groupe $this->filterStatsByCenters = $parameterBag->get('chill_main')['acl']['filter_stats_by_center']; } + #[\Override] public function buildForm(FormBuilderInterface $builder) {} + #[\Override] public function getFormDefaultData(): array { return []; } + #[\Override] public function getAllowedFormattersTypes() { return [FormatterInterface::TYPE_TABULAR]; } + #[\Override] public function getDescription() { return 'export.export.count_household_on_activity_person.description'; } + #[\Override] public function getGroup(): string { return 'Exports of activities linked to a person'; } + #[\Override] public function getLabels($key, array $values, $data) { if ('export_count_activity' !== $key) { @@ -65,26 +71,31 @@ final readonly class CountHouseholdOnActivity implements ExportInterface, Groupe return static fn ($value) => '_header' === $value ? 'export.export.count_household_on_activity_person.header' : $value; } + #[\Override] public function getQueryKeys($data) { return ['export_count_activity']; } + #[\Override] public function getResult($query, $data) { return $query->getQuery()->getResult(Query::HYDRATE_SCALAR); } + #[\Override] public function getTitle() { return 'export.export.count_household_on_activity_person.title'; } + #[\Override] public function getType(): string { return Declarations::ACTIVITY; } + #[\Override] public function initiateQuery(array $requiredModifiers, array $acl, array $data = []) { $centers = array_map(static fn ($el) => $el['center'], $acl); @@ -121,11 +132,13 @@ final readonly class CountHouseholdOnActivity implements ExportInterface, Groupe return $qb; } + #[\Override] public function requiredRole(): string { return ActivityStatsVoter::STATS; } + #[\Override] public function supportsModifiers() { return [ diff --git a/src/Bundle/ChillActivityBundle/Export/Export/LinkedToPerson/ListActivity.php b/src/Bundle/ChillActivityBundle/Export/Export/LinkedToPerson/ListActivity.php index f7b5f3a8a..7b6ca2653 100644 --- a/src/Bundle/ChillActivityBundle/Export/Export/LinkedToPerson/ListActivity.php +++ b/src/Bundle/ChillActivityBundle/Export/Export/LinkedToPerson/ListActivity.php @@ -57,6 +57,7 @@ class ListActivity implements ListInterface, GroupedExportInterface $this->filterStatsByCenters = $parameterBag->get('chill_main')['acl']['filter_stats_by_center']; } + #[\Override] public function buildForm(FormBuilderInterface $builder) { $builder->add('fields', ChoiceType::class, [ @@ -76,26 +77,31 @@ class ListActivity implements ListInterface, GroupedExportInterface ]); } + #[\Override] public function getFormDefaultData(): array { return []; } + #[\Override] public function getAllowedFormattersTypes() { return [FormatterInterface::TYPE_LIST]; } + #[\Override] public function getDescription() { return 'List activities linked to a person description'; } + #[\Override] public function getGroup(): string { return 'Exports of activities linked to a person'; } + #[\Override] public function getLabels($key, array $values, $data) { switch ($key) { @@ -165,26 +171,31 @@ class ListActivity implements ListInterface, GroupedExportInterface } } + #[\Override] public function getQueryKeys($data) { return $data['fields']; } + #[\Override] public function getResult($query, $data) { return $query->getQuery()->getResult(Query::HYDRATE_SCALAR); } + #[\Override] public function getTitle() { return 'List activity linked to a person'; } + #[\Override] public function getType(): string { return Declarations::ACTIVITY; } + #[\Override] public function initiateQuery(array $requiredModifiers, array $acl, array $data = []) { $centers = array_map(static fn ($el) => $el['center'], $acl); @@ -279,11 +290,13 @@ class ListActivity implements ListInterface, GroupedExportInterface return $qb; } + #[\Override] public function requiredRole(): string { return ActivityStatsVoter::LISTS; } + #[\Override] public function supportsModifiers() { return [ diff --git a/src/Bundle/ChillActivityBundle/Export/Export/LinkedToPerson/StatActivityDuration.php b/src/Bundle/ChillActivityBundle/Export/Export/LinkedToPerson/StatActivityDuration.php index 3cdadac67..3edb6eb24 100644 --- a/src/Bundle/ChillActivityBundle/Export/Export/LinkedToPerson/StatActivityDuration.php +++ b/src/Bundle/ChillActivityBundle/Export/Export/LinkedToPerson/StatActivityDuration.php @@ -30,7 +30,7 @@ use Symfony\Component\Form\FormBuilderInterface; */ class StatActivityDuration implements ExportInterface, GroupedExportInterface { - final public const SUM = 'sum'; + final public const string SUM = 'sum'; private readonly bool $filterStatsByCenters; /** @@ -47,18 +47,22 @@ class StatActivityDuration implements ExportInterface, GroupedExportInterface $this->filterStatsByCenters = $parameterBag->get('chill_main')['acl']['filter_stats_by_center']; } + #[\Override] public function buildForm(FormBuilderInterface $builder) {} + #[\Override] public function getFormDefaultData(): array { return []; } + #[\Override] public function getAllowedFormattersTypes() { return [FormatterInterface::TYPE_TABULAR]; } + #[\Override] public function getDescription() { if (self::SUM === $this->action) { @@ -68,11 +72,13 @@ class StatActivityDuration implements ExportInterface, GroupedExportInterface throw new \LogicException('this action is not supported: '.$this->action); } + #[\Override] public function getGroup(): string { return 'Exports of activities linked to a person'; } + #[\Override] public function getLabels($key, array $values, $data) { if ('export_stat_activity' !== $key) { @@ -84,16 +90,19 @@ class StatActivityDuration implements ExportInterface, GroupedExportInterface return static fn (string $value) => '_header' === $value ? $header : $value; } + #[\Override] public function getQueryKeys($data) { return ['export_stat_activity']; } + #[\Override] public function getResult($query, $data) { return $query->getQuery()->getResult(Query::HYDRATE_SCALAR); } + #[\Override] public function getTitle() { if (self::SUM === $this->action) { @@ -103,11 +112,13 @@ class StatActivityDuration implements ExportInterface, GroupedExportInterface throw new \LogicException('This action is not supported: '.$this->action); } + #[\Override] public function getType(): string { return Declarations::ACTIVITY; } + #[\Override] public function initiateQuery(array $requiredModifiers, array $acl, array $data = []) { $centers = array_map( @@ -145,11 +156,13 @@ class StatActivityDuration implements ExportInterface, GroupedExportInterface return $qb; } + #[\Override] public function requiredRole(): string { return ActivityStatsVoter::STATS; } + #[\Override] public function supportsModifiers() { return [ diff --git a/src/Bundle/ChillActivityBundle/Export/Export/ListActivityHelper.php b/src/Bundle/ChillActivityBundle/Export/Export/ListActivityHelper.php index 15137b013..c4d8a421c 100644 --- a/src/Bundle/ChillActivityBundle/Export/Export/ListActivityHelper.php +++ b/src/Bundle/ChillActivityBundle/Export/Export/ListActivityHelper.php @@ -28,7 +28,7 @@ use Symfony\Contracts\Translation\TranslatorInterface; class ListActivityHelper { - final public const MSG_KEY = 'export.list.activity.'; + final public const string MSG_KEY = 'export.list.activity.'; public function __construct( private readonly ActivityPresenceRepositoryInterface $activityPresenceRepository, diff --git a/src/Bundle/ChillActivityBundle/Export/Filter/ACPFilters/ActivityTypeFilter.php b/src/Bundle/ChillActivityBundle/Export/Filter/ACPFilters/ActivityTypeFilter.php index 7c6eb0bb2..fde53d763 100644 --- a/src/Bundle/ChillActivityBundle/Export/Filter/ACPFilters/ActivityTypeFilter.php +++ b/src/Bundle/ChillActivityBundle/Export/Filter/ACPFilters/ActivityTypeFilter.php @@ -25,7 +25,7 @@ use Symfony\Component\Form\FormBuilderInterface; final readonly class ActivityTypeFilter implements FilterInterface { - private const BASE_EXISTS = 'SELECT 1 FROM '.Activity::class.' act_type_filter_activity WHERE act_type_filter_activity.accompanyingPeriod = acp'; + private const string BASE_EXISTS = 'SELECT 1 FROM '.Activity::class.' act_type_filter_activity WHERE act_type_filter_activity.accompanyingPeriod = acp'; public function __construct( private ActivityTypeRepositoryInterface $activityTypeRepository, @@ -33,11 +33,13 @@ final readonly class ActivityTypeFilter implements FilterInterface private RollingDateConverterInterface $rollingDateConverter, ) {} + #[\Override] public function addRole(): ?string { return null; } + #[\Override] public function alterQuery(QueryBuilder $qb, $data) { $exists = self::BASE_EXISTS; @@ -62,11 +64,13 @@ final readonly class ActivityTypeFilter implements FilterInterface } } + #[\Override] public function applyOn() { return Declarations::ACP_TYPE; } + #[\Override] public function buildForm(FormBuilderInterface $builder) { $builder->add('accepted_activitytypes', EntityType::class, [ @@ -92,6 +96,7 @@ final readonly class ActivityTypeFilter implements FilterInterface ]); } + #[\Override] public function getFormDefaultData(): array { return [ @@ -101,6 +106,7 @@ final readonly class ActivityTypeFilter implements FilterInterface ]; } + #[\Override] public function describeAction($data, $format = 'string'): array { $types = []; @@ -118,6 +124,7 @@ final readonly class ActivityTypeFilter implements FilterInterface ]]; } + #[\Override] public function getTitle(): string { return 'Filter accompanying course by activity type'; diff --git a/src/Bundle/ChillActivityBundle/Export/Filter/ACPFilters/BySocialActionFilter.php b/src/Bundle/ChillActivityBundle/Export/Filter/ACPFilters/BySocialActionFilter.php index 13349baa5..9374c81c4 100644 --- a/src/Bundle/ChillActivityBundle/Export/Filter/ACPFilters/BySocialActionFilter.php +++ b/src/Bundle/ChillActivityBundle/Export/Filter/ACPFilters/BySocialActionFilter.php @@ -23,11 +23,13 @@ class BySocialActionFilter implements FilterInterface { public function __construct(private readonly SocialActionRender $actionRender) {} + #[\Override] public function addRole(): ?string { return null; } + #[\Override] public function alterQuery(QueryBuilder $qb, $data) { if (!\in_array('actsocialaction', $qb->getAllAliases(), true)) { @@ -43,11 +45,13 @@ class BySocialActionFilter implements FilterInterface ); } + #[\Override] public function applyOn(): string { return Declarations::ACTIVITY_ACP; } + #[\Override] public function buildForm(FormBuilderInterface $builder) { $builder->add('accepted_socialactions', PickSocialActionType::class, [ @@ -55,11 +59,13 @@ class BySocialActionFilter implements FilterInterface ]); } + #[\Override] public function getFormDefaultData(): array { return []; } + #[\Override] public function describeAction($data, $format = 'string'): array { $actions = []; @@ -75,6 +81,7 @@ class BySocialActionFilter implements FilterInterface ]]; } + #[\Override] public function getTitle(): string { return 'Filter activity by linked socialaction'; diff --git a/src/Bundle/ChillActivityBundle/Export/Filter/ACPFilters/BySocialIssueFilter.php b/src/Bundle/ChillActivityBundle/Export/Filter/ACPFilters/BySocialIssueFilter.php index bef40290e..b02c56362 100644 --- a/src/Bundle/ChillActivityBundle/Export/Filter/ACPFilters/BySocialIssueFilter.php +++ b/src/Bundle/ChillActivityBundle/Export/Filter/ACPFilters/BySocialIssueFilter.php @@ -23,11 +23,13 @@ class BySocialIssueFilter implements FilterInterface { public function __construct(private readonly SocialIssueRender $issueRender) {} + #[\Override] public function addRole(): ?string { return null; } + #[\Override] public function alterQuery(QueryBuilder $qb, $data) { if (!\in_array('actsocialissue', $qb->getAllAliases(), true)) { @@ -43,11 +45,13 @@ class BySocialIssueFilter implements FilterInterface ); } + #[\Override] public function applyOn(): string { return Declarations::ACTIVITY_ACP; } + #[\Override] public function buildForm(FormBuilderInterface $builder) { $builder->add('accepted_socialissues', PickSocialIssueType::class, [ @@ -55,11 +59,13 @@ class BySocialIssueFilter implements FilterInterface ]); } + #[\Override] public function getFormDefaultData(): array { return []; } + #[\Override] public function describeAction($data, $format = 'string'): array { $issues = []; @@ -75,6 +81,7 @@ class BySocialIssueFilter implements FilterInterface ]]; } + #[\Override] public function getTitle(): string { return 'Filter activity by linked socialissue'; diff --git a/src/Bundle/ChillActivityBundle/Export/Filter/ACPFilters/HasNoActivityFilter.php b/src/Bundle/ChillActivityBundle/Export/Filter/ACPFilters/HasNoActivityFilter.php index afd708d33..dc4c23989 100644 --- a/src/Bundle/ChillActivityBundle/Export/Filter/ACPFilters/HasNoActivityFilter.php +++ b/src/Bundle/ChillActivityBundle/Export/Filter/ACPFilters/HasNoActivityFilter.php @@ -22,11 +22,13 @@ use Symfony\Component\Form\FormBuilderInterface; */ class HasNoActivityFilter implements FilterInterface { + #[\Override] public function addRole(): ?string { return null; } + #[\Override] public function alterQuery(QueryBuilder $qb, $data) { $qb @@ -38,26 +40,31 @@ class HasNoActivityFilter implements FilterInterface '); } + #[\Override] public function applyOn(): string { return Declarations::ACP_TYPE; } + #[\Override] public function buildForm(FormBuilderInterface $builder) { // no form needed } + #[\Override] public function getFormDefaultData(): array { return []; } + #[\Override] public function describeAction($data, $format = 'string'): array { return ['Filtered acp which has no activities', []]; } + #[\Override] public function getTitle(): string { return 'Filter acp which has no activity'; diff --git a/src/Bundle/ChillActivityBundle/Export/Filter/ACPFilters/PeriodHavingActivityBetweenDatesFilter.php b/src/Bundle/ChillActivityBundle/Export/Filter/ACPFilters/PeriodHavingActivityBetweenDatesFilter.php index 1a006ba97..42a63fd77 100644 --- a/src/Bundle/ChillActivityBundle/Export/Filter/ACPFilters/PeriodHavingActivityBetweenDatesFilter.php +++ b/src/Bundle/ChillActivityBundle/Export/Filter/ACPFilters/PeriodHavingActivityBetweenDatesFilter.php @@ -25,11 +25,13 @@ final readonly class PeriodHavingActivityBetweenDatesFilter implements FilterInt private RollingDateConverterInterface $rollingDateConverter, ) {} + #[\Override] public function getTitle() { return 'export.filter.activity.course_having_activity_between_date.Title'; } + #[\Override] public function buildForm(FormBuilderInterface $builder) { $builder @@ -41,6 +43,7 @@ final readonly class PeriodHavingActivityBetweenDatesFilter implements FilterInt ]); } + #[\Override] public function getFormDefaultData(): array { return [ @@ -49,6 +52,7 @@ final readonly class PeriodHavingActivityBetweenDatesFilter implements FilterInt ]; } + #[\Override] public function describeAction($data, $format = 'string') { return [ @@ -60,11 +64,13 @@ final readonly class PeriodHavingActivityBetweenDatesFilter implements FilterInt ]; } + #[\Override] public function addRole(): ?string { return null; } + #[\Override] public function alterQuery(QueryBuilder $qb, $data) { $alias = 'act_period_having_act_betw_date_alias'; @@ -82,6 +88,7 @@ final readonly class PeriodHavingActivityBetweenDatesFilter implements FilterInt ->setParameter($to, $this->rollingDateConverter->convert($data['end_date'])); } + #[\Override] public function applyOn() { return \Chill\PersonBundle\Export\Declarations::ACP_TYPE; diff --git a/src/Bundle/ChillActivityBundle/Export/Filter/ActivityDateFilter.php b/src/Bundle/ChillActivityBundle/Export/Filter/ActivityDateFilter.php index e3d7796d3..a61afc09f 100644 --- a/src/Bundle/ChillActivityBundle/Export/Filter/ActivityDateFilter.php +++ b/src/Bundle/ChillActivityBundle/Export/Filter/ActivityDateFilter.php @@ -25,11 +25,13 @@ class ActivityDateFilter implements FilterInterface { public function __construct(protected TranslatorInterface $translator, private readonly RollingDateConverterInterface $rollingDateConverter) {} + #[\Override] public function addRole(): ?string { return null; } + #[\Override] public function alterQuery(QueryBuilder $qb, $data) { $where = $qb->getDQLPart('where'); @@ -56,11 +58,13 @@ class ActivityDateFilter implements FilterInterface ); } + #[\Override] public function applyOn(): string { return Declarations::ACTIVITY; } + #[\Override] public function buildForm(FormBuilderInterface $builder) { $builder @@ -72,11 +76,13 @@ class ActivityDateFilter implements FilterInterface ]); } + #[\Override] public function getFormDefaultData(): array { return ['date_from' => new RollingDate(RollingDate::T_YEAR_PREVIOUS_START), 'date_to' => new RollingDate(RollingDate::T_TODAY)]; } + #[\Override] public function describeAction($data, $format = 'string') { return [ @@ -88,6 +94,7 @@ class ActivityDateFilter implements FilterInterface ]; } + #[\Override] public function getTitle() { return 'Filtered by date activity'; diff --git a/src/Bundle/ChillActivityBundle/Export/Filter/ActivityPresenceFilter.php b/src/Bundle/ChillActivityBundle/Export/Filter/ActivityPresenceFilter.php index 201b9f810..77e88b035 100644 --- a/src/Bundle/ChillActivityBundle/Export/Filter/ActivityPresenceFilter.php +++ b/src/Bundle/ChillActivityBundle/Export/Filter/ActivityPresenceFilter.php @@ -28,11 +28,13 @@ final readonly class ActivityPresenceFilter implements FilterInterface private TranslatorInterface $translator ) {} + #[\Override] public function getTitle() { return 'export.filter.activity.by_presence.Filter activity by activity presence'; } + #[\Override] public function buildForm(FormBuilderInterface $builder) { $builder->add('presences', EntityType::class, [ @@ -45,11 +47,13 @@ final readonly class ActivityPresenceFilter implements FilterInterface ]); } + #[\Override] public function getFormDefaultData(): array { return []; } + #[\Override] public function describeAction($data, $format = 'string') { $presences = array_map( @@ -63,11 +67,13 @@ final readonly class ActivityPresenceFilter implements FilterInterface ]; } + #[\Override] public function addRole(): ?string { return null; } + #[\Override] public function alterQuery(QueryBuilder $qb, $data) { $qb @@ -75,6 +81,7 @@ final readonly class ActivityPresenceFilter implements FilterInterface ->setParameter('activity_presence_filter_presences', $data['presences']); } + #[\Override] public function applyOn() { return Declarations::ACTIVITY; diff --git a/src/Bundle/ChillActivityBundle/Export/Filter/ActivityTypeFilter.php b/src/Bundle/ChillActivityBundle/Export/Filter/ActivityTypeFilter.php index ae47146df..a56e12774 100644 --- a/src/Bundle/ChillActivityBundle/Export/Filter/ActivityTypeFilter.php +++ b/src/Bundle/ChillActivityBundle/Export/Filter/ActivityTypeFilter.php @@ -29,11 +29,13 @@ class ActivityTypeFilter implements ExportElementValidatedInterface, FilterInter protected ActivityTypeRepositoryInterface $activityTypeRepository ) {} + #[\Override] public function addRole(): ?string { return null; } + #[\Override] public function alterQuery(QueryBuilder $qb, $data) { $clause = $qb->expr()->in('activity.activityType', ':selected_activity_types'); @@ -42,11 +44,13 @@ class ActivityTypeFilter implements ExportElementValidatedInterface, FilterInter $qb->setParameter('selected_activity_types', $data['types']); } + #[\Override] public function applyOn(): string { return Declarations::ACTIVITY; } + #[\Override] public function buildForm(FormBuilderInterface $builder) { $builder->add('types', EntityType::class, [ @@ -70,11 +74,13 @@ class ActivityTypeFilter implements ExportElementValidatedInterface, FilterInter ]); } + #[\Override] public function getFormDefaultData(): array { return []; } + #[\Override] public function describeAction($data, $format = 'string') { // collect all the reasons'name used in this filter in one array @@ -88,11 +94,13 @@ class ActivityTypeFilter implements ExportElementValidatedInterface, FilterInter ]]; } + #[\Override] public function getTitle() { return 'Filter by activity type'; } + #[\Override] public function validateForm($data, ExecutionContextInterface $context) { if (null === $data['types'] || 0 === \count($data['types'])) { diff --git a/src/Bundle/ChillActivityBundle/Export/Filter/ActivityUsersFilter.php b/src/Bundle/ChillActivityBundle/Export/Filter/ActivityUsersFilter.php index 56285c026..e1f3205e8 100644 --- a/src/Bundle/ChillActivityBundle/Export/Filter/ActivityUsersFilter.php +++ b/src/Bundle/ChillActivityBundle/Export/Filter/ActivityUsersFilter.php @@ -22,11 +22,13 @@ class ActivityUsersFilter implements FilterInterface { public function __construct(private readonly UserRender $userRender) {} + #[\Override] public function addRole(): ?string { return null; } + #[\Override] public function alterQuery(QueryBuilder $qb, $data) { $orX = $qb->expr()->orX(); @@ -39,11 +41,13 @@ class ActivityUsersFilter implements FilterInterface $qb->andWhere($orX); } + #[\Override] public function applyOn() { return Declarations::ACTIVITY; } + #[\Override] public function buildForm(FormBuilderInterface $builder) { $builder->add('accepted_users', PickUserDynamicType::class, [ @@ -52,11 +56,13 @@ class ActivityUsersFilter implements FilterInterface ]); } + #[\Override] public function getFormDefaultData(): array { return []; } + #[\Override] public function describeAction($data, $format = 'string') { $users = []; @@ -70,6 +76,7 @@ class ActivityUsersFilter implements FilterInterface ]]; } + #[\Override] public function getTitle(): string { return 'Filter activity by users'; diff --git a/src/Bundle/ChillActivityBundle/Export/Filter/ByCreatorFilter.php b/src/Bundle/ChillActivityBundle/Export/Filter/ByCreatorFilter.php index f75c5a817..4f1e447fa 100644 --- a/src/Bundle/ChillActivityBundle/Export/Filter/ByCreatorFilter.php +++ b/src/Bundle/ChillActivityBundle/Export/Filter/ByCreatorFilter.php @@ -22,11 +22,13 @@ class ByCreatorFilter implements FilterInterface { public function __construct(private readonly UserRender $userRender) {} + #[\Override] public function addRole(): ?string { return null; } + #[\Override] public function alterQuery(QueryBuilder $qb, $data) { $qb @@ -36,11 +38,13 @@ class ByCreatorFilter implements FilterInterface ->setParameter('users', $data['accepted_users']); } + #[\Override] public function applyOn(): string { return Declarations::ACTIVITY; } + #[\Override] public function buildForm(FormBuilderInterface $builder) { $builder->add('accepted_users', PickUserDynamicType::class, [ @@ -48,11 +52,13 @@ class ByCreatorFilter implements FilterInterface ]); } + #[\Override] public function getFormDefaultData(): array { return []; } + #[\Override] public function describeAction($data, $format = 'string'): array { $users = []; @@ -66,6 +72,7 @@ class ByCreatorFilter implements FilterInterface ]]; } + #[\Override] public function getTitle(): string { return 'Filter activity by creator'; diff --git a/src/Bundle/ChillActivityBundle/Export/Filter/CreatorJobFilter.php b/src/Bundle/ChillActivityBundle/Export/Filter/CreatorJobFilter.php index 3b805d4ff..e62ed4a69 100644 --- a/src/Bundle/ChillActivityBundle/Export/Filter/CreatorJobFilter.php +++ b/src/Bundle/ChillActivityBundle/Export/Filter/CreatorJobFilter.php @@ -26,7 +26,7 @@ use Symfony\Contracts\Translation\TranslatorInterface; final readonly class CreatorJobFilter implements FilterInterface { - private const PREFIX = 'acp_act_filter_creator_job'; + private const string PREFIX = 'acp_act_filter_creator_job'; public function __construct( private TranslatableStringHelper $translatableStringHelper, @@ -34,11 +34,13 @@ final readonly class CreatorJobFilter implements FilterInterface private UserJobRepositoryInterface $userJobRepository, ) {} + #[\Override] public function addRole(): ?string { return null; } + #[\Override] public function alterQuery(QueryBuilder $qb, $data) { $p = self::PREFIX; @@ -70,11 +72,13 @@ final readonly class CreatorJobFilter implements FilterInterface ); } + #[\Override] public function applyOn(): string { return Declarations::ACTIVITY; } + #[\Override] public function buildForm(FormBuilderInterface $builder) { $builder @@ -90,6 +94,7 @@ final readonly class CreatorJobFilter implements FilterInterface ]); } + #[\Override] public function describeAction($data, $format = 'string'): array { $jobs = array_map( @@ -102,6 +107,7 @@ final readonly class CreatorJobFilter implements FilterInterface ]]; } + #[\Override] public function getFormDefaultData(): array { return [ @@ -109,6 +115,7 @@ final readonly class CreatorJobFilter implements FilterInterface ]; } + #[\Override] public function getTitle(): string { return 'export.filter.activity.by_creator_job.Filter activity by user job'; diff --git a/src/Bundle/ChillActivityBundle/Export/Filter/CreatorScopeFilter.php b/src/Bundle/ChillActivityBundle/Export/Filter/CreatorScopeFilter.php index 36b827e9b..2a3669034 100644 --- a/src/Bundle/ChillActivityBundle/Export/Filter/CreatorScopeFilter.php +++ b/src/Bundle/ChillActivityBundle/Export/Filter/CreatorScopeFilter.php @@ -24,18 +24,20 @@ use Symfony\Component\Form\FormBuilderInterface; class CreatorScopeFilter implements FilterInterface { - private const PREFIX = 'acp_act_filter_creator_scope'; + private const string PREFIX = 'acp_act_filter_creator_scope'; public function __construct( private readonly TranslatableStringHelper $translatableStringHelper, private readonly ScopeRepositoryInterface $scopeRepository, ) {} + #[\Override] public function addRole(): ?string { return null; } + #[\Override] public function alterQuery(QueryBuilder $qb, $data) { $p = self::PREFIX; @@ -67,11 +69,13 @@ class CreatorScopeFilter implements FilterInterface ); } + #[\Override] public function applyOn(): string { return Declarations::ACTIVITY; } + #[\Override] public function buildForm(FormBuilderInterface $builder) { $builder @@ -86,6 +90,7 @@ class CreatorScopeFilter implements FilterInterface ]); } + #[\Override] public function describeAction($data, $format = 'string'): array { $scopes = []; @@ -101,6 +106,7 @@ class CreatorScopeFilter implements FilterInterface ]]; } + #[\Override] public function getFormDefaultData(): array { return [ @@ -108,6 +114,7 @@ class CreatorScopeFilter implements FilterInterface ]; } + #[\Override] public function getTitle(): string { return 'export.filter.activity.by_creator_scope.Filter activity by user scope'; diff --git a/src/Bundle/ChillActivityBundle/Export/Filter/EmergencyFilter.php b/src/Bundle/ChillActivityBundle/Export/Filter/EmergencyFilter.php index b74be2552..b2cf139a1 100644 --- a/src/Bundle/ChillActivityBundle/Export/Filter/EmergencyFilter.php +++ b/src/Bundle/ChillActivityBundle/Export/Filter/EmergencyFilter.php @@ -21,20 +21,22 @@ use Symfony\Contracts\Translation\TranslatorInterface; class EmergencyFilter implements FilterInterface { - private const CHOICES = [ + private const array CHOICES = [ 'activity is emergency' => 'true', 'activity is not emergency' => 'false', ]; - private const DEFAULT_CHOICE = 'false'; + private const string DEFAULT_CHOICE = 'false'; public function __construct(private readonly TranslatorInterface $translator) {} + #[\Override] public function addRole(): ?string { return null; } + #[\Override] public function alterQuery(QueryBuilder $qb, $data) { $where = $qb->getDQLPart('where'); @@ -51,11 +53,13 @@ class EmergencyFilter implements FilterInterface $qb->setParameter('emergency', $data['accepted_emergency']); } + #[\Override] public function applyOn(): string { return Declarations::ACTIVITY; } + #[\Override] public function buildForm(FormBuilderInterface $builder) { $builder->add('accepted_emergency', ChoiceType::class, [ @@ -66,11 +70,13 @@ class EmergencyFilter implements FilterInterface ]); } + #[\Override] public function getFormDefaultData(): array { return ['accepted_emergency' => self::DEFAULT_CHOICE]; } + #[\Override] public function describeAction($data, $format = 'string'): array { return [ @@ -82,6 +88,7 @@ class EmergencyFilter implements FilterInterface ]; } + #[\Override] public function getTitle(): string { return 'Filter activity by emergency'; diff --git a/src/Bundle/ChillActivityBundle/Export/Filter/LocationFilter.php b/src/Bundle/ChillActivityBundle/Export/Filter/LocationFilter.php index 77b4ce20d..60d1b2c92 100644 --- a/src/Bundle/ChillActivityBundle/Export/Filter/LocationFilter.php +++ b/src/Bundle/ChillActivityBundle/Export/Filter/LocationFilter.php @@ -19,11 +19,13 @@ use Symfony\Component\Form\FormBuilderInterface; class LocationFilter implements FilterInterface { + #[\Override] public function addRole(): ?string { return null; } + #[\Override] public function alterQuery(QueryBuilder $qb, $data) { $qb->andWhere( @@ -33,11 +35,13 @@ class LocationFilter implements FilterInterface $qb->setParameter('location', $data['accepted_location']); } + #[\Override] public function applyOn(): string { return Declarations::ACTIVITY; } + #[\Override] public function buildForm(FormBuilderInterface $builder) { $builder->add('accepted_location', PickUserLocationType::class, [ @@ -46,11 +50,13 @@ class LocationFilter implements FilterInterface ]); } + #[\Override] public function getFormDefaultData(): array { return []; } + #[\Override] public function describeAction($data, $format = 'string'): array { $locations = []; @@ -64,6 +70,7 @@ class LocationFilter implements FilterInterface ]]; } + #[\Override] public function getTitle(): string { return 'Filter activity by location'; diff --git a/src/Bundle/ChillActivityBundle/Export/Filter/LocationTypeFilter.php b/src/Bundle/ChillActivityBundle/Export/Filter/LocationTypeFilter.php index 771dfca30..e113b65b9 100644 --- a/src/Bundle/ChillActivityBundle/Export/Filter/LocationTypeFilter.php +++ b/src/Bundle/ChillActivityBundle/Export/Filter/LocationTypeFilter.php @@ -23,11 +23,13 @@ class LocationTypeFilter implements FilterInterface { public function __construct(private readonly TranslatableStringHelper $translatableStringHelper) {} + #[\Override] public function addRole(): ?string { return null; } + #[\Override] public function alterQuery(QueryBuilder $qb, $data) { if (!\in_array('actloc', $qb->getAllAliases(), true)) { @@ -47,11 +49,13 @@ class LocationTypeFilter implements FilterInterface $qb->setParameter('locationtype', $data['accepted_locationtype']); } + #[\Override] public function applyOn(): string { return Declarations::ACTIVITY; } + #[\Override] public function buildForm(FormBuilderInterface $builder) { $builder->add('accepted_locationtype', PickLocationTypeType::class, [ @@ -60,11 +64,13 @@ class LocationTypeFilter implements FilterInterface ]); } + #[\Override] public function getFormDefaultData(): array { return []; } + #[\Override] public function describeAction($data, $format = 'string'): array { $types = []; @@ -80,6 +86,7 @@ class LocationTypeFilter implements FilterInterface ]]; } + #[\Override] public function getTitle(): string { return 'Filter activity by locationtype'; diff --git a/src/Bundle/ChillActivityBundle/Export/Filter/PersonFilters/ActivityReasonFilter.php b/src/Bundle/ChillActivityBundle/Export/Filter/PersonFilters/ActivityReasonFilter.php index b8ce3259f..4dbe13ef8 100644 --- a/src/Bundle/ChillActivityBundle/Export/Filter/PersonFilters/ActivityReasonFilter.php +++ b/src/Bundle/ChillActivityBundle/Export/Filter/PersonFilters/ActivityReasonFilter.php @@ -28,11 +28,13 @@ class ActivityReasonFilter implements ExportElementValidatedInterface, FilterInt { public function __construct(protected TranslatableStringHelper $translatableStringHelper, protected ActivityReasonRepository $activityReasonRepository) {} + #[\Override] public function addRole(): ?string { return null; } + #[\Override] public function alterQuery(QueryBuilder $qb, $data) { $where = $qb->getDQLPart('where'); @@ -53,11 +55,13 @@ class ActivityReasonFilter implements ExportElementValidatedInterface, FilterInt $qb->setParameter('selected_activity_reasons', $data['reasons']); } + #[\Override] public function applyOn(): string { return Declarations::ACTIVITY_PERSON; } + #[\Override] public function buildForm(FormBuilderInterface $builder) { $builder->add('reasons', EntityType::class, [ @@ -70,11 +74,13 @@ class ActivityReasonFilter implements ExportElementValidatedInterface, FilterInt ]); } + #[\Override] public function getFormDefaultData(): array { return []; } + #[\Override] public function describeAction($data, $format = 'string') { // collect all the reasons'name used in this filter in one array @@ -91,11 +97,13 @@ class ActivityReasonFilter implements ExportElementValidatedInterface, FilterInt ]; } + #[\Override] public function getTitle() { return 'Filter by reason'; } + #[\Override] public function validateForm($data, ExecutionContextInterface $context) { if (null === $data['reasons'] || 0 === \count($data['reasons'])) { diff --git a/src/Bundle/ChillActivityBundle/Export/Filter/PersonFilters/PersonHavingActivityBetweenDateFilter.php b/src/Bundle/ChillActivityBundle/Export/Filter/PersonFilters/PersonHavingActivityBetweenDateFilter.php index eb2312c0e..7a65b8e8e 100644 --- a/src/Bundle/ChillActivityBundle/Export/Filter/PersonFilters/PersonHavingActivityBetweenDateFilter.php +++ b/src/Bundle/ChillActivityBundle/Export/Filter/PersonFilters/PersonHavingActivityBetweenDateFilter.php @@ -34,11 +34,13 @@ final readonly class PersonHavingActivityBetweenDateFilter implements ExportElem private RollingDateConverterInterface $rollingDateConverter, ) {} + #[\Override] public function addRole(): ?string { return null; } + #[\Override] public function alterQuery(QueryBuilder $qb, $data) { // create a subquery for activity @@ -83,11 +85,13 @@ final readonly class PersonHavingActivityBetweenDateFilter implements ExportElem ); } + #[\Override] public function applyOn(): string { return Declarations::PERSON_TYPE; } + #[\Override] public function buildForm(FormBuilderInterface $builder) { $builder->add('date_from_rolling', PickRollingDateType::class, [ @@ -112,6 +116,7 @@ final readonly class PersonHavingActivityBetweenDateFilter implements ExportElem } } + #[\Override] public function getFormDefaultData(): array { return [ @@ -121,6 +126,7 @@ final readonly class PersonHavingActivityBetweenDateFilter implements ExportElem ]; } + #[\Override] public function describeAction($data, $format = 'string') { return [ @@ -141,11 +147,13 @@ final readonly class PersonHavingActivityBetweenDateFilter implements ExportElem ]; } + #[\Override] public function getTitle() { return 'export.filter.activity.person_between_dates.title'; } + #[\Override] public function validateForm($data, ExecutionContextInterface $context) { if ($this->rollingDateConverter->convert($data['date_from_rolling']) diff --git a/src/Bundle/ChillActivityBundle/Export/Filter/PersonsFilter.php b/src/Bundle/ChillActivityBundle/Export/Filter/PersonsFilter.php index 8bdefeb24..93257318e 100644 --- a/src/Bundle/ChillActivityBundle/Export/Filter/PersonsFilter.php +++ b/src/Bundle/ChillActivityBundle/Export/Filter/PersonsFilter.php @@ -24,15 +24,17 @@ use Symfony\Component\Form\FormBuilderInterface; */ final readonly class PersonsFilter implements FilterInterface { - private const PREFIX = 'act_persons_filter'; + private const string PREFIX = 'act_persons_filter'; public function __construct(private PersonRenderInterface $personRender) {} + #[\Override] public function addRole(): ?string { return null; } + #[\Override] public function alterQuery(QueryBuilder $qb, $data) { $p = self::PREFIX; @@ -47,11 +49,13 @@ final readonly class PersonsFilter implements FilterInterface $qb->andWhere($orX); } + #[\Override] public function applyOn() { return Declarations::ACTIVITY; } + #[\Override] public function buildForm(FormBuilderInterface $builder) { $builder->add('accepted_persons', PickPersonDynamicType::class, [ @@ -60,6 +64,7 @@ final readonly class PersonsFilter implements FilterInterface ]); } + #[\Override] public function getFormDefaultData(): array { return [ @@ -67,6 +72,7 @@ final readonly class PersonsFilter implements FilterInterface ]; } + #[\Override] public function describeAction($data, $format = 'string') { $users = []; @@ -80,6 +86,7 @@ final readonly class PersonsFilter implements FilterInterface ]]; } + #[\Override] public function getTitle(): string { return 'export.filter.activity.by_persons.Filter activity by persons'; diff --git a/src/Bundle/ChillActivityBundle/Export/Filter/SentReceivedFilter.php b/src/Bundle/ChillActivityBundle/Export/Filter/SentReceivedFilter.php index 3011627e8..0f0c2ec10 100644 --- a/src/Bundle/ChillActivityBundle/Export/Filter/SentReceivedFilter.php +++ b/src/Bundle/ChillActivityBundle/Export/Filter/SentReceivedFilter.php @@ -22,20 +22,22 @@ use Symfony\Contracts\Translation\TranslatorInterface; class SentReceivedFilter implements FilterInterface { - private const CHOICES = [ + private const array CHOICES = [ 'export.filter.activity.by_sent_received.is sent' => Activity::SENTRECEIVED_SENT, 'export.filter.activity.by_sent_received.is received' => Activity::SENTRECEIVED_RECEIVED, ]; - private const DEFAULT_CHOICE = Activity::SENTRECEIVED_SENT; + private const string DEFAULT_CHOICE = Activity::SENTRECEIVED_SENT; public function __construct(private readonly TranslatorInterface $translator) {} + #[\Override] public function addRole(): ?string { return null; } + #[\Override] public function alterQuery(QueryBuilder $qb, $data) { $where = $qb->getDQLPart('where'); @@ -52,11 +54,13 @@ class SentReceivedFilter implements FilterInterface $qb->setParameter('sentreceived', $data['accepted_sentreceived']); } + #[\Override] public function applyOn(): string { return Declarations::ACTIVITY; } + #[\Override] public function buildForm(FormBuilderInterface $builder) { $builder->add('accepted_sentreceived', ChoiceType::class, [ @@ -68,11 +72,13 @@ class SentReceivedFilter implements FilterInterface ]); } + #[\Override] public function getFormDefaultData(): array { return ['accepted_sentreceived' => self::DEFAULT_CHOICE]; } + #[\Override] public function describeAction($data, $format = 'string'): array { $sentreceived = array_flip(self::CHOICES)[$data['accepted_sentreceived']]; @@ -82,6 +88,7 @@ class SentReceivedFilter implements FilterInterface ]]; } + #[\Override] public function getTitle(): string { return 'Filter activity by sentreceived'; diff --git a/src/Bundle/ChillActivityBundle/Export/Filter/UserFilter.php b/src/Bundle/ChillActivityBundle/Export/Filter/UserFilter.php index 6e6b745b9..aec09e7b7 100644 --- a/src/Bundle/ChillActivityBundle/Export/Filter/UserFilter.php +++ b/src/Bundle/ChillActivityBundle/Export/Filter/UserFilter.php @@ -23,11 +23,13 @@ class UserFilter implements FilterInterface { public function __construct(private readonly UserRender $userRender) {} + #[\Override] public function addRole(): ?string { return null; } + #[\Override] public function alterQuery(QueryBuilder $qb, $data) { $where = $qb->getDQLPart('where'); @@ -44,11 +46,13 @@ class UserFilter implements FilterInterface $qb->setParameter('users', $data['accepted_users']); } + #[\Override] public function applyOn(): string { return Declarations::ACTIVITY; } + #[\Override] public function buildForm(FormBuilderInterface $builder) { $builder->add('accepted_users', PickUserDynamicType::class, [ @@ -57,11 +61,13 @@ class UserFilter implements FilterInterface ]); } + #[\Override] public function getFormDefaultData(): array { return []; } + #[\Override] public function describeAction($data, $format = 'string'): array { $users = []; @@ -75,6 +81,7 @@ class UserFilter implements FilterInterface ]]; } + #[\Override] public function getTitle(): string { return 'Filter activity by user'; diff --git a/src/Bundle/ChillActivityBundle/Export/Filter/UsersJobFilter.php b/src/Bundle/ChillActivityBundle/Export/Filter/UsersJobFilter.php index f6d23ea78..3177d2cbd 100644 --- a/src/Bundle/ChillActivityBundle/Export/Filter/UsersJobFilter.php +++ b/src/Bundle/ChillActivityBundle/Export/Filter/UsersJobFilter.php @@ -25,18 +25,20 @@ use Symfony\Component\Form\FormBuilderInterface; class UsersJobFilter implements FilterInterface { - private const PREFIX = 'act_filter_user_job'; + private const string PREFIX = 'act_filter_user_job'; public function __construct( private readonly TranslatableStringHelperInterface $translatableStringHelper, private readonly UserJobRepositoryInterface $userJobRepository ) {} + #[\Override] public function addRole(): ?string { return null; } + #[\Override] public function alterQuery(QueryBuilder $qb, $data) { $p = self::PREFIX; @@ -60,11 +62,13 @@ class UsersJobFilter implements FilterInterface ); } + #[\Override] public function applyOn() { return Declarations::ACTIVITY; } + #[\Override] public function buildForm(FormBuilderInterface $builder) { $builder @@ -77,6 +81,7 @@ class UsersJobFilter implements FilterInterface ]); } + #[\Override] public function describeAction($data, $format = 'string') { return ['export.filter.activity.by_users_job.Filtered activity by users job: only %jobs%', [ @@ -90,6 +95,7 @@ class UsersJobFilter implements FilterInterface ]]; } + #[\Override] public function getFormDefaultData(): array { return [ @@ -97,6 +103,7 @@ class UsersJobFilter implements FilterInterface ]; } + #[\Override] public function getTitle() { return 'export.filter.activity.by_users_job.Filter by users job'; diff --git a/src/Bundle/ChillActivityBundle/Export/Filter/UsersScopeFilter.php b/src/Bundle/ChillActivityBundle/Export/Filter/UsersScopeFilter.php index 4ce9c845a..bbc37ba5b 100644 --- a/src/Bundle/ChillActivityBundle/Export/Filter/UsersScopeFilter.php +++ b/src/Bundle/ChillActivityBundle/Export/Filter/UsersScopeFilter.php @@ -25,18 +25,20 @@ use Symfony\Component\Form\FormBuilderInterface; class UsersScopeFilter implements FilterInterface { - private const PREFIX = 'act_filter_user_scope'; + private const string PREFIX = 'act_filter_user_scope'; public function __construct( private readonly ScopeRepositoryInterface $scopeRepository, private readonly TranslatableStringHelperInterface $translatableStringHelper ) {} + #[\Override] public function addRole(): ?string { return null; } + #[\Override] public function alterQuery(QueryBuilder $qb, $data) { $p = self::PREFIX; @@ -60,11 +62,13 @@ class UsersScopeFilter implements FilterInterface ); } + #[\Override] public function applyOn(): string { return Declarations::ACTIVITY; } + #[\Override] public function buildForm(FormBuilderInterface $builder) { $builder @@ -77,6 +81,7 @@ class UsersScopeFilter implements FilterInterface ]); } + #[\Override] public function describeAction($data, $format = 'string'): array { return ['export.filter.activity.by_users_scope.Filtered activity by users scope: only %scopes%', [ @@ -90,6 +95,7 @@ class UsersScopeFilter implements FilterInterface ]]; } + #[\Override] public function getFormDefaultData(): array { return [ @@ -97,6 +103,7 @@ class UsersScopeFilter implements FilterInterface ]; } + #[\Override] public function getTitle(): string { return 'export.filter.activity.by_users_scope.Filter by users scope'; diff --git a/src/Bundle/ChillActivityBundle/Form/ActivityPresenceType.php b/src/Bundle/ChillActivityBundle/Form/ActivityPresenceType.php index b0ee15c10..cebed7a03 100644 --- a/src/Bundle/ChillActivityBundle/Form/ActivityPresenceType.php +++ b/src/Bundle/ChillActivityBundle/Form/ActivityPresenceType.php @@ -20,6 +20,7 @@ use Symfony\Component\OptionsResolver\OptionsResolver; class ActivityPresenceType extends AbstractType { + #[\Override] public function buildForm(FormBuilderInterface $builder, array $options): void { $builder @@ -33,6 +34,7 @@ class ActivityPresenceType extends AbstractType ]); } + #[\Override] public function configureOptions(OptionsResolver $resolver): void { $resolver->setDefaults([ diff --git a/src/Bundle/ChillActivityBundle/Form/ActivityReasonCategoryType.php b/src/Bundle/ChillActivityBundle/Form/ActivityReasonCategoryType.php index 3a0f2a318..4232283f9 100644 --- a/src/Bundle/ChillActivityBundle/Form/ActivityReasonCategoryType.php +++ b/src/Bundle/ChillActivityBundle/Form/ActivityReasonCategoryType.php @@ -19,6 +19,7 @@ use Symfony\Component\OptionsResolver\OptionsResolver; class ActivityReasonCategoryType extends AbstractType { + #[\Override] public function buildForm(FormBuilderInterface $builder, array $options) { $builder @@ -29,6 +30,7 @@ class ActivityReasonCategoryType extends AbstractType /** * @param OptionsResolverInterface $resolver */ + #[\Override] public function configureOptions(OptionsResolver $resolver) { $resolver->setDefaults([ @@ -39,6 +41,7 @@ class ActivityReasonCategoryType extends AbstractType /** * @return string */ + #[\Override] public function getBlockPrefix() { return 'chill_activitybundle_activityreasoncategory'; diff --git a/src/Bundle/ChillActivityBundle/Form/ActivityReasonType.php b/src/Bundle/ChillActivityBundle/Form/ActivityReasonType.php index f47a101bd..76eaf5ed0 100644 --- a/src/Bundle/ChillActivityBundle/Form/ActivityReasonType.php +++ b/src/Bundle/ChillActivityBundle/Form/ActivityReasonType.php @@ -21,6 +21,7 @@ use Symfony\Component\OptionsResolver\OptionsResolver; class ActivityReasonType extends AbstractType { + #[\Override] public function buildForm(FormBuilderInterface $builder, array $options) { $builder @@ -29,6 +30,7 @@ class ActivityReasonType extends AbstractType ->add('category', TranslatableActivityReasonCategoryType::class); } + #[\Override] public function configureOptions(OptionsResolver $resolver) { $resolver->setDefaults([ @@ -39,6 +41,7 @@ class ActivityReasonType extends AbstractType /** * @return string */ + #[\Override] public function getBlockPrefix() { return 'chill_activitybundle_activityreason'; diff --git a/src/Bundle/ChillActivityBundle/Form/ActivityType.php b/src/Bundle/ChillActivityBundle/Form/ActivityType.php index 9e2358e8b..5dcc3de43 100644 --- a/src/Bundle/ChillActivityBundle/Form/ActivityType.php +++ b/src/Bundle/ChillActivityBundle/Form/ActivityType.php @@ -68,6 +68,7 @@ class ActivityType extends AbstractType $this->user = $tokenStorage->getToken()->getUser(); } + #[\Override] public function buildForm(FormBuilderInterface $builder, array $options): void { // handle times choices @@ -386,6 +387,7 @@ class ActivityType extends AbstractType } } + #[\Override] public function configureOptions(OptionsResolver $resolver): void { $resolver->setDefaults([ @@ -400,6 +402,7 @@ class ActivityType extends AbstractType ->setAllowedTypes('accompanyingPeriod', [AccompanyingPeriod::class, 'null']); } + #[\Override] public function getBlockPrefix(): string { return 'chill_activitybundle_activity'; diff --git a/src/Bundle/ChillActivityBundle/Form/ActivityTypeCategoryType.php b/src/Bundle/ChillActivityBundle/Form/ActivityTypeCategoryType.php index c4d79f522..a3e6f0996 100644 --- a/src/Bundle/ChillActivityBundle/Form/ActivityTypeCategoryType.php +++ b/src/Bundle/ChillActivityBundle/Form/ActivityTypeCategoryType.php @@ -21,6 +21,7 @@ use Symfony\Component\OptionsResolver\OptionsResolver; class ActivityTypeCategoryType extends AbstractType { + #[\Override] public function buildForm(FormBuilderInterface $builder, array $options): void { $builder @@ -38,6 +39,7 @@ class ActivityTypeCategoryType extends AbstractType ]); } + #[\Override] public function configureOptions(OptionsResolver $resolver): void { $resolver->setDefaults([ diff --git a/src/Bundle/ChillActivityBundle/Form/ActivityTypeType.php b/src/Bundle/ChillActivityBundle/Form/ActivityTypeType.php index 8e8ae51f7..8d79eab83 100644 --- a/src/Bundle/ChillActivityBundle/Form/ActivityTypeType.php +++ b/src/Bundle/ChillActivityBundle/Form/ActivityTypeType.php @@ -27,6 +27,7 @@ class ActivityTypeType extends AbstractType { public function __construct(private readonly TranslatableStringHelper $translatableStringHelper) {} + #[\Override] public function buildForm(FormBuilderInterface $builder, array $options) { $builder @@ -67,6 +68,7 @@ class ActivityTypeType extends AbstractType ->add('commentVisible', ActivityFieldPresence::class); } + #[\Override] public function configureOptions(OptionsResolver $resolver) { $resolver->setDefaults([ diff --git a/src/Bundle/ChillActivityBundle/Form/Type/ActivityFieldPresence.php b/src/Bundle/ChillActivityBundle/Form/Type/ActivityFieldPresence.php index 42db8c4ac..21c5954f7 100644 --- a/src/Bundle/ChillActivityBundle/Form/Type/ActivityFieldPresence.php +++ b/src/Bundle/ChillActivityBundle/Form/Type/ActivityFieldPresence.php @@ -18,6 +18,7 @@ use Symfony\Component\OptionsResolver\OptionsResolver; class ActivityFieldPresence extends AbstractType { + #[\Override] public function configureOptions(OptionsResolver $resolver) { $resolver->setDefaults( @@ -31,6 +32,7 @@ class ActivityFieldPresence extends AbstractType ); } + #[\Override] public function getParent() { return ChoiceType::class; diff --git a/src/Bundle/ChillActivityBundle/Form/Type/PickActivityReasonType.php b/src/Bundle/ChillActivityBundle/Form/Type/PickActivityReasonType.php index be1e372f1..4d17d0037 100644 --- a/src/Bundle/ChillActivityBundle/Form/Type/PickActivityReasonType.php +++ b/src/Bundle/ChillActivityBundle/Form/Type/PickActivityReasonType.php @@ -30,6 +30,7 @@ class PickActivityReasonType extends AbstractType private readonly TranslatableStringHelperInterface $translatableStringHelper ) {} + #[\Override] public function configureOptions(OptionsResolver $resolver) { $resolver->setDefaults( @@ -49,11 +50,13 @@ class PickActivityReasonType extends AbstractType ); } + #[\Override] public function getBlockPrefix() { return 'translatable_activity_reason'; } + #[\Override] public function getParent() { return EntityType::class; diff --git a/src/Bundle/ChillActivityBundle/Form/Type/TranslatableActivityReasonCategoryType.php b/src/Bundle/ChillActivityBundle/Form/Type/TranslatableActivityReasonCategoryType.php index ee1417bfb..c7d3679d2 100644 --- a/src/Bundle/ChillActivityBundle/Form/Type/TranslatableActivityReasonCategoryType.php +++ b/src/Bundle/ChillActivityBundle/Form/Type/TranslatableActivityReasonCategoryType.php @@ -25,6 +25,7 @@ class TranslatableActivityReasonCategoryType extends AbstractType { public function __construct(private readonly TranslatableStringHelperInterface $translatableStringHelper, private readonly TranslatorInterface $translator) {} + #[\Override] public function configureOptions(OptionsResolver $resolver) { $resolver->setDefaults( @@ -36,6 +37,7 @@ class TranslatableActivityReasonCategoryType extends AbstractType ); } + #[\Override] public function getParent() { return EntityType::class; diff --git a/src/Bundle/ChillActivityBundle/Form/Type/TranslatableActivityType.php b/src/Bundle/ChillActivityBundle/Form/Type/TranslatableActivityType.php index 5c77e500d..243773b10 100644 --- a/src/Bundle/ChillActivityBundle/Form/Type/TranslatableActivityType.php +++ b/src/Bundle/ChillActivityBundle/Form/Type/TranslatableActivityType.php @@ -22,6 +22,7 @@ class TranslatableActivityType extends AbstractType { public function __construct(protected TranslatableStringHelperInterface $translatableStringHelper, protected ActivityTypeRepositoryInterface $activityTypeRepository) {} + #[\Override] public function configureOptions(OptionsResolver $resolver) { $resolver->setDefaults( @@ -34,11 +35,13 @@ class TranslatableActivityType extends AbstractType ); } + #[\Override] public function getBlockPrefix() { return 'translatable_activity_type'; } + #[\Override] public function getParent() { return EntityType::class; diff --git a/src/Bundle/ChillActivityBundle/Menu/AccompanyingCourseMenuBuilder.php b/src/Bundle/ChillActivityBundle/Menu/AccompanyingCourseMenuBuilder.php index b4990c0e3..822402511 100644 --- a/src/Bundle/ChillActivityBundle/Menu/AccompanyingCourseMenuBuilder.php +++ b/src/Bundle/ChillActivityBundle/Menu/AccompanyingCourseMenuBuilder.php @@ -25,6 +25,7 @@ class AccompanyingCourseMenuBuilder implements LocalMenuBuilderInterface { public function __construct(protected Security $security, protected TranslatorInterface $translator) {} + #[\Override] public function buildMenu($menuId, MenuItem $menu, array $parameters) { $period = $parameters['accompanyingCourse']; @@ -42,6 +43,7 @@ class AccompanyingCourseMenuBuilder implements LocalMenuBuilderInterface } } + #[\Override] public static function getMenuIds(): array { return ['accompanyingCourse']; diff --git a/src/Bundle/ChillActivityBundle/Menu/AccompanyingCourseQuickMenuBuilder.php b/src/Bundle/ChillActivityBundle/Menu/AccompanyingCourseQuickMenuBuilder.php index 2a3291515..bf7a516f9 100644 --- a/src/Bundle/ChillActivityBundle/Menu/AccompanyingCourseQuickMenuBuilder.php +++ b/src/Bundle/ChillActivityBundle/Menu/AccompanyingCourseQuickMenuBuilder.php @@ -20,11 +20,13 @@ final readonly class AccompanyingCourseQuickMenuBuilder implements LocalMenuBuil { public function __construct(private Security $security) {} + #[\Override] public static function getMenuIds(): array { return ['accompanying_course_quick_menu']; } + #[\Override] public function buildMenu($menuId, MenuItem $menu, array $parameters) { /** @var \Chill\PersonBundle\Entity\AccompanyingPeriod $accompanyingCourse */ diff --git a/src/Bundle/ChillActivityBundle/Menu/AdminMenuBuilder.php b/src/Bundle/ChillActivityBundle/Menu/AdminMenuBuilder.php index 0afe11cfc..787673ac8 100644 --- a/src/Bundle/ChillActivityBundle/Menu/AdminMenuBuilder.php +++ b/src/Bundle/ChillActivityBundle/Menu/AdminMenuBuilder.php @@ -22,6 +22,7 @@ final readonly class AdminMenuBuilder implements LocalMenuBuilderInterface { public function __construct(private Security $security) {} + #[\Override] public function buildMenu($menuId, MenuItem $menu, array $parameters) { if (!$this->security->isGranted('ROLE_ADMIN')) { @@ -57,6 +58,7 @@ final readonly class AdminMenuBuilder implements LocalMenuBuilderInterface ])->setExtras(['order' => 5050]); } + #[\Override] public static function getMenuIds(): array { return ['admin_section', 'admin_activity']; diff --git a/src/Bundle/ChillActivityBundle/Menu/PersonMenuBuilder.php b/src/Bundle/ChillActivityBundle/Menu/PersonMenuBuilder.php index 797d64eb6..f5da4fa1e 100644 --- a/src/Bundle/ChillActivityBundle/Menu/PersonMenuBuilder.php +++ b/src/Bundle/ChillActivityBundle/Menu/PersonMenuBuilder.php @@ -25,6 +25,7 @@ final readonly class PersonMenuBuilder implements LocalMenuBuilderInterface { public function __construct(private AuthorizationCheckerInterface $authorizationChecker, private TranslatorInterface $translator) {} + #[\Override] public function buildMenu($menuId, MenuItem $menu, array $parameters) { /** @var Person $person */ @@ -42,6 +43,7 @@ final readonly class PersonMenuBuilder implements LocalMenuBuilderInterface } } + #[\Override] public static function getMenuIds(): array { return ['person']; diff --git a/src/Bundle/ChillActivityBundle/Notification/ActivityNotificationHandler.php b/src/Bundle/ChillActivityBundle/Notification/ActivityNotificationHandler.php index 8eb219fd2..94743382e 100644 --- a/src/Bundle/ChillActivityBundle/Notification/ActivityNotificationHandler.php +++ b/src/Bundle/ChillActivityBundle/Notification/ActivityNotificationHandler.php @@ -20,11 +20,13 @@ final readonly class ActivityNotificationHandler implements NotificationHandlerI { public function __construct(private ActivityRepository $activityRepository) {} + #[\Override] public function getTemplate(Notification $notification, array $options = []): string { return '@ChillActivity/Activity/showInNotification.html.twig'; } + #[\Override] public function getTemplateData(Notification $notification, array $options = []): array { return [ @@ -33,6 +35,7 @@ final readonly class ActivityNotificationHandler implements NotificationHandlerI ]; } + #[\Override] public function supports(Notification $notification, array $options = []): bool { return Activity::class === $notification->getRelatedEntityClass(); diff --git a/src/Bundle/ChillActivityBundle/Repository/ActivityACLAwareRepository.php b/src/Bundle/ChillActivityBundle/Repository/ActivityACLAwareRepository.php index 34ddfe432..279951a05 100644 --- a/src/Bundle/ChillActivityBundle/Repository/ActivityACLAwareRepository.php +++ b/src/Bundle/ChillActivityBundle/Repository/ActivityACLAwareRepository.php @@ -50,6 +50,7 @@ final readonly class ActivityACLAwareRepository implements ActivityACLAwareRepos * @throws NonUniqueResultException * @throws NoResultException */ + #[\Override] public function countByAccompanyingPeriod(AccompanyingPeriod $period, string $role, array $filters = []): int { $qb = $this->buildBaseQuery($filters); @@ -61,6 +62,7 @@ final readonly class ActivityACLAwareRepository implements ActivityACLAwareRepos return $qb->getQuery()->getSingleScalarResult(); } + #[\Override] public function countByPerson(Person $person, string $role, array $filters = []): int { $qb = $this->buildBaseQuery($filters); @@ -72,6 +74,7 @@ final readonly class ActivityACLAwareRepository implements ActivityACLAwareRepos return $qb->getQuery()->getSingleScalarResult(); } + #[\Override] public function findByAccompanyingPeriod(AccompanyingPeriod $period, string $role, ?int $start = 0, ?int $limit = 1000, array $orderBy = ['date' => 'DESC'], array $filters = []): array { $qb = $this->buildBaseQuery($filters); @@ -161,6 +164,7 @@ final readonly class ActivityACLAwareRepository implements ActivityACLAwareRepos /** * @return array */ + #[\Override] public function findActivityTypeByAssociated(AccompanyingPeriod|Person $associated): array { $in = $this->em->createQueryBuilder(); @@ -188,6 +192,7 @@ final readonly class ActivityACLAwareRepository implements ActivityACLAwareRepos return $qb->getQuery()->getResult(); } + #[\Override] public function findUserJobByAssociated(AccompanyingPeriod|Person $associated): array { $in = $this->em->createQueryBuilder(); @@ -220,6 +225,7 @@ final readonly class ActivityACLAwareRepository implements ActivityACLAwareRepos return $qb->getQuery()->getResult(); } + #[\Override] public function findByAccompanyingPeriodSimplified(AccompanyingPeriod $period, ?int $limit = 1000): array { $rsm = new ResultSetMappingBuilder($this->em); @@ -302,6 +308,7 @@ final readonly class ActivityACLAwareRepository implements ActivityACLAwareRepos return $nq->getResult(AbstractQuery::HYDRATE_ARRAY); } + #[\Override] public function findByPerson(Person $person, string $role, ?int $start = 0, ?int $limit = 1000, ?array $orderBy = [], array $filters = []): array { $qb = $this->buildBaseQuery($filters); diff --git a/src/Bundle/ChillActivityBundle/Repository/ActivityDocumentACLAwareRepository.php b/src/Bundle/ChillActivityBundle/Repository/ActivityDocumentACLAwareRepository.php index c0fd359f1..b01e2ac79 100644 --- a/src/Bundle/ChillActivityBundle/Repository/ActivityDocumentACLAwareRepository.php +++ b/src/Bundle/ChillActivityBundle/Repository/ActivityDocumentACLAwareRepository.php @@ -35,6 +35,7 @@ final readonly class ActivityDocumentACLAwareRepository implements ActivityDocum private Security $security ) {} + #[\Override] public function buildFetchQueryActivityDocumentLinkedToPersonFromPersonContext(Person $person, ?\DateTimeImmutable $startDate = null, ?\DateTimeImmutable $endDate = null, ?string $content = null): FetchQueryInterface { $query = $this->buildBaseFetchQueryActivityDocumentLinkedToPersonFromPersonContext($person, $startDate, $endDate, $content); @@ -71,6 +72,7 @@ final readonly class ActivityDocumentACLAwareRepository implements ActivityDocum return $this->addWhereClauses($query, $startDate, $endDate, $content); } + #[\Override] public function buildFetchQueryActivityDocumentLinkedToAccompanyingPeriodFromPersonContext(Person $person, ?\DateTimeImmutable $startDate = null, ?\DateTimeImmutable $endDate = null, ?string $content = null): FetchQuery { $storedObjectMetadata = $this->em->getClassMetadata(StoredObject::class); diff --git a/src/Bundle/ChillActivityBundle/Repository/ActivityPresenceRepository.php b/src/Bundle/ChillActivityBundle/Repository/ActivityPresenceRepository.php index 3ed96074b..af1af2a83 100644 --- a/src/Bundle/ChillActivityBundle/Repository/ActivityPresenceRepository.php +++ b/src/Bundle/ChillActivityBundle/Repository/ActivityPresenceRepository.php @@ -24,26 +24,31 @@ class ActivityPresenceRepository implements ActivityPresenceRepositoryInterface $this->repository = $entityManager->getRepository($this->getClassName()); } + #[\Override] public function find($id): ?ActivityPresence { return $this->repository->find($id); } + #[\Override] public function findAll(): array { return $this->repository->findAll(); } + #[\Override] public function findBy(array $criteria, ?array $orderBy = null, ?int $limit = null, ?int $offset = null): array { return $this->findBy($criteria, $orderBy, $limit, $offset); } + #[\Override] public function findOneBy(array $criteria): ?ActivityPresence { return $this->findOneBy($criteria); } + #[\Override] public function getClassName(): string { return ActivityPresence::class; diff --git a/src/Bundle/ChillActivityBundle/Repository/ActivityReasonRepository.php b/src/Bundle/ChillActivityBundle/Repository/ActivityReasonRepository.php index 47a7b35e8..8b850e839 100644 --- a/src/Bundle/ChillActivityBundle/Repository/ActivityReasonRepository.php +++ b/src/Bundle/ChillActivityBundle/Repository/ActivityReasonRepository.php @@ -33,6 +33,7 @@ class ActivityReasonRepository extends ServiceEntityRepository /** * @return ActivityReason[] */ + #[\Override] public function findAll(): array { $qb = $this->createQueryBuilder('ar'); diff --git a/src/Bundle/ChillActivityBundle/Repository/ActivityTypeRepository.php b/src/Bundle/ChillActivityBundle/Repository/ActivityTypeRepository.php index 698c8b370..63e652bdd 100644 --- a/src/Bundle/ChillActivityBundle/Repository/ActivityTypeRepository.php +++ b/src/Bundle/ChillActivityBundle/Repository/ActivityTypeRepository.php @@ -24,6 +24,7 @@ final readonly class ActivityTypeRepository implements ActivityTypeRepositoryInt $this->repository = $em->getRepository(ActivityType::class); } + #[\Override] public function find($id): ?ActivityType { return $this->repository->find($id); @@ -32,6 +33,7 @@ final readonly class ActivityTypeRepository implements ActivityTypeRepositoryInt /** * @return array|ActivityType[] */ + #[\Override] public function findAll(): array { return $this->repository->findAll(); @@ -40,6 +42,7 @@ final readonly class ActivityTypeRepository implements ActivityTypeRepositoryInt /** * @return array|ActivityType[] */ + #[\Override] public function findAllActive(): array { return $this->findBy(['active' => true]); @@ -48,16 +51,19 @@ final readonly class ActivityTypeRepository implements ActivityTypeRepositoryInt /** * @return array|ActivityType[] */ + #[\Override] public function findBy(array $criteria, ?array $orderBy = null, ?int $limit = null, ?int $offset = null): array { return $this->repository->findBy($criteria, $orderBy, $limit, $offset); } + #[\Override] public function findOneBy(array $criteria): ?ActivityType { return $this->repository->findOneBy($criteria); } + #[\Override] public function getClassName(): string { return ActivityType::class; diff --git a/src/Bundle/ChillActivityBundle/Security/Authorization/ActivityStatsVoter.php b/src/Bundle/ChillActivityBundle/Security/Authorization/ActivityStatsVoter.php index 27f4b07a6..1ba72f7d5 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 { - final public const LISTS = 'CHILL_ACTIVITY_LIST'; + final public const string LISTS = 'CHILL_ACTIVITY_LIST'; - final public const STATS = 'CHILL_ACTIVITY_STATS'; + final public const string STATS = 'CHILL_ACTIVITY_STATS'; protected VoterHelperInterface $helper; @@ -34,26 +34,31 @@ class ActivityStatsVoter extends AbstractChillVoter implements ProvideRoleHierar ->build(); } + #[\Override] public function getRoles(): array { return $this->getAttributes(); } + #[\Override] public function getRolesWithHierarchy(): array { return ['Activity' => $this->getRoles()]; } + #[\Override] public function getRolesWithoutScope(): array { return $this->getAttributes(); } + #[\Override] protected function supports($attribute, $subject) { return $this->helper->supports($attribute, $subject); } + #[\Override] protected function voteOnAttribute($attribute, $subject, TokenInterface $token) { return $this->helper->voteOnAttribute($attribute, $subject, $token); diff --git a/src/Bundle/ChillActivityBundle/Security/Authorization/ActivityVoter.php b/src/Bundle/ChillActivityBundle/Security/Authorization/ActivityVoter.php index dd51a1f55..7523632d0 100644 --- a/src/Bundle/ChillActivityBundle/Security/Authorization/ActivityVoter.php +++ b/src/Bundle/ChillActivityBundle/Security/Authorization/ActivityVoter.php @@ -32,7 +32,7 @@ class ActivityVoter extends AbstractChillVoter implements ProvideRoleHierarchyIn * * It is safe for usage in template and controller */ - final public const CREATE = 'CHILL_ACTIVITY_CREATE'; + final public const string CREATE = 'CHILL_ACTIVITY_CREATE'; /** * role to allow to create an activity associated win an accompanying course. @@ -41,7 +41,7 @@ class ActivityVoter extends AbstractChillVoter implements ProvideRoleHierarchyIn * * @internal */ - final public const CREATE_ACCOMPANYING_COURSE = 'CHILL_ACTIVITY_CREATE_ACCOMPANYING_COURSE'; + final public const string CREATE_ACCOMPANYING_COURSE = 'CHILL_ACTIVITY_CREATE_ACCOMPANYING_COURSE'; /** * role to allow to create an activity associated with a person. @@ -50,19 +50,19 @@ class ActivityVoter extends AbstractChillVoter implements ProvideRoleHierarchyIn * * @internal */ - final public const CREATE_PERSON = 'CHILL_ACTIVITY_CREATE_PERSON'; + final public const string CREATE_PERSON = 'CHILL_ACTIVITY_CREATE_PERSON'; - final public const DELETE = 'CHILL_ACTIVITY_DELETE'; + final public const string DELETE = 'CHILL_ACTIVITY_DELETE'; - final public const FULL = 'CHILL_ACTIVITY_FULL'; + final public const string FULL = 'CHILL_ACTIVITY_FULL'; - final public const SEE = 'CHILL_ACTIVITY_SEE'; + final public const string SEE = 'CHILL_ACTIVITY_SEE'; - final public const SEE_DETAILS = 'CHILL_ACTIVITY_SEE_DETAILS'; + final public const string SEE_DETAILS = 'CHILL_ACTIVITY_SEE_DETAILS'; - final public const UPDATE = 'CHILL_ACTIVITY_UPDATE'; + final public const string UPDATE = 'CHILL_ACTIVITY_UPDATE'; - private const ALL = [ + private const array ALL = [ self::CREATE, self::SEE, self::UPDATE, @@ -84,6 +84,7 @@ class ActivityVoter extends AbstractChillVoter implements ProvideRoleHierarchyIn ->build(); } + #[\Override] public function getRoles(): array { return [ @@ -97,21 +98,25 @@ class ActivityVoter extends AbstractChillVoter implements ProvideRoleHierarchyIn ]; } + #[\Override] public function getRolesWithHierarchy(): array { return ['Activity' => $this->getRoles()]; } + #[\Override] public function getRolesWithoutScope(): array { return []; } + #[\Override] protected function supports($attribute, $subject): bool { return $this->voterHelper->supports($attribute, $subject); } + #[\Override] protected function voteOnAttribute($attribute, $subject, TokenInterface $token): bool { if (!$token->getUser() instanceof User) { diff --git a/src/Bundle/ChillActivityBundle/Service/DocGenerator/ActivityContext.php b/src/Bundle/ChillActivityBundle/Service/DocGenerator/ActivityContext.php index 46e466ae1..cbc29d30b 100644 --- a/src/Bundle/ChillActivityBundle/Service/DocGenerator/ActivityContext.php +++ b/src/Bundle/ChillActivityBundle/Service/DocGenerator/ActivityContext.php @@ -53,11 +53,13 @@ class ActivityContext implements private readonly ThirdPartyRepository $thirdPartyRepository ) {} + #[\Override] public function adminFormReverseTransform(array $data): array { return $data; } + #[\Override] public function adminFormTransform(array $data): array { return [ @@ -72,6 +74,7 @@ class ActivityContext implements ]; } + #[\Override] public function buildAdminForm(FormBuilderInterface $builder): void { $builder @@ -112,6 +115,7 @@ class ActivityContext implements /** * @param Activity $entity */ + #[\Override] public function buildPublicForm(FormBuilderInterface $builder, DocGeneratorTemplate $template, $entity): void { $options = $template->getOptions(); @@ -147,6 +151,7 @@ class ActivityContext implements } } + #[\Override] public function contextGenerationDataDenormalize(DocGeneratorTemplate $template, $entity, array $data): array { $denormalized = []; @@ -168,6 +173,7 @@ class ActivityContext implements return $denormalized; } + #[\Override] public function contextGenerationDataNormalize(DocGeneratorTemplate $template, $entity, array $data): array { $normalized = []; @@ -181,6 +187,7 @@ class ActivityContext implements return $normalized; } + #[\Override] public function getData(DocGeneratorTemplate $template, $entity, array $contextGenerationData = []): array { if (!$entity instanceof Activity) { @@ -216,16 +223,19 @@ class ActivityContext implements return $data; } + #[\Override] public function getDescription(): string { return 'docgen.A basic context for activity'; } + #[\Override] public function getEntityClass(): string { return Activity::class; } + #[\Override] public function getFormData(DocGeneratorTemplate $template, $entity): array { return [ @@ -233,21 +243,25 @@ class ActivityContext implements ]; } + #[\Override] public static function getKey(): string { return self::class; } + #[\Override] public function getName(): string { return 'docgen.Activity basic'; } + #[\Override] public function hasAdminForm(): bool { return true; } + #[\Override] public function hasPublicForm(DocGeneratorTemplate $template, $entity): bool { $options = $template->getOptions(); @@ -255,6 +269,7 @@ class ActivityContext implements return $options['mainPerson'] || $options['person1'] || $options['person2'] || $options['thirdParty']; } + #[\Override] public function storeGenerated(DocGeneratorTemplate $template, StoredObject $storedObject, object $entity, array $contextGenerationData): void { $storedObject->setTitle($this->translatableStringHelper->localize($template->getName())); diff --git a/src/Bundle/ChillActivityBundle/Service/DocGenerator/ListActivitiesByAccompanyingPeriodContext.php b/src/Bundle/ChillActivityBundle/Service/DocGenerator/ListActivitiesByAccompanyingPeriodContext.php index a2fa996a6..eef3cc2fc 100644 --- a/src/Bundle/ChillActivityBundle/Service/DocGenerator/ListActivitiesByAccompanyingPeriodContext.php +++ b/src/Bundle/ChillActivityBundle/Service/DocGenerator/ListActivitiesByAccompanyingPeriodContext.php @@ -59,21 +59,25 @@ class ListActivitiesByAccompanyingPeriodContext implements private readonly UserRepository $userRepository ) {} + #[\Override] public function adminFormReverseTransform(array $data): array { return $this->accompanyingPeriodContext->adminFormReverseTransform($data); } + #[\Override] public function adminFormTransform(array $data): array { return $this->accompanyingPeriodContext->adminFormTransform($data); } + #[\Override] public function buildAdminForm(FormBuilderInterface $builder): void { $this->accompanyingPeriodContext->buildAdminForm($builder); } + #[\Override] public function buildPublicForm(FormBuilderInterface $builder, DocGeneratorTemplate $template, $entity): void { $this->accompanyingPeriodContext->buildPublicForm($builder, $template, $entity); @@ -89,6 +93,7 @@ class ListActivitiesByAccompanyingPeriodContext implements ]); } + #[\Override] public function contextGenerationDataDenormalize(DocGeneratorTemplate $template, $entity, array $data): array { $denormalized = $this->accompanyingPeriodContext->contextGenerationDataDenormalize($template, $entity, $data); @@ -100,6 +105,7 @@ class ListActivitiesByAccompanyingPeriodContext implements return $denormalized; } + #[\Override] public function contextGenerationDataNormalize(DocGeneratorTemplate $template, $entity, array $data): array { $normalized = $this->accompanyingPeriodContext->contextGenerationDataNormalize($template, $entity, $data); @@ -151,6 +157,7 @@ class ListActivitiesByAccompanyingPeriodContext implements ); } + #[\Override] public function getData(DocGeneratorTemplate $template, object $entity, array $contextGenerationData = []): array { $data = $this->accompanyingPeriodContext->getData($template, $entity, $contextGenerationData); @@ -173,41 +180,49 @@ class ListActivitiesByAccompanyingPeriodContext implements return $data; } + #[\Override] public function getDescription(): string { return 'docgen.Accompanying period with a list of activities description'; } + #[\Override] public function getEntityClass(): string { return AccompanyingPeriod::class; } + #[\Override] public function getFormData(DocGeneratorTemplate $template, $entity): array { return $this->accompanyingPeriodContext->getFormData($template, $entity); } + #[\Override] public static function getKey(): string { return self::class; } + #[\Override] public function getName(): string { return 'docgen.Accompanying period with a list of activities'; } + #[\Override] public function hasAdminForm(): bool { return $this->accompanyingPeriodContext->hasAdminForm(); } + #[\Override] public function hasPublicForm(DocGeneratorTemplate $template, $entity): bool { return true; } + #[\Override] public function storeGenerated(DocGeneratorTemplate $template, StoredObject $storedObject, object $entity, array $contextGenerationData): void { $this->accompanyingPeriodContext->storeGenerated($template, $storedObject, $entity, $contextGenerationData); diff --git a/src/Bundle/ChillActivityBundle/Service/EntityInfo/AccompanyingPeriodInfoQueryPart/ActivityUsersDateQueryPartForAccompanyingPeriodInfo.php b/src/Bundle/ChillActivityBundle/Service/EntityInfo/AccompanyingPeriodInfoQueryPart/ActivityUsersDateQueryPartForAccompanyingPeriodInfo.php index bb70d6e87..2a998af6e 100644 --- a/src/Bundle/ChillActivityBundle/Service/EntityInfo/AccompanyingPeriodInfoQueryPart/ActivityUsersDateQueryPartForAccompanyingPeriodInfo.php +++ b/src/Bundle/ChillActivityBundle/Service/EntityInfo/AccompanyingPeriodInfoQueryPart/ActivityUsersDateQueryPartForAccompanyingPeriodInfo.php @@ -16,47 +16,56 @@ use Chill\PersonBundle\Service\EntityInfo\AccompanyingPeriodInfoUnionQueryPartIn class ActivityUsersDateQueryPartForAccompanyingPeriodInfo implements AccompanyingPeriodInfoUnionQueryPartInterface { + #[\Override] public function getAccompanyingPeriodIdColumn(): string { return 'activity.accompanyingperiod_id'; } + #[\Override] public function getRelatedEntityColumn(): string { return Activity::class; } + #[\Override] public function getRelatedEntityIdColumn(): string { return 'activity.id'; } + #[\Override] public function getUserIdColumn(): string { return 'au.user_id'; } + #[\Override] public function getDateTimeColumn(): string { return 'activity.date'; } + #[\Override] public function getDiscriminator(): string { return 'activity_date'; } + #[\Override] public function getMetadataColumn(): string { return '\'{}\'::jsonb'; } + #[\Override] public function getFromStatement(): string { return 'activity LEFT JOIN activity_user au on activity.id = au.activity_id'; } + #[\Override] public function getWhereClause(): string { return 'activity.accompanyingperiod_id IS NOT NULL'; diff --git a/src/Bundle/ChillActivityBundle/Service/GenericDoc/Providers/AccompanyingPeriodActivityGenericDocProvider.php b/src/Bundle/ChillActivityBundle/Service/GenericDoc/Providers/AccompanyingPeriodActivityGenericDocProvider.php index d29e08ef5..276fdb644 100644 --- a/src/Bundle/ChillActivityBundle/Service/GenericDoc/Providers/AccompanyingPeriodActivityGenericDocProvider.php +++ b/src/Bundle/ChillActivityBundle/Service/GenericDoc/Providers/AccompanyingPeriodActivityGenericDocProvider.php @@ -28,7 +28,7 @@ use Symfony\Component\Security\Core\Security; final readonly class AccompanyingPeriodActivityGenericDocProvider implements GenericDocForAccompanyingPeriodProviderInterface, GenericDocForPersonProviderInterface { - public const KEY = 'accompanying_period_activity_document'; + public const string KEY = 'accompanying_period_activity_document'; public function __construct( private EntityManagerInterface $em, @@ -36,6 +36,7 @@ final readonly class AccompanyingPeriodActivityGenericDocProvider implements Gen private ActivityDocumentACLAwareRepositoryInterface $activityDocumentACLAwareRepository, ) {} + #[\Override] public function buildFetchQueryForAccompanyingPeriod(AccompanyingPeriod $accompanyingPeriod, ?\DateTimeImmutable $startDate = null, ?\DateTimeImmutable $endDate = null, ?string $content = null, ?string $origin = null): FetchQueryInterface { $storedObjectMetadata = $this->em->getClassMetadata(StoredObject::class); @@ -89,16 +90,19 @@ final readonly class AccompanyingPeriodActivityGenericDocProvider implements Gen return $query; } + #[\Override] public function isAllowedForAccompanyingPeriod(AccompanyingPeriod $accompanyingPeriod): bool { return $this->security->isGranted(ActivityVoter::SEE, $accompanyingPeriod); } + #[\Override] public function isAllowedForPerson(Person $person): bool { return $this->security->isGranted(AccompanyingPeriodVoter::SEE, $person); } + #[\Override] public function buildFetchQueryForPerson(Person $person, ?\DateTimeImmutable $startDate = null, ?\DateTimeImmutable $endDate = null, ?string $content = null, ?string $origin = null): FetchQueryInterface { return $this->activityDocumentACLAwareRepository diff --git a/src/Bundle/ChillActivityBundle/Service/GenericDoc/Providers/PersonActivityGenericDocProvider.php b/src/Bundle/ChillActivityBundle/Service/GenericDoc/Providers/PersonActivityGenericDocProvider.php index d553afbb2..12ed0a7e4 100644 --- a/src/Bundle/ChillActivityBundle/Service/GenericDoc/Providers/PersonActivityGenericDocProvider.php +++ b/src/Bundle/ChillActivityBundle/Service/GenericDoc/Providers/PersonActivityGenericDocProvider.php @@ -20,13 +20,14 @@ use Symfony\Component\Security\Core\Security; final readonly class PersonActivityGenericDocProvider implements GenericDocForPersonProviderInterface { - public const KEY = 'person_activity_document'; + public const string KEY = 'person_activity_document'; public function __construct( private Security $security, private ActivityDocumentACLAwareRepositoryInterface $personActivityDocumentACLAwareRepository, ) {} + #[\Override] public function buildFetchQueryForPerson(Person $person, ?\DateTimeImmutable $startDate = null, ?\DateTimeImmutable $endDate = null, ?string $content = null, ?string $origin = null): FetchQueryInterface { return $this->personActivityDocumentACLAwareRepository->buildFetchQueryActivityDocumentLinkedToPersonFromPersonContext( @@ -37,6 +38,7 @@ final readonly class PersonActivityGenericDocProvider implements GenericDocForPe ); } + #[\Override] public function isAllowedForPerson(Person $person): bool { return $this->security->isGranted(ActivityVoter::SEE, $person); diff --git a/src/Bundle/ChillActivityBundle/Service/GenericDoc/Renderers/AccompanyingPeriodActivityGenericDocRenderer.php b/src/Bundle/ChillActivityBundle/Service/GenericDoc/Renderers/AccompanyingPeriodActivityGenericDocRenderer.php index 93649cea8..b476f97d1 100644 --- a/src/Bundle/ChillActivityBundle/Service/GenericDoc/Renderers/AccompanyingPeriodActivityGenericDocRenderer.php +++ b/src/Bundle/ChillActivityBundle/Service/GenericDoc/Renderers/AccompanyingPeriodActivityGenericDocRenderer.php @@ -22,16 +22,19 @@ final readonly class AccompanyingPeriodActivityGenericDocRenderer implements Gen { public function __construct(private StoredObjectRepository $objectRepository, private ActivityRepository $activityRepository) {} + #[\Override] public function supports(GenericDocDTO $genericDocDTO, $options = []): bool { return AccompanyingPeriodActivityGenericDocProvider::KEY === $genericDocDTO->key || PersonActivityGenericDocProvider::KEY === $genericDocDTO->key; } + #[\Override] public function getTemplate(GenericDocDTO $genericDocDTO, $options = []): string { return '@ChillActivity/GenericDoc/activity_document.html.twig'; } + #[\Override] public function getTemplateData(GenericDocDTO $genericDocDTO, $options = []): array { return [ diff --git a/src/Bundle/ChillActivityBundle/Templating/Entity/ActivityReasonRender.php b/src/Bundle/ChillActivityBundle/Templating/Entity/ActivityReasonRender.php index aa7783d2d..000efce07 100644 --- a/src/Bundle/ChillActivityBundle/Templating/Entity/ActivityReasonRender.php +++ b/src/Bundle/ChillActivityBundle/Templating/Entity/ActivityReasonRender.php @@ -34,6 +34,7 @@ class ActivityReasonRender implements ChillEntityRenderInterface $this->translatableStringHelper = $translatableStringHelper; } + #[\Override] public function renderBox($entity, array $options): string { return @@ -55,6 +56,7 @@ class ActivityReasonRender implements ChillEntityRenderInterface $this->getDefaultClosingBox(); } + #[\Override] public function renderString($entity, array $options): string { $category = ''; @@ -71,6 +73,7 @@ class ActivityReasonRender implements ChillEntityRenderInterface ); } + #[\Override] public function supports($entity, array $options): bool { return $entity instanceof ActivityReason; diff --git a/src/Bundle/ChillActivityBundle/Tests/Export/Aggregator/ACPAggregators/ByActivityTypeAggregatorTest.php b/src/Bundle/ChillActivityBundle/Tests/Export/Aggregator/ACPAggregators/ByActivityTypeAggregatorTest.php index bc0651b1f..1b2129203 100644 --- a/src/Bundle/ChillActivityBundle/Tests/Export/Aggregator/ACPAggregators/ByActivityTypeAggregatorTest.php +++ b/src/Bundle/ChillActivityBundle/Tests/Export/Aggregator/ACPAggregators/ByActivityTypeAggregatorTest.php @@ -31,6 +31,7 @@ class ByActivityTypeAggregatorTest extends AbstractAggregatorTest private ActivityTypeRepositoryInterface $activityTypeRepository; private TranslatableStringHelperInterface $translatableStringHelper; + #[\Override] protected function setUp(): void { parent::setUp(); @@ -41,6 +42,7 @@ class ByActivityTypeAggregatorTest extends AbstractAggregatorTest $this->translatableStringHelper = self::getContainer()->get(TranslatableStringHelperInterface::class); } + #[\Override] public function getAggregator() { return new ByActivityTypeAggregator( @@ -50,6 +52,7 @@ class ByActivityTypeAggregatorTest extends AbstractAggregatorTest ); } + #[\Override] public static function getFormData(): array { return [ @@ -72,6 +75,7 @@ class ByActivityTypeAggregatorTest extends AbstractAggregatorTest ]; } + #[\Override] public static function getQueryBuilders(): iterable { self::bootKernel(); diff --git a/src/Bundle/ChillActivityBundle/Tests/Export/Aggregator/ACPAggregators/BySocialActionAggregatorTest.php b/src/Bundle/ChillActivityBundle/Tests/Export/Aggregator/ACPAggregators/BySocialActionAggregatorTest.php index 1d7578bf0..75e95b8da 100644 --- a/src/Bundle/ChillActivityBundle/Tests/Export/Aggregator/ACPAggregators/BySocialActionAggregatorTest.php +++ b/src/Bundle/ChillActivityBundle/Tests/Export/Aggregator/ACPAggregators/BySocialActionAggregatorTest.php @@ -25,6 +25,7 @@ final class BySocialActionAggregatorTest extends AbstractAggregatorTest { private BySocialActionAggregator $aggregator; + #[\Override] protected function setUp(): void { self::bootKernel(); @@ -32,11 +33,13 @@ final class BySocialActionAggregatorTest extends AbstractAggregatorTest $this->aggregator = self::getContainer()->get('chill.activity.export.bysocialaction_aggregator'); } + #[\Override] public function getAggregator() { return $this->aggregator; } + #[\Override] public static function getFormData(): array { return [ @@ -44,6 +47,7 @@ final class BySocialActionAggregatorTest extends AbstractAggregatorTest ]; } + #[\Override] public static function getQueryBuilders(): iterable { self::bootKernel(); diff --git a/src/Bundle/ChillActivityBundle/Tests/Export/Aggregator/ACPAggregators/BySocialIssueAggregatorTest.php b/src/Bundle/ChillActivityBundle/Tests/Export/Aggregator/ACPAggregators/BySocialIssueAggregatorTest.php index a3b69eaef..83b29e466 100644 --- a/src/Bundle/ChillActivityBundle/Tests/Export/Aggregator/ACPAggregators/BySocialIssueAggregatorTest.php +++ b/src/Bundle/ChillActivityBundle/Tests/Export/Aggregator/ACPAggregators/BySocialIssueAggregatorTest.php @@ -25,6 +25,7 @@ final class BySocialIssueAggregatorTest extends AbstractAggregatorTest { private BySocialIssueAggregator $aggregator; + #[\Override] protected function setUp(): void { self::bootKernel(); @@ -32,11 +33,13 @@ final class BySocialIssueAggregatorTest extends AbstractAggregatorTest $this->aggregator = self::getContainer()->get('chill.activity.export.bysocialissue_aggregator'); } + #[\Override] public function getAggregator() { return $this->aggregator; } + #[\Override] public static function getFormData(): array { return [ @@ -44,6 +47,7 @@ final class BySocialIssueAggregatorTest extends AbstractAggregatorTest ]; } + #[\Override] public static function getQueryBuilders(): iterable { self::bootKernel(); diff --git a/src/Bundle/ChillActivityBundle/Tests/Export/Aggregator/ActivityPresenceAggregatorTest.php b/src/Bundle/ChillActivityBundle/Tests/Export/Aggregator/ActivityPresenceAggregatorTest.php index db26d4dd4..f95a4a485 100644 --- a/src/Bundle/ChillActivityBundle/Tests/Export/Aggregator/ActivityPresenceAggregatorTest.php +++ b/src/Bundle/ChillActivityBundle/Tests/Export/Aggregator/ActivityPresenceAggregatorTest.php @@ -28,6 +28,7 @@ class ActivityPresenceAggregatorTest extends AbstractAggregatorTest private TranslatableStringHelperInterface $translatableStringHelper; private ActivityPresenceRepositoryInterface $activityPresenceRepository; + #[\Override] protected function setUp(): void { self::bootKernel(); @@ -35,11 +36,13 @@ class ActivityPresenceAggregatorTest extends AbstractAggregatorTest $this->activityPresenceRepository = self::getContainer()->get(ActivityPresenceRepositoryInterface::class); } + #[\Override] public function getAggregator() { return new ActivityPresenceAggregator($this->activityPresenceRepository, $this->translatableStringHelper); } + #[\Override] public static function getFormData(): array { return [ @@ -47,6 +50,7 @@ class ActivityPresenceAggregatorTest extends AbstractAggregatorTest ]; } + #[\Override] public static function getQueryBuilders(): iterable { self::bootKernel(); diff --git a/src/Bundle/ChillActivityBundle/Tests/Export/Aggregator/ActivityReasonAggregatorTest.php b/src/Bundle/ChillActivityBundle/Tests/Export/Aggregator/ActivityReasonAggregatorTest.php index 41c7213c0..5dcee6566 100644 --- a/src/Bundle/ChillActivityBundle/Tests/Export/Aggregator/ActivityReasonAggregatorTest.php +++ b/src/Bundle/ChillActivityBundle/Tests/Export/Aggregator/ActivityReasonAggregatorTest.php @@ -28,6 +28,7 @@ final class ActivityReasonAggregatorTest extends AbstractAggregatorTest private ActivityReasonAggregator $aggregator; + #[\Override] protected function setUp(): void { self::bootKernel(); @@ -44,11 +45,13 @@ final class ActivityReasonAggregatorTest extends AbstractAggregatorTest ->push($request->reveal());*/ } + #[\Override] public function getAggregator() { return $this->aggregator; } + #[\Override] public static function getFormData(): array { return [ @@ -57,6 +60,7 @@ final class ActivityReasonAggregatorTest extends AbstractAggregatorTest ]; } + #[\Override] public static function getQueryBuilders(): iterable { self::bootKernel(); diff --git a/src/Bundle/ChillActivityBundle/Tests/Export/Aggregator/ActivityTypeAggregatorTest.php b/src/Bundle/ChillActivityBundle/Tests/Export/Aggregator/ActivityTypeAggregatorTest.php index 0768060f2..90d82f020 100644 --- a/src/Bundle/ChillActivityBundle/Tests/Export/Aggregator/ActivityTypeAggregatorTest.php +++ b/src/Bundle/ChillActivityBundle/Tests/Export/Aggregator/ActivityTypeAggregatorTest.php @@ -30,6 +30,7 @@ final class ActivityTypeAggregatorTest extends AbstractAggregatorTest private ActivityTypeAggregator $aggregator; + #[\Override] protected function setUp(): void { self::bootKernel(); @@ -45,11 +46,13 @@ final class ActivityTypeAggregatorTest extends AbstractAggregatorTest ->push($request->reveal()); } + #[\Override] public function getAggregator() { return $this->aggregator; } + #[\Override] public static function getFormData(): array { return [ @@ -57,6 +60,7 @@ final class ActivityTypeAggregatorTest extends AbstractAggregatorTest ]; } + #[\Override] public static function getQueryBuilders(): iterable { self::bootKernel(); diff --git a/src/Bundle/ChillActivityBundle/Tests/Export/Aggregator/ActivityUserAggregatorTest.php b/src/Bundle/ChillActivityBundle/Tests/Export/Aggregator/ActivityUserAggregatorTest.php index 186dc093b..01cc268ac 100644 --- a/src/Bundle/ChillActivityBundle/Tests/Export/Aggregator/ActivityUserAggregatorTest.php +++ b/src/Bundle/ChillActivityBundle/Tests/Export/Aggregator/ActivityUserAggregatorTest.php @@ -30,6 +30,7 @@ final class ActivityUserAggregatorTest extends AbstractAggregatorTest private ActivityUserAggregator $aggregator; + #[\Override] protected function setUp(): void { self::bootKernel(); @@ -45,11 +46,13 @@ final class ActivityUserAggregatorTest extends AbstractAggregatorTest ->push($request->reveal()); } + #[\Override] public function getAggregator() { return $this->aggregator; } + #[\Override] public static function getFormData(): array { return [ @@ -57,6 +60,7 @@ final class ActivityUserAggregatorTest extends AbstractAggregatorTest ]; } + #[\Override] public static function getQueryBuilders(): iterable { self::bootKernel(); diff --git a/src/Bundle/ChillActivityBundle/Tests/Export/Aggregator/ByThirdpartyAggregatorTest.php b/src/Bundle/ChillActivityBundle/Tests/Export/Aggregator/ByThirdpartyAggregatorTest.php index 50d0f760e..d8c7b6ff8 100644 --- a/src/Bundle/ChillActivityBundle/Tests/Export/Aggregator/ByThirdpartyAggregatorTest.php +++ b/src/Bundle/ChillActivityBundle/Tests/Export/Aggregator/ByThirdpartyAggregatorTest.php @@ -25,6 +25,7 @@ final class ByThirdpartyAggregatorTest extends AbstractAggregatorTest { private ByThirdpartyAggregator $aggregator; + #[\Override] protected function setUp(): void { self::bootKernel(); @@ -32,11 +33,13 @@ final class ByThirdpartyAggregatorTest extends AbstractAggregatorTest $this->aggregator = self::getContainer()->get(ByThirdpartyAggregator::class); } + #[\Override] public function getAggregator() { return $this->aggregator; } + #[\Override] public static function getFormData(): array { return [ @@ -44,6 +47,7 @@ final class ByThirdpartyAggregatorTest extends AbstractAggregatorTest ]; } + #[\Override] public static function getQueryBuilders(): iterable { self::bootKernel(); diff --git a/src/Bundle/ChillActivityBundle/Tests/Export/Aggregator/ByUserAggregatorTest.php b/src/Bundle/ChillActivityBundle/Tests/Export/Aggregator/ByUserAggregatorTest.php index b45d78be1..e115f773d 100644 --- a/src/Bundle/ChillActivityBundle/Tests/Export/Aggregator/ByUserAggregatorTest.php +++ b/src/Bundle/ChillActivityBundle/Tests/Export/Aggregator/ByUserAggregatorTest.php @@ -25,6 +25,7 @@ final class ByUserAggregatorTest extends AbstractAggregatorTest { private ByCreatorAggregator $aggregator; + #[\Override] protected function setUp(): void { self::bootKernel(); @@ -32,11 +33,13 @@ final class ByUserAggregatorTest extends AbstractAggregatorTest $this->aggregator = self::getContainer()->get(ByCreatorAggregator::class); } + #[\Override] public function getAggregator() { return $this->aggregator; } + #[\Override] public static function getFormData(): array { return [ @@ -44,6 +47,7 @@ final class ByUserAggregatorTest extends AbstractAggregatorTest ]; } + #[\Override] public static function getQueryBuilders(): iterable { self::bootKernel(); diff --git a/src/Bundle/ChillActivityBundle/Tests/Export/Aggregator/CreatorJobAggregatorTest.php b/src/Bundle/ChillActivityBundle/Tests/Export/Aggregator/CreatorJobAggregatorTest.php index 763ab1a52..c646d15d6 100644 --- a/src/Bundle/ChillActivityBundle/Tests/Export/Aggregator/CreatorJobAggregatorTest.php +++ b/src/Bundle/ChillActivityBundle/Tests/Export/Aggregator/CreatorJobAggregatorTest.php @@ -25,6 +25,7 @@ final class CreatorJobAggregatorTest extends AbstractAggregatorTest { private CreatorJobAggregator $aggregator; + #[\Override] protected function setUp(): void { self::bootKernel(); @@ -32,11 +33,13 @@ final class CreatorJobAggregatorTest extends AbstractAggregatorTest $this->aggregator = self::getContainer()->get(CreatorJobAggregator::class); } + #[\Override] public function getAggregator() { return $this->aggregator; } + #[\Override] public static function getFormData(): array { return [ @@ -44,6 +47,7 @@ final class CreatorJobAggregatorTest extends AbstractAggregatorTest ]; } + #[\Override] public static function getQueryBuilders(): iterable { self::bootKernel(); diff --git a/src/Bundle/ChillActivityBundle/Tests/Export/Aggregator/CreatorScopeAggregatorTest.php b/src/Bundle/ChillActivityBundle/Tests/Export/Aggregator/CreatorScopeAggregatorTest.php index 1c0b9fe28..741862cc5 100644 --- a/src/Bundle/ChillActivityBundle/Tests/Export/Aggregator/CreatorScopeAggregatorTest.php +++ b/src/Bundle/ChillActivityBundle/Tests/Export/Aggregator/CreatorScopeAggregatorTest.php @@ -25,6 +25,7 @@ final class CreatorScopeAggregatorTest extends AbstractAggregatorTest { private CreatorScopeAggregator $aggregator; + #[\Override] protected function setUp(): void { self::bootKernel(); @@ -32,11 +33,13 @@ final class CreatorScopeAggregatorTest extends AbstractAggregatorTest $this->aggregator = self::getContainer()->get(CreatorScopeAggregator::class); } + #[\Override] public function getAggregator() { return $this->aggregator; } + #[\Override] public static function getFormData(): array { return [ @@ -44,6 +47,7 @@ final class CreatorScopeAggregatorTest extends AbstractAggregatorTest ]; } + #[\Override] public static function getQueryBuilders(): iterable { self::bootKernel(); diff --git a/src/Bundle/ChillActivityBundle/Tests/Export/Aggregator/DateAggregatorTest.php b/src/Bundle/ChillActivityBundle/Tests/Export/Aggregator/DateAggregatorTest.php index 7fb3b42c4..48bbdd4b5 100644 --- a/src/Bundle/ChillActivityBundle/Tests/Export/Aggregator/DateAggregatorTest.php +++ b/src/Bundle/ChillActivityBundle/Tests/Export/Aggregator/DateAggregatorTest.php @@ -25,6 +25,7 @@ final class DateAggregatorTest extends AbstractAggregatorTest { private DateAggregator $aggregator; + #[\Override] protected function setUp(): void { self::bootKernel(); @@ -32,11 +33,13 @@ final class DateAggregatorTest extends AbstractAggregatorTest $this->aggregator = self::getContainer()->get(DateAggregator::class); } + #[\Override] public function getAggregator() { return $this->aggregator; } + #[\Override] public static function getFormData(): array { return [ @@ -52,6 +55,7 @@ final class DateAggregatorTest extends AbstractAggregatorTest ]; } + #[\Override] public static function getQueryBuilders(): iterable { self::bootKernel(); diff --git a/src/Bundle/ChillActivityBundle/Tests/Export/Aggregator/LocationTypeAggregatorTest.php b/src/Bundle/ChillActivityBundle/Tests/Export/Aggregator/LocationTypeAggregatorTest.php index 4eebe9dc2..400abbc63 100644 --- a/src/Bundle/ChillActivityBundle/Tests/Export/Aggregator/LocationTypeAggregatorTest.php +++ b/src/Bundle/ChillActivityBundle/Tests/Export/Aggregator/LocationTypeAggregatorTest.php @@ -25,6 +25,7 @@ final class LocationTypeAggregatorTest extends AbstractAggregatorTest { private LocationTypeAggregator $aggregator; + #[\Override] protected function setUp(): void { self::bootKernel(); @@ -32,11 +33,13 @@ final class LocationTypeAggregatorTest extends AbstractAggregatorTest $this->aggregator = self::getContainer()->get(LocationTypeAggregator::class); } + #[\Override] public function getAggregator() { return $this->aggregator; } + #[\Override] public static function getFormData(): array { return [ @@ -44,6 +47,7 @@ final class LocationTypeAggregatorTest extends AbstractAggregatorTest ]; } + #[\Override] public static function getQueryBuilders(): iterable { self::bootKernel(); diff --git a/src/Bundle/ChillActivityBundle/Tests/Export/Aggregator/PersonAggregators/PersonAggregatorTest.php b/src/Bundle/ChillActivityBundle/Tests/Export/Aggregator/PersonAggregators/PersonAggregatorTest.php index 208d7971b..3553695ef 100644 --- a/src/Bundle/ChillActivityBundle/Tests/Export/Aggregator/PersonAggregators/PersonAggregatorTest.php +++ b/src/Bundle/ChillActivityBundle/Tests/Export/Aggregator/PersonAggregators/PersonAggregatorTest.php @@ -26,22 +26,26 @@ class PersonAggregatorTest extends AbstractAggregatorTest { private LabelPersonHelper $labelPersonHelper; + #[\Override] protected function setUp(): void { self::bootKernel(); $this->labelPersonHelper = self::getContainer()->get(LabelPersonHelper::class); } + #[\Override] public function getAggregator() { return new PersonAggregator($this->labelPersonHelper); } + #[\Override] public static function getFormData(): array { return [[]]; } + #[\Override] public static function getQueryBuilders(): iterable { self::bootKernel(); diff --git a/src/Bundle/ChillActivityBundle/Tests/Export/Aggregator/PersonsAggregatorTest.php b/src/Bundle/ChillActivityBundle/Tests/Export/Aggregator/PersonsAggregatorTest.php index bf9a683c3..7e12ebec9 100644 --- a/src/Bundle/ChillActivityBundle/Tests/Export/Aggregator/PersonsAggregatorTest.php +++ b/src/Bundle/ChillActivityBundle/Tests/Export/Aggregator/PersonsAggregatorTest.php @@ -26,6 +26,7 @@ class PersonsAggregatorTest extends AbstractAggregatorTest { private LabelPersonHelper $labelPersonHelper; + #[\Override] protected function setUp(): void { parent::setUp(); @@ -33,11 +34,13 @@ class PersonsAggregatorTest extends AbstractAggregatorTest $this->labelPersonHelper = self::getContainer()->get(LabelPersonHelper::class); } + #[\Override] public function getAggregator() { return new PersonsAggregator($this->labelPersonHelper); } + #[\Override] public static function getFormData(): array { return [ @@ -45,6 +48,7 @@ class PersonsAggregatorTest extends AbstractAggregatorTest ]; } + #[\Override] public static function getQueryBuilders(): iterable { self::bootKernel(); diff --git a/src/Bundle/ChillActivityBundle/Tests/Export/Export/LinkedToACP/AvgActivityDurationTest.php b/src/Bundle/ChillActivityBundle/Tests/Export/Export/LinkedToACP/AvgActivityDurationTest.php index 6231673c2..0113b02c9 100644 --- a/src/Bundle/ChillActivityBundle/Tests/Export/Export/LinkedToACP/AvgActivityDurationTest.php +++ b/src/Bundle/ChillActivityBundle/Tests/Export/Export/LinkedToACP/AvgActivityDurationTest.php @@ -22,11 +22,13 @@ use Chill\MainBundle\Test\Export\AbstractExportTest; */ final class AvgActivityDurationTest extends AbstractExportTest { + #[\Override] protected function setUp(): void { self::bootKernel(); } + #[\Override] public function getExport() { $activityRepository = self::getContainer()->get(ActivityRepository::class); @@ -35,6 +37,7 @@ final class AvgActivityDurationTest extends AbstractExportTest yield new AvgActivityDuration($activityRepository, $this->getParameters(false)); } + #[\Override] public static function getFormData(): array { return [ @@ -42,6 +45,7 @@ final class AvgActivityDurationTest extends AbstractExportTest ]; } + #[\Override] public static function getModifiersCombination(): array { return [ diff --git a/src/Bundle/ChillActivityBundle/Tests/Export/Export/LinkedToACP/AvgActivityVisitDurationTest.php b/src/Bundle/ChillActivityBundle/Tests/Export/Export/LinkedToACP/AvgActivityVisitDurationTest.php index 76ce0070f..bb6fdd3d7 100644 --- a/src/Bundle/ChillActivityBundle/Tests/Export/Export/LinkedToACP/AvgActivityVisitDurationTest.php +++ b/src/Bundle/ChillActivityBundle/Tests/Export/Export/LinkedToACP/AvgActivityVisitDurationTest.php @@ -22,11 +22,13 @@ use Doctrine\ORM\EntityManagerInterface; */ final class AvgActivityVisitDurationTest extends AbstractExportTest { + #[\Override] protected function setUp(): void { self::bootKernel(); } + #[\Override] public function getExport() { $em = self::getContainer()->get(EntityManagerInterface::class); @@ -35,6 +37,7 @@ final class AvgActivityVisitDurationTest extends AbstractExportTest yield new AvgActivityVisitDuration($em, $this->getParameters(false)); } + #[\Override] public static function getFormData(): array { return [ @@ -42,6 +45,7 @@ final class AvgActivityVisitDurationTest extends AbstractExportTest ]; } + #[\Override] public static function getModifiersCombination(): array { return [ diff --git a/src/Bundle/ChillActivityBundle/Tests/Export/Export/LinkedToACP/CountActivityTest.php b/src/Bundle/ChillActivityBundle/Tests/Export/Export/LinkedToACP/CountActivityTest.php index 9035807c3..f06b4ff44 100644 --- a/src/Bundle/ChillActivityBundle/Tests/Export/Export/LinkedToACP/CountActivityTest.php +++ b/src/Bundle/ChillActivityBundle/Tests/Export/Export/LinkedToACP/CountActivityTest.php @@ -22,11 +22,13 @@ use Doctrine\ORM\EntityManagerInterface; */ final class CountActivityTest extends AbstractExportTest { + #[\Override] protected function setUp(): void { self::bootKernel(); } + #[\Override] public function getExport() { $em = self::getContainer()->get(EntityManagerInterface::class); @@ -35,6 +37,7 @@ final class CountActivityTest extends AbstractExportTest yield new CountActivity($em, $this->getParameters(false)); } + #[\Override] public static function getFormData(): array { return [ @@ -42,6 +45,7 @@ final class CountActivityTest extends AbstractExportTest ]; } + #[\Override] public static function getModifiersCombination(): array { return [ diff --git a/src/Bundle/ChillActivityBundle/Tests/Export/Export/LinkedToACP/CountHouseholdOnActivityTest.php b/src/Bundle/ChillActivityBundle/Tests/Export/Export/LinkedToACP/CountHouseholdOnActivityTest.php index e7c7b7909..1070d0377 100644 --- a/src/Bundle/ChillActivityBundle/Tests/Export/Export/LinkedToACP/CountHouseholdOnActivityTest.php +++ b/src/Bundle/ChillActivityBundle/Tests/Export/Export/LinkedToACP/CountHouseholdOnActivityTest.php @@ -26,18 +26,21 @@ class CountHouseholdOnActivityTest extends AbstractExportTest { private EntityManagerInterface $entityManager; + #[\Override] protected function setUp(): void { self::bootKernel(); $this->entityManager = self::getContainer()->get(EntityManagerInterface::class); } + #[\Override] public function getExport() { yield new CountHouseholdOnActivity($this->entityManager, $this->getParameters(true)); yield new CountHouseholdOnActivity($this->entityManager, $this->getParameters(false)); } + #[\Override] public static function getFormData(): array { return [ @@ -45,6 +48,7 @@ class CountHouseholdOnActivityTest extends AbstractExportTest ]; } + #[\Override] public static function getModifiersCombination(): array { return [ diff --git a/src/Bundle/ChillActivityBundle/Tests/Export/Export/LinkedToACP/CountPersonsOnActivityTest.php b/src/Bundle/ChillActivityBundle/Tests/Export/Export/LinkedToACP/CountPersonsOnActivityTest.php index fcfb9b12e..b88d0e186 100644 --- a/src/Bundle/ChillActivityBundle/Tests/Export/Export/LinkedToACP/CountPersonsOnActivityTest.php +++ b/src/Bundle/ChillActivityBundle/Tests/Export/Export/LinkedToACP/CountPersonsOnActivityTest.php @@ -24,11 +24,13 @@ use Doctrine\ORM\EntityManagerInterface; */ class CountPersonsOnActivityTest extends AbstractExportTest { + #[\Override] protected function setUp(): void { self::bootKernel(); } + #[\Override] public function getExport() { $em = self::getContainer()->get(EntityManagerInterface::class); @@ -37,11 +39,13 @@ class CountPersonsOnActivityTest extends AbstractExportTest yield new CountPersonsOnActivity($em, $this->getParameters(false)); } + #[\Override] public static function getFormData(): array { return [[]]; } + #[\Override] public static function getModifiersCombination(): array { return [[ diff --git a/src/Bundle/ChillActivityBundle/Tests/Export/Export/LinkedToACP/SumActivityDurationTest.php b/src/Bundle/ChillActivityBundle/Tests/Export/Export/LinkedToACP/SumActivityDurationTest.php index 319d9408e..3619020b2 100644 --- a/src/Bundle/ChillActivityBundle/Tests/Export/Export/LinkedToACP/SumActivityDurationTest.php +++ b/src/Bundle/ChillActivityBundle/Tests/Export/Export/LinkedToACP/SumActivityDurationTest.php @@ -22,11 +22,13 @@ use Doctrine\ORM\EntityManagerInterface; */ final class SumActivityDurationTest extends AbstractExportTest { + #[\Override] protected function setUp(): void { self::bootKernel(); } + #[\Override] public function getExport() { $em = self::getContainer()->get(EntityManagerInterface::class); @@ -35,6 +37,7 @@ final class SumActivityDurationTest extends AbstractExportTest yield new SumActivityDuration($em, $this->getParameters(false)); } + #[\Override] public static function getFormData(): array { return [ @@ -42,6 +45,7 @@ final class SumActivityDurationTest extends AbstractExportTest ]; } + #[\Override] public static function getModifiersCombination(): array { return [ diff --git a/src/Bundle/ChillActivityBundle/Tests/Export/Export/LinkedToACP/SumActivityVisitDurationTest.php b/src/Bundle/ChillActivityBundle/Tests/Export/Export/LinkedToACP/SumActivityVisitDurationTest.php index a92a49cbb..5f9f8ad64 100644 --- a/src/Bundle/ChillActivityBundle/Tests/Export/Export/LinkedToACP/SumActivityVisitDurationTest.php +++ b/src/Bundle/ChillActivityBundle/Tests/Export/Export/LinkedToACP/SumActivityVisitDurationTest.php @@ -24,6 +24,7 @@ final class SumActivityVisitDurationTest extends AbstractExportTest { private SumActivityVisitDuration $export; + #[\Override] protected function setUp(): void { self::bootKernel(); @@ -31,6 +32,7 @@ final class SumActivityVisitDurationTest extends AbstractExportTest $this->export = self::getContainer()->get('chill.activity.export.sum_activity_visit_duration_linked_to_acp'); } + #[\Override] public function getExport() { $em = self::getContainer()->get(EntityManagerInterface::class); @@ -39,6 +41,7 @@ final class SumActivityVisitDurationTest extends AbstractExportTest yield new SumActivityVisitDuration($em, $this->getParameters(false)); } + #[\Override] public static function getFormData(): array { return [ @@ -46,6 +49,7 @@ final class SumActivityVisitDurationTest extends AbstractExportTest ]; } + #[\Override] public static function getModifiersCombination(): array { return [ diff --git a/src/Bundle/ChillActivityBundle/Tests/Export/Export/LinkedToPerson/CountActivityTest.php b/src/Bundle/ChillActivityBundle/Tests/Export/Export/LinkedToPerson/CountActivityTest.php index 569a66a0c..351bc9306 100644 --- a/src/Bundle/ChillActivityBundle/Tests/Export/Export/LinkedToPerson/CountActivityTest.php +++ b/src/Bundle/ChillActivityBundle/Tests/Export/Export/LinkedToPerson/CountActivityTest.php @@ -22,11 +22,13 @@ use Chill\MainBundle\Test\Export\AbstractExportTest; */ final class CountActivityTest extends AbstractExportTest { + #[\Override] protected function setUp(): void { self::bootKernel(); } + #[\Override] public function getExport() { $activityRepository = self::getContainer()->get(ActivityRepository::class); @@ -35,6 +37,7 @@ final class CountActivityTest extends AbstractExportTest yield new CountActivity($activityRepository, $this->getParameters(false)); } + #[\Override] public static function getFormData(): array { return [ @@ -42,6 +45,7 @@ final class CountActivityTest extends AbstractExportTest ]; } + #[\Override] public static function getModifiersCombination(): array { return [ diff --git a/src/Bundle/ChillActivityBundle/Tests/Export/Export/LinkedToPerson/CountHouseholdOnActivityTest.php b/src/Bundle/ChillActivityBundle/Tests/Export/Export/LinkedToPerson/CountHouseholdOnActivityTest.php index 7e222d8e1..2243ae53c 100644 --- a/src/Bundle/ChillActivityBundle/Tests/Export/Export/LinkedToPerson/CountHouseholdOnActivityTest.php +++ b/src/Bundle/ChillActivityBundle/Tests/Export/Export/LinkedToPerson/CountHouseholdOnActivityTest.php @@ -26,18 +26,21 @@ class CountHouseholdOnActivityTest extends AbstractExportTest { private ActivityRepository $activityRepository; + #[\Override] protected function setUp(): void { self::bootKernel(); $this->activityRepository = self::getContainer()->get(ActivityRepository::class); } + #[\Override] public function getExport() { yield new CountHouseholdOnActivity($this->activityRepository, $this->getParameters(true)); yield new CountHouseholdOnActivity($this->activityRepository, $this->getParameters(false)); } + #[\Override] public static function getFormData(): array { return [ @@ -45,6 +48,7 @@ class CountHouseholdOnActivityTest extends AbstractExportTest ]; } + #[\Override] public static function getModifiersCombination(): array { return [ diff --git a/src/Bundle/ChillActivityBundle/Tests/Export/Export/LinkedToPerson/ListActivityTest.php b/src/Bundle/ChillActivityBundle/Tests/Export/Export/LinkedToPerson/ListActivityTest.php index 91a532b74..058bacec1 100644 --- a/src/Bundle/ChillActivityBundle/Tests/Export/Export/LinkedToPerson/ListActivityTest.php +++ b/src/Bundle/ChillActivityBundle/Tests/Export/Export/LinkedToPerson/ListActivityTest.php @@ -30,6 +30,7 @@ final class ListActivityTest extends AbstractExportTest private readonly ListActivity $export; + #[\Override] protected function setUp(): void { self::bootKernel(); @@ -43,6 +44,7 @@ final class ListActivityTest extends AbstractExportTest ->push($request->reveal()); } + #[\Override] public function getExport() { $em = self::getContainer()->get(EntityManagerInterface::class); @@ -67,6 +69,7 @@ final class ListActivityTest extends AbstractExportTest ); } + #[\Override] public static function getFormData(): array { return [ @@ -89,6 +92,7 @@ final class ListActivityTest extends AbstractExportTest ]; } + #[\Override] public static function getModifiersCombination(): array { return [ diff --git a/src/Bundle/ChillActivityBundle/Tests/Export/Export/LinkedToPerson/StatActivityDurationTest.php b/src/Bundle/ChillActivityBundle/Tests/Export/Export/LinkedToPerson/StatActivityDurationTest.php index 31225eb8e..f552e63ac 100644 --- a/src/Bundle/ChillActivityBundle/Tests/Export/Export/LinkedToPerson/StatActivityDurationTest.php +++ b/src/Bundle/ChillActivityBundle/Tests/Export/Export/LinkedToPerson/StatActivityDurationTest.php @@ -26,11 +26,13 @@ final class StatActivityDurationTest extends AbstractExportTest { private readonly StatActivityDuration $export; + #[\Override] protected function setUp(): void { self::bootKernel(); } + #[\Override] public function getExport() { $activityRepository = self::getContainer()->get(ActivityRepository::class); @@ -38,6 +40,7 @@ final class StatActivityDurationTest extends AbstractExportTest yield new StatActivityDuration($activityRepository, $this->getParameters(false), 'sum'); } + #[\Override] public static function getFormData(): array { return [ @@ -45,6 +48,7 @@ final class StatActivityDurationTest extends AbstractExportTest ]; } + #[\Override] public static function getModifiersCombination(): array { return [ diff --git a/src/Bundle/ChillActivityBundle/Tests/Export/Filter/ACPFilters/ActivityTypeFilterTest.php b/src/Bundle/ChillActivityBundle/Tests/Export/Filter/ACPFilters/ActivityTypeFilterTest.php index ee9422385..645c2e8c9 100644 --- a/src/Bundle/ChillActivityBundle/Tests/Export/Filter/ACPFilters/ActivityTypeFilterTest.php +++ b/src/Bundle/ChillActivityBundle/Tests/Export/Filter/ACPFilters/ActivityTypeFilterTest.php @@ -29,6 +29,7 @@ final class ActivityTypeFilterTest extends AbstractFilterTest { private \Chill\ActivityBundle\Export\Filter\ACPFilters\ActivityTypeFilter $filter; + #[\Override] protected function setUp(): void { self::bootKernel(); @@ -36,11 +37,13 @@ final class ActivityTypeFilterTest extends AbstractFilterTest $this->filter = self::getContainer()->get(\Chill\ActivityBundle\Export\Filter\ACPFilters\ActivityTypeFilter::class); } + #[\Override] public function getFilter() { return $this->filter; } + #[\Override] public static function getFormData(): array { self::bootKernel(); @@ -83,6 +86,7 @@ final class ActivityTypeFilterTest extends AbstractFilterTest return $data; } + #[\Override] public static function getQueryBuilders(): iterable { self::bootKernel(); diff --git a/src/Bundle/ChillActivityBundle/Tests/Export/Filter/ACPFilters/ByCreatorFilterTest.php b/src/Bundle/ChillActivityBundle/Tests/Export/Filter/ACPFilters/ByCreatorFilterTest.php index 88e33a9ba..c27ed8590 100644 --- a/src/Bundle/ChillActivityBundle/Tests/Export/Filter/ACPFilters/ByCreatorFilterTest.php +++ b/src/Bundle/ChillActivityBundle/Tests/Export/Filter/ACPFilters/ByCreatorFilterTest.php @@ -26,6 +26,7 @@ final class ByCreatorFilterTest extends AbstractFilterTest { private ByCreatorFilter $filter; + #[\Override] protected function setUp(): void { self::bootKernel(); @@ -33,11 +34,13 @@ final class ByCreatorFilterTest extends AbstractFilterTest $this->filter = self::getContainer()->get(ByCreatorFilter::class); } + #[\Override] public function getFilter() { return $this->filter; } + #[\Override] public static function getFormData(): array { self::bootKernel(); @@ -58,6 +61,7 @@ final class ByCreatorFilterTest extends AbstractFilterTest return $data; } + #[\Override] public static function getQueryBuilders(): iterable { self::bootKernel(); diff --git a/src/Bundle/ChillActivityBundle/Tests/Export/Filter/ACPFilters/BySocialActionFilterTest.php b/src/Bundle/ChillActivityBundle/Tests/Export/Filter/ACPFilters/BySocialActionFilterTest.php index ef5fdbf81..cfd729798 100644 --- a/src/Bundle/ChillActivityBundle/Tests/Export/Filter/ACPFilters/BySocialActionFilterTest.php +++ b/src/Bundle/ChillActivityBundle/Tests/Export/Filter/ACPFilters/BySocialActionFilterTest.php @@ -26,6 +26,7 @@ final class BySocialActionFilterTest extends AbstractFilterTest { private \Chill\ActivityBundle\Export\Filter\ACPFilters\BySocialActionFilter $filter; + #[\Override] protected function setUp(): void { self::bootKernel(); @@ -33,11 +34,13 @@ final class BySocialActionFilterTest extends AbstractFilterTest $this->filter = self::getContainer()->get(\Chill\ActivityBundle\Export\Filter\ACPFilters\BySocialActionFilter::class); } + #[\Override] public function getFilter() { return $this->filter; } + #[\Override] public static function getFormData(): array { self::bootKernel(); @@ -57,6 +60,7 @@ final class BySocialActionFilterTest extends AbstractFilterTest return $data; } + #[\Override] public static function getQueryBuilders(): iterable { self::bootKernel(); diff --git a/src/Bundle/ChillActivityBundle/Tests/Export/Filter/ACPFilters/BySocialIssueFilterTest.php b/src/Bundle/ChillActivityBundle/Tests/Export/Filter/ACPFilters/BySocialIssueFilterTest.php index dba709aab..d6877e40c 100644 --- a/src/Bundle/ChillActivityBundle/Tests/Export/Filter/ACPFilters/BySocialIssueFilterTest.php +++ b/src/Bundle/ChillActivityBundle/Tests/Export/Filter/ACPFilters/BySocialIssueFilterTest.php @@ -27,6 +27,7 @@ final class BySocialIssueFilterTest extends AbstractFilterTest { private BySocialIssueFilter $filter; + #[\Override] protected function setUp(): void { self::bootKernel(); @@ -34,11 +35,13 @@ final class BySocialIssueFilterTest extends AbstractFilterTest $this->filter = self::getContainer()->get(BySocialIssueFilter::class); } + #[\Override] public function getFilter() { return $this->filter; } + #[\Override] public static function getFormData(): array { self::bootKernel(); @@ -59,6 +62,7 @@ final class BySocialIssueFilterTest extends AbstractFilterTest return $data; } + #[\Override] public static function getQueryBuilders(): iterable { if (null === self::$kernel) { diff --git a/src/Bundle/ChillActivityBundle/Tests/Export/Filter/ActivityDateFilterTest.php b/src/Bundle/ChillActivityBundle/Tests/Export/Filter/ActivityDateFilterTest.php index d9b2e3144..3baf950ad 100644 --- a/src/Bundle/ChillActivityBundle/Tests/Export/Filter/ActivityDateFilterTest.php +++ b/src/Bundle/ChillActivityBundle/Tests/Export/Filter/ActivityDateFilterTest.php @@ -26,6 +26,7 @@ final class ActivityDateFilterTest extends AbstractFilterTest { private ActivityDateFilter $filter; + #[\Override] protected function setUp(): void { self::bootKernel(); @@ -33,11 +34,13 @@ final class ActivityDateFilterTest extends AbstractFilterTest $this->filter = self::getContainer()->get(ActivityDateFilter::class); } + #[\Override] public function getFilter() { return $this->filter; } + #[\Override] public static function getFormData(): array { return [ @@ -48,6 +51,7 @@ final class ActivityDateFilterTest extends AbstractFilterTest ]; } + #[\Override] public static function getQueryBuilders(): iterable { self::bootKernel(); diff --git a/src/Bundle/ChillActivityBundle/Tests/Export/Filter/ActivityPresenceFilterTest.php b/src/Bundle/ChillActivityBundle/Tests/Export/Filter/ActivityPresenceFilterTest.php index 01c94ce63..f7a890b78 100644 --- a/src/Bundle/ChillActivityBundle/Tests/Export/Filter/ActivityPresenceFilterTest.php +++ b/src/Bundle/ChillActivityBundle/Tests/Export/Filter/ActivityPresenceFilterTest.php @@ -30,6 +30,7 @@ class ActivityPresenceFilterTest extends AbstractFilterTest private TranslatableStringHelperInterface $translatableStringHelper; private TranslatorInterface $translator; + #[\Override] protected function setUp(): void { parent::setUp(); @@ -39,11 +40,13 @@ class ActivityPresenceFilterTest extends AbstractFilterTest $this->translatableStringHelper = self::getContainer()->get(TranslatableStringHelperInterface::class); } + #[\Override] public function getFilter() { return new ActivityPresenceFilter($this->translatableStringHelper, $this->translator); } + #[\Override] public static function getFormData(): array { self::bootKernel(); @@ -60,6 +63,7 @@ class ActivityPresenceFilterTest extends AbstractFilterTest ]; } + #[\Override] public static function getQueryBuilders(): iterable { self::bootKernel(); diff --git a/src/Bundle/ChillActivityBundle/Tests/Export/Filter/ActivityReasonFilterTest.php b/src/Bundle/ChillActivityBundle/Tests/Export/Filter/ActivityReasonFilterTest.php index 555364f9a..70388870d 100644 --- a/src/Bundle/ChillActivityBundle/Tests/Export/Filter/ActivityReasonFilterTest.php +++ b/src/Bundle/ChillActivityBundle/Tests/Export/Filter/ActivityReasonFilterTest.php @@ -29,6 +29,7 @@ final class ActivityReasonFilterTest extends AbstractFilterTest private ActivityReasonFilter $filter; + #[\Override] protected function setUp(): void { self::bootKernel(); @@ -44,11 +45,13 @@ final class ActivityReasonFilterTest extends AbstractFilterTest ->push($request->reveal()); } + #[\Override] public function getFilter() { return $this->filter; } + #[\Override] public static function getFormData(): array { self::bootKernel(); @@ -68,6 +71,7 @@ final class ActivityReasonFilterTest extends AbstractFilterTest return $data; } + #[\Override] public static function getQueryBuilders(): iterable { self::bootKernel(); diff --git a/src/Bundle/ChillActivityBundle/Tests/Export/Filter/ActivityTypeFilterTest.php b/src/Bundle/ChillActivityBundle/Tests/Export/Filter/ActivityTypeFilterTest.php index a9c44d591..c7c566bf5 100644 --- a/src/Bundle/ChillActivityBundle/Tests/Export/Filter/ActivityTypeFilterTest.php +++ b/src/Bundle/ChillActivityBundle/Tests/Export/Filter/ActivityTypeFilterTest.php @@ -27,6 +27,7 @@ final class ActivityTypeFilterTest extends AbstractFilterTest { private ActivityTypeFilter $filter; + #[\Override] protected function setUp(): void { self::bootKernel(); @@ -34,11 +35,13 @@ final class ActivityTypeFilterTest extends AbstractFilterTest $this->filter = self::getContainer()->get('chill.activity.export.type_filter'); } + #[\Override] public function getFilter() { return $this->filter; } + #[\Override] public static function getFormData(): array { self::bootKernel(); @@ -61,6 +64,7 @@ final class ActivityTypeFilterTest extends AbstractFilterTest return $data; } + #[\Override] public static function getQueryBuilders(): iterable { self::bootKernel(); diff --git a/src/Bundle/ChillActivityBundle/Tests/Export/Filter/ByCreatorFilterTest.php b/src/Bundle/ChillActivityBundle/Tests/Export/Filter/ByCreatorFilterTest.php index cbd168ce8..5593eab58 100644 --- a/src/Bundle/ChillActivityBundle/Tests/Export/Filter/ByCreatorFilterTest.php +++ b/src/Bundle/ChillActivityBundle/Tests/Export/Filter/ByCreatorFilterTest.php @@ -26,6 +26,7 @@ final class ByCreatorFilterTest extends AbstractFilterTest { private ByCreatorFilter $filter; + #[\Override] protected function setUp(): void { self::bootKernel(); @@ -33,11 +34,13 @@ final class ByCreatorFilterTest extends AbstractFilterTest $this->filter = self::getContainer()->get(ByCreatorFilter::class); } + #[\Override] public function getFilter() { return $this->filter; } + #[\Override] public static function getFormData(): array { $em = self::getContainer()->get(EntityManagerInterface::class); @@ -56,6 +59,7 @@ final class ByCreatorFilterTest extends AbstractFilterTest return $data; } + #[\Override] public static function getQueryBuilders(): iterable { if (null === self::$kernel) { diff --git a/src/Bundle/ChillActivityBundle/Tests/Export/Filter/CreatorJobFilterTest.php b/src/Bundle/ChillActivityBundle/Tests/Export/Filter/CreatorJobFilterTest.php index 9babab132..d62ef26d9 100644 --- a/src/Bundle/ChillActivityBundle/Tests/Export/Filter/CreatorJobFilterTest.php +++ b/src/Bundle/ChillActivityBundle/Tests/Export/Filter/CreatorJobFilterTest.php @@ -31,6 +31,7 @@ class CreatorJobFilterTest extends AbstractFilterTest private TranslatorInterface $translator; private UserJobRepositoryInterface $userJobRepository; + #[\Override] protected function setUp(): void { parent::setUp(); @@ -42,6 +43,7 @@ class CreatorJobFilterTest extends AbstractFilterTest $this->userJobRepository = self::getContainer()->get(UserJobRepositoryInterface::class); } + #[\Override] public function getFilter() { return new CreatorJobFilter( @@ -51,6 +53,7 @@ class CreatorJobFilterTest extends AbstractFilterTest ); } + #[\Override] public static function getFormData(): array { $this->setUp(); @@ -61,6 +64,7 @@ class CreatorJobFilterTest extends AbstractFilterTest ]; } + #[\Override] public static function getQueryBuilders(): iterable { self::setUp(); diff --git a/src/Bundle/ChillActivityBundle/Tests/Export/Filter/CreatorScopeFilterTest.php b/src/Bundle/ChillActivityBundle/Tests/Export/Filter/CreatorScopeFilterTest.php index 9fdb4ea61..08c75235c 100644 --- a/src/Bundle/ChillActivityBundle/Tests/Export/Filter/CreatorScopeFilterTest.php +++ b/src/Bundle/ChillActivityBundle/Tests/Export/Filter/CreatorScopeFilterTest.php @@ -26,6 +26,7 @@ final class CreatorScopeFilterTest extends AbstractFilterTest { private CreatorScopeFilter $filter; + #[\Override] protected function setUp(): void { self::bootKernel(); @@ -33,11 +34,13 @@ final class CreatorScopeFilterTest extends AbstractFilterTest $this->filter = self::getContainer()->get(CreatorScopeFilter::class); } + #[\Override] public function getFilter() { return $this->filter; } + #[\Override] public static function getFormData(): array { self::bootKernel(); @@ -58,6 +61,7 @@ final class CreatorScopeFilterTest extends AbstractFilterTest return $data; } + #[\Override] public static function getQueryBuilders(): iterable { self::bootKernel(); diff --git a/src/Bundle/ChillActivityBundle/Tests/Export/Filter/EmergencyFilterTest.php b/src/Bundle/ChillActivityBundle/Tests/Export/Filter/EmergencyFilterTest.php index d1645533c..325f9c1c9 100644 --- a/src/Bundle/ChillActivityBundle/Tests/Export/Filter/EmergencyFilterTest.php +++ b/src/Bundle/ChillActivityBundle/Tests/Export/Filter/EmergencyFilterTest.php @@ -25,6 +25,7 @@ final class EmergencyFilterTest extends AbstractFilterTest { private EmergencyFilter $filter; + #[\Override] protected function setUp(): void { self::bootKernel(); @@ -32,11 +33,13 @@ final class EmergencyFilterTest extends AbstractFilterTest $this->filter = self::getContainer()->get(EmergencyFilter::class); } + #[\Override] public function getFilter() { return $this->filter; } + #[\Override] public static function getFormData(): array { return [ @@ -45,6 +48,7 @@ final class EmergencyFilterTest extends AbstractFilterTest ]; } + #[\Override] public static function getQueryBuilders(): iterable { self::bootKernel(); diff --git a/src/Bundle/ChillActivityBundle/Tests/Export/Filter/LocationTypeFilterTest.php b/src/Bundle/ChillActivityBundle/Tests/Export/Filter/LocationTypeFilterTest.php index b3ffa7abb..ad04b4c6c 100644 --- a/src/Bundle/ChillActivityBundle/Tests/Export/Filter/LocationTypeFilterTest.php +++ b/src/Bundle/ChillActivityBundle/Tests/Export/Filter/LocationTypeFilterTest.php @@ -26,6 +26,7 @@ final class LocationTypeFilterTest extends AbstractFilterTest { private LocationTypeFilter $filter; + #[\Override] protected function setUp(): void { self::bootKernel(); @@ -33,11 +34,13 @@ final class LocationTypeFilterTest extends AbstractFilterTest $this->filter = self::getContainer()->get(LocationTypeFilter::class); } + #[\Override] public function getFilter() { return $this->filter; } + #[\Override] public static function getFormData(): array { self::bootKernel(); @@ -58,6 +61,7 @@ final class LocationTypeFilterTest extends AbstractFilterTest return $data; } + #[\Override] public static function getQueryBuilders(): iterable { self::bootKernel(); diff --git a/src/Bundle/ChillActivityBundle/Tests/Export/Filter/PersonFilters/ActivityReasonFilterTest.php b/src/Bundle/ChillActivityBundle/Tests/Export/Filter/PersonFilters/ActivityReasonFilterTest.php index 0c9637e2e..a482b8b55 100644 --- a/src/Bundle/ChillActivityBundle/Tests/Export/Filter/PersonFilters/ActivityReasonFilterTest.php +++ b/src/Bundle/ChillActivityBundle/Tests/Export/Filter/PersonFilters/ActivityReasonFilterTest.php @@ -27,6 +27,7 @@ final class ActivityReasonFilterTest extends AbstractFilterTest { private ActivityReasonFilter $filter; + #[\Override] protected function setUp(): void { self::bootKernel(); @@ -34,11 +35,13 @@ final class ActivityReasonFilterTest extends AbstractFilterTest $this->filter = self::getContainer()->get('chill.activity.export.reason_filter'); } + #[\Override] public function getFilter() { return $this->filter; } + #[\Override] public static function getFormData(): array { self::bootKernel(); @@ -59,6 +62,7 @@ final class ActivityReasonFilterTest extends AbstractFilterTest return $data; } + #[\Override] public static function getQueryBuilders(): iterable { self::bootKernel(); diff --git a/src/Bundle/ChillActivityBundle/Tests/Export/Filter/PersonFilters/PersonHavingActivityBetweenDateFilterTest.php b/src/Bundle/ChillActivityBundle/Tests/Export/Filter/PersonFilters/PersonHavingActivityBetweenDateFilterTest.php index 329256f3d..4747d1358 100644 --- a/src/Bundle/ChillActivityBundle/Tests/Export/Filter/PersonFilters/PersonHavingActivityBetweenDateFilterTest.php +++ b/src/Bundle/ChillActivityBundle/Tests/Export/Filter/PersonFilters/PersonHavingActivityBetweenDateFilterTest.php @@ -26,6 +26,7 @@ final class PersonHavingActivityBetweenDateFilterTest extends AbstractFilterTest { private PersonHavingActivityBetweenDateFilter $filter; + #[\Override] protected function setUp(): void { self::bootKernel(); @@ -33,11 +34,13 @@ final class PersonHavingActivityBetweenDateFilterTest extends AbstractFilterTest $this->filter = self::getContainer()->get('chill.activity.export.person_having_an_activity_between_date_filter'); } + #[\Override] public function getFilter() { return $this->filter; } + #[\Override] public static function getFormData(): array { self::bootKernel(); @@ -60,6 +63,7 @@ final class PersonHavingActivityBetweenDateFilterTest extends AbstractFilterTest return $data; } + #[\Override] public static function getQueryBuilders(): iterable { if (null === self::$kernel) { diff --git a/src/Bundle/ChillActivityBundle/Tests/Export/Filter/PersonHavingActivityBetweenDateFilterTest.php b/src/Bundle/ChillActivityBundle/Tests/Export/Filter/PersonHavingActivityBetweenDateFilterTest.php index c5aa9f517..e561ad14d 100644 --- a/src/Bundle/ChillActivityBundle/Tests/Export/Filter/PersonHavingActivityBetweenDateFilterTest.php +++ b/src/Bundle/ChillActivityBundle/Tests/Export/Filter/PersonHavingActivityBetweenDateFilterTest.php @@ -28,6 +28,7 @@ final class PersonHavingActivityBetweenDateFilterTest extends AbstractFilterTest { private PersonHavingActivityBetweenDateFilter $filter; + #[\Override] protected function setUp(): void { self::bootKernel(); @@ -43,11 +44,13 @@ final class PersonHavingActivityBetweenDateFilterTest extends AbstractFilterTest ->push($request->reveal()); } + #[\Override] public function getFilter() { return $this->filter; } + #[\Override] public static function getFormData(): array { $date_from = \DateTime::createFromFormat('Y-m-d', '2015-01-15'); @@ -66,6 +69,7 @@ final class PersonHavingActivityBetweenDateFilterTest extends AbstractFilterTest return $data; } + #[\Override] public static function getQueryBuilders(): iterable { self::bootKernel(); diff --git a/src/Bundle/ChillActivityBundle/Tests/Export/Filter/PersonsFilterTest.php b/src/Bundle/ChillActivityBundle/Tests/Export/Filter/PersonsFilterTest.php index cf2ab05ac..48f881a14 100644 --- a/src/Bundle/ChillActivityBundle/Tests/Export/Filter/PersonsFilterTest.php +++ b/src/Bundle/ChillActivityBundle/Tests/Export/Filter/PersonsFilterTest.php @@ -27,6 +27,7 @@ class PersonsFilterTest extends AbstractFilterTest { private PersonRenderInterface $personRender; + #[\Override] protected function setUp(): void { parent::setUp(); @@ -34,11 +35,13 @@ class PersonsFilterTest extends AbstractFilterTest $this->personRender = self::getContainer()->get(PersonRenderInterface::class); } + #[\Override] public function getFilter() { return new PersonsFilter($this->personRender); } + #[\Override] public static function getFormData(): array { self::bootKernel(); @@ -55,6 +58,7 @@ class PersonsFilterTest extends AbstractFilterTest ]; } + #[\Override] public static function getQueryBuilders(): iterable { self::bootKernel(); diff --git a/src/Bundle/ChillActivityBundle/Tests/Export/Filter/SentReceivedFilterTest.php b/src/Bundle/ChillActivityBundle/Tests/Export/Filter/SentReceivedFilterTest.php index 843bfea1d..64564631e 100644 --- a/src/Bundle/ChillActivityBundle/Tests/Export/Filter/SentReceivedFilterTest.php +++ b/src/Bundle/ChillActivityBundle/Tests/Export/Filter/SentReceivedFilterTest.php @@ -25,6 +25,7 @@ final class SentReceivedFilterTest extends AbstractFilterTest { private SentReceivedFilter $filter; + #[\Override] protected function setUp(): void { self::bootKernel(); @@ -32,11 +33,13 @@ final class SentReceivedFilterTest extends AbstractFilterTest $this->filter = self::getContainer()->get(SentReceivedFilter::class); } + #[\Override] public function getFilter() { return $this->filter; } + #[\Override] public static function getFormData(): array { return [ @@ -45,6 +48,7 @@ final class SentReceivedFilterTest extends AbstractFilterTest ]; } + #[\Override] public static function getQueryBuilders(): iterable { self::bootKernel(); diff --git a/src/Bundle/ChillActivityBundle/Tests/Export/Filter/UserFilterTest.php b/src/Bundle/ChillActivityBundle/Tests/Export/Filter/UserFilterTest.php index 569fb5403..c7a1f0f07 100644 --- a/src/Bundle/ChillActivityBundle/Tests/Export/Filter/UserFilterTest.php +++ b/src/Bundle/ChillActivityBundle/Tests/Export/Filter/UserFilterTest.php @@ -26,6 +26,7 @@ final class UserFilterTest extends AbstractFilterTest { private UserFilter $filter; + #[\Override] protected function setUp(): void { self::bootKernel(); @@ -33,11 +34,13 @@ final class UserFilterTest extends AbstractFilterTest $this->filter = self::getContainer()->get(UserFilter::class); } + #[\Override] public function getFilter() { return $this->filter; } + #[\Override] public static function getFormData(): array { self::bootKernel(); @@ -58,6 +61,7 @@ final class UserFilterTest extends AbstractFilterTest return $data; } + #[\Override] public static function getQueryBuilders(): iterable { self::bootKernel(); diff --git a/src/Bundle/ChillActivityBundle/Tests/Form/ActivityTypeTest.php b/src/Bundle/ChillActivityBundle/Tests/Form/ActivityTypeTest.php index 3d1b31f08..b5d4ea09b 100644 --- a/src/Bundle/ChillActivityBundle/Tests/Form/ActivityTypeTest.php +++ b/src/Bundle/ChillActivityBundle/Tests/Form/ActivityTypeTest.php @@ -39,6 +39,7 @@ final class ActivityTypeTest extends KernelTestCase */ protected $user; + #[\Override] protected function setUp(): void { self::bootKernel(); diff --git a/src/Bundle/ChillActivityBundle/Tests/Form/Type/TranslatableActivityReasonTest.php b/src/Bundle/ChillActivityBundle/Tests/Form/Type/TranslatableActivityReasonTest.php index 014c3ae9f..ac9a999d4 100644 --- a/src/Bundle/ChillActivityBundle/Tests/Form/Type/TranslatableActivityReasonTest.php +++ b/src/Bundle/ChillActivityBundle/Tests/Form/Type/TranslatableActivityReasonTest.php @@ -30,6 +30,7 @@ final class TranslatableActivityReasonTest extends TypeTestCase */ private static $prophet; + #[\Override] protected function setUp(): void { parent::setUp(); @@ -59,6 +60,7 @@ final class TranslatableActivityReasonTest extends TypeTestCase return new \Symfony\Bridge\Doctrine\Form\Type\EntityType($managerRegistry->reveal()); } + #[\Override] protected function getExtensions() { $entityType = $this->getEntityType(); diff --git a/src/Bundle/ChillActivityBundle/Tests/Form/Type/TranslatableActivityTypeTest.php b/src/Bundle/ChillActivityBundle/Tests/Form/Type/TranslatableActivityTypeTest.php index 6715af3ed..3620c7e35 100644 --- a/src/Bundle/ChillActivityBundle/Tests/Form/Type/TranslatableActivityTypeTest.php +++ b/src/Bundle/ChillActivityBundle/Tests/Form/Type/TranslatableActivityTypeTest.php @@ -28,6 +28,7 @@ final class TranslatableActivityTypeTest extends KernelTestCase */ protected $builder; + #[\Override] protected function setUp(): void { self::bootKernel(); diff --git a/src/Bundle/ChillActivityBundle/Tests/Repository/ActivityACLAwareRepositoryTest.php b/src/Bundle/ChillActivityBundle/Tests/Repository/ActivityACLAwareRepositoryTest.php index de4a3312d..c551140bc 100644 --- a/src/Bundle/ChillActivityBundle/Tests/Repository/ActivityACLAwareRepositoryTest.php +++ b/src/Bundle/ChillActivityBundle/Tests/Repository/ActivityACLAwareRepositoryTest.php @@ -51,6 +51,7 @@ class ActivityACLAwareRepositoryTest extends KernelTestCase private RequestStack $requestStack; + #[\Override] protected function setUp(): void { self::bootKernel(); diff --git a/src/Bundle/ChillActivityBundle/Tests/Repository/ActivityDocumentACLAwareRepositoryTest.php b/src/Bundle/ChillActivityBundle/Tests/Repository/ActivityDocumentACLAwareRepositoryTest.php index b8f1842c2..be27d70ee 100644 --- a/src/Bundle/ChillActivityBundle/Tests/Repository/ActivityDocumentACLAwareRepositoryTest.php +++ b/src/Bundle/ChillActivityBundle/Tests/Repository/ActivityDocumentACLAwareRepositoryTest.php @@ -42,6 +42,7 @@ class ActivityDocumentACLAwareRepositoryTest extends KernelTestCase private Security $security; + #[\Override] protected function setUp(): void { self::bootKernel(); diff --git a/src/Bundle/ChillActivityBundle/Tests/Security/Authorization/ActivityVoterTest.php b/src/Bundle/ChillActivityBundle/Tests/Security/Authorization/ActivityVoterTest.php index e3ab7b60a..06eb1f10f 100644 --- a/src/Bundle/ChillActivityBundle/Tests/Security/Authorization/ActivityVoterTest.php +++ b/src/Bundle/ChillActivityBundle/Tests/Security/Authorization/ActivityVoterTest.php @@ -49,6 +49,7 @@ final class ActivityVoterTest extends KernelTestCase */ protected $voter; + #[\Override] protected function setUp(): void { self::bootKernel(); diff --git a/src/Bundle/ChillActivityBundle/Tests/Service/DocGenerator/ListActivitiesByAccompanyingPeriodContextTest.php b/src/Bundle/ChillActivityBundle/Tests/Service/DocGenerator/ListActivitiesByAccompanyingPeriodContextTest.php index eadb8710c..f1c6dc279 100644 --- a/src/Bundle/ChillActivityBundle/Tests/Service/DocGenerator/ListActivitiesByAccompanyingPeriodContextTest.php +++ b/src/Bundle/ChillActivityBundle/Tests/Service/DocGenerator/ListActivitiesByAccompanyingPeriodContextTest.php @@ -32,6 +32,7 @@ class ListActivitiesByAccompanyingPeriodContextTest extends KernelTestCase private AccompanyingPeriodRepository $accompanyingPeriodRepository; private UserRepositoryInterface $userRepository; + #[\Override] protected function setUp(): void { self::bootKernel(); diff --git a/src/Bundle/ChillActivityBundle/Timeline/TimelineActivityProvider.php b/src/Bundle/ChillActivityBundle/Timeline/TimelineActivityProvider.php index 23a75e9fe..5e0c8c738 100644 --- a/src/Bundle/ChillActivityBundle/Timeline/TimelineActivityProvider.php +++ b/src/Bundle/ChillActivityBundle/Timeline/TimelineActivityProvider.php @@ -24,7 +24,7 @@ use Symfony\Component\Security\Core\User\UserInterface; class TimelineActivityProvider implements TimelineProviderInterface { - private const SUPPORTED_CONTEXTS = ['center', 'person']; + private const array SUPPORTED_CONTEXTS = ['center', 'person']; protected UserInterface $user; @@ -41,6 +41,7 @@ class TimelineActivityProvider implements TimelineProviderInterface $this->user = $storage->getToken()->getUser(); } + #[\Override] public function fetchQuery($context, array $args) { if ('center' === $context) { @@ -64,6 +65,7 @@ class TimelineActivityProvider implements TimelineProviderInterface ]); } + #[\Override] public function getEntities(array $ids): array { $activities = $this->em->getRepository(Activity::class) @@ -78,6 +80,7 @@ class TimelineActivityProvider implements TimelineProviderInterface return $result; } + #[\Override] public function getEntityTemplate($entity, $context, array $args): array { $this->checkContext($context); @@ -91,6 +94,7 @@ class TimelineActivityProvider implements TimelineProviderInterface ]; } + #[\Override] public function supportsType($type): bool { return 'activity' === $type; diff --git a/src/Bundle/ChillActivityBundle/Validator/Constraints/ActivityValidity.php b/src/Bundle/ChillActivityBundle/Validator/Constraints/ActivityValidity.php index bea38c768..4817498ca 100644 --- a/src/Bundle/ChillActivityBundle/Validator/Constraints/ActivityValidity.php +++ b/src/Bundle/ChillActivityBundle/Validator/Constraints/ActivityValidity.php @@ -16,9 +16,9 @@ use Symfony\Component\Validator\Constraint; #[\Attribute(\Attribute::TARGET_CLASS)] class ActivityValidity extends Constraint { - final public const IS_REQUIRED_MESSAGE = ' is required'; + final public const string IS_REQUIRED_MESSAGE = ' is required'; - final public const ROOT_MESSAGE = 'For this type of activity, '; + final public const string ROOT_MESSAGE = 'For this type of activity, '; public $noPersonsMessage = 'For this type of activity, you must add at least one person'; @@ -30,6 +30,7 @@ class ActivityValidity extends Constraint public $socialIssuesMessage = 'For this type of activity, you must add at least one social issue'; + #[\Override] public function getTargets() { return self::CLASS_CONSTRAINT; diff --git a/src/Bundle/ChillActivityBundle/Validator/Constraints/ActivityValidityValidator.php b/src/Bundle/ChillActivityBundle/Validator/Constraints/ActivityValidityValidator.php index 21ee6185e..19e486c2b 100644 --- a/src/Bundle/ChillActivityBundle/Validator/Constraints/ActivityValidityValidator.php +++ b/src/Bundle/ChillActivityBundle/Validator/Constraints/ActivityValidityValidator.php @@ -20,6 +20,7 @@ use Symfony\Component\Validator\Exception\UnexpectedValueException; class ActivityValidityValidator extends ConstraintValidator { + #[\Override] public function validate($activity, Constraint $constraint) { if (!$constraint instanceof ActivityValidity) { diff --git a/src/Bundle/ChillActivityBundle/migrations/Version20150701091248.php b/src/Bundle/ChillActivityBundle/migrations/Version20150701091248.php index 5a050035a..587db4f42 100644 --- a/src/Bundle/ChillActivityBundle/migrations/Version20150701091248.php +++ b/src/Bundle/ChillActivityBundle/migrations/Version20150701091248.php @@ -19,6 +19,7 @@ use Doctrine\Migrations\AbstractMigration; */ class Version20150701091248 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { // this down() migration is auto-generated, please modify it to your needs @@ -37,6 +38,7 @@ class Version20150701091248 extends AbstractMigration $this->addSql('DROP TABLE ActivityType'); } + #[\Override] public function up(Schema $schema): void { // this up() migration is auto-generated, please modify it to your needs diff --git a/src/Bundle/ChillActivityBundle/migrations/Version20150702093317.php b/src/Bundle/ChillActivityBundle/migrations/Version20150702093317.php index 053e4ecc8..a1bc7d506 100644 --- a/src/Bundle/ChillActivityBundle/migrations/Version20150702093317.php +++ b/src/Bundle/ChillActivityBundle/migrations/Version20150702093317.php @@ -19,6 +19,7 @@ use Doctrine\Migrations\AbstractMigration; */ class Version20150702093317 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { // this down() migration is auto-generated, please modify it to your needs @@ -32,6 +33,7 @@ class Version20150702093317 extends AbstractMigration $this->addSql('ALTER TABLE ActivityType ADD COLUMN name VARCHAR(255) NOT NULL;'); } + #[\Override] public function up(Schema $schema): void { // this up() migration is auto-generated, please modify it to your needs diff --git a/src/Bundle/ChillActivityBundle/migrations/Version20150704091347.php b/src/Bundle/ChillActivityBundle/migrations/Version20150704091347.php index 78204fa67..5a9e43aa0 100644 --- a/src/Bundle/ChillActivityBundle/migrations/Version20150704091347.php +++ b/src/Bundle/ChillActivityBundle/migrations/Version20150704091347.php @@ -19,6 +19,7 @@ use Doctrine\Migrations\AbstractMigration; */ class Version20150704091347 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { // this down() migration is auto-generated, please modify it to your needs @@ -28,6 +29,7 @@ class Version20150704091347 extends AbstractMigration $this->addSql('ALTER TABLE Activity ALTER COLUMN attendee DROP NOT NULL;'); } + #[\Override] public function up(Schema $schema): void { // this up() migration is auto-generated, please modify it to your needs diff --git a/src/Bundle/ChillActivityBundle/migrations/Version20160222103457.php b/src/Bundle/ChillActivityBundle/migrations/Version20160222103457.php index ceb0e59e6..133ddb477 100644 --- a/src/Bundle/ChillActivityBundle/migrations/Version20160222103457.php +++ b/src/Bundle/ChillActivityBundle/migrations/Version20160222103457.php @@ -22,6 +22,7 @@ use Doctrine\Migrations\AbstractMigration; */ class Version20160222103457 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->abortIf( @@ -49,6 +50,7 @@ class Version20160222103457 extends AbstractMigration $this->addSql('DROP TABLE activity_activityreason'); } + #[\Override] public function up(Schema $schema): void { $this->abortIf( diff --git a/src/Bundle/ChillActivityBundle/migrations/Version20161114085659.php b/src/Bundle/ChillActivityBundle/migrations/Version20161114085659.php index 7a5fdbd9d..891976312 100644 --- a/src/Bundle/ChillActivityBundle/migrations/Version20161114085659.php +++ b/src/Bundle/ChillActivityBundle/migrations/Version20161114085659.php @@ -19,11 +19,13 @@ use Doctrine\Migrations\AbstractMigration; */ class Version20161114085659 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->addSql('ALTER TABLE ActivityType DROP active'); } + #[\Override] public function up(Schema $schema): void { $this->addSql('ALTER TABLE activitytype ADD active BOOLEAN NOT NULL DEFAULT \'t\''); diff --git a/src/Bundle/ChillActivityBundle/migrations/Version20210304154629.php b/src/Bundle/ChillActivityBundle/migrations/Version20210304154629.php index 23bd785a6..94ff1c386 100644 --- a/src/Bundle/ChillActivityBundle/migrations/Version20210304154629.php +++ b/src/Bundle/ChillActivityBundle/migrations/Version20210304154629.php @@ -19,6 +19,7 @@ use Doctrine\Migrations\AbstractMigration; */ final class Version20210304154629 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { // this down() migration is auto-generated, please modify it to your needs @@ -28,11 +29,13 @@ final class Version20210304154629 extends AbstractMigration $this->addSql('ALTER TABLE activity DROP comment_date'); } + #[\Override] public function getDescription(): string { return ''; } + #[\Override] public function up(Schema $schema): void { // this up() migration is auto-generated, please modify it to your needs diff --git a/src/Bundle/ChillActivityBundle/migrations/Version20210311114250.php b/src/Bundle/ChillActivityBundle/migrations/Version20210311114250.php index 96c34abce..c5072a54b 100644 --- a/src/Bundle/ChillActivityBundle/migrations/Version20210311114250.php +++ b/src/Bundle/ChillActivityBundle/migrations/Version20210311114250.php @@ -19,16 +19,19 @@ use Doctrine\Migrations\AbstractMigration; */ final class Version20210311114250 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { // this down() migration is auto-generated, please modify it to your needs } + #[\Override] public function getDescription(): string { return ''; } + #[\Override] public function up(Schema $schema): void { // this up() migration is auto-generated, please modify it to your needs diff --git a/src/Bundle/ChillActivityBundle/migrations/Version20210401090853.php b/src/Bundle/ChillActivityBundle/migrations/Version20210401090853.php index c522e7dbc..7c608b080 100644 --- a/src/Bundle/ChillActivityBundle/migrations/Version20210401090853.php +++ b/src/Bundle/ChillActivityBundle/migrations/Version20210401090853.php @@ -19,6 +19,7 @@ use Doctrine\Migrations\AbstractMigration; */ final class Version20210401090853 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { // this down() migration is auto-generated, please modify it to your needs @@ -26,11 +27,13 @@ final class Version20210401090853 extends AbstractMigration $this->addSql('DROP TABLE activitytypecategory'); } + #[\Override] public function getDescription(): string { return ''; } + #[\Override] public function up(Schema $schema): void { // this up() migration is auto-generated, please modify it to your needs diff --git a/src/Bundle/ChillActivityBundle/migrations/Version20210408122329.php b/src/Bundle/ChillActivityBundle/migrations/Version20210408122329.php index 10986f6ec..08e9e5281 100644 --- a/src/Bundle/ChillActivityBundle/migrations/Version20210408122329.php +++ b/src/Bundle/ChillActivityBundle/migrations/Version20210408122329.php @@ -19,6 +19,7 @@ use Doctrine\Migrations\AbstractMigration; */ final class Version20210408122329 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->addSql('ALTER TABLE activitytype DROP personVisible'); @@ -56,11 +57,13 @@ final class Version20210408122329 extends AbstractMigration $this->addSql('COMMENT ON COLUMN activitytype.name IS NULL'); } + #[\Override] public function getDescription(): string { return ''; } + #[\Override] public function up(Schema $schema): void { $this->addSql('ALTER TABLE activitytype ADD personVisible SMALLINT DEFAULT 2 NOT NULL'); diff --git a/src/Bundle/ChillActivityBundle/migrations/Version20210415113216.php b/src/Bundle/ChillActivityBundle/migrations/Version20210415113216.php index 21d61f31d..ea96252f9 100644 --- a/src/Bundle/ChillActivityBundle/migrations/Version20210415113216.php +++ b/src/Bundle/ChillActivityBundle/migrations/Version20210415113216.php @@ -19,6 +19,7 @@ use Doctrine\Migrations\AbstractMigration; */ final class Version20210415113216 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->addSql('ALTER TABLE activitytype ADD thirdpartyvisible SMALLINT DEFAULT 1 NOT NULL'); @@ -31,11 +32,13 @@ final class Version20210415113216 extends AbstractMigration $this->addSql('ALTER TABLE activitytype DROP documentsLabel'); } + #[\Override] public function getDescription(): string { return ''; } + #[\Override] public function up(Schema $schema): void { $this->addSql('ALTER TABLE activitytype ADD thirdPartiesVisible SMALLINT DEFAULT 1 NOT NULL'); diff --git a/src/Bundle/ChillActivityBundle/migrations/Version20210422073711.php b/src/Bundle/ChillActivityBundle/migrations/Version20210422073711.php index 9be59b2b9..3c773f2a8 100644 --- a/src/Bundle/ChillActivityBundle/migrations/Version20210422073711.php +++ b/src/Bundle/ChillActivityBundle/migrations/Version20210422073711.php @@ -19,6 +19,7 @@ use Doctrine\Migrations\AbstractMigration; */ final class Version20210422073711 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->addSql('ALTER TABLE activity DROP emergency'); @@ -31,11 +32,13 @@ final class Version20210422073711 extends AbstractMigration $this->addSql('DROP TABLE activitytpresence'); } + #[\Override] public function getDescription(): string { return ''; } + #[\Override] public function up(Schema $schema): void { $this->addSql('CREATE SEQUENCE activitytpresence_id_seq INCREMENT BY 1 MINVALUE 1 START 6'); diff --git a/src/Bundle/ChillActivityBundle/migrations/Version20210422123846.php b/src/Bundle/ChillActivityBundle/migrations/Version20210422123846.php index 110ca24b2..d0e9582ea 100644 --- a/src/Bundle/ChillActivityBundle/migrations/Version20210422123846.php +++ b/src/Bundle/ChillActivityBundle/migrations/Version20210422123846.php @@ -19,6 +19,7 @@ use Doctrine\Migrations\AbstractMigration; */ final class Version20210422123846 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->addSql('DROP TABLE activity_person'); @@ -34,11 +35,13 @@ final class Version20210422123846 extends AbstractMigration $this->addSql('ALTER TABLE activitytype DROP usersLabel'); } + #[\Override] public function getDescription(): string { return ''; } + #[\Override] public function up(Schema $schema): void { $this->addSql('CREATE TABLE activity_person (activity_id INT NOT NULL, person_id INT NOT NULL, PRIMARY KEY(activity_id, person_id))'); diff --git a/src/Bundle/ChillActivityBundle/migrations/Version20210506071150.php b/src/Bundle/ChillActivityBundle/migrations/Version20210506071150.php index f80b09431..935dba95b 100644 --- a/src/Bundle/ChillActivityBundle/migrations/Version20210506071150.php +++ b/src/Bundle/ChillActivityBundle/migrations/Version20210506071150.php @@ -19,16 +19,19 @@ use Doctrine\Migrations\AbstractMigration; */ final class Version20210506071150 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->addSql('ALTER TABLE activity ALTER durationTime SET NOT NULL'); } + #[\Override] public function getDescription(): string { return ''; } + #[\Override] public function up(Schema $schema): void { // this up() migration is auto-generated, please modify it to your needs diff --git a/src/Bundle/ChillActivityBundle/migrations/Version20210506090417.php b/src/Bundle/ChillActivityBundle/migrations/Version20210506090417.php index 04759300d..e537525fb 100644 --- a/src/Bundle/ChillActivityBundle/migrations/Version20210506090417.php +++ b/src/Bundle/ChillActivityBundle/migrations/Version20210506090417.php @@ -19,12 +19,14 @@ use Doctrine\Migrations\AbstractMigration; */ final class Version20210506090417 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->addSql('ALTER TABLE activitytypecategory DROP ordering'); $this->addSql('ALTER TABLE activitytype DROP ordering'); } + #[\Override] public function up(Schema $schema): void { $this->addSql('ALTER TABLE activitytype ADD ordering DOUBLE PRECISION DEFAULT \'0.0\' NOT NULL'); diff --git a/src/Bundle/ChillActivityBundle/migrations/Version20210506094520.php b/src/Bundle/ChillActivityBundle/migrations/Version20210506094520.php index 35be1f08a..70dcb4d3b 100644 --- a/src/Bundle/ChillActivityBundle/migrations/Version20210506094520.php +++ b/src/Bundle/ChillActivityBundle/migrations/Version20210506094520.php @@ -19,17 +19,20 @@ use Doctrine\Migrations\AbstractMigration; */ final class Version20210506094520 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->addSql('ALTER TABLE activitytype DROP CONSTRAINT FK_B38CD05112469DE2'); $this->addSql('ALTER TABLE activitytype DROP category_id'); } + #[\Override] public function getDescription(): string { return ''; } + #[\Override] public function up(Schema $schema): void { $this->addSql('ALTER TABLE activitytype ADD category_id INT DEFAULT 1'); diff --git a/src/Bundle/ChillActivityBundle/migrations/Version20210506112500.php b/src/Bundle/ChillActivityBundle/migrations/Version20210506112500.php index 3b23d89f4..c492ae8ad 100644 --- a/src/Bundle/ChillActivityBundle/migrations/Version20210506112500.php +++ b/src/Bundle/ChillActivityBundle/migrations/Version20210506112500.php @@ -19,6 +19,7 @@ use Doctrine\Migrations\AbstractMigration; */ final class Version20210506112500 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { // this down() migration is auto-generated, please modify it to your needs @@ -30,11 +31,13 @@ final class Version20210506112500 extends AbstractMigration $this->addSql('DROP TABLE activity_storedobject'); } + #[\Override] public function getDescription(): string { return ''; } + #[\Override] public function up(Schema $schema): void { // this up() migration is auto-generated, please modify it to your needs diff --git a/src/Bundle/ChillActivityBundle/migrations/Version20210520095626.php b/src/Bundle/ChillActivityBundle/migrations/Version20210520095626.php index 9d2979810..572eeff05 100644 --- a/src/Bundle/ChillActivityBundle/migrations/Version20210520095626.php +++ b/src/Bundle/ChillActivityBundle/migrations/Version20210520095626.php @@ -19,17 +19,20 @@ use Doctrine\Migrations\AbstractMigration; */ final class Version20210520095626 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->addSql('ALTER TABLE activity DROP CONSTRAINT FK_AC74095AD7FA8EF0'); $this->addSql('ALTER TABLE activity DROP accompanyingPeriod_id'); } + #[\Override] public function getDescription(): string { return ''; } + #[\Override] public function up(Schema $schema): void { $this->addSql('ALTER TABLE activity ADD accompanyingPeriod_id INT DEFAULT NULL'); diff --git a/src/Bundle/ChillActivityBundle/migrations/Version20210528161250.php b/src/Bundle/ChillActivityBundle/migrations/Version20210528161250.php index df83fc2ce..eafd03986 100644 --- a/src/Bundle/ChillActivityBundle/migrations/Version20210528161250.php +++ b/src/Bundle/ChillActivityBundle/migrations/Version20210528161250.php @@ -19,17 +19,20 @@ use Doctrine\Migrations\AbstractMigration; */ final class Version20210528161250 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->addSql('DROP TABLE chill_activity_activity_chill_person_socialissue'); $this->addSql('DROP TABLE chill_activity_activity_chill_person_socialaction'); } + #[\Override] public function getDescription(): string { return 'Add socialIssues & socialActions fields to Activity'; } + #[\Override] public function up(Schema $schema): void { $this->addSql('CREATE TABLE chill_activity_activity_chill_person_socialissue (activity_id INT NOT NULL, socialissue_id INT NOT NULL, PRIMARY KEY(activity_id, socialissue_id))'); diff --git a/src/Bundle/ChillActivityBundle/migrations/Version20210602103243.php b/src/Bundle/ChillActivityBundle/migrations/Version20210602103243.php index 20595eddd..fe3685b9f 100644 --- a/src/Bundle/ChillActivityBundle/migrations/Version20210602103243.php +++ b/src/Bundle/ChillActivityBundle/migrations/Version20210602103243.php @@ -19,6 +19,7 @@ use Doctrine\Migrations\AbstractMigration; */ final class Version20210602103243 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->addSql('ALTER TABLE activitytype DROP socialIssuesVisible'); @@ -27,11 +28,13 @@ final class Version20210602103243 extends AbstractMigration $this->addSql('ALTER TABLE activitytype DROP socialActionsLabel'); } + #[\Override] public function getDescription(): string { return 'Add info for socialIssues & socialActions in ActivityType'; } + #[\Override] public function up(Schema $schema): void { $this->addSql('ALTER TABLE activitytype ADD socialIssuesVisible SMALLINT DEFAULT 1 NOT NULL'); diff --git a/src/Bundle/ChillActivityBundle/migrations/Version20211119173555.php b/src/Bundle/ChillActivityBundle/migrations/Version20211119173555.php index cd8078136..0017a32b7 100644 --- a/src/Bundle/ChillActivityBundle/migrations/Version20211119173555.php +++ b/src/Bundle/ChillActivityBundle/migrations/Version20211119173555.php @@ -16,16 +16,19 @@ use Doctrine\Migrations\AbstractMigration; final class Version20211119173555 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->throwIrreversibleMigrationException(); } + #[\Override] public function getDescription(): string { return 'remove comment on deprecated json_array type'; } + #[\Override] public function up(Schema $schema): void { $columns = [ diff --git a/src/Bundle/ChillActivityBundle/migrations/Version20211207152023.php b/src/Bundle/ChillActivityBundle/migrations/Version20211207152023.php index d7806b62b..0d6df3495 100644 --- a/src/Bundle/ChillActivityBundle/migrations/Version20211207152023.php +++ b/src/Bundle/ChillActivityBundle/migrations/Version20211207152023.php @@ -16,16 +16,19 @@ use Doctrine\Migrations\AbstractMigration; final class Version20211207152023 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->throwIrreversibleMigrationException('placevisible and placelabel could not be created'); } + #[\Override] public function getDescription(): string { return 'DROP place visible and place label, which are replaced by location'; } + #[\Override] public function up(Schema $schema): void { $this->addSql('ALTER TABLE activitytype DROP placevisible'); diff --git a/src/Bundle/ChillActivityBundle/migrations/Version20220425133027.php b/src/Bundle/ChillActivityBundle/migrations/Version20220425133027.php index ad1f0e47d..df63d10c2 100644 --- a/src/Bundle/ChillActivityBundle/migrations/Version20220425133027.php +++ b/src/Bundle/ChillActivityBundle/migrations/Version20220425133027.php @@ -16,17 +16,20 @@ use Doctrine\Migrations\AbstractMigration; final class Version20220425133027 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->addSql('ALTER TABLE activitytype DROP privateCommentLabel'); $this->addSql('ALTER TABLE activitytype DROP privateCommentVisible'); } + #[\Override] public function getDescription(): string { return 'add private comment option to activity types'; } + #[\Override] public function up(Schema $schema): void { $this->addSql('ALTER TABLE activitytype ADD privateCommentLabel VARCHAR(255) DEFAULT \'\' NOT NULL'); diff --git a/src/Bundle/ChillActivityBundle/migrations/Version20220527124438.php b/src/Bundle/ChillActivityBundle/migrations/Version20220527124438.php index c52e48c07..17228f34c 100644 --- a/src/Bundle/ChillActivityBundle/migrations/Version20220527124438.php +++ b/src/Bundle/ChillActivityBundle/migrations/Version20220527124438.php @@ -16,16 +16,19 @@ use Doctrine\Migrations\AbstractMigration; final class Version20220527124438 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->addSql('ALTER TABLE chill_person_accompanying_period_work DROP privateComment_comments'); } + #[\Override] public function getDescription(): string { return 'add private comment to activity'; } + #[\Override] public function up(Schema $schema): void { $this->addSql('ALTER TABLE activity ADD privateComment_comments JSON DEFAULT \'{}\''); diff --git a/src/Bundle/ChillActivityBundle/migrations/Version20221014130554.php b/src/Bundle/ChillActivityBundle/migrations/Version20221014130554.php index 4cbe47d26..e144157f3 100644 --- a/src/Bundle/ChillActivityBundle/migrations/Version20221014130554.php +++ b/src/Bundle/ChillActivityBundle/migrations/Version20221014130554.php @@ -16,6 +16,7 @@ use Doctrine\Migrations\AbstractMigration; final class Version20221014130554 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->addSql('ALTER TABLE activity DROP updatedAt'); @@ -30,11 +31,13 @@ final class Version20221014130554 extends AbstractMigration $this->addSql('ALTER INDEX idx_ac74095ac54c8c93 RENAME TO idx_55026b0cc54c8c93'); } + #[\Override] public function getDescription(): string { return 'Track update and create on activity'; } + #[\Override] public function up(Schema $schema): void { $this->addSql('ALTER TABLE activity ADD updatedAt TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL'); diff --git a/src/Bundle/ChillAsideActivityBundle/src/Controller/AsideActivityCategoryController.php b/src/Bundle/ChillAsideActivityBundle/src/Controller/AsideActivityCategoryController.php index 602ef1204..833cd72a0 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/Controller/AsideActivityCategoryController.php +++ b/src/Bundle/ChillAsideActivityBundle/src/Controller/AsideActivityCategoryController.php @@ -21,6 +21,7 @@ use Symfony\Component\HttpFoundation\Request; */ class AsideActivityCategoryController extends CRUDController { + #[\Override] protected function orderQuery(string $action, $query, Request $request, PaginatorInterface $paginator) { /* @var QueryBuilder $query */ diff --git a/src/Bundle/ChillAsideActivityBundle/src/Controller/AsideActivityController.php b/src/Bundle/ChillAsideActivityBundle/src/Controller/AsideActivityController.php index ffeab7630..d8a790093 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/Controller/AsideActivityController.php +++ b/src/Bundle/ChillAsideActivityBundle/src/Controller/AsideActivityController.php @@ -28,6 +28,7 @@ final class AsideActivityController extends CRUDController private readonly Security $security ) {} + #[\Override] public function createEntity(string $action, Request $request): object { $user = $this->security->getUser(); @@ -59,6 +60,7 @@ final class AsideActivityController extends CRUDController return $asideActivity; } + #[\Override] protected function buildQueryEntities(string $action, Request $request, ?FilterOrderHelper $filterOrder = null) { $qb = parent::buildQueryEntities($action, $request); @@ -72,6 +74,7 @@ final class AsideActivityController extends CRUDController return $qb; } + #[\Override] protected function orderQuery( string $action, $query, diff --git a/src/Bundle/ChillAsideActivityBundle/src/DataFixtures/ORM/LoadAsideActivity.php b/src/Bundle/ChillAsideActivityBundle/src/DataFixtures/ORM/LoadAsideActivity.php index 12c82be00..6909e0f36 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/DataFixtures/ORM/LoadAsideActivity.php +++ b/src/Bundle/ChillAsideActivityBundle/src/DataFixtures/ORM/LoadAsideActivity.php @@ -22,6 +22,7 @@ class LoadAsideActivity extends Fixture implements DependentFixtureInterface { public function __construct(private readonly UserRepository $userRepository) {} + #[\Override] public function getDependencies(): array { return [ @@ -30,6 +31,7 @@ class LoadAsideActivity extends Fixture implements DependentFixtureInterface ]; } + #[\Override] public function load(ObjectManager $manager) { $user = $this->userRepository->findOneBy(['username' => 'center a_social']); diff --git a/src/Bundle/ChillAsideActivityBundle/src/DataFixtures/ORM/LoadAsideActivityCategory.php b/src/Bundle/ChillAsideActivityBundle/src/DataFixtures/ORM/LoadAsideActivityCategory.php index 3e6b4247a..6d3a72049 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/DataFixtures/ORM/LoadAsideActivityCategory.php +++ b/src/Bundle/ChillAsideActivityBundle/src/DataFixtures/ORM/LoadAsideActivityCategory.php @@ -16,6 +16,7 @@ use Doctrine\Persistence\ObjectManager; class LoadAsideActivityCategory extends \Doctrine\Bundle\FixturesBundle\Fixture { + #[\Override] public function load(ObjectManager $manager) { foreach ( diff --git a/src/Bundle/ChillAsideActivityBundle/src/DependencyInjection/ChillAsideActivityExtension.php b/src/Bundle/ChillAsideActivityBundle/src/DependencyInjection/ChillAsideActivityExtension.php index 056f29ba1..46eb83bd7 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/DependencyInjection/ChillAsideActivityExtension.php +++ b/src/Bundle/ChillAsideActivityBundle/src/DependencyInjection/ChillAsideActivityExtension.php @@ -19,6 +19,7 @@ use Symfony\Component\DependencyInjection\Loader; final class ChillAsideActivityExtension extends Extension implements PrependExtensionInterface { + #[\Override] public function load(array $configs, ContainerBuilder $container): void { $configuration = $this->getConfiguration($configs, $container); @@ -34,6 +35,7 @@ final class ChillAsideActivityExtension extends Extension implements PrependExte $loader->load('services/export.yaml'); } + #[\Override] public function prepend(ContainerBuilder $container) { $this->prependRoute($container); diff --git a/src/Bundle/ChillAsideActivityBundle/src/DependencyInjection/Configuration.php b/src/Bundle/ChillAsideActivityBundle/src/DependencyInjection/Configuration.php index 241a545a8..9b94eac13 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/DependencyInjection/Configuration.php +++ b/src/Bundle/ChillAsideActivityBundle/src/DependencyInjection/Configuration.php @@ -16,6 +16,7 @@ use Symfony\Component\Config\Definition\ConfigurationInterface; class Configuration implements ConfigurationInterface { + #[\Override] public function getConfigTreeBuilder() { $treeBuilder = new TreeBuilder('chill_aside_activity'); diff --git a/src/Bundle/ChillAsideActivityBundle/src/Entity/AsideActivity.php b/src/Bundle/ChillAsideActivityBundle/src/Entity/AsideActivity.php index b7671c61a..fb8c15ecf 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/Entity/AsideActivity.php +++ b/src/Bundle/ChillAsideActivityBundle/src/Entity/AsideActivity.php @@ -124,6 +124,7 @@ class AsideActivity implements TrackCreationInterface, TrackUpdateInterface return $this; } + #[\Override] public function setCreatedAt(\DateTimeInterface $createdAt): self { $this->createdAt = $createdAt; @@ -131,6 +132,7 @@ class AsideActivity implements TrackCreationInterface, TrackUpdateInterface return $this; } + #[\Override] public function setCreatedBy(?User $createdBy): self { $this->createdBy = $createdBy; @@ -173,6 +175,7 @@ class AsideActivity implements TrackCreationInterface, TrackUpdateInterface return $this; } + #[\Override] public function setUpdatedAt(\DateTimeInterface $updatedAt): self { $this->updatedAt = $updatedAt; @@ -180,6 +183,7 @@ class AsideActivity implements TrackCreationInterface, TrackUpdateInterface return $this; } + #[\Override] public function setUpdatedBy(?User $updatedBy): self { $this->updatedBy = $updatedBy; diff --git a/src/Bundle/ChillAsideActivityBundle/src/Export/Aggregator/ByActivityTypeAggregator.php b/src/Bundle/ChillAsideActivityBundle/src/Export/Aggregator/ByActivityTypeAggregator.php index 4271ae118..9d3dfcf69 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/Export/Aggregator/ByActivityTypeAggregator.php +++ b/src/Bundle/ChillAsideActivityBundle/src/Export/Aggregator/ByActivityTypeAggregator.php @@ -25,32 +25,38 @@ class ByActivityTypeAggregator implements AggregatorInterface private readonly TranslatableStringHelper $translatableStringHelper ) {} + #[\Override] public function addRole(): ?string { return null; } + #[\Override] public function alterQuery(QueryBuilder $qb, $data) { $qb->addSelect('IDENTITY(aside.type) AS by_aside_activity_type_aggregator') ->addGroupBy('by_aside_activity_type_aggregator'); } + #[\Override] public function applyOn(): string { return Declarations::ASIDE_ACTIVITY_TYPE; } + #[\Override] public function buildForm(FormBuilderInterface $builder) { // No form needed } + #[\Override] public function getFormDefaultData(): array { return []; } + #[\Override] public function getLabels($key, array $values, $data) { return function ($value): string { @@ -66,11 +72,13 @@ class ByActivityTypeAggregator implements AggregatorInterface }; } + #[\Override] public function getQueryKeys($data): array { return ['by_aside_activity_type_aggregator']; } + #[\Override] public function getTitle(): string { return 'export.aggregator.Group by aside activity type'; diff --git a/src/Bundle/ChillAsideActivityBundle/src/Export/Aggregator/ByLocationAggregator.php b/src/Bundle/ChillAsideActivityBundle/src/Export/Aggregator/ByLocationAggregator.php index b5ca1022b..fd33c546e 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/Export/Aggregator/ByLocationAggregator.php +++ b/src/Bundle/ChillAsideActivityBundle/src/Export/Aggregator/ByLocationAggregator.php @@ -21,16 +21,19 @@ class ByLocationAggregator implements AggregatorInterface { public function __construct(private readonly LocationRepository $locationRepository) {} + #[\Override] public function buildForm(FormBuilderInterface $builder): void { // no form } + #[\Override] public function getFormDefaultData(): array { return []; } + #[\Override] public function getLabels($key, array $values, $data) { return function ($value): string { @@ -45,27 +48,32 @@ class ByLocationAggregator implements AggregatorInterface }; } + #[\Override] public function getQueryKeys($data): array { return ['by_aside_activity_location_aggregator']; } + #[\Override] public function getTitle(): string { return 'export.aggregator.Group by aside activity location'; } + #[\Override] public function addRole(): ?string { return null; } + #[\Override] public function alterQuery(QueryBuilder $qb, $data): void { $qb->addSelect('IDENTITY(aside.location) AS by_aside_activity_location_aggregator') ->addGroupBy('by_aside_activity_location_aggregator'); } + #[\Override] public function applyOn(): string { return Declarations::ASIDE_ACTIVITY_TYPE; diff --git a/src/Bundle/ChillAsideActivityBundle/src/Export/Aggregator/ByUserJobAggregator.php b/src/Bundle/ChillAsideActivityBundle/src/Export/Aggregator/ByUserJobAggregator.php index c3883b18a..5ff5b44b8 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/Export/Aggregator/ByUserJobAggregator.php +++ b/src/Bundle/ChillAsideActivityBundle/src/Export/Aggregator/ByUserJobAggregator.php @@ -22,18 +22,20 @@ use Symfony\Component\Form\FormBuilderInterface; class ByUserJobAggregator implements AggregatorInterface { - private const PREFIX = 'aside_act_agg_user_job'; + private const string PREFIX = 'aside_act_agg_user_job'; public function __construct( private readonly UserJobRepositoryInterface $userJobRepository, private readonly TranslatableStringHelperInterface $translatableStringHelper ) {} + #[\Override] public function addRole(): ?string { return null; } + #[\Override] public function alterQuery(QueryBuilder $qb, $data) { $p = self::PREFIX; @@ -60,18 +62,22 @@ class ByUserJobAggregator implements AggregatorInterface ->addGroupBy("{$p}_select"); } + #[\Override] public function applyOn(): string { return Declarations::ASIDE_ACTIVITY_TYPE; } + #[\Override] public function buildForm(FormBuilderInterface $builder) {} + #[\Override] public function getFormDefaultData(): array { return []; } + #[\Override] public function getLabels($key, array $values, $data) { return function ($value): string { @@ -91,11 +97,13 @@ class ByUserJobAggregator implements AggregatorInterface }; } + #[\Override] public function getQueryKeys($data): array { return [self::PREFIX.'_select']; } + #[\Override] public function getTitle(): string { return 'export.aggregator.by_user_job.Aggregate by user job'; diff --git a/src/Bundle/ChillAsideActivityBundle/src/Export/Aggregator/ByUserScopeAggregator.php b/src/Bundle/ChillAsideActivityBundle/src/Export/Aggregator/ByUserScopeAggregator.php index a99d2b75f..80d34ae4e 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/Export/Aggregator/ByUserScopeAggregator.php +++ b/src/Bundle/ChillAsideActivityBundle/src/Export/Aggregator/ByUserScopeAggregator.php @@ -22,18 +22,20 @@ use Symfony\Component\Form\FormBuilderInterface; class ByUserScopeAggregator implements AggregatorInterface { - private const PREFIX = 'aside_act_agg_user_scope'; + private const string PREFIX = 'aside_act_agg_user_scope'; public function __construct( private readonly ScopeRepositoryInterface $scopeRepository, private readonly TranslatableStringHelperInterface $translatableStringHelper ) {} + #[\Override] public function addRole(): ?string { return null; } + #[\Override] public function alterQuery(QueryBuilder $qb, $data) { $p = self::PREFIX; @@ -59,18 +61,22 @@ class ByUserScopeAggregator implements AggregatorInterface ->addGroupBy("{$p}_select"); } + #[\Override] public function applyOn(): string { return Declarations::ASIDE_ACTIVITY_TYPE; } + #[\Override] public function buildForm(FormBuilderInterface $builder) {} + #[\Override] public function getFormDefaultData(): array { return []; } + #[\Override] public function getLabels($key, array $values, $data) { return function ($value): string { @@ -90,11 +96,13 @@ class ByUserScopeAggregator implements AggregatorInterface }; } + #[\Override] public function getQueryKeys($data): array { return [self::PREFIX.'_select']; } + #[\Override] public function getTitle(): string { return 'export.aggregator.by_user_scope.Aggregate by user scope'; diff --git a/src/Bundle/ChillAsideActivityBundle/src/Export/Export/AvgAsideActivityDuration.php b/src/Bundle/ChillAsideActivityBundle/src/Export/Export/AvgAsideActivityDuration.php index 70922b6ae..a8449769a 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/Export/Export/AvgAsideActivityDuration.php +++ b/src/Bundle/ChillAsideActivityBundle/src/Export/Export/AvgAsideActivityDuration.php @@ -24,28 +24,34 @@ class AvgAsideActivityDuration implements ExportInterface, GroupedExportInterfac { public function __construct(private readonly AsideActivityRepository $repository) {} + #[\Override] public function buildForm(FormBuilderInterface $builder) {} + #[\Override] public function getFormDefaultData(): array { return []; } + #[\Override] public function getAllowedFormattersTypes(): array { return [FormatterInterface::TYPE_TABULAR]; } + #[\Override] public function getDescription(): string { return 'export.Average aside activities duration'; } + #[\Override] public function getGroup(): string { return 'export.Exports of aside activities'; } + #[\Override] public function getLabels($key, array $values, $data) { if ('export_avg_aside_activity_duration' !== $key) { @@ -55,26 +61,31 @@ class AvgAsideActivityDuration implements ExportInterface, GroupedExportInterfac return static fn ($value) => '_header' === $value ? 'Average duration aside activities' : $value; } + #[\Override] public function getQueryKeys($data): array { return ['export_avg_aside_activity_duration']; } + #[\Override] public function getResult($query, $data) { return $query->getQuery()->getResult(Query::HYDRATE_SCALAR); } + #[\Override] public function getTitle(): string { return 'export.Average aside activities duration'; } + #[\Override] public function getType(): string { return Declarations::ASIDE_ACTIVITY_TYPE; } + #[\Override] public function initiateQuery(array $requiredModifiers, array $acl, array $data = []) { $qb = $this->repository->createQueryBuilder('aside'); @@ -86,11 +97,13 @@ class AvgAsideActivityDuration implements ExportInterface, GroupedExportInterfac return $qb; } + #[\Override] public function requiredRole(): string { return AsideActivityVoter::STATS; } + #[\Override] public function supportsModifiers(): array { return [Declarations::ASIDE_ACTIVITY_TYPE]; diff --git a/src/Bundle/ChillAsideActivityBundle/src/Export/Export/CountAsideActivity.php b/src/Bundle/ChillAsideActivityBundle/src/Export/Export/CountAsideActivity.php index 6d1eed5fe..7b1f73721 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/Export/Export/CountAsideActivity.php +++ b/src/Bundle/ChillAsideActivityBundle/src/Export/Export/CountAsideActivity.php @@ -24,28 +24,34 @@ class CountAsideActivity implements ExportInterface, GroupedExportInterface { public function __construct(private readonly AsideActivityRepository $repository) {} + #[\Override] public function buildForm(FormBuilderInterface $builder) {} + #[\Override] public function getFormDefaultData(): array { return []; } + #[\Override] public function getAllowedFormattersTypes(): array { return [FormatterInterface::TYPE_TABULAR]; } + #[\Override] public function getDescription(): string { return 'export.Count aside activities by various parameters.'; } + #[\Override] public function getGroup(): string { return 'export.Exports of aside activities'; } + #[\Override] public function getLabels($key, array $values, $data) { if ('export_result' !== $key) { @@ -58,26 +64,31 @@ class CountAsideActivity implements ExportInterface, GroupedExportInterface return static fn ($value) => $labels[$value]; } + #[\Override] public function getQueryKeys($data): array { return ['export_result']; } + #[\Override] public function getResult($query, $data) { return $query->getQuery()->getResult(Query::HYDRATE_SCALAR); } + #[\Override] public function getTitle(): string { return 'export.Count aside activities'; } + #[\Override] public function getType(): string { return Declarations::ASIDE_ACTIVITY_TYPE; } + #[\Override] public function initiateQuery(array $requiredModifiers, array $acl, array $data = []) { $qb = $this->repository->createQueryBuilder('aside'); @@ -87,11 +98,13 @@ class CountAsideActivity implements ExportInterface, GroupedExportInterface return $qb; } + #[\Override] public function requiredRole(): string { return AsideActivityVoter::STATS; } + #[\Override] public function supportsModifiers(): array { return [ diff --git a/src/Bundle/ChillAsideActivityBundle/src/Export/Export/ListAsideActivity.php b/src/Bundle/ChillAsideActivityBundle/src/Export/Export/ListAsideActivity.php index 33155c62f..1295fe5b5 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/Export/Export/ListAsideActivity.php +++ b/src/Bundle/ChillAsideActivityBundle/src/Export/Export/ListAsideActivity.php @@ -44,28 +44,34 @@ final readonly class ListAsideActivity implements ListInterface, GroupedExportIn private TranslatableStringHelperInterface $translatableStringHelper ) {} + #[\Override] public function buildForm(FormBuilderInterface $builder) {} + #[\Override] public function getFormDefaultData(): array { return []; } + #[\Override] public function getAllowedFormattersTypes() { return [FormatterInterface::TYPE_LIST]; } + #[\Override] public function getDescription() { return 'export.aside_activity.List of aside activities'; } + #[\Override] public function getGroup(): string { return 'export.Exports of aside activities'; } + #[\Override] public function getLabels($key, array $values, $data) { return match ($key) { @@ -142,6 +148,7 @@ final readonly class ListAsideActivity implements ListInterface, GroupedExportIn }; } + #[\Override] public function getQueryKeys($data) { return [ @@ -160,21 +167,25 @@ final readonly class ListAsideActivity implements ListInterface, GroupedExportIn ]; } + #[\Override] public function getResult($query, $data): array { return $query->getQuery()->getResult(AbstractQuery::HYDRATE_ARRAY); } + #[\Override] public function getTitle() { return 'export.aside_activity.List of aside activities'; } + #[\Override] public function getType(): string { return Declarations::ASIDE_ACTIVITY_TYPE; } + #[\Override] public function initiateQuery(array $requiredModifiers, array $acl, array $data = []) { $qb = $this->em->createQueryBuilder() @@ -201,11 +212,13 @@ final readonly class ListAsideActivity implements ListInterface, GroupedExportIn return $qb; } + #[\Override] public function requiredRole(): string { return AsideActivityVoter::STATS; } + #[\Override] public function supportsModifiers() { return [Declarations::ASIDE_ACTIVITY_TYPE]; diff --git a/src/Bundle/ChillAsideActivityBundle/src/Export/Export/SumAsideActivityDuration.php b/src/Bundle/ChillAsideActivityBundle/src/Export/Export/SumAsideActivityDuration.php index 0fd318902..4fffcc82e 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/Export/Export/SumAsideActivityDuration.php +++ b/src/Bundle/ChillAsideActivityBundle/src/Export/Export/SumAsideActivityDuration.php @@ -24,28 +24,34 @@ class SumAsideActivityDuration implements ExportInterface, GroupedExportInterfac { public function __construct(private readonly AsideActivityRepository $repository) {} + #[\Override] public function buildForm(FormBuilderInterface $builder) {} + #[\Override] public function getFormDefaultData(): array { return []; } + #[\Override] public function getAllowedFormattersTypes(): array { return [FormatterInterface::TYPE_TABULAR]; } + #[\Override] public function getDescription(): string { return 'export.Sum aside activities duration'; } + #[\Override] public function getGroup(): string { return 'export.Exports of aside activities'; } + #[\Override] public function getLabels($key, array $values, $data) { if ('export_sum_aside_activity_duration' !== $key) { @@ -55,26 +61,31 @@ class SumAsideActivityDuration implements ExportInterface, GroupedExportInterfac return static fn ($value) => '_header' === $value ? 'Sum duration aside activities' : $value; } + #[\Override] public function getQueryKeys($data): array { return ['export_sum_aside_activity_duration']; } + #[\Override] public function getResult($query, $data) { return $query->getQuery()->getResult(Query::HYDRATE_SCALAR); } + #[\Override] public function getTitle(): string { return 'export.Sum aside activities duration'; } + #[\Override] public function getType(): string { return Declarations::ASIDE_ACTIVITY_TYPE; } + #[\Override] public function initiateQuery(array $requiredModifiers, array $acl, array $data = []) { $qb = $this->repository @@ -86,11 +97,13 @@ class SumAsideActivityDuration implements ExportInterface, GroupedExportInterfac return $qb; } + #[\Override] public function requiredRole(): string { return AsideActivityVoter::STATS; } + #[\Override] public function supportsModifiers(): array { return [Declarations::ASIDE_ACTIVITY_TYPE]; diff --git a/src/Bundle/ChillAsideActivityBundle/src/Export/Filter/ByActivityTypeFilter.php b/src/Bundle/ChillAsideActivityBundle/src/Export/Filter/ByActivityTypeFilter.php index 708b12ef1..3eba486a2 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/Export/Filter/ByActivityTypeFilter.php +++ b/src/Bundle/ChillAsideActivityBundle/src/Export/Filter/ByActivityTypeFilter.php @@ -30,11 +30,13 @@ class ByActivityTypeFilter implements FilterInterface private readonly AsideActivityCategoryRepository $asideActivityTypeRepository ) {} + #[\Override] public function addRole(): ?string { return null; } + #[\Override] public function alterQuery(QueryBuilder $qb, $data) { $clause = $qb->expr()->in('aside.type', ':types'); @@ -43,11 +45,13 @@ class ByActivityTypeFilter implements FilterInterface $qb->setParameter('types', $data['types']); } + #[\Override] public function applyOn(): string { return Declarations::ASIDE_ACTIVITY_TYPE; } + #[\Override] public function buildForm(FormBuilderInterface $builder) { $builder @@ -68,11 +72,13 @@ class ByActivityTypeFilter implements FilterInterface ]); } + #[\Override] public function getFormDefaultData(): array { return []; } + #[\Override] public function describeAction($data, $format = 'string'): array { $types = array_map( @@ -85,6 +91,7 @@ class ByActivityTypeFilter implements FilterInterface ]]; } + #[\Override] public function getTitle(): string { return 'export.filter.Filter by aside activity type'; diff --git a/src/Bundle/ChillAsideActivityBundle/src/Export/Filter/ByDateFilter.php b/src/Bundle/ChillAsideActivityBundle/src/Export/Filter/ByDateFilter.php index b8d77d942..6d3e30aa6 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/Export/Filter/ByDateFilter.php +++ b/src/Bundle/ChillAsideActivityBundle/src/Export/Filter/ByDateFilter.php @@ -24,11 +24,13 @@ class ByDateFilter implements FilterInterface { public function __construct(private readonly RollingDateConverterInterface $rollingDateConverter, protected TranslatorInterface $translator) {} + #[\Override] public function addRole(): ?string { return null; } + #[\Override] public function alterQuery(QueryBuilder $qb, $data) { $clause = $qb->expr()->between( @@ -48,11 +50,13 @@ class ByDateFilter implements FilterInterface ); } + #[\Override] public function applyOn(): string { return Declarations::ASIDE_ACTIVITY_TYPE; } + #[\Override] public function buildForm(FormBuilderInterface $builder) { $builder @@ -64,6 +68,7 @@ class ByDateFilter implements FilterInterface ]); } + #[\Override] public function getFormDefaultData(): array { return [ @@ -72,6 +77,7 @@ class ByDateFilter implements FilterInterface ]; } + #[\Override] public function describeAction($data, $format = 'string'): array { return ['export.filter.Filtered by aside activities between %dateFrom% and %dateTo%', [ @@ -80,6 +86,7 @@ class ByDateFilter implements FilterInterface ]]; } + #[\Override] public function getTitle(): string { return 'export.filter.Filter by aside activity date'; diff --git a/src/Bundle/ChillAsideActivityBundle/src/Export/Filter/ByLocationFilter.php b/src/Bundle/ChillAsideActivityBundle/src/Export/Filter/ByLocationFilter.php index 6de002606..6220aa45f 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/Export/Filter/ByLocationFilter.php +++ b/src/Bundle/ChillAsideActivityBundle/src/Export/Filter/ByLocationFilter.php @@ -27,17 +27,20 @@ final readonly class ByLocationFilter implements FilterInterface private Security $security ) {} + #[\Override] public function getTitle(): string { return 'export.filter.Filter by aside activity location'; } + #[\Override] public function buildForm(FormBuilderInterface $builder): void { $builder ->add('locations', PickUserLocationType::class); } + #[\Override] public function getFormDefaultData(): array { $user = $this->security->getUser(); @@ -53,6 +56,7 @@ final readonly class ByLocationFilter implements FilterInterface ]; } + #[\Override] public function describeAction($data, $format = 'string'): array { $extractFunction = fn (Location $l): string => $l->getName(); @@ -67,11 +71,13 @@ final readonly class ByLocationFilter implements FilterInterface ]]; } + #[\Override] public function addRole(): ?string { return null; } + #[\Override] public function alterQuery(QueryBuilder $qb, $data): void { $clause = $qb->expr()->in('aside.location', ':locations'); @@ -80,6 +86,7 @@ final readonly class ByLocationFilter implements FilterInterface $qb->setParameter('locations', $data['locations']); } + #[\Override] public function applyOn(): string { return Declarations::ASIDE_ACTIVITY_TYPE; diff --git a/src/Bundle/ChillAsideActivityBundle/src/Export/Filter/ByUserFilter.php b/src/Bundle/ChillAsideActivityBundle/src/Export/Filter/ByUserFilter.php index 8dd1a8eac..4debd0222 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/Export/Filter/ByUserFilter.php +++ b/src/Bundle/ChillAsideActivityBundle/src/Export/Filter/ByUserFilter.php @@ -22,11 +22,13 @@ class ByUserFilter implements FilterInterface { public function __construct(private readonly UserRender $userRender) {} + #[\Override] public function addRole(): ?string { return null; } + #[\Override] public function alterQuery(QueryBuilder $qb, $data) { $clause = $qb->expr()->in('aside.agent', ':users'); @@ -36,11 +38,13 @@ class ByUserFilter implements FilterInterface ->setParameter('users', $data['accepted_users']); } + #[\Override] public function applyOn(): string { return Declarations::ASIDE_ACTIVITY_TYPE; } + #[\Override] public function buildForm(FormBuilderInterface $builder) { $builder->add('accepted_users', PickUserDynamicType::class, [ @@ -49,11 +53,13 @@ class ByUserFilter implements FilterInterface ]); } + #[\Override] public function getFormDefaultData(): array { return []; } + #[\Override] public function describeAction($data, $format = 'string'): array { $users = []; @@ -67,6 +73,7 @@ class ByUserFilter implements FilterInterface ]]; } + #[\Override] public function getTitle(): string { return 'export.filter.Filter aside activity by user'; diff --git a/src/Bundle/ChillAsideActivityBundle/src/Export/Filter/ByUserJobFilter.php b/src/Bundle/ChillAsideActivityBundle/src/Export/Filter/ByUserJobFilter.php index ec2e3d220..a926a8754 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/Export/Filter/ByUserJobFilter.php +++ b/src/Bundle/ChillAsideActivityBundle/src/Export/Filter/ByUserJobFilter.php @@ -25,18 +25,20 @@ use Symfony\Component\Form\FormBuilderInterface; class ByUserJobFilter implements FilterInterface { - private const PREFIX = 'aside_act_filter_user_job'; + private const string PREFIX = 'aside_act_filter_user_job'; public function __construct( private readonly TranslatableStringHelperInterface $translatableStringHelper, private readonly UserJobRepositoryInterface $userJobRepository ) {} + #[\Override] public function addRole(): ?string { return null; } + #[\Override] public function alterQuery(QueryBuilder $qb, $data) { $p = self::PREFIX; @@ -60,11 +62,13 @@ class ByUserJobFilter implements FilterInterface ); } + #[\Override] public function applyOn(): string { return Declarations::ASIDE_ACTIVITY_TYPE; } + #[\Override] public function buildForm(FormBuilderInterface $builder) { $builder @@ -77,6 +81,7 @@ class ByUserJobFilter implements FilterInterface ]); } + #[\Override] public function describeAction($data, $format = 'string'): array { return ['export.filter.by_user_job.Filtered aside activities by user jobs: only %jobs%', [ @@ -90,6 +95,7 @@ class ByUserJobFilter implements FilterInterface ]]; } + #[\Override] public function getFormDefaultData(): array { return [ @@ -97,6 +103,7 @@ class ByUserJobFilter implements FilterInterface ]; } + #[\Override] public function getTitle(): string { return 'export.filter.by_user_job.Filter by user jobs'; diff --git a/src/Bundle/ChillAsideActivityBundle/src/Export/Filter/ByUserScopeFilter.php b/src/Bundle/ChillAsideActivityBundle/src/Export/Filter/ByUserScopeFilter.php index 8f8d50462..a75c12913 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/Export/Filter/ByUserScopeFilter.php +++ b/src/Bundle/ChillAsideActivityBundle/src/Export/Filter/ByUserScopeFilter.php @@ -25,18 +25,20 @@ use Symfony\Component\Form\FormBuilderInterface; class ByUserScopeFilter implements FilterInterface { - private const PREFIX = 'aside_act_filter_user_scope'; + private const string PREFIX = 'aside_act_filter_user_scope'; public function __construct( private readonly ScopeRepositoryInterface $scopeRepository, private readonly TranslatableStringHelperInterface $translatableStringHelper ) {} + #[\Override] public function addRole(): ?string { return null; } + #[\Override] public function alterQuery(QueryBuilder $qb, $data) { $p = self::PREFIX; @@ -60,11 +62,13 @@ class ByUserScopeFilter implements FilterInterface ); } + #[\Override] public function applyOn(): string { return Declarations::ASIDE_ACTIVITY_TYPE; } + #[\Override] public function buildForm(FormBuilderInterface $builder) { $builder @@ -77,6 +81,7 @@ class ByUserScopeFilter implements FilterInterface ]); } + #[\Override] public function describeAction($data, $format = 'string') { return ['export.filter.by_user_scope.Filtered aside activities by user scope: only %scopes%', [ @@ -90,6 +95,7 @@ class ByUserScopeFilter implements FilterInterface ]]; } + #[\Override] public function getFormDefaultData(): array { return [ @@ -97,6 +103,7 @@ class ByUserScopeFilter implements FilterInterface ]; } + #[\Override] public function getTitle(): string { return 'export.filter.by_user_scope.Filter by user scope'; diff --git a/src/Bundle/ChillAsideActivityBundle/src/Form/AsideActivityCategoryType.php b/src/Bundle/ChillAsideActivityBundle/src/Form/AsideActivityCategoryType.php index 3a69be137..f1671fded 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/Form/AsideActivityCategoryType.php +++ b/src/Bundle/ChillAsideActivityBundle/src/Form/AsideActivityCategoryType.php @@ -24,6 +24,7 @@ final class AsideActivityCategoryType extends AbstractType { public function __construct(private readonly CategoryRender $categoryRender) {} + #[\Override] public function buildForm(FormBuilderInterface $builder, array $options) { $builder->add( diff --git a/src/Bundle/ChillAsideActivityBundle/src/Form/AsideActivityFormType.php b/src/Bundle/ChillAsideActivityBundle/src/Form/AsideActivityFormType.php index d6fcb821c..a311bed9d 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/Form/AsideActivityFormType.php +++ b/src/Bundle/ChillAsideActivityBundle/src/Form/AsideActivityFormType.php @@ -36,6 +36,7 @@ final class AsideActivityFormType extends AbstractType $this->timeChoices = $parameterBag->get('chill_aside_activity.form.time_duration'); } + #[\Override] public function buildForm(FormBuilderInterface $builder, array $options) { $timeChoices = []; @@ -110,6 +111,7 @@ final class AsideActivityFormType extends AbstractType } } + #[\Override] public function configureOptions(OptionsResolver $resolver): void { $resolver->setDefaults([ @@ -117,6 +119,7 @@ final class AsideActivityFormType extends AbstractType ]); } + #[\Override] public function getBlockPrefix(): string { return 'chill_asideactivitybundle_asideactivity'; diff --git a/src/Bundle/ChillAsideActivityBundle/src/Form/Type/PickAsideActivityCategoryType.php b/src/Bundle/ChillAsideActivityBundle/src/Form/Type/PickAsideActivityCategoryType.php index 23923fb6c..fd80f9aca 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/Form/Type/PickAsideActivityCategoryType.php +++ b/src/Bundle/ChillAsideActivityBundle/src/Form/Type/PickAsideActivityCategoryType.php @@ -22,6 +22,7 @@ final class PickAsideActivityCategoryType extends AbstractType { public function __construct(private readonly CategoryRender $categoryRender) {} + #[\Override] public function configureOptions(OptionsResolver $resolver) { $resolver @@ -44,6 +45,7 @@ final class PickAsideActivityCategoryType extends AbstractType ]); } + #[\Override] public function getParent(): string { return EntityType::class; diff --git a/src/Bundle/ChillAsideActivityBundle/src/Menu/AdminMenuBuilder.php b/src/Bundle/ChillAsideActivityBundle/src/Menu/AdminMenuBuilder.php index 43a37e068..1b9efa3a1 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/Menu/AdminMenuBuilder.php +++ b/src/Bundle/ChillAsideActivityBundle/src/Menu/AdminMenuBuilder.php @@ -18,6 +18,7 @@ final readonly class AdminMenuBuilder implements \Chill\MainBundle\Routing\Local { public function __construct(private Security $security) {} + #[\Override] public function buildMenu($menuId, MenuItem $menu, array $parameters) { // all the entries below must have ROLE_ADMIN permissions @@ -42,6 +43,7 @@ final readonly class AdminMenuBuilder implements \Chill\MainBundle\Routing\Local ]); } + #[\Override] public static function getMenuIds(): array { return ['admin_section', 'admin_aside_activity']; diff --git a/src/Bundle/ChillAsideActivityBundle/src/Menu/SectionMenuBuilder.php b/src/Bundle/ChillAsideActivityBundle/src/Menu/SectionMenuBuilder.php index a32d52303..f9735e426 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/Menu/SectionMenuBuilder.php +++ b/src/Bundle/ChillAsideActivityBundle/src/Menu/SectionMenuBuilder.php @@ -23,6 +23,7 @@ class SectionMenuBuilder implements LocalMenuBuilderInterface { public function __construct(protected TranslatorInterface $translator, public AuthorizationCheckerInterface $authorizationChecker) {} + #[\Override] public function buildMenu($menuId, MenuItem $menu, array $parameters) { if ($this->authorizationChecker->isGranted('ROLE_USER')) { @@ -36,6 +37,7 @@ class SectionMenuBuilder implements LocalMenuBuilderInterface } } + #[\Override] public static function getMenuIds(): array { return ['section']; diff --git a/src/Bundle/ChillAsideActivityBundle/src/Menu/UserMenuBuilder.php b/src/Bundle/ChillAsideActivityBundle/src/Menu/UserMenuBuilder.php index 154556bca..1464f0681 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/Menu/UserMenuBuilder.php +++ b/src/Bundle/ChillAsideActivityBundle/src/Menu/UserMenuBuilder.php @@ -52,6 +52,7 @@ class UserMenuBuilder implements LocalMenuBuilderInterface $this->authorizationChecker = $authorizationChecker; } + #[\Override] public function buildMenu($menuId, MenuItem $menu, array $parameters) { if ($this->authorizationChecker->isGranted('ROLE_USER')) { @@ -65,6 +66,7 @@ class UserMenuBuilder implements LocalMenuBuilderInterface } } + #[\Override] public static function getMenuIds(): array { return ['user']; diff --git a/src/Bundle/ChillAsideActivityBundle/src/Repository/AsideActivityCategoryRepository.php b/src/Bundle/ChillAsideActivityBundle/src/Repository/AsideActivityCategoryRepository.php index 6735606ce..3580a6240 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/Repository/AsideActivityCategoryRepository.php +++ b/src/Bundle/ChillAsideActivityBundle/src/Repository/AsideActivityCategoryRepository.php @@ -25,6 +25,7 @@ class AsideActivityCategoryRepository implements ObjectRepository $this->repository = $entityManager->getRepository(AsideActivityCategory::class); } + #[\Override] public function find($id): ?AsideActivityCategory { return $this->repository->find($id); @@ -33,6 +34,7 @@ class AsideActivityCategoryRepository implements ObjectRepository /** * @return AsideActivityCategory[] */ + #[\Override] public function findAll(): array { return $this->repository->findAll(); @@ -49,16 +51,19 @@ class AsideActivityCategoryRepository implements ObjectRepository * * @return AsideActivityCategory[] */ + #[\Override] public function findBy(array $criteria, ?array $orderBy = null, $limit = null, $offset = null): array { return $this->repository->findBy($criteria, $orderBy, $limit, $offset); } + #[\Override] public function findOneBy(array $criteria): ?AsideActivityCategory { return $this->repository->findOneBy($criteria); } + #[\Override] public function getClassName(): string { return AsideActivityCategory::class; diff --git a/src/Bundle/ChillAsideActivityBundle/src/Repository/AsideActivityRepository.php b/src/Bundle/ChillAsideActivityBundle/src/Repository/AsideActivityRepository.php index b3dc46f87..3f54be4bd 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/Repository/AsideActivityRepository.php +++ b/src/Bundle/ChillAsideActivityBundle/src/Repository/AsideActivityRepository.php @@ -28,6 +28,7 @@ final class AsideActivityRepository extends ServiceEntityRepository parent::__construct($registry, AsideActivity::class); } + #[\Override] public function getClassName(): string { return AsideActivity::class; diff --git a/src/Bundle/ChillAsideActivityBundle/src/Security/AsideActivityVoter.php b/src/Bundle/ChillAsideActivityBundle/src/Security/AsideActivityVoter.php index e15abd439..7df8a11d2 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/Security/AsideActivityVoter.php +++ b/src/Bundle/ChillAsideActivityBundle/src/Security/AsideActivityVoter.php @@ -21,7 +21,7 @@ use Symfony\Component\Security\Core\Authentication\Token\TokenInterface; class AsideActivityVoter extends AbstractChillVoter implements ProvideRoleHierarchyInterface { - final public const STATS = 'CHILL_ASIDE_ACTIVITY_STATS'; + final public const string STATS = 'CHILL_ASIDE_ACTIVITY_STATS'; private readonly VoterHelperInterface $voterHelper; @@ -37,6 +37,7 @@ class AsideActivityVoter extends AbstractChillVoter implements ProvideRoleHierar /** * @return string[] */ + #[\Override] public function getRoles(): array { return $this->getAttributes(); @@ -45,6 +46,7 @@ class AsideActivityVoter extends AbstractChillVoter implements ProvideRoleHierar /** * @return string[][] */ + #[\Override] public function getRolesWithHierarchy(): array { return ['Aside activity' => $this->getRoles()]; @@ -53,16 +55,19 @@ class AsideActivityVoter extends AbstractChillVoter implements ProvideRoleHierar /** * @return string[] */ + #[\Override] public function getRolesWithoutScope(): array { return $this->getAttributes(); } + #[\Override] protected function supports($attribute, $subject) { return $this->voterHelper->supports($attribute, $subject); } + #[\Override] protected function voteOnAttribute($attribute, $subject, TokenInterface $token): bool { if (!$token->getUser() instanceof User) { diff --git a/src/Bundle/ChillAsideActivityBundle/src/Templating/Entity/CategoryRender.php b/src/Bundle/ChillAsideActivityBundle/src/Templating/Entity/CategoryRender.php index 2598c4e01..0671daf16 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/Templating/Entity/CategoryRender.php +++ b/src/Bundle/ChillAsideActivityBundle/src/Templating/Entity/CategoryRender.php @@ -20,11 +20,11 @@ use Chill\MainBundle\Templating\TranslatableStringHelper; */ final readonly class CategoryRender implements ChillEntityRenderInterface { - public const DEFAULT_ARGS = [ + public const array DEFAULT_ARGS = [ self::SEPERATOR_KEY => ' > ', ]; - public const SEPERATOR_KEY = 'default.separator'; + public const string SEPERATOR_KEY = 'default.separator'; public function __construct(private TranslatableStringHelper $translatableStringHelper, private \Twig\Environment $engine) {} @@ -39,6 +39,7 @@ final readonly class CategoryRender implements ChillEntityRenderInterface return $parents; } + #[\Override] public function renderBox($asideActivityCategory, array $options): string { $options = array_merge(self::DEFAULT_ARGS, $options); @@ -54,6 +55,7 @@ final readonly class CategoryRender implements ChillEntityRenderInterface ); } + #[\Override] public function renderString($asideActivityCategory, array $options): string { $options = array_merge(self::DEFAULT_ARGS, $options); @@ -72,6 +74,7 @@ final readonly class CategoryRender implements ChillEntityRenderInterface return implode($options[self::SEPERATOR_KEY], $titles); } + #[\Override] public function supports($asideActivityCategory, array $options): bool { return $asideActivityCategory instanceof AsideActivityCategory; diff --git a/src/Bundle/ChillAsideActivityBundle/src/Tests/Controller/AsideActivityControllerTest.php b/src/Bundle/ChillAsideActivityBundle/src/Tests/Controller/AsideActivityControllerTest.php index 21e78e6cf..5926669c7 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/Tests/Controller/AsideActivityControllerTest.php +++ b/src/Bundle/ChillAsideActivityBundle/src/Tests/Controller/AsideActivityControllerTest.php @@ -25,6 +25,7 @@ final class AsideActivityControllerTest extends WebTestCase { use PrepareClientTrait; + #[\Override] protected function tearDown(): void { self::ensureKernelShutdown(); diff --git a/src/Bundle/ChillAsideActivityBundle/src/Tests/Export/Export/ListAsideActivityTest.php b/src/Bundle/ChillAsideActivityBundle/src/Tests/Export/Export/ListAsideActivityTest.php index aae93c17b..60c84f18b 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/Tests/Export/Export/ListAsideActivityTest.php +++ b/src/Bundle/ChillAsideActivityBundle/src/Tests/Export/Export/ListAsideActivityTest.php @@ -24,6 +24,7 @@ class ListAsideActivityTest extends KernelTestCase { private ListAsideActivity $listAsideActivity; + #[\Override] protected function setUp(): void { parent::setUp(); diff --git a/src/Bundle/ChillAsideActivityBundle/src/migrations/Version20210706124644.php b/src/Bundle/ChillAsideActivityBundle/src/migrations/Version20210706124644.php index bb4d3487a..99202b07a 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/migrations/Version20210706124644.php +++ b/src/Bundle/ChillAsideActivityBundle/src/migrations/Version20210706124644.php @@ -16,6 +16,7 @@ use Doctrine\Migrations\AbstractMigration; final class Version20210706124644 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { // this down() migration is auto-generated, please modify it to your needs @@ -26,11 +27,13 @@ final class Version20210706124644 extends AbstractMigration $this->addSql('DROP TABLE AsideActivityType'); } + #[\Override] public function getDescription(): string { return 'Aside activity category entity created'; } + #[\Override] public function up(Schema $schema): void { $this->addSql('CREATE SEQUENCE AsideActivity_id_seq INCREMENT BY 1 MINVALUE 1 START 1'); diff --git a/src/Bundle/ChillAsideActivityBundle/src/migrations/Version20210804082249.php b/src/Bundle/ChillAsideActivityBundle/src/migrations/Version20210804082249.php index 345107e51..710ae2a24 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/migrations/Version20210804082249.php +++ b/src/Bundle/ChillAsideActivityBundle/src/migrations/Version20210804082249.php @@ -16,6 +16,7 @@ use Doctrine\Migrations\AbstractMigration; final class Version20210804082249 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { // this down() migration is auto-generated, please modify it to your needs @@ -41,11 +42,13 @@ final class Version20210804082249 extends AbstractMigration $this->addSql('DROP SCHEMA chill_asideactivity'); } + #[\Override] public function getDescription(): string { return 'Aside activity entity created'; } + #[\Override] public function up(Schema $schema): void { // this up() migration is auto-generated, please modify it to your needs diff --git a/src/Bundle/ChillAsideActivityBundle/src/migrations/Version20210806140343.php b/src/Bundle/ChillAsideActivityBundle/src/migrations/Version20210806140343.php index b44b8569e..ff5728eeb 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/migrations/Version20210806140343.php +++ b/src/Bundle/ChillAsideActivityBundle/src/migrations/Version20210806140343.php @@ -16,17 +16,20 @@ use Doctrine\Migrations\AbstractMigration; final class Version20210806140343 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { // this down() migration is auto-generated, please modify it to your needs $this->addSql('ALTER TABLE chill_asideactivity.AsideActivity ADD duration INT DEFAULT NULL'); } + #[\Override] public function getDescription(): string { return 'Duration changed to type integer'; } + #[\Override] public function up(Schema $schema): void { // this up() migration is auto-generated, please modify it to your needs diff --git a/src/Bundle/ChillAsideActivityBundle/src/migrations/Version20210806140710.php b/src/Bundle/ChillAsideActivityBundle/src/migrations/Version20210806140710.php index e56092890..5d2a56637 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/migrations/Version20210806140710.php +++ b/src/Bundle/ChillAsideActivityBundle/src/migrations/Version20210806140710.php @@ -16,17 +16,20 @@ use Doctrine\Migrations\AbstractMigration; final class Version20210806140710 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { // this down() migration is auto-generated, please modify it to your needs $this->addSql('ALTER TABLE chill_asideactivity.AsideActivity DROP duration'); } + #[\Override] public function getDescription(): string { return 'Duration changed back to timestamp'; } + #[\Override] public function up(Schema $schema): void { // this up() migration is auto-generated, please modify it to your needs diff --git a/src/Bundle/ChillAsideActivityBundle/src/migrations/Version20210810084456.php b/src/Bundle/ChillAsideActivityBundle/src/migrations/Version20210810084456.php index 0c32523cc..66a58ee0d 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/migrations/Version20210810084456.php +++ b/src/Bundle/ChillAsideActivityBundle/src/migrations/Version20210810084456.php @@ -16,6 +16,7 @@ use Doctrine\Migrations\AbstractMigration; final class Version20210810084456 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { // this down() migration is auto-generated, please modify it to your needs @@ -30,11 +31,13 @@ final class Version20210810084456 extends AbstractMigration $this->addSql('COMMENT ON COLUMN chill_asideactivity.AsideActivity.date IS \'(DC2Type:datetime_immutable)\''); } + #[\Override] public function getDescription(): string { return 'createdat, updatedat and date given a type timestamp'; } + #[\Override] public function up(Schema $schema): void { // this up() migration is auto-generated, please modify it to your needs diff --git a/src/Bundle/ChillAsideActivityBundle/src/migrations/Version20210922182907.php b/src/Bundle/ChillAsideActivityBundle/src/migrations/Version20210922182907.php index 633576bc3..15b547497 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/migrations/Version20210922182907.php +++ b/src/Bundle/ChillAsideActivityBundle/src/migrations/Version20210922182907.php @@ -16,16 +16,19 @@ use Doctrine\Migrations\AbstractMigration; final class Version20210922182907 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->addSql('ALTER TABLE chill_asideactivity.AsideActivityCategory DROP parent'); } + #[\Override] public function getDescription(): string { return 'Parent and children added to aside activity category entity'; } + #[\Override] public function up(Schema $schema): void { $this->addSql('ALTER TABLE chill_asideactivity.asideactivitycategory ADD parent_id INT DEFAULT NULL'); diff --git a/src/Bundle/ChillAsideActivityBundle/src/migrations/Version20211004134012.php b/src/Bundle/ChillAsideActivityBundle/src/migrations/Version20211004134012.php index 27d297861..ccbb37715 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/migrations/Version20211004134012.php +++ b/src/Bundle/ChillAsideActivityBundle/src/migrations/Version20211004134012.php @@ -19,16 +19,19 @@ use Doctrine\Migrations\AbstractMigration; */ final class Version20211004134012 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->addSql('ALTER TABLE chill_asideactivity.asideactivitycategory DROP ordering'); } + #[\Override] public function getDescription(): string { return 'allow to add an ordering to aside activity categories'; } + #[\Override] public function up(Schema $schema): void { $this->addSql('ALTER TABLE chill_asideactivity.asideactivitycategory ADD ordering DOUBLE PRECISION NOT NULL DEFAULT 0.00'); diff --git a/src/Bundle/ChillAsideActivityBundle/src/migrations/Version20230816112809.php b/src/Bundle/ChillAsideActivityBundle/src/migrations/Version20230816112809.php index bde8af1e3..811ec42c2 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/migrations/Version20230816112809.php +++ b/src/Bundle/ChillAsideActivityBundle/src/migrations/Version20230816112809.php @@ -16,11 +16,13 @@ use Doctrine\Migrations\AbstractMigration; final class Version20230816112809 extends AbstractMigration { + #[\Override] public function getDescription(): string { return 'Update location attribute in asideactivity'; } + #[\Override] public function down(Schema $schema): void { $this->addSql('DROP INDEX chill_asideactivity.IDX_A866DA0E64D218E'); @@ -29,6 +31,7 @@ final class Version20230816112809 extends AbstractMigration $this->addSql('ALTER TABLE chill_asideactivity.AsideActivity ADD location VARCHAR(100) DEFAULT NULL'); } + #[\Override] public function up(Schema $schema): void { $this->addSql('ALTER TABLE chill_asideactivity.asideactivity ADD location_id INT DEFAULT NULL'); diff --git a/src/Bundle/ChillBudgetBundle/Calculator/CalculatorResult.php b/src/Bundle/ChillBudgetBundle/Calculator/CalculatorResult.php index ce31dcaaf..5e9fc3bef 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 { - final public const TYPE_CURRENCY = 'currency'; + final public const string TYPE_CURRENCY = 'currency'; - final public const TYPE_PERCENTAGE = 'percentage'; + final public const string TYPE_PERCENTAGE = 'percentage'; - final public const TYPE_RATE = 'rate'; + final public const string TYPE_RATE = 'rate'; public $label; diff --git a/src/Bundle/ChillBudgetBundle/ChillBudgetBundle.php b/src/Bundle/ChillBudgetBundle/ChillBudgetBundle.php index 71f6a7076..f95c2cd75 100644 --- a/src/Bundle/ChillBudgetBundle/ChillBudgetBundle.php +++ b/src/Bundle/ChillBudgetBundle/ChillBudgetBundle.php @@ -16,6 +16,7 @@ use Symfony\Component\HttpKernel\Bundle\Bundle; class ChillBudgetBundle extends Bundle { + #[\Override] public function build(\Symfony\Component\DependencyInjection\ContainerBuilder $container) { parent::build($container); diff --git a/src/Bundle/ChillBudgetBundle/Controller/Admin/ChargeKindController.php b/src/Bundle/ChillBudgetBundle/Controller/Admin/ChargeKindController.php index a84d54e40..f07202d12 100644 --- a/src/Bundle/ChillBudgetBundle/Controller/Admin/ChargeKindController.php +++ b/src/Bundle/ChillBudgetBundle/Controller/Admin/ChargeKindController.php @@ -18,6 +18,7 @@ use Symfony\Component\HttpFoundation\Request; class ChargeKindController extends CRUDController { + #[\Override] protected function orderQuery(string $action, $query, Request $request, PaginatorInterface $paginator) { /* @var QueryBuilder $query */ diff --git a/src/Bundle/ChillBudgetBundle/Controller/Admin/ResourceKindController.php b/src/Bundle/ChillBudgetBundle/Controller/Admin/ResourceKindController.php index ffef467f9..c85ed3d88 100644 --- a/src/Bundle/ChillBudgetBundle/Controller/Admin/ResourceKindController.php +++ b/src/Bundle/ChillBudgetBundle/Controller/Admin/ResourceKindController.php @@ -18,6 +18,7 @@ use Symfony\Component\HttpFoundation\Request; class ResourceKindController extends CRUDController { + #[\Override] protected function orderQuery(string $action, $query, Request $request, PaginatorInterface $paginator) { /* @var QueryBuilder $query */ diff --git a/src/Bundle/ChillBudgetBundle/Controller/ChargeController.php b/src/Bundle/ChillBudgetBundle/Controller/ChargeController.php index 480e2c645..48026a514 100644 --- a/src/Bundle/ChillBudgetBundle/Controller/ChargeController.php +++ b/src/Bundle/ChillBudgetBundle/Controller/ChargeController.php @@ -84,11 +84,13 @@ class ChargeController extends AbstractElementController return $this->_view($charge, '@ChillBudget/Charge/view.html.twig'); } + #[\Override] protected function createNewElement() { return new Charge(); } + #[\Override] protected function getType() { return ChargeType::class; diff --git a/src/Bundle/ChillBudgetBundle/Controller/ResourceController.php b/src/Bundle/ChillBudgetBundle/Controller/ResourceController.php index fd9dc9f63..d62c102c2 100644 --- a/src/Bundle/ChillBudgetBundle/Controller/ResourceController.php +++ b/src/Bundle/ChillBudgetBundle/Controller/ResourceController.php @@ -76,11 +76,13 @@ class ResourceController extends AbstractElementController return $this->_view($resource, '@ChillBudget/Resource/view.html.twig'); } + #[\Override] protected function createNewElement() { return new Resource(); } + #[\Override] protected function getType() { return ResourceType::class; diff --git a/src/Bundle/ChillBudgetBundle/DependencyInjection/ChillBudgetExtension.php b/src/Bundle/ChillBudgetBundle/DependencyInjection/ChillBudgetExtension.php index 6a8842b64..e2355ab6e 100644 --- a/src/Bundle/ChillBudgetBundle/DependencyInjection/ChillBudgetExtension.php +++ b/src/Bundle/ChillBudgetBundle/DependencyInjection/ChillBudgetExtension.php @@ -29,6 +29,7 @@ use Symfony\Component\HttpKernel\DependencyInjection\Extension; */ class ChillBudgetExtension extends Extension implements PrependExtensionInterface { + #[\Override] public function load(array $configs, ContainerBuilder $container) { $configuration = $this->getConfiguration($configs, $container); @@ -48,6 +49,7 @@ class ChillBudgetExtension extends Extension implements PrependExtensionInterfac $this->storeConfig('charges', $config, $container); } + #[\Override] public function prepend(ContainerBuilder $container) { $this->prependAuthorization($container); diff --git a/src/Bundle/ChillBudgetBundle/DependencyInjection/Compiler/CalculatorCompilerPass.php b/src/Bundle/ChillBudgetBundle/DependencyInjection/Compiler/CalculatorCompilerPass.php index 012c4eab5..2c75f0f52 100644 --- a/src/Bundle/ChillBudgetBundle/DependencyInjection/Compiler/CalculatorCompilerPass.php +++ b/src/Bundle/ChillBudgetBundle/DependencyInjection/Compiler/CalculatorCompilerPass.php @@ -17,6 +17,7 @@ use Symfony\Component\DependencyInjection\Reference; class CalculatorCompilerPass implements CompilerPassInterface { + #[\Override] public function process(ContainerBuilder $container) { $manager = $container->getDefinition(\Chill\BudgetBundle\Calculator\CalculatorManager::class); diff --git a/src/Bundle/ChillBudgetBundle/DependencyInjection/Configuration.php b/src/Bundle/ChillBudgetBundle/DependencyInjection/Configuration.php index ff9931f2d..565e79d16 100644 --- a/src/Bundle/ChillBudgetBundle/DependencyInjection/Configuration.php +++ b/src/Bundle/ChillBudgetBundle/DependencyInjection/Configuration.php @@ -16,6 +16,7 @@ use Symfony\Component\Config\Definition\ConfigurationInterface; class Configuration implements ConfigurationInterface { + #[\Override] public function getConfigTreeBuilder() { $treeBuilder = new TreeBuilder('chill_budget'); diff --git a/src/Bundle/ChillBudgetBundle/Entity/Charge.php b/src/Bundle/ChillBudgetBundle/Entity/Charge.php index b4b2918c9..096617b57 100644 --- a/src/Bundle/ChillBudgetBundle/Entity/Charge.php +++ b/src/Bundle/ChillBudgetBundle/Entity/Charge.php @@ -22,15 +22,15 @@ use Doctrine\ORM\Mapping as ORM; #[ORM\Table(name: 'chill_budget.charge')] class Charge extends AbstractElement implements HasCentersInterface { - final public const HELP_ASKED = 'running'; + final public const string HELP_ASKED = 'running'; - final public const HELP_NO = 'no'; + final public const string HELP_NO = 'no'; - final public const HELP_NOT_RELEVANT = 'not-relevant'; + final public const string HELP_NOT_RELEVANT = 'not-relevant'; - final public const HELP_YES = 'yes'; + final public const string HELP_YES = 'yes'; - final public const HELPS = [ + final public const array HELPS = [ self::HELP_ASKED, self::HELP_NO, self::HELP_YES, @@ -54,6 +54,7 @@ class Charge extends AbstractElement implements HasCentersInterface $this->setStartDate(new \DateTimeImmutable('today')); } + #[\Override] public function getCenters(): array { if (null !== $this->getPerson()) { @@ -83,11 +84,13 @@ class Charge extends AbstractElement implements HasCentersInterface return $this->id; } + #[\Override] public function isCharge(): bool { return true; } + #[\Override] public function isResource(): bool { return false; diff --git a/src/Bundle/ChillBudgetBundle/Entity/Resource.php b/src/Bundle/ChillBudgetBundle/Entity/Resource.php index 14fa0c9fa..2b7f4d2d2 100644 --- a/src/Bundle/ChillBudgetBundle/Entity/Resource.php +++ b/src/Bundle/ChillBudgetBundle/Entity/Resource.php @@ -36,6 +36,7 @@ class Resource extends AbstractElement implements HasCentersInterface $this->setStartDate(new \DateTimeImmutable('today')); } + #[\Override] public function getCenters(): array { if (null !== $this->getPerson()) { @@ -60,11 +61,13 @@ class Resource extends AbstractElement implements HasCentersInterface return $this->resource; } + #[\Override] public function isCharge(): bool { return false; } + #[\Override] public function isResource(): bool { return true; diff --git a/src/Bundle/ChillBudgetBundle/Form/Admin/ChargeKindType.php b/src/Bundle/ChillBudgetBundle/Form/Admin/ChargeKindType.php index c3c2a66bf..d7d907ba8 100644 --- a/src/Bundle/ChillBudgetBundle/Form/Admin/ChargeKindType.php +++ b/src/Bundle/ChillBudgetBundle/Form/Admin/ChargeKindType.php @@ -22,6 +22,7 @@ use Symfony\Component\OptionsResolver\OptionsResolver; class ChargeKindType extends AbstractType { + #[\Override] public function buildForm(FormBuilderInterface $builder, array $options) { $builder @@ -39,6 +40,7 @@ class ChargeKindType extends AbstractType ]); } + #[\Override] public function configureOptions(OptionsResolver $resolver) { $resolver diff --git a/src/Bundle/ChillBudgetBundle/Form/Admin/ResourceKindType.php b/src/Bundle/ChillBudgetBundle/Form/Admin/ResourceKindType.php index 41d3a8b53..47966edd7 100644 --- a/src/Bundle/ChillBudgetBundle/Form/Admin/ResourceKindType.php +++ b/src/Bundle/ChillBudgetBundle/Form/Admin/ResourceKindType.php @@ -22,6 +22,7 @@ use Symfony\Component\OptionsResolver\OptionsResolver; class ResourceKindType extends AbstractType { + #[\Override] public function buildForm(FormBuilderInterface $builder, array $options) { $builder @@ -39,6 +40,7 @@ class ResourceKindType extends AbstractType ]); } + #[\Override] public function configureOptions(OptionsResolver $resolver) { $resolver diff --git a/src/Bundle/ChillBudgetBundle/Form/ChargeType.php b/src/Bundle/ChillBudgetBundle/Form/ChargeType.php index 2d219b62a..65ee3f025 100644 --- a/src/Bundle/ChillBudgetBundle/Form/ChargeType.php +++ b/src/Bundle/ChillBudgetBundle/Form/ChargeType.php @@ -29,6 +29,7 @@ class ChargeType extends AbstractType { public function __construct(protected TranslatableStringHelperInterface $translatableStringHelper, private readonly ChargeKindRepository $repository, private readonly TranslatorInterface $translator) {} + #[\Override] public function buildForm(FormBuilderInterface $builder, array $options) { $builder @@ -74,6 +75,7 @@ class ChargeType extends AbstractType } } + #[\Override] public function configureOptions(OptionsResolver $resolver) { $resolver->setDefaults([ @@ -89,6 +91,7 @@ class ChargeType extends AbstractType ->setAllowedTypes('show_help', 'boolean'); } + #[\Override] public function getBlockPrefix() { return 'chill_budgetbundle_charge'; diff --git a/src/Bundle/ChillBudgetBundle/Form/ResourceType.php b/src/Bundle/ChillBudgetBundle/Form/ResourceType.php index ba93f1080..2e1089e1d 100644 --- a/src/Bundle/ChillBudgetBundle/Form/ResourceType.php +++ b/src/Bundle/ChillBudgetBundle/Form/ResourceType.php @@ -28,6 +28,7 @@ class ResourceType extends AbstractType { public function __construct(protected TranslatableStringHelperInterface $translatableStringHelper, private readonly ResourceKindRepository $repository, private readonly TranslatorInterface $translator) {} + #[\Override] public function buildForm(FormBuilderInterface $builder, array $options) { $builder @@ -59,6 +60,7 @@ class ResourceType extends AbstractType } } + #[\Override] public function configureOptions(OptionsResolver $resolver) { $resolver->setDefaults([ @@ -72,6 +74,7 @@ class ResourceType extends AbstractType ->setAllowedTypes('show_end_date', 'boolean'); } + #[\Override] public function getBlockPrefix() { return 'chill_budgetbundle_resource'; diff --git a/src/Bundle/ChillBudgetBundle/Menu/AdminMenuBuilder.php b/src/Bundle/ChillBudgetBundle/Menu/AdminMenuBuilder.php index b8b4b617c..24a339ddd 100644 --- a/src/Bundle/ChillBudgetBundle/Menu/AdminMenuBuilder.php +++ b/src/Bundle/ChillBudgetBundle/Menu/AdminMenuBuilder.php @@ -19,6 +19,7 @@ final readonly class AdminMenuBuilder implements LocalMenuBuilderInterface { public function __construct(private Security $security) {} + #[\Override] public function buildMenu($menuId, MenuItem $menu, array $parameters) { // all the entries below must have ROLE_ADMIN permissions @@ -50,6 +51,7 @@ final readonly class AdminMenuBuilder implements LocalMenuBuilderInterface ]); } + #[\Override] public static function getMenuIds(): array { return ['admin_section', 'admin_budget']; diff --git a/src/Bundle/ChillBudgetBundle/Menu/HouseholdMenuBuilder.php b/src/Bundle/ChillBudgetBundle/Menu/HouseholdMenuBuilder.php index af9cf8280..f00d92cbb 100644 --- a/src/Bundle/ChillBudgetBundle/Menu/HouseholdMenuBuilder.php +++ b/src/Bundle/ChillBudgetBundle/Menu/HouseholdMenuBuilder.php @@ -22,6 +22,7 @@ final readonly class HouseholdMenuBuilder implements LocalMenuBuilderInterface { public function __construct(private Security $security, private TranslatorInterface $translator) {} + #[\Override] public function buildMenu($menuId, MenuItem $menu, array $parameters) { /** @var Household $household */ @@ -37,6 +38,7 @@ final readonly class HouseholdMenuBuilder implements LocalMenuBuilderInterface } } + #[\Override] public static function getMenuIds(): array { return ['household']; diff --git a/src/Bundle/ChillBudgetBundle/Menu/PersonMenuBuilder.php b/src/Bundle/ChillBudgetBundle/Menu/PersonMenuBuilder.php index 25bd6a218..0ce12f92e 100644 --- a/src/Bundle/ChillBudgetBundle/Menu/PersonMenuBuilder.php +++ b/src/Bundle/ChillBudgetBundle/Menu/PersonMenuBuilder.php @@ -22,6 +22,7 @@ class PersonMenuBuilder implements LocalMenuBuilderInterface { public function __construct(protected AuthorizationCheckerInterface $authorizationChecker, protected TranslatorInterface $translator) {} + #[\Override] public function buildMenu($menuId, MenuItem $menu, array $parameters) { /** @var Person $person */ @@ -39,6 +40,7 @@ class PersonMenuBuilder implements LocalMenuBuilderInterface } } + #[\Override] public static function getMenuIds(): array { return ['person']; diff --git a/src/Bundle/ChillBudgetBundle/Repository/ChargeKindRepository.php b/src/Bundle/ChillBudgetBundle/Repository/ChargeKindRepository.php index b2bb9e82e..91a899293 100644 --- a/src/Bundle/ChillBudgetBundle/Repository/ChargeKindRepository.php +++ b/src/Bundle/ChillBudgetBundle/Repository/ChargeKindRepository.php @@ -24,6 +24,7 @@ final readonly class ChargeKindRepository implements ChargeKindRepositoryInterfa $this->repository = $entityManager->getRepository(ChargeKind::class); } + #[\Override] public function find($id): ?ChargeKind { return $this->repository->find($id); @@ -32,6 +33,7 @@ final readonly class ChargeKindRepository implements ChargeKindRepositoryInterfa /** * @return array */ + #[\Override] public function findAll(): array { return $this->repository->findAll(); @@ -40,6 +42,7 @@ final readonly class ChargeKindRepository implements ChargeKindRepositoryInterfa /** * @return array */ + #[\Override] public function findAllActive(): array { $qb = $this->repository->createQueryBuilder('c'); @@ -55,6 +58,7 @@ final readonly class ChargeKindRepository implements ChargeKindRepositoryInterfa /** * @return array */ + #[\Override] public function findAllByType(string $type): array { return $this->findBy(['elementType' => $type]); @@ -66,21 +70,25 @@ final readonly class ChargeKindRepository implements ChargeKindRepositoryInterfa * * @return array */ + #[\Override] public function findBy(array $criteria, ?array $orderBy = null, ?int $limit = null, ?int $offset = null): array { return $this->repository->findBy($criteria, $orderBy, $limit, $offset); } + #[\Override] public function findOneBy(array $criteria): ?ChargeKind { return $this->repository->findOneBy($criteria); } + #[\Override] public function findOneByKind(string $kind): ?ChargeKind { return $this->repository->findOneBy(['kind' => $kind]); } + #[\Override] public function getClassName(): string { return ChargeKind::class; diff --git a/src/Bundle/ChillBudgetBundle/Repository/ResourceKindRepository.php b/src/Bundle/ChillBudgetBundle/Repository/ResourceKindRepository.php index 18051f120..cb5edb105 100644 --- a/src/Bundle/ChillBudgetBundle/Repository/ResourceKindRepository.php +++ b/src/Bundle/ChillBudgetBundle/Repository/ResourceKindRepository.php @@ -24,6 +24,7 @@ final readonly class ResourceKindRepository implements ResourceKindRepositoryInt $this->repository = $entityManager->getRepository(ResourceKind::class); } + #[\Override] public function find($id): ?ResourceKind { return $this->repository->find($id); @@ -32,6 +33,7 @@ final readonly class ResourceKindRepository implements ResourceKindRepositoryInt /** * @return list */ + #[\Override] public function findAll(): array { return $this->repository->findAll(); @@ -40,6 +42,7 @@ final readonly class ResourceKindRepository implements ResourceKindRepositoryInt /** * @return list */ + #[\Override] public function findAllActive(): array { $qb = $this->repository->createQueryBuilder('r'); @@ -52,6 +55,7 @@ final readonly class ResourceKindRepository implements ResourceKindRepositoryInt ->getResult(); } + #[\Override] public function findOneByKind(string $kind): ?ResourceKind { return $this->repository->findOneBy(['kind' => $kind]); @@ -60,6 +64,7 @@ final readonly class ResourceKindRepository implements ResourceKindRepositoryInt /** * @return list */ + #[\Override] public function findAllByType(string $type): array { return $this->findBy(['elementType' => $type]); @@ -71,16 +76,19 @@ final readonly class ResourceKindRepository implements ResourceKindRepositoryInt * * @return list */ + #[\Override] public function findBy(array $criteria, ?array $orderBy = null, ?int $limit = null, ?int $offset = null): array { return $this->repository->findBy($criteria, $orderBy, $limit, $offset); } + #[\Override] public function findOneBy(array $criteria): ?ResourceKind { return $this->repository->findOneBy($criteria); } + #[\Override] public function getClassName(): string { return ResourceKind::class; diff --git a/src/Bundle/ChillBudgetBundle/Security/Authorization/BudgetElementVoter.php b/src/Bundle/ChillBudgetBundle/Security/Authorization/BudgetElementVoter.php index ceb3874e1..906cc0406 100644 --- a/src/Bundle/ChillBudgetBundle/Security/Authorization/BudgetElementVoter.php +++ b/src/Bundle/ChillBudgetBundle/Security/Authorization/BudgetElementVoter.php @@ -22,20 +22,20 @@ use Symfony\Component\Security\Core\Authorization\Voter\Voter; class BudgetElementVoter extends Voter implements ProvideRoleHierarchyInterface { - final public const CREATE = 'CHILL_BUDGET_ELEMENT_CREATE'; + final public const string CREATE = 'CHILL_BUDGET_ELEMENT_CREATE'; - final public const DELETE = 'CHILL_BUDGET_ELEMENT_DELETE'; + final public const string DELETE = 'CHILL_BUDGET_ELEMENT_DELETE'; - final public const ROLES = [ + final public const array ROLES = [ self::CREATE, self::DELETE, self::SEE, self::UPDATE, ]; - final public const SEE = 'CHILL_BUDGET_ELEMENT_SEE'; + final public const string SEE = 'CHILL_BUDGET_ELEMENT_SEE'; - final public const UPDATE = 'CHILL_BUDGET_ELEMENT_UPDATE'; + final public const string UPDATE = 'CHILL_BUDGET_ELEMENT_UPDATE'; protected VoterHelperInterface $voter; @@ -49,26 +49,31 @@ class BudgetElementVoter extends Voter implements ProvideRoleHierarchyInterface ->build(); } + #[\Override] public function getRoles(): array { return self::ROLES; } + #[\Override] public function getRolesWithHierarchy(): array { return ['Budget elements' => self::ROLES]; } + #[\Override] public function getRolesWithoutScope(): array { return self::ROLES; } + #[\Override] protected function supports($attribute, $subject) { return $this->voter->supports($attribute, $subject); } + #[\Override] protected function voteOnAttribute($attribute, $subject, TokenInterface $token) { if ( diff --git a/src/Bundle/ChillBudgetBundle/Service/Summary/SummaryBudget.php b/src/Bundle/ChillBudgetBundle/Service/Summary/SummaryBudget.php index a57f7fb29..5bdb7cf84 100644 --- a/src/Bundle/ChillBudgetBundle/Service/Summary/SummaryBudget.php +++ b/src/Bundle/ChillBudgetBundle/Service/Summary/SummaryBudget.php @@ -26,16 +26,17 @@ use Doctrine\ORM\Query\ResultSetMapping; */ 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'; + private const string 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'; - private const QUERY_CHARGE_BY_PERSON = 'select SUM(amount) AS sum, string_agg(comment, \'|\') AS comment, charge_id AS kind_id FROM chill_budget.charge WHERE person_id = ? AND NOW() BETWEEN startdate AND COALESCE(enddate, \'infinity\'::timestamp) GROUP BY charge_id'; + private const string QUERY_CHARGE_BY_PERSON = 'select SUM(amount) AS sum, string_agg(comment, \'|\') AS comment, charge_id AS kind_id FROM chill_budget.charge WHERE person_id = ? AND NOW() BETWEEN startdate AND COALESCE(enddate, \'infinity\'::timestamp) GROUP BY charge_id'; - private const QUERY_RESOURCE_BY_HOUSEHOLD = 'select SUM(amount) AS sum, string_agg(comment, \'|\') AS comment, resource_id AS kind_id FROM chill_budget.resource WHERE (person_id IN (_ids_) OR household_id = ?) AND NOW() BETWEEN startdate AND COALESCE(enddate, \'infinity\'::timestamp) GROUP BY resource_id'; + private const string QUERY_RESOURCE_BY_HOUSEHOLD = 'select SUM(amount) AS sum, string_agg(comment, \'|\') AS comment, resource_id AS kind_id FROM chill_budget.resource WHERE (person_id IN (_ids_) OR household_id = ?) AND NOW() BETWEEN startdate AND COALESCE(enddate, \'infinity\'::timestamp) GROUP BY resource_id'; - private const QUERY_RESOURCE_BY_PERSON = 'select SUM(amount) AS sum, string_agg(comment, \'|\') AS comment, resource_id AS kind_id FROM chill_budget.resource WHERE person_id = ? AND NOW() BETWEEN startdate AND COALESCE(enddate, \'infinity\'::timestamp) GROUP BY resource_id'; + private const string QUERY_RESOURCE_BY_PERSON = 'select SUM(amount) AS sum, string_agg(comment, \'|\') AS comment, resource_id AS kind_id FROM chill_budget.resource WHERE person_id = ? AND NOW() BETWEEN startdate AND COALESCE(enddate, \'infinity\'::timestamp) GROUP BY resource_id'; public function __construct(private EntityManagerInterface $em, private TranslatableStringHelperInterface $translatableStringHelper, private ResourceKindRepositoryInterface $resourceKindRepository, private ChargeKindRepositoryInterface $chargeKindRepository) {} + #[\Override] public function getSummaryForHousehold(?Household $household): array { if (null === $household) { @@ -65,6 +66,7 @@ final readonly class SummaryBudget implements SummaryBudgetInterface ]; } + #[\Override] public function getSummaryForPerson(?Person $person): array { if (null === $person) { diff --git a/src/Bundle/ChillBudgetBundle/Templating/BudgetElementTypeRender.php b/src/Bundle/ChillBudgetBundle/Templating/BudgetElementTypeRender.php index 26871b0f4..3b743d437 100644 --- a/src/Bundle/ChillBudgetBundle/Templating/BudgetElementTypeRender.php +++ b/src/Bundle/ChillBudgetBundle/Templating/BudgetElementTypeRender.php @@ -23,6 +23,7 @@ final readonly class BudgetElementTypeRender implements ChillEntityRenderInterfa { public function __construct(private TranslatableStringHelperInterface $translatableStringHelper, private \Twig\Environment $engine) {} + #[\Override] public function renderBox($entity, array $options): string { return $this->engine->render('@ChillBudget/Entity/budget_element_type.html.twig', [ @@ -31,6 +32,7 @@ final readonly class BudgetElementTypeRender implements ChillEntityRenderInterfa ]); } + #[\Override] public function renderString($entity, array $options): string { $title = ''; @@ -42,6 +44,7 @@ final readonly class BudgetElementTypeRender implements ChillEntityRenderInterfa return $title; } + #[\Override] public function supports($entity, array $options): bool { return $entity instanceof ChargeKind || $entity instanceof ResourceKind; diff --git a/src/Bundle/ChillBudgetBundle/migrations/Version20180522080432.php b/src/Bundle/ChillBudgetBundle/migrations/Version20180522080432.php index 04fdecdea..f4c0105f0 100644 --- a/src/Bundle/ChillBudgetBundle/migrations/Version20180522080432.php +++ b/src/Bundle/ChillBudgetBundle/migrations/Version20180522080432.php @@ -19,16 +19,19 @@ use Doctrine\Migrations\AbstractMigration; */ final class Version20180522080432 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->addSql('DROP SCHEMA chill_budget CASCADE'); } + #[\Override] public function getDescription(): string { return 'Creation of necessary tables for budget bundle'; } + #[\Override] public function up(Schema $schema): void { $this->addSql('CREATE SCHEMA chill_budget'); diff --git a/src/Bundle/ChillBudgetBundle/migrations/Version20181219145631.php b/src/Bundle/ChillBudgetBundle/migrations/Version20181219145631.php index 810193c38..0bd5a4275 100644 --- a/src/Bundle/ChillBudgetBundle/migrations/Version20181219145631.php +++ b/src/Bundle/ChillBudgetBundle/migrations/Version20181219145631.php @@ -19,11 +19,13 @@ use Doctrine\Migrations\AbstractMigration; */ final class Version20181219145631 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->addSql('ALTER TABLE chill_budget.charge ALTER help SET NOT NULL'); } + #[\Override] public function up(Schema $schema): void { $this->addSql('ALTER TABLE chill_budget.charge ALTER help DROP NOT NULL'); diff --git a/src/Bundle/ChillBudgetBundle/migrations/Version20220224090319.php b/src/Bundle/ChillBudgetBundle/migrations/Version20220224090319.php index 8ce73e534..6bdb6d401 100644 --- a/src/Bundle/ChillBudgetBundle/migrations/Version20220224090319.php +++ b/src/Bundle/ChillBudgetBundle/migrations/Version20220224090319.php @@ -19,6 +19,7 @@ use Doctrine\Migrations\AbstractMigration; */ final class Version20220224090319 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->addSql('ALTER TABLE chill_budget.charge DROP CONSTRAINT FK_5C99D2C3E79FF843'); @@ -27,11 +28,13 @@ final class Version20220224090319 extends AbstractMigration $this->addSql('ALTER TABLE chill_budget.resource DROP household_id'); } + #[\Override] public function getDescription(): string { return 'Add household to budget AbstractElement'; } + #[\Override] public function up(Schema $schema): void { $this->addSql('ALTER TABLE chill_budget.charge ADD household_id INT DEFAULT NULL'); diff --git a/src/Bundle/ChillBudgetBundle/migrations/Version20221116163445.php b/src/Bundle/ChillBudgetBundle/migrations/Version20221116163445.php index 118b7c30d..50c837e48 100644 --- a/src/Bundle/ChillBudgetBundle/migrations/Version20221116163445.php +++ b/src/Bundle/ChillBudgetBundle/migrations/Version20221116163445.php @@ -16,6 +16,7 @@ use Doctrine\Migrations\AbstractMigration; final class Version20221116163445 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->addSql('DROP SEQUENCE chill_budget.charge_type_id_seq CASCADE'); @@ -24,11 +25,13 @@ final class Version20221116163445 extends AbstractMigration $this->addSql('DROP TABLE chill_budget.resource_type'); } + #[\Override] public function getDescription(): string { return 'Create resource type and charge type'; } + #[\Override] public function up(Schema $schema): void { $this->addSql('CREATE SEQUENCE chill_budget.charge_type_id_seq INCREMENT BY 1 MINVALUE 1 START 1'); diff --git a/src/Bundle/ChillBudgetBundle/migrations/Version20221130101659.php b/src/Bundle/ChillBudgetBundle/migrations/Version20221130101659.php index 98d67b341..c757f57d6 100644 --- a/src/Bundle/ChillBudgetBundle/migrations/Version20221130101659.php +++ b/src/Bundle/ChillBudgetBundle/migrations/Version20221130101659.php @@ -16,6 +16,7 @@ use Doctrine\Migrations\AbstractMigration; final class Version20221130101659 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->addSql('ALTER TABLE chill_budget.resource_type DROP kind'); @@ -24,11 +25,13 @@ final class Version20221130101659 extends AbstractMigration $this->addSql('ALTER TABLE chill_budget.charge_type DROP tags'); } + #[\Override] public function getDescription(): string { return 'Add kind and tags property to charge and resource types'; } + #[\Override] public function up(Schema $schema): void { $this->addSql('ALTER TABLE chill_budget.charge_type ADD kind VARCHAR(255) DEFAULT \'\' NOT NULL'); diff --git a/src/Bundle/ChillBudgetBundle/migrations/Version20221202165608.php b/src/Bundle/ChillBudgetBundle/migrations/Version20221202165608.php index c2152100b..c5e174383 100644 --- a/src/Bundle/ChillBudgetBundle/migrations/Version20221202165608.php +++ b/src/Bundle/ChillBudgetBundle/migrations/Version20221202165608.php @@ -16,6 +16,7 @@ use Doctrine\Migrations\AbstractMigration; final class Version20221202165608 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->addSql('ALTER TABLE chill_budget.charge DROP CONSTRAINT FK_5C99D2C355284914'); @@ -24,11 +25,13 @@ final class Version20221202165608 extends AbstractMigration $this->addSql('ALTER TABLE chill_budget.resource DROP resource_id'); } + #[\Override] public function getDescription(): string { return 'Integrate budget admin entity'; } + #[\Override] public function up(Schema $schema): void { $this->addSql('ALTER TABLE chill_budget.charge ADD charge_id INT DEFAULT NULL'); diff --git a/src/Bundle/ChillBudgetBundle/migrations/Version20221207105407.php b/src/Bundle/ChillBudgetBundle/migrations/Version20221207105407.php index cfe3a0089..0907e63cd 100644 --- a/src/Bundle/ChillBudgetBundle/migrations/Version20221207105407.php +++ b/src/Bundle/ChillBudgetBundle/migrations/Version20221207105407.php @@ -21,22 +21,26 @@ final class Version20221207105407 extends AbstractMigration implements Container { public ContainerInterface $container; + #[\Override] public function down(Schema $schema): void { $this->addSql('DELETE FROM chill_budget.resource_type;'); $this->addSql('DELETE FROM chill_budget.charge_type;'); } + #[\Override] public function getDescription(): string { return 'Use new budget admin entities'; } + #[\Override] public function setContainer(?ContainerInterface $container = null) { $this->container = $container; } + #[\Override] public function up(Schema $schema): void { $resources = $this->container->getParameter('chill_budget.resources'); diff --git a/src/Bundle/ChillBudgetBundle/migrations/Version20230201131008.php b/src/Bundle/ChillBudgetBundle/migrations/Version20230201131008.php index 7131c31f2..4db48f647 100644 --- a/src/Bundle/ChillBudgetBundle/migrations/Version20230201131008.php +++ b/src/Bundle/ChillBudgetBundle/migrations/Version20230201131008.php @@ -19,16 +19,19 @@ use Doctrine\Migrations\AbstractMigration; */ final class Version20230201131008 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { // this shouldn't be undone. } + #[\Override] public function getDescription(): string { return 'Fix the comment on tags column in resource and charge type'; } + #[\Override] public function up(Schema $schema): void { $this->addSql('COMMENT ON COLUMN chill_budget.resource_type.tags IS \'(DC2Type:json)\''); diff --git a/src/Bundle/ChillBudgetBundle/migrations/Version20230209161546.php b/src/Bundle/ChillBudgetBundle/migrations/Version20230209161546.php index 4495db8a7..cdcdc57b5 100644 --- a/src/Bundle/ChillBudgetBundle/migrations/Version20230209161546.php +++ b/src/Bundle/ChillBudgetBundle/migrations/Version20230209161546.php @@ -16,17 +16,20 @@ use Doctrine\Migrations\AbstractMigration; final class Version20230209161546 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->addSql('DROP INDEX resource_kind_unique_type_idx'); $this->addSql('DROP INDEX charge_kind_unique_type_idx'); } + #[\Override] public function getDescription(): string { return 'Budget: add unique constraint on kind for charge_kind and resource_kind'; } + #[\Override] public function up(Schema $schema): void { $this->addSql("UPDATE chill_budget.resource_type SET kind=md5(random()::text) WHERE kind = ''"); diff --git a/src/Bundle/ChillBudgetBundle/migrations/Version20230328155010.php b/src/Bundle/ChillBudgetBundle/migrations/Version20230328155010.php index ed524940e..8aacd89bf 100644 --- a/src/Bundle/ChillBudgetBundle/migrations/Version20230328155010.php +++ b/src/Bundle/ChillBudgetBundle/migrations/Version20230328155010.php @@ -16,11 +16,13 @@ use Doctrine\Migrations\AbstractMigration; final class Version20230328155010 extends AbstractMigration { + #[\Override] public function getDescription(): string { return 'budget elements: restore the previous type to resource/charge kind if applicable'; } + #[\Override] public function up(Schema $schema): void { $this->addSql(<<<'SQL' @@ -48,6 +50,7 @@ final class Version20230328155010 extends AbstractMigration SQL); } + #[\Override] public function down(Schema $schema): void { $this->addSql("UPDATE chill_budget.resource_type SET kind=md5(random()::text) WHERE kind = ''"); diff --git a/src/Bundle/ChillCalendarBundle/ChillCalendarBundle.php b/src/Bundle/ChillCalendarBundle/ChillCalendarBundle.php index f0f20181a..fdc306e9a 100644 --- a/src/Bundle/ChillCalendarBundle/ChillCalendarBundle.php +++ b/src/Bundle/ChillCalendarBundle/ChillCalendarBundle.php @@ -17,6 +17,7 @@ use Symfony\Component\HttpKernel\Bundle\Bundle; class ChillCalendarBundle extends Bundle { + #[\Override] public function build(ContainerBuilder $container) { parent::build($container); diff --git a/src/Bundle/ChillCalendarBundle/Command/AzureGrantAdminConsentAndAcquireToken.php b/src/Bundle/ChillCalendarBundle/Command/AzureGrantAdminConsentAndAcquireToken.php index f98ca2418..4062d9ca3 100644 --- a/src/Bundle/ChillCalendarBundle/Command/AzureGrantAdminConsentAndAcquireToken.php +++ b/src/Bundle/ChillCalendarBundle/Command/AzureGrantAdminConsentAndAcquireToken.php @@ -34,6 +34,7 @@ class AzureGrantAdminConsentAndAcquireToken extends Command parent::__construct('chill:calendar:msgraph-grant-admin-consent'); } + #[\Override] protected function execute(InputInterface $input, OutputInterface $output): int { /** @var FormatterHelper $formatter */ diff --git a/src/Bundle/ChillCalendarBundle/Command/MapAndSubscribeUserCalendarCommand.php b/src/Bundle/ChillCalendarBundle/Command/MapAndSubscribeUserCalendarCommand.php index ae4205c38..9b935be62 100644 --- a/src/Bundle/ChillCalendarBundle/Command/MapAndSubscribeUserCalendarCommand.php +++ b/src/Bundle/ChillCalendarBundle/Command/MapAndSubscribeUserCalendarCommand.php @@ -45,6 +45,7 @@ final class MapAndSubscribeUserCalendarCommand extends Command parent::__construct('chill:calendar:msgraph-user-map-subscribe'); } + #[\Override] public function execute(InputInterface $input, OutputInterface $output): int { $this->logger->info(self::class.' execute command'); @@ -156,6 +157,7 @@ final class MapAndSubscribeUserCalendarCommand extends Command return Command::SUCCESS; } + #[\Override] protected function configure() { parent::configure(); diff --git a/src/Bundle/ChillCalendarBundle/Command/SendShortMessageOnEligibleCalendar.php b/src/Bundle/ChillCalendarBundle/Command/SendShortMessageOnEligibleCalendar.php index 7d0426a24..779f45986 100644 --- a/src/Bundle/ChillCalendarBundle/Command/SendShortMessageOnEligibleCalendar.php +++ b/src/Bundle/ChillCalendarBundle/Command/SendShortMessageOnEligibleCalendar.php @@ -30,6 +30,7 @@ class SendShortMessageOnEligibleCalendar extends Command parent::__construct('chill:calendar:send-short-messages'); } + #[\Override] protected function execute(InputInterface $input, OutputInterface $output): int { $this->messageSender->sendBulkMessageToEligibleCalendars(); diff --git a/src/Bundle/ChillCalendarBundle/Command/SendTestShortMessageOnCalendarCommand.php b/src/Bundle/ChillCalendarBundle/Command/SendTestShortMessageOnCalendarCommand.php index 1b76f25fa..30d2709fc 100644 --- a/src/Bundle/ChillCalendarBundle/Command/SendTestShortMessageOnCalendarCommand.php +++ b/src/Bundle/ChillCalendarBundle/Command/SendTestShortMessageOnCalendarCommand.php @@ -52,8 +52,10 @@ class SendTestShortMessageOnCalendarCommand extends Command parent::__construct('chill:calendar:test-send-short-message'); } + #[\Override] protected function configure() {} + #[\Override] protected function execute(InputInterface $input, OutputInterface $output): int { $calendar = new Calendar(); diff --git a/src/Bundle/ChillCalendarBundle/Controller/CalendarAPIController.php b/src/Bundle/ChillCalendarBundle/Controller/CalendarAPIController.php index eb5812b4d..c2fdd7ee1 100644 --- a/src/Bundle/ChillCalendarBundle/Controller/CalendarAPIController.php +++ b/src/Bundle/ChillCalendarBundle/Controller/CalendarAPIController.php @@ -67,6 +67,7 @@ class CalendarAPIController extends ApiController return $this->json($collection, Response::HTTP_OK, [], ['groups' => ['calendar:light']]); } + #[\Override] protected function customizeQuery(string $action, Request $request, $qb): void { if ($request->query->has('main_user')) { @@ -75,6 +76,7 @@ class CalendarAPIController extends ApiController } } + #[\Override] protected function getContextForSerialization(string $action, Request $request, string $_format, $entity): array { switch ($action) { diff --git a/src/Bundle/ChillCalendarBundle/Controller/CancelReasonController.php b/src/Bundle/ChillCalendarBundle/Controller/CancelReasonController.php index 17cbecb02..12aa92c44 100644 --- a/src/Bundle/ChillCalendarBundle/Controller/CancelReasonController.php +++ b/src/Bundle/ChillCalendarBundle/Controller/CancelReasonController.php @@ -17,6 +17,7 @@ use Symfony\Component\HttpFoundation\Request; class CancelReasonController extends CRUDController { + #[\Override] protected function orderQuery(string $action, $query, Request $request, PaginatorInterface $paginator) { $query->addOrderBy('e.id', 'ASC'); diff --git a/src/Bundle/ChillCalendarBundle/DataFixtures/ORM/LoadCalendarACL.php b/src/Bundle/ChillCalendarBundle/DataFixtures/ORM/LoadCalendarACL.php index 2ef7365ca..731239c96 100644 --- a/src/Bundle/ChillCalendarBundle/DataFixtures/ORM/LoadCalendarACL.php +++ b/src/Bundle/ChillCalendarBundle/DataFixtures/ORM/LoadCalendarACL.php @@ -21,6 +21,7 @@ use Doctrine\Persistence\ObjectManager; class LoadCalendarACL extends Fixture implements OrderedFixtureInterface { + #[\Override] public function load(ObjectManager $manager): void { $roleScopes = []; @@ -47,6 +48,7 @@ class LoadCalendarACL extends Fixture implements OrderedFixtureInterface $manager->flush(); } + #[\Override] public function getOrder(): int { return 16000; diff --git a/src/Bundle/ChillCalendarBundle/DataFixtures/ORM/LoadCalendarRange.php b/src/Bundle/ChillCalendarBundle/DataFixtures/ORM/LoadCalendarRange.php index f222823bf..3301f64fe 100644 --- a/src/Bundle/ChillCalendarBundle/DataFixtures/ORM/LoadCalendarRange.php +++ b/src/Bundle/ChillCalendarBundle/DataFixtures/ORM/LoadCalendarRange.php @@ -30,16 +30,19 @@ class LoadCalendarRange extends Fixture implements FixtureGroupInterface, Ordere public function __construct(private readonly UserRepository $userRepository) {} + #[\Override] public static function getGroups(): array { return ['calendar']; } + #[\Override] public function getOrder(): int { return 40003; } + #[\Override] public function load(ObjectManager $manager): void { $users = $this->userRepository->findAll(); diff --git a/src/Bundle/ChillCalendarBundle/DataFixtures/ORM/LoadCancelReason.php b/src/Bundle/ChillCalendarBundle/DataFixtures/ORM/LoadCancelReason.php index d7e552d5d..46b334c4d 100644 --- a/src/Bundle/ChillCalendarBundle/DataFixtures/ORM/LoadCancelReason.php +++ b/src/Bundle/ChillCalendarBundle/DataFixtures/ORM/LoadCancelReason.php @@ -20,6 +20,7 @@ class LoadCancelReason extends Fixture implements FixtureGroupInterface { public static $references = []; + #[\Override] public static function getGroups(): array { return ['calendar']; @@ -30,6 +31,7 @@ class LoadCancelReason extends Fixture implements FixtureGroupInterface return 40001; } + #[\Override] public function load(ObjectManager $manager): void { $arr = [ diff --git a/src/Bundle/ChillCalendarBundle/DataFixtures/ORM/LoadInvite.php b/src/Bundle/ChillCalendarBundle/DataFixtures/ORM/LoadInvite.php index f677a4283..619802247 100644 --- a/src/Bundle/ChillCalendarBundle/DataFixtures/ORM/LoadInvite.php +++ b/src/Bundle/ChillCalendarBundle/DataFixtures/ORM/LoadInvite.php @@ -22,6 +22,7 @@ class LoadInvite extends Fixture implements FixtureGroupInterface { public static $references = []; + #[\Override] public static function getGroups(): array { return ['calendar']; @@ -32,6 +33,7 @@ class LoadInvite extends Fixture implements FixtureGroupInterface return 40002; } + #[\Override] public function load(ObjectManager $manager): void { $arr = [ diff --git a/src/Bundle/ChillCalendarBundle/DependencyInjection/ChillCalendarExtension.php b/src/Bundle/ChillCalendarBundle/DependencyInjection/ChillCalendarExtension.php index 5aa8d8507..faa59b9e4 100644 --- a/src/Bundle/ChillCalendarBundle/DependencyInjection/ChillCalendarExtension.php +++ b/src/Bundle/ChillCalendarBundle/DependencyInjection/ChillCalendarExtension.php @@ -26,6 +26,7 @@ use Symfony\Component\HttpKernel\DependencyInjection\Extension; */ class ChillCalendarExtension extends Extension implements PrependExtensionInterface { + #[\Override] public function load(array $configs, ContainerBuilder $container) { $configuration = new Configuration(); @@ -49,6 +50,7 @@ class ChillCalendarExtension extends Extension implements PrependExtensionInterf } } + #[\Override] public function prepend(ContainerBuilder $container) { $this->preprendRoutes($container); diff --git a/src/Bundle/ChillCalendarBundle/DependencyInjection/Configuration.php b/src/Bundle/ChillCalendarBundle/DependencyInjection/Configuration.php index a3e4ae391..067fe86d6 100644 --- a/src/Bundle/ChillCalendarBundle/DependencyInjection/Configuration.php +++ b/src/Bundle/ChillCalendarBundle/DependencyInjection/Configuration.php @@ -21,6 +21,7 @@ use Symfony\Component\Config\Definition\ConfigurationInterface; */ class Configuration implements ConfigurationInterface { + #[\Override] public function getConfigTreeBuilder() { $treeBuilder = new TreeBuilder('chill_calendar'); diff --git a/src/Bundle/ChillCalendarBundle/Entity/Calendar.php b/src/Bundle/ChillCalendarBundle/Entity/Calendar.php index 53949d1f0..86e1d2f8a 100644 --- a/src/Bundle/ChillCalendarBundle/Entity/Calendar.php +++ b/src/Bundle/ChillCalendarBundle/Entity/Calendar.php @@ -48,20 +48,20 @@ class Calendar implements TrackCreationInterface, TrackUpdateInterface, HasCente use TrackUpdateTrait; - final public const SMS_CANCEL_PENDING = 'sms_cancel_pending'; + final public const string SMS_CANCEL_PENDING = 'sms_cancel_pending'; - final public const SMS_PENDING = 'sms_pending'; + final public const string SMS_PENDING = 'sms_pending'; - final public const SMS_SENT = 'sms_sent'; + final public const string SMS_SENT = 'sms_sent'; - final public const STATUS_CANCELED = 'canceled'; + final public const string STATUS_CANCELED = 'canceled'; /** * @deprecated */ - final public const STATUS_MOVED = 'moved'; + final public const string STATUS_MOVED = 'moved'; - final public const STATUS_VALID = 'valid'; + final public const string STATUS_VALID = 'valid'; /** * a list of invite which have been added during this session. @@ -269,6 +269,7 @@ class Calendar implements TrackCreationInterface, TrackUpdateInterface, HasCente return $this->cancelReason; } + #[\Override] public function getCenters(): ?iterable { return match ($this->getContext()) { diff --git a/src/Bundle/ChillCalendarBundle/Entity/CancelReason.php b/src/Bundle/ChillCalendarBundle/Entity/CancelReason.php index d4a2ed9a9..051f4bd79 100644 --- a/src/Bundle/ChillCalendarBundle/Entity/CancelReason.php +++ b/src/Bundle/ChillCalendarBundle/Entity/CancelReason.php @@ -18,11 +18,11 @@ use Doctrine\ORM\Mapping as ORM; #[ORM\Table(name: 'chill_calendar.cancel_reason')] class CancelReason { - final public const CANCELEDBY_DONOTCOUNT = 'CANCELEDBY_DONOTCOUNT'; + final public const string CANCELEDBY_DONOTCOUNT = 'CANCELEDBY_DONOTCOUNT'; - final public const CANCELEDBY_PERSON = 'CANCELEDBY_PERSON'; + final public const string CANCELEDBY_PERSON = 'CANCELEDBY_PERSON'; - final public const CANCELEDBY_USER = 'CANCELEDBY_USER'; + final public const string CANCELEDBY_USER = 'CANCELEDBY_USER'; #[ORM\Column(type: \Doctrine\DBAL\Types\Types::BOOLEAN)] private ?bool $active = null; diff --git a/src/Bundle/ChillCalendarBundle/Entity/Invite.php b/src/Bundle/ChillCalendarBundle/Entity/Invite.php index 3c1b2477d..447c6c8c0 100644 --- a/src/Bundle/ChillCalendarBundle/Entity/Invite.php +++ b/src/Bundle/ChillCalendarBundle/Entity/Invite.php @@ -36,23 +36,23 @@ class Invite implements TrackUpdateInterface, TrackCreationInterface use TrackUpdateTrait; - final public const ACCEPTED = 'accepted'; + final public const string ACCEPTED = 'accepted'; - final public const DECLINED = 'declined'; + final public const string DECLINED = 'declined'; - final public const PENDING = 'pending'; + final public const string PENDING = 'pending'; /** * all statuses in one const. */ - final public const STATUSES = [ + final public const array STATUSES = [ self::ACCEPTED, self::DECLINED, self::PENDING, self::TENTATIVELY_ACCEPTED, ]; - final public const TENTATIVELY_ACCEPTED = 'tentative'; + final public const string TENTATIVELY_ACCEPTED = 'tentative'; #[ORM\ManyToOne(targetEntity: Calendar::class, inversedBy: 'invites')] private ?Calendar $calendar = null; diff --git a/src/Bundle/ChillCalendarBundle/Export/Aggregator/AgentAggregator.php b/src/Bundle/ChillCalendarBundle/Export/Aggregator/AgentAggregator.php index 5e2091fac..2d6b12b4c 100644 --- a/src/Bundle/ChillCalendarBundle/Export/Aggregator/AgentAggregator.php +++ b/src/Bundle/ChillCalendarBundle/Export/Aggregator/AgentAggregator.php @@ -22,11 +22,13 @@ final readonly class AgentAggregator implements AggregatorInterface { public function __construct(private UserRepository $userRepository, private UserRender $userRender) {} + #[\Override] public function addRole(): ?string { return null; } + #[\Override] public function alterQuery(QueryBuilder $qb, $data) { if (!\in_array('caluser', $qb->getAllAliases(), true)) { @@ -37,21 +39,25 @@ final readonly class AgentAggregator implements AggregatorInterface $qb->addGroupBy('agent_aggregator'); } + #[\Override] public function applyOn(): string { return Declarations::CALENDAR_TYPE; } + #[\Override] public function buildForm(FormBuilderInterface $builder) { // no form } + #[\Override] public function getFormDefaultData(): array { return []; } + #[\Override] public function getLabels($key, array $values, $data): \Closure { return function ($value): string { @@ -69,11 +75,13 @@ final readonly class AgentAggregator implements AggregatorInterface }; } + #[\Override] public function getQueryKeys($data): array { return ['agent_aggregator']; } + #[\Override] public function getTitle(): string { return 'Group calendars by agent'; diff --git a/src/Bundle/ChillCalendarBundle/Export/Aggregator/CancelReasonAggregator.php b/src/Bundle/ChillCalendarBundle/Export/Aggregator/CancelReasonAggregator.php index 7c84653d2..6be2e41f8 100644 --- a/src/Bundle/ChillCalendarBundle/Export/Aggregator/CancelReasonAggregator.php +++ b/src/Bundle/ChillCalendarBundle/Export/Aggregator/CancelReasonAggregator.php @@ -22,11 +22,13 @@ class CancelReasonAggregator implements AggregatorInterface { public function __construct(private readonly CancelReasonRepository $cancelReasonRepository, private readonly TranslatableStringHelper $translatableStringHelper) {} + #[\Override] public function addRole(): ?string { return null; } + #[\Override] public function alterQuery(QueryBuilder $qb, $data) { // TODO: still needs to take into account calendars without a cancel reason somehow @@ -38,21 +40,25 @@ class CancelReasonAggregator implements AggregatorInterface $qb->addGroupBy('cancel_reason_aggregator'); } + #[\Override] public function applyOn(): string { return Declarations::CALENDAR_TYPE; } + #[\Override] public function buildForm(FormBuilderInterface $builder) { // no form } + #[\Override] public function getFormDefaultData(): array { return []; } + #[\Override] public function getLabels($key, array $values, $data): \Closure { return function ($value): string { @@ -72,11 +78,13 @@ class CancelReasonAggregator implements AggregatorInterface }; } + #[\Override] public function getQueryKeys($data): array { return ['cancel_reason_aggregator']; } + #[\Override] public function getTitle(): string { return 'Group calendars by cancel reason'; diff --git a/src/Bundle/ChillCalendarBundle/Export/Aggregator/JobAggregator.php b/src/Bundle/ChillCalendarBundle/Export/Aggregator/JobAggregator.php index 76cbe5cd8..7c83fce6a 100644 --- a/src/Bundle/ChillCalendarBundle/Export/Aggregator/JobAggregator.php +++ b/src/Bundle/ChillCalendarBundle/Export/Aggregator/JobAggregator.php @@ -22,18 +22,20 @@ use Symfony\Component\Form\FormBuilderInterface; final readonly class JobAggregator implements AggregatorInterface { - private const PREFIX = 'cal_agg_job'; + private const string PREFIX = 'cal_agg_job'; public function __construct( private UserJobRepository $jobRepository, private TranslatableStringHelper $translatableStringHelper ) {} + #[\Override] public function addRole(): ?string { return null; } + #[\Override] public function alterQuery(QueryBuilder $qb, $data) { $p = self::PREFIX; @@ -60,18 +62,22 @@ final readonly class JobAggregator implements AggregatorInterface ->addGroupBy("{$p}_select"); } + #[\Override] public function applyOn(): string { return Declarations::CALENDAR_TYPE; } + #[\Override] public function buildForm(FormBuilderInterface $builder) {} + #[\Override] public function getFormDefaultData(): array { return []; } + #[\Override] public function getLabels($key, array $values, $data): \Closure { return function ($value): string { @@ -93,11 +99,13 @@ final readonly class JobAggregator implements AggregatorInterface }; } + #[\Override] public function getQueryKeys($data): array { return [self::PREFIX.'_select']; } + #[\Override] public function getTitle(): string { return 'export.aggregator.calendar.agent_job.Group calendars by agent job'; diff --git a/src/Bundle/ChillCalendarBundle/Export/Aggregator/LocationAggregator.php b/src/Bundle/ChillCalendarBundle/Export/Aggregator/LocationAggregator.php index 6481f95b4..cceba0023 100644 --- a/src/Bundle/ChillCalendarBundle/Export/Aggregator/LocationAggregator.php +++ b/src/Bundle/ChillCalendarBundle/Export/Aggregator/LocationAggregator.php @@ -21,11 +21,13 @@ final readonly class LocationAggregator implements AggregatorInterface { public function __construct(private LocationRepository $locationRepository) {} + #[\Override] public function addRole(): ?string { return null; } + #[\Override] public function alterQuery(QueryBuilder $qb, $data) { if (!\in_array('calloc', $qb->getAllAliases(), true)) { @@ -35,21 +37,25 @@ final readonly class LocationAggregator implements AggregatorInterface $qb->addGroupBy('location_aggregator'); } + #[\Override] public function applyOn(): string { return Declarations::CALENDAR_TYPE; } + #[\Override] public function buildForm(FormBuilderInterface $builder) { // no form } + #[\Override] public function getFormDefaultData(): array { return []; } + #[\Override] public function getLabels($key, array $values, $data): \Closure { return function ($value): string { @@ -67,11 +73,13 @@ final readonly class LocationAggregator implements AggregatorInterface }; } + #[\Override] public function getQueryKeys($data): array { return ['location_aggregator']; } + #[\Override] public function getTitle(): string { return 'Group calendars by location'; diff --git a/src/Bundle/ChillCalendarBundle/Export/Aggregator/LocationTypeAggregator.php b/src/Bundle/ChillCalendarBundle/Export/Aggregator/LocationTypeAggregator.php index be9406cfa..3c3273c99 100644 --- a/src/Bundle/ChillCalendarBundle/Export/Aggregator/LocationTypeAggregator.php +++ b/src/Bundle/ChillCalendarBundle/Export/Aggregator/LocationTypeAggregator.php @@ -22,11 +22,13 @@ final readonly class LocationTypeAggregator implements AggregatorInterface { public function __construct(private LocationTypeRepository $locationTypeRepository, private TranslatableStringHelper $translatableStringHelper) {} + #[\Override] public function addRole(): ?string { return null; } + #[\Override] public function alterQuery(QueryBuilder $qb, $data) { if (!\in_array('calloc', $qb->getAllAliases(), true)) { @@ -37,21 +39,25 @@ final readonly class LocationTypeAggregator implements AggregatorInterface $qb->addGroupBy('location_type_aggregator'); } + #[\Override] public function applyOn(): string { return Declarations::CALENDAR_TYPE; } + #[\Override] public function buildForm(FormBuilderInterface $builder) { // no form } + #[\Override] public function getFormDefaultData(): array { return []; } + #[\Override] public function getLabels($key, array $values, $data): \Closure { return function ($value): string { @@ -73,11 +79,13 @@ final readonly class LocationTypeAggregator implements AggregatorInterface }; } + #[\Override] public function getQueryKeys($data): array { return ['location_type_aggregator']; } + #[\Override] public function getTitle(): string { return 'Group calendars by location type'; diff --git a/src/Bundle/ChillCalendarBundle/Export/Aggregator/MonthYearAggregator.php b/src/Bundle/ChillCalendarBundle/Export/Aggregator/MonthYearAggregator.php index 6bf65b8ef..d1b664562 100644 --- a/src/Bundle/ChillCalendarBundle/Export/Aggregator/MonthYearAggregator.php +++ b/src/Bundle/ChillCalendarBundle/Export/Aggregator/MonthYearAggregator.php @@ -18,11 +18,13 @@ use Symfony\Component\Form\FormBuilderInterface; class MonthYearAggregator implements AggregatorInterface { + #[\Override] public function addRole(): ?string { return null; } + #[\Override] public function alterQuery(QueryBuilder $qb, $data) { $qb->addSelect("to_char(cal.startDate, 'MM-YYYY') AS month_year_aggregator"); @@ -30,21 +32,25 @@ class MonthYearAggregator implements AggregatorInterface $qb->addGroupBy('month_year_aggregator'); } + #[\Override] public function applyOn(): string { return Declarations::CALENDAR_TYPE; } + #[\Override] public function buildForm(FormBuilderInterface $builder) { // No form needed } + #[\Override] public function getFormDefaultData(): array { return []; } + #[\Override] public function getLabels($key, array $values, $data): \Closure { return static function ($value): string { @@ -56,11 +62,13 @@ class MonthYearAggregator implements AggregatorInterface }; } + #[\Override] public function getQueryKeys($data): array { return ['month_year_aggregator']; } + #[\Override] public function getTitle(): string { return 'Group calendars by month and year'; diff --git a/src/Bundle/ChillCalendarBundle/Export/Aggregator/ScopeAggregator.php b/src/Bundle/ChillCalendarBundle/Export/Aggregator/ScopeAggregator.php index 4998f6d1f..71b465986 100644 --- a/src/Bundle/ChillCalendarBundle/Export/Aggregator/ScopeAggregator.php +++ b/src/Bundle/ChillCalendarBundle/Export/Aggregator/ScopeAggregator.php @@ -22,18 +22,20 @@ use Symfony\Component\Form\FormBuilderInterface; final readonly class ScopeAggregator implements AggregatorInterface { - private const PREFIX = 'cal_agg_scope'; + private const string PREFIX = 'cal_agg_scope'; public function __construct( private ScopeRepository $scopeRepository, private TranslatableStringHelper $translatableStringHelper ) {} + #[\Override] public function addRole(): ?string { return null; } + #[\Override] public function alterQuery(QueryBuilder $qb, $data) { $p = self::PREFIX; @@ -60,18 +62,22 @@ final readonly class ScopeAggregator implements AggregatorInterface ->addGroupBy("{$p}_select"); } + #[\Override] public function applyOn(): string { return Declarations::CALENDAR_TYPE; } + #[\Override] public function buildForm(FormBuilderInterface $builder) {} + #[\Override] public function getFormDefaultData(): array { return []; } + #[\Override] public function getLabels($key, array $values, $data): \Closure { return function ($value): string { @@ -93,11 +99,13 @@ final readonly class ScopeAggregator implements AggregatorInterface }; } + #[\Override] public function getQueryKeys($data): array { return [self::PREFIX.'_select']; } + #[\Override] public function getTitle(): string { return 'export.aggregator.calendar.agent_scope.Group calendars by agent scope'; diff --git a/src/Bundle/ChillCalendarBundle/Export/Aggregator/UrgencyAggregator.php b/src/Bundle/ChillCalendarBundle/Export/Aggregator/UrgencyAggregator.php index e9213d3cb..f45a5f5a1 100644 --- a/src/Bundle/ChillCalendarBundle/Export/Aggregator/UrgencyAggregator.php +++ b/src/Bundle/ChillCalendarBundle/Export/Aggregator/UrgencyAggregator.php @@ -28,32 +28,38 @@ class UrgencyAggregator implements AggregatorInterface { public function __construct(private readonly TranslatorInterface $translator) {} + #[\Override] public function addRole(): ?string { return null; } + #[\Override] public function alterQuery(QueryBuilder $qb, $data) { $qb->addSelect('cal.urgent AS urgency_aggregator'); $qb->addGroupBy('urgency_aggregator'); } + #[\Override] public function applyOn(): string { return Declarations::CALENDAR_TYPE; } + #[\Override] public function buildForm(FormBuilderInterface $builder) { // no form } + #[\Override] public function getFormDefaultData(): array { return []; } + #[\Override] public function getLabels($key, array $values, $data): \Closure { return function ($value): string { @@ -69,11 +75,13 @@ class UrgencyAggregator implements AggregatorInterface }; } + #[\Override] public function getQueryKeys($data): array { return ['urgency_aggregator']; } + #[\Override] public function getTitle(): string { return 'Group calendars by urgency'; diff --git a/src/Bundle/ChillCalendarBundle/Export/Export/CountCalendars.php b/src/Bundle/ChillCalendarBundle/Export/Export/CountCalendars.php index f643eaa68..dffbbc4b2 100644 --- a/src/Bundle/ChillCalendarBundle/Export/Export/CountCalendars.php +++ b/src/Bundle/ChillCalendarBundle/Export/Export/CountCalendars.php @@ -29,31 +29,37 @@ class CountCalendars implements ExportInterface, GroupedExportInterface private readonly CalendarRepository $calendarRepository, ) {} + #[\Override] public function buildForm(FormBuilderInterface $builder) { // No form necessary } + #[\Override] public function getFormDefaultData(): array { return []; } + #[\Override] public function getAllowedFormattersTypes(): array { return [FormatterInterface::TYPE_TABULAR]; } + #[\Override] public function getDescription(): string { return 'Count calendars by various parameters.'; } + #[\Override] public function getGroup(): string { return 'Exports of calendar'; } + #[\Override] public function getLabels($key, array $values, $data) { if ('export_result' !== $key) { @@ -66,21 +72,25 @@ class CountCalendars implements ExportInterface, GroupedExportInterface return static fn ($value) => $labels[$value]; } + #[\Override] public function getQueryKeys($data): array { return ['export_result']; } + #[\Override] public function getResult($query, $data) { return $query->getQuery()->getResult(AbstractQuery::HYDRATE_SCALAR); } + #[\Override] public function getTitle(): string { return 'Count calendars'; } + #[\Override] public function getType(): string { return Declarations::CALENDAR_TYPE; @@ -89,6 +99,7 @@ class CountCalendars implements ExportInterface, GroupedExportInterface /** * Initiate the query. */ + #[\Override] public function initiateQuery(array $requiredModifiers, array $acl, array $data = []): QueryBuilder { $centers = array_map(static fn ($el) => $el['center'], $acl); @@ -103,12 +114,14 @@ class CountCalendars implements ExportInterface, GroupedExportInterface return $qb; } + #[\Override] public function requiredRole(): string { // which role should we give here? return PersonVoter::STATS; } + #[\Override] public function supportsModifiers(): array { return [ diff --git a/src/Bundle/ChillCalendarBundle/Export/Export/StatCalendarAvgDuration.php b/src/Bundle/ChillCalendarBundle/Export/Export/StatCalendarAvgDuration.php index b69185a17..46efd8c7e 100644 --- a/src/Bundle/ChillCalendarBundle/Export/Export/StatCalendarAvgDuration.php +++ b/src/Bundle/ChillCalendarBundle/Export/Export/StatCalendarAvgDuration.php @@ -26,31 +26,37 @@ class StatCalendarAvgDuration implements ExportInterface, GroupedExportInterface { public function __construct(private readonly CalendarRepository $calendarRepository) {} + #[\Override] public function buildForm(FormBuilderInterface $builder): void { // no form needed } + #[\Override] public function getFormDefaultData(): array { return []; } + #[\Override] public function getAllowedFormattersTypes(): array { return [FormatterInterface::TYPE_TABULAR]; } + #[\Override] public function getDescription(): string { return 'Get the average of calendar duration according to various filters'; } + #[\Override] public function getGroup(): string { return 'Exports of calendar'; } + #[\Override] public function getLabels($key, array $values, $data) { if ('export_result' !== $key) { @@ -63,26 +69,31 @@ class StatCalendarAvgDuration implements ExportInterface, GroupedExportInterface return static fn ($value) => $labels[$value]; } + #[\Override] public function getQueryKeys($data): array { return ['export_result']; } + #[\Override] public function getResult($query, $data) { return $query->getQuery()->getResult(Query::HYDRATE_SCALAR); } + #[\Override] public function getTitle(): string { return 'Average calendar duration'; } + #[\Override] public function getType(): string { return Declarations::CALENDAR_TYPE; } + #[\Override] public function initiateQuery(array $requiredModifiers, array $acl, array $data = []): QueryBuilder { $qb = $this->calendarRepository->createQueryBuilder('cal'); @@ -95,11 +106,13 @@ class StatCalendarAvgDuration implements ExportInterface, GroupedExportInterface return $qb; } + #[\Override] public function requiredRole(): string { return AccompanyingPeriodVoter::STATS; } + #[\Override] public function supportsModifiers(): array { return [ diff --git a/src/Bundle/ChillCalendarBundle/Export/Export/StatCalendarSumDuration.php b/src/Bundle/ChillCalendarBundle/Export/Export/StatCalendarSumDuration.php index 8ea23014c..b1e80c3c8 100644 --- a/src/Bundle/ChillCalendarBundle/Export/Export/StatCalendarSumDuration.php +++ b/src/Bundle/ChillCalendarBundle/Export/Export/StatCalendarSumDuration.php @@ -26,31 +26,37 @@ class StatCalendarSumDuration implements ExportInterface, GroupedExportInterface { public function __construct(private readonly CalendarRepository $calendarRepository) {} + #[\Override] public function buildForm(FormBuilderInterface $builder): void { // no form needed } + #[\Override] public function getFormDefaultData(): array { return []; } + #[\Override] public function getAllowedFormattersTypes(): array { return [FormatterInterface::TYPE_TABULAR]; } + #[\Override] public function getDescription(): string { return 'Get the sum of calendar durations according to various filters'; } + #[\Override] public function getGroup(): string { return 'Exports of calendar'; } + #[\Override] public function getLabels($key, array $values, $data) { if ('export_result' !== $key) { @@ -63,26 +69,31 @@ class StatCalendarSumDuration implements ExportInterface, GroupedExportInterface return static fn ($value) => $labels[$value]; } + #[\Override] public function getQueryKeys($data): array { return ['export_result']; } + #[\Override] public function getResult($query, $data) { return $query->getQuery()->getResult(Query::HYDRATE_SCALAR); } + #[\Override] public function getTitle(): string { return 'Sum of calendar durations'; } + #[\Override] public function getType(): string { return Declarations::CALENDAR_TYPE; } + #[\Override] public function initiateQuery(array $requiredModifiers, array $acl, array $data = []): QueryBuilder { $qb = $this->calendarRepository->createQueryBuilder('cal'); @@ -95,11 +106,13 @@ class StatCalendarSumDuration implements ExportInterface, GroupedExportInterface return $qb; } + #[\Override] public function requiredRole(): string { return AccompanyingPeriodVoter::STATS; } + #[\Override] public function supportsModifiers(): array { return [ diff --git a/src/Bundle/ChillCalendarBundle/Export/Filter/AgentFilter.php b/src/Bundle/ChillCalendarBundle/Export/Filter/AgentFilter.php index c16c148fc..9ed523c21 100644 --- a/src/Bundle/ChillCalendarBundle/Export/Filter/AgentFilter.php +++ b/src/Bundle/ChillCalendarBundle/Export/Filter/AgentFilter.php @@ -24,11 +24,13 @@ class AgentFilter implements FilterInterface { public function __construct(private readonly UserRender $userRender) {} + #[\Override] public function addRole(): ?string { return null; } + #[\Override] public function alterQuery(QueryBuilder $qb, $data) { $where = $qb->getDQLPart('where'); @@ -44,11 +46,13 @@ class AgentFilter implements FilterInterface $qb->setParameter('agents', $data['accepted_agents']); } + #[\Override] public function applyOn(): string { return Declarations::CALENDAR_TYPE; } + #[\Override] public function buildForm(FormBuilderInterface $builder) { $builder->add('accepted_agents', EntityType::class, [ @@ -59,11 +63,13 @@ class AgentFilter implements FilterInterface ]); } + #[\Override] public function getFormDefaultData(): array { return []; } + #[\Override] public function describeAction($data, $format = 'string'): array { $users = []; @@ -78,6 +84,7 @@ class AgentFilter implements FilterInterface ], ]; } + #[\Override] public function getTitle(): string { return 'Filter calendars by agent'; diff --git a/src/Bundle/ChillCalendarBundle/Export/Filter/BetweenDatesFilter.php b/src/Bundle/ChillCalendarBundle/Export/Filter/BetweenDatesFilter.php index 90a004388..72a6581c0 100644 --- a/src/Bundle/ChillCalendarBundle/Export/Filter/BetweenDatesFilter.php +++ b/src/Bundle/ChillCalendarBundle/Export/Filter/BetweenDatesFilter.php @@ -23,11 +23,13 @@ class BetweenDatesFilter implements FilterInterface { public function __construct(private readonly RollingDateConverterInterface $rollingDateConverter) {} + #[\Override] public function addRole(): ?string { return null; } + #[\Override] public function alterQuery(QueryBuilder $qb, $data) { $clause = $qb->expr()->andX( @@ -47,11 +49,13 @@ class BetweenDatesFilter implements FilterInterface ); } + #[\Override] public function applyOn(): string { return Declarations::CALENDAR_TYPE; } + #[\Override] public function buildForm(FormBuilderInterface $builder) { $builder @@ -59,11 +63,13 @@ class BetweenDatesFilter implements FilterInterface ->add('date_to', PickRollingDateType::class, []); } + #[\Override] public function getFormDefaultData(): array { return ['date_from' => new RollingDate(RollingDate::T_YEAR_PREVIOUS_START), 'date_to' => new RollingDate(RollingDate::T_TODAY)]; } + #[\Override] public function describeAction($data, $format = 'string'): array { return ['Filtered by calendars between %dateFrom% and %dateTo%', [ @@ -72,6 +78,7 @@ class BetweenDatesFilter implements FilterInterface ]]; } + #[\Override] public function getTitle(): string { return 'Filter calendars between certain dates'; diff --git a/src/Bundle/ChillCalendarBundle/Export/Filter/CalendarRangeFilter.php b/src/Bundle/ChillCalendarBundle/Export/Filter/CalendarRangeFilter.php index 63149509f..de37ba13d 100644 --- a/src/Bundle/ChillCalendarBundle/Export/Filter/CalendarRangeFilter.php +++ b/src/Bundle/ChillCalendarBundle/Export/Filter/CalendarRangeFilter.php @@ -27,20 +27,22 @@ use Symfony\Contracts\Translation\TranslatorInterface; class CalendarRangeFilter implements FilterInterface { - private const CHOICES = [ + private const array CHOICES = [ 'Not made within a calendar range' => 'true', 'Made within a calendar range' => 'false', ]; - private const DEFAULT_CHOICE = 'false'; + private const string DEFAULT_CHOICE = 'false'; public function __construct(private readonly TranslatorInterface $translator) {} + #[\Override] public function addRole(): ?string { return null; } + #[\Override] public function alterQuery(QueryBuilder $qb, $data) { if (null !== $data['hasCalendarRange']) { @@ -50,11 +52,13 @@ class CalendarRangeFilter implements FilterInterface } } + #[\Override] public function applyOn(): string { return Declarations::CALENDAR_TYPE; } + #[\Override] public function buildForm(FormBuilderInterface $builder) { $builder->add('hasCalendarRange', ChoiceType::class, [ @@ -66,11 +70,13 @@ class CalendarRangeFilter implements FilterInterface ]); } + #[\Override] public function getFormDefaultData(): array { return ['hasCalendarRange' => self::DEFAULT_CHOICE]; } + #[\Override] public function describeAction($data, $format = 'string'): array { $choice = ''; @@ -90,6 +96,7 @@ class CalendarRangeFilter implements FilterInterface ]; } + #[\Override] public function getTitle(): string { return 'Filter by calendar range'; diff --git a/src/Bundle/ChillCalendarBundle/Export/Filter/JobFilter.php b/src/Bundle/ChillCalendarBundle/Export/Filter/JobFilter.php index 5543a453b..f38c9b7fb 100644 --- a/src/Bundle/ChillCalendarBundle/Export/Filter/JobFilter.php +++ b/src/Bundle/ChillCalendarBundle/Export/Filter/JobFilter.php @@ -24,18 +24,20 @@ use Symfony\Component\Form\FormBuilderInterface; final readonly class JobFilter implements FilterInterface { - private const PREFIX = 'cal_filter_job'; + private const string PREFIX = 'cal_filter_job'; public function __construct( private TranslatableStringHelper $translatableStringHelper, private UserJobRepositoryInterface $userJobRepository ) {} + #[\Override] public function addRole(): ?string { return null; } + #[\Override] public function alterQuery(QueryBuilder $qb, $data) { $p = self::PREFIX; @@ -65,11 +67,13 @@ final readonly class JobFilter implements FilterInterface ); } + #[\Override] public function applyOn(): string { return Declarations::CALENDAR_TYPE; } + #[\Override] public function buildForm(FormBuilderInterface $builder) { $builder @@ -84,6 +88,7 @@ final readonly class JobFilter implements FilterInterface ]); } + #[\Override] public function describeAction($data, $format = 'string'): array { $userJobs = []; @@ -99,6 +104,7 @@ final readonly class JobFilter implements FilterInterface ]]; } + #[\Override] public function getFormDefaultData(): array { return [ @@ -106,6 +112,7 @@ final readonly class JobFilter implements FilterInterface ]; } + #[\Override] public function getTitle(): string { return 'export.filter.calendar.agent_job.Filter calendars by agent job'; diff --git a/src/Bundle/ChillCalendarBundle/Export/Filter/ScopeFilter.php b/src/Bundle/ChillCalendarBundle/Export/Filter/ScopeFilter.php index 2f46db892..ae031b2b7 100644 --- a/src/Bundle/ChillCalendarBundle/Export/Filter/ScopeFilter.php +++ b/src/Bundle/ChillCalendarBundle/Export/Filter/ScopeFilter.php @@ -25,7 +25,7 @@ use Symfony\Contracts\Translation\TranslatorInterface; class ScopeFilter implements FilterInterface { - private const PREFIX = 'cal_filter_scope'; + private const string PREFIX = 'cal_filter_scope'; public function __construct( protected TranslatorInterface $translator, @@ -33,11 +33,13 @@ class ScopeFilter implements FilterInterface private readonly ScopeRepositoryInterface $scopeRepository ) {} + #[\Override] public function addRole(): ?string { return null; } + #[\Override] public function alterQuery(QueryBuilder $qb, $data) { $p = self::PREFIX; @@ -67,11 +69,13 @@ class ScopeFilter implements FilterInterface ); } + #[\Override] public function applyOn(): string { return Declarations::CALENDAR_TYPE; } + #[\Override] public function buildForm(FormBuilderInterface $builder) { $builder @@ -86,6 +90,7 @@ class ScopeFilter implements FilterInterface ]); } + #[\Override] public function describeAction($data, $format = 'string'): array { $scopes = []; @@ -101,6 +106,7 @@ class ScopeFilter implements FilterInterface ]]; } + #[\Override] public function getFormDefaultData(): array { return [ @@ -108,6 +114,7 @@ class ScopeFilter implements FilterInterface ]; } + #[\Override] public function getTitle(): string { return 'export.filter.calendar.agent_scope.Filter calendars by agent scope'; diff --git a/src/Bundle/ChillCalendarBundle/Form/CalendarDocCreateType.php b/src/Bundle/ChillCalendarBundle/Form/CalendarDocCreateType.php index b77886097..99164afe3 100644 --- a/src/Bundle/ChillCalendarBundle/Form/CalendarDocCreateType.php +++ b/src/Bundle/ChillCalendarBundle/Form/CalendarDocCreateType.php @@ -20,6 +20,7 @@ use Symfony\Component\OptionsResolver\OptionsResolver; class CalendarDocCreateType extends AbstractType { + #[\Override] public function buildForm(FormBuilderInterface $builder, array $options) { $builder @@ -33,6 +34,7 @@ class CalendarDocCreateType extends AbstractType ]); } + #[\Override] public function configureOptions(OptionsResolver $resolver) { $resolver->setDefaults([ diff --git a/src/Bundle/ChillCalendarBundle/Form/CalendarDocEditType.php b/src/Bundle/ChillCalendarBundle/Form/CalendarDocEditType.php index 224a74f01..507f7c61d 100644 --- a/src/Bundle/ChillCalendarBundle/Form/CalendarDocEditType.php +++ b/src/Bundle/ChillCalendarBundle/Form/CalendarDocEditType.php @@ -19,6 +19,7 @@ use Symfony\Component\OptionsResolver\OptionsResolver; class CalendarDocEditType extends AbstractType { + #[\Override] public function buildForm(FormBuilderInterface $builder, array $options) { $builder @@ -28,6 +29,7 @@ class CalendarDocEditType extends AbstractType ]); } + #[\Override] public function configureOptions(OptionsResolver $resolver) { $resolver->setDefaults([ diff --git a/src/Bundle/ChillCalendarBundle/Form/CalendarType.php b/src/Bundle/ChillCalendarBundle/Form/CalendarType.php index eec0b3f9f..be4de10ba 100644 --- a/src/Bundle/ChillCalendarBundle/Form/CalendarType.php +++ b/src/Bundle/ChillCalendarBundle/Form/CalendarType.php @@ -40,6 +40,7 @@ class CalendarType extends AbstractType private readonly IdToCalendarRangeDataTransformer $calendarRangeDataTransformer ) {} + #[\Override] public function buildForm(FormBuilderInterface $builder, array $options) { $builder @@ -131,6 +132,7 @@ class CalendarType extends AbstractType ->addModelTransformer($this->idToLocationDataTransformer); } + #[\Override] public function configureOptions(OptionsResolver $resolver) { $resolver->setDefaults([ @@ -138,6 +140,7 @@ class CalendarType extends AbstractType ]); } + #[\Override] public function getBlockPrefix() { // as the js share some hardcoded items from activity, we have to rewrite block prefix diff --git a/src/Bundle/ChillCalendarBundle/Form/CancelReasonType.php b/src/Bundle/ChillCalendarBundle/Form/CancelReasonType.php index c0ac4ddb0..78abebe5e 100644 --- a/src/Bundle/ChillCalendarBundle/Form/CancelReasonType.php +++ b/src/Bundle/ChillCalendarBundle/Form/CancelReasonType.php @@ -21,6 +21,7 @@ use Symfony\Component\OptionsResolver\OptionsResolver; class CancelReasonType extends AbstractType { + #[\Override] public function buildForm(FormBuilderInterface $builder, array $options) { $builder @@ -31,6 +32,7 @@ class CancelReasonType extends AbstractType ->add('canceledBy', TextType::class); } + #[\Override] public function configureOptions(OptionsResolver $resolver) { $resolver diff --git a/src/Bundle/ChillCalendarBundle/Menu/AccompanyingCourseMenuBuilder.php b/src/Bundle/ChillCalendarBundle/Menu/AccompanyingCourseMenuBuilder.php index 6dd5bfa52..398f696d3 100644 --- a/src/Bundle/ChillCalendarBundle/Menu/AccompanyingCourseMenuBuilder.php +++ b/src/Bundle/ChillCalendarBundle/Menu/AccompanyingCourseMenuBuilder.php @@ -21,6 +21,7 @@ class AccompanyingCourseMenuBuilder implements LocalMenuBuilderInterface { public function __construct(private readonly Security $security, protected TranslatorInterface $translator) {} + #[\Override] public function buildMenu($menuId, MenuItem $menu, array $parameters) { $period = $parameters['accompanyingCourse']; @@ -35,6 +36,7 @@ class AccompanyingCourseMenuBuilder implements LocalMenuBuilderInterface } } + #[\Override] public static function getMenuIds(): array { return ['accompanyingCourse']; diff --git a/src/Bundle/ChillCalendarBundle/Menu/AccompanyingCourseQuickMenuBuilder.php b/src/Bundle/ChillCalendarBundle/Menu/AccompanyingCourseQuickMenuBuilder.php index cfca6813f..fa6afaa37 100644 --- a/src/Bundle/ChillCalendarBundle/Menu/AccompanyingCourseQuickMenuBuilder.php +++ b/src/Bundle/ChillCalendarBundle/Menu/AccompanyingCourseQuickMenuBuilder.php @@ -20,11 +20,13 @@ final readonly class AccompanyingCourseQuickMenuBuilder implements LocalMenuBuil { public function __construct(private Security $security) {} + #[\Override] public static function getMenuIds(): array { return ['accompanying_course_quick_menu']; } + #[\Override] public function buildMenu($menuId, MenuItem $menu, array $parameters) { /** @var \Chill\PersonBundle\Entity\AccompanyingPeriod $accompanyingCourse */ diff --git a/src/Bundle/ChillCalendarBundle/Menu/AdminMenuBuilder.php b/src/Bundle/ChillCalendarBundle/Menu/AdminMenuBuilder.php index 1658029a7..860e32e94 100644 --- a/src/Bundle/ChillCalendarBundle/Menu/AdminMenuBuilder.php +++ b/src/Bundle/ChillCalendarBundle/Menu/AdminMenuBuilder.php @@ -27,6 +27,7 @@ class AdminMenuBuilder implements LocalMenuBuilderInterface $this->authorizationChecker = $authorizationChecker; } + #[\Override] public function buildMenu($menuId, MenuItem $menu, array $parameters) { if (!$this->authorizationChecker->isGranted('ROLE_ADMIN')) { @@ -46,6 +47,7 @@ class AdminMenuBuilder implements LocalMenuBuilderInterface ])->setExtras(['order' => 6010]); } + #[\Override] public static function getMenuIds(): array { return ['admin_section', 'admin_calendar']; diff --git a/src/Bundle/ChillCalendarBundle/Menu/PersonMenuBuilder.php b/src/Bundle/ChillCalendarBundle/Menu/PersonMenuBuilder.php index e92a72bb7..4f7217d0b 100644 --- a/src/Bundle/ChillCalendarBundle/Menu/PersonMenuBuilder.php +++ b/src/Bundle/ChillCalendarBundle/Menu/PersonMenuBuilder.php @@ -21,6 +21,7 @@ class PersonMenuBuilder implements LocalMenuBuilderInterface { public function __construct(private readonly Security $security, protected TranslatorInterface $translator) {} + #[\Override] public function buildMenu($menuId, MenuItem $menu, array $parameters) { $person = $parameters['person']; @@ -35,6 +36,7 @@ class PersonMenuBuilder implements LocalMenuBuilderInterface } } + #[\Override] public static function getMenuIds(): array { return ['person']; diff --git a/src/Bundle/ChillCalendarBundle/Menu/UserMenuBuilder.php b/src/Bundle/ChillCalendarBundle/Menu/UserMenuBuilder.php index 3a062f7b8..031338749 100644 --- a/src/Bundle/ChillCalendarBundle/Menu/UserMenuBuilder.php +++ b/src/Bundle/ChillCalendarBundle/Menu/UserMenuBuilder.php @@ -20,6 +20,7 @@ class UserMenuBuilder implements LocalMenuBuilderInterface { public function __construct(private readonly Security $security, public TranslatorInterface $translator) {} + #[\Override] public function buildMenu($menuId, MenuItem $menu, array $parameters) { if ($this->security->isGranted('ROLE_USER')) { @@ -33,6 +34,7 @@ class UserMenuBuilder implements LocalMenuBuilderInterface } } + #[\Override] public static function getMenuIds(): array { return ['user']; diff --git a/src/Bundle/ChillCalendarBundle/Messenger/Message/CalendarMessage.php b/src/Bundle/ChillCalendarBundle/Messenger/Message/CalendarMessage.php index 9bcd81c67..e631f0f69 100644 --- a/src/Bundle/ChillCalendarBundle/Messenger/Message/CalendarMessage.php +++ b/src/Bundle/ChillCalendarBundle/Messenger/Message/CalendarMessage.php @@ -24,9 +24,9 @@ use Chill\MainBundle\Entity\User; class CalendarMessage { - final public const CALENDAR_PERSIST = 'CHILL_CALENDAR_CALENDAR_PERSIST'; + final public const string CALENDAR_PERSIST = 'CHILL_CALENDAR_CALENDAR_PERSIST'; - final public const CALENDAR_UPDATE = 'CHILL_CALENDAR_CALENDAR_UPDATE'; + final public const string CALENDAR_UPDATE = 'CHILL_CALENDAR_CALENDAR_UPDATE'; private readonly int $byUserId; diff --git a/src/Bundle/ChillCalendarBundle/Messenger/Message/CalendarRangeMessage.php b/src/Bundle/ChillCalendarBundle/Messenger/Message/CalendarRangeMessage.php index 13669a0a2..da8a7747b 100644 --- a/src/Bundle/ChillCalendarBundle/Messenger/Message/CalendarRangeMessage.php +++ b/src/Bundle/ChillCalendarBundle/Messenger/Message/CalendarRangeMessage.php @@ -23,9 +23,9 @@ use Chill\MainBundle\Entity\User; class CalendarRangeMessage { - final public const CALENDAR_RANGE_PERSIST = 'CHILL_CALENDAR_CALENDAR_RANGE_PERSIST'; + final public const string CALENDAR_RANGE_PERSIST = 'CHILL_CALENDAR_CALENDAR_RANGE_PERSIST'; - final public const CALENDAR_RANGE_UPDATE = 'CHILL_CALENDAR_CALENDAR_RANGE_UPDATE'; + final public const string CALENDAR_RANGE_UPDATE = 'CHILL_CALENDAR_CALENDAR_RANGE_UPDATE'; private ?int $byUserId = null; diff --git a/src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/MSGraph/MSUserAbsenceReader.php b/src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/MSGraph/MSUserAbsenceReader.php index 4acc9de46..be1db660a 100644 --- a/src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/MSGraph/MSUserAbsenceReader.php +++ b/src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/MSGraph/MSUserAbsenceReader.php @@ -32,6 +32,7 @@ final readonly class MSUserAbsenceReader implements MSUserAbsenceReaderInterface /** * @throw UserAbsenceSyncException when the data cannot be reached or is not valid from microsoft */ + #[\Override] public function isUserAbsent(User $user): ?bool { $id = $this->mapCalendarToUser->getUserId($user); diff --git a/src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/MSGraph/MachineHttpClient.php b/src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/MSGraph/MachineHttpClient.php index f84d04120..949652746 100644 --- a/src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/MSGraph/MachineHttpClient.php +++ b/src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/MSGraph/MachineHttpClient.php @@ -38,6 +38,7 @@ class MachineHttpClient implements HttpClientInterface * @throws \Symfony\Contracts\HttpClient\Exception\TransportExceptionInterface * @throws \LogicException if method is not supported */ + #[\Override] public function request(string $method, string $url, array $options = []): ResponseInterface { $options['headers'] = array_merge( @@ -68,6 +69,7 @@ class MachineHttpClient implements HttpClientInterface return $this->decoratedClient->request($method, $url, $options); } + #[\Override] public function stream($responses, ?float $timeout = null): ResponseStreamInterface { return $this->decoratedClient->stream($responses, $timeout); diff --git a/src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/MSGraph/MachineTokenStorage.php b/src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/MSGraph/MachineTokenStorage.php index f2a0fc096..2aa7443b4 100644 --- a/src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/MSGraph/MachineTokenStorage.php +++ b/src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/MSGraph/MachineTokenStorage.php @@ -25,7 +25,7 @@ use TheNetworg\OAuth2\Client\Token\AccessToken; class MachineTokenStorage { - private const KEY = 'msgraph_access_token'; + private const string KEY = 'msgraph_access_token'; private ?AccessTokenInterface $accessToken = null; diff --git a/src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/MSGraph/MapCalendarToUser.php b/src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/MSGraph/MapCalendarToUser.php index 5577adc2e..024a258ca 100644 --- a/src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/MSGraph/MapCalendarToUser.php +++ b/src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/MSGraph/MapCalendarToUser.php @@ -28,13 +28,13 @@ use Symfony\Contracts\HttpClient\HttpClientInterface; */ class MapCalendarToUser { - final public const EXPIRATION_SUBSCRIPTION_EVENT = 'subscription_events_expiration'; + final public const string EXPIRATION_SUBSCRIPTION_EVENT = 'subscription_events_expiration'; - final public const ID_SUBSCRIPTION_EVENT = 'subscription_events_id'; + final public const string ID_SUBSCRIPTION_EVENT = 'subscription_events_id'; - final public const METADATA_KEY = 'msgraph'; + final public const string METADATA_KEY = 'msgraph'; - final public const SECRET_SUBSCRIPTION_EVENT = 'subscription_events_secret'; + final public const string SECRET_SUBSCRIPTION_EVENT = 'subscription_events_secret'; public function __construct(private readonly HttpClientInterface $machineHttpClient, private readonly LoggerInterface $logger) {} diff --git a/src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/MSGraph/OnBehalfOfUserTokenStorage.php b/src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/MSGraph/OnBehalfOfUserTokenStorage.php index d8fff109b..61d074c43 100644 --- a/src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/MSGraph/OnBehalfOfUserTokenStorage.php +++ b/src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/MSGraph/OnBehalfOfUserTokenStorage.php @@ -27,7 +27,7 @@ use TheNetworg\OAuth2\Client\Token\AccessToken; */ class OnBehalfOfUserTokenStorage { - final public const MS_GRAPH_ACCESS_TOKEN = 'msgraph_access_token'; + final public const string MS_GRAPH_ACCESS_TOKEN = 'msgraph_access_token'; 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 84797f6f1..1b35e13df 100644 --- a/src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/MSGraph/RemoteEventConverter.php +++ b/src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/MSGraph/RemoteEventConverter.php @@ -37,16 +37,16 @@ class RemoteEventConverter * valid when the remote string contains also a timezone, like in * lastModifiedDate. */ - final public const REMOTE_DATETIMEZONE_FORMAT = 'Y-m-d\TH:i:s.u?P'; + final public const string REMOTE_DATETIMEZONE_FORMAT = 'Y-m-d\TH:i:s.u?P'; /** * Same as above, but sometimes the date is expressed with only 6 milliseconds. */ - final public const REMOTE_DATETIMEZONE_FORMAT_ALT = 'Y-m-d\TH:i:s.uP'; + final public const string 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 string 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 const string REMOTE_DATETIME_WITHOUT_TZ_FORMAT = 'Y-m-d\TH:i:s.u?'; private readonly \DateTimeZone $defaultDateTimeZone; diff --git a/src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/MSGraphRemoteCalendarConnector.php b/src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/MSGraphRemoteCalendarConnector.php index a85de21d3..404bb0c8b 100644 --- a/src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/MSGraphRemoteCalendarConnector.php +++ b/src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/MSGraphRemoteCalendarConnector.php @@ -43,6 +43,7 @@ class MSGraphRemoteCalendarConnector implements RemoteCalendarConnectorInterface 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) {} + #[\Override] public function countEventsForUser(User $user, \DateTimeImmutable $startDate, \DateTimeImmutable $endDate): int { $userId = $this->mapCalendarToUser->getUserId($user); @@ -80,12 +81,14 @@ class MSGraphRemoteCalendarConnector implements RemoteCalendarConnectorInterface return $data['@odata.count']; } + #[\Override] public function getMakeReadyResponse(string $returnPath): Response { return new RedirectResponse($this->urlGenerator ->generate('chill_calendar_remote_connect_azure', ['returnPath' => $returnPath])); } + #[\Override] public function isReady(): bool { $user = $this->security->getUser(); @@ -118,6 +121,7 @@ class MSGraphRemoteCalendarConnector implements RemoteCalendarConnectorInterface * @throws \Symfony\Contracts\HttpClient\Exception\ServerExceptionInterface * @throws \Symfony\Contracts\HttpClient\Exception\TransportExceptionInterface */ + #[\Override] public function listEventsForUser(User $user, \DateTimeImmutable $startDate, \DateTimeImmutable $endDate, ?int $offset = 0, ?int $limit = 50): array { $userId = $this->mapCalendarToUser->getUserId($user); @@ -169,6 +173,7 @@ class MSGraphRemoteCalendarConnector implements RemoteCalendarConnectorInterface } } + #[\Override] public function removeCalendar(string $remoteId, array $remoteAttributes, User $user, ?CalendarRange $associatedCalendarRange = null): void { if ('' === $remoteId) { @@ -182,6 +187,7 @@ class MSGraphRemoteCalendarConnector implements RemoteCalendarConnectorInterface } } + #[\Override] public function removeCalendarRange(string $remoteId, array $remoteAttributes, User $user): void { if ('' === $remoteId) { @@ -191,6 +197,7 @@ class MSGraphRemoteCalendarConnector implements RemoteCalendarConnectorInterface $this->removeEvent($remoteId, $user); } + #[\Override] public function syncCalendar(Calendar $calendar, string $action, ?CalendarRange $previousCalendarRange, ?User $previousMainUser, ?array $oldInvites, ?array $newInvites): void { /* @@ -247,6 +254,7 @@ class MSGraphRemoteCalendarConnector implements RemoteCalendarConnectorInterface } } + #[\Override] public function syncCalendarRange(CalendarRange $calendarRange): void { if ($calendarRange->hasRemoteId()) { @@ -256,6 +264,7 @@ class MSGraphRemoteCalendarConnector implements RemoteCalendarConnectorInterface } } + #[\Override] public function syncInvite(Invite $invite): void { if ('' === $remoteId = $invite->getCalendar()->getRemoteId()) { diff --git a/src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/NullRemoteCalendarConnector.php b/src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/NullRemoteCalendarConnector.php index 61e57631d..744fd2cf1 100644 --- a/src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/NullRemoteCalendarConnector.php +++ b/src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/NullRemoteCalendarConnector.php @@ -26,33 +26,42 @@ use Symfony\Component\HttpFoundation\Response; class NullRemoteCalendarConnector implements RemoteCalendarConnectorInterface { + #[\Override] public function countEventsForUser(User $user, \DateTimeImmutable $startDate, \DateTimeImmutable $endDate): int { return 0; } + #[\Override] public function getMakeReadyResponse(string $returnPath): Response { throw new \LogicException('As this connector is always ready, this method should not be called'); } + #[\Override] public function isReady(): bool { return true; } + #[\Override] public function listEventsForUser(User $user, \DateTimeImmutable $startDate, \DateTimeImmutable $endDate, ?int $offset = 0, ?int $limit = 50): array { return []; } + #[\Override] public function removeCalendar(string $remoteId, array $remoteAttributes, User $user, ?CalendarRange $associatedCalendarRange = null): void {} + #[\Override] public function removeCalendarRange(string $remoteId, array $remoteAttributes, User $user): void {} + #[\Override] public function syncCalendar(Calendar $calendar, string $action, ?CalendarRange $previousCalendarRange, ?User $previousMainUser, ?array $oldInvites, ?array $newInvites): void {} + #[\Override] public function syncCalendarRange(CalendarRange $calendarRange): void {} + #[\Override] public function syncInvite(Invite $invite): void {} } diff --git a/src/Bundle/ChillCalendarBundle/RemoteCalendar/DependencyInjection/RemoteCalendarCompilerPass.php b/src/Bundle/ChillCalendarBundle/RemoteCalendar/DependencyInjection/RemoteCalendarCompilerPass.php index c52fc2866..4ea1322e8 100644 --- a/src/Bundle/ChillCalendarBundle/RemoteCalendar/DependencyInjection/RemoteCalendarCompilerPass.php +++ b/src/Bundle/ChillCalendarBundle/RemoteCalendar/DependencyInjection/RemoteCalendarCompilerPass.php @@ -35,6 +35,7 @@ use TheNetworg\OAuth2\Client\Provider\Azure; class RemoteCalendarCompilerPass implements CompilerPassInterface { + #[\Override] public function process(ContainerBuilder $container) { $config = $container->getParameter('chill_calendar'); diff --git a/src/Bundle/ChillCalendarBundle/Repository/CalendarACLAwareRepository.php b/src/Bundle/ChillCalendarBundle/Repository/CalendarACLAwareRepository.php index 8f661a881..8edcdc047 100644 --- a/src/Bundle/ChillCalendarBundle/Repository/CalendarACLAwareRepository.php +++ b/src/Bundle/ChillCalendarBundle/Repository/CalendarACLAwareRepository.php @@ -124,6 +124,7 @@ class CalendarACLAwareRepository implements CalendarACLAwareRepositoryInterface return $qb; } + #[\Override] public function countByAccompanyingPeriod(AccompanyingPeriod $period, ?\DateTimeImmutable $startDate, ?\DateTimeImmutable $endDate): int { $qb = $this->buildQueryByAccompanyingPeriod($period, $startDate, $endDate)->select('count(c)'); @@ -131,6 +132,7 @@ class CalendarACLAwareRepository implements CalendarACLAwareRepositoryInterface return $qb->getQuery()->getSingleScalarResult(); } + #[\Override] public function countByPerson(Person $person, ?\DateTimeImmutable $startDate, ?\DateTimeImmutable $endDate): int { return $this->buildQueryByPerson($person, $startDate, $endDate) @@ -139,6 +141,7 @@ class CalendarACLAwareRepository implements CalendarACLAwareRepositoryInterface ->getSingleScalarResult(); } + #[\Override] public function countIgnoredByAccompanyingPeriod(AccompanyingPeriod $period, ?\DateTimeImmutable $startDate, ?\DateTimeImmutable $endDate): int { $qb = $this->buildQueryByAccompanyingPeriodIgnoredByDates($period, $startDate, $endDate)->select('count(c)'); @@ -146,6 +149,7 @@ class CalendarACLAwareRepository implements CalendarACLAwareRepositoryInterface return $qb->getQuery()->getSingleScalarResult(); } + #[\Override] public function countIgnoredByPerson(Person $person, ?\DateTimeImmutable $startDate, ?\DateTimeImmutable $endDate): int { return $this->buildQueryByPersonIgnoredByDates($person, $startDate, $endDate) @@ -157,6 +161,7 @@ class CalendarACLAwareRepository implements CalendarACLAwareRepositoryInterface /** * @return array|Calendar[] */ + #[\Override] public function findByAccompanyingPeriod(AccompanyingPeriod $period, ?\DateTimeImmutable $startDate, ?\DateTimeImmutable $endDate, ?array $orderBy = [], ?int $offset = null, ?int $limit = null): array { $qb = $this->buildQueryByAccompanyingPeriod($period, $startDate, $endDate)->select('c'); @@ -176,6 +181,7 @@ class CalendarACLAwareRepository implements CalendarACLAwareRepositoryInterface return $qb->getQuery()->getResult(); } + #[\Override] public function findByPerson(Person $person, ?\DateTimeImmutable $startDate, ?\DateTimeImmutable $endDate, ?array $orderBy = [], ?int $offset = null, ?int $limit = null): array { $qb = $this->buildQueryByPerson($person, $startDate, $endDate) diff --git a/src/Bundle/ChillCalendarBundle/Repository/CalendarDocRepository.php b/src/Bundle/ChillCalendarBundle/Repository/CalendarDocRepository.php index dd593bf3c..22e85f0cc 100644 --- a/src/Bundle/ChillCalendarBundle/Repository/CalendarDocRepository.php +++ b/src/Bundle/ChillCalendarBundle/Repository/CalendarDocRepository.php @@ -25,26 +25,31 @@ class CalendarDocRepository implements ObjectRepository, CalendarDocRepositoryIn $this->repository = $entityManager->getRepository($this->getClassName()); } + #[\Override] public function find($id): ?CalendarDoc { return $this->repository->find($id); } + #[\Override] public function findAll(): array { return $this->repository->findAll(); } + #[\Override] public function findBy(array $criteria, ?array $orderBy = null, ?int $limit = null, ?int $offset = null) { return $this->repository->findBy($criteria, $orderBy, $limit, $offset); } + #[\Override] public function findOneBy(array $criteria): ?CalendarDoc { return $this->findOneBy($criteria); } + #[\Override] public function getClassName() { return CalendarDoc::class; diff --git a/src/Bundle/ChillCalendarBundle/Repository/CalendarRangeRepository.php b/src/Bundle/ChillCalendarBundle/Repository/CalendarRangeRepository.php index d6e1ac8a5..82ec5533d 100644 --- a/src/Bundle/ChillCalendarBundle/Repository/CalendarRangeRepository.php +++ b/src/Bundle/ChillCalendarBundle/Repository/CalendarRangeRepository.php @@ -36,6 +36,7 @@ class CalendarRangeRepository implements ObjectRepository ->getQuery()->getSingleScalarResult(); } + #[\Override] public function find($id): ?CalendarRange { return $this->repository->find($id); @@ -44,6 +45,7 @@ class CalendarRangeRepository implements ObjectRepository /** * @return array|CalendarRange[] */ + #[\Override] public function findAll(): array { return $this->repository->findAll(); @@ -52,6 +54,7 @@ class CalendarRangeRepository implements ObjectRepository /** * @return array|CalendarRange[] */ + #[\Override] public function findBy(array $criteria, ?array $orderBy = null, ?int $limit = null, ?int $offset = null) { return $this->repository->findBy($criteria, $orderBy, $limit, $offset); @@ -80,6 +83,7 @@ class CalendarRangeRepository implements ObjectRepository return $qb->getQuery()->getResult(); } + #[\Override] public function findOneBy(array $criteria): ?CalendarRange { return $this->repository->findOneBy($criteria); @@ -136,6 +140,7 @@ class CalendarRangeRepository implements ObjectRepository return $results; } + #[\Override] public function getClassName(): string { return CalendarRange::class; diff --git a/src/Bundle/ChillCalendarBundle/Repository/CalendarRepository.php b/src/Bundle/ChillCalendarBundle/Repository/CalendarRepository.php index 3121854e5..73bec524a 100644 --- a/src/Bundle/ChillCalendarBundle/Repository/CalendarRepository.php +++ b/src/Bundle/ChillCalendarBundle/Repository/CalendarRepository.php @@ -51,6 +51,7 @@ class CalendarRepository implements ObjectRepository return $this->repository->createQueryBuilder($alias, $indexBy); } + #[\Override] public function find($id): ?Calendar { return $this->repository->find($id); @@ -59,6 +60,7 @@ class CalendarRepository implements ObjectRepository /** * @return array|Calendar[] */ + #[\Override] public function findAll(): array { return $this->repository->findAll(); @@ -67,6 +69,7 @@ class CalendarRepository implements ObjectRepository /** * @return array|Calendar[] */ + #[\Override] public function findBy(array $criteria, ?array $orderBy = null, ?int $limit = null, ?int $offset = null): array { return $this->repository->findBy($criteria, $orderBy, $limit, $offset); @@ -120,6 +123,7 @@ class CalendarRepository implements ObjectRepository return $qb->getQuery()->getResult(); } + #[\Override] public function findOneBy(array $criteria): ?Calendar { return $this->repository->findOneBy($criteria); @@ -176,6 +180,7 @@ class CalendarRepository implements ObjectRepository return $results; } + #[\Override] public function getClassName() { return Calendar::class; diff --git a/src/Bundle/ChillCalendarBundle/Repository/InviteRepository.php b/src/Bundle/ChillCalendarBundle/Repository/InviteRepository.php index 8778330f8..d7fd07494 100644 --- a/src/Bundle/ChillCalendarBundle/Repository/InviteRepository.php +++ b/src/Bundle/ChillCalendarBundle/Repository/InviteRepository.php @@ -25,6 +25,7 @@ class InviteRepository implements ObjectRepository $this->entityRepository = $em->getRepository(Invite::class); } + #[\Override] public function find($id): ?Invite { return $this->entityRepository->find($id); @@ -33,6 +34,7 @@ class InviteRepository implements ObjectRepository /** * @return array|Invite[] */ + #[\Override] public function findAll(): array { return $this->entityRepository->findAll(); @@ -41,16 +43,19 @@ class InviteRepository implements ObjectRepository /** * @return array|Invite[] */ + #[\Override] public function findBy(array $criteria, ?array $orderBy = null, ?int $limit = null, ?int $offset = null) { return $this->entityRepository->findBy($criteria, $orderBy, $limit, $offset); } + #[\Override] public function findOneBy(array $criteria): ?Invite { return $this->entityRepository->findOneBy($criteria); } + #[\Override] public function getClassName(): string { return Invite::class; diff --git a/src/Bundle/ChillCalendarBundle/Security/Voter/CalendarDocVoter.php b/src/Bundle/ChillCalendarBundle/Security/Voter/CalendarDocVoter.php index c87acfe2d..a69729471 100644 --- a/src/Bundle/ChillCalendarBundle/Security/Voter/CalendarDocVoter.php +++ b/src/Bundle/ChillCalendarBundle/Security/Voter/CalendarDocVoter.php @@ -20,22 +20,24 @@ use Symfony\Component\Security\Core\Security; class CalendarDocVoter extends Voter { - final public const EDIT = 'CHILL_CALENDAR_DOC_EDIT'; + final public const string EDIT = 'CHILL_CALENDAR_DOC_EDIT'; - final public const SEE = 'CHILL_CALENDAR_DOC_SEE'; + final public const string SEE = 'CHILL_CALENDAR_DOC_SEE'; - private const ALL = [ + private const array ALL = [ 'CHILL_CALENDAR_DOC_EDIT', 'CHILL_CALENDAR_DOC_SEE', ]; public function __construct(private readonly Security $security) {} + #[\Override] protected function supports($attribute, $subject): bool { return \in_array($attribute, self::ALL, true) && ($subject instanceof CalendarDoc || $subject instanceof Calendar); } + #[\Override] protected function voteOnAttribute($attribute, $subject, TokenInterface $token): bool { if ($subject instanceof Calendar) { diff --git a/src/Bundle/ChillCalendarBundle/Security/Voter/CalendarVoter.php b/src/Bundle/ChillCalendarBundle/Security/Voter/CalendarVoter.php index b7aae9349..408e96abd 100644 --- a/src/Bundle/ChillCalendarBundle/Security/Voter/CalendarVoter.php +++ b/src/Bundle/ChillCalendarBundle/Security/Voter/CalendarVoter.php @@ -31,13 +31,13 @@ use Symfony\Component\Security\Core\Security; class CalendarVoter extends AbstractChillVoter implements ProvideRoleHierarchyInterface { - final public const CREATE = 'CHILL_CALENDAR_CALENDAR_CREATE'; + final public const string CREATE = 'CHILL_CALENDAR_CALENDAR_CREATE'; - final public const DELETE = 'CHILL_CALENDAR_CALENDAR_DELETE'; + final public const string DELETE = 'CHILL_CALENDAR_CALENDAR_DELETE'; - final public const EDIT = 'CHILL_CALENDAR_CALENDAR_EDIT'; + final public const string EDIT = 'CHILL_CALENDAR_CALENDAR_EDIT'; - final public const SEE = 'CHILL_CALENDAR_CALENDAR_SEE'; + final public const string SEE = 'CHILL_CALENDAR_CALENDAR_SEE'; private readonly VoterHelperInterface $voterHelper; @@ -53,6 +53,7 @@ class CalendarVoter extends AbstractChillVoter implements ProvideRoleHierarchyIn ->build(); } + #[\Override] public function getRoles(): array { return [ @@ -63,11 +64,13 @@ class CalendarVoter extends AbstractChillVoter implements ProvideRoleHierarchyIn ]; } + #[\Override] public function getRolesWithHierarchy(): array { return ['Calendar' => $this->getRoles()]; } + #[\Override] public function getRolesWithoutScope(): array { return [ @@ -78,11 +81,13 @@ class CalendarVoter extends AbstractChillVoter implements ProvideRoleHierarchyIn ]; } + #[\Override] protected function supports($attribute, $subject): bool { return $this->voterHelper->supports($attribute, $subject); } + #[\Override] protected function voteOnAttribute($attribute, $subject, TokenInterface $token): bool { if ($subject instanceof AccompanyingPeriod) { diff --git a/src/Bundle/ChillCalendarBundle/Security/Voter/InviteVoter.php b/src/Bundle/ChillCalendarBundle/Security/Voter/InviteVoter.php index 72aa806e6..1876e9bf7 100644 --- a/src/Bundle/ChillCalendarBundle/Security/Voter/InviteVoter.php +++ b/src/Bundle/ChillCalendarBundle/Security/Voter/InviteVoter.php @@ -24,8 +24,9 @@ use Symfony\Component\Security\Core\Authorization\Voter\Voter; class InviteVoter extends Voter { - final public const ANSWER = 'CHILL_CALENDAR_INVITE_ANSWER'; + final public const string ANSWER = 'CHILL_CALENDAR_INVITE_ANSWER'; + #[\Override] protected function supports($attribute, $subject): bool { return $subject instanceof Invite && self::ANSWER === $attribute; @@ -35,6 +36,7 @@ class InviteVoter extends Voter * @param string $attribute * @param Invite $subject */ + #[\Override] protected function voteOnAttribute($attribute, $subject, TokenInterface $token): bool { return $token->getUser() === $subject->getUser(); diff --git a/src/Bundle/ChillCalendarBundle/Service/DocGenerator/CalendarContext.php b/src/Bundle/ChillCalendarBundle/Service/DocGenerator/CalendarContext.php index 087f5ea86..70d7af989 100644 --- a/src/Bundle/ChillCalendarBundle/Service/DocGenerator/CalendarContext.php +++ b/src/Bundle/ChillCalendarBundle/Service/DocGenerator/CalendarContext.php @@ -43,6 +43,7 @@ final readonly class CalendarContext implements CalendarContextInterface private TranslatableStringHelperInterface $translatableStringHelper ) {} + #[\Override] public function adminFormReverseTransform(array $data): array { return array_merge( @@ -57,11 +58,13 @@ final readonly class CalendarContext implements CalendarContextInterface ); } + #[\Override] public function adminFormTransform(array $data): array { return $data; } + #[\Override] public function buildAdminForm(FormBuilderInterface $builder): void { $builder @@ -87,6 +90,7 @@ final readonly class CalendarContext implements CalendarContextInterface ]); } + #[\Override] public function buildPublicForm(FormBuilderInterface $builder, DocGeneratorTemplate $template, $entity): void { $options = $this->getOptions($template); @@ -121,6 +125,7 @@ final readonly class CalendarContext implements CalendarContextInterface } } + #[\Override] public function getData(DocGeneratorTemplate $template, mixed $entity, array $contextGenerationData = []): array { $options = $this->getOptions($template); @@ -152,16 +157,19 @@ final readonly class CalendarContext implements CalendarContextInterface return $data; } + #[\Override] public function getDescription(): string { return 'docgen.calendar.A base context for generating document on calendar'; } + #[\Override] public function getEntityClass(): string { return Calendar::class; } + #[\Override] public function getFormData(DocGeneratorTemplate $template, $entity): array { $options = $this->getOptions($template); @@ -186,26 +194,31 @@ final readonly class CalendarContext implements CalendarContextInterface return $data; } + #[\Override] public static function getKey(): string { return self::class; } + #[\Override] public function getName(): string { return 'docgen.calendar.Base context for calendar'; } + #[\Override] public function hasAdminForm(): bool { return true; } + #[\Override] public function hasPublicForm(DocGeneratorTemplate $template, $entity): bool { return true; } + #[\Override] public function contextGenerationDataNormalize(DocGeneratorTemplate $template, $entity, array $data): array { $normalized = []; @@ -220,6 +233,7 @@ final readonly class CalendarContext implements CalendarContextInterface return $normalized; } + #[\Override] public function contextGenerationDataDenormalize(DocGeneratorTemplate $template, $entity, array $data): array { $denormalized = []; @@ -242,6 +256,7 @@ final readonly class CalendarContext implements CalendarContextInterface return $denormalized; } + #[\Override] public function storeGenerated(DocGeneratorTemplate $template, StoredObject $storedObject, object $entity, array $contextGenerationData): void { $options = $this->getOptions($template); diff --git a/src/Bundle/ChillCalendarBundle/Service/GenericDoc/Providers/AccompanyingPeriodCalendarGenericDocProvider.php b/src/Bundle/ChillCalendarBundle/Service/GenericDoc/Providers/AccompanyingPeriodCalendarGenericDocProvider.php index 7d4544b37..bd48b4a61 100644 --- a/src/Bundle/ChillCalendarBundle/Service/GenericDoc/Providers/AccompanyingPeriodCalendarGenericDocProvider.php +++ b/src/Bundle/ChillCalendarBundle/Service/GenericDoc/Providers/AccompanyingPeriodCalendarGenericDocProvider.php @@ -33,7 +33,7 @@ use Symfony\Component\Security\Core\Security; */ final readonly class AccompanyingPeriodCalendarGenericDocProvider implements GenericDocForAccompanyingPeriodProviderInterface, GenericDocForPersonProviderInterface { - public const KEY = 'accompanying_period_calendar_document'; + public const string KEY = 'accompanying_period_calendar_document'; public function __construct( private Security $security, @@ -43,6 +43,7 @@ final readonly class AccompanyingPeriodCalendarGenericDocProvider implements Gen /** * @throws MappingException */ + #[\Override] public function buildFetchQueryForAccompanyingPeriod(AccompanyingPeriod $accompanyingPeriod, ?\DateTimeImmutable $startDate = null, ?\DateTimeImmutable $endDate = null, ?string $content = null, ?string $origin = null): FetchQueryInterface { $classMetadata = $this->em->getClassMetadata(CalendarDoc::class); @@ -85,11 +86,13 @@ final readonly class AccompanyingPeriodCalendarGenericDocProvider implements Gen return $query; } + #[\Override] public function isAllowedForAccompanyingPeriod(AccompanyingPeriod $accompanyingPeriod): bool { return $this->security->isGranted(CalendarVoter::SEE, $accompanyingPeriod); } + #[\Override] public function buildFetchQueryForPerson(Person $person, ?\DateTimeImmutable $startDate = null, ?\DateTimeImmutable $endDate = null, ?string $content = null, ?string $origin = null): FetchQueryInterface { $classMetadata = $this->em->getClassMetadata(CalendarDoc::class); @@ -151,6 +154,7 @@ final readonly class AccompanyingPeriodCalendarGenericDocProvider implements Gen return $this->addWhereClausesToQuery($query, $startDate, $endDate, $content); } + #[\Override] public function isAllowedForPerson(Person $person): bool { // check that the person is allowed to see an accompanying period. If yes, the diff --git a/src/Bundle/ChillCalendarBundle/Service/GenericDoc/Providers/PersonCalendarGenericDocProvider.php b/src/Bundle/ChillCalendarBundle/Service/GenericDoc/Providers/PersonCalendarGenericDocProvider.php index 5ca52744b..165f82cb2 100644 --- a/src/Bundle/ChillCalendarBundle/Service/GenericDoc/Providers/PersonCalendarGenericDocProvider.php +++ b/src/Bundle/ChillCalendarBundle/Service/GenericDoc/Providers/PersonCalendarGenericDocProvider.php @@ -32,7 +32,7 @@ use Symfony\Component\Security\Core\Security; */ final readonly class PersonCalendarGenericDocProvider implements GenericDocForPersonProviderInterface { - public const KEY = 'person_calendar_document'; + public const string KEY = 'person_calendar_document'; public function __construct( private Security $security, @@ -73,6 +73,7 @@ final readonly class PersonCalendarGenericDocProvider implements GenericDocForPe /** * @throws MappingException */ + #[\Override] public function buildFetchQueryForPerson(Person $person, ?\DateTimeImmutable $startDate = null, ?\DateTimeImmutable $endDate = null, ?string $content = null, ?string $origin = null): FetchQueryInterface { $classMetadata = $this->em->getClassMetadata(CalendarDoc::class); @@ -112,6 +113,7 @@ final readonly class PersonCalendarGenericDocProvider implements GenericDocForPe return $this->addWhereClausesToQuery($query, $startDate, $endDate, $content); } + #[\Override] public function isAllowedForPerson(Person $person): bool { return $this->security->isGranted(CalendarVoter::SEE, $person); diff --git a/src/Bundle/ChillCalendarBundle/Service/GenericDoc/Renderers/AccompanyingPeriodCalendarGenericDocRenderer.php b/src/Bundle/ChillCalendarBundle/Service/GenericDoc/Renderers/AccompanyingPeriodCalendarGenericDocRenderer.php index 123afc164..a7c276f04 100644 --- a/src/Bundle/ChillCalendarBundle/Service/GenericDoc/Renderers/AccompanyingPeriodCalendarGenericDocRenderer.php +++ b/src/Bundle/ChillCalendarBundle/Service/GenericDoc/Renderers/AccompanyingPeriodCalendarGenericDocRenderer.php @@ -21,16 +21,19 @@ final readonly class AccompanyingPeriodCalendarGenericDocRenderer implements Gen { public function __construct(private CalendarDocRepository $repository) {} + #[\Override] public function supports(GenericDocDTO $genericDocDTO, $options = []): bool { return AccompanyingPeriodCalendarGenericDocProvider::KEY === $genericDocDTO->key || PersonCalendarGenericDocProvider::KEY === $genericDocDTO->key; } + #[\Override] public function getTemplate(GenericDocDTO $genericDocDTO, $options = []): string { return '@ChillCalendar/GenericDoc/calendar_document.html.twig'; } + #[\Override] public function getTemplateData(GenericDocDTO $genericDocDTO, $options = []): array { return [ diff --git a/src/Bundle/ChillCalendarBundle/Service/ShortMessageNotification/DefaultRangeGenerator.php b/src/Bundle/ChillCalendarBundle/Service/ShortMessageNotification/DefaultRangeGenerator.php index b79118cf0..c08ce62c6 100644 --- a/src/Bundle/ChillCalendarBundle/Service/ShortMessageNotification/DefaultRangeGenerator.php +++ b/src/Bundle/ChillCalendarBundle/Service/ShortMessageNotification/DefaultRangeGenerator.php @@ -29,6 +29,7 @@ use Monolog\DateTimeImmutable; */ class DefaultRangeGenerator implements RangeGeneratorInterface { + #[\Override] public function generateRange(\DateTimeImmutable $date): ?array { $onMidnight = DateTimeImmutable::createFromFormat('Y-m-d H:i:s', $date->format('Y-m-d').' 00:00:00'); diff --git a/src/Bundle/ChillCalendarBundle/Service/ShortMessageNotification/DefaultShortMessageForCalendarBuilder.php b/src/Bundle/ChillCalendarBundle/Service/ShortMessageNotification/DefaultShortMessageForCalendarBuilder.php index 880c9950f..ab3bb0969 100644 --- a/src/Bundle/ChillCalendarBundle/Service/ShortMessageNotification/DefaultShortMessageForCalendarBuilder.php +++ b/src/Bundle/ChillCalendarBundle/Service/ShortMessageNotification/DefaultShortMessageForCalendarBuilder.php @@ -25,6 +25,7 @@ class DefaultShortMessageForCalendarBuilder implements ShortMessageForCalendarBu { public function __construct(private readonly \Twig\Environment $engine) {} + #[\Override] public function buildMessageForCalendar(Calendar $calendar): array { if (true !== $calendar->getSendSMS()) { diff --git a/src/Bundle/ChillCalendarBundle/Tests/Controller/CalendarControllerTest.php b/src/Bundle/ChillCalendarBundle/Tests/Controller/CalendarControllerTest.php index ef2597367..0a0f17138 100644 --- a/src/Bundle/ChillCalendarBundle/Tests/Controller/CalendarControllerTest.php +++ b/src/Bundle/ChillCalendarBundle/Tests/Controller/CalendarControllerTest.php @@ -32,11 +32,13 @@ final class CalendarControllerTest extends WebTestCase /** * Setup before each test method (see phpunit doc). */ + #[\Override] protected function setUp(): void { $this->client = $this->getClientAuthenticated(); } + #[\Override] protected function tearDown(): void { self::ensureKernelShutdown(); diff --git a/src/Bundle/ChillCalendarBundle/Tests/Controller/RemoteCalendarMSGraphSyncControllerTest.php b/src/Bundle/ChillCalendarBundle/Tests/Controller/RemoteCalendarMSGraphSyncControllerTest.php index 67214814d..cc2da8c62 100644 --- a/src/Bundle/ChillCalendarBundle/Tests/Controller/RemoteCalendarMSGraphSyncControllerTest.php +++ b/src/Bundle/ChillCalendarBundle/Tests/Controller/RemoteCalendarMSGraphSyncControllerTest.php @@ -28,7 +28,7 @@ use Symfony\Component\Messenger\Transport\InMemoryTransport; */ final class RemoteCalendarMSGraphSyncControllerTest extends WebTestCase { - private const SAMPLE_BODY = <<<'JSON' + private const string SAMPLE_BODY = <<<'JSON' { "value": [ { @@ -49,6 +49,7 @@ final class RemoteCalendarMSGraphSyncControllerTest extends WebTestCase } JSON; + #[\Override] protected function tearDown(): void { self::ensureKernelShutdown(); diff --git a/src/Bundle/ChillCalendarBundle/Tests/Export/Aggregator/AgentAggregatorTest.php b/src/Bundle/ChillCalendarBundle/Tests/Export/Aggregator/AgentAggregatorTest.php index 0a69efa83..e41a6d40f 100644 --- a/src/Bundle/ChillCalendarBundle/Tests/Export/Aggregator/AgentAggregatorTest.php +++ b/src/Bundle/ChillCalendarBundle/Tests/Export/Aggregator/AgentAggregatorTest.php @@ -32,6 +32,7 @@ final class AgentAggregatorTest extends AbstractAggregatorTest { private AgentAggregator $aggregator; + #[\Override] protected function setUp(): void { self::bootKernel(); @@ -39,11 +40,13 @@ final class AgentAggregatorTest extends AbstractAggregatorTest $this->aggregator = self::getContainer()->get('chill.calendar.export.agent_aggregator'); } + #[\Override] public function getAggregator() { return $this->aggregator; } + #[\Override] public static function getFormData(): array { return [ @@ -51,6 +54,7 @@ final class AgentAggregatorTest extends AbstractAggregatorTest ]; } + #[\Override] public static function getQueryBuilders(): iterable { self::bootKernel(); diff --git a/src/Bundle/ChillCalendarBundle/Tests/Export/Aggregator/CancelReasonAggregatorTest.php b/src/Bundle/ChillCalendarBundle/Tests/Export/Aggregator/CancelReasonAggregatorTest.php index 8257425ce..25b3bb6b1 100644 --- a/src/Bundle/ChillCalendarBundle/Tests/Export/Aggregator/CancelReasonAggregatorTest.php +++ b/src/Bundle/ChillCalendarBundle/Tests/Export/Aggregator/CancelReasonAggregatorTest.php @@ -32,6 +32,7 @@ final class CancelReasonAggregatorTest extends AbstractAggregatorTest { private CancelReasonAggregator $aggregator; + #[\Override] protected function setUp(): void { self::bootKernel(); @@ -39,11 +40,13 @@ final class CancelReasonAggregatorTest extends AbstractAggregatorTest $this->aggregator = self::getContainer()->get('chill.calendar.export.cancel_reason_aggregator'); } + #[\Override] public function getAggregator() { return $this->aggregator; } + #[\Override] public static function getFormData(): array { return [ @@ -51,6 +54,7 @@ final class CancelReasonAggregatorTest extends AbstractAggregatorTest ]; } + #[\Override] public static function getQueryBuilders(): iterable { self::bootKernel(); diff --git a/src/Bundle/ChillCalendarBundle/Tests/Export/Aggregator/JobAggregatorTest.php b/src/Bundle/ChillCalendarBundle/Tests/Export/Aggregator/JobAggregatorTest.php index 064939cf0..5ab2ffd35 100644 --- a/src/Bundle/ChillCalendarBundle/Tests/Export/Aggregator/JobAggregatorTest.php +++ b/src/Bundle/ChillCalendarBundle/Tests/Export/Aggregator/JobAggregatorTest.php @@ -32,6 +32,7 @@ final class JobAggregatorTest extends AbstractAggregatorTest { private JobAggregator $aggregator; + #[\Override] protected function setUp(): void { self::bootKernel(); @@ -39,11 +40,13 @@ final class JobAggregatorTest extends AbstractAggregatorTest $this->aggregator = self::getContainer()->get('chill.calendar.export.job_aggregator'); } + #[\Override] public function getAggregator() { return $this->aggregator; } + #[\Override] public static function getFormData(): array { return [ @@ -51,6 +54,7 @@ final class JobAggregatorTest extends AbstractAggregatorTest ]; } + #[\Override] public static function getQueryBuilders(): iterable { self::bootKernel(); diff --git a/src/Bundle/ChillCalendarBundle/Tests/Export/Aggregator/LocationAggregatorTest.php b/src/Bundle/ChillCalendarBundle/Tests/Export/Aggregator/LocationAggregatorTest.php index 7fa4045fd..ee995ea2b 100644 --- a/src/Bundle/ChillCalendarBundle/Tests/Export/Aggregator/LocationAggregatorTest.php +++ b/src/Bundle/ChillCalendarBundle/Tests/Export/Aggregator/LocationAggregatorTest.php @@ -32,6 +32,7 @@ final class LocationAggregatorTest extends AbstractAggregatorTest { private LocationAggregator $aggregator; + #[\Override] protected function setUp(): void { self::bootKernel(); @@ -39,11 +40,13 @@ final class LocationAggregatorTest extends AbstractAggregatorTest $this->aggregator = self::getContainer()->get('chill.calendar.export.location_aggregator'); } + #[\Override] public function getAggregator() { return $this->aggregator; } + #[\Override] public static function getFormData(): array { return [ @@ -51,6 +54,7 @@ final class LocationAggregatorTest extends AbstractAggregatorTest ]; } + #[\Override] public static function getQueryBuilders(): iterable { self::bootKernel(); diff --git a/src/Bundle/ChillCalendarBundle/Tests/Export/Aggregator/LocationTypeAggregatorTest.php b/src/Bundle/ChillCalendarBundle/Tests/Export/Aggregator/LocationTypeAggregatorTest.php index 341b1df9d..ce2235df8 100644 --- a/src/Bundle/ChillCalendarBundle/Tests/Export/Aggregator/LocationTypeAggregatorTest.php +++ b/src/Bundle/ChillCalendarBundle/Tests/Export/Aggregator/LocationTypeAggregatorTest.php @@ -32,6 +32,7 @@ final class LocationTypeAggregatorTest extends AbstractAggregatorTest { private LocationTypeAggregator $aggregator; + #[\Override] protected function setUp(): void { self::bootKernel(); @@ -39,11 +40,13 @@ final class LocationTypeAggregatorTest extends AbstractAggregatorTest $this->aggregator = self::getContainer()->get('chill.calendar.export.location_type_aggregator'); } + #[\Override] public function getAggregator() { return $this->aggregator; } + #[\Override] public static function getFormData(): array { return [ @@ -51,6 +54,7 @@ final class LocationTypeAggregatorTest extends AbstractAggregatorTest ]; } + #[\Override] public static function getQueryBuilders(): iterable { self::bootKernel(); diff --git a/src/Bundle/ChillCalendarBundle/Tests/Export/Aggregator/MonthYearAggregatorTest.php b/src/Bundle/ChillCalendarBundle/Tests/Export/Aggregator/MonthYearAggregatorTest.php index 6a3cd36b3..08744f813 100644 --- a/src/Bundle/ChillCalendarBundle/Tests/Export/Aggregator/MonthYearAggregatorTest.php +++ b/src/Bundle/ChillCalendarBundle/Tests/Export/Aggregator/MonthYearAggregatorTest.php @@ -32,6 +32,7 @@ final class MonthYearAggregatorTest extends AbstractAggregatorTest { private MonthYearAggregator $aggregator; + #[\Override] protected function setUp(): void { self::bootKernel(); @@ -39,11 +40,13 @@ final class MonthYearAggregatorTest extends AbstractAggregatorTest $this->aggregator = self::getContainer()->get('chill.calendar.export.month_aggregator'); } + #[\Override] public function getAggregator() { return $this->aggregator; } + #[\Override] public static function getFormData(): array { return [ @@ -51,6 +54,7 @@ final class MonthYearAggregatorTest extends AbstractAggregatorTest ]; } + #[\Override] public static function getQueryBuilders(): iterable { self::bootKernel(); diff --git a/src/Bundle/ChillCalendarBundle/Tests/Export/Aggregator/ScopeAggregatorTest.php b/src/Bundle/ChillCalendarBundle/Tests/Export/Aggregator/ScopeAggregatorTest.php index 05d68356d..1b275e790 100644 --- a/src/Bundle/ChillCalendarBundle/Tests/Export/Aggregator/ScopeAggregatorTest.php +++ b/src/Bundle/ChillCalendarBundle/Tests/Export/Aggregator/ScopeAggregatorTest.php @@ -32,6 +32,7 @@ final class ScopeAggregatorTest extends AbstractAggregatorTest { private ScopeAggregator $aggregator; + #[\Override] protected function setUp(): void { self::bootKernel(); @@ -39,11 +40,13 @@ final class ScopeAggregatorTest extends AbstractAggregatorTest $this->aggregator = self::getContainer()->get('chill.calendar.export.scope_aggregator'); } + #[\Override] public function getAggregator() { return $this->aggregator; } + #[\Override] public static function getFormData(): array { return [ @@ -51,6 +54,7 @@ final class ScopeAggregatorTest extends AbstractAggregatorTest ]; } + #[\Override] public static function getQueryBuilders(): iterable { self::bootKernel(); diff --git a/src/Bundle/ChillCalendarBundle/Tests/Export/Filter/AgentFilterTest.php b/src/Bundle/ChillCalendarBundle/Tests/Export/Filter/AgentFilterTest.php index 755526b6d..a55389fda 100644 --- a/src/Bundle/ChillCalendarBundle/Tests/Export/Filter/AgentFilterTest.php +++ b/src/Bundle/ChillCalendarBundle/Tests/Export/Filter/AgentFilterTest.php @@ -33,6 +33,7 @@ final class AgentFilterTest extends AbstractFilterTest { private AgentFilter $filter; + #[\Override] protected function setUp(): void { self::bootKernel(); @@ -46,11 +47,13 @@ final class AgentFilterTest extends AbstractFilterTest $this->filter = self::getContainer()->get('chill.calendar.export.agent_filter'); } + #[\Override] public function getFilter() { return $this->filter; } + #[\Override] public static function getFormData(): array { self::bootKernel(); @@ -71,6 +74,7 @@ final class AgentFilterTest extends AbstractFilterTest return $data; } + #[\Override] public static function getQueryBuilders(): iterable { self::bootKernel(); diff --git a/src/Bundle/ChillCalendarBundle/Tests/Export/Filter/BetweenDatesFilterTest.php b/src/Bundle/ChillCalendarBundle/Tests/Export/Filter/BetweenDatesFilterTest.php index ab09c2672..63fdfa97d 100644 --- a/src/Bundle/ChillCalendarBundle/Tests/Export/Filter/BetweenDatesFilterTest.php +++ b/src/Bundle/ChillCalendarBundle/Tests/Export/Filter/BetweenDatesFilterTest.php @@ -33,6 +33,7 @@ final class BetweenDatesFilterTest extends AbstractFilterTest { private BetweenDatesFilter $filter; + #[\Override] protected function setUp(): void { self::bootKernel(); @@ -46,11 +47,13 @@ final class BetweenDatesFilterTest extends AbstractFilterTest $this->filter = self::getContainer()->get('chill.calendar.export.between_dates_filter'); } + #[\Override] public function getFilter() { return $this->filter; } + #[\Override] public static function getFormData(): array { return [ @@ -61,6 +64,7 @@ final class BetweenDatesFilterTest extends AbstractFilterTest ]; } + #[\Override] public static function getQueryBuilders(): iterable { self::bootKernel(); diff --git a/src/Bundle/ChillCalendarBundle/Tests/Export/Filter/JobFilterTest.php b/src/Bundle/ChillCalendarBundle/Tests/Export/Filter/JobFilterTest.php index 758b8ccbc..12cda32e3 100644 --- a/src/Bundle/ChillCalendarBundle/Tests/Export/Filter/JobFilterTest.php +++ b/src/Bundle/ChillCalendarBundle/Tests/Export/Filter/JobFilterTest.php @@ -34,6 +34,7 @@ final class JobFilterTest extends AbstractFilterTest { private JobFilter $filter; + #[\Override] protected function setUp(): void { self::bootKernel(); @@ -47,11 +48,13 @@ final class JobFilterTest extends AbstractFilterTest $this->filter = self::getContainer()->get('chill.calendar.export.job_filter'); } + #[\Override] public function getFilter() { return $this->filter; } + #[\Override] public static function getFormData(): array { self::bootKernel(); @@ -70,6 +73,7 @@ final class JobFilterTest extends AbstractFilterTest ]; } + #[\Override] public static function getQueryBuilders(): iterable { self::bootKernel(); diff --git a/src/Bundle/ChillCalendarBundle/Tests/Export/Filter/ScopeFilterTest.php b/src/Bundle/ChillCalendarBundle/Tests/Export/Filter/ScopeFilterTest.php index 623f8f3f0..6c103fbf4 100644 --- a/src/Bundle/ChillCalendarBundle/Tests/Export/Filter/ScopeFilterTest.php +++ b/src/Bundle/ChillCalendarBundle/Tests/Export/Filter/ScopeFilterTest.php @@ -34,6 +34,7 @@ final class ScopeFilterTest extends AbstractFilterTest { private ScopeFilter $filter; + #[\Override] protected function setUp(): void { self::bootKernel(); @@ -47,11 +48,13 @@ final class ScopeFilterTest extends AbstractFilterTest $this->filter = self::getContainer()->get('chill.calendar.export.scope_filter'); } + #[\Override] public function getFilter() { return $this->filter; } + #[\Override] public static function getFormData(): array { self::bootKernel(); @@ -70,6 +73,7 @@ final class ScopeFilterTest extends AbstractFilterTest ]; } + #[\Override] public static function getQueryBuilders(): iterable { self::bootKernel(); diff --git a/src/Bundle/ChillCalendarBundle/Tests/Form/CalendarTypeTest.php b/src/Bundle/ChillCalendarBundle/Tests/Form/CalendarTypeTest.php index 0d1202b67..7bf117322 100644 --- a/src/Bundle/ChillCalendarBundle/Tests/Form/CalendarTypeTest.php +++ b/src/Bundle/ChillCalendarBundle/Tests/Form/CalendarTypeTest.php @@ -67,6 +67,7 @@ final class CalendarTypeTest extends TypeTestCase private TokenStorageInterface $tokenStorage; + #[\Override] protected function setUp(): void { $this->personsToIdDataTransformer = $this->buildMultiToIdDataTransformer(PersonsToIdDataTransformer::class, Person::class); @@ -121,6 +122,7 @@ final class CalendarTypeTest extends TypeTestCase $this->assertContains(3, $calendar->getUsers()->map(static fn (User $u) => $u->getId())); } + #[\Override] protected function getExtensions() { $calendarType = new CalendarType( diff --git a/src/Bundle/ChillCalendarBundle/Tests/RemoteCalendar/Connector/MSGraph/CalendarRangeSyncerTest.php b/src/Bundle/ChillCalendarBundle/Tests/RemoteCalendar/Connector/MSGraph/CalendarRangeSyncerTest.php index 9f7df0c2c..ef339c1d7 100644 --- a/src/Bundle/ChillCalendarBundle/Tests/RemoteCalendar/Connector/MSGraph/CalendarRangeSyncerTest.php +++ b/src/Bundle/ChillCalendarBundle/Tests/RemoteCalendar/Connector/MSGraph/CalendarRangeSyncerTest.php @@ -39,7 +39,7 @@ final class CalendarRangeSyncerTest extends TestCase { use ProphecyTrait; - private const NOTIF_DELETE = <<<'JSON' + private const string NOTIF_DELETE = <<<'JSON' { "value": [ { @@ -60,7 +60,7 @@ final class CalendarRangeSyncerTest extends TestCase } JSON; - private const NOTIF_UPDATE = <<<'JSON' + private const string NOTIF_UPDATE = <<<'JSON' { "value": [ { @@ -81,7 +81,7 @@ final class CalendarRangeSyncerTest extends TestCase } JSON; - private const REMOTE_CALENDAR_RANGE = <<<'JSON' + private const string REMOTE_CALENDAR_RANGE = <<<'JSON' { "@odata.context": "https://graph.microsoft.com/v1.0/$metadata#users('4feb0ae3-7ffb-48dd-891e-c86b2cdeefd4')/events/$entity", "@odata.etag": "W/\"B3bmsWoxX06b9JHIZPptRQAAJcswFA==\"", diff --git a/src/Bundle/ChillCalendarBundle/Tests/RemoteCalendar/Connector/MSGraph/CalendarSyncerTest.php b/src/Bundle/ChillCalendarBundle/Tests/RemoteCalendar/Connector/MSGraph/CalendarSyncerTest.php index e6196aead..80c479f85 100644 --- a/src/Bundle/ChillCalendarBundle/Tests/RemoteCalendar/Connector/MSGraph/CalendarSyncerTest.php +++ b/src/Bundle/ChillCalendarBundle/Tests/RemoteCalendar/Connector/MSGraph/CalendarSyncerTest.php @@ -40,7 +40,7 @@ final class CalendarSyncerTest extends TestCase { use ProphecyTrait; - private const NOTIF_DELETE = <<<'JSON' + private const string NOTIF_DELETE = <<<'JSON' { "value": [ { @@ -61,7 +61,7 @@ final class CalendarSyncerTest extends TestCase } JSON; - private const NOTIF_UPDATE = <<<'JSON' + private const string NOTIF_UPDATE = <<<'JSON' { "value": [ { @@ -82,7 +82,7 @@ final class CalendarSyncerTest extends TestCase } JSON; - private const REMOTE_CALENDAR_NO_ATTENDEES = <<<'JSON' + private const string REMOTE_CALENDAR_NO_ATTENDEES = <<<'JSON' { "@odata.context": "https://graph.microsoft.com/v1.0/$metadata#users('4feb0ae3-7ffb-48dd-891e-c86b2cdeefd4')/events/$entity", "@odata.etag": "W/\"B3bmsWoxX06b9JHIZPptRQAAJcswFA==\"", @@ -155,7 +155,7 @@ final class CalendarSyncerTest extends TestCase } JSON; - private const REMOTE_CALENDAR_NOT_ORGANIZER = <<<'JSON' + private const string REMOTE_CALENDAR_NOT_ORGANIZER = <<<'JSON' { "@odata.etag": "W/\"B3bmsWoxX06b9JHIZPptRQAAJcrv7A==\"", "id": "AAMkADM1MTdlMGIzLTZhZWUtNDQ0ZC05Y2M4LWViMjhmOWJlMDhhMQBGAAAAAAA5e3965gkBSLcU1p00sMSyBwAHduaxajFfTpv0kchk_m1FAAAAAAENAAAHduaxajFfTpv0kchk_m1FAAAl1BuqAAA=", @@ -250,7 +250,7 @@ final class CalendarSyncerTest extends TestCase } JSON; - private const REMOTE_CALENDAR_WITH_ATTENDEES = <<<'JSON' + private const string REMOTE_CALENDAR_WITH_ATTENDEES = <<<'JSON' { "@odata.etag": "W/\"B3bmsWoxX06b9JHIZPptRQAAJcrv7A==\"", "id": "AAMkADM1MTdlMGIzLTZhZWUtNDQ0ZC05Y2M4LWViMjhmOWJlMDhhMQBGAAAAAAA5e3965gkBSLcU1p00sMSyBwAHduaxajFfTpv0kchk_m1FAAAAAAENAAAHduaxajFfTpv0kchk_m1FAAAl1BuqAAA=", diff --git a/src/Bundle/ChillCalendarBundle/Tests/Repository/CalendarACLAwareRepositoryTest.php b/src/Bundle/ChillCalendarBundle/Tests/Repository/CalendarACLAwareRepositoryTest.php index 590ff8d8e..6d2464e74 100644 --- a/src/Bundle/ChillCalendarBundle/Tests/Repository/CalendarACLAwareRepositoryTest.php +++ b/src/Bundle/ChillCalendarBundle/Tests/Repository/CalendarACLAwareRepositoryTest.php @@ -32,6 +32,7 @@ final class CalendarACLAwareRepositoryTest extends KernelTestCase private EntityManagerInterface $entityManager; + #[\Override] protected function setUp(): void { self::bootKernel(); diff --git a/src/Bundle/ChillCalendarBundle/Tests/Serializer/Normalizer/CalendarNormalizerTest.php b/src/Bundle/ChillCalendarBundle/Tests/Serializer/Normalizer/CalendarNormalizerTest.php index 95fae8879..2774c1059 100644 --- a/src/Bundle/ChillCalendarBundle/Tests/Serializer/Normalizer/CalendarNormalizerTest.php +++ b/src/Bundle/ChillCalendarBundle/Tests/Serializer/Normalizer/CalendarNormalizerTest.php @@ -28,6 +28,7 @@ final class CalendarNormalizerTest extends KernelTestCase { private NormalizerInterface $normalizer; + #[\Override] protected function setUp(): void { self::bootKernel(); diff --git a/src/Bundle/ChillCalendarBundle/Tests/Service/ShortMessageNotification/BulkCalendarShortMessageSenderTest.php b/src/Bundle/ChillCalendarBundle/Tests/Service/ShortMessageNotification/BulkCalendarShortMessageSenderTest.php index 09c9ddf96..5d444f36a 100644 --- a/src/Bundle/ChillCalendarBundle/Tests/Service/ShortMessageNotification/BulkCalendarShortMessageSenderTest.php +++ b/src/Bundle/ChillCalendarBundle/Tests/Service/ShortMessageNotification/BulkCalendarShortMessageSenderTest.php @@ -50,12 +50,14 @@ final class BulkCalendarShortMessageSenderTest extends KernelTestCase private array $toDelete = []; + #[\Override] protected function setUp(): void { parent::setUp(); self::bootKernel(); } + #[\Override] protected function tearDown(): void { self::bootKernel(); diff --git a/src/Bundle/ChillCalendarBundle/Tests/Service/ShortMessageNotification/DefaultShortMessageForCalendarBuilderTest.php b/src/Bundle/ChillCalendarBundle/Tests/Service/ShortMessageNotification/DefaultShortMessageForCalendarBuilderTest.php index 222d3a451..722ea36e2 100644 --- a/src/Bundle/ChillCalendarBundle/Tests/Service/ShortMessageNotification/DefaultShortMessageForCalendarBuilderTest.php +++ b/src/Bundle/ChillCalendarBundle/Tests/Service/ShortMessageNotification/DefaultShortMessageForCalendarBuilderTest.php @@ -40,6 +40,7 @@ final class DefaultShortMessageForCalendarBuilderTest extends TestCase private PhoneNumberUtil $phoneNumberUtil; + #[\Override] protected function setUp(): void { $this->phoneNumberUtil = PhoneNumberUtil::getInstance(); diff --git a/src/Bundle/ChillCalendarBundle/migrations/Version20210715141731.php b/src/Bundle/ChillCalendarBundle/migrations/Version20210715141731.php index ee3fdaadd..174f412d2 100644 --- a/src/Bundle/ChillCalendarBundle/migrations/Version20210715141731.php +++ b/src/Bundle/ChillCalendarBundle/migrations/Version20210715141731.php @@ -19,6 +19,7 @@ use Doctrine\Migrations\AbstractMigration; */ final class Version20210715141731 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->addSql('ALTER TABLE chill_calendar.calendar_to_persons DROP CONSTRAINT FK_AEE94715A40A2C8'); @@ -43,11 +44,13 @@ final class Version20210715141731 extends AbstractMigration $this->addSql('DROP SCHEMA chill_calendar'); } + #[\Override] public function getDescription(): string { return 'Create the schema chill_calendar and several calendar entities'; } + #[\Override] public function up(Schema $schema): void { $this->addSql('CREATE SCHEMA chill_calendar'); diff --git a/src/Bundle/ChillCalendarBundle/migrations/Version20210723074557.php b/src/Bundle/ChillCalendarBundle/migrations/Version20210723074557.php index 6b2c8e2c5..50e5f4cc7 100644 --- a/src/Bundle/ChillCalendarBundle/migrations/Version20210723074557.php +++ b/src/Bundle/ChillCalendarBundle/migrations/Version20210723074557.php @@ -19,6 +19,7 @@ use Doctrine\Migrations\AbstractMigration; */ final class Version20210723074557 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->addSql('CREATE TABLE chill_calendar.calendar_to_non_professionals (calendar_id INT NOT NULL, person_id INT NOT NULL, PRIMARY KEY(calendar_id, person_id))'); @@ -30,11 +31,13 @@ final class Version20210723074557 extends AbstractMigration $this->addSql('ALTER TABLE chill_calendar.cancel_reason ALTER canceledBy DROP DEFAULT'); } + #[\Override] public function getDescription(): string { return 'Adapt calendar entities'; } + #[\Override] public function up(Schema $schema): void { $this->addSql('DROP TABLE chill_calendar.calendar_to_non_professionals'); diff --git a/src/Bundle/ChillCalendarBundle/migrations/Version20210723142003.php b/src/Bundle/ChillCalendarBundle/migrations/Version20210723142003.php index a4574eef8..71f5b9acc 100644 --- a/src/Bundle/ChillCalendarBundle/migrations/Version20210723142003.php +++ b/src/Bundle/ChillCalendarBundle/migrations/Version20210723142003.php @@ -19,6 +19,7 @@ use Doctrine\Migrations\AbstractMigration; */ final class Version20210723142003 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->addSql('ALTER TABLE chill_calendar.calendar ALTER startDate TYPE DATE'); @@ -29,11 +30,13 @@ final class Version20210723142003 extends AbstractMigration $this->addSql('COMMENT ON COLUMN chill_calendar.calendar.enddate IS \'(DC2Type:date_immutable)\''); } + #[\Override] public function getDescription(): string { return 'Alter startDate and endDate to datetimetz_immutable'; } + #[\Override] public function up(Schema $schema): void { $this->addSql('ALTER TABLE chill_calendar.calendar ALTER startdate TYPE TIMESTAMP(0) WITH TIME ZONE'); diff --git a/src/Bundle/ChillCalendarBundle/migrations/Version20210723142842.php b/src/Bundle/ChillCalendarBundle/migrations/Version20210723142842.php index 30db0ff29..90729daaa 100644 --- a/src/Bundle/ChillCalendarBundle/migrations/Version20210723142842.php +++ b/src/Bundle/ChillCalendarBundle/migrations/Version20210723142842.php @@ -19,6 +19,7 @@ use Doctrine\Migrations\AbstractMigration; */ final class Version20210723142842 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->addSql('ALTER TABLE chill_calendar.calendar_range ALTER startDate TYPE DATE'); @@ -29,11 +30,13 @@ final class Version20210723142842 extends AbstractMigration $this->addSql('COMMENT ON COLUMN chill_calendar.calendar_range.enddate IS \'(DC2Type:date_immutable)\''); } + #[\Override] public function getDescription(): string { return 'Alter startDate and endDate to datetimetz_immutable on calendarRange'; } + #[\Override] public function up(Schema $schema): void { $this->addSql('ALTER TABLE chill_calendar.calendar_range ALTER startdate TYPE TIMESTAMP(0) WITH TIME ZONE'); diff --git a/src/Bundle/ChillCalendarBundle/migrations/Version20211119173557.php b/src/Bundle/ChillCalendarBundle/migrations/Version20211119173557.php index cee5205b5..11208243f 100644 --- a/src/Bundle/ChillCalendarBundle/migrations/Version20211119173557.php +++ b/src/Bundle/ChillCalendarBundle/migrations/Version20211119173557.php @@ -16,16 +16,19 @@ use Doctrine\Migrations\AbstractMigration; final class Version20211119173557 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->throwIrreversibleMigrationException(); } + #[\Override] public function getDescription(): string { return 'remove comment on deprecated json_array type'; } + #[\Override] public function up(Schema $schema): void { $columns = [ diff --git a/src/Bundle/ChillCalendarBundle/migrations/Version20220510155609.php b/src/Bundle/ChillCalendarBundle/migrations/Version20220510155609.php index e023389ca..4510843a4 100644 --- a/src/Bundle/ChillCalendarBundle/migrations/Version20220510155609.php +++ b/src/Bundle/ChillCalendarBundle/migrations/Version20220510155609.php @@ -23,6 +23,7 @@ use Doctrine\Migrations\AbstractMigration; final class Version20220510155609 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->addSql('ALTER TABLE chill_calendar.calendar_range DROP CONSTRAINT FK_38D57D0565FF1AEC'); @@ -38,11 +39,13 @@ final class Version20220510155609 extends AbstractMigration $this->addSql('ALTER TABLE chill_calendar.calendar_range DROP createdBy_id'); } + #[\Override] public function getDescription(): string { return 'Add columns on calendar range to handle remote'; } + #[\Override] public function up(Schema $schema): void { $this->addSql('ALTER TABLE chill_calendar.calendar_range ADD remoteId TEXT DEFAULT \'\' NOT NULL'); diff --git a/src/Bundle/ChillCalendarBundle/migrations/Version20220511134619.php b/src/Bundle/ChillCalendarBundle/migrations/Version20220511134619.php index b82d1b442..6b3c99198 100644 --- a/src/Bundle/ChillCalendarBundle/migrations/Version20220511134619.php +++ b/src/Bundle/ChillCalendarBundle/migrations/Version20220511134619.php @@ -23,6 +23,7 @@ use Doctrine\Migrations\AbstractMigration; final class Version20220511134619 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->addSql('CREATE TABLE chill_calendar.calendar_to_invites (calendar_id INT NOT NULL, invite_id INT NOT NULL, PRIMARY KEY(calendar_id, invite_id))'); @@ -55,11 +56,13 @@ final class Version20220511134619 extends AbstractMigration $this->addSql('ALTER TABLE chill_calendar.calendar DROP updatedBy_id'); } + #[\Override] public function getDescription(): string { return 'Prepare schema for handling calendar invites'; } + #[\Override] public function up(Schema $schema): void { $this->addSql('DROP TABLE chill_calendar.calendar_to_invites'); diff --git a/src/Bundle/ChillCalendarBundle/migrations/Version20220525080633.php b/src/Bundle/ChillCalendarBundle/migrations/Version20220525080633.php index 344d3a2e6..9657997a6 100644 --- a/src/Bundle/ChillCalendarBundle/migrations/Version20220525080633.php +++ b/src/Bundle/ChillCalendarBundle/migrations/Version20220525080633.php @@ -23,6 +23,7 @@ use Doctrine\Migrations\AbstractMigration; final class Version20220525080633 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->addSql('ALTER TABLE chill_calendar.invite ALTER status DROP NOT NULL'); @@ -37,11 +38,13 @@ final class Version20220525080633 extends AbstractMigration $this->addSql('CREATE INDEX idx_712315aca76ed395 ON chill_calendar.calendar (user_id)'); } + #[\Override] public function getDescription(): string { return 'Calendar: add remote infos and fix associations'; } + #[\Override] public function up(Schema $schema): void { $this->addSql('ALTER TABLE chill_calendar.calendar DROP CONSTRAINT fk_712315aca76ed395'); diff --git a/src/Bundle/ChillCalendarBundle/migrations/Version20220527124558.php b/src/Bundle/ChillCalendarBundle/migrations/Version20220527124558.php index fc430761e..eb58fe503 100644 --- a/src/Bundle/ChillCalendarBundle/migrations/Version20220527124558.php +++ b/src/Bundle/ChillCalendarBundle/migrations/Version20220527124558.php @@ -16,16 +16,19 @@ use Doctrine\Migrations\AbstractMigration; final class Version20220527124558 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->addSql('ALTER TABLE chill_calendar.calendar DROP privateComment_comments'); } + #[\Override] public function getDescription(): string { return 'add private comment to calendar'; } + #[\Override] public function up(Schema $schema): void { $this->addSql('ALTER TABLE chill_calendar.calendar ADD privateComment_comments JSON DEFAULT NULL'); diff --git a/src/Bundle/ChillCalendarBundle/migrations/Version20220527234046.php b/src/Bundle/ChillCalendarBundle/migrations/Version20220527234046.php index a3996e0ff..0ef991623 100644 --- a/src/Bundle/ChillCalendarBundle/migrations/Version20220527234046.php +++ b/src/Bundle/ChillCalendarBundle/migrations/Version20220527234046.php @@ -16,17 +16,20 @@ use Doctrine\Migrations\AbstractMigration; final class Version20220527234046 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->addSql('ALTER TABLE chill_calendar.calendar ALTER COLUMN privateComment_comments DROP NOT NULL'); $this->addSql('ALTER TABLE chill_calendar.calendar ALTER COLUMN privateComment_comments SET DEFAULT NULL'); } + #[\Override] public function getDescription(): string { return ''; } + #[\Override] public function up(Schema $schema): void { $this->addSql('UPDATE chill_calendar.calendar SET privateComment_comments=\'{}\' WHERE privateComment_comments IS NULL'); diff --git a/src/Bundle/ChillCalendarBundle/migrations/Version20220606153851.php b/src/Bundle/ChillCalendarBundle/migrations/Version20220606153851.php index 8b6974670..7ddbcb57b 100644 --- a/src/Bundle/ChillCalendarBundle/migrations/Version20220606153851.php +++ b/src/Bundle/ChillCalendarBundle/migrations/Version20220606153851.php @@ -23,6 +23,7 @@ use Doctrine\Migrations\AbstractMigration; final class Version20220606153851 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->addSql('ALTER TABLE chill_calendar.calendar ALTER endDate TYPE TIMESTAMP(0) WITH TIME ZONE'); @@ -33,11 +34,13 @@ final class Version20220606153851 extends AbstractMigration $this->addSql('COMMENT ON COLUMN chill_calendar.calendar.startdate IS \'(DC2Type:datetimetz_immutable)\''); } + #[\Override] public function getDescription(): string { return 'remove timezone from dates in calendar entity'; } + #[\Override] public function up(Schema $schema): void { $this->addSql('ALTER TABLE chill_calendar.calendar ALTER startdate TYPE TIMESTAMP(0) WITHOUT TIME ZONE'); diff --git a/src/Bundle/ChillCalendarBundle/migrations/Version20220606154119.php b/src/Bundle/ChillCalendarBundle/migrations/Version20220606154119.php index eec87a628..c3647e161 100644 --- a/src/Bundle/ChillCalendarBundle/migrations/Version20220606154119.php +++ b/src/Bundle/ChillCalendarBundle/migrations/Version20220606154119.php @@ -23,6 +23,7 @@ use Doctrine\Migrations\AbstractMigration; final class Version20220606154119 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->addSql('ALTER TABLE chill_calendar.calendar_range ALTER endDate TYPE TIMESTAMP(0) WITH TIME ZONE'); @@ -33,11 +34,13 @@ final class Version20220606154119 extends AbstractMigration $this->addSql('COMMENT ON COLUMN chill_calendar.calendar_range.startdate IS \'(DC2Type:datetimetz_immutable)\''); } + #[\Override] public function getDescription(): string { return 'remove timezone from calendar range'; } + #[\Override] public function up(Schema $schema): void { $this->addSql('ALTER TABLE chill_calendar.calendar_range ALTER startdate TYPE TIMESTAMP(0) WITHOUT TIME ZONE'); diff --git a/src/Bundle/ChillCalendarBundle/migrations/Version20220608084052.php b/src/Bundle/ChillCalendarBundle/migrations/Version20220608084052.php index 8fa727533..e80e23f0b 100644 --- a/src/Bundle/ChillCalendarBundle/migrations/Version20220608084052.php +++ b/src/Bundle/ChillCalendarBundle/migrations/Version20220608084052.php @@ -23,17 +23,20 @@ use Doctrine\Migrations\AbstractMigration; final class Version20220608084052 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->addSql('ALTER TABLE chill_calendar.invite DROP remoteAttributes'); $this->addSql('ALTER TABLE chill_calendar.invite DROP remoteId'); } + #[\Override] public function getDescription(): string { return 'Add remoteId for invitation'; } + #[\Override] public function up(Schema $schema): void { $this->addSql('ALTER TABLE chill_calendar.invite ADD remoteAttributes JSON DEFAULT \'[]\' NOT NULL'); diff --git a/src/Bundle/ChillCalendarBundle/migrations/Version20220609200857.php b/src/Bundle/ChillCalendarBundle/migrations/Version20220609200857.php index 75e3fa61c..ccf50484b 100644 --- a/src/Bundle/ChillCalendarBundle/migrations/Version20220609200857.php +++ b/src/Bundle/ChillCalendarBundle/migrations/Version20220609200857.php @@ -23,6 +23,7 @@ use Doctrine\Migrations\AbstractMigration; final class Version20220609200857 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->addSql('DROP INDEX chill_calendar.idx_calendar_range_remote'); @@ -33,11 +34,13 @@ final class Version20220609200857 extends AbstractMigration $this->addSql('CREATE INDEX idx_calendar_invite_remote ON chill_calendar.invite (remoteId)'); } + #[\Override] public function getDescription(): string { return 'Set an unique contraint on remoteId on calendar object which are synced to a remote'; } + #[\Override] public function up(Schema $schema): void { $this->addSql('DROP INDEX chill_calendar.idx_calendar_range_remote'); diff --git a/src/Bundle/ChillCalendarBundle/migrations/Version20220613202636.php b/src/Bundle/ChillCalendarBundle/migrations/Version20220613202636.php index 82eda3800..0b7380ef7 100644 --- a/src/Bundle/ChillCalendarBundle/migrations/Version20220613202636.php +++ b/src/Bundle/ChillCalendarBundle/migrations/Version20220613202636.php @@ -23,16 +23,19 @@ use Doctrine\Migrations\AbstractMigration; final class Version20220613202636 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->addSql('ALTER TABLE chill_calendar.calendar DROP smsStatus'); } + #[\Override] public function getDescription(): string { return 'Add sms status on calendars'; } + #[\Override] public function up(Schema $schema): void { $this->addSql('ALTER TABLE chill_calendar.calendar ADD smsStatus TEXT DEFAULT \'sms_pending\' NOT NULL'); diff --git a/src/Bundle/ChillCalendarBundle/migrations/Version20220629095515.php b/src/Bundle/ChillCalendarBundle/migrations/Version20220629095515.php index 7179bb79a..7e0b65035 100644 --- a/src/Bundle/ChillCalendarBundle/migrations/Version20220629095515.php +++ b/src/Bundle/ChillCalendarBundle/migrations/Version20220629095515.php @@ -23,16 +23,19 @@ use Doctrine\Migrations\AbstractMigration; final class Version20220629095515 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->addSql('alter table chill_calendar.calendar_range DROP COLUMN location_id'); } + #[\Override] public function getDescription(): string { return 'Add location on calendar range'; } + #[\Override] public function up(Schema $schema): void { $this->addSql('ALTER TABLE chill_calendar.calendar_range ADD location_id INT DEFAULT NULL'); diff --git a/src/Bundle/ChillCalendarBundle/migrations/Version20220921101643.php b/src/Bundle/ChillCalendarBundle/migrations/Version20220921101643.php index b9a3619c2..26a85add9 100644 --- a/src/Bundle/ChillCalendarBundle/migrations/Version20220921101643.php +++ b/src/Bundle/ChillCalendarBundle/migrations/Version20220921101643.php @@ -26,17 +26,20 @@ use Doctrine\Migrations\AbstractMigration; */ final class Version20220921101643 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { // this down() migration is auto-generated, please modify it to your needs $this->addSql('ALTER TABLE chill_calendar.calendar DROP urgent'); } + #[\Override] public function getDescription(): string { return 'Add urgent property to calendar entity'; } + #[\Override] public function up(Schema $schema): void { // this up() migration is auto-generated, please modify it to your needs diff --git a/src/Bundle/ChillCalendarBundle/migrations/Version20221020101547.php b/src/Bundle/ChillCalendarBundle/migrations/Version20221020101547.php index 1fbfde60e..e37b0b034 100644 --- a/src/Bundle/ChillCalendarBundle/migrations/Version20221020101547.php +++ b/src/Bundle/ChillCalendarBundle/migrations/Version20221020101547.php @@ -16,6 +16,7 @@ use Doctrine\Migrations\AbstractMigration; final class Version20221020101547 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->addSql('DROP SEQUENCE chill_calendar.calendar_doc_id_seq CASCADE'); @@ -23,11 +24,13 @@ final class Version20221020101547 extends AbstractMigration $this->addSql('ALTER TABLE chill_calendar.calendar DROP dateTimeVersion'); } + #[\Override] public function getDescription(): string { return 'Add calendardoc on Calendar'; } + #[\Override] public function up(Schema $schema): void { $this->addSql('CREATE SEQUENCE chill_calendar.calendar_doc_id_seq INCREMENT BY 1 MINVALUE 1 START 1'); diff --git a/src/Bundle/ChillCalendarBundle/migrations/Version20221021092541.php b/src/Bundle/ChillCalendarBundle/migrations/Version20221021092541.php index 732b975e3..8b6356add 100644 --- a/src/Bundle/ChillCalendarBundle/migrations/Version20221021092541.php +++ b/src/Bundle/ChillCalendarBundle/migrations/Version20221021092541.php @@ -16,16 +16,19 @@ use Doctrine\Migrations\AbstractMigration; final class Version20221021092541 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->addSql('ALTER TABLE chill_calendar.calendar DROP person_id'); } + #[\Override] public function getDescription(): string { return 'Associate a calendar with a person'; } + #[\Override] public function up(Schema $schema): void { $this->addSql('ALTER TABLE chill_calendar.calendar ADD person_id INT DEFAULT NULL'); diff --git a/src/Bundle/ChillCalendarBundle/migrations/Version20221125144205.php b/src/Bundle/ChillCalendarBundle/migrations/Version20221125144205.php index 624fdda00..8565cab63 100644 --- a/src/Bundle/ChillCalendarBundle/migrations/Version20221125144205.php +++ b/src/Bundle/ChillCalendarBundle/migrations/Version20221125144205.php @@ -16,16 +16,19 @@ use Doctrine\Migrations\AbstractMigration; final class Version20221125144205 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->throwIrreversibleMigrationException(); } + #[\Override] public function getDescription(): string { return 'Calendar: remove association between scope and calendar'; } + #[\Override] public function up(Schema $schema): void { $this->addSql( diff --git a/src/Bundle/ChillCustomFieldsBundle/ChillCustomFieldsBundle.php b/src/Bundle/ChillCustomFieldsBundle/ChillCustomFieldsBundle.php index 5d32ed7e9..6799fda6c 100644 --- a/src/Bundle/ChillCustomFieldsBundle/ChillCustomFieldsBundle.php +++ b/src/Bundle/ChillCustomFieldsBundle/ChillCustomFieldsBundle.php @@ -16,6 +16,7 @@ use Symfony\Component\HttpKernel\Bundle\Bundle; class ChillCustomFieldsBundle extends Bundle { + #[\Override] public function build(\Symfony\Component\DependencyInjection\ContainerBuilder $container) { parent::build($container); diff --git a/src/Bundle/ChillCustomFieldsBundle/Command/CreateFieldsOnGroupCommand.php b/src/Bundle/ChillCustomFieldsBundle/Command/CreateFieldsOnGroupCommand.php index 24c531860..ad048187e 100644 --- a/src/Bundle/ChillCustomFieldsBundle/Command/CreateFieldsOnGroupCommand.php +++ b/src/Bundle/ChillCustomFieldsBundle/Command/CreateFieldsOnGroupCommand.php @@ -32,9 +32,9 @@ use Symfony\Component\Yaml\Parser; class CreateFieldsOnGroupCommand extends Command { protected static $defaultDescription = 'Create custom fields from a yml file'; - final public const ARG_DELETE = 'delete'; + final public const string ARG_DELETE = 'delete'; - final public const ARG_PATH = 'path'; + final public const string ARG_PATH = 'path'; /** * CreateFieldsOnGroupCommand constructor. @@ -49,6 +49,7 @@ class CreateFieldsOnGroupCommand extends Command parent::__construct(); } + #[\Override] protected function configure() { $this->setName('chill:custom_fields:populate_group') @@ -79,6 +80,7 @@ class CreateFieldsOnGroupCommand extends Command } } + #[\Override] protected function execute(InputInterface $input, OutputInterface $output): int { $helper = $this->getHelperSet()->get('question'); diff --git a/src/Bundle/ChillCustomFieldsBundle/CustomFields/AbstractCustomField.php b/src/Bundle/ChillCustomFieldsBundle/CustomFields/AbstractCustomField.php index 72167861f..e9759db63 100644 --- a/src/Bundle/ChillCustomFieldsBundle/CustomFields/AbstractCustomField.php +++ b/src/Bundle/ChillCustomFieldsBundle/CustomFields/AbstractCustomField.php @@ -15,6 +15,7 @@ use Chill\CustomFieldsBundle\Entity\CustomField; abstract class AbstractCustomField implements CustomFieldInterface { + #[\Override] public function isEmptyValue($value, CustomField $customField) { return empty($value) && false !== $value; diff --git a/src/Bundle/ChillCustomFieldsBundle/CustomFields/CustomFieldChoice.php b/src/Bundle/ChillCustomFieldsBundle/CustomFields/CustomFieldChoice.php index a54e4c21f..ea0e25909 100644 --- a/src/Bundle/ChillCustomFieldsBundle/CustomFields/CustomFieldChoice.php +++ b/src/Bundle/ChillCustomFieldsBundle/CustomFields/CustomFieldChoice.php @@ -24,15 +24,15 @@ use Twig\Environment; class CustomFieldChoice extends AbstractCustomField { - final public const ALLOW_OTHER = 'other'; + final public const string ALLOW_OTHER = 'other'; - final public const CHOICES = 'choices'; + final public const string CHOICES = 'choices'; - final public const EXPANDED = 'expanded'; + final public const string EXPANDED = 'expanded'; - final public const MULTIPLE = 'multiple'; + final public const string MULTIPLE = 'multiple'; - final public const OTHER_VALUE_LABEL = 'otherValueLabel'; + final public const string OTHER_VALUE_LABEL = 'otherValueLabel'; /** * CustomFieldChoice constructor. @@ -50,6 +50,7 @@ class CustomFieldChoice extends AbstractCustomField return $cf->getOptions()[self::ALLOW_OTHER]; } + #[\Override] public function buildForm(FormBuilderInterface $builder, CustomField $customField) { // prepare choices @@ -101,6 +102,7 @@ class CustomFieldChoice extends AbstractCustomField } } + #[\Override] public function buildOptionsForm(FormBuilderInterface $builder) { $builder @@ -141,6 +143,7 @@ class CustomFieldChoice extends AbstractCustomField return $builder; } + #[\Override] public function deserialize($serialized, CustomField $customField) { // we always have to adapt to what the current data should be @@ -191,6 +194,7 @@ class CustomFieldChoice extends AbstractCustomField ]; } + #[\Override] public function getName() { return 'Choices'; @@ -227,6 +231,7 @@ class CustomFieldChoice extends AbstractCustomField return $this->deserialize($data, $cf) === $choiceSlug; } + #[\Override] public function isEmptyValue($value, CustomField $customField) { if (null === $value) { @@ -266,6 +271,7 @@ class CustomFieldChoice extends AbstractCustomField * * @return string html representation */ + #[\Override] public function render($value, CustomField $customField, $documentType = 'html') { // extract the data. They are under a _choice key if they are stored with allow_other @@ -295,6 +301,7 @@ class CustomFieldChoice extends AbstractCustomField ); } + #[\Override] public function serialize($value, CustomField $customField) { return $value; diff --git a/src/Bundle/ChillCustomFieldsBundle/CustomFields/CustomFieldDate.php b/src/Bundle/ChillCustomFieldsBundle/CustomFields/CustomFieldDate.php index dac447930..2932bc63a 100644 --- a/src/Bundle/ChillCustomFieldsBundle/CustomFields/CustomFieldDate.php +++ b/src/Bundle/ChillCustomFieldsBundle/CustomFields/CustomFieldDate.php @@ -31,22 +31,23 @@ use Twig\Environment; */ class CustomFieldDate extends AbstractCustomField { - final public const DATE_FORMAT = \DateTime::RFC3339; + final public const string DATE_FORMAT = \DateTime::RFC3339; - final public const FORMAT = 'format'; + final public const string FORMAT = 'format'; - final public const MAX = 'max'; + final public const string MAX = 'max'; /** * key for the minimal value of the field. */ - final public const MIN = 'min'; + final public const string MIN = 'min'; public function __construct( private readonly Environment $templating, private readonly TranslatableStringHelper $translatableStringHelper ) {} + #[\Override] public function buildForm(FormBuilderInterface $builder, CustomField $customField) { $fieldOptions = $this->prepareFieldOptions($customField); @@ -64,6 +65,7 @@ class CustomFieldDate extends AbstractCustomField ); } + #[\Override] public function buildOptionsForm(FormBuilderInterface $builder) { $validatorFunction = static function ($value, ExecutionContextInterface $context) { @@ -98,6 +100,7 @@ class CustomFieldDate extends AbstractCustomField ]); } + #[\Override] public function deserialize($serialized, CustomField $customField) { if (empty($serialized)) { @@ -107,11 +110,13 @@ class CustomFieldDate extends AbstractCustomField return \DateTime::createFromFormat(self::DATE_FORMAT, $serialized); } + #[\Override] public function getName() { return 'Date field'; } + #[\Override] public function render($value, CustomField $customField, $documentType = 'html') { switch ($documentType) { @@ -136,6 +141,7 @@ class CustomFieldDate extends AbstractCustomField } } + #[\Override] public function serialize($date, CustomField $customField) { if (null === $date) { diff --git a/src/Bundle/ChillCustomFieldsBundle/CustomFields/CustomFieldLongChoice.php b/src/Bundle/ChillCustomFieldsBundle/CustomFields/CustomFieldLongChoice.php index 54d63b978..d33bc6105 100644 --- a/src/Bundle/ChillCustomFieldsBundle/CustomFields/CustomFieldLongChoice.php +++ b/src/Bundle/ChillCustomFieldsBundle/CustomFields/CustomFieldLongChoice.php @@ -22,7 +22,7 @@ use Symfony\Component\Form\FormBuilderInterface; class CustomFieldLongChoice extends AbstractCustomField { - final public const KEY = 'key'; + final public const string KEY = 'key'; public function __construct( private readonly OptionRepository $optionRepository, @@ -30,6 +30,7 @@ class CustomFieldLongChoice extends AbstractCustomField private readonly \Twig\Environment $templating, ) {} + #[\Override] public function buildForm(FormBuilderInterface $builder, CustomField $customField) { $options = $customField->getOptions(); @@ -63,6 +64,7 @@ class CustomFieldLongChoice extends AbstractCustomField ->addModelTransformer(new CustomFieldDataTransformer($this, $customField)); } + #[\Override] public function buildOptionsForm(FormBuilderInterface $builder) { // create a selector between different keys @@ -79,6 +81,7 @@ class CustomFieldLongChoice extends AbstractCustomField ]); } + #[\Override] public function deserialize($serialized, CustomField $customField) { if (null === $serialized) { @@ -88,11 +91,13 @@ class CustomFieldLongChoice extends AbstractCustomField return $this->optionRepository->find($serialized); } + #[\Override] public function getName() { return 'Long choice field'; } + #[\Override] public function render($value, CustomField $customField, $documentType = 'html') { $option = $this->deserialize($value, $customField); @@ -105,6 +110,7 @@ class CustomFieldLongChoice extends AbstractCustomField ]); } + #[\Override] public function serialize($value, CustomField $customField) { if (null === $value) { diff --git a/src/Bundle/ChillCustomFieldsBundle/CustomFields/CustomFieldNumber.php b/src/Bundle/ChillCustomFieldsBundle/CustomFields/CustomFieldNumber.php index e083b9b80..6976d8dea 100644 --- a/src/Bundle/ChillCustomFieldsBundle/CustomFields/CustomFieldNumber.php +++ b/src/Bundle/ChillCustomFieldsBundle/CustomFields/CustomFieldNumber.php @@ -28,22 +28,23 @@ use Twig\Environment; */ class CustomFieldNumber extends AbstractCustomField { - final public const MAX = 'max'; + final public const string MAX = 'max'; /** * key for the minimal value of the field. */ - final public const MIN = 'min'; + final public const string MIN = 'min'; - final public const POST_TEXT = 'post_text'; + final public const string POST_TEXT = 'post_text'; - final public const SCALE = 'scale'; + final public const string SCALE = 'scale'; public function __construct( private readonly Environment $templating, private readonly TranslatableStringHelper $translatableStringHelper ) {} + #[\Override] public function buildForm(FormBuilderInterface $builder, CustomField $customField) { $options = $customField->getOptions(); @@ -58,6 +59,7 @@ class CustomFieldNumber extends AbstractCustomField $builder->add($customField->getSlug(), $type, $fieldOptions); } + #[\Override] public function buildOptionsForm(FormBuilderInterface $builder) { return $builder @@ -83,16 +85,19 @@ class CustomFieldNumber extends AbstractCustomField ]); } + #[\Override] public function deserialize($serialized, CustomField $customField) { return $serialized; } + #[\Override] public function getName() { return 'Number field'; } + #[\Override] public function render($value, CustomField $customField, $documentType = 'html') { $template = '@ChillCustomFields/CustomFieldsRendering/number.' @@ -107,6 +112,7 @@ class CustomFieldNumber extends AbstractCustomField ]); } + #[\Override] public function serialize($value, CustomField $customField) { return $value; diff --git a/src/Bundle/ChillCustomFieldsBundle/CustomFields/CustomFieldText.php b/src/Bundle/ChillCustomFieldsBundle/CustomFields/CustomFieldText.php index 17d8e95e7..a74f5373c 100644 --- a/src/Bundle/ChillCustomFieldsBundle/CustomFields/CustomFieldText.php +++ b/src/Bundle/ChillCustomFieldsBundle/CustomFields/CustomFieldText.php @@ -22,9 +22,9 @@ use Twig\Environment; class CustomFieldText extends AbstractCustomField { - final public const MAX_LENGTH = 'maxLength'; + final public const string MAX_LENGTH = 'maxLength'; - final public const MULTIPLE_CF_INLINE = 'multipleCFInline'; + final public const string MULTIPLE_CF_INLINE = 'multipleCFInline'; public function __construct( private readonly Environment $templating, @@ -37,6 +37,7 @@ class CustomFieldText extends AbstractCustomField * if maxLength < 256 THEN the form type is 'text' * if not, THEN the form type is textarea */ + #[\Override] public function buildForm(FormBuilderInterface $builder, CustomField $customField) { $options = $customField->getOptions(); @@ -60,6 +61,7 @@ class CustomFieldText extends AbstractCustomField ]); } + #[\Override] public function buildOptionsForm(FormBuilderInterface $builder) { return $builder @@ -74,16 +76,19 @@ class CustomFieldText extends AbstractCustomField ]); } + #[\Override] public function deserialize($serialized, CustomField $customField) { return $serialized; } + #[\Override] public function getName() { return 'Text field'; } + #[\Override] public function render($value, CustomField $customField, $documentType = 'html') { $template = '@ChillCustomFields/CustomFieldsRendering/text.html.twig'; @@ -96,6 +101,7 @@ class CustomFieldText extends AbstractCustomField ->render($template, ['text' => $value]); } + #[\Override] public function serialize($value, CustomField $customField) { return $value; diff --git a/src/Bundle/ChillCustomFieldsBundle/CustomFields/CustomFieldTitle.php b/src/Bundle/ChillCustomFieldsBundle/CustomFields/CustomFieldTitle.php index 302e04350..b24d8c0a8 100644 --- a/src/Bundle/ChillCustomFieldsBundle/CustomFields/CustomFieldTitle.php +++ b/src/Bundle/ChillCustomFieldsBundle/CustomFields/CustomFieldTitle.php @@ -20,11 +20,11 @@ use Twig\Environment; class CustomFieldTitle extends AbstractCustomField { - final public const TYPE = 'type'; + final public const string TYPE = 'type'; - final public const TYPE_SUBTITLE = 'subtitle'; + final public const string TYPE_SUBTITLE = 'subtitle'; - final public const TYPE_TITLE = 'title'; + final public const string TYPE_TITLE = 'title'; public function __construct( private readonly Environment $templating, @@ -34,6 +34,7 @@ class CustomFieldTitle extends AbstractCustomField private readonly TranslatableStringHelper $translatableStringHelper ) {} + #[\Override] public function buildForm(FormBuilderInterface $builder, CustomField $customField) { $builder->add($customField->getSlug(), CustomFieldsTitleType::class, [ @@ -46,6 +47,7 @@ class CustomFieldTitle extends AbstractCustomField ]); } + #[\Override] public function buildOptionsForm(FormBuilderInterface $builder) { return $builder->add( @@ -61,21 +63,25 @@ class CustomFieldTitle extends AbstractCustomField ); } + #[\Override] public function deserialize($serialized, CustomField $customField) { return $serialized; } + #[\Override] public function getName() { return 'Title'; } + #[\Override] public function isEmptyValue($value, CustomField $customField) { return false; } + #[\Override] public function render($value, CustomField $customField, $documentType = 'html') { return $this->templating @@ -88,6 +94,7 @@ class CustomFieldTitle extends AbstractCustomField ); } + #[\Override] public function serialize($value, CustomField $customField) { return $value; diff --git a/src/Bundle/ChillCustomFieldsBundle/DataFixtures/ORM/LoadOption.php b/src/Bundle/ChillCustomFieldsBundle/DataFixtures/ORM/LoadOption.php index f95991b7c..aeab5bfd2 100644 --- a/src/Bundle/ChillCustomFieldsBundle/DataFixtures/ORM/LoadOption.php +++ b/src/Bundle/ChillCustomFieldsBundle/DataFixtures/ORM/LoadOption.php @@ -46,11 +46,13 @@ class LoadOption extends AbstractFixture implements OrderedFixtureInterface $this->fakerNl = \Faker\Factory::create('nl_NL'); } + #[\Override] public function getOrder() { return 1000; } + #[\Override] public function load(ObjectManager $manager) { echo "Loading Options \n"; diff --git a/src/Bundle/ChillCustomFieldsBundle/DependencyInjection/ChillCustomFieldsExtension.php b/src/Bundle/ChillCustomFieldsBundle/DependencyInjection/ChillCustomFieldsExtension.php index 724fd01ca..eb6b7c820 100644 --- a/src/Bundle/ChillCustomFieldsBundle/DependencyInjection/ChillCustomFieldsExtension.php +++ b/src/Bundle/ChillCustomFieldsBundle/DependencyInjection/ChillCustomFieldsExtension.php @@ -24,6 +24,7 @@ use Symfony\Component\HttpKernel\DependencyInjection\Extension; */ class ChillCustomFieldsExtension extends Extension implements PrependExtensionInterface { + #[\Override] public function load(array $configs, ContainerBuilder $container) { $configuration = new Configuration(); @@ -54,6 +55,7 @@ class ChillCustomFieldsExtension extends Extension implements PrependExtensionIn /** (non-PHPdoc). * @see \Symfony\Component\DependencyInjection\Extension\PrependExtensionInterface::prepend() */ + #[\Override] public function prepend(ContainerBuilder $container) { // add form layout to twig resources diff --git a/src/Bundle/ChillCustomFieldsBundle/DependencyInjection/Configuration.php b/src/Bundle/ChillCustomFieldsBundle/DependencyInjection/Configuration.php index e68fdd2c4..94fc50f97 100644 --- a/src/Bundle/ChillCustomFieldsBundle/DependencyInjection/Configuration.php +++ b/src/Bundle/ChillCustomFieldsBundle/DependencyInjection/Configuration.php @@ -22,6 +22,7 @@ use Symfony\Component\Config\Definition\ConfigurationInterface; */ class Configuration implements ConfigurationInterface { + #[\Override] public function getConfigTreeBuilder() { $treeBuilder = new TreeBuilder('chill_custom_fields'); diff --git a/src/Bundle/ChillCustomFieldsBundle/DependencyInjection/CustomFieldCompilerPass.php b/src/Bundle/ChillCustomFieldsBundle/DependencyInjection/CustomFieldCompilerPass.php index 6e68a248a..9c43dc4a9 100644 --- a/src/Bundle/ChillCustomFieldsBundle/DependencyInjection/CustomFieldCompilerPass.php +++ b/src/Bundle/ChillCustomFieldsBundle/DependencyInjection/CustomFieldCompilerPass.php @@ -17,6 +17,7 @@ use Symfony\Component\DependencyInjection\Reference; class CustomFieldCompilerPass implements CompilerPassInterface { + #[\Override] public function process(ContainerBuilder $container) { if (!$container->hasDefinition('chill.custom_field.provider')) { diff --git a/src/Bundle/ChillCustomFieldsBundle/Entity/CustomField.php b/src/Bundle/ChillCustomFieldsBundle/Entity/CustomField.php index 06ff658c7..2e3aa3501 100644 --- a/src/Bundle/ChillCustomFieldsBundle/Entity/CustomField.php +++ b/src/Bundle/ChillCustomFieldsBundle/Entity/CustomField.php @@ -21,9 +21,9 @@ use Doctrine\ORM\Mapping as ORM; #[ORM\Table(name: 'customfield')] class CustomField { - final public const ONE_TO_MANY = 2; + final public const int ONE_TO_MANY = 2; - final public const ONE_TO_ONE = 1; + final public const int ONE_TO_ONE = 1; #[ORM\Column(type: \Doctrine\DBAL\Types\Types::BOOLEAN)] private bool $active = true; diff --git a/src/Bundle/ChillCustomFieldsBundle/Form/CustomFieldType.php b/src/Bundle/ChillCustomFieldsBundle/Form/CustomFieldType.php index 23a7ed975..1e0a7f558 100644 --- a/src/Bundle/ChillCustomFieldsBundle/Form/CustomFieldType.php +++ b/src/Bundle/ChillCustomFieldsBundle/Form/CustomFieldType.php @@ -32,6 +32,7 @@ class CustomFieldType extends AbstractType { public function __construct(private readonly CustomFieldProvider $customFieldProvider, private readonly ObjectManager $om, private readonly TranslatableStringHelper $translatableStringHelper) {} + #[\Override] public function buildForm(FormBuilderInterface $builder, array $options) { $customFieldsList = []; @@ -91,6 +92,7 @@ class CustomFieldType extends AbstractType /** * @param OptionsResolverInterface $resolver */ + #[\Override] public function configureOptions(OptionsResolver $resolver) { $resolver->setDefaults([ @@ -106,6 +108,7 @@ class CustomFieldType extends AbstractType /** * @return string */ + #[\Override] public function getBlockPrefix() { return 'custom_field_choice'; diff --git a/src/Bundle/ChillCustomFieldsBundle/Form/CustomFieldsGroupType.php b/src/Bundle/ChillCustomFieldsBundle/Form/CustomFieldsGroupType.php index 8cf3ea182..b5cd20410 100644 --- a/src/Bundle/ChillCustomFieldsBundle/Form/CustomFieldsGroupType.php +++ b/src/Bundle/ChillCustomFieldsBundle/Form/CustomFieldsGroupType.php @@ -30,6 +30,7 @@ class CustomFieldsGroupType extends AbstractType ) {} // TODO : details about the function + #[\Override] public function buildForm(FormBuilderInterface $builder, array $options) { // prepare translation @@ -86,6 +87,7 @@ class CustomFieldsGroupType extends AbstractType ); } + #[\Override] public function configureOptions(OptionsResolver $resolver) { $resolver->setDefaults([ diff --git a/src/Bundle/ChillCustomFieldsBundle/Form/DataTransformer/CustomFieldDataTransformer.php b/src/Bundle/ChillCustomFieldsBundle/Form/DataTransformer/CustomFieldDataTransformer.php index ee5f8b386..a6b5b4c15 100644 --- a/src/Bundle/ChillCustomFieldsBundle/Form/DataTransformer/CustomFieldDataTransformer.php +++ b/src/Bundle/ChillCustomFieldsBundle/Form/DataTransformer/CustomFieldDataTransformer.php @@ -19,6 +19,7 @@ class CustomFieldDataTransformer implements DataTransformerInterface { public function __construct(private readonly CustomFieldInterface $customFieldDefinition, private readonly CustomField $customField) {} + #[\Override] public function reverseTransform($value) { return $this->customFieldDefinition->serialize( @@ -27,6 +28,7 @@ class CustomFieldDataTransformer implements DataTransformerInterface ); } + #[\Override] public function transform($value) { return $this->customFieldDefinition->deserialize( diff --git a/src/Bundle/ChillCustomFieldsBundle/Form/DataTransformer/CustomFieldsGroupToIdTransformer.php b/src/Bundle/ChillCustomFieldsBundle/Form/DataTransformer/CustomFieldsGroupToIdTransformer.php index 180ac0a8a..5f2ec0cdd 100644 --- a/src/Bundle/ChillCustomFieldsBundle/Form/DataTransformer/CustomFieldsGroupToIdTransformer.php +++ b/src/Bundle/ChillCustomFieldsBundle/Form/DataTransformer/CustomFieldsGroupToIdTransformer.php @@ -27,6 +27,7 @@ class CustomFieldsGroupToIdTransformer implements DataTransformerInterface * * @throws TransformationFailedException if object (report) is not found */ + #[\Override] public function reverseTransform($id): ?CustomFieldsGroup { if (!$id) { @@ -54,6 +55,7 @@ class CustomFieldsGroupToIdTransformer implements DataTransformerInterface * * @return string */ + #[\Override] public function transform($customFieldsGroup) { if (null === $customFieldsGroup) { diff --git a/src/Bundle/ChillCustomFieldsBundle/Form/DataTransformer/JsonCustomFieldToArrayTransformer.php b/src/Bundle/ChillCustomFieldsBundle/Form/DataTransformer/JsonCustomFieldToArrayTransformer.php index 9f2fa3a9e..6295dcf68 100644 --- a/src/Bundle/ChillCustomFieldsBundle/Form/DataTransformer/JsonCustomFieldToArrayTransformer.php +++ b/src/Bundle/ChillCustomFieldsBundle/Form/DataTransformer/JsonCustomFieldToArrayTransformer.php @@ -39,6 +39,7 @@ class JsonCustomFieldToArrayTransformer implements DataTransformerInterface $this->customField = $customFieldsByLabel; } + #[\Override] public function reverseTransform($customFieldsArray) { /* @@ -101,6 +102,7 @@ class JsonCustomFieldToArrayTransformer implements DataTransformerInterface return json_encode($customFieldsArrayRet, \JSON_THROW_ON_ERROR); } + #[\Override] public function transform($customFieldsJSON) { echo $customFieldsJSON; diff --git a/src/Bundle/ChillCustomFieldsBundle/Form/Extension/PostTextExtension.php b/src/Bundle/ChillCustomFieldsBundle/Form/Extension/PostTextExtension.php index 2d801beec..11d1597bd 100644 --- a/src/Bundle/ChillCustomFieldsBundle/Form/Extension/PostTextExtension.php +++ b/src/Bundle/ChillCustomFieldsBundle/Form/Extension/PostTextExtension.php @@ -26,6 +26,7 @@ use Symfony\Component\OptionsResolver\OptionsResolver; */ abstract class PostTextExtension extends AbstractTypeExtension { + #[\Override] public function buildView(FormView $view, FormInterface $form, array $options) { if (\array_key_exists('post_text', $options)) { @@ -34,6 +35,7 @@ abstract class PostTextExtension extends AbstractTypeExtension } } + #[\Override] public function configureOptions(OptionsResolver $resolver) { $resolver->setDefined(['post_text']); diff --git a/src/Bundle/ChillCustomFieldsBundle/Form/Extension/PostTextIntegerExtension.php b/src/Bundle/ChillCustomFieldsBundle/Form/Extension/PostTextIntegerExtension.php index da17c573d..b53db1c0a 100644 --- a/src/Bundle/ChillCustomFieldsBundle/Form/Extension/PostTextIntegerExtension.php +++ b/src/Bundle/ChillCustomFieldsBundle/Form/Extension/PostTextIntegerExtension.php @@ -18,6 +18,7 @@ use Symfony\Component\Form\Extension\Core\Type\IntegerType; */ class PostTextIntegerExtension extends PostTextExtension { + #[\Override] public static function getExtendedTypes(): iterable { return [IntegerType::class]; diff --git a/src/Bundle/ChillCustomFieldsBundle/Form/Extension/PostTextNumberExtension.php b/src/Bundle/ChillCustomFieldsBundle/Form/Extension/PostTextNumberExtension.php index 1303744ce..ffcb529d1 100644 --- a/src/Bundle/ChillCustomFieldsBundle/Form/Extension/PostTextNumberExtension.php +++ b/src/Bundle/ChillCustomFieldsBundle/Form/Extension/PostTextNumberExtension.php @@ -18,6 +18,7 @@ use Symfony\Component\Form\Extension\Core\Type\NumberType; */ class PostTextNumberExtension extends PostTextExtension { + #[\Override] public static function getExtendedTypes(): iterable { return [NumberType::class]; diff --git a/src/Bundle/ChillCustomFieldsBundle/Form/Type/ChoiceWithOtherType.php b/src/Bundle/ChillCustomFieldsBundle/Form/Type/ChoiceWithOtherType.php index 8d0c049f0..896b11074 100644 --- a/src/Bundle/ChillCustomFieldsBundle/Form/Type/ChoiceWithOtherType.php +++ b/src/Bundle/ChillCustomFieldsBundle/Form/Type/ChoiceWithOtherType.php @@ -27,6 +27,7 @@ class ChoiceWithOtherType extends AbstractType /** (non-PHPdoc). * @see \Symfony\Component\Form\AbstractType::buildForm() */ + #[\Override] public function buildForm(FormBuilderInterface $builder, array $options) { // add an 'other' entry in choices array @@ -44,6 +45,7 @@ class ChoiceWithOtherType extends AbstractType /** (non-PHPdoc). * @see \Symfony\Component\Form\AbstractType::configureOptions() */ + #[\Override] public function configureOptions(OptionsResolver $resolver) { $resolver diff --git a/src/Bundle/ChillCustomFieldsBundle/Form/Type/ChoicesListType.php b/src/Bundle/ChillCustomFieldsBundle/Form/Type/ChoicesListType.php index c50bd856e..44328a844 100644 --- a/src/Bundle/ChillCustomFieldsBundle/Form/Type/ChoicesListType.php +++ b/src/Bundle/ChillCustomFieldsBundle/Form/Type/ChoicesListType.php @@ -24,6 +24,7 @@ class ChoicesListType extends AbstractType /** (non-PHPdoc). * @see \Symfony\Component\Form\AbstractType::buildForm() */ + #[\Override] public function buildForm(FormBuilderInterface $builder, array $options) { $builder->add('name', TranslatableStringFormType::class) @@ -52,6 +53,7 @@ class ChoicesListType extends AbstractType /** * @see \Symfony\Component\Form\FormTypeInterface::getName() */ + #[\Override] public function getBlockPrefix() { return 'cf_choices_list'; diff --git a/src/Bundle/ChillCustomFieldsBundle/Form/Type/ChoicesType.php b/src/Bundle/ChillCustomFieldsBundle/Form/Type/ChoicesType.php index 6730d2579..d8de8477e 100644 --- a/src/Bundle/ChillCustomFieldsBundle/Form/Type/ChoicesType.php +++ b/src/Bundle/ChillCustomFieldsBundle/Form/Type/ChoicesType.php @@ -16,11 +16,13 @@ use Symfony\Component\Form\Extension\Core\Type\CollectionType; class ChoicesType extends AbstractType { + #[\Override] public function getBlockPrefix() { return 'cf_choices'; } + #[\Override] public function getParent() { return CollectionType::class; diff --git a/src/Bundle/ChillCustomFieldsBundle/Form/Type/CustomFieldType.php b/src/Bundle/ChillCustomFieldsBundle/Form/Type/CustomFieldType.php index 6da8a9a71..d35bd8c5d 100644 --- a/src/Bundle/ChillCustomFieldsBundle/Form/Type/CustomFieldType.php +++ b/src/Bundle/ChillCustomFieldsBundle/Form/Type/CustomFieldType.php @@ -29,6 +29,7 @@ class CustomFieldType extends AbstractType $this->customFieldCompiler = $compiler; } + #[\Override] public function buildForm(FormBuilderInterface $builder, array $options) { foreach ($options['group']->getActiveCustomFields() as $cf) { @@ -39,6 +40,7 @@ class CustomFieldType extends AbstractType } } + #[\Override] public function configureOptions(OptionsResolver $resolver) { $resolver diff --git a/src/Bundle/ChillCustomFieldsBundle/Form/Type/CustomFieldsTitleType.php b/src/Bundle/ChillCustomFieldsBundle/Form/Type/CustomFieldsTitleType.php index 5d5377a15..27cc765ea 100644 --- a/src/Bundle/ChillCustomFieldsBundle/Form/Type/CustomFieldsTitleType.php +++ b/src/Bundle/ChillCustomFieldsBundle/Form/Type/CustomFieldsTitleType.php @@ -16,8 +16,10 @@ use Symfony\Component\Form\FormBuilderInterface; class CustomFieldsTitleType extends AbstractType { + #[\Override] public function buildForm(FormBuilderInterface $builder, array $options) {} + #[\Override] public function getBlockPrefix() { return 'custom_field_title'; diff --git a/src/Bundle/ChillCustomFieldsBundle/Form/Type/LinkedCustomFieldsType.php b/src/Bundle/ChillCustomFieldsBundle/Form/Type/LinkedCustomFieldsType.php index 8f6e896bf..008177ddc 100644 --- a/src/Bundle/ChillCustomFieldsBundle/Form/Type/LinkedCustomFieldsType.php +++ b/src/Bundle/ChillCustomFieldsBundle/Form/Type/LinkedCustomFieldsType.php @@ -80,6 +80,7 @@ class LinkedCustomFieldsType extends AbstractType ); } + #[\Override] public function buildForm(FormBuilderInterface $builder, array $options) { $this->choiceName = $builder->getName(); @@ -91,11 +92,13 @@ class LinkedCustomFieldsType extends AbstractType ); } + #[\Override] public function getBlockPrefix() { return 'custom_fields_group_linked_custom_fields'; } + #[\Override] public function getParent() { return ChoiceType::class; diff --git a/src/Bundle/ChillCustomFieldsBundle/Menu/AdminMenuBuilder.php b/src/Bundle/ChillCustomFieldsBundle/Menu/AdminMenuBuilder.php index db63ad6ac..6a8cd02ad 100644 --- a/src/Bundle/ChillCustomFieldsBundle/Menu/AdminMenuBuilder.php +++ b/src/Bundle/ChillCustomFieldsBundle/Menu/AdminMenuBuilder.php @@ -27,6 +27,7 @@ class AdminMenuBuilder implements LocalMenuBuilderInterface $this->authorizationChecker = $authorizationChecker; } + #[\Override] public function buildMenu($menuId, MenuItem $menu, array $parameters) { if (!$this->authorizationChecker->isGranted('ROLE_ADMIN')) { @@ -50,6 +51,7 @@ class AdminMenuBuilder implements LocalMenuBuilderInterface ])->setExtras(['order' => 4520]); } + #[\Override] public static function getMenuIds(): array { return ['admin_section', 'admin_custom_fields']; diff --git a/src/Bundle/ChillCustomFieldsBundle/Service/CustomFieldProvider.php b/src/Bundle/ChillCustomFieldsBundle/Service/CustomFieldProvider.php index fcccf01ed..38ee90b98 100644 --- a/src/Bundle/ChillCustomFieldsBundle/Service/CustomFieldProvider.php +++ b/src/Bundle/ChillCustomFieldsBundle/Service/CustomFieldProvider.php @@ -84,6 +84,7 @@ class CustomFieldProvider implements ContainerAwareInterface * * @see \Symfony\Component\DependencyInjection\ContainerAwareInterface::setContainer() */ + #[\Override] public function setContainer(?ContainerInterface $container = null) { if (null === $container) { diff --git a/src/Bundle/ChillCustomFieldsBundle/Templating/Twig/CustomFieldRenderingTwig.php b/src/Bundle/ChillCustomFieldsBundle/Templating/Twig/CustomFieldRenderingTwig.php index 6d3d889a8..6e5dfd8fe 100644 --- a/src/Bundle/ChillCustomFieldsBundle/Templating/Twig/CustomFieldRenderingTwig.php +++ b/src/Bundle/ChillCustomFieldsBundle/Templating/Twig/CustomFieldRenderingTwig.php @@ -38,6 +38,7 @@ class CustomFieldRenderingTwig extends AbstractExtension * * @see Twig_Extension::getFunctions() */ + #[\Override] public function getFunctions() { return [ diff --git a/src/Bundle/ChillCustomFieldsBundle/Templating/Twig/CustomFieldsGroupRenderingTwig.php b/src/Bundle/ChillCustomFieldsBundle/Templating/Twig/CustomFieldsGroupRenderingTwig.php index 57add2733..a67d42370 100644 --- a/src/Bundle/ChillCustomFieldsBundle/Templating/Twig/CustomFieldsGroupRenderingTwig.php +++ b/src/Bundle/ChillCustomFieldsBundle/Templating/Twig/CustomFieldsGroupRenderingTwig.php @@ -43,6 +43,7 @@ final class CustomFieldsGroupRenderingTwig extends AbstractExtension * * @see Twig_Extension::getFunctions() */ + #[\Override] public function getFunctions() { return [ diff --git a/src/Bundle/ChillCustomFieldsBundle/Tests/CustomFields/CustomFieldsChoiceTest.php b/src/Bundle/ChillCustomFieldsBundle/Tests/CustomFields/CustomFieldsChoiceTest.php index 6f6ba394e..45f2a59d7 100644 --- a/src/Bundle/ChillCustomFieldsBundle/Tests/CustomFields/CustomFieldsChoiceTest.php +++ b/src/Bundle/ChillCustomFieldsBundle/Tests/CustomFields/CustomFieldsChoiceTest.php @@ -35,6 +35,7 @@ final class CustomFieldsChoiceTest extends KernelTestCase private ?object $cfProvider = null; + #[\Override] protected function setUp(): void { self::bootKernel(); @@ -44,6 +45,7 @@ final class CustomFieldsChoiceTest extends KernelTestCase $this->cfChoice = $this->cfProvider->getCustomFieldByType('choice'); } + #[\Override] protected function tearDown(): void { parent::tearDown(); diff --git a/src/Bundle/ChillCustomFieldsBundle/Tests/CustomFields/CustomFieldsNumberTest.php b/src/Bundle/ChillCustomFieldsBundle/Tests/CustomFields/CustomFieldsNumberTest.php index 235631e24..bda389b88 100644 --- a/src/Bundle/ChillCustomFieldsBundle/Tests/CustomFields/CustomFieldsNumberTest.php +++ b/src/Bundle/ChillCustomFieldsBundle/Tests/CustomFields/CustomFieldsNumberTest.php @@ -30,6 +30,7 @@ final class CustomFieldsNumberTest extends \Symfony\Bundle\FrameworkBundle\Test\ */ private $formBuilder; + #[\Override] protected function setUp(): void { self::bootKernel(); diff --git a/src/Bundle/ChillCustomFieldsBundle/Tests/CustomFields/CustomFieldsTextTest.php b/src/Bundle/ChillCustomFieldsBundle/Tests/CustomFields/CustomFieldsTextTest.php index 2d1268e71..b404a5f71 100644 --- a/src/Bundle/ChillCustomFieldsBundle/Tests/CustomFields/CustomFieldsTextTest.php +++ b/src/Bundle/ChillCustomFieldsBundle/Tests/CustomFields/CustomFieldsTextTest.php @@ -27,6 +27,7 @@ final class CustomFieldsTextTest extends WebTestCase private ?object $customFieldProvider = null; + #[\Override] protected function setUp(): void { self::bootKernel(); diff --git a/src/Bundle/ChillCustomFieldsBundle/Tests/Form/Extension/PostTextIntegerExtensionTest.php b/src/Bundle/ChillCustomFieldsBundle/Tests/Form/Extension/PostTextIntegerExtensionTest.php index d6327829a..3499b067e 100644 --- a/src/Bundle/ChillCustomFieldsBundle/Tests/Form/Extension/PostTextIntegerExtensionTest.php +++ b/src/Bundle/ChillCustomFieldsBundle/Tests/Form/Extension/PostTextIntegerExtensionTest.php @@ -28,6 +28,7 @@ final class PostTextIntegerExtensionTest extends KernelTestCase */ private $formBuilder; + #[\Override] protected function setUp(): void { self::bootKernel(); diff --git a/src/Bundle/ChillCustomFieldsBundle/Tests/Form/Extension/PostTextNumberExtensionTest.php b/src/Bundle/ChillCustomFieldsBundle/Tests/Form/Extension/PostTextNumberExtensionTest.php index 4a905ae1b..74b1ea858 100644 --- a/src/Bundle/ChillCustomFieldsBundle/Tests/Form/Extension/PostTextNumberExtensionTest.php +++ b/src/Bundle/ChillCustomFieldsBundle/Tests/Form/Extension/PostTextNumberExtensionTest.php @@ -28,6 +28,7 @@ final class PostTextNumberExtensionTest extends KernelTestCase */ private $formBuilder; + #[\Override] protected function setUp(): void { self::bootKernel(); diff --git a/src/Bundle/ChillCustomFieldsBundle/Tests/Service/CustomFieldsHelperTest.php b/src/Bundle/ChillCustomFieldsBundle/Tests/Service/CustomFieldsHelperTest.php index 6d3abbc66..2d96180df 100644 --- a/src/Bundle/ChillCustomFieldsBundle/Tests/Service/CustomFieldsHelperTest.php +++ b/src/Bundle/ChillCustomFieldsBundle/Tests/Service/CustomFieldsHelperTest.php @@ -27,6 +27,7 @@ final class CustomFieldsHelperTest extends KernelTestCase private CustomField $randomCFText; + #[\Override] protected function setUp(): void { self::bootKernel(); diff --git a/src/Bundle/ChillCustomFieldsBundle/Tests/Templating/Twig/CustomFieldRenderingTwigTest.php b/src/Bundle/ChillCustomFieldsBundle/Tests/Templating/Twig/CustomFieldRenderingTwigTest.php index 04376b84a..e3f2fab76 100644 --- a/src/Bundle/ChillCustomFieldsBundle/Tests/Templating/Twig/CustomFieldRenderingTwigTest.php +++ b/src/Bundle/ChillCustomFieldsBundle/Tests/Templating/Twig/CustomFieldRenderingTwigTest.php @@ -27,6 +27,7 @@ final class CustomFieldRenderingTwigTest extends KernelTestCase private ?object $cfRendering = null; + #[\Override] protected function setUp(): void { self::bootKernel(); diff --git a/src/Bundle/ChillCustomFieldsBundle/Tests/Templating/Twig/CustomFieldsGroupRenderingTwigTest.php b/src/Bundle/ChillCustomFieldsBundle/Tests/Templating/Twig/CustomFieldsGroupRenderingTwigTest.php index 07da58cbc..b632c21cb 100644 --- a/src/Bundle/ChillCustomFieldsBundle/Tests/Templating/Twig/CustomFieldsGroupRenderingTwigTest.php +++ b/src/Bundle/ChillCustomFieldsBundle/Tests/Templating/Twig/CustomFieldsGroupRenderingTwigTest.php @@ -29,6 +29,7 @@ final class CustomFieldsGroupRenderingTwigTest extends KernelTestCase private ?object $cfRendering = null; + #[\Override] protected function setUp(): void { self::bootKernel(); diff --git a/src/Bundle/ChillCustomFieldsBundle/migrations/Version20141128195430.php b/src/Bundle/ChillCustomFieldsBundle/migrations/Version20141128195430.php index f96a578da..7da717dd2 100644 --- a/src/Bundle/ChillCustomFieldsBundle/migrations/Version20141128195430.php +++ b/src/Bundle/ChillCustomFieldsBundle/migrations/Version20141128195430.php @@ -19,11 +19,13 @@ use Doctrine\Migrations\AbstractMigration; */ class Version20141128195430 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { // this down() migration is auto-generated, please modify it to your needs } + #[\Override] public function up(Schema $schema): void { $this->addSql('CREATE SEQUENCE CustomField_id_seq INCREMENT BY 1 MINVALUE 1 START 1;'); diff --git a/src/Bundle/ChillCustomFieldsBundle/migrations/Version20150224164531.php b/src/Bundle/ChillCustomFieldsBundle/migrations/Version20150224164531.php index 9470e932c..d67f018dc 100644 --- a/src/Bundle/ChillCustomFieldsBundle/migrations/Version20150224164531.php +++ b/src/Bundle/ChillCustomFieldsBundle/migrations/Version20150224164531.php @@ -19,11 +19,13 @@ use Doctrine\Migrations\AbstractMigration; */ class Version20150224164531 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->addSql('ALTER TABLE CustomFieldsGroup DROP options'); } + #[\Override] public function up(Schema $schema): void { $this->addSql('ALTER TABLE customfieldsgroup ADD options JSON DEFAULT \'{}\'::json'); diff --git a/src/Bundle/ChillCustomFieldsBundle/migrations/Version20151210155904.php b/src/Bundle/ChillCustomFieldsBundle/migrations/Version20151210155904.php index c8804c378..855364c8e 100644 --- a/src/Bundle/ChillCustomFieldsBundle/migrations/Version20151210155904.php +++ b/src/Bundle/ChillCustomFieldsBundle/migrations/Version20151210155904.php @@ -19,6 +19,7 @@ use Doctrine\Migrations\AbstractMigration; */ class Version20151210155904 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { // this down() migration is auto-generated, please modify it to your needs @@ -27,6 +28,7 @@ class Version20151210155904 extends AbstractMigration $this->addSql('ALTER TABLE CustomField DROP required'); } + #[\Override] public function up(Schema $schema): void { // this up() migration is auto-generated, please modify it to your needs diff --git a/src/Bundle/ChillCustomFieldsBundle/migrations/Version20151210205610.php b/src/Bundle/ChillCustomFieldsBundle/migrations/Version20151210205610.php index 1f3211aa3..cc53de67b 100644 --- a/src/Bundle/ChillCustomFieldsBundle/migrations/Version20151210205610.php +++ b/src/Bundle/ChillCustomFieldsBundle/migrations/Version20151210205610.php @@ -19,6 +19,7 @@ use Doctrine\Migrations\AbstractMigration; */ class Version20151210205610 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { // this down() migration is auto-generated, please modify it to your needs @@ -29,6 +30,7 @@ class Version20151210205610 extends AbstractMigration $this->addSql('DROP TABLE custom_field_long_choice_options'); } + #[\Override] public function up(Schema $schema): void { $this->abortIf('postgresql' !== $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'postgresql\'.'); diff --git a/src/Bundle/ChillDocGeneratorBundle/ChillDocGeneratorBundle.php b/src/Bundle/ChillDocGeneratorBundle/ChillDocGeneratorBundle.php index c81bcd372..3d422486b 100644 --- a/src/Bundle/ChillDocGeneratorBundle/ChillDocGeneratorBundle.php +++ b/src/Bundle/ChillDocGeneratorBundle/ChillDocGeneratorBundle.php @@ -17,6 +17,7 @@ use Symfony\Component\HttpKernel\Bundle\Bundle; class ChillDocGeneratorBundle extends Bundle { + #[\Override] public function build(ContainerBuilder $container) { parent::build($container); diff --git a/src/Bundle/ChillDocGeneratorBundle/Context/ContextManager.php b/src/Bundle/ChillDocGeneratorBundle/Context/ContextManager.php index afcf6fab1..9a45b0991 100644 --- a/src/Bundle/ChillDocGeneratorBundle/Context/ContextManager.php +++ b/src/Bundle/ChillDocGeneratorBundle/Context/ContextManager.php @@ -21,6 +21,7 @@ final readonly class ContextManager implements ContextManagerInterface */ public function __construct(private iterable $contexts) {} + #[\Override] public function getContextByDocGeneratorTemplate(DocGeneratorTemplate $docGeneratorTemplate): DocGeneratorContextInterface { foreach ($this->contexts as $key => $context) { @@ -32,6 +33,7 @@ final readonly class ContextManager implements ContextManagerInterface throw new ContextNotFoundException($docGeneratorTemplate->getContext()); } + #[\Override] public function getContextByKey(string $searchedKey): DocGeneratorContextInterface { foreach ($this->contexts as $key => $context) { @@ -43,6 +45,7 @@ final readonly class ContextManager implements ContextManagerInterface throw new ContextNotFoundException($searchedKey); } + #[\Override] public function getContexts(): array { return iterator_to_array($this->contexts); diff --git a/src/Bundle/ChillDocGeneratorBundle/Controller/AdminDocGeneratorTemplateController.php b/src/Bundle/ChillDocGeneratorBundle/Controller/AdminDocGeneratorTemplateController.php index 04fa9ce07..3f4fab86c 100644 --- a/src/Bundle/ChillDocGeneratorBundle/Controller/AdminDocGeneratorTemplateController.php +++ b/src/Bundle/ChillDocGeneratorBundle/Controller/AdminDocGeneratorTemplateController.php @@ -24,6 +24,7 @@ class AdminDocGeneratorTemplateController extends CRUDController { public function __construct(private readonly ContextManager $contextManager) {} + #[\Override] public function generateTemplateParameter(string $action, $entity, Request $request, array $defaultTemplateParameters = []) { switch ($action) { @@ -49,6 +50,7 @@ class AdminDocGeneratorTemplateController extends CRUDController } } + #[\Override] public function new(Request $request): Response { if (!$request->query->has('context')) { @@ -68,6 +70,7 @@ class AdminDocGeneratorTemplateController extends CRUDController ]); } + #[\Override] protected function createEntity(string $action, Request $request): object { /** @var DocGeneratorTemplate $entity */ @@ -85,6 +88,7 @@ class AdminDocGeneratorTemplateController extends CRUDController * * @return QueryBuilder|mixed */ + #[\Override] protected function orderQuery(string $action, $query, Request $request, PaginatorInterface $paginator) { return $query->addSelect('JSON_EXTRACT(e.name, :lang) AS HIDDEN name_lang') diff --git a/src/Bundle/ChillDocGeneratorBundle/DataFixtures/ORM/LoadDocGeneratorTemplate.php b/src/Bundle/ChillDocGeneratorBundle/DataFixtures/ORM/LoadDocGeneratorTemplate.php index 97d436c5e..c49a54629 100644 --- a/src/Bundle/ChillDocGeneratorBundle/DataFixtures/ORM/LoadDocGeneratorTemplate.php +++ b/src/Bundle/ChillDocGeneratorBundle/DataFixtures/ORM/LoadDocGeneratorTemplate.php @@ -23,6 +23,7 @@ use Doctrine\Persistence\ObjectManager; */ class LoadDocGeneratorTemplate extends AbstractFixture { + #[\Override] public function load(ObjectManager $manager) { $templates = [ diff --git a/src/Bundle/ChillDocGeneratorBundle/DependencyInjection/ChillDocGeneratorExtension.php b/src/Bundle/ChillDocGeneratorBundle/DependencyInjection/ChillDocGeneratorExtension.php index f42462dc8..d3f7f3ec3 100644 --- a/src/Bundle/ChillDocGeneratorBundle/DependencyInjection/ChillDocGeneratorExtension.php +++ b/src/Bundle/ChillDocGeneratorBundle/DependencyInjection/ChillDocGeneratorExtension.php @@ -24,6 +24,7 @@ use Symfony\Component\HttpKernel\DependencyInjection\Extension; */ class ChillDocGeneratorExtension extends Extension implements PrependExtensionInterface { + #[\Override] public function load(array $configs, ContainerBuilder $container) { $configuration = new Configuration(); @@ -36,6 +37,7 @@ class ChillDocGeneratorExtension extends Extension implements PrependExtensionIn $loader->load('services/form.yaml'); } + #[\Override] public function prepend(ContainerBuilder $container) { $this->preprendRoutes($container); diff --git a/src/Bundle/ChillDocGeneratorBundle/DependencyInjection/Configuration.php b/src/Bundle/ChillDocGeneratorBundle/DependencyInjection/Configuration.php index 495121f91..137ec5ed1 100644 --- a/src/Bundle/ChillDocGeneratorBundle/DependencyInjection/Configuration.php +++ b/src/Bundle/ChillDocGeneratorBundle/DependencyInjection/Configuration.php @@ -16,6 +16,7 @@ use Symfony\Component\Config\Definition\ConfigurationInterface; class Configuration implements ConfigurationInterface { + #[\Override] public function getConfigTreeBuilder() { $treeBuilder = new TreeBuilder('chill_doc_generator'); diff --git a/src/Bundle/ChillDocGeneratorBundle/Form/DocGeneratorTemplateType.php b/src/Bundle/ChillDocGeneratorBundle/Form/DocGeneratorTemplateType.php index 1b87ef926..b374dd9e9 100644 --- a/src/Bundle/ChillDocGeneratorBundle/Form/DocGeneratorTemplateType.php +++ b/src/Bundle/ChillDocGeneratorBundle/Form/DocGeneratorTemplateType.php @@ -26,6 +26,7 @@ class DocGeneratorTemplateType extends AbstractType { public function __construct(private readonly ContextManager $contextManager) {} + #[\Override] public function buildForm(FormBuilderInterface $builder, array $options) { /** @var DocGeneratorTemplate $template */ @@ -64,6 +65,7 @@ class DocGeneratorTemplateType extends AbstractType } } + #[\Override] public function configureOptions(OptionsResolver $resolver) { $resolver diff --git a/src/Bundle/ChillDocGeneratorBundle/GeneratorDriver/RelatorioDriver.php b/src/Bundle/ChillDocGeneratorBundle/GeneratorDriver/RelatorioDriver.php index 1ee3f0ba1..38f8048c3 100644 --- a/src/Bundle/ChillDocGeneratorBundle/GeneratorDriver/RelatorioDriver.php +++ b/src/Bundle/ChillDocGeneratorBundle/GeneratorDriver/RelatorioDriver.php @@ -33,6 +33,7 @@ final readonly class RelatorioDriver implements DriverInterface $this->url = $parameterBag->get('chill_doc_generator')['driver']['relatorio']['url']; } + #[\Override] public function generateFromString(string $template, string $resourceType, array $data, ?string $templateName = null): string { $form = new FormDataPart( diff --git a/src/Bundle/ChillDocGeneratorBundle/Menu/AdminMenuBuilder.php b/src/Bundle/ChillDocGeneratorBundle/Menu/AdminMenuBuilder.php index 8796b8e39..5644b2e80 100644 --- a/src/Bundle/ChillDocGeneratorBundle/Menu/AdminMenuBuilder.php +++ b/src/Bundle/ChillDocGeneratorBundle/Menu/AdminMenuBuilder.php @@ -20,6 +20,7 @@ class AdminMenuBuilder implements LocalMenuBuilderInterface { public function __construct(private readonly TranslatorInterface $translator, private readonly Security $security) {} + #[\Override] public function buildMenu($menuId, MenuItem $menu, array $parameters) { if ($this->security->isGranted('ROLE_ADMIN')) { @@ -32,6 +33,7 @@ class AdminMenuBuilder implements LocalMenuBuilderInterface } } + #[\Override] public static function getMenuIds(): array { return ['admin_section', 'admin_docstore']; diff --git a/src/Bundle/ChillDocGeneratorBundle/Repository/DocGeneratorTemplateRepository.php b/src/Bundle/ChillDocGeneratorBundle/Repository/DocGeneratorTemplateRepository.php index 498daf7ba..09877ccb6 100644 --- a/src/Bundle/ChillDocGeneratorBundle/Repository/DocGeneratorTemplateRepository.php +++ b/src/Bundle/ChillDocGeneratorBundle/Repository/DocGeneratorTemplateRepository.php @@ -25,6 +25,7 @@ final readonly class DocGeneratorTemplateRepository implements DocGeneratorTempl $this->repository = $entityManager->getRepository(DocGeneratorTemplate::class); } + #[\Override] public function countByEntity(string $entity): int { $builder = $this->repository->createQueryBuilder('t'); @@ -38,6 +39,7 @@ final readonly class DocGeneratorTemplateRepository implements DocGeneratorTempl return $builder->getQuery()->getSingleScalarResult(); } + #[\Override] public function find($id, $lockMode = null, $lockVersion = null): ?DocGeneratorTemplate { return $this->repository->find($id, $lockMode, $lockVersion); @@ -46,6 +48,7 @@ final readonly class DocGeneratorTemplateRepository implements DocGeneratorTempl /** * @return DocGeneratorTemplate[] */ + #[\Override] public function findAll(): array { return $this->repository->findAll(); @@ -57,6 +60,7 @@ final readonly class DocGeneratorTemplateRepository implements DocGeneratorTempl * * @return DocGeneratorTemplate[] */ + #[\Override] public function findBy(array $criteria, ?array $orderBy = null, $limit = null, $offset = null): array { return $this->repository->findBy($criteria, $orderBy, $limit, $offset); @@ -84,11 +88,13 @@ final readonly class DocGeneratorTemplateRepository implements DocGeneratorTempl ->getResult(); } + #[\Override] public function findOneBy(array $criteria, ?array $orderBy = null): ?DocGeneratorTemplate { return $this->repository->findOneBy($criteria, $orderBy); } + #[\Override] public function getClassName() { return DocGeneratorTemplate::class; diff --git a/src/Bundle/ChillDocGeneratorBundle/Serializer/Encoder/DocGenEncoder.php b/src/Bundle/ChillDocGeneratorBundle/Serializer/Encoder/DocGenEncoder.php index bcf73abd0..a3c515234 100644 --- a/src/Bundle/ChillDocGeneratorBundle/Serializer/Encoder/DocGenEncoder.php +++ b/src/Bundle/ChillDocGeneratorBundle/Serializer/Encoder/DocGenEncoder.php @@ -16,6 +16,7 @@ use Symfony\Component\Serializer\Exception\UnexpectedValueException; class DocGenEncoder implements EncoderInterface { + #[\Override] public function encode($data, $format, array $context = []) { if (!$this->isAssociative($data)) { @@ -28,6 +29,7 @@ class DocGenEncoder implements EncoderInterface return $result; } + #[\Override] public function supportsEncoding($format) { return 'docgen' === $format; diff --git a/src/Bundle/ChillDocGeneratorBundle/Serializer/Normalizer/CollectionDocGenNormalizer.php b/src/Bundle/ChillDocGeneratorBundle/Serializer/Normalizer/CollectionDocGenNormalizer.php index 55c53c1d9..33aff4017 100644 --- a/src/Bundle/ChillDocGeneratorBundle/Serializer/Normalizer/CollectionDocGenNormalizer.php +++ b/src/Bundle/ChillDocGeneratorBundle/Serializer/Normalizer/CollectionDocGenNormalizer.php @@ -30,6 +30,7 @@ class CollectionDocGenNormalizer implements ContextAwareNormalizerInterface, Nor * * @return array|\ArrayObject|bool|float|int|string|void|null */ + #[\Override] public function normalize($object, $format = null, array $context = []) { $data = []; @@ -45,6 +46,7 @@ class CollectionDocGenNormalizer implements ContextAwareNormalizerInterface, Nor return $data; } + #[\Override] public function supportsNormalization($data, $format = null, array $context = []) { if ('docgen' !== $format) { diff --git a/src/Bundle/ChillDocGeneratorBundle/Serializer/Normalizer/DocGenObjectNormalizer.php b/src/Bundle/ChillDocGeneratorBundle/Serializer/Normalizer/DocGenObjectNormalizer.php index a19e783d1..38ff89c22 100644 --- a/src/Bundle/ChillDocGeneratorBundle/Serializer/Normalizer/DocGenObjectNormalizer.php +++ b/src/Bundle/ChillDocGeneratorBundle/Serializer/Normalizer/DocGenObjectNormalizer.php @@ -40,6 +40,7 @@ class DocGenObjectNormalizer implements NormalizerAwareInterface, NormalizerInte $this->propertyAccess = PropertyAccess::createPropertyAccessor(); } + #[\Override] public function normalize($object, $format = null, array $context = []) { $classMetadataKey = $object ?? $context['docgen:expects'] ?? null; @@ -79,6 +80,7 @@ class DocGenObjectNormalizer implements NormalizerAwareInterface, NormalizerInte return $this->normalizeObject($object, $format, $context, $expectedGroups, $metadata, $attributes); } + #[\Override] public function supportsNormalization($data, $format = null): bool { return 'docgen' === $format && (\is_object($data) || null === $data); diff --git a/src/Bundle/ChillDocGeneratorBundle/Service/Generator/Generator.php b/src/Bundle/ChillDocGeneratorBundle/Service/Generator/Generator.php index 127d135bb..f0c0859f7 100644 --- a/src/Bundle/ChillDocGeneratorBundle/Service/Generator/Generator.php +++ b/src/Bundle/ChillDocGeneratorBundle/Service/Generator/Generator.php @@ -26,7 +26,7 @@ use Symfony\Component\Yaml\Yaml; class Generator implements GeneratorInterface { - private const LOG_PREFIX = '[docgen generator] '; + private const string LOG_PREFIX = '[docgen generator] '; public function __construct( private readonly ContextManagerInterface $contextManager, @@ -36,6 +36,7 @@ class Generator implements GeneratorInterface private readonly StoredObjectManagerInterface $storedObjectManager ) {} + #[\Override] public function generateDataDump( DocGeneratorTemplate $template, int $entityId, @@ -55,6 +56,7 @@ class Generator implements GeneratorInterface ); } + #[\Override] public function generateDocFromTemplate( DocGeneratorTemplate $template, int $entityId, diff --git a/src/Bundle/ChillDocGeneratorBundle/Service/Messenger/OnAfterMessageHandledClearStoredObjectCache.php b/src/Bundle/ChillDocGeneratorBundle/Service/Messenger/OnAfterMessageHandledClearStoredObjectCache.php index 0256f8a8a..9c46c386b 100644 --- a/src/Bundle/ChillDocGeneratorBundle/Service/Messenger/OnAfterMessageHandledClearStoredObjectCache.php +++ b/src/Bundle/ChillDocGeneratorBundle/Service/Messenger/OnAfterMessageHandledClearStoredObjectCache.php @@ -28,6 +28,7 @@ final readonly class OnAfterMessageHandledClearStoredObjectCache implements Even private LoggerInterface $logger, ) {} + #[\Override] public static function getSubscribedEvents() { return [ diff --git a/src/Bundle/ChillDocGeneratorBundle/Service/Messenger/OnGenerationFails.php b/src/Bundle/ChillDocGeneratorBundle/Service/Messenger/OnGenerationFails.php index e3491f339..8bc838292 100644 --- a/src/Bundle/ChillDocGeneratorBundle/Service/Messenger/OnGenerationFails.php +++ b/src/Bundle/ChillDocGeneratorBundle/Service/Messenger/OnGenerationFails.php @@ -30,7 +30,7 @@ use Symfony\Contracts\Translation\TranslatorInterface; */ final readonly class OnGenerationFails implements EventSubscriberInterface { - public const LOG_PREFIX = '[docgen failed] '; + public const string LOG_PREFIX = '[docgen failed] '; public function __construct( private DocGeneratorTemplateRepositoryInterface $docGeneratorTemplateRepository, @@ -42,6 +42,7 @@ final readonly class OnGenerationFails implements EventSubscriberInterface private UserRepositoryInterface $userRepository ) {} + #[\Override] public static function getSubscribedEvents() { return [ diff --git a/src/Bundle/ChillDocGeneratorBundle/Service/Messenger/RequestGenerationHandler.php b/src/Bundle/ChillDocGeneratorBundle/Service/Messenger/RequestGenerationHandler.php index dbd45fde0..d76eecf99 100644 --- a/src/Bundle/ChillDocGeneratorBundle/Service/Messenger/RequestGenerationHandler.php +++ b/src/Bundle/ChillDocGeneratorBundle/Service/Messenger/RequestGenerationHandler.php @@ -32,9 +32,9 @@ use Symfony\Contracts\Translation\TranslatorInterface; */ class RequestGenerationHandler implements MessageHandlerInterface { - final public const AUTHORIZED_TRIALS = 5; + final public const int AUTHORIZED_TRIALS = 5; - private const LOG_PREFIX = '[docgen message handler] '; + private const string LOG_PREFIX = '[docgen message handler] '; public function __construct( private readonly DocGeneratorTemplateRepository $docGeneratorTemplateRepository, diff --git a/src/Bundle/ChillDocGeneratorBundle/migrations/Version20210805162522.php b/src/Bundle/ChillDocGeneratorBundle/migrations/Version20210805162522.php index 94337386b..fa076c7a2 100644 --- a/src/Bundle/ChillDocGeneratorBundle/migrations/Version20210805162522.php +++ b/src/Bundle/ChillDocGeneratorBundle/migrations/Version20210805162522.php @@ -19,17 +19,20 @@ use Doctrine\Migrations\AbstractMigration; */ final class Version20210805162522 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->addSql('DROP SEQUENCE chill_docgen_template_id_seq CASCADE'); $this->addSql('DROP TABLE chill_docgen_template'); } + #[\Override] public function getDescription(): string { return 'Creation of table for storing DocGenTemplate'; } + #[\Override] public function up(Schema $schema): void { $this->addSql('CREATE SEQUENCE chill_docgen_template_id_seq INCREMENT BY 1 MINVALUE 1 START 1'); diff --git a/src/Bundle/ChillDocGeneratorBundle/migrations/Version20210812214310.php b/src/Bundle/ChillDocGeneratorBundle/migrations/Version20210812214310.php index 17dd03cd7..e66cc085b 100644 --- a/src/Bundle/ChillDocGeneratorBundle/migrations/Version20210812214310.php +++ b/src/Bundle/ChillDocGeneratorBundle/migrations/Version20210812214310.php @@ -19,6 +19,7 @@ use Doctrine\Migrations\AbstractMigration; */ final class Version20210812214310 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->addSql('ALTER TABLE chill_docgen_template DROP entities'); @@ -26,11 +27,13 @@ final class Version20210812214310 extends AbstractMigration $this->addSql('COMMENT ON COLUMN chill_docgen_template.name IS NULL'); } + #[\Override] public function getDescription(): string { return 'Add entities and context fields to DocGenTemplate'; } + #[\Override] public function up(Schema $schema): void { $this->addSql('ALTER TABLE chill_docgen_template ADD entities TEXT'); diff --git a/src/Bundle/ChillDocGeneratorBundle/migrations/Version20211103111010.php b/src/Bundle/ChillDocGeneratorBundle/migrations/Version20211103111010.php index 882e98ba8..9f5ccb7d7 100644 --- a/src/Bundle/ChillDocGeneratorBundle/migrations/Version20211103111010.php +++ b/src/Bundle/ChillDocGeneratorBundle/migrations/Version20211103111010.php @@ -19,6 +19,7 @@ use Doctrine\Migrations\AbstractMigration; */ final class Version20211103111010 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->addSql('ALTER TABLE chill_docgen_template DROP CONSTRAINT FK_49A347E893CB796C'); @@ -29,11 +30,13 @@ final class Version20211103111010 extends AbstractMigration $this->addSql('ALTER TABLE chill_docgen_template ALTER context DROP NOT NULL'); } + #[\Override] public function getDescription(): string { return 'Using DocStore objects inside the DocGenTemplate'; } + #[\Override] public function up(Schema $schema): void { $this->addSql('ALTER TABLE chill_docgen_template ADD file_id INT DEFAULT NULL'); diff --git a/src/Bundle/ChillDocGeneratorBundle/migrations/Version20211119173556.php b/src/Bundle/ChillDocGeneratorBundle/migrations/Version20211119173556.php index 068ffdee6..fb7dd6162 100644 --- a/src/Bundle/ChillDocGeneratorBundle/migrations/Version20211119173556.php +++ b/src/Bundle/ChillDocGeneratorBundle/migrations/Version20211119173556.php @@ -16,16 +16,19 @@ use Doctrine\Migrations\AbstractMigration; final class Version20211119173556 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->throwIrreversibleMigrationException(); } + #[\Override] public function getDescription(): string { return 'remove comment on deprecated json_array type'; } + #[\Override] public function up(Schema $schema): void { $columns = [ diff --git a/src/Bundle/ChillDocGeneratorBundle/migrations/Version20211201191757.php b/src/Bundle/ChillDocGeneratorBundle/migrations/Version20211201191757.php index 28c908a86..0b05e7036 100644 --- a/src/Bundle/ChillDocGeneratorBundle/migrations/Version20211201191757.php +++ b/src/Bundle/ChillDocGeneratorBundle/migrations/Version20211201191757.php @@ -16,6 +16,7 @@ use Doctrine\Migrations\AbstractMigration; final class Version20211201191757 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->addSql('ALTER TABLE chill_docgen_template DROP active'); @@ -25,11 +26,13 @@ final class Version20211201191757 extends AbstractMigration $this->addSql('COMMENT ON COLUMN chill_docgen_template.entities IS \'(DC2Type:simple_array)\''); } + #[\Override] public function getDescription(): string { return 'Add options, active and link to entity in docgen_template'; } + #[\Override] public function up(Schema $schema): void { $this->addSql('ALTER TABLE chill_docgen_template ADD active BOOLEAN DEFAULT true NOT NULL'); diff --git a/src/Bundle/ChillDocGeneratorBundle/migrations/Version20230214192558.php b/src/Bundle/ChillDocGeneratorBundle/migrations/Version20230214192558.php index 176256924..7c9620d3c 100644 --- a/src/Bundle/ChillDocGeneratorBundle/migrations/Version20230214192558.php +++ b/src/Bundle/ChillDocGeneratorBundle/migrations/Version20230214192558.php @@ -16,11 +16,13 @@ use Doctrine\Migrations\AbstractMigration; final class Version20230214192558 extends AbstractMigration { + #[\Override] public function getDescription(): string { return 'Add status, template_id and fix defaults on chill_doc.stored_object'; } + #[\Override] public function up(Schema $schema): void { $this->addSql('ALTER TABLE chill_doc.stored_object ADD template_id INT DEFAULT NULL'); @@ -38,6 +40,7 @@ final class Version20230214192558 extends AbstractMigration $this->addSql('CREATE INDEX IDX_49604E363174800F ON chill_doc.stored_object (createdBy_id)'); } + #[\Override] public function down(Schema $schema): void { $this->addSql('ALTER TABLE chill_doc.stored_object DROP CONSTRAINT FK_49604E365DA0FB8'); diff --git a/src/Bundle/ChillDocGeneratorBundle/tests/Serializer/Encoder/DocGenEncoderTest.php b/src/Bundle/ChillDocGeneratorBundle/tests/Serializer/Encoder/DocGenEncoderTest.php index b48f19719..55ef96353 100644 --- a/src/Bundle/ChillDocGeneratorBundle/tests/Serializer/Encoder/DocGenEncoderTest.php +++ b/src/Bundle/ChillDocGeneratorBundle/tests/Serializer/Encoder/DocGenEncoderTest.php @@ -24,6 +24,7 @@ final class DocGenEncoderTest extends TestCase { private DocGenEncoder $encoder; + #[\Override] protected function setUp(): void { parent::setUp(); diff --git a/src/Bundle/ChillDocGeneratorBundle/tests/Serializer/Normalizer/CollectionDocGenNormalizerTest.php b/src/Bundle/ChillDocGeneratorBundle/tests/Serializer/Normalizer/CollectionDocGenNormalizerTest.php index 5f16f8be3..38e849f1a 100644 --- a/src/Bundle/ChillDocGeneratorBundle/tests/Serializer/Normalizer/CollectionDocGenNormalizerTest.php +++ b/src/Bundle/ChillDocGeneratorBundle/tests/Serializer/Normalizer/CollectionDocGenNormalizerTest.php @@ -25,6 +25,7 @@ class CollectionDocGenNormalizerTest extends KernelTestCase { private NormalizerInterface $normalizer; + #[\Override] protected function setUp(): void { self::bootKernel(); diff --git a/src/Bundle/ChillDocGeneratorBundle/tests/Serializer/Normalizer/DocGenObjectNormalizerTest.php b/src/Bundle/ChillDocGeneratorBundle/tests/Serializer/Normalizer/DocGenObjectNormalizerTest.php index c45ac5e20..5398dcddd 100644 --- a/src/Bundle/ChillDocGeneratorBundle/tests/Serializer/Normalizer/DocGenObjectNormalizerTest.php +++ b/src/Bundle/ChillDocGeneratorBundle/tests/Serializer/Normalizer/DocGenObjectNormalizerTest.php @@ -31,6 +31,7 @@ final class DocGenObjectNormalizerTest extends KernelTestCase { private NormalizerInterface $normalizer; + #[\Override] protected function setUp(): void { self::bootKernel(); diff --git a/src/Bundle/ChillDocGeneratorBundle/tests/Service/Context/BaseContextDataTest.php b/src/Bundle/ChillDocGeneratorBundle/tests/Service/Context/BaseContextDataTest.php index ee5a6cc62..5743958da 100644 --- a/src/Bundle/ChillDocGeneratorBundle/tests/Service/Context/BaseContextDataTest.php +++ b/src/Bundle/ChillDocGeneratorBundle/tests/Service/Context/BaseContextDataTest.php @@ -26,6 +26,7 @@ final class BaseContextDataTest extends KernelTestCase { use ProphecyTrait; + #[\Override] protected function setUp(): void { self::bootKernel(); diff --git a/src/Bundle/ChillDocStoreBundle/AsyncUpload/Command/ConfigureOpenstackObjectStorageCommand.php b/src/Bundle/ChillDocStoreBundle/AsyncUpload/Command/ConfigureOpenstackObjectStorageCommand.php index fd1b41481..3843d7757 100644 --- a/src/Bundle/ChillDocStoreBundle/AsyncUpload/Command/ConfigureOpenstackObjectStorageCommand.php +++ b/src/Bundle/ChillDocStoreBundle/AsyncUpload/Command/ConfigureOpenstackObjectStorageCommand.php @@ -36,6 +36,7 @@ class ConfigureOpenstackObjectStorageCommand extends Command parent::__construct(); } + #[\Override] protected function configure() { $this @@ -45,6 +46,7 @@ class ConfigureOpenstackObjectStorageCommand extends Command ; } + #[\Override] protected function interact(InputInterface $input, OutputInterface $output) { if (!$input->hasOption('os_token')) { @@ -60,6 +62,7 @@ class ConfigureOpenstackObjectStorageCommand extends Command } } + #[\Override] protected function execute(InputInterface $input, OutputInterface $output): int { $domains = trim(implode(' ', $input->getOption('domain'))); diff --git a/src/Bundle/ChillDocStoreBundle/AsyncUpload/Driver/OpenstackObjectStore/TempUrlOpenstackGenerator.php b/src/Bundle/ChillDocStoreBundle/AsyncUpload/Driver/OpenstackObjectStore/TempUrlOpenstackGenerator.php index e410529b4..153be074a 100644 --- a/src/Bundle/ChillDocStoreBundle/AsyncUpload/Driver/OpenstackObjectStore/TempUrlOpenstackGenerator.php +++ b/src/Bundle/ChillDocStoreBundle/AsyncUpload/Driver/OpenstackObjectStore/TempUrlOpenstackGenerator.php @@ -26,7 +26,7 @@ use Symfony\Component\EventDispatcher\EventDispatcherInterface; */ final readonly class TempUrlOpenstackGenerator implements TempUrlGeneratorInterface { - private const CHARACTERS = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; + private const string CHARACTERS = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; private string $base_url; private string $key; @@ -54,6 +54,7 @@ final readonly class TempUrlOpenstackGenerator implements TempUrlGeneratorInterf /** * @throws TempUrlGeneratorException */ + #[\Override] public function generatePost( ?int $expire_delay = null, ?int $submit_delay = null, @@ -112,6 +113,7 @@ final readonly class TempUrlOpenstackGenerator implements TempUrlGeneratorInterf /** * Generate an absolute public url for a GET request on the object. */ + #[\Override] public function generate(string $method, string $object_name, ?int $expire_delay = null): SignedUrl { if ($expire_delay > $this->max_expire_delay) { diff --git a/src/Bundle/ChillDocStoreBundle/AsyncUpload/Event/TempUrlGenerateEvent.php b/src/Bundle/ChillDocStoreBundle/AsyncUpload/Event/TempUrlGenerateEvent.php index 619dba4e0..93a804a67 100644 --- a/src/Bundle/ChillDocStoreBundle/AsyncUpload/Event/TempUrlGenerateEvent.php +++ b/src/Bundle/ChillDocStoreBundle/AsyncUpload/Event/TempUrlGenerateEvent.php @@ -15,7 +15,7 @@ use Chill\DocStoreBundle\AsyncUpload\SignedUrl; final class TempUrlGenerateEvent extends \Symfony\Contracts\EventDispatcher\Event { - final public const NAME_GENERATE = 'async_uploader.generate_url'; + final public const string NAME_GENERATE = 'async_uploader.generate_url'; public function __construct(private readonly SignedUrl $data) {} diff --git a/src/Bundle/ChillDocStoreBundle/AsyncUpload/Templating/AsyncUploadExtension.php b/src/Bundle/ChillDocStoreBundle/AsyncUpload/Templating/AsyncUploadExtension.php index e7c3e6cf0..22f8e5032 100644 --- a/src/Bundle/ChillDocStoreBundle/AsyncUpload/Templating/AsyncUploadExtension.php +++ b/src/Bundle/ChillDocStoreBundle/AsyncUpload/Templating/AsyncUploadExtension.php @@ -28,6 +28,7 @@ class AsyncUploadExtension extends AbstractExtension private readonly UrlGeneratorInterface $routingUrlGenerator ) {} + #[\Override] public function getFilters() { return [ diff --git a/src/Bundle/ChillDocStoreBundle/ChillDocStoreBundle.php b/src/Bundle/ChillDocStoreBundle/ChillDocStoreBundle.php index 8dcbe72c3..734c0862c 100644 --- a/src/Bundle/ChillDocStoreBundle/ChillDocStoreBundle.php +++ b/src/Bundle/ChillDocStoreBundle/ChillDocStoreBundle.php @@ -19,6 +19,7 @@ use Symfony\Component\HttpKernel\Bundle\Bundle; class ChillDocStoreBundle extends Bundle { + #[\Override] public function build(ContainerBuilder $container) { $container->registerForAutoconfiguration(GenericDocForAccompanyingPeriodProviderInterface::class) diff --git a/src/Bundle/ChillDocStoreBundle/DataFixtures/ORM/LoadDocumentACL.php b/src/Bundle/ChillDocStoreBundle/DataFixtures/ORM/LoadDocumentACL.php index 1217c2a12..1290f8d4f 100644 --- a/src/Bundle/ChillDocStoreBundle/DataFixtures/ORM/LoadDocumentACL.php +++ b/src/Bundle/ChillDocStoreBundle/DataFixtures/ORM/LoadDocumentACL.php @@ -24,11 +24,13 @@ use Doctrine\Persistence\ObjectManager; */ class LoadDocumentACL extends AbstractFixture implements OrderedFixtureInterface { + #[\Override] public function getOrder() { return 35000; } + #[\Override] public function load(ObjectManager $manager) { foreach (LoadPermissionsGroup::$refs as $permissionsGroupRef) { diff --git a/src/Bundle/ChillDocStoreBundle/DataFixtures/ORM/LoadDocumentCategory.php b/src/Bundle/ChillDocStoreBundle/DataFixtures/ORM/LoadDocumentCategory.php index 92c3780fe..1a0663301 100644 --- a/src/Bundle/ChillDocStoreBundle/DataFixtures/ORM/LoadDocumentCategory.php +++ b/src/Bundle/ChillDocStoreBundle/DataFixtures/ORM/LoadDocumentCategory.php @@ -18,11 +18,13 @@ use Doctrine\Persistence\ObjectManager; class LoadDocumentCategory extends AbstractFixture implements OrderedFixtureInterface { + #[\Override] public function getOrder() { return 35010; } + #[\Override] public function load(ObjectManager $manager) { $category = (new DocumentCategory('chill-doc-store', 10)) diff --git a/src/Bundle/ChillDocStoreBundle/Dav/Request/PropfindRequestAnalyzer.php b/src/Bundle/ChillDocStoreBundle/Dav/Request/PropfindRequestAnalyzer.php index e6c52a193..59c28fd38 100644 --- a/src/Bundle/ChillDocStoreBundle/Dav/Request/PropfindRequestAnalyzer.php +++ b/src/Bundle/ChillDocStoreBundle/Dav/Request/PropfindRequestAnalyzer.php @@ -18,7 +18,7 @@ use Chill\DocStoreBundle\Dav\Exception\ParseRequestException; */ class PropfindRequestAnalyzer { - private const KNOWN_PROPS = [ + private const array KNOWN_PROPS = [ 'resourceType', 'contentType', 'lastModified', diff --git a/src/Bundle/ChillDocStoreBundle/DependencyInjection/ChillDocStoreExtension.php b/src/Bundle/ChillDocStoreBundle/DependencyInjection/ChillDocStoreExtension.php index fe9aeecfa..c3c1ce059 100644 --- a/src/Bundle/ChillDocStoreBundle/DependencyInjection/ChillDocStoreExtension.php +++ b/src/Bundle/ChillDocStoreBundle/DependencyInjection/ChillDocStoreExtension.php @@ -28,6 +28,7 @@ use Symfony\Component\HttpKernel\DependencyInjection\Extension; */ class ChillDocStoreExtension extends Extension implements PrependExtensionInterface { + #[\Override] public function load(array $configs, ContainerBuilder $container) { $configuration = new Configuration(); @@ -44,6 +45,7 @@ class ChillDocStoreExtension extends Extension implements PrependExtensionInterf $loader->load('services/templating.yaml'); } + #[\Override] public function prepend(ContainerBuilder $container) { $this->prependRoute($container); diff --git a/src/Bundle/ChillDocStoreBundle/DependencyInjection/Configuration.php b/src/Bundle/ChillDocStoreBundle/DependencyInjection/Configuration.php index 7c6a08f80..3c2bbb0be 100644 --- a/src/Bundle/ChillDocStoreBundle/DependencyInjection/Configuration.php +++ b/src/Bundle/ChillDocStoreBundle/DependencyInjection/Configuration.php @@ -22,6 +22,7 @@ use Symfony\Component\Config\Definition\ConfigurationInterface; */ class Configuration implements ConfigurationInterface { + #[\Override] public function getConfigTreeBuilder() { $treeBuilder = new TreeBuilder('chill_doc_store'); diff --git a/src/Bundle/ChillDocStoreBundle/Entity/AccompanyingCourseDocument.php b/src/Bundle/ChillDocStoreBundle/Entity/AccompanyingCourseDocument.php index d0e72e74f..8ad915659 100644 --- a/src/Bundle/ChillDocStoreBundle/Entity/AccompanyingCourseDocument.php +++ b/src/Bundle/ChillDocStoreBundle/Entity/AccompanyingCourseDocument.php @@ -29,6 +29,7 @@ class AccompanyingCourseDocument extends Document implements HasScopesInterface, #[ORM\Column(type: \Doctrine\DBAL\Types\Types::INTEGER)] private ?int $id = null; + #[\Override] public function getCenters(): ?iterable { return $this->course->getCenters(); @@ -44,6 +45,7 @@ class AccompanyingCourseDocument extends Document implements HasScopesInterface, return $this->id; } + #[\Override] public function getScopes(): iterable { if (null === $this->course) { diff --git a/src/Bundle/ChillDocStoreBundle/Entity/PersonDocument.php b/src/Bundle/ChillDocStoreBundle/Entity/PersonDocument.php index b6eefc733..e07bb9712 100644 --- a/src/Bundle/ChillDocStoreBundle/Entity/PersonDocument.php +++ b/src/Bundle/ChillDocStoreBundle/Entity/PersonDocument.php @@ -35,6 +35,7 @@ class PersonDocument extends Document implements HasCenterInterface, HasScopeInt #[ORM\ManyToOne(targetEntity: Scope::class)] private ?Scope $scope = null; + #[\Override] public function getCenter() { return $this->getPerson()->getCenter(); @@ -50,6 +51,7 @@ class PersonDocument extends Document implements HasCenterInterface, HasScopeInt return $this->person; } + #[\Override] public function getScope(): ?Scope { return $this->scope; diff --git a/src/Bundle/ChillDocStoreBundle/Entity/StoredObject.php b/src/Bundle/ChillDocStoreBundle/Entity/StoredObject.php index 4472d2177..67794f671 100644 --- a/src/Bundle/ChillDocStoreBundle/Entity/StoredObject.php +++ b/src/Bundle/ChillDocStoreBundle/Entity/StoredObject.php @@ -35,9 +35,9 @@ use Symfony\Component\Serializer\Annotation as Serializer; class StoredObject implements Document, TrackCreationInterface { use TrackCreationTrait; - final public const STATUS_READY = 'ready'; - final public const STATUS_PENDING = 'pending'; - final public const STATUS_FAILURE = 'failure'; + final public const string STATUS_READY = 'ready'; + final public const string STATUS_PENDING = 'pending'; + final public const string STATUS_FAILURE = 'failure'; #[Serializer\Groups(['write'])] #[ORM\Column(type: \Doctrine\DBAL\Types\Types::JSON, name: 'datas')] @@ -186,6 +186,7 @@ class StoredObject implements Document, TrackCreationInterface return $this->uuid; } + #[\Override] public function getWopiDocId(): string { return (string) $this->uuid; diff --git a/src/Bundle/ChillDocStoreBundle/Form/AccompanyingCourseDocumentType.php b/src/Bundle/ChillDocStoreBundle/Form/AccompanyingCourseDocumentType.php index 5d2096ca0..f05ce7747 100644 --- a/src/Bundle/ChillDocStoreBundle/Form/AccompanyingCourseDocumentType.php +++ b/src/Bundle/ChillDocStoreBundle/Form/AccompanyingCourseDocumentType.php @@ -30,6 +30,7 @@ final class AccompanyingCourseDocumentType extends AbstractType private readonly TranslatableStringHelperInterface $translatableStringHelper ) {} + #[\Override] public function buildForm(FormBuilderInterface $builder, array $options) { $builder @@ -52,6 +53,7 @@ final class AccompanyingCourseDocumentType extends AbstractType ]); } + #[\Override] public function configureOptions(OptionsResolver $resolver) { $resolver->setDefaults([ diff --git a/src/Bundle/ChillDocStoreBundle/Form/CollectionStoredObjectType.php b/src/Bundle/ChillDocStoreBundle/Form/CollectionStoredObjectType.php index fd14897bf..4770cc25e 100644 --- a/src/Bundle/ChillDocStoreBundle/Form/CollectionStoredObjectType.php +++ b/src/Bundle/ChillDocStoreBundle/Form/CollectionStoredObjectType.php @@ -17,6 +17,7 @@ use Symfony\Component\OptionsResolver\OptionsResolver; class CollectionStoredObjectType extends AbstractType { + #[\Override] public function configureOptions(OptionsResolver $resolver) { $resolver @@ -30,6 +31,7 @@ class CollectionStoredObjectType extends AbstractType ->setDefault('js_caller', 'data-collection-stored-object'); } + #[\Override] public function getParent() { return ChillCollectionType::class; diff --git a/src/Bundle/ChillDocStoreBundle/Form/DataMapper/StoredObjectDataMapper.php b/src/Bundle/ChillDocStoreBundle/Form/DataMapper/StoredObjectDataMapper.php index 170b1ab0a..af7cf4621 100644 --- a/src/Bundle/ChillDocStoreBundle/Form/DataMapper/StoredObjectDataMapper.php +++ b/src/Bundle/ChillDocStoreBundle/Form/DataMapper/StoredObjectDataMapper.php @@ -23,6 +23,7 @@ class StoredObjectDataMapper implements DataMapperInterface /** * @param FormInterface[]|\Traversable $forms A list of {@link FormInterface} instances */ + #[\Override] public function mapDataToForms($viewData, \Traversable $forms) { if (null === $viewData) { @@ -43,6 +44,7 @@ class StoredObjectDataMapper implements DataMapperInterface /** * @param FormInterface[]|\Traversable $forms A list of {@link FormInterface} instances */ + #[\Override] public function mapFormsToData(\Traversable $forms, &$viewData) { $forms = iterator_to_array($forms); diff --git a/src/Bundle/ChillDocStoreBundle/Form/DataTransformer/StoredObjectDataTransformer.php b/src/Bundle/ChillDocStoreBundle/Form/DataTransformer/StoredObjectDataTransformer.php index e06d8d7cc..2af8c0178 100644 --- a/src/Bundle/ChillDocStoreBundle/Form/DataTransformer/StoredObjectDataTransformer.php +++ b/src/Bundle/ChillDocStoreBundle/Form/DataTransformer/StoredObjectDataTransformer.php @@ -23,6 +23,7 @@ class StoredObjectDataTransformer implements DataTransformerInterface private readonly SerializerInterface $serializer ) {} + #[\Override] public function transform(mixed $value): mixed { if (null === $value) { @@ -40,6 +41,7 @@ class StoredObjectDataTransformer implements DataTransformerInterface throw new UnexpectedTypeException($value, StoredObject::class); } + #[\Override] public function reverseTransform(mixed $value): mixed { if ('' === $value || null === $value) { diff --git a/src/Bundle/ChillDocStoreBundle/Form/DocumentCategoryType.php b/src/Bundle/ChillDocStoreBundle/Form/DocumentCategoryType.php index 6396314e2..ee1077f96 100644 --- a/src/Bundle/ChillDocStoreBundle/Form/DocumentCategoryType.php +++ b/src/Bundle/ChillDocStoreBundle/Form/DocumentCategoryType.php @@ -20,6 +20,7 @@ use Symfony\Component\OptionsResolver\OptionsResolver; class DocumentCategoryType extends AbstractType { + #[\Override] public function buildForm(FormBuilderInterface $builder, array $options) { $bundles = [ @@ -40,6 +41,7 @@ class DocumentCategoryType extends AbstractType ->add('name', TranslatableStringFormType::class); } + #[\Override] public function configureOptions(OptionsResolver $resolver) { $resolver->setDefaults([ diff --git a/src/Bundle/ChillDocStoreBundle/Form/PersonDocumentType.php b/src/Bundle/ChillDocStoreBundle/Form/PersonDocumentType.php index 0addd53cc..eadf1b2bc 100644 --- a/src/Bundle/ChillDocStoreBundle/Form/PersonDocumentType.php +++ b/src/Bundle/ChillDocStoreBundle/Form/PersonDocumentType.php @@ -32,6 +32,7 @@ class PersonDocumentType extends AbstractType { public function __construct(private readonly TranslatableStringHelperInterface $translatableStringHelper, private readonly ScopeResolverDispatcher $scopeResolverDispatcher, private readonly ParameterBagInterface $parameterBag, private readonly CenterResolverDispatcher $centerResolverDispatcher) {} + #[\Override] public function buildForm(FormBuilderInterface $builder, array $options) { $document = $options['data']; @@ -63,6 +64,7 @@ class PersonDocumentType extends AbstractType } } + #[\Override] public function configureOptions(OptionsResolver $resolver) { $resolver->setDefaults([ diff --git a/src/Bundle/ChillDocStoreBundle/Form/StoredObjectType.php b/src/Bundle/ChillDocStoreBundle/Form/StoredObjectType.php index 3e4ceb163..20623fdf0 100644 --- a/src/Bundle/ChillDocStoreBundle/Form/StoredObjectType.php +++ b/src/Bundle/ChillDocStoreBundle/Form/StoredObjectType.php @@ -30,6 +30,7 @@ final class StoredObjectType extends AbstractType private readonly StoredObjectDataMapper $storedObjectDataMapper, ) {} + #[\Override] public function buildForm(FormBuilderInterface $builder, array $options) { if (true === $options['has_title']) { @@ -44,6 +45,7 @@ final class StoredObjectType extends AbstractType $builder->setDataMapper($this->storedObjectDataMapper); } + #[\Override] public function configureOptions(OptionsResolver $resolver) { $resolver diff --git a/src/Bundle/ChillDocStoreBundle/Form/Type/AsyncUploaderType.php b/src/Bundle/ChillDocStoreBundle/Form/Type/AsyncUploaderType.php index 58d4eebb1..5491ecb50 100644 --- a/src/Bundle/ChillDocStoreBundle/Form/Type/AsyncUploaderType.php +++ b/src/Bundle/ChillDocStoreBundle/Form/Type/AsyncUploaderType.php @@ -36,6 +36,7 @@ class AsyncUploaderType extends AbstractType $this->max_post_file_size = $config['max_post_file_size']; } + #[\Override] public function configureOptions(OptionsResolver $resolver) { $resolver->setDefaults([ @@ -52,6 +53,7 @@ class AsyncUploaderType extends AbstractType $resolver->setAllowedTypes('submit_delay', ['int']); } + #[\Override] public function buildView( FormView $view, FormInterface $form, @@ -70,6 +72,7 @@ class AsyncUploaderType extends AbstractType $view->vars['attr']['data-max-post-size'] = $options['max_post_size']; } + #[\Override] public function getParent() { return HiddenType::class; diff --git a/src/Bundle/ChillDocStoreBundle/GenericDoc/FetchQuery.php b/src/Bundle/ChillDocStoreBundle/GenericDoc/FetchQuery.php index 80eeaf372..5ec04d1f3 100644 --- a/src/Bundle/ChillDocStoreBundle/GenericDoc/FetchQuery.php +++ b/src/Bundle/ChillDocStoreBundle/GenericDoc/FetchQuery.php @@ -92,46 +92,55 @@ class FetchQuery implements FetchQueryInterface unset($this->joins[$index], $this->joinParams[$index], $this->joinTypes[$index]); } + #[\Override] public function getSelectKeyString(): string { return $this->selectKeyString; } + #[\Override] public function getSelectIdentifierJsonB(): string { return $this->selectIdentifierJsonB; } + #[\Override] public function getSelectIdentifierParams(): array { return $this->selectIdentifierParams; } + #[\Override] public function getSelectIdentifiersTypes(): array { return $this->selectIdentifierTypes; } + #[\Override] public function getSelectDate(): string { return $this->selectDate; } + #[\Override] public function getSelectDateTypes(): array { return $this->selectDateTypes; } + #[\Override] public function getSelectDateParams(): array { return $this->selectDateParams; } + #[\Override] public function getFromQuery(): string { return $this->from.' '.implode(' ', $this->joins); } + #[\Override] public function getFromQueryParams(): array { $result = []; @@ -143,6 +152,7 @@ class FetchQuery implements FetchQueryInterface return $result; } + #[\Override] public function getFromQueryTypes(): array { $result = []; @@ -154,11 +164,13 @@ class FetchQuery implements FetchQueryInterface return $result; } + #[\Override] public function getWhereQuery(): string { return implode(' AND ', $this->wheres); } + #[\Override] public function getWhereQueryParams(): array { $result = []; @@ -170,6 +182,7 @@ class FetchQuery implements FetchQueryInterface return $result; } + #[\Override] public function getWhereQueryTypes(): array { $result = []; diff --git a/src/Bundle/ChillDocStoreBundle/GenericDoc/FetchQueryToSqlBuilder.php b/src/Bundle/ChillDocStoreBundle/GenericDoc/FetchQueryToSqlBuilder.php index 174a5014d..607fa7773 100644 --- a/src/Bundle/ChillDocStoreBundle/GenericDoc/FetchQueryToSqlBuilder.php +++ b/src/Bundle/ChillDocStoreBundle/GenericDoc/FetchQueryToSqlBuilder.php @@ -15,7 +15,7 @@ use Doctrine\DBAL\Types\Types; final readonly class FetchQueryToSqlBuilder { - private const SQL = <<<'SQL' + private const string SQL = <<<'SQL' SELECT '{{ key }}' AS key, {{ identifiers }} AS identifiers, diff --git a/src/Bundle/ChillDocStoreBundle/GenericDoc/Providers/AccompanyingCourseDocumentGenericDocProvider.php b/src/Bundle/ChillDocStoreBundle/GenericDoc/Providers/AccompanyingCourseDocumentGenericDocProvider.php index 7522c5d3b..e1a1c3da9 100644 --- a/src/Bundle/ChillDocStoreBundle/GenericDoc/Providers/AccompanyingCourseDocumentGenericDocProvider.php +++ b/src/Bundle/ChillDocStoreBundle/GenericDoc/Providers/AccompanyingCourseDocumentGenericDocProvider.php @@ -26,13 +26,14 @@ use Symfony\Component\Security\Core\Security; final readonly class AccompanyingCourseDocumentGenericDocProvider implements GenericDocForAccompanyingPeriodProviderInterface, GenericDocForPersonProviderInterface { - public const KEY = 'accompanying_course_document'; + public const string KEY = 'accompanying_course_document'; public function __construct( private Security $security, private EntityManagerInterface $entityManager, ) {} + #[\Override] public function buildFetchQueryForAccompanyingPeriod(AccompanyingPeriod $accompanyingPeriod, ?\DateTimeImmutable $startDate = null, ?\DateTimeImmutable $endDate = null, ?string $content = null, ?string $origin = null): FetchQueryInterface { $classMetadata = $this->entityManager->getClassMetadata(AccompanyingCourseDocument::class); @@ -53,11 +54,13 @@ final readonly class AccompanyingCourseDocumentGenericDocProvider implements Gen return $this->addWhereClause($query, $startDate, $endDate, $content); } + #[\Override] public function isAllowedForAccompanyingPeriod(AccompanyingPeriod $accompanyingPeriod): bool { return $this->security->isGranted(AccompanyingCourseDocumentVoter::SEE, $accompanyingPeriod); } + #[\Override] public function buildFetchQueryForPerson(Person $person, ?\DateTimeImmutable $startDate = null, ?\DateTimeImmutable $endDate = null, ?string $content = null, ?string $origin = null): FetchQueryInterface { $classMetadata = $this->entityManager->getClassMetadata(AccompanyingCourseDocument::class); @@ -102,6 +105,7 @@ final readonly class AccompanyingCourseDocumentGenericDocProvider implements Gen return $this->addWhereClause($query, $startDate, $endDate, $content); } + #[\Override] public function isAllowedForPerson(Person $person): bool { return $this->security->isGranted(AccompanyingPeriodVoter::SEE, $person); diff --git a/src/Bundle/ChillDocStoreBundle/GenericDoc/Providers/PersonDocumentGenericDocProvider.php b/src/Bundle/ChillDocStoreBundle/GenericDoc/Providers/PersonDocumentGenericDocProvider.php index 2b9239c74..fbe73e37c 100644 --- a/src/Bundle/ChillDocStoreBundle/GenericDoc/Providers/PersonDocumentGenericDocProvider.php +++ b/src/Bundle/ChillDocStoreBundle/GenericDoc/Providers/PersonDocumentGenericDocProvider.php @@ -22,13 +22,14 @@ use Symfony\Component\Security\Core\Security; final readonly class PersonDocumentGenericDocProvider implements GenericDocForPersonProviderInterface, GenericDocForAccompanyingPeriodProviderInterface { - public const KEY = 'person_document'; + public const string KEY = 'person_document'; public function __construct( private Security $security, private PersonDocumentACLAwareRepositoryInterface $personDocumentACLAwareRepository, ) {} + #[\Override] public function buildFetchQueryForPerson( Person $person, ?\DateTimeImmutable $startDate = null, @@ -44,16 +45,19 @@ final readonly class PersonDocumentGenericDocProvider implements GenericDocForPe ); } + #[\Override] public function isAllowedForPerson(Person $person): bool { return $this->security->isGranted(PersonDocumentVoter::SEE, $person); } + #[\Override] public function buildFetchQueryForAccompanyingPeriod(AccompanyingPeriod $accompanyingPeriod, ?\DateTimeImmutable $startDate = null, ?\DateTimeImmutable $endDate = null, ?string $content = null, ?string $origin = null): FetchQueryInterface { return $this->personDocumentACLAwareRepository->buildFetchQueryForAccompanyingPeriod($accompanyingPeriod, $startDate, $endDate, $content); } + #[\Override] public function isAllowedForAccompanyingPeriod(AccompanyingPeriod $accompanyingPeriod): bool { // we assume that the user is allowed to see at least one person of the course diff --git a/src/Bundle/ChillDocStoreBundle/GenericDoc/Renderer/AccompanyingCourseDocumentGenericDocRenderer.php b/src/Bundle/ChillDocStoreBundle/GenericDoc/Renderer/AccompanyingCourseDocumentGenericDocRenderer.php index 70175ee1b..385ccd529 100644 --- a/src/Bundle/ChillDocStoreBundle/GenericDoc/Renderer/AccompanyingCourseDocumentGenericDocRenderer.php +++ b/src/Bundle/ChillDocStoreBundle/GenericDoc/Renderer/AccompanyingCourseDocumentGenericDocRenderer.php @@ -25,17 +25,20 @@ final readonly class AccompanyingCourseDocumentGenericDocRenderer implements Gen private PersonDocumentRepository $personDocumentRepository, ) {} + #[\Override] public function supports(GenericDocDTO $genericDocDTO, $options = []): bool { return AccompanyingCourseDocumentGenericDocProvider::KEY === $genericDocDTO->key || PersonDocumentGenericDocProvider::KEY === $genericDocDTO->key; } + #[\Override] public function getTemplate(GenericDocDTO $genericDocDTO, $options = []): string { return '@ChillDocStore/List/list_item.html.twig'; } + #[\Override] public function getTemplateData(GenericDocDTO $genericDocDTO, $options = []): array { if (AccompanyingCourseDocumentGenericDocProvider::KEY === $genericDocDTO->key) { diff --git a/src/Bundle/ChillDocStoreBundle/GenericDoc/Twig/GenericDocExtension.php b/src/Bundle/ChillDocStoreBundle/GenericDoc/Twig/GenericDocExtension.php index 2420cc424..c4818dcd5 100644 --- a/src/Bundle/ChillDocStoreBundle/GenericDoc/Twig/GenericDocExtension.php +++ b/src/Bundle/ChillDocStoreBundle/GenericDoc/Twig/GenericDocExtension.php @@ -16,6 +16,7 @@ use Twig\TwigFilter; final class GenericDocExtension extends AbstractExtension { + #[\Override] public function getFilters() { return [ diff --git a/src/Bundle/ChillDocStoreBundle/Menu/AdminMenuBuilder.php b/src/Bundle/ChillDocStoreBundle/Menu/AdminMenuBuilder.php index 466c3bace..e85ecf15a 100644 --- a/src/Bundle/ChillDocStoreBundle/Menu/AdminMenuBuilder.php +++ b/src/Bundle/ChillDocStoreBundle/Menu/AdminMenuBuilder.php @@ -27,6 +27,7 @@ class AdminMenuBuilder implements LocalMenuBuilderInterface $this->authorizationChecker = $authorizationChecker; } + #[\Override] public function buildMenu($menuId, MenuItem $menu, array $parameters) { if (!$this->authorizationChecker->isGranted('ROLE_ADMIN')) { @@ -46,6 +47,7 @@ class AdminMenuBuilder implements LocalMenuBuilderInterface ])->setExtras(['order' => 4010]); } + #[\Override] public static function getMenuIds(): array { return ['admin_section', 'admin_docstore']; diff --git a/src/Bundle/ChillDocStoreBundle/Menu/MenuBuilder.php b/src/Bundle/ChillDocStoreBundle/Menu/MenuBuilder.php index 485c95078..7bced1c6c 100644 --- a/src/Bundle/ChillDocStoreBundle/Menu/MenuBuilder.php +++ b/src/Bundle/ChillDocStoreBundle/Menu/MenuBuilder.php @@ -22,6 +22,7 @@ final readonly class MenuBuilder implements LocalMenuBuilderInterface { public function __construct(private Security $security, private TranslatorInterface $translator) {} + #[\Override] public function buildMenu($menuId, MenuItem $menu, array $parameters) { match ($menuId) { @@ -31,6 +32,7 @@ final readonly class MenuBuilder implements LocalMenuBuilderInterface }; } + #[\Override] public static function getMenuIds(): array { return ['person', 'accompanyingCourse']; diff --git a/src/Bundle/ChillDocStoreBundle/Repository/AccompanyingCourseDocumentRepository.php b/src/Bundle/ChillDocStoreBundle/Repository/AccompanyingCourseDocumentRepository.php index 2679993c4..ea2685b05 100644 --- a/src/Bundle/ChillDocStoreBundle/Repository/AccompanyingCourseDocumentRepository.php +++ b/src/Bundle/ChillDocStoreBundle/Repository/AccompanyingCourseDocumentRepository.php @@ -45,26 +45,31 @@ class AccompanyingCourseDocumentRepository implements ObjectRepository return $qb->getQuery()->getSingleScalarResult(); } + #[\Override] public function find($id): ?AccompanyingCourseDocument { return $this->repository->find($id); } + #[\Override] public function findAll(): array { return $this->repository->findAll(); } + #[\Override] public function findBy(array $criteria, ?array $orderBy = null, $limit = null, $offset = null) { return $this->repository->findBy($criteria, $orderBy, $limit, $offset); } + #[\Override] public function findOneBy(array $criteria): ?AccompanyingCourseDocument { return $this->findOneBy($criteria); } + #[\Override] public function getClassName() { return AccompanyingCourseDocument::class; diff --git a/src/Bundle/ChillDocStoreBundle/Repository/DocumentCategoryRepository.php b/src/Bundle/ChillDocStoreBundle/Repository/DocumentCategoryRepository.php index 460418951..bf944d387 100644 --- a/src/Bundle/ChillDocStoreBundle/Repository/DocumentCategoryRepository.php +++ b/src/Bundle/ChillDocStoreBundle/Repository/DocumentCategoryRepository.php @@ -28,6 +28,7 @@ class DocumentCategoryRepository implements ObjectRepository $this->repository = $em->getRepository(DocumentCategory::class); } + #[\Override] public function find($id): ?DocumentCategory { return $this->repository->find($id); @@ -36,21 +37,25 @@ class DocumentCategoryRepository implements ObjectRepository /** * @return array|DocumentCategory[] */ + #[\Override] public function findAll(): array { return $this->repository->findAll(); } + #[\Override] public function findBy(array $criteria, ?array $orderBy = null, $limit = null, $offset = null) { return $this->repository->findBy($criteria, $orderBy, $limit, $offset); } + #[\Override] public function findOneBy(array $criteria): ?DocumentCategory { return $this->findOneBy($criteria); } + #[\Override] public function getClassName() { return DocumentCategory::class; diff --git a/src/Bundle/ChillDocStoreBundle/Repository/PersonDocumentACLAwareRepository.php b/src/Bundle/ChillDocStoreBundle/Repository/PersonDocumentACLAwareRepository.php index 016a61dab..451b6e980 100644 --- a/src/Bundle/ChillDocStoreBundle/Repository/PersonDocumentACLAwareRepository.php +++ b/src/Bundle/ChillDocStoreBundle/Repository/PersonDocumentACLAwareRepository.php @@ -47,6 +47,7 @@ final readonly class PersonDocumentACLAwareRepository implements PersonDocumentA return $qb; } + #[\Override] public function buildFetchQueryForPerson(Person $person, ?\DateTimeImmutable $startDate = null, ?\DateTimeImmutable $endDate = null, ?string $content = null): FetchQueryInterface { $query = $this->buildBaseFetchQueryForPerson($person, $startDate, $endDate, $content); @@ -54,6 +55,7 @@ final readonly class PersonDocumentACLAwareRepository implements PersonDocumentA return $this->addFetchQueryByPersonACL($query, $person); } + #[\Override] public function buildFetchQueryForAccompanyingPeriod(AccompanyingPeriod $period, ?\DateTimeImmutable $startDate = null, ?\DateTimeImmutable $endDate = null, ?string $content = null): FetchQueryInterface { $personDocMetadata = $this->em->getClassMetadata(PersonDocument::class); @@ -168,6 +170,7 @@ final readonly class PersonDocumentACLAwareRepository implements PersonDocumentA return $query; } + #[\Override] public function countByPerson(Person $person): int { $qb = $this->buildQueryByPerson($person)->select('COUNT(d)'); @@ -177,6 +180,7 @@ final readonly class PersonDocumentACLAwareRepository implements PersonDocumentA return $qb->getQuery()->getSingleScalarResult(); } + #[\Override] public function findByPerson(Person $person, array $orderBy = [], int $limit = 20, int $offset = 0): array { $qb = $this->buildQueryByPerson($person)->select('d'); diff --git a/src/Bundle/ChillDocStoreBundle/Repository/PersonDocumentRepository.php b/src/Bundle/ChillDocStoreBundle/Repository/PersonDocumentRepository.php index f880c0d67..fb85f762e 100644 --- a/src/Bundle/ChillDocStoreBundle/Repository/PersonDocumentRepository.php +++ b/src/Bundle/ChillDocStoreBundle/Repository/PersonDocumentRepository.php @@ -29,26 +29,31 @@ readonly class PersonDocumentRepository implements ObjectRepository $this->repository = $this->entityManager->getRepository($this->getClassName()); } + #[\Override] public function find($id): ?PersonDocument { return $this->repository->find($id); } + #[\Override] public function findAll() { return $this->repository->findAll(); } + #[\Override] public function findBy(array $criteria, ?array $orderBy = null, ?int $limit = null, ?int $offset = null) { return $this->repository->findBy($criteria, $orderBy, $limit, $offset); } + #[\Override] public function findOneBy(array $criteria): ?PersonDocument { return $this->repository->findOneBy($criteria); } + #[\Override] public function getClassName(): string { return PersonDocument::class; diff --git a/src/Bundle/ChillDocStoreBundle/Repository/StoredObjectRepository.php b/src/Bundle/ChillDocStoreBundle/Repository/StoredObjectRepository.php index 84bc7d4cb..8b857decb 100644 --- a/src/Bundle/ChillDocStoreBundle/Repository/StoredObjectRepository.php +++ b/src/Bundle/ChillDocStoreBundle/Repository/StoredObjectRepository.php @@ -24,6 +24,7 @@ final readonly class StoredObjectRepository implements StoredObjectRepositoryInt $this->repository = $entityManager->getRepository(StoredObject::class); } + #[\Override] public function find($id, $lockMode = null, $lockVersion = null): ?StoredObject { return $this->repository->find($id, $lockMode, $lockVersion); @@ -32,6 +33,7 @@ final readonly class StoredObjectRepository implements StoredObjectRepositoryInt /** * @return array */ + #[\Override] public function findAll(): array { return $this->repository->findAll(); @@ -43,16 +45,19 @@ final readonly class StoredObjectRepository implements StoredObjectRepositoryInt * * @return array */ + #[\Override] public function findBy(array $criteria, ?array $orderBy = null, $limit = null, $offset = null): array { return $this->repository->findBy($criteria, $orderBy, $limit, $offset); } + #[\Override] public function findOneBy(array $criteria): ?StoredObject { return $this->repository->findOneBy($criteria); } + #[\Override] public function getClassName(): string { return StoredObject::class; diff --git a/src/Bundle/ChillDocStoreBundle/Security/Authorization/AccompanyingCourseDocumentVoter.php b/src/Bundle/ChillDocStoreBundle/Security/Authorization/AccompanyingCourseDocumentVoter.php index 5febc7e42..5d33ab325 100644 --- a/src/Bundle/ChillDocStoreBundle/Security/Authorization/AccompanyingCourseDocumentVoter.php +++ b/src/Bundle/ChillDocStoreBundle/Security/Authorization/AccompanyingCourseDocumentVoter.php @@ -25,15 +25,15 @@ use Symfony\Component\Security\Core\Security; class AccompanyingCourseDocumentVoter extends AbstractChillVoter implements ProvideRoleHierarchyInterface { - final public const CREATE = 'CHILL_ACCOMPANYING_COURSE_DOCUMENT_CREATE'; + final public const string CREATE = 'CHILL_ACCOMPANYING_COURSE_DOCUMENT_CREATE'; - final public const DELETE = 'CHILL_ACCOMPANYING_COURSE_DOCUMENT_DELETE'; + final public const string DELETE = 'CHILL_ACCOMPANYING_COURSE_DOCUMENT_DELETE'; - final public const SEE = 'CHILL_ACCOMPANYING_COURSE_DOCUMENT_SEE'; + final public const string SEE = 'CHILL_ACCOMPANYING_COURSE_DOCUMENT_SEE'; - final public const SEE_DETAILS = 'CHILL_ACCOMPANYING_COURSE_DOCUMENT_SEE_DETAILS'; + final public const string SEE_DETAILS = 'CHILL_ACCOMPANYING_COURSE_DOCUMENT_SEE_DETAILS'; - final public const UPDATE = 'CHILL_ACCOMPANYING_COURSE_DOCUMENT_UPDATE'; + final public const string UPDATE = 'CHILL_ACCOMPANYING_COURSE_DOCUMENT_UPDATE'; protected VoterHelperInterface $voterHelper; @@ -49,6 +49,7 @@ class AccompanyingCourseDocumentVoter extends AbstractChillVoter implements Prov ->build(); } + #[\Override] public function getRoles(): array { return [ @@ -60,21 +61,25 @@ class AccompanyingCourseDocumentVoter extends AbstractChillVoter implements Prov ]; } + #[\Override] public function getRolesWithHierarchy(): array { return ['accompanyingCourseDocument' => $this->getRoles()]; } + #[\Override] public function getRolesWithoutScope(): array { return []; } + #[\Override] protected function supports($attribute, $subject): bool { return $this->voterHelper->supports($attribute, $subject); } + #[\Override] protected function voteOnAttribute($attribute, $subject, TokenInterface $token): bool { if (!$token->getUser() instanceof User) { diff --git a/src/Bundle/ChillDocStoreBundle/Security/Authorization/AsyncUploadVoter.php b/src/Bundle/ChillDocStoreBundle/Security/Authorization/AsyncUploadVoter.php index 1d7ad759a..8fc68387f 100644 --- a/src/Bundle/ChillDocStoreBundle/Security/Authorization/AsyncUploadVoter.php +++ b/src/Bundle/ChillDocStoreBundle/Security/Authorization/AsyncUploadVoter.php @@ -18,17 +18,19 @@ use Symfony\Component\Security\Core\Security; final class AsyncUploadVoter extends Voter { - public const GENERATE_SIGNATURE = 'CHILL_DOC_GENERATE_ASYNC_SIGNATURE'; + public const string GENERATE_SIGNATURE = 'CHILL_DOC_GENERATE_ASYNC_SIGNATURE'; public function __construct( private readonly Security $security, ) {} + #[\Override] protected function supports($attribute, $subject): bool { return self::GENERATE_SIGNATURE === $attribute && $subject instanceof SignedUrl; } + #[\Override] protected function voteOnAttribute($attribute, $subject, TokenInterface $token): bool { /** @var SignedUrl $subject */ diff --git a/src/Bundle/ChillDocStoreBundle/Security/Authorization/PersonDocumentVoter.php b/src/Bundle/ChillDocStoreBundle/Security/Authorization/PersonDocumentVoter.php index 21c08e9fd..2c1b05676 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 { - final public const CREATE = 'CHILL_PERSON_DOCUMENT_CREATE'; + final public const string CREATE = 'CHILL_PERSON_DOCUMENT_CREATE'; - final public const DELETE = 'CHILL_PERSON_DOCUMENT_DELETE'; + final public const string DELETE = 'CHILL_PERSON_DOCUMENT_DELETE'; - final public const SEE = 'CHILL_PERSON_DOCUMENT_SEE'; + final public const string SEE = 'CHILL_PERSON_DOCUMENT_SEE'; - final public const SEE_DETAILS = 'CHILL_PERSON_DOCUMENT_SEE_DETAILS'; + final public const string SEE_DETAILS = 'CHILL_PERSON_DOCUMENT_SEE_DETAILS'; - final public const UPDATE = 'CHILL_PERSON_DOCUMENT_UPDATE'; + final public const string UPDATE = 'CHILL_PERSON_DOCUMENT_UPDATE'; protected VoterHelperInterface $voterHelper; @@ -49,6 +49,7 @@ class PersonDocumentVoter extends AbstractChillVoter implements ProvideRoleHiera ->build(); } + #[\Override] public function getRoles(): array { return [ @@ -60,16 +61,19 @@ class PersonDocumentVoter extends AbstractChillVoter implements ProvideRoleHiera ]; } + #[\Override] public function getRolesWithHierarchy(): array { return ['PersonDocument' => $this->getRoles()]; } + #[\Override] public function getRolesWithoutScope(): array { return []; } + #[\Override] protected function supports($attribute, $subject) { return $this->voterHelper->supports($attribute, $subject); @@ -81,6 +85,7 @@ class PersonDocumentVoter extends AbstractChillVoter implements ProvideRoleHiera * * @return bool */ + #[\Override] protected function voteOnAttribute($attribute, $subject, TokenInterface $token) { $this->logger->debug(sprintf('Voting from %s class', self::class)); diff --git a/src/Bundle/ChillDocStoreBundle/Security/Authorization/StoredObjectVoter.php b/src/Bundle/ChillDocStoreBundle/Security/Authorization/StoredObjectVoter.php index 2e253cf3c..f81b2bce6 100644 --- a/src/Bundle/ChillDocStoreBundle/Security/Authorization/StoredObjectVoter.php +++ b/src/Bundle/ChillDocStoreBundle/Security/Authorization/StoredObjectVoter.php @@ -23,12 +23,14 @@ use Symfony\Component\Security\Core\Authorization\Voter\Voter; */ class StoredObjectVoter extends Voter { + #[\Override] protected function supports($attribute, $subject): bool { return StoredObjectRoleEnum::tryFrom($attribute) instanceof StoredObjectRoleEnum && $subject instanceof StoredObject; } + #[\Override] protected function voteOnAttribute($attribute, $subject, TokenInterface $token): bool { /** @var StoredObject $subject */ diff --git a/src/Bundle/ChillDocStoreBundle/Security/Guard/DavOnUrlTokenExtractor.php b/src/Bundle/ChillDocStoreBundle/Security/Guard/DavOnUrlTokenExtractor.php index 3881c6251..1726fce33 100644 --- a/src/Bundle/ChillDocStoreBundle/Security/Guard/DavOnUrlTokenExtractor.php +++ b/src/Bundle/ChillDocStoreBundle/Security/Guard/DavOnUrlTokenExtractor.php @@ -29,6 +29,7 @@ final readonly class DavOnUrlTokenExtractor implements TokenExtractorInterface private LoggerInterface $logger, ) {} + #[\Override] public function extract(Request $request): false|string { $uri = $request->getRequestUri(); diff --git a/src/Bundle/ChillDocStoreBundle/Security/Guard/DavTokenAuthenticationEventSubscriber.php b/src/Bundle/ChillDocStoreBundle/Security/Guard/DavTokenAuthenticationEventSubscriber.php index 7b33c0eec..93d300807 100644 --- a/src/Bundle/ChillDocStoreBundle/Security/Guard/DavTokenAuthenticationEventSubscriber.php +++ b/src/Bundle/ChillDocStoreBundle/Security/Guard/DavTokenAuthenticationEventSubscriber.php @@ -21,9 +21,10 @@ use Symfony\Component\EventDispatcher\EventSubscriberInterface; */ class DavTokenAuthenticationEventSubscriber implements EventSubscriberInterface { - final public const STORED_OBJECT = 'stored_object'; - final public const ACTIONS = 'stored_objects_actions'; + final public const string STORED_OBJECT = 'stored_object'; + final public const string ACTIONS = 'stored_objects_actions'; + #[\Override] public static function getSubscribedEvents(): array { return [ diff --git a/src/Bundle/ChillDocStoreBundle/Security/Guard/JWTDavTokenProvider.php b/src/Bundle/ChillDocStoreBundle/Security/Guard/JWTDavTokenProvider.php index 0bd0cdb8e..6f7674ef3 100644 --- a/src/Bundle/ChillDocStoreBundle/Security/Guard/JWTDavTokenProvider.php +++ b/src/Bundle/ChillDocStoreBundle/Security/Guard/JWTDavTokenProvider.php @@ -26,6 +26,7 @@ final readonly class JWTDavTokenProvider implements JWTDavTokenProviderInterface private Security $security, ) {} + #[\Override] public function createToken(StoredObject $storedObject, StoredObjectRoleEnum $roleEnum): string { return $this->JWTTokenManager->createFromPayload($this->security->getUser(), [ @@ -38,6 +39,7 @@ final readonly class JWTDavTokenProvider implements JWTDavTokenProviderInterface ]); } + #[\Override] public function getTokenExpiration(string $tokenString): \DateTimeImmutable { $jwt = $this->JWTTokenManager->parse($tokenString); diff --git a/src/Bundle/ChillDocStoreBundle/Security/Guard/JWTOnDavUrlAuthenticator.php b/src/Bundle/ChillDocStoreBundle/Security/Guard/JWTOnDavUrlAuthenticator.php index fe8ba2b73..60adaabe0 100644 --- a/src/Bundle/ChillDocStoreBundle/Security/Guard/JWTOnDavUrlAuthenticator.php +++ b/src/Bundle/ChillDocStoreBundle/Security/Guard/JWTOnDavUrlAuthenticator.php @@ -34,6 +34,7 @@ class JWTOnDavUrlAuthenticator extends JWTTokenAuthenticator parent::__construct($jwtManager, $dispatcher, $tokenExtractor, $preAuthenticationTokenStorage, $translator); } + #[\Override] protected function getTokenExtractor() { return $this->davOnUrlTokenExtractor; diff --git a/src/Bundle/ChillDocStoreBundle/Serializer/Normalizer/StoredObjectDenormalizer.php b/src/Bundle/ChillDocStoreBundle/Serializer/Normalizer/StoredObjectDenormalizer.php index 2c96f7faa..ef87e383d 100644 --- a/src/Bundle/ChillDocStoreBundle/Serializer/Normalizer/StoredObjectDenormalizer.php +++ b/src/Bundle/ChillDocStoreBundle/Serializer/Normalizer/StoredObjectDenormalizer.php @@ -22,6 +22,7 @@ class StoredObjectDenormalizer implements DenormalizerInterface public function __construct(private readonly StoredObjectRepository $storedObjectRepository) {} + #[\Override] public function denormalize($data, $type, $format = null, array $context = []) { $object = $this->extractObjectToPopulate(StoredObject::class, $context); @@ -33,6 +34,7 @@ class StoredObjectDenormalizer implements DenormalizerInterface return $this->storedObjectRepository->find($data['id']); } + #[\Override] public function supportsDenormalization($data, $type, $format = null) { if (false === \is_array($data)) { diff --git a/src/Bundle/ChillDocStoreBundle/Serializer/Normalizer/StoredObjectNormalizer.php b/src/Bundle/ChillDocStoreBundle/Serializer/Normalizer/StoredObjectNormalizer.php index f6eb5a1cb..cd8ded378 100644 --- a/src/Bundle/ChillDocStoreBundle/Serializer/Normalizer/StoredObjectNormalizer.php +++ b/src/Bundle/ChillDocStoreBundle/Serializer/Normalizer/StoredObjectNormalizer.php @@ -27,14 +27,15 @@ use Symfony\Component\Serializer\Normalizer\NormalizerInterface; final class StoredObjectNormalizer implements NormalizerInterface, NormalizerAwareInterface { use NormalizerAwareTrait; - public const ADD_DAV_SEE_LINK_CONTEXT = 'dav-see-link-context'; - public const ADD_DAV_EDIT_LINK_CONTEXT = 'dav-edit-link-context'; + public const string ADD_DAV_SEE_LINK_CONTEXT = 'dav-see-link-context'; + public const string ADD_DAV_EDIT_LINK_CONTEXT = 'dav-edit-link-context'; public function __construct( private readonly JWTDavTokenProviderInterface $JWTDavTokenProvider, private readonly UrlGeneratorInterface $urlGenerator ) {} + #[\Override] public function normalize($object, ?string $format = null, array $context = []) { /** @var StoredObject $object */ @@ -82,6 +83,7 @@ final class StoredObjectNormalizer implements NormalizerInterface, NormalizerAwa return $datas; } + #[\Override] public function supportsNormalization($data, ?string $format = null) { return $data instanceof StoredObject && 'json' === $format; diff --git a/src/Bundle/ChillDocStoreBundle/Service/StoredObjectManager.php b/src/Bundle/ChillDocStoreBundle/Service/StoredObjectManager.php index 7100ca821..d2a4ff602 100644 --- a/src/Bundle/ChillDocStoreBundle/Service/StoredObjectManager.php +++ b/src/Bundle/ChillDocStoreBundle/Service/StoredObjectManager.php @@ -23,7 +23,7 @@ use Symfony\Contracts\HttpClient\ResponseInterface; final class StoredObjectManager implements StoredObjectManagerInterface { - private const ALGORITHM = 'AES-256-CBC'; + private const string ALGORITHM = 'AES-256-CBC'; private array $inMemory = []; @@ -32,6 +32,7 @@ final class StoredObjectManager implements StoredObjectManagerInterface private readonly TempUrlGeneratorInterface $tempUrlGenerator ) {} + #[\Override] public function getLastModified(StoredObject $document): \DateTimeInterface { if ($this->hasCache($document)) { @@ -58,6 +59,7 @@ final class StoredObjectManager implements StoredObjectManagerInterface return $this->extractLastModifiedFromResponse($response); } + #[\Override] public function getContentLength(StoredObject $document): int { if ([] === $document->getKeyInfos()) { @@ -88,6 +90,7 @@ final class StoredObjectManager implements StoredObjectManagerInterface return strlen($this->read($document)); } + #[\Override] public function etag(StoredObject $document): string { if ($this->hasCache($document)) { @@ -114,6 +117,7 @@ final class StoredObjectManager implements StoredObjectManagerInterface return $this->extractEtagFromResponse($response, $document); } + #[\Override] public function read(StoredObject $document): string { $response = $this->getResponseFromCache($document); @@ -144,6 +148,7 @@ final class StoredObjectManager implements StoredObjectManagerInterface return $clearData; } + #[\Override] public function write(StoredObject $document, string $clearContent): void { if ($this->hasCache($document)) { @@ -193,6 +198,7 @@ final class StoredObjectManager implements StoredObjectManagerInterface } } + #[\Override] public function clearCache(): void { $this->inMemory = []; diff --git a/src/Bundle/ChillDocStoreBundle/Templating/WopiEditTwigExtension.php b/src/Bundle/ChillDocStoreBundle/Templating/WopiEditTwigExtension.php index 754c3fb3c..524d3d4de 100644 --- a/src/Bundle/ChillDocStoreBundle/Templating/WopiEditTwigExtension.php +++ b/src/Bundle/ChillDocStoreBundle/Templating/WopiEditTwigExtension.php @@ -17,6 +17,7 @@ use Twig\TwigFunction; class WopiEditTwigExtension extends AbstractExtension { + #[\Override] public function getFilters(): array { return [ @@ -31,6 +32,7 @@ class WopiEditTwigExtension extends AbstractExtension ]; } + #[\Override] public function getFunctions(): array { return [ diff --git a/src/Bundle/ChillDocStoreBundle/Templating/WopiEditTwigExtensionRuntime.php b/src/Bundle/ChillDocStoreBundle/Templating/WopiEditTwigExtensionRuntime.php index 716cb422e..20c1e9f09 100644 --- a/src/Bundle/ChillDocStoreBundle/Templating/WopiEditTwigExtensionRuntime.php +++ b/src/Bundle/ChillDocStoreBundle/Templating/WopiEditTwigExtensionRuntime.php @@ -23,7 +23,7 @@ use Twig\Extension\RuntimeExtensionInterface; final readonly class WopiEditTwigExtensionRuntime implements RuntimeExtensionInterface { - public const SUPPORTED_MIMES = [ + public const array SUPPORTED_MIMES = [ 'image/svg+xml', 'application/vnd.ms-powerpoint', 'application/vnd.ms-excel', @@ -115,13 +115,13 @@ final readonly class WopiEditTwigExtensionRuntime implements RuntimeExtensionInt 'application/pdf', ]; - private const DEFAULT_OPTIONS_TEMPLATE_BUTTON_GROUP = [ + private const array DEFAULT_OPTIONS_TEMPLATE_BUTTON_GROUP = [ 'small' => false, ]; - private const TEMPLATE = '@ChillDocStore/Button/wopi_edit_document.html.twig'; + private const string TEMPLATE = '@ChillDocStore/Button/wopi_edit_document.html.twig'; - private const TEMPLATE_BUTTON_GROUP = '@ChillDocStore/Button/button_group.html.twig'; + private const string TEMPLATE_BUTTON_GROUP = '@ChillDocStore/Button/button_group.html.twig'; public function __construct( private DiscoveryInterface $discovery, diff --git a/src/Bundle/ChillDocStoreBundle/Tests/AsyncUpload/Templating/AsyncUploadExtensionTest.php b/src/Bundle/ChillDocStoreBundle/Tests/AsyncUpload/Templating/AsyncUploadExtensionTest.php index e309c02ec..5ce20d4e8 100644 --- a/src/Bundle/ChillDocStoreBundle/Tests/AsyncUpload/Templating/AsyncUploadExtensionTest.php +++ b/src/Bundle/ChillDocStoreBundle/Tests/AsyncUpload/Templating/AsyncUploadExtensionTest.php @@ -31,6 +31,7 @@ class AsyncUploadExtensionTest extends KernelTestCase private AsyncUploadExtension $asyncUploadExtension; + #[\Override] public function setUp(): void { $generator = $this->prophesize(TempUrlGeneratorInterface::class); diff --git a/src/Bundle/ChillDocStoreBundle/Tests/Controller/WebdavControllerTest.php b/src/Bundle/ChillDocStoreBundle/Tests/Controller/WebdavControllerTest.php index d116add92..60071de3d 100644 --- a/src/Bundle/ChillDocStoreBundle/Tests/Controller/WebdavControllerTest.php +++ b/src/Bundle/ChillDocStoreBundle/Tests/Controller/WebdavControllerTest.php @@ -32,6 +32,7 @@ class WebdavControllerTest extends KernelTestCase private \Twig\Environment $engine; + #[\Override] protected function setUp(): void { self::bootKernel(); @@ -384,27 +385,33 @@ class WebdavControllerTest extends KernelTestCase class MockedStoredObjectManager implements StoredObjectManagerInterface { + #[\Override] public function getLastModified(StoredObject $document): \DateTimeInterface { return new \DateTimeImmutable('2023-09-13T14:15'); } + #[\Override] public function getContentLength(StoredObject $document): int { return 5; } + #[\Override] public function read(StoredObject $document): string { return 'abcde'; } + #[\Override] public function write(StoredObject $document, string $clearContent): void {} + #[\Override] public function etag(StoredObject $document): string { return 'ab56b4d92b40713acc5af89985d4b786'; } + #[\Override] public function clearCache(): void {} } diff --git a/src/Bundle/ChillDocStoreBundle/Tests/Form/StoredObjectTypeTest.php b/src/Bundle/ChillDocStoreBundle/Tests/Form/StoredObjectTypeTest.php index 2fc17787a..137c819be 100644 --- a/src/Bundle/ChillDocStoreBundle/Tests/Form/StoredObjectTypeTest.php +++ b/src/Bundle/ChillDocStoreBundle/Tests/Form/StoredObjectTypeTest.php @@ -70,6 +70,7 @@ class StoredObjectTypeTest extends TypeTestCase $this->assertEquals($newTitle, $model->getTitle()); } + #[\Override] protected function getExtensions() { $jwtTokenProvider = $this->prophesize(JWTDavTokenProviderInterface::class); diff --git a/src/Bundle/ChillDocStoreBundle/Tests/GenericDoc/ManagerTest.php b/src/Bundle/ChillDocStoreBundle/Tests/GenericDoc/ManagerTest.php index eed078aa3..cd01d50a4 100644 --- a/src/Bundle/ChillDocStoreBundle/Tests/GenericDoc/ManagerTest.php +++ b/src/Bundle/ChillDocStoreBundle/Tests/GenericDoc/ManagerTest.php @@ -37,6 +37,7 @@ class ManagerTest extends KernelTestCase private Connection $connection; + #[\Override] protected function setUp(): void { self::bootKernel(); @@ -174,6 +175,7 @@ class ManagerTest extends KernelTestCase final readonly class SimpleGenericDocAccompanyingPeriodProvider implements GenericDocForAccompanyingPeriodProviderInterface { + #[\Override] public function buildFetchQueryForAccompanyingPeriod(AccompanyingPeriod $accompanyingPeriod, ?\DateTimeImmutable $startDate = null, ?\DateTimeImmutable $endDate = null, ?string $content = null, ?string $origin = null): FetchQueryInterface { $query = new FetchQuery( @@ -188,6 +190,7 @@ final readonly class SimpleGenericDocAccompanyingPeriodProvider implements Gener return $query; } + #[\Override] public function isAllowedForAccompanyingPeriod(AccompanyingPeriod $accompanyingPeriod): bool { return true; @@ -196,6 +199,7 @@ final readonly class SimpleGenericDocAccompanyingPeriodProvider implements Gener final readonly class SimpleGenericDocPersonProvider implements GenericDocForPersonProviderInterface { + #[\Override] public function buildFetchQueryForPerson(Person $person, ?\DateTimeImmutable $startDate = null, ?\DateTimeImmutable $endDate = null, ?string $content = null, ?string $origin = null): FetchQueryInterface { $query = new FetchQuery( @@ -210,6 +214,7 @@ final readonly class SimpleGenericDocPersonProvider implements GenericDocForPers return $query; } + #[\Override] public function isAllowedForPerson(Person $person): bool { return true; diff --git a/src/Bundle/ChillDocStoreBundle/Tests/GenericDoc/Providers/AccompanyingCourseDocumentGenericDocProviderTest.php b/src/Bundle/ChillDocStoreBundle/Tests/GenericDoc/Providers/AccompanyingCourseDocumentGenericDocProviderTest.php index a4f5234d5..3e37cda28 100644 --- a/src/Bundle/ChillDocStoreBundle/Tests/GenericDoc/Providers/AccompanyingCourseDocumentGenericDocProviderTest.php +++ b/src/Bundle/ChillDocStoreBundle/Tests/GenericDoc/Providers/AccompanyingCourseDocumentGenericDocProviderTest.php @@ -30,6 +30,7 @@ class AccompanyingCourseDocumentGenericDocProviderTest extends KernelTestCase use ProphecyTrait; private EntityManagerInterface $entityManager; + #[\Override] public function setUp(): void { self::bootKernel(); diff --git a/src/Bundle/ChillDocStoreBundle/Tests/GenericDoc/Providers/PersonDocumentGenericDocProviderTest.php b/src/Bundle/ChillDocStoreBundle/Tests/GenericDoc/Providers/PersonDocumentGenericDocProviderTest.php index 602dd7f4c..4f347c053 100644 --- a/src/Bundle/ChillDocStoreBundle/Tests/GenericDoc/Providers/PersonDocumentGenericDocProviderTest.php +++ b/src/Bundle/ChillDocStoreBundle/Tests/GenericDoc/Providers/PersonDocumentGenericDocProviderTest.php @@ -33,6 +33,7 @@ class PersonDocumentGenericDocProviderTest extends KernelTestCase private PersonDocumentACLAwareRepositoryInterface $personDocumentACLAwareRepository; + #[\Override] protected function setUp(): void { self::bootKernel(); diff --git a/src/Bundle/ChillDocStoreBundle/Tests/Repository/PersonDocumentACLAwareRepositoryTest.php b/src/Bundle/ChillDocStoreBundle/Tests/Repository/PersonDocumentACLAwareRepositoryTest.php index a6c8e591a..e08d13c0f 100644 --- a/src/Bundle/ChillDocStoreBundle/Tests/Repository/PersonDocumentACLAwareRepositoryTest.php +++ b/src/Bundle/ChillDocStoreBundle/Tests/Repository/PersonDocumentACLAwareRepositoryTest.php @@ -39,6 +39,7 @@ class PersonDocumentACLAwareRepositoryTest extends KernelTestCase private ScopeRepositoryInterface $scopeRepository; + #[\Override] protected function setUp(): void { self::bootKernel(); diff --git a/src/Bundle/ChillDocStoreBundle/Tests/Serializer/Normalizer/SignedUrlNormalizerTest.php b/src/Bundle/ChillDocStoreBundle/Tests/Serializer/Normalizer/SignedUrlNormalizerTest.php index cb5294fff..c59150efa 100644 --- a/src/Bundle/ChillDocStoreBundle/Tests/Serializer/Normalizer/SignedUrlNormalizerTest.php +++ b/src/Bundle/ChillDocStoreBundle/Tests/Serializer/Normalizer/SignedUrlNormalizerTest.php @@ -25,6 +25,7 @@ class SignedUrlNormalizerTest extends KernelTestCase { public static NormalizerInterface $normalizer; + #[\Override] public static function setUpBeforeClass(): void { parent::setUpBeforeClass(); diff --git a/src/Bundle/ChillDocStoreBundle/Tests/Serializer/Normalizer/SignedUrlPostNormalizerTest.php b/src/Bundle/ChillDocStoreBundle/Tests/Serializer/Normalizer/SignedUrlPostNormalizerTest.php index ceb777f23..6926a38b2 100644 --- a/src/Bundle/ChillDocStoreBundle/Tests/Serializer/Normalizer/SignedUrlPostNormalizerTest.php +++ b/src/Bundle/ChillDocStoreBundle/Tests/Serializer/Normalizer/SignedUrlPostNormalizerTest.php @@ -25,6 +25,7 @@ class SignedUrlPostNormalizerTest extends KernelTestCase { public static NormalizerInterface $normalizer; + #[\Override] public static function setUpBeforeClass(): void { parent::setUpBeforeClass(); diff --git a/src/Bundle/ChillDocStoreBundle/Tests/Validator/Constraints/AsyncFileExistsValidatorTest.php b/src/Bundle/ChillDocStoreBundle/Tests/Validator/Constraints/AsyncFileExistsValidatorTest.php index 6e46ee370..f556e7a7c 100644 --- a/src/Bundle/ChillDocStoreBundle/Tests/Validator/Constraints/AsyncFileExistsValidatorTest.php +++ b/src/Bundle/ChillDocStoreBundle/Tests/Validator/Constraints/AsyncFileExistsValidatorTest.php @@ -31,6 +31,7 @@ class AsyncFileExistsValidatorTest extends ConstraintValidatorTestCase { use ProphecyTrait; + #[\Override] protected function createValidator() { $client = new MockHttpClient(function ($method, $url, $options): MockResponse { diff --git a/src/Bundle/ChillDocStoreBundle/Validator/Constraints/AsyncFileExists.php b/src/Bundle/ChillDocStoreBundle/Validator/Constraints/AsyncFileExists.php index b76ddae68..185b8134b 100644 --- a/src/Bundle/ChillDocStoreBundle/Validator/Constraints/AsyncFileExists.php +++ b/src/Bundle/ChillDocStoreBundle/Validator/Constraints/AsyncFileExists.php @@ -27,11 +27,13 @@ final class AsyncFileExists extends Constraint } } + #[\Override] public function validatedBy() { return AsyncFileExistsValidator::class; } + #[\Override] public function getTargets() { return [Constraint::CLASS_CONSTRAINT, Constraint::PROPERTY_CONSTRAINT]; diff --git a/src/Bundle/ChillDocStoreBundle/Validator/Constraints/AsyncFileExistsValidator.php b/src/Bundle/ChillDocStoreBundle/Validator/Constraints/AsyncFileExistsValidator.php index e5ccd2fdf..80d320af0 100644 --- a/src/Bundle/ChillDocStoreBundle/Validator/Constraints/AsyncFileExistsValidator.php +++ b/src/Bundle/ChillDocStoreBundle/Validator/Constraints/AsyncFileExistsValidator.php @@ -30,6 +30,7 @@ final class AsyncFileExistsValidator extends ConstraintValidator private readonly HttpClientInterface $client ) {} + #[\Override] public function validate($value, Constraint $constraint): void { if ($value instanceof StoredObject) { diff --git a/src/Bundle/ChillDocStoreBundle/Workflow/AccompanyingCourseDocumentWorkflowHandler.php b/src/Bundle/ChillDocStoreBundle/Workflow/AccompanyingCourseDocumentWorkflowHandler.php index 9d1b619f9..4cf08e451 100644 --- a/src/Bundle/ChillDocStoreBundle/Workflow/AccompanyingCourseDocumentWorkflowHandler.php +++ b/src/Bundle/ChillDocStoreBundle/Workflow/AccompanyingCourseDocumentWorkflowHandler.php @@ -34,6 +34,7 @@ class AccompanyingCourseDocumentWorkflowHandler implements EntityWorkflowHandler $this->repository = $em->getRepository(AccompanyingCourseDocument::class); } + #[\Override] public function getDeletionRoles(): array { return [ @@ -41,6 +42,7 @@ class AccompanyingCourseDocumentWorkflowHandler implements EntityWorkflowHandler ]; } + #[\Override] public function getEntityData(EntityWorkflow $entityWorkflow, array $options = []): array { $course = $this->getRelatedEntity($entityWorkflow)?->getCourse(); @@ -55,6 +57,7 @@ class AccompanyingCourseDocumentWorkflowHandler implements EntityWorkflowHandler ]; } + #[\Override] public function getEntityTitle(EntityWorkflow $entityWorkflow, array $options = []): string { $doc = $this->getRelatedEntity($entityWorkflow); @@ -67,6 +70,7 @@ class AccompanyingCourseDocumentWorkflowHandler implements EntityWorkflowHandler .' - '.$doc->getTitle(); } + #[\Override] public function getRelatedEntity(EntityWorkflow $entityWorkflow): ?AccompanyingCourseDocument { return $this->repository->find($entityWorkflow->getRelatedEntityId()); @@ -77,6 +81,7 @@ class AccompanyingCourseDocumentWorkflowHandler implements EntityWorkflowHandler * * @return array[] */ + #[\Override] public function getRelatedObjects(object $object): array { return [ @@ -84,11 +89,13 @@ class AccompanyingCourseDocumentWorkflowHandler implements EntityWorkflowHandler ]; } + #[\Override] public function getRoleShow(EntityWorkflow $entityWorkflow): ?string { return null; } + #[\Override] public function getSuggestedUsers(EntityWorkflow $entityWorkflow): array { $suggestedUsers = $entityWorkflow->getUsersInvolved(); @@ -99,11 +106,13 @@ class AccompanyingCourseDocumentWorkflowHandler implements EntityWorkflowHandler return $suggestedUsers; } + #[\Override] public function getTemplate(EntityWorkflow $entityWorkflow, array $options = []): string { return '@ChillDocStore/AccompanyingCourseDocument/_workflow.html.twig'; } + #[\Override] public function getTemplateData(EntityWorkflow $entityWorkflow, array $options = []): array { return [ @@ -112,16 +121,19 @@ class AccompanyingCourseDocumentWorkflowHandler implements EntityWorkflowHandler ]; } + #[\Override] public function isObjectSupported(object $object): bool { return $object instanceof AccompanyingCourseDocument; } + #[\Override] public function supports(EntityWorkflow $entityWorkflow, array $options = []): bool { return AccompanyingCourseDocument::class === $entityWorkflow->getRelatedEntityClass(); } + #[\Override] public function supportsFreeze(EntityWorkflow $entityWorkflow, array $options = []): bool { return false; diff --git a/src/Bundle/ChillDocStoreBundle/migrations/Version20180605102533.php b/src/Bundle/ChillDocStoreBundle/migrations/Version20180605102533.php index b9a0bf336..df965cdfc 100644 --- a/src/Bundle/ChillDocStoreBundle/migrations/Version20180605102533.php +++ b/src/Bundle/ChillDocStoreBundle/migrations/Version20180605102533.php @@ -19,6 +19,7 @@ use Doctrine\Migrations\AbstractMigration; */ final class Version20180605102533 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->abortIf('postgresql' !== $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'postgresql\'.'); @@ -26,6 +27,7 @@ final class Version20180605102533 extends AbstractMigration $this->addSql('DROP SCHEMA chill_doc CASCADE'); } + #[\Override] public function up(Schema $schema): void { $this->abortIf('postgresql' !== $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'postgresql\'.'); diff --git a/src/Bundle/ChillDocStoreBundle/migrations/Version20180606133338.php b/src/Bundle/ChillDocStoreBundle/migrations/Version20180606133338.php index c18778788..952823e0d 100644 --- a/src/Bundle/ChillDocStoreBundle/migrations/Version20180606133338.php +++ b/src/Bundle/ChillDocStoreBundle/migrations/Version20180606133338.php @@ -19,6 +19,7 @@ use Doctrine\Migrations\AbstractMigration; */ final class Version20180606133338 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->abortIf('postgresql' !== $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'postgresql\'.'); @@ -30,6 +31,7 @@ final class Version20180606133338 extends AbstractMigration $this->addSql('ALTER TABLE chill_doc.person_document DROP object_id'); } + #[\Override] public function up(Schema $schema): void { $this->abortIf('postgresql' !== $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'postgresql\'.'); diff --git a/src/Bundle/ChillDocStoreBundle/migrations/Version20210903091534.php b/src/Bundle/ChillDocStoreBundle/migrations/Version20210903091534.php index 334bf33d9..bc15b5812 100644 --- a/src/Bundle/ChillDocStoreBundle/migrations/Version20210903091534.php +++ b/src/Bundle/ChillDocStoreBundle/migrations/Version20210903091534.php @@ -19,17 +19,20 @@ use Doctrine\Migrations\AbstractMigration; */ final class Version20210903091534 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->addSql('DROP SEQUENCE chill_doc.accompanyingcourse_document_id_seq CASCADE'); $this->addSql('DROP TABLE chill_doc.accompanyingcourse_document'); } + #[\Override] public function getDescription(): string { return ''; } + #[\Override] public function up(Schema $schema): void { $this->addSql('CREATE SEQUENCE chill_doc.accompanyingcourse_document_id_seq INCREMENT BY 1 MINVALUE 1 START 1'); diff --git a/src/Bundle/ChillDocStoreBundle/migrations/Version20210903123835.php b/src/Bundle/ChillDocStoreBundle/migrations/Version20210903123835.php index fee3d7157..ae7103804 100644 --- a/src/Bundle/ChillDocStoreBundle/migrations/Version20210903123835.php +++ b/src/Bundle/ChillDocStoreBundle/migrations/Version20210903123835.php @@ -19,6 +19,7 @@ use Doctrine\Migrations\AbstractMigration; */ final class Version20210903123835 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->addSql('ALTER TABLE chill_doc.accompanyingcourse_document DROP CONSTRAINT FK_A45098F6369A0BE36EF62EFC'); @@ -39,11 +40,13 @@ final class Version20210903123835 extends AbstractMigration $this->addSql('ALTER TABLE chill_doc.accompanyingcourse_document DROP date'); } + #[\Override] public function getDescription(): string { return ''; } + #[\Override] public function up(Schema $schema): void { $this->addSql('ALTER TABLE chill_doc.accompanyingcourse_document ADD category_bundle_id VARCHAR(255) DEFAULT NULL'); diff --git a/src/Bundle/ChillDocStoreBundle/migrations/Version20210928182542.php b/src/Bundle/ChillDocStoreBundle/migrations/Version20210928182542.php index e95dba572..fe8f98ec0 100644 --- a/src/Bundle/ChillDocStoreBundle/migrations/Version20210928182542.php +++ b/src/Bundle/ChillDocStoreBundle/migrations/Version20210928182542.php @@ -16,16 +16,19 @@ use Doctrine\Migrations\AbstractMigration; final class Version20210928182542 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->addSql('ALTER TABLE chill_doc.stored_object DROP uuid'); } + #[\Override] public function getDescription(): string { return 'Create UUID column on StoredObject table.'; } + #[\Override] public function up(Schema $schema): void { $this->addSql('CREATE EXTENSION IF NOT EXISTS "uuid-ossp"'); diff --git a/src/Bundle/ChillDocStoreBundle/migrations/Version20211119173558.php b/src/Bundle/ChillDocStoreBundle/migrations/Version20211119173558.php index 1c3907563..2c96cd1a6 100644 --- a/src/Bundle/ChillDocStoreBundle/migrations/Version20211119173558.php +++ b/src/Bundle/ChillDocStoreBundle/migrations/Version20211119173558.php @@ -16,16 +16,19 @@ use Doctrine\Migrations\AbstractMigration; final class Version20211119173558 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->throwIrreversibleMigrationException(); } + #[\Override] public function getDescription(): string { return 'remove comment on deprecated json_array type'; } + #[\Override] public function up(Schema $schema): void { $columns = [ diff --git a/src/Bundle/ChillDocStoreBundle/migrations/Version20220131093117.php b/src/Bundle/ChillDocStoreBundle/migrations/Version20220131093117.php index 3474e5199..ffd5dc5d0 100644 --- a/src/Bundle/ChillDocStoreBundle/migrations/Version20220131093117.php +++ b/src/Bundle/ChillDocStoreBundle/migrations/Version20220131093117.php @@ -19,6 +19,7 @@ use Doctrine\Migrations\AbstractMigration; */ final class Version20220131093117 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->addSql('ALTER TABLE chill_doc.person_document DROP CONSTRAINT FK_41DA53C5DA0FB8'); @@ -39,11 +40,13 @@ final class Version20220131093117 extends AbstractMigration $this->addSql('ALTER TABLE chill_doc.accompanyingcourse_document DROP updatedBy_id'); } + #[\Override] public function getDescription(): string { return 'Implementations of create and update traits for Document entity + template property added'; } + #[\Override] public function up(Schema $schema): void { $this->addSql('ALTER TABLE chill_doc.accompanyingcourse_document ADD template_id INT DEFAULT NULL'); diff --git a/src/Bundle/ChillDocStoreBundle/migrations/Version20220525141646.php b/src/Bundle/ChillDocStoreBundle/migrations/Version20220525141646.php index 17b65896c..d48fedc0b 100644 --- a/src/Bundle/ChillDocStoreBundle/migrations/Version20220525141646.php +++ b/src/Bundle/ChillDocStoreBundle/migrations/Version20220525141646.php @@ -19,16 +19,19 @@ use Doctrine\Migrations\AbstractMigration; */ final class Version20220525141646 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->addSql('ALTER TABLE chill_doc.stored_object DROP title'); } + #[\Override] public function getDescription(): string { return 'Add title on storedObject'; } + #[\Override] public function up(Schema $schema): void { $this->addSql('ALTER TABLE chill_doc.stored_object ADD title TEXT NOT NULL DEFAULT \'\' '); diff --git a/src/Bundle/ChillDocStoreBundle/migrations/Version20230227161327.php b/src/Bundle/ChillDocStoreBundle/migrations/Version20230227161327.php index a9453fa07..1c8b6a253 100644 --- a/src/Bundle/ChillDocStoreBundle/migrations/Version20230227161327.php +++ b/src/Bundle/ChillDocStoreBundle/migrations/Version20230227161327.php @@ -16,16 +16,19 @@ use Doctrine\Migrations\AbstractMigration; final class Version20230227161327 extends AbstractMigration { + #[\Override] public function getDescription(): string { return 'Add a generation counter on doc store'; } + #[\Override] public function up(Schema $schema): void { $this->addSql('ALTER TABLE chill_doc.stored_object ADD generationTrialsCounter INT DEFAULT 0 NOT NULL;'); } + #[\Override] public function down(Schema $schema): void { $this->addSql('ALTER TABLE chill_doc.stored_object DROP generationTrialsCounter'); diff --git a/src/Bundle/ChillDocStoreBundle/migrations/Version20240322100107.php b/src/Bundle/ChillDocStoreBundle/migrations/Version20240322100107.php index 5f7a92b48..38eaf77c5 100644 --- a/src/Bundle/ChillDocStoreBundle/migrations/Version20240322100107.php +++ b/src/Bundle/ChillDocStoreBundle/migrations/Version20240322100107.php @@ -16,11 +16,13 @@ use Doctrine\Migrations\AbstractMigration; final class Version20240322100107 extends AbstractMigration { + #[\Override] public function getDescription(): string { return 'StoredObject: add deleteAt and generationErrors columns'; } + #[\Override] public function up(Schema $schema): void { $this->addSql('ALTER TABLE chill_doc.stored_object ADD deleteAt TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL'); @@ -28,6 +30,7 @@ final class Version20240322100107 extends AbstractMigration $this->addSql('COMMENT ON COLUMN chill_doc.stored_object.deleteAt IS \'(DC2Type:datetime_immutable)\''); } + #[\Override] public function down(Schema $schema): void { $this->addSql('ALTER TABLE chill_doc.stored_object DROP deleteAt'); diff --git a/src/Bundle/ChillEventBundle/DataFixtures/ORM/LoadEventTypes.php b/src/Bundle/ChillEventBundle/DataFixtures/ORM/LoadEventTypes.php index 1d2668c12..484797b17 100644 --- a/src/Bundle/ChillEventBundle/DataFixtures/ORM/LoadEventTypes.php +++ b/src/Bundle/ChillEventBundle/DataFixtures/ORM/LoadEventTypes.php @@ -25,11 +25,13 @@ class LoadEventTypes extends AbstractFixture implements OrderedFixtureInterface { public static $refs = []; + #[\Override] public function getOrder() { return 30000; } + #[\Override] public function load(ObjectManager $manager) { /* diff --git a/src/Bundle/ChillEventBundle/DataFixtures/ORM/LoadParticipation.php b/src/Bundle/ChillEventBundle/DataFixtures/ORM/LoadParticipation.php index db431c858..821a24f34 100644 --- a/src/Bundle/ChillEventBundle/DataFixtures/ORM/LoadParticipation.php +++ b/src/Bundle/ChillEventBundle/DataFixtures/ORM/LoadParticipation.php @@ -58,11 +58,13 @@ class LoadParticipation extends AbstractFixture implements OrderedFixtureInterfa return $events; } + #[\Override] public function getOrder() { return 30010; } + #[\Override] public function load(ObjectManager $manager) { $centers = $manager->getRepository(Center::class) diff --git a/src/Bundle/ChillEventBundle/DataFixtures/ORM/LoadRolesACL.php b/src/Bundle/ChillEventBundle/DataFixtures/ORM/LoadRolesACL.php index 87e676730..1b6d181ab 100644 --- a/src/Bundle/ChillEventBundle/DataFixtures/ORM/LoadRolesACL.php +++ b/src/Bundle/ChillEventBundle/DataFixtures/ORM/LoadRolesACL.php @@ -23,11 +23,13 @@ use Doctrine\Persistence\ObjectManager; */ class LoadRolesACL extends AbstractFixture implements OrderedFixtureInterface { + #[\Override] public function getOrder() { return 30011; } + #[\Override] public function load(ObjectManager $manager) { foreach (LoadPermissionsGroup::$refs as $permissionsGroupRef) { diff --git a/src/Bundle/ChillEventBundle/DependencyInjection/ChillEventExtension.php b/src/Bundle/ChillEventBundle/DependencyInjection/ChillEventExtension.php index 0b30ca6c5..c33aa09a7 100644 --- a/src/Bundle/ChillEventBundle/DependencyInjection/ChillEventExtension.php +++ b/src/Bundle/ChillEventBundle/DependencyInjection/ChillEventExtension.php @@ -26,6 +26,7 @@ use Symfony\Component\HttpKernel\DependencyInjection\Extension; */ class ChillEventExtension extends Extension implements PrependExtensionInterface { + #[\Override] public function load(array $configs, ContainerBuilder $container) { $configuration = new Configuration(); @@ -45,6 +46,7 @@ class ChillEventExtension extends Extension implements PrependExtensionInterface /** (non-PHPdoc). * @see \Symfony\Component\DependencyInjection\Extension\PrependExtensionInterface::prepend() */ + #[\Override] public function prepend(ContainerBuilder $container) { $this->prependAuthorization($container); diff --git a/src/Bundle/ChillEventBundle/DependencyInjection/Configuration.php b/src/Bundle/ChillEventBundle/DependencyInjection/Configuration.php index fe42ad99a..27f97bd47 100644 --- a/src/Bundle/ChillEventBundle/DependencyInjection/Configuration.php +++ b/src/Bundle/ChillEventBundle/DependencyInjection/Configuration.php @@ -21,6 +21,7 @@ use Symfony\Component\Config\Definition\ConfigurationInterface; */ class Configuration implements ConfigurationInterface { + #[\Override] public function getConfigTreeBuilder() { $treeBuilder = new TreeBuilder('chill_event'); diff --git a/src/Bundle/ChillEventBundle/Entity/Event.php b/src/Bundle/ChillEventBundle/Entity/Event.php index 4a3b4cd67..2a300ca0c 100644 --- a/src/Bundle/ChillEventBundle/Entity/Event.php +++ b/src/Bundle/ChillEventBundle/Entity/Event.php @@ -129,6 +129,7 @@ class Event implements HasCenterInterface, HasScopeInterface, TrackCreationInter /** * @return Center */ + #[\Override] public function getCenter() { return $this->center; @@ -202,6 +203,7 @@ class Event implements HasCenterInterface, HasScopeInterface, TrackCreationInter * * @return Scope */ + #[\Override] public function getScope() { return $this->getCircle(); diff --git a/src/Bundle/ChillEventBundle/Entity/Participation.php b/src/Bundle/ChillEventBundle/Entity/Participation.php index 0225799c5..80549784e 100644 --- a/src/Bundle/ChillEventBundle/Entity/Participation.php +++ b/src/Bundle/ChillEventBundle/Entity/Participation.php @@ -58,6 +58,7 @@ class Participation implements \ArrayAccess, HasCenterInterface, HasScopeInterfa #[ORM\ManyToOne(targetEntity: Status::class)] private ?Status $status = null; + #[\Override] public function getCenter() { if (null === $this->getEvent()) { @@ -114,6 +115,7 @@ class Participation implements \ArrayAccess, HasCenterInterface, HasScopeInterfa /** * @return Scope */ + #[\Override] public function getScope() { if (null === $this->getEvent()) { @@ -162,6 +164,7 @@ class Participation implements \ArrayAccess, HasCenterInterface, HasScopeInterfa } } + #[\Override] public function offsetExists(mixed $offset): bool { return \in_array($offset, [ @@ -172,6 +175,7 @@ class Participation implements \ArrayAccess, HasCenterInterface, HasScopeInterfa /** * @return Event|Person|Role|Status */ + #[\Override] public function offsetGet(mixed $offset): mixed { return match ($offset) { @@ -183,6 +187,7 @@ class Participation implements \ArrayAccess, HasCenterInterface, HasScopeInterfa }; } + #[\Override] public function offsetSet(mixed $offset, mixed $value): void { switch ($offset) { @@ -208,6 +213,7 @@ class Participation implements \ArrayAccess, HasCenterInterface, HasScopeInterfa } } + #[\Override] public function offsetUnset(mixed $offset): void { $this->offsetSet($offset, null); diff --git a/src/Bundle/ChillEventBundle/Export/Aggregator/EventDateAggregator.php b/src/Bundle/ChillEventBundle/Export/Aggregator/EventDateAggregator.php index 1e519997a..98a8e98c8 100644 --- a/src/Bundle/ChillEventBundle/Export/Aggregator/EventDateAggregator.php +++ b/src/Bundle/ChillEventBundle/Export/Aggregator/EventDateAggregator.php @@ -19,19 +19,21 @@ use Symfony\Component\Form\FormBuilderInterface; class EventDateAggregator implements AggregatorInterface { - private const CHOICES = [ + private const array CHOICES = [ 'by month' => 'month', 'by week' => 'week', 'by year' => 'year', ]; - private const DEFAULT_CHOICE = 'year'; + private const string DEFAULT_CHOICE = 'year'; + #[\Override] public function addRole(): ?string { return null; } + #[\Override] public function alterQuery(QueryBuilder $qb, $data) { $order = null; @@ -62,11 +64,13 @@ class EventDateAggregator implements AggregatorInterface $qb->addOrderBy('date_aggregator', $order); } + #[\Override] public function applyOn(): string { return Declarations::EVENT; } + #[\Override] public function buildForm(FormBuilderInterface $builder) { $builder->add('frequency', ChoiceType::class, [ @@ -76,11 +80,13 @@ class EventDateAggregator implements AggregatorInterface ]); } + #[\Override] public function getFormDefaultData(): array { return ['frequency' => self::DEFAULT_CHOICE]; } + #[\Override] public function getLabels($key, array $values, $data) { return static function ($value) use ($data): string { @@ -98,11 +104,13 @@ class EventDateAggregator implements AggregatorInterface }; } + #[\Override] public function getQueryKeys($data): array { return ['date_aggregator']; } + #[\Override] public function getTitle(): string { return 'Group event by date'; diff --git a/src/Bundle/ChillEventBundle/Export/Aggregator/EventTypeAggregator.php b/src/Bundle/ChillEventBundle/Export/Aggregator/EventTypeAggregator.php index db757cac9..959b1c6c2 100644 --- a/src/Bundle/ChillEventBundle/Export/Aggregator/EventTypeAggregator.php +++ b/src/Bundle/ChillEventBundle/Export/Aggregator/EventTypeAggregator.php @@ -20,15 +20,17 @@ use Symfony\Component\Form\FormBuilderInterface; class EventTypeAggregator implements AggregatorInterface { - final public const KEY = 'event_type_aggregator'; + final public const string KEY = 'event_type_aggregator'; public function __construct(protected EventTypeRepository $eventTypeRepository, protected TranslatableStringHelperInterface $translatableStringHelper) {} + #[\Override] public function addRole(): ?string { return null; } + #[\Override] public function alterQuery(QueryBuilder $qb, $data) { if (!\in_array('eventtype', $qb->getAllAliases(), true)) { @@ -39,21 +41,25 @@ class EventTypeAggregator implements AggregatorInterface $qb->addGroupBy(self::KEY); } + #[\Override] public function applyOn(): string { return Declarations::EVENT; } + #[\Override] public function buildForm(FormBuilderInterface $builder) { // no form required for this aggregator } + #[\Override] public function getFormDefaultData(): array { return []; } + #[\Override] public function getLabels($key, array $values, $data): \Closure { return function (int|string|null $value): string { @@ -69,11 +75,13 @@ class EventTypeAggregator implements AggregatorInterface }; } + #[\Override] public function getQueryKeys($data): array { return [self::KEY]; } + #[\Override] public function getTitle() { return 'Group by event type'; diff --git a/src/Bundle/ChillEventBundle/Export/Aggregator/RoleAggregator.php b/src/Bundle/ChillEventBundle/Export/Aggregator/RoleAggregator.php index c02483db2..1a94fd5a5 100644 --- a/src/Bundle/ChillEventBundle/Export/Aggregator/RoleAggregator.php +++ b/src/Bundle/ChillEventBundle/Export/Aggregator/RoleAggregator.php @@ -20,15 +20,17 @@ use Symfony\Component\Form\FormBuilderInterface; class RoleAggregator implements AggregatorInterface { - final public const KEY = 'part_role_aggregator'; + final public const string KEY = 'part_role_aggregator'; public function __construct(protected RoleRepository $roleRepository, protected TranslatableStringHelperInterface $translatableStringHelper) {} + #[\Override] public function addRole(): ?string { return null; } + #[\Override] public function alterQuery(QueryBuilder $qb, $data) { if (!\in_array('event_part', $qb->getAllAliases(), true)) { @@ -39,21 +41,25 @@ class RoleAggregator implements AggregatorInterface $qb->addGroupBy(self::KEY); } + #[\Override] public function applyOn(): string { return Declarations::EVENT_PARTICIPANTS; } + #[\Override] public function buildForm(FormBuilderInterface $builder) { // no form required for this aggregator } + #[\Override] public function getFormDefaultData(): array { return []; } + #[\Override] public function getLabels($key, array $values, $data): \Closure { return function (int|string|null $value): string { @@ -69,11 +75,13 @@ class RoleAggregator implements AggregatorInterface }; } + #[\Override] public function getQueryKeys($data): array { return [self::KEY]; } + #[\Override] public function getTitle() { return 'Group by participant role'; diff --git a/src/Bundle/ChillEventBundle/Export/Export/CountEventParticipations.php b/src/Bundle/ChillEventBundle/Export/Export/CountEventParticipations.php index 5c5d5bf05..5c32c7d21 100644 --- a/src/Bundle/ChillEventBundle/Export/Export/CountEventParticipations.php +++ b/src/Bundle/ChillEventBundle/Export/Export/CountEventParticipations.php @@ -34,28 +34,34 @@ readonly class CountEventParticipations implements ExportInterface, GroupedExpor $this->filterStatsByCenters = $parameterBag->get('chill_main')['acl']['filter_stats_by_center']; } + #[\Override] public function buildForm(FormBuilderInterface $builder) {} + #[\Override] public function getFormDefaultData(): array { return []; } + #[\Override] public function getAllowedFormattersTypes() { return [FormatterInterface::TYPE_TABULAR]; } + #[\Override] public function getDescription() { return 'Count participants to an event by various parameters.'; } + #[\Override] public function getGroup(): string { return 'Exports of events'; } + #[\Override] public function getLabels($key, array $values, $data) { if ('export_count_event_participants' !== $key) { @@ -65,26 +71,31 @@ readonly class CountEventParticipations implements ExportInterface, GroupedExpor return static fn ($value) => '_header' === $value ? 'Count event participants' : $value; } + #[\Override] public function getQueryKeys($data) { return ['export_count_event_participants']; } + #[\Override] public function getResult($query, $data) { return $query->getQuery()->getResult(Query::HYDRATE_SCALAR); } + #[\Override] public function getTitle() { return 'Count event participants'; } + #[\Override] public function getType(): string { return Declarations::EVENT_PARTICIPANTS; } + #[\Override] public function initiateQuery(array $requiredModifiers, array $acl, array $data = []) { $centers = array_map(static fn ($el) => $el['center'], $acl); @@ -110,11 +121,13 @@ readonly class CountEventParticipations implements ExportInterface, GroupedExpor return $qb; } + #[\Override] public function requiredRole(): string { return ParticipationVoter::STATS; } + #[\Override] public function supportsModifiers() { return [ diff --git a/src/Bundle/ChillEventBundle/Export/Export/CountEvents.php b/src/Bundle/ChillEventBundle/Export/Export/CountEvents.php index 7cb98b5a6..ea14c953d 100644 --- a/src/Bundle/ChillEventBundle/Export/Export/CountEvents.php +++ b/src/Bundle/ChillEventBundle/Export/Export/CountEvents.php @@ -34,28 +34,34 @@ readonly class CountEvents implements ExportInterface, GroupedExportInterface $this->filterStatsByCenters = $parameterBag->get('chill_main')['acl']['filter_stats_by_center']; } + #[\Override] public function buildForm(FormBuilderInterface $builder) {} + #[\Override] public function getFormDefaultData(): array { return []; } + #[\Override] public function getAllowedFormattersTypes() { return [FormatterInterface::TYPE_TABULAR]; } + #[\Override] public function getDescription() { return 'Count events by various parameters.'; } + #[\Override] public function getGroup(): string { return 'Exports of events'; } + #[\Override] public function getLabels($key, array $values, $data) { if ('export_count_event' !== $key) { @@ -65,26 +71,31 @@ readonly class CountEvents implements ExportInterface, GroupedExportInterface return static fn ($value) => '_header' === $value ? 'Number of events' : $value; } + #[\Override] public function getQueryKeys($data) { return ['export_count_event']; } + #[\Override] public function getResult($query, $data) { return $query->getQuery()->getResult(Query::HYDRATE_SCALAR); } + #[\Override] public function getTitle() { return 'Count events'; } + #[\Override] public function getType(): string { return Declarations::EVENT; } + #[\Override] public function initiateQuery(array $requiredModifiers, array $acl, array $data = []) { $centers = array_map(static fn ($el) => $el['center'], $acl); @@ -111,11 +122,13 @@ readonly class CountEvents implements ExportInterface, GroupedExportInterface return $qb; } + #[\Override] public function requiredRole(): string { return EventVoter::STATS; } + #[\Override] public function supportsModifiers() { return [ diff --git a/src/Bundle/ChillEventBundle/Export/Filter/EventDateFilter.php b/src/Bundle/ChillEventBundle/Export/Filter/EventDateFilter.php index 10f1dbd81..d7214f28d 100644 --- a/src/Bundle/ChillEventBundle/Export/Filter/EventDateFilter.php +++ b/src/Bundle/ChillEventBundle/Export/Filter/EventDateFilter.php @@ -25,11 +25,13 @@ class EventDateFilter implements FilterInterface { public function __construct(protected TranslatorInterface $translator, private readonly RollingDateConverterInterface $rollingDateConverter) {} + #[\Override] public function addRole(): ?string { return null; } + #[\Override] public function alterQuery(QueryBuilder $qb, $data) { $where = $qb->getDQLPart('where'); @@ -56,11 +58,13 @@ class EventDateFilter implements FilterInterface ); } + #[\Override] public function applyOn(): string { return Declarations::EVENT; } + #[\Override] public function buildForm(FormBuilderInterface $builder) { $builder @@ -72,11 +76,13 @@ class EventDateFilter implements FilterInterface ]); } + #[\Override] public function getFormDefaultData(): array { return ['date_from' => new RollingDate(RollingDate::T_YEAR_PREVIOUS_START), 'date_to' => new RollingDate(RollingDate::T_TODAY)]; } + #[\Override] public function describeAction($data, $format = 'string') { return [ @@ -88,6 +94,7 @@ class EventDateFilter implements FilterInterface ]; } + #[\Override] public function getTitle() { return 'Filtered by event date'; diff --git a/src/Bundle/ChillEventBundle/Export/Filter/EventTypeFilter.php b/src/Bundle/ChillEventBundle/Export/Filter/EventTypeFilter.php index 9e8855adf..3015db0f5 100644 --- a/src/Bundle/ChillEventBundle/Export/Filter/EventTypeFilter.php +++ b/src/Bundle/ChillEventBundle/Export/Filter/EventTypeFilter.php @@ -29,11 +29,13 @@ class EventTypeFilter implements ExportElementValidatedInterface, FilterInterfac protected EventTypeRepository $eventTypeRepository ) {} + #[\Override] public function addRole(): ?string { return null; } + #[\Override] public function alterQuery(QueryBuilder $qb, $data) { $clause = $qb->expr()->in('event.type', ':selected_event_types'); @@ -42,11 +44,13 @@ class EventTypeFilter implements ExportElementValidatedInterface, FilterInterfac $qb->setParameter('selected_event_types', $data['types']); } + #[\Override] public function applyOn(): string { return Declarations::EVENT; } + #[\Override] public function buildForm(FormBuilderInterface $builder) { $builder->add('types', EntityType::class, [ @@ -61,11 +65,13 @@ class EventTypeFilter implements ExportElementValidatedInterface, FilterInterfac ]); } + #[\Override] public function getFormDefaultData(): array { return []; } + #[\Override] public function describeAction($data, $format = 'string') { $typeNames = array_map( @@ -78,11 +84,13 @@ class EventTypeFilter implements ExportElementValidatedInterface, FilterInterfac ]]; } + #[\Override] public function getTitle() { return 'Filtered by event type'; } + #[\Override] public function validateForm($data, ExecutionContextInterface $context) { if (null === $data['types'] || 0 === \count($data['types'])) { diff --git a/src/Bundle/ChillEventBundle/Export/Filter/RoleFilter.php b/src/Bundle/ChillEventBundle/Export/Filter/RoleFilter.php index 791f07f7a..d313bd6c7 100644 --- a/src/Bundle/ChillEventBundle/Export/Filter/RoleFilter.php +++ b/src/Bundle/ChillEventBundle/Export/Filter/RoleFilter.php @@ -29,11 +29,13 @@ class RoleFilter implements ExportElementValidatedInterface, FilterInterface protected RoleRepository $roleRepository ) {} + #[\Override] public function addRole(): ?string { return null; } + #[\Override] public function alterQuery(QueryBuilder $qb, $data) { $clause = $qb->expr()->in('event_part.role', ':selected_part_roles'); @@ -42,11 +44,13 @@ class RoleFilter implements ExportElementValidatedInterface, FilterInterface $qb->setParameter('selected_part_roles', $data['part_roles']); } + #[\Override] public function applyOn(): string { return Declarations::EVENT_PARTICIPANTS; } + #[\Override] public function buildForm(FormBuilderInterface $builder) { $builder->add('part_roles', EntityType::class, [ @@ -61,11 +65,13 @@ class RoleFilter implements ExportElementValidatedInterface, FilterInterface ]); } + #[\Override] public function getFormDefaultData(): array { return []; } + #[\Override] public function describeAction($data, $format = 'string') { $roleNames = array_map( @@ -78,11 +84,13 @@ class RoleFilter implements ExportElementValidatedInterface, FilterInterface ]]; } + #[\Override] public function getTitle() { return 'Filter by participant roles'; } + #[\Override] public function validateForm($data, ExecutionContextInterface $context) { if (null === $data['part_roles'] || 0 === \count($data['part_roles'])) { diff --git a/src/Bundle/ChillEventBundle/Form/ChoiceLoader/EventChoiceLoader.php b/src/Bundle/ChillEventBundle/Form/ChoiceLoader/EventChoiceLoader.php index 9aa001170..b39106725 100644 --- a/src/Bundle/ChillEventBundle/Form/ChoiceLoader/EventChoiceLoader.php +++ b/src/Bundle/ChillEventBundle/Form/ChoiceLoader/EventChoiceLoader.php @@ -53,6 +53,7 @@ class EventChoiceLoader implements ChoiceLoaderInterface /** * @param null $value */ + #[\Override] public function loadChoiceList($value = null): ChoiceListInterface { return new \Symfony\Component\Form\ChoiceList\ArrayChoiceList( @@ -66,6 +67,7 @@ class EventChoiceLoader implements ChoiceLoaderInterface * * @return array */ + #[\Override] public function loadChoicesForValues(array $values, $value = null) { $choices = []; @@ -95,6 +97,7 @@ class EventChoiceLoader implements ChoiceLoaderInterface * * @return array|string[] */ + #[\Override] public function loadValuesForChoices(array $choices, $value = null) { $values = []; diff --git a/src/Bundle/ChillEventBundle/Form/EventType.php b/src/Bundle/ChillEventBundle/Form/EventType.php index ebdf66010..2049a13b5 100644 --- a/src/Bundle/ChillEventBundle/Form/EventType.php +++ b/src/Bundle/ChillEventBundle/Form/EventType.php @@ -30,6 +30,7 @@ use Symfony\Component\OptionsResolver\OptionsResolver; class EventType extends AbstractType { + #[\Override] public function buildForm(FormBuilderInterface $builder, array $options) { $builder @@ -76,6 +77,7 @@ class EventType extends AbstractType ]); } + #[\Override] public function configureOptions(OptionsResolver $resolver) { $resolver->setDefaults([ @@ -90,6 +92,7 @@ class EventType extends AbstractType /** * @return string */ + #[\Override] public function getBlockPrefix() { return 'chill_eventbundle_event'; diff --git a/src/Bundle/ChillEventBundle/Form/EventTypeType.php b/src/Bundle/ChillEventBundle/Form/EventTypeType.php index 4b09daef0..04c5ecc4e 100644 --- a/src/Bundle/ChillEventBundle/Form/EventTypeType.php +++ b/src/Bundle/ChillEventBundle/Form/EventTypeType.php @@ -17,6 +17,7 @@ use Symfony\Component\Form\FormBuilderInterface; class EventTypeType extends AbstractType { + #[\Override] public function buildForm(FormBuilderInterface $builder, array $options) { $builder @@ -27,11 +28,13 @@ class EventTypeType extends AbstractType /** * @return string */ + #[\Override] public function getBlockPrefix() { return 'chill_eventbundle_eventtype'; } + #[\Override] public function configureOptions(\Symfony\Component\OptionsResolver\OptionsResolver $resolver) { $resolver->setDefaults([ diff --git a/src/Bundle/ChillEventBundle/Form/ParticipationType.php b/src/Bundle/ChillEventBundle/Form/ParticipationType.php index af1854954..1c74ae4c1 100644 --- a/src/Bundle/ChillEventBundle/Form/ParticipationType.php +++ b/src/Bundle/ChillEventBundle/Form/ParticipationType.php @@ -29,6 +29,7 @@ final class ParticipationType extends AbstractType { public function __construct(private readonly TranslatableStringHelperInterface $translatableStringHelper) {} + #[\Override] public function buildForm(FormBuilderInterface $builder, array $options) { // local copy of variable for Closure @@ -45,6 +46,7 @@ final class ParticipationType extends AbstractType ]); } + #[\Override] public function configureOptions(OptionsResolver $resolver) { $resolver->setDefined('event_type') diff --git a/src/Bundle/ChillEventBundle/Form/RoleType.php b/src/Bundle/ChillEventBundle/Form/RoleType.php index 8b9f27be2..50db2b9cd 100644 --- a/src/Bundle/ChillEventBundle/Form/RoleType.php +++ b/src/Bundle/ChillEventBundle/Form/RoleType.php @@ -22,6 +22,7 @@ final class RoleType extends AbstractType { public function __construct(private readonly TranslatableStringHelperInterface $translatableStringHelper) {} + #[\Override] public function buildForm(FormBuilderInterface $builder, array $options) { $builder @@ -36,11 +37,13 @@ final class RoleType extends AbstractType /** * @return string */ + #[\Override] public function getBlockPrefix() { return 'chill_eventbundle_role'; } + #[\Override] public function configureOptions(\Symfony\Component\OptionsResolver\OptionsResolver $resolver) { $resolver->setDefaults([ diff --git a/src/Bundle/ChillEventBundle/Form/StatusType.php b/src/Bundle/ChillEventBundle/Form/StatusType.php index 7e8c8c1b9..9cc9caa22 100644 --- a/src/Bundle/ChillEventBundle/Form/StatusType.php +++ b/src/Bundle/ChillEventBundle/Form/StatusType.php @@ -18,6 +18,7 @@ use Symfony\Component\Form\FormBuilderInterface; class StatusType extends AbstractType { + #[\Override] public function buildForm(FormBuilderInterface $builder, array $options) { $builder @@ -29,11 +30,13 @@ class StatusType extends AbstractType /** * @return string */ + #[\Override] public function getBlockPrefix() { return 'chill_eventbundle_status'; } + #[\Override] public function configureOptions(\Symfony\Component\OptionsResolver\OptionsResolver $resolver) { $resolver->setDefaults([ diff --git a/src/Bundle/ChillEventBundle/Form/Type/PickEventType.php b/src/Bundle/ChillEventBundle/Form/Type/PickEventType.php index 9fcdbd85f..87ec0185d 100644 --- a/src/Bundle/ChillEventBundle/Form/Type/PickEventType.php +++ b/src/Bundle/ChillEventBundle/Form/Type/PickEventType.php @@ -45,6 +45,7 @@ final class PickEventType extends AbstractType private readonly Security $security ) {} + #[\Override] public function buildView(\Symfony\Component\Form\FormView $view, \Symfony\Component\Form\FormInterface $form, array $options) { $view->vars['attr']['data-person-picker'] = true; @@ -57,6 +58,7 @@ final class PickEventType extends AbstractType $view->vars['attr']['data-searching-label'] = $this->translator->trans('select2.searching'); } + #[\Override] public function configureOptions(OptionsResolver $resolver) { parent::configureOptions($resolver); @@ -88,6 +90,7 @@ final class PickEventType extends AbstractType ]); } + #[\Override] public function getParent(): ?string { return EntityType::class; diff --git a/src/Bundle/ChillEventBundle/Form/Type/PickEventTypeType.php b/src/Bundle/ChillEventBundle/Form/Type/PickEventTypeType.php index d027c05cf..cef7bb6b9 100644 --- a/src/Bundle/ChillEventBundle/Form/Type/PickEventTypeType.php +++ b/src/Bundle/ChillEventBundle/Form/Type/PickEventTypeType.php @@ -33,6 +33,7 @@ class PickEventTypeType extends AbstractType $this->translatableStringHelper = $helper; } + #[\Override] public function configureOptions(OptionsResolver $resolver) { $helper = $this->translatableStringHelper; @@ -47,6 +48,7 @@ class PickEventTypeType extends AbstractType ); } + #[\Override] public function getParent() { return EntityType::class; diff --git a/src/Bundle/ChillEventBundle/Form/Type/PickRoleType.php b/src/Bundle/ChillEventBundle/Form/Type/PickRoleType.php index c8d69c119..2439fb960 100644 --- a/src/Bundle/ChillEventBundle/Form/Type/PickRoleType.php +++ b/src/Bundle/ChillEventBundle/Form/Type/PickRoleType.php @@ -34,6 +34,7 @@ final class PickRoleType extends AbstractType private readonly RoleRepository $roleRepository ) {} + #[\Override] public function buildForm(FormBuilderInterface $builder, array $options) { // create copy for easier management @@ -69,6 +70,7 @@ final class PickRoleType extends AbstractType } } + #[\Override] public function configureOptions(OptionsResolver $resolver) { // create copy for use in Closure @@ -100,6 +102,7 @@ final class PickRoleType extends AbstractType ]); } + #[\Override] public function getParent() { return EntityType::class; diff --git a/src/Bundle/ChillEventBundle/Form/Type/PickStatusType.php b/src/Bundle/ChillEventBundle/Form/Type/PickStatusType.php index 3f4ab3624..5687b46ee 100644 --- a/src/Bundle/ChillEventBundle/Form/Type/PickStatusType.php +++ b/src/Bundle/ChillEventBundle/Form/Type/PickStatusType.php @@ -35,6 +35,7 @@ final class PickStatusType extends AbstractType { public function __construct(protected TranslatableStringHelperInterface $translatableStringHelper, protected TranslatorInterface $translator, protected StatusRepository $statusRepository) {} + #[\Override] public function buildForm(FormBuilderInterface $builder, array $options) { $qb = $options['query_builder']; @@ -66,6 +67,7 @@ final class PickStatusType extends AbstractType } } + #[\Override] public function configureOptions(OptionsResolver $resolver) { // create copy for use in Closure @@ -97,6 +99,7 @@ final class PickStatusType extends AbstractType ]); } + #[\Override] public function getParent() { return EntityType::class; diff --git a/src/Bundle/ChillEventBundle/Menu/AdminMenuBuilder.php b/src/Bundle/ChillEventBundle/Menu/AdminMenuBuilder.php index 9db1713b6..ce9f914ad 100644 --- a/src/Bundle/ChillEventBundle/Menu/AdminMenuBuilder.php +++ b/src/Bundle/ChillEventBundle/Menu/AdminMenuBuilder.php @@ -27,6 +27,7 @@ class AdminMenuBuilder implements LocalMenuBuilderInterface $this->authorizationChecker = $authorizationChecker; } + #[\Override] public function buildMenu($menuId, MenuItem $menu, array $parameters) { if (!$this->authorizationChecker->isGranted('ROLE_ADMIN')) { @@ -54,6 +55,7 @@ class AdminMenuBuilder implements LocalMenuBuilderInterface ])->setExtras(['order' => 6530]); } + #[\Override] public static function getMenuIds(): array { return ['admin_section', 'admin_event']; diff --git a/src/Bundle/ChillEventBundle/Menu/PersonMenuBuilder.php b/src/Bundle/ChillEventBundle/Menu/PersonMenuBuilder.php index e14e4c979..9b55dece8 100644 --- a/src/Bundle/ChillEventBundle/Menu/PersonMenuBuilder.php +++ b/src/Bundle/ChillEventBundle/Menu/PersonMenuBuilder.php @@ -37,6 +37,7 @@ class PersonMenuBuilder implements LocalMenuBuilderInterface $this->translator = $translator; } + #[\Override] public function buildMenu($menuId, MenuItem $menu, array $parameters) { /** @var \Chill\PersonBundle\Entity\Person $person */ @@ -55,6 +56,7 @@ class PersonMenuBuilder implements LocalMenuBuilderInterface } } + #[\Override] public static function getMenuIds(): array { return ['person']; diff --git a/src/Bundle/ChillEventBundle/Menu/SectionMenuBuilder.php b/src/Bundle/ChillEventBundle/Menu/SectionMenuBuilder.php index 276324938..a0856f80d 100644 --- a/src/Bundle/ChillEventBundle/Menu/SectionMenuBuilder.php +++ b/src/Bundle/ChillEventBundle/Menu/SectionMenuBuilder.php @@ -24,6 +24,7 @@ final readonly class SectionMenuBuilder implements LocalMenuBuilderInterface private TranslatorInterface $translator, ) {} + #[\Override] public function buildMenu($menuId, MenuItem $menu, array $parameters) { if ($this->security->isGranted(EventVoter::SEE)) { @@ -38,6 +39,7 @@ final readonly class SectionMenuBuilder implements LocalMenuBuilderInterface } } + #[\Override] public static function getMenuIds(): array { return ['section']; diff --git a/src/Bundle/ChillEventBundle/Repository/EventACLAwareRepository.php b/src/Bundle/ChillEventBundle/Repository/EventACLAwareRepository.php index 22141b536..ee5868e48 100644 --- a/src/Bundle/ChillEventBundle/Repository/EventACLAwareRepository.php +++ b/src/Bundle/ChillEventBundle/Repository/EventACLAwareRepository.php @@ -35,6 +35,7 @@ final readonly class EventACLAwareRepository implements EventACLAwareRepositoryI * @throws NonUniqueResultException * @throws NoResultException */ + #[\Override] public function countAllViewable(array $filters): int { if (!$this->security->getUser() instanceof User) { @@ -49,6 +50,7 @@ final readonly class EventACLAwareRepository implements EventACLAwareRepositoryI return $qb->getQuery()->getSingleScalarResult(); } + #[\Override] public function findAllViewable(array $filters, int $offset = 0, int $limit = 50): array { if (!$this->security->getUser() instanceof User) { diff --git a/src/Bundle/ChillEventBundle/Repository/RoleRepository.php b/src/Bundle/ChillEventBundle/Repository/RoleRepository.php index b5444a85b..4f209b939 100644 --- a/src/Bundle/ChillEventBundle/Repository/RoleRepository.php +++ b/src/Bundle/ChillEventBundle/Repository/RoleRepository.php @@ -32,11 +32,13 @@ readonly class RoleRepository implements ObjectRepository return $this->repository->createQueryBuilder($alias, $indexBy); } + #[\Override] public function find($id) { return $this->repository->find($id); } + #[\Override] public function findAll(): array { return $this->repository->findAll(); @@ -51,16 +53,19 @@ readonly class RoleRepository implements ObjectRepository return $roles; } + #[\Override] public function findBy(array $criteria, ?array $orderBy = null, ?int $limit = null, ?int $offset = null): array { return $this->repository->findBy($criteria, $orderBy, $limit, $offset); } + #[\Override] public function findOneBy(array $criteria) { return $this->repository->findOneBy($criteria); } + #[\Override] public function getClassName(): string { return Role::class; diff --git a/src/Bundle/ChillEventBundle/Search/EventSearch.php b/src/Bundle/ChillEventBundle/Search/EventSearch.php index 57cb9e9c5..49b09549c 100644 --- a/src/Bundle/ChillEventBundle/Search/EventSearch.php +++ b/src/Bundle/ChillEventBundle/Search/EventSearch.php @@ -35,7 +35,7 @@ use Symfony\Component\Security\Core\Security; */ class EventSearch extends AbstractSearch { - final public const NAME = 'event_regular'; + final public const string NAME = 'event_regular'; public function __construct( private readonly Security $security, @@ -45,16 +45,19 @@ class EventSearch extends AbstractSearch private readonly PaginatorFactory $paginatorFactory ) {} + #[\Override] public function getOrder() { return 3000; } + #[\Override] public function isActiveByDefault() { return true; } + #[\Override] public function renderResult( array $terms, $start = 0, @@ -98,6 +101,7 @@ class EventSearch extends AbstractSearch ]; } + #[\Override] public function supports($domain, $format) { return 'event' === $domain || 'events' === $domain; diff --git a/src/Bundle/ChillEventBundle/Security/EventVoter.php b/src/Bundle/ChillEventBundle/Security/EventVoter.php index e490e0518..ff8956e9a 100644 --- a/src/Bundle/ChillEventBundle/Security/EventVoter.php +++ b/src/Bundle/ChillEventBundle/Security/EventVoter.php @@ -28,22 +28,22 @@ use Symfony\Component\Security\Core\Authentication\Token\TokenInterface; */ class EventVoter extends AbstractChillVoter implements ProvideRoleHierarchyInterface { - final public const CREATE = 'CHILL_EVENT_CREATE'; + final public const string CREATE = 'CHILL_EVENT_CREATE'; - final public const ROLES = [ + final public const array ROLES = [ self::SEE, self::SEE_DETAILS, self::CREATE, self::UPDATE, ]; - final public const SEE = 'CHILL_EVENT_SEE'; + final public const string SEE = 'CHILL_EVENT_SEE'; - final public const SEE_DETAILS = 'CHILL_EVENT_SEE_DETAILS'; + final public const string SEE_DETAILS = 'CHILL_EVENT_SEE_DETAILS'; - final public const UPDATE = 'CHILL_EVENT_UPDATE'; + final public const string UPDATE = 'CHILL_EVENT_UPDATE'; - final public const STATS = 'CHILL_EVENT_STATS'; + final public const string STATS = 'CHILL_EVENT_STATS'; private readonly VoterHelperInterface $voterHelper; @@ -61,11 +61,13 @@ class EventVoter extends AbstractChillVoter implements ProvideRoleHierarchyInter ->build(); } + #[\Override] public function getRoles(): array { return [...self::ROLES, self::STATS]; } + #[\Override] public function getRolesWithHierarchy(): array { return [ @@ -73,16 +75,19 @@ class EventVoter extends AbstractChillVoter implements ProvideRoleHierarchyInter ]; } + #[\Override] public function getRolesWithoutScope(): array { return [self::ROLES, self::STATS]; } + #[\Override] public function supports($attribute, $subject) { return $this->voterHelper->supports($attribute, $subject); } + #[\Override] protected function voteOnAttribute($attribute, $subject, TokenInterface $token) { $this->logger->debug(sprintf('Voting from %s class', self::class)); diff --git a/src/Bundle/ChillEventBundle/Security/ParticipationVoter.php b/src/Bundle/ChillEventBundle/Security/ParticipationVoter.php index 368a47cab..3407874d0 100644 --- a/src/Bundle/ChillEventBundle/Security/ParticipationVoter.php +++ b/src/Bundle/ChillEventBundle/Security/ParticipationVoter.php @@ -25,22 +25,22 @@ use Symfony\Component\Security\Core\Authentication\Token\TokenInterface; class ParticipationVoter extends AbstractChillVoter implements ProvideRoleHierarchyInterface { - final public const CREATE = 'CHILL_EVENT_PARTICIPATION_CREATE'; + final public const string CREATE = 'CHILL_EVENT_PARTICIPATION_CREATE'; - final public const ROLES = [ + final public const array ROLES = [ self::SEE, self::SEE_DETAILS, self::CREATE, self::UPDATE, ]; - final public const SEE = 'CHILL_EVENT_PARTICIPATION_SEE'; + final public const string SEE = 'CHILL_EVENT_PARTICIPATION_SEE'; - final public const SEE_DETAILS = 'CHILL_EVENT_PARTICIPATION_SEE_DETAILS'; + final public const string SEE_DETAILS = 'CHILL_EVENT_PARTICIPATION_SEE_DETAILS'; - final public const UPDATE = 'CHILL_EVENT_PARTICIPATION_UPDATE'; + final public const string UPDATE = 'CHILL_EVENT_PARTICIPATION_UPDATE'; - final public const STATS = 'CHILL_EVENT_PARTICIPATION_STATS'; + final public const string STATS = 'CHILL_EVENT_PARTICIPATION_STATS'; private readonly VoterHelperInterface $voterHelper; @@ -58,11 +58,13 @@ class ParticipationVoter extends AbstractChillVoter implements ProvideRoleHierar ->build(); } + #[\Override] public function getRoles(): array { return [...self::ROLES, self::STATS]; } + #[\Override] public function getRolesWithHierarchy(): array { return [ @@ -70,11 +72,13 @@ class ParticipationVoter extends AbstractChillVoter implements ProvideRoleHierar ]; } + #[\Override] public function getRolesWithoutScope(): array { return [self::ROLES, self::STATS]; } + #[\Override] public function supports($attribute, $subject) { return $this->voterHelper->supports($attribute, $subject); @@ -85,6 +89,7 @@ class ParticipationVoter extends AbstractChillVoter implements ProvideRoleHierar * * @return bool */ + #[\Override] protected function voteOnAttribute($attribute, $subject, TokenInterface $token) { $this->logger->debug(sprintf('Voting from %s class', self::class)); diff --git a/src/Bundle/ChillEventBundle/Tests/Controller/EventListControllerTest.php b/src/Bundle/ChillEventBundle/Tests/Controller/EventListControllerTest.php index a7814dd84..447640fc8 100644 --- a/src/Bundle/ChillEventBundle/Tests/Controller/EventListControllerTest.php +++ b/src/Bundle/ChillEventBundle/Tests/Controller/EventListControllerTest.php @@ -30,6 +30,7 @@ class EventListControllerTest extends WebTestCase private readonly PaginatorFactory $paginatorFactory; private readonly Environment $environment; + #[\Override] protected function setUp(): void {} public function testList(): void diff --git a/src/Bundle/ChillEventBundle/Tests/Controller/ParticipationControllerTest.php b/src/Bundle/ChillEventBundle/Tests/Controller/ParticipationControllerTest.php index a4dd546d6..6d101c97a 100644 --- a/src/Bundle/ChillEventBundle/Tests/Controller/ParticipationControllerTest.php +++ b/src/Bundle/ChillEventBundle/Tests/Controller/ParticipationControllerTest.php @@ -54,6 +54,7 @@ final class ParticipationControllerTest extends WebTestCase $this->personsIdsCache = []; } + #[\Override] protected function tearDown(): void { parent::tearDown(); diff --git a/src/Bundle/ChillEventBundle/Tests/Export/CountEventParticipationsTest.php b/src/Bundle/ChillEventBundle/Tests/Export/CountEventParticipationsTest.php index 2c7886ed7..acf1cda2b 100644 --- a/src/Bundle/ChillEventBundle/Tests/Export/CountEventParticipationsTest.php +++ b/src/Bundle/ChillEventBundle/Tests/Export/CountEventParticipationsTest.php @@ -24,6 +24,7 @@ class CountEventParticipationsTest extends KernelTestCase { private CountEventParticipations $countEventParticipations; + #[\Override] protected function setUp(): void { parent::setUp(); diff --git a/src/Bundle/ChillEventBundle/Tests/Export/CountEventTest.php b/src/Bundle/ChillEventBundle/Tests/Export/CountEventTest.php index 15884edec..cf0046a86 100644 --- a/src/Bundle/ChillEventBundle/Tests/Export/CountEventTest.php +++ b/src/Bundle/ChillEventBundle/Tests/Export/CountEventTest.php @@ -24,6 +24,7 @@ class CountEventTest extends KernelTestCase { private CountEvents $countEvents; + #[\Override] protected function setUp(): void { parent::setUp(); diff --git a/src/Bundle/ChillEventBundle/Tests/Export/aggregators/EventDateAggregatorTest.php b/src/Bundle/ChillEventBundle/Tests/Export/aggregators/EventDateAggregatorTest.php index 4adf4fa2c..8aaa745fa 100644 --- a/src/Bundle/ChillEventBundle/Tests/Export/aggregators/EventDateAggregatorTest.php +++ b/src/Bundle/ChillEventBundle/Tests/Export/aggregators/EventDateAggregatorTest.php @@ -25,6 +25,7 @@ class EventDateAggregatorTest extends AbstractAggregatorTest { private $aggregator; + #[\Override] protected function setUp(): void { self::bootKernel(); @@ -32,11 +33,13 @@ class EventDateAggregatorTest extends AbstractAggregatorTest $this->aggregator = self::getContainer()->get(EventDateAggregator::class); } + #[\Override] public function getAggregator() { return $this->aggregator; } + #[\Override] public function getFormData(): array|\Generator { yield ['frequency' => 'YYYY']; @@ -44,6 +47,7 @@ class EventDateAggregatorTest extends AbstractAggregatorTest yield ['frequency' => 'YYYY-IV']; } + #[\Override] public function getQueryBuilders(): array { self::bootKernel(); diff --git a/src/Bundle/ChillEventBundle/Tests/Export/aggregators/EventTypeAggregatorTest.php b/src/Bundle/ChillEventBundle/Tests/Export/aggregators/EventTypeAggregatorTest.php index 33e3182c4..7f83662c9 100644 --- a/src/Bundle/ChillEventBundle/Tests/Export/aggregators/EventTypeAggregatorTest.php +++ b/src/Bundle/ChillEventBundle/Tests/Export/aggregators/EventTypeAggregatorTest.php @@ -25,6 +25,7 @@ class EventTypeAggregatorTest extends AbstractAggregatorTest { private $aggregator; + #[\Override] protected function setUp(): void { self::bootKernel(); @@ -32,11 +33,13 @@ class EventTypeAggregatorTest extends AbstractAggregatorTest $this->aggregator = self::getContainer()->get(EventTypeAggregator::class); } + #[\Override] public function getAggregator() { return $this->aggregator; } + #[\Override] public function getFormData(): array { return [ @@ -44,6 +47,7 @@ class EventTypeAggregatorTest extends AbstractAggregatorTest ]; } + #[\Override] public function getQueryBuilders(): array { self::bootKernel(); diff --git a/src/Bundle/ChillEventBundle/Tests/Export/aggregators/RoleAggregatorTest.php b/src/Bundle/ChillEventBundle/Tests/Export/aggregators/RoleAggregatorTest.php index c9cdb92be..1c48360ac 100644 --- a/src/Bundle/ChillEventBundle/Tests/Export/aggregators/RoleAggregatorTest.php +++ b/src/Bundle/ChillEventBundle/Tests/Export/aggregators/RoleAggregatorTest.php @@ -26,6 +26,7 @@ class RoleAggregatorTest extends AbstractAggregatorTest { private $aggregator; + #[\Override] protected function setUp(): void { self::bootKernel(); @@ -33,11 +34,13 @@ class RoleAggregatorTest extends AbstractAggregatorTest $this->aggregator = self::getContainer()->get(RoleAggregator::class); } + #[\Override] public function getAggregator() { return $this->aggregator; } + #[\Override] public function getFormData(): array { return [ @@ -45,6 +48,7 @@ class RoleAggregatorTest extends AbstractAggregatorTest ]; } + #[\Override] public function getQueryBuilders(): array { self::bootKernel(); diff --git a/src/Bundle/ChillEventBundle/Tests/Export/filters/EventDateFilterTest.php b/src/Bundle/ChillEventBundle/Tests/Export/filters/EventDateFilterTest.php index 369ceee59..f3dc64503 100644 --- a/src/Bundle/ChillEventBundle/Tests/Export/filters/EventDateFilterTest.php +++ b/src/Bundle/ChillEventBundle/Tests/Export/filters/EventDateFilterTest.php @@ -27,6 +27,7 @@ class EventDateFilterTest extends AbstractFilterTest { private RollingDateConverterInterface $rollingDateConverter; + #[\Override] protected function setUp(): void { parent::setUp(); @@ -35,11 +36,13 @@ class EventDateFilterTest extends AbstractFilterTest $this->rollingDateConverter = self::getContainer()->get(RollingDateConverterInterface::class); } + #[\Override] public function getFilter() { return new EventDateFilter($this->rollingDateConverter); } + #[\Override] public function getFormData() { return [ @@ -50,6 +53,7 @@ class EventDateFilterTest extends AbstractFilterTest ]; } + #[\Override] public function getQueryBuilders(): array { self::bootKernel(); diff --git a/src/Bundle/ChillEventBundle/Tests/Export/filters/EventTypeFilterTest.php b/src/Bundle/ChillEventBundle/Tests/Export/filters/EventTypeFilterTest.php index 4e41b624e..8b0de3fc7 100644 --- a/src/Bundle/ChillEventBundle/Tests/Export/filters/EventTypeFilterTest.php +++ b/src/Bundle/ChillEventBundle/Tests/Export/filters/EventTypeFilterTest.php @@ -27,17 +27,20 @@ class EventTypeFilterTest extends AbstractFilterTest { private EventTypeFilter $filter; + #[\Override] protected function setUp(): void { self::bootKernel(); $this->filter = self::getContainer()->get(EventTypeFilter::class); } + #[\Override] public function getFilter(): EventTypeFilter|\Chill\MainBundle\Export\FilterInterface { return $this->filter; } + #[\Override] public function getFormData() { self::bootKernel(); @@ -61,6 +64,7 @@ class EventTypeFilterTest extends AbstractFilterTest return $data; } + #[\Override] public function getQueryBuilders() { self::bootKernel(); diff --git a/src/Bundle/ChillEventBundle/Tests/Export/filters/RoleFilterTest.php b/src/Bundle/ChillEventBundle/Tests/Export/filters/RoleFilterTest.php index 714098956..a64fd74e2 100644 --- a/src/Bundle/ChillEventBundle/Tests/Export/filters/RoleFilterTest.php +++ b/src/Bundle/ChillEventBundle/Tests/Export/filters/RoleFilterTest.php @@ -28,6 +28,7 @@ class RoleFilterTest extends AbstractFilterTest { private RoleFilter $filter; + #[\Override] protected function setUp(): void { self::bootKernel(); @@ -35,11 +36,13 @@ class RoleFilterTest extends AbstractFilterTest $this->filter = self::getContainer()->get(RoleFilter::class); } + #[\Override] public function getFilter() { return $this->filter; } + #[\Override] public function getFormData(): array { self::bootKernel(); @@ -63,6 +66,7 @@ class RoleFilterTest extends AbstractFilterTest return $data; } + #[\Override] public function getQueryBuilders() { self::bootKernel(); diff --git a/src/Bundle/ChillEventBundle/Tests/Repository/EventACLAwareRepositoryTest.php b/src/Bundle/ChillEventBundle/Tests/Repository/EventACLAwareRepositoryTest.php index 758e50d56..fdbe424cc 100644 --- a/src/Bundle/ChillEventBundle/Tests/Repository/EventACLAwareRepositoryTest.php +++ b/src/Bundle/ChillEventBundle/Tests/Repository/EventACLAwareRepositoryTest.php @@ -32,6 +32,7 @@ class EventACLAwareRepositoryTest extends KernelTestCase { use ProphecyTrait; + #[\Override] protected function setUp(): void { self::bootKernel(); diff --git a/src/Bundle/ChillEventBundle/Tests/Search/EventSearchTest.php b/src/Bundle/ChillEventBundle/Tests/Search/EventSearchTest.php index 90c38743b..30b2a531b 100644 --- a/src/Bundle/ChillEventBundle/Tests/Search/EventSearchTest.php +++ b/src/Bundle/ChillEventBundle/Tests/Search/EventSearchTest.php @@ -68,6 +68,7 @@ final class EventSearchTest extends WebTestCase */ protected $prophet; + #[\Override] protected function setUp(): void { self::bootKernel(); @@ -96,6 +97,7 @@ final class EventSearchTest extends WebTestCase $this->createEvents(); } + #[\Override] protected function tearDown(): void { foreach ($this->events as $event) { diff --git a/src/Bundle/ChillEventBundle/Timeline/TimelineEventProvider.php b/src/Bundle/ChillEventBundle/Timeline/TimelineEventProvider.php index 9e35a6757..5416cdd8c 100644 --- a/src/Bundle/ChillEventBundle/Timeline/TimelineEventProvider.php +++ b/src/Bundle/ChillEventBundle/Timeline/TimelineEventProvider.php @@ -66,6 +66,7 @@ class TimelineEventProvider implements TimelineProviderInterface * * @throws \Doctrine\ORM\Mapping\MappingException */ + #[\Override] public function fetchQuery($context, array $args) { $this->checkContext($context); @@ -87,6 +88,7 @@ class TimelineEventProvider implements TimelineProviderInterface /** * @return array|mixed[] */ + #[\Override] public function getEntities(array $ids) { $events = $this->em->getRepository(Event::class) @@ -107,6 +109,7 @@ class TimelineEventProvider implements TimelineProviderInterface * * @return array|mixed[] */ + #[\Override] public function getEntityTemplate($entity, $context, array $args) { $this->checkContext($context); @@ -126,6 +129,7 @@ class TimelineEventProvider implements TimelineProviderInterface * * @return bool */ + #[\Override] public function supportsType($type) { return 'event' === $type; diff --git a/src/Bundle/ChillEventBundle/migrations/Version20160318111334.php b/src/Bundle/ChillEventBundle/migrations/Version20160318111334.php index e5725df24..8e67e077c 100644 --- a/src/Bundle/ChillEventBundle/migrations/Version20160318111334.php +++ b/src/Bundle/ChillEventBundle/migrations/Version20160318111334.php @@ -19,11 +19,13 @@ use Doctrine\Migrations\AbstractMigration; */ class Version20160318111334 extends AbstractMigration { + #[\Override] public function getDescription(): string { return 'initialize the bundle chill event'; } + #[\Override] public function down(Schema $schema): void { $this->addSql('ALTER TABLE chill_event_role DROP CONSTRAINT FK_AA714E54C54C8C93'); @@ -50,6 +52,7 @@ class Version20160318111334 extends AbstractMigration $this->addSql('DROP TABLE chill_event_participation'); } + #[\Override] public function up(Schema $schema): void { $this->addSql('CREATE SEQUENCE chill_event_event_type_id_seq INCREMENT BY 1 MINVALUE 1 START 1'); diff --git a/src/Bundle/ChillEventBundle/migrations/Version20190110140538.php b/src/Bundle/ChillEventBundle/migrations/Version20190110140538.php index 28780d4a9..d454278c7 100644 --- a/src/Bundle/ChillEventBundle/migrations/Version20190110140538.php +++ b/src/Bundle/ChillEventBundle/migrations/Version20190110140538.php @@ -19,17 +19,20 @@ use Doctrine\Migrations\AbstractMigration; */ final class Version20190110140538 extends AbstractMigration { + #[\Override] public function getDescription(): string { return 'switch event date to datetime'; } + #[\Override] public function down(Schema $schema): void { $this->addSql('ALTER TABLE chill_event_event ALTER date TYPE DATE'); $this->addSql('ALTER TABLE chill_event_event ALTER date DROP DEFAULT'); } + #[\Override] public function up(Schema $schema): void { $this->addSql('ALTER TABLE chill_event_event ALTER date TYPE TIMESTAMP(0) WITHOUT TIME ZONE'); diff --git a/src/Bundle/ChillEventBundle/migrations/Version20190115140042.php b/src/Bundle/ChillEventBundle/migrations/Version20190115140042.php index b853a797f..4d6eb7b13 100644 --- a/src/Bundle/ChillEventBundle/migrations/Version20190115140042.php +++ b/src/Bundle/ChillEventBundle/migrations/Version20190115140042.php @@ -19,11 +19,13 @@ use Doctrine\Migrations\AbstractMigration; */ final class Version20190115140042 extends AbstractMigration { + #[\Override] public function getDescription(): string { return 'add a moderator field to events'; } + #[\Override] public function down(Schema $schema): void { $this->addSql('ALTER TABLE chill_event_event DROP CONSTRAINT FK_FA320FC8D0AFA354'); @@ -31,6 +33,7 @@ final class Version20190115140042 extends AbstractMigration $this->addSql('ALTER TABLE chill_event_event DROP moderator_id'); } + #[\Override] public function up(Schema $schema): void { $this->addSql('ALTER TABLE chill_event_event ADD moderator_id INT DEFAULT NULL'); diff --git a/src/Bundle/ChillEventBundle/migrations/Version20190201143121.php b/src/Bundle/ChillEventBundle/migrations/Version20190201143121.php index 50fb2435b..3af4780cd 100644 --- a/src/Bundle/ChillEventBundle/migrations/Version20190201143121.php +++ b/src/Bundle/ChillEventBundle/migrations/Version20190201143121.php @@ -19,17 +19,20 @@ use Doctrine\Migrations\AbstractMigration; */ final class Version20190201143121 extends AbstractMigration { + #[\Override] public function getDescription(): string { return 'fix moderator: relation with user (not person)'; } + #[\Override] public function down(Schema $schema): void { $this->addSql('ALTER TABLE chill_event_event DROP CONSTRAINT fk_fa320fc8d0afa354'); $this->addSql('ALTER TABLE chill_event_event ADD CONSTRAINT fk_fa320fc8d0afa354 FOREIGN KEY (moderator_id) REFERENCES chill_person_person (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); } + #[\Override] public function up(Schema $schema): void { $this->addSql('ALTER TABLE chill_event_event DROP CONSTRAINT FK_FA320FC8D0AFA354'); diff --git a/src/Bundle/ChillEventBundle/migrations/Version20231127134244.php b/src/Bundle/ChillEventBundle/migrations/Version20231127134244.php index 8a5fa592a..6d9e94ce9 100644 --- a/src/Bundle/ChillEventBundle/migrations/Version20231127134244.php +++ b/src/Bundle/ChillEventBundle/migrations/Version20231127134244.php @@ -16,11 +16,13 @@ use Doctrine\Migrations\AbstractMigration; final class Version20231127134244 extends AbstractMigration { + #[\Override] public function getDescription(): string { return 'add creation - update information on event and event participation'; } + #[\Override] public function up(Schema $schema): void { $this->addSql('ALTER TABLE chill_event_event ADD createdAt TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL'); @@ -45,6 +47,7 @@ final class Version20231127134244 extends AbstractMigration $this->addSql('CREATE INDEX IDX_4E7768AC65FF1AEC ON chill_event_participation (updatedBy_id)'); } + #[\Override] public function down(Schema $schema): void { $this->addSql('ALTER TABLE chill_event_event DROP createdAt'); diff --git a/src/Bundle/ChillEventBundle/migrations/Version20231128114959.php b/src/Bundle/ChillEventBundle/migrations/Version20231128114959.php index b5ca41390..c55d6ea06 100644 --- a/src/Bundle/ChillEventBundle/migrations/Version20231128114959.php +++ b/src/Bundle/ChillEventBundle/migrations/Version20231128114959.php @@ -16,11 +16,13 @@ use Doctrine\Migrations\AbstractMigration; final class Version20231128114959 extends AbstractMigration { + #[\Override] public function getDescription(): string { return 'Add unique index on participation and drop column participation::lastUpdate'; } + #[\Override] public function up(Schema $schema): void { $this->addSql('UPDATE chill_event_participation SET updatedAt=lastupdate WHERE updatedat IS NULL'); @@ -31,6 +33,7 @@ final class Version20231128114959 extends AbstractMigration $this->addSql('CREATE UNIQUE INDEX chill_event_participation_event_person_unique_idx ON chill_event_participation (event_id, person_id)'); } + #[\Override] public function down(Schema $schema): void { $this->addSql('DROP INDEX chill_event_participation_event_person_unique_idx'); diff --git a/src/Bundle/ChillEventBundle/migrations/Version20231128122635.php b/src/Bundle/ChillEventBundle/migrations/Version20231128122635.php index 4191f7678..8fd347d76 100644 --- a/src/Bundle/ChillEventBundle/migrations/Version20231128122635.php +++ b/src/Bundle/ChillEventBundle/migrations/Version20231128122635.php @@ -16,11 +16,13 @@ use Doctrine\Migrations\AbstractMigration; final class Version20231128122635 extends AbstractMigration { + #[\Override] public function getDescription(): string { return 'Append more fields on event: location, documents, and comment'; } + #[\Override] public function up(Schema $schema): void { $this->addSql('CREATE TABLE chill_event_event_documents (event_id INT NOT NULL, storedobject_id INT NOT NULL, PRIMARY KEY(event_id, storedobject_id))'); @@ -37,6 +39,7 @@ final class Version20231128122635 extends AbstractMigration $this->addSql('CREATE INDEX IDX_FA320FC864D218E ON chill_event_event (location_id)'); } + #[\Override] public function down(Schema $schema): void { $this->addSql('ALTER TABLE chill_event_event_documents DROP CONSTRAINT FK_5C1B638671F7E88B'); diff --git a/src/Bundle/ChillFranceTravailApiBundle/src/ApiHelper/PartenaireRomeAppellation.php b/src/Bundle/ChillFranceTravailApiBundle/src/ApiHelper/PartenaireRomeAppellation.php index 66a8ee05b..fb0355f07 100644 --- a/src/Bundle/ChillFranceTravailApiBundle/src/ApiHelper/PartenaireRomeAppellation.php +++ b/src/Bundle/ChillFranceTravailApiBundle/src/ApiHelper/PartenaireRomeAppellation.php @@ -36,7 +36,7 @@ class PartenaireRomeAppellation */ protected $logger; - private const BASE = 'https://api.pole-emploi.io/partenaire/rome-metiers/v1/metiers/'; + private const string BASE = 'https://api.pole-emploi.io/partenaire/rome-metiers/v1/metiers/'; public function __construct( ApiWrapper $wrapper, diff --git a/src/Bundle/ChillFranceTravailApiBundle/src/DependencyInjection/ChillFranceTravailApiExtension.php b/src/Bundle/ChillFranceTravailApiBundle/src/DependencyInjection/ChillFranceTravailApiExtension.php index 1f69b80c2..a1797a322 100644 --- a/src/Bundle/ChillFranceTravailApiBundle/src/DependencyInjection/ChillFranceTravailApiExtension.php +++ b/src/Bundle/ChillFranceTravailApiBundle/src/DependencyInjection/ChillFranceTravailApiExtension.php @@ -24,6 +24,7 @@ use Symfony\Component\DependencyInjection\Loader; */ class ChillFranceTravailApiExtension extends Extension implements PrependExtensionInterface { + #[\Override] public function load(array $configs, ContainerBuilder $container) { $configuration = new Configuration(); @@ -33,6 +34,7 @@ class ChillFranceTravailApiExtension extends Extension implements PrependExtensi $loader->load('services.yml'); } + #[\Override] public function prepend(ContainerBuilder $container): void { $this->prependRoute($container); diff --git a/src/Bundle/ChillFranceTravailApiBundle/src/DependencyInjection/Configuration.php b/src/Bundle/ChillFranceTravailApiBundle/src/DependencyInjection/Configuration.php index 2d94678d4..2159ae1f4 100644 --- a/src/Bundle/ChillFranceTravailApiBundle/src/DependencyInjection/Configuration.php +++ b/src/Bundle/ChillFranceTravailApiBundle/src/DependencyInjection/Configuration.php @@ -21,6 +21,7 @@ use Symfony\Component\Config\Definition\ConfigurationInterface; */ class Configuration implements ConfigurationInterface { + #[\Override] public function getConfigTreeBuilder() { $treeBuilder = new TreeBuilder('chill_france_travail_api'); diff --git a/src/Bundle/ChillFranceTravailApiBundle/src/Tests/ApiHelper/PartenaireRomeAppellationTest.php b/src/Bundle/ChillFranceTravailApiBundle/src/Tests/ApiHelper/PartenaireRomeAppellationTest.php index 4096d5e94..f88278865 100644 --- a/src/Bundle/ChillFranceTravailApiBundle/src/Tests/ApiHelper/PartenaireRomeAppellationTest.php +++ b/src/Bundle/ChillFranceTravailApiBundle/src/Tests/ApiHelper/PartenaireRomeAppellationTest.php @@ -23,6 +23,7 @@ use Chill\FranceTravailApiBundle\ApiHelper\PartenaireRomeAppellation; */ class PartenaireRomeAppellationTest extends KernelTestCase { + #[\Override] protected function setUp(): void { parent::setUp(); diff --git a/src/Bundle/ChillJobBundle/src/Controller/CSCrudReportController.php b/src/Bundle/ChillJobBundle/src/Controller/CSCrudReportController.php index 6f0cc742c..b9e70c252 100644 --- a/src/Bundle/ChillJobBundle/src/Controller/CSCrudReportController.php +++ b/src/Bundle/ChillJobBundle/src/Controller/CSCrudReportController.php @@ -22,6 +22,7 @@ use Symfony\Component\HttpFoundation\Response; */ class CSCrudReportController extends EntityPersonCRUDController { + #[\Override] protected function onBeforeRedirectAfterSubmission(string $action, $entity, FormInterface $form, Request $request): ?Response { $next = $request->request->get('submit', 'save-and-close'); @@ -34,6 +35,7 @@ class CSCrudReportController extends EntityPersonCRUDController }; } + #[\Override] protected function duplicateEntity(string $action, Request $request) { if ('cscv' === $this->getCrudName()) { @@ -77,6 +79,7 @@ class CSCrudReportController extends EntityPersonCRUDController return parent::duplicateEntity($action, $request); } + #[\Override] protected function createFormFor(string $action, $entity, ?string $formClass = null, array $formOptions = []): FormInterface { if ($entity instanceof Immersion) { @@ -100,6 +103,7 @@ class CSCrudReportController extends EntityPersonCRUDController return parent::createFormFor($action, $entity, $formClass, $formOptions); } + #[\Override] protected function onPreFlush(string $action, $entity, FormInterface $form, Request $request) { // for immersion / edit-bilan action diff --git a/src/Bundle/ChillJobBundle/src/Controller/CSPersonController.php b/src/Bundle/ChillJobBundle/src/Controller/CSPersonController.php index d5ddf329d..a272cc4e3 100644 --- a/src/Bundle/ChillJobBundle/src/Controller/CSPersonController.php +++ b/src/Bundle/ChillJobBundle/src/Controller/CSPersonController.php @@ -56,6 +56,7 @@ class CSPersonController extends OneToOneEntityPersonCRUDController return $this->viewAction('dispositifs_view', $request, $person); } + #[\Override] protected function generateRedirectOnCreateRoute($action, Request $request, $entity): string { $route = ''; @@ -74,6 +75,7 @@ class CSPersonController extends OneToOneEntityPersonCRUDController return $this->generateUrl($route, ['id' => $entity->getPerson()->getId()]); } + #[\Override] protected function checkACL($action, $entity): void { match ($action) { @@ -89,6 +91,7 @@ class CSPersonController extends OneToOneEntityPersonCRUDController }; } + #[\Override] protected function onBeforeRedirectAfterSubmission(string $action, $entity, FormInterface $form, Request $request): ?Response { return match ($action) { @@ -104,6 +107,7 @@ class CSPersonController extends OneToOneEntityPersonCRUDController }; } + #[\Override] protected function getTemplateFor($action, $entity, Request $request): string { return match ($action) { @@ -115,6 +119,7 @@ class CSPersonController extends OneToOneEntityPersonCRUDController }; } + #[\Override] protected function createFormFor(string $action, $entity, ?string $formClass = null, array $formOptions = []): FormInterface { switch ($action) { diff --git a/src/Bundle/ChillJobBundle/src/Controller/CVCrudController.php b/src/Bundle/ChillJobBundle/src/Controller/CVCrudController.php index bd78498cb..cb8478a2c 100644 --- a/src/Bundle/ChillJobBundle/src/Controller/CVCrudController.php +++ b/src/Bundle/ChillJobBundle/src/Controller/CVCrudController.php @@ -21,6 +21,7 @@ use Symfony\Component\HttpFoundation\Response; */ class CVCrudController extends EntityPersonCRUDController { + #[\Override] protected function onBeforeRedirectAfterSubmission(string $action, $entity, FormInterface $form, Request $request): ?Response { $next = $request->request->get('submit', 'save-and-close'); @@ -33,6 +34,7 @@ class CVCrudController extends EntityPersonCRUDController }; } + #[\Override] protected function duplicateEntity(string $action, Request $request) { if ('cv' === $this->getCrudName()) { diff --git a/src/Bundle/ChillJobBundle/src/Controller/FreinCrudController.php b/src/Bundle/ChillJobBundle/src/Controller/FreinCrudController.php index d3b8ee6ef..1b052b769 100644 --- a/src/Bundle/ChillJobBundle/src/Controller/FreinCrudController.php +++ b/src/Bundle/ChillJobBundle/src/Controller/FreinCrudController.php @@ -21,6 +21,7 @@ use Symfony\Component\HttpFoundation\Response; */ class FreinCrudController extends EntityPersonCRUDController { + #[\Override] protected function onBeforeRedirectAfterSubmission(string $action, $entity, FormInterface $form, Request $request): ?Response { $next = $request->request->get('submit', 'save-and-close'); diff --git a/src/Bundle/ChillJobBundle/src/Controller/ImmersionCrudController.php b/src/Bundle/ChillJobBundle/src/Controller/ImmersionCrudController.php index c4880c3f3..56a66f706 100644 --- a/src/Bundle/ChillJobBundle/src/Controller/ImmersionCrudController.php +++ b/src/Bundle/ChillJobBundle/src/Controller/ImmersionCrudController.php @@ -22,6 +22,7 @@ use Symfony\Component\HttpFoundation\Response; */ class ImmersionCrudController extends EntityPersonCRUDController { + #[\Override] protected function onBeforeRedirectAfterSubmission(string $action, $entity, FormInterface $form, Request $request): ?Response { $next = $request->request->get('submit', 'save-and-close'); @@ -34,6 +35,7 @@ class ImmersionCrudController extends EntityPersonCRUDController }; } + #[\Override] protected function createFormFor(string $action, $entity, ?string $formClass = null, array $formOptions = []): FormInterface { if ($entity instanceof Immersion) { @@ -57,6 +59,7 @@ class ImmersionCrudController extends EntityPersonCRUDController return parent::createFormFor($action, $entity, $formClass, $formOptions); } + #[\Override] protected function onPreFlush(string $action, $entity, FormInterface $form, Request $request) { // for immersion / edit-bilan action diff --git a/src/Bundle/ChillJobBundle/src/Controller/ProjetProfessionnelCrudController.php b/src/Bundle/ChillJobBundle/src/Controller/ProjetProfessionnelCrudController.php index 80c953699..219053b6f 100644 --- a/src/Bundle/ChillJobBundle/src/Controller/ProjetProfessionnelCrudController.php +++ b/src/Bundle/ChillJobBundle/src/Controller/ProjetProfessionnelCrudController.php @@ -21,6 +21,7 @@ use Symfony\Component\HttpFoundation\Response; */ class ProjetProfessionnelCrudController extends EntityPersonCRUDController { + #[\Override] protected function onBeforeRedirectAfterSubmission(string $action, $entity, FormInterface $form, Request $request): ?Response { $next = $request->request->get('submit', 'save-and-close'); @@ -33,6 +34,7 @@ class ProjetProfessionnelCrudController extends EntityPersonCRUDController }; } + #[\Override] protected function duplicateEntity(string $action, Request $request) { if ('projet_prof' === $this->getCrudName()) { diff --git a/src/Bundle/ChillJobBundle/src/DependencyInjection/ChillJobExtension.php b/src/Bundle/ChillJobBundle/src/DependencyInjection/ChillJobExtension.php index 110e5d8df..87d53368e 100644 --- a/src/Bundle/ChillJobBundle/src/DependencyInjection/ChillJobExtension.php +++ b/src/Bundle/ChillJobBundle/src/DependencyInjection/ChillJobExtension.php @@ -38,6 +38,7 @@ use Symfony\Component\DependencyInjection\Loader; */ class ChillJobExtension extends Extension implements PrependExtensionInterface { + #[\Override] public function load(array $configs, ContainerBuilder $container): void { $configuration = new Configuration(); @@ -53,6 +54,7 @@ class ChillJobExtension extends Extension implements PrependExtensionInterface $loader->load('services/security.yml'); } + #[\Override] public function prepend(ContainerBuilder $container): void { $this->prependRoute($container); diff --git a/src/Bundle/ChillJobBundle/src/DependencyInjection/Configuration.php b/src/Bundle/ChillJobBundle/src/DependencyInjection/Configuration.php index f4140defa..696221a5a 100644 --- a/src/Bundle/ChillJobBundle/src/DependencyInjection/Configuration.php +++ b/src/Bundle/ChillJobBundle/src/DependencyInjection/Configuration.php @@ -21,6 +21,7 @@ use Symfony\Component\Config\Definition\ConfigurationInterface; */ class Configuration implements ConfigurationInterface { + #[\Override] public function getConfigTreeBuilder() { $treeBuilder = new TreeBuilder('chill_job'); diff --git a/src/Bundle/ChillJobBundle/src/Entity/CV.php b/src/Bundle/ChillJobBundle/src/Entity/CV.php index 257e4a0d0..089e76d49 100644 --- a/src/Bundle/ChillJobBundle/src/Entity/CV.php +++ b/src/Bundle/ChillJobBundle/src/Entity/CV.php @@ -295,6 +295,7 @@ class CV implements \Stringable return $this; } + #[\Override] public function __toString(): string { return 'CV de '.$this->getPerson().' daté du '. diff --git a/src/Bundle/ChillJobBundle/src/Entity/Frein.php b/src/Bundle/ChillJobBundle/src/Entity/Frein.php index b60a342fd..be7acf220 100644 --- a/src/Bundle/ChillJobBundle/src/Entity/Frein.php +++ b/src/Bundle/ChillJobBundle/src/Entity/Frein.php @@ -152,11 +152,13 @@ class Frein implements HasPerson, \Stringable return $this->notesEmploi; } + #[\Override] public function getPerson(): ?Person { return $this->person; } + #[\Override] public function setPerson(?Person $person = null): HasPerson { $this->person = $person; @@ -184,6 +186,7 @@ class Frein implements HasPerson, \Stringable } } + #[\Override] public function __toString(): string { return 'Rapport "frein" de '.$this->getPerson().' daté du '. diff --git a/src/Bundle/ChillJobBundle/src/Entity/Immersion.php b/src/Bundle/ChillJobBundle/src/Entity/Immersion.php index 5ae19a365..0bc18a426 100644 --- a/src/Bundle/ChillJobBundle/src/Entity/Immersion.php +++ b/src/Bundle/ChillJobBundle/src/Entity/Immersion.php @@ -1076,6 +1076,7 @@ class Immersion implements \Stringable return $this; } + #[\Override] public function __toString(): string { return 'Rapport "immersion" de '.$this->getPerson(); diff --git a/src/Bundle/ChillJobBundle/src/Entity/ProjetProfessionnel.php b/src/Bundle/ChillJobBundle/src/Entity/ProjetProfessionnel.php index 58a1fca41..52fedf74d 100644 --- a/src/Bundle/ChillJobBundle/src/Entity/ProjetProfessionnel.php +++ b/src/Bundle/ChillJobBundle/src/Entity/ProjetProfessionnel.php @@ -399,6 +399,7 @@ class ProjetProfessionnel implements \Stringable return $this; } + #[\Override] public function __toString(): string { return 'Rapport "projet professionnel" de '.$this->getPerson().' daté du '. diff --git a/src/Bundle/ChillJobBundle/src/Entity/Rome/Appellation.php b/src/Bundle/ChillJobBundle/src/Entity/Rome/Appellation.php index 1d2c3b026..026f8ccd4 100644 --- a/src/Bundle/ChillJobBundle/src/Entity/Rome/Appellation.php +++ b/src/Bundle/ChillJobBundle/src/Entity/Rome/Appellation.php @@ -100,6 +100,7 @@ class Appellation implements \Stringable return $this; } + #[\Override] public function __toString(): string { return (string) $this->libelle; diff --git a/src/Bundle/ChillJobBundle/src/Export/AddCSPersonToPersonListHelper.php b/src/Bundle/ChillJobBundle/src/Export/AddCSPersonToPersonListHelper.php index 0c27bdb32..7f0d6e106 100644 --- a/src/Bundle/ChillJobBundle/src/Export/AddCSPersonToPersonListHelper.php +++ b/src/Bundle/ChillJobBundle/src/Export/AddCSPersonToPersonListHelper.php @@ -26,7 +26,7 @@ class AddCSPersonToPersonListHelper implements CustomizeListPersonHelperInterfac { public function __construct(private readonly TranslatorInterface $translator) {} - private const CSPERSON_FIELDS = [ + private const array CSPERSON_FIELDS = [ 'dateFinDernierEmploi', /* 'prescripteur__name', 'prescripteur__email', @@ -46,6 +46,7 @@ class AddCSPersonToPersonListHelper implements CustomizeListPersonHelperInterfac 'situationProfessionnelle', ]; + #[\Override] public function alterKeys(array $existing): array { $ressources = array_map(static fn ($key) => 'ressources__'.$key, CSPerson::RESSOURCES); @@ -65,6 +66,7 @@ class AddCSPersonToPersonListHelper implements CustomizeListPersonHelperInterfac ]; } + #[\Override] public function alterSelect(QueryBuilder $qb, \DateTimeImmutable $computedDate): void { $qb @@ -111,6 +113,7 @@ class AddCSPersonToPersonListHelper implements CustomizeListPersonHelperInterfac } } + #[\Override] public function getLabels(string $key, array $values, array $data): ?callable { if (str_contains($key, '__')) { diff --git a/src/Bundle/ChillJobBundle/src/Export/ListCV.php b/src/Bundle/ChillJobBundle/src/Export/ListCV.php index 896c7db01..87330d1a4 100644 --- a/src/Bundle/ChillJobBundle/src/Export/ListCV.php +++ b/src/Bundle/ChillJobBundle/src/Export/ListCV.php @@ -71,6 +71,7 @@ class ListCV implements ListInterface, ExportElementValidatedInterface * * @param mixed $data the data, as returned by the user */ + #[\Override] public function validateForm($data, ExecutionContextInterface $context) {} /** @@ -78,6 +79,7 @@ class ListCV implements ListInterface, ExportElementValidatedInterface * * @return string */ + #[\Override] public function getTitle() { return 'Liste des CVs par personne'; @@ -86,6 +88,7 @@ class ListCV implements ListInterface, ExportElementValidatedInterface /** * Add a form to collect data from the user. */ + #[\Override] public function buildForm(FormBuilderInterface $builder) { $builder @@ -140,6 +143,7 @@ class ListCV implements ListInterface, ExportElementValidatedInterface * * @return string */ + #[\Override] public function getType() { return Person::class; @@ -151,6 +155,7 @@ class ListCV implements ListInterface, ExportElementValidatedInterface * * @return string */ + #[\Override] public function getDescription() { return 'Crée une liste des CVs en fonction de différents paramètres.'; @@ -171,6 +176,7 @@ class ListCV implements ListInterface, ExportElementValidatedInterface * * @return QueryBuilder|\Doctrine\ORM\NativeQuery the query to execute */ + #[\Override] public function initiateQuery(array $requiredModifiers, array $acl, array $data = []) { return $this->entityManager->createQueryBuilder() @@ -184,6 +190,7 @@ class ListCV implements ListInterface, ExportElementValidatedInterface * * @return string[] */ + #[\Override] public function supportsModifiers() { return ['cv', 'person']; @@ -192,6 +199,7 @@ class ListCV implements ListInterface, ExportElementValidatedInterface /** * Return the required Role to execute the Export. */ + #[\Override] public function requiredRole(): string { return ExportsJobVoter::EXPORT; @@ -202,6 +210,7 @@ class ListCV implements ListInterface, ExportElementValidatedInterface * * @return string[] */ + #[\Override] public function getAllowedFormattersTypes() { return [FormatterInterface::TYPE_LIST]; @@ -218,6 +227,7 @@ class ListCV implements ListInterface, ExportElementValidatedInterface * * @return array */ + #[\Override] public function getQueryKeys($data) { return array_keys($data['fields']); @@ -239,6 +249,7 @@ class ListCV implements ListInterface, ExportElementValidatedInterface * @param QueryBuilder|\Doctrine\ORM\NativeQuery $qb * @param mixed[] $data the data from the export's form (added by self::buildForm) */ + #[\Override] public function getResult($qb, $data) { $qb->select('person.id'); @@ -312,6 +323,7 @@ class ListCV implements ListInterface, ExportElementValidatedInterface * @param mixed[] $values The values from the result. if there are duplicates, those might be given twice. Example: array('FR', 'BE', 'CZ', 'FR', 'BE', 'FR') * @param mixed $data The data from the export's form (as defined in `buildForm` */ + #[\Override] public function getLabels($key, array $values, $data) { return match ($key) { @@ -388,6 +400,7 @@ ORDER BY cv.reportdate DESC SQL; + #[\Override] public function getFormDefaultData(): array { return []; diff --git a/src/Bundle/ChillJobBundle/src/Export/ListFrein.php b/src/Bundle/ChillJobBundle/src/Export/ListFrein.php index 8e3a64294..e68173323 100644 --- a/src/Bundle/ChillJobBundle/src/Export/ListFrein.php +++ b/src/Bundle/ChillJobBundle/src/Export/ListFrein.php @@ -84,6 +84,7 @@ class ListFrein implements ListInterface, ExportElementValidatedInterface * * @param mixed $data the data, as returned by the user */ + #[\Override] public function validateForm($data, ExecutionContextInterface $context) {} /** @@ -91,6 +92,7 @@ class ListFrein implements ListInterface, ExportElementValidatedInterface * * @return string */ + #[\Override] public function getTitle() { return 'Liste des freins identifiés par personne'; @@ -99,6 +101,7 @@ class ListFrein implements ListInterface, ExportElementValidatedInterface /** * Add a form to collect data from the user. */ + #[\Override] public function buildForm(FormBuilderInterface $builder) { $builder @@ -153,6 +156,7 @@ class ListFrein implements ListInterface, ExportElementValidatedInterface * * @return string */ + #[\Override] public function getType() { return Person::class; @@ -164,6 +168,7 @@ class ListFrein implements ListInterface, ExportElementValidatedInterface * * @return string */ + #[\Override] public function getDescription() { return 'Crée une liste des personnes et de leurs freins identifiés en fonction de différents paramètres.'; @@ -184,6 +189,7 @@ class ListFrein implements ListInterface, ExportElementValidatedInterface * * @return QueryBuilder|\Doctrine\ORM\NativeQuery the query to execute */ + #[\Override] public function initiateQuery(array $requiredModifiers, array $acl, array $data = []) { return $this->entityManager->createQueryBuilder() @@ -197,6 +203,7 @@ class ListFrein implements ListInterface, ExportElementValidatedInterface * * @return string[] */ + #[\Override] public function supportsModifiers() { return ['frein', 'person']; @@ -205,6 +212,7 @@ class ListFrein implements ListInterface, ExportElementValidatedInterface /** * Return the required Role to execute the Export. */ + #[\Override] public function requiredRole(): string { return ExportsJobVoter::EXPORT; @@ -215,6 +223,7 @@ class ListFrein implements ListInterface, ExportElementValidatedInterface * * @return string[] */ + #[\Override] public function getAllowedFormattersTypes() { return [FormatterInterface::TYPE_LIST]; @@ -241,6 +250,7 @@ class ListFrein implements ListInterface, ExportElementValidatedInterface * * @return array */ + #[\Override] public function getQueryKeys($data) { $freins = self::FREINS; @@ -332,6 +342,7 @@ class ListFrein implements ListInterface, ExportElementValidatedInterface * @param QueryBuilder|\Doctrine\ORM\NativeQuery $qb * @param mixed[] $data the data from the export's form (added by self::buildForm) */ + #[\Override] public function getResult($qb, $data) { $qb->select('person.id'); @@ -407,6 +418,7 @@ class ListFrein implements ListInterface, ExportElementValidatedInterface * @param mixed[] $values The values from the result. if there are duplicates, those might be given twice. Example: array('FR', 'BE', 'CZ', 'FR', 'BE', 'FR') * @param mixed $data The data from the export's form (as defined in `buildForm` */ + #[\Override] public function getLabels($key, array $values, $data) { return match ($key) { @@ -490,6 +502,7 @@ ORDER BY fr.reportdate DESC SQL; + #[\Override] public function getFormDefaultData(): array { return []; diff --git a/src/Bundle/ChillJobBundle/src/Export/ListProjetProfessionnel.php b/src/Bundle/ChillJobBundle/src/Export/ListProjetProfessionnel.php index 0a1eeb753..90cc2aa1d 100644 --- a/src/Bundle/ChillJobBundle/src/Export/ListProjetProfessionnel.php +++ b/src/Bundle/ChillJobBundle/src/Export/ListProjetProfessionnel.php @@ -89,6 +89,7 @@ class ListProjetProfessionnel implements ListInterface, ExportElementValidatedIn * * @param mixed $data the data, as returned by the user */ + #[\Override] public function validateForm($data, ExecutionContextInterface $context) {} /** @@ -96,6 +97,7 @@ class ListProjetProfessionnel implements ListInterface, ExportElementValidatedIn * * @return string */ + #[\Override] public function getTitle() { return 'Liste des projets professionnels par personne'; @@ -104,6 +106,7 @@ class ListProjetProfessionnel implements ListInterface, ExportElementValidatedIn /** * Add a form to collect data from the user. */ + #[\Override] public function buildForm(FormBuilderInterface $builder) { $builder @@ -159,6 +162,7 @@ class ListProjetProfessionnel implements ListInterface, ExportElementValidatedIn * * @return string */ + #[\Override] public function getType() { return Person::class; @@ -170,6 +174,7 @@ class ListProjetProfessionnel implements ListInterface, ExportElementValidatedIn * * @return string */ + #[\Override] public function getDescription() { return 'Crée une liste des personnes et de leur projet professionnel en fonction de différents paramètres.'; @@ -190,6 +195,7 @@ class ListProjetProfessionnel implements ListInterface, ExportElementValidatedIn * * @return QueryBuilder|\Doctrine\ORM\NativeQuery the query to execute */ + #[\Override] public function initiateQuery(array $requiredModifiers, array $acl, array $data = []) { return $this->entityManager->createQueryBuilder() @@ -203,6 +209,7 @@ class ListProjetProfessionnel implements ListInterface, ExportElementValidatedIn * * @return string[] */ + #[\Override] public function supportsModifiers() { return ['projetprofessionnel', 'person']; @@ -211,6 +218,7 @@ class ListProjetProfessionnel implements ListInterface, ExportElementValidatedIn /** * Return the required Role to execute the Export. */ + #[\Override] public function requiredRole(): string { return ExportsJobVoter::EXPORT; @@ -221,6 +229,7 @@ class ListProjetProfessionnel implements ListInterface, ExportElementValidatedIn * * @return string[] */ + #[\Override] public function getAllowedFormattersTypes() { return [FormatterInterface::TYPE_LIST]; @@ -247,6 +256,7 @@ class ListProjetProfessionnel implements ListInterface, ExportElementValidatedIn * * @return array */ + #[\Override] public function getQueryKeys($data) { $projet_professionnel = self::PPROF; @@ -370,6 +380,7 @@ class ListProjetProfessionnel implements ListInterface, ExportElementValidatedIn * @param QueryBuilder|\Doctrine\ORM\NativeQuery $qb * @param mixed[] $data the data from the export's form (added by self::buildForm) */ + #[\Override] public function getResult($qb, $data) { $qb->select('person.id'); @@ -445,6 +456,7 @@ class ListProjetProfessionnel implements ListInterface, ExportElementValidatedIn * @param mixed[] $values The values from the result. if there are duplicates, those might be given twice. Example: array('FR', 'BE', 'CZ', 'FR', 'BE', 'FR') * @param mixed $data The data from the export's form (as defined in `buildForm` */ + #[\Override] public function getLabels($key, array $values, $data) { return match ($key) { @@ -579,6 +591,7 @@ ORDER BY pp.reportdate DESC SQL; + #[\Override] public function getFormDefaultData(): array { return []; diff --git a/src/Bundle/ChillJobBundle/src/Form/CSPersonDispositifsType.php b/src/Bundle/ChillJobBundle/src/Form/CSPersonDispositifsType.php index 187c5f656..7f170397e 100644 --- a/src/Bundle/ChillJobBundle/src/Form/CSPersonDispositifsType.php +++ b/src/Bundle/ChillJobBundle/src/Form/CSPersonDispositifsType.php @@ -23,6 +23,7 @@ use Chill\MainBundle\Form\Type\ChillDateType; class CSPersonDispositifsType extends AbstractType { + #[\Override] public function buildForm(FormBuilderInterface $builder, array $options) { $builder @@ -108,6 +109,7 @@ class CSPersonDispositifsType extends AbstractType ]); } + #[\Override] public function configureOptions(OptionsResolver $resolver) { $resolver->setDefaults(['data_class' => CSPerson::class]); @@ -118,6 +120,7 @@ class CSPersonDispositifsType extends AbstractType ; } + #[\Override] public function getBlockPrefix() { return 'job_bundle_csperson'; diff --git a/src/Bundle/ChillJobBundle/src/Form/CSPersonPersonalSituationType.php b/src/Bundle/ChillJobBundle/src/Form/CSPersonPersonalSituationType.php index ba04d8b0f..433944e8d 100644 --- a/src/Bundle/ChillJobBundle/src/Form/CSPersonPersonalSituationType.php +++ b/src/Bundle/ChillJobBundle/src/Form/CSPersonPersonalSituationType.php @@ -27,6 +27,7 @@ use Chill\PersonBundle\Form\Type\Select2MaritalStatusType; class CSPersonPersonalSituationType extends AbstractType { + #[\Override] public function buildForm(FormBuilderInterface $builder, array $options) { $builder @@ -240,6 +241,7 @@ class CSPersonPersonalSituationType extends AbstractType ; } + #[\Override] public function configureOptions(OptionsResolver $resolver) { $resolver->setDefaults(['data_class' => CSPerson::class]); @@ -249,6 +251,7 @@ class CSPersonPersonalSituationType extends AbstractType ; } + #[\Override] public function getBlockPrefix() { return 'job_bundle_csperson'; diff --git a/src/Bundle/ChillJobBundle/src/Form/CV/ExperienceType.php b/src/Bundle/ChillJobBundle/src/Form/CV/ExperienceType.php index de74f2a22..ab05f49ee 100644 --- a/src/Bundle/ChillJobBundle/src/Form/CV/ExperienceType.php +++ b/src/Bundle/ChillJobBundle/src/Form/CV/ExperienceType.php @@ -22,6 +22,7 @@ use Chill\JobBundle\Entity\CV\Experience; class ExperienceType extends AbstractType { + #[\Override] public function buildForm(FormBuilderInterface $builder, array $options) { $builder @@ -58,11 +59,13 @@ class ExperienceType extends AbstractType ; } + #[\Override] public function configureOptions(OptionsResolver $resolver) { $resolver->setDefaults(['data_class' => Experience::class]); } + #[\Override] public function getBlockPrefix() { return 'job_bundle_cv_experience'; diff --git a/src/Bundle/ChillJobBundle/src/Form/CV/FormationType.php b/src/Bundle/ChillJobBundle/src/Form/CV/FormationType.php index 83093d95b..40ed7cc24 100644 --- a/src/Bundle/ChillJobBundle/src/Form/CV/FormationType.php +++ b/src/Bundle/ChillJobBundle/src/Form/CV/FormationType.php @@ -21,6 +21,7 @@ use Chill\JobBundle\Entity\CV\Formation as F; class FormationType extends AbstractType { + #[\Override] public function buildForm(FormBuilderInterface $builder, array $options) { $builder @@ -63,11 +64,13 @@ class FormationType extends AbstractType ; } + #[\Override] public function configureOptions(OptionsResolver $resolver) { $resolver->setDefaults(['data_class' => F::class]); } + #[\Override] public function getBlockPrefix() { return 'job_bundle_cv_formation'; diff --git a/src/Bundle/ChillJobBundle/src/Form/CVType.php b/src/Bundle/ChillJobBundle/src/Form/CVType.php index c6fb6614d..7dc64d715 100644 --- a/src/Bundle/ChillJobBundle/src/Form/CVType.php +++ b/src/Bundle/ChillJobBundle/src/Form/CVType.php @@ -25,6 +25,7 @@ use Chill\MainBundle\Form\Type\Select2LanguageType; class CVType extends AbstractType { + #[\Override] public function buildForm(FormBuilderInterface $builder, array $options) { $builder @@ -79,11 +80,13 @@ class CVType extends AbstractType ; } + #[\Override] public function configureOptions(OptionsResolver $resolver) { $resolver->setDefaults(['data_class' => CV::class]); } + #[\Override] public function getBlockPrefix() { return 'job_bundle_cv'; diff --git a/src/Bundle/ChillJobBundle/src/Form/ChoiceLoader/RomeAppellationChoiceLoader.php b/src/Bundle/ChillJobBundle/src/Form/ChoiceLoader/RomeAppellationChoiceLoader.php index 39ab23ae1..e4aab8b52 100644 --- a/src/Bundle/ChillJobBundle/src/Form/ChoiceLoader/RomeAppellationChoiceLoader.php +++ b/src/Bundle/ChillJobBundle/src/Form/ChoiceLoader/RomeAppellationChoiceLoader.php @@ -66,11 +66,13 @@ class RomeAppellationChoiceLoader implements ChoiceLoaderInterface $this->validator = $validator; } + #[\Override] public function loadChoiceList($value = null): ChoiceListInterface { return new ArrayChoiceList($this->lazyLoadedAppellations, $value); } + #[\Override] public function loadChoicesForValues($values, $value = null) { $choices = []; @@ -135,6 +137,7 @@ class RomeAppellationChoiceLoader implements ChoiceLoaderInterface return $choices; } + #[\Override] public function loadValuesForChoices(array $choices, $value = null) { $values = []; diff --git a/src/Bundle/ChillJobBundle/src/Form/FreinType.php b/src/Bundle/ChillJobBundle/src/Form/FreinType.php index 43c28ddeb..7e41650c0 100644 --- a/src/Bundle/ChillJobBundle/src/Form/FreinType.php +++ b/src/Bundle/ChillJobBundle/src/Form/FreinType.php @@ -21,6 +21,7 @@ use Symfony\Component\Form\Extension\Core\Type\TextareaType; class FreinType extends AbstractType { + #[\Override] public function buildForm(FormBuilderInterface $builder, array $options) { $builder @@ -54,11 +55,13 @@ class FreinType extends AbstractType ; } + #[\Override] public function configureOptions(OptionsResolver $resolver) { $resolver->setDefaults(['data_class' => Frein::class]); } + #[\Override] public function getBlockPrefix() { return 'job_bundle_frein'; diff --git a/src/Bundle/ChillJobBundle/src/Form/ImmersionType.php b/src/Bundle/ChillJobBundle/src/Form/ImmersionType.php index ed5e2276e..eadce8479 100644 --- a/src/Bundle/ChillJobBundle/src/Form/ImmersionType.php +++ b/src/Bundle/ChillJobBundle/src/Form/ImmersionType.php @@ -27,6 +27,7 @@ use Chill\JobBundle\Entity\Immersion; class ImmersionType extends AbstractType { + #[\Override] public function buildForm(FormBuilderInterface $builder, array $options) { if ('immersion' === $options['step']) { @@ -179,6 +180,7 @@ class ImmersionType extends AbstractType } } + #[\Override] public function configureOptions(OptionsResolver $resolver) { $resolver->setDefaults(['data_class' => Immersion::class, 'step' => 'immersion']); @@ -190,6 +192,7 @@ class ImmersionType extends AbstractType ; } + #[\Override] public function getBlockPrefix() { return 'job_bundle_immersion'; diff --git a/src/Bundle/ChillJobBundle/src/Form/ProjetProfessionnelType.php b/src/Bundle/ChillJobBundle/src/Form/ProjetProfessionnelType.php index 4817dfcc3..3691dcb98 100644 --- a/src/Bundle/ChillJobBundle/src/Form/ProjetProfessionnelType.php +++ b/src/Bundle/ChillJobBundle/src/Form/ProjetProfessionnelType.php @@ -22,6 +22,7 @@ use Chill\JobBundle\Form\Type\PickRomeAppellationType; class ProjetProfessionnelType extends AbstractType { + #[\Override] public function buildForm(FormBuilderInterface $builder, array $options) { $builder @@ -96,11 +97,13 @@ class ProjetProfessionnelType extends AbstractType ; } + #[\Override] public function configureOptions(OptionsResolver $resolver) { $resolver->setDefaults(['data_class' => ProjetProfessionnel::class]); } + #[\Override] public function getBlockPrefix() { return 'job_bundle_projetprofessionnel'; diff --git a/src/Bundle/ChillJobBundle/src/Form/Type/PickRomeAppellationType.php b/src/Bundle/ChillJobBundle/src/Form/Type/PickRomeAppellationType.php index 174a25c18..8d8fc5c1a 100644 --- a/src/Bundle/ChillJobBundle/src/Form/Type/PickRomeAppellationType.php +++ b/src/Bundle/ChillJobBundle/src/Form/Type/PickRomeAppellationType.php @@ -77,11 +77,13 @@ class PickRomeAppellationType extends AbstractType $this->validator = $validator; } + #[\Override] public function buildForm(FormBuilderInterface $builder, array $options) { // ->addModelTransformer($this->romeAppellationTransformer) } + #[\Override] public function configureOptions(OptionsResolver $resolver) { $resolver @@ -97,11 +99,13 @@ class PickRomeAppellationType extends AbstractType ; } + #[\Override] public function getParent() { return EntityType::class; } + #[\Override] public function buildView(\Symfony\Component\Form\FormView $view, \Symfony\Component\Form\FormInterface $form, array $options) { $view->vars['attr']['data-rome-appellation-picker'] = true; diff --git a/src/Bundle/ChillJobBundle/src/Menu/MenuBuilder.php b/src/Bundle/ChillJobBundle/src/Menu/MenuBuilder.php index c838a4b1a..0b41aa895 100644 --- a/src/Bundle/ChillJobBundle/src/Menu/MenuBuilder.php +++ b/src/Bundle/ChillJobBundle/src/Menu/MenuBuilder.php @@ -28,6 +28,7 @@ class MenuBuilder implements LocalMenuBuilderInterface $this->authorizationChecker = $authorizationChecker; } + #[\Override] public function buildMenu($menuId, MenuItem $menu, array $parameters) { /** @var \Chill\PersonBundle\Entity\Person $person */ @@ -65,6 +66,7 @@ class MenuBuilder implements LocalMenuBuilderInterface ]); } + #[\Override] public static function getMenuIds(): array { return ['person']; diff --git a/src/Bundle/ChillJobBundle/src/Security/Authorization/ExportsJobVoter.php b/src/Bundle/ChillJobBundle/src/Security/Authorization/ExportsJobVoter.php index af4935893..4d24155b0 100644 --- a/src/Bundle/ChillJobBundle/src/Security/Authorization/ExportsJobVoter.php +++ b/src/Bundle/ChillJobBundle/src/Security/Authorization/ExportsJobVoter.php @@ -45,6 +45,7 @@ class ExportsJobVoter extends AbstractChillVoter implements ProvideRoleHierarchy /** * @return bool */ + #[\Override] protected function supports($attribute, $subject) { if ($subject instanceof Center) { @@ -60,6 +61,7 @@ class ExportsJobVoter extends AbstractChillVoter implements ProvideRoleHierarchy /** * @return bool */ + #[\Override] protected function voteOnAttribute($attribute, $subject, TokenInterface $token) { $user = $token->getUser(); @@ -87,6 +89,7 @@ class ExportsJobVoter extends AbstractChillVoter implements ProvideRoleHierarchy * [ 'Title' => [ 'CHILL_FOO_SEE', 'CHILL_FOO_UPDATE' ] ] * ``` */ + #[\Override] public function getRolesWithHierarchy(): array { return ['JobBundle' => $this->getRoles()]; @@ -97,6 +100,7 @@ class ExportsJobVoter extends AbstractChillVoter implements ProvideRoleHierarchy * * @return string[] array of roles (as string) */ + #[\Override] public function getRoles(): array { return $this->getAttributes(); @@ -107,6 +111,7 @@ class ExportsJobVoter extends AbstractChillVoter implements ProvideRoleHierarchy * * @return string[] array of roles without scopes */ + #[\Override] public function getRolesWithoutScope(): array { return $this->getAttributes(); diff --git a/src/Bundle/ChillJobBundle/src/Security/Authorization/JobVoter.php b/src/Bundle/ChillJobBundle/src/Security/Authorization/JobVoter.php index 54de180f5..5a6951e1b 100644 --- a/src/Bundle/ChillJobBundle/src/Security/Authorization/JobVoter.php +++ b/src/Bundle/ChillJobBundle/src/Security/Authorization/JobVoter.php @@ -49,6 +49,7 @@ class JobVoter extends AbstractChillVoter implements ProvideRoleHierarchyInterfa $this->authorizationHelper = $authorizationHelper; } + #[\Override] protected function supports($attribute, $subject) { if (!\in_array($attribute, self::ALL, true)) { @@ -66,6 +67,7 @@ class JobVoter extends AbstractChillVoter implements ProvideRoleHierarchyInterfa return false; } + #[\Override] protected function voteOnAttribute($attribute, $subject, TokenInterface $token) { if ($subject instanceof Person) { @@ -102,16 +104,19 @@ class JobVoter extends AbstractChillVoter implements ProvideRoleHierarchyInterfa return true; } + #[\Override] public function getRoles(): array { return self::ALL; } + #[\Override] public function getRolesWithHierarchy(): array { return ['JobBundle' => $this->getRoles()]; } + #[\Override] public function getRolesWithoutScope(): array { return $this->getRoles(); diff --git a/src/Bundle/ChillJobBundle/src/ThirdParty/EntrepriseType.php b/src/Bundle/ChillJobBundle/src/ThirdParty/EntrepriseType.php index 347d9c7d9..294b9b597 100644 --- a/src/Bundle/ChillJobBundle/src/ThirdParty/EntrepriseType.php +++ b/src/Bundle/ChillJobBundle/src/ThirdParty/EntrepriseType.php @@ -18,6 +18,7 @@ use Chill\ThirdPartyBundle\ThirdPartyType\ThirdPartyTypeProviderInterface; */ class EntrepriseType implements ThirdPartyTypeProviderInterface { + #[\Override] public static function getKey(): string { return 'entreprise'; diff --git a/src/Bundle/ChillJobBundle/src/ThirdParty/PrescripteurType.php b/src/Bundle/ChillJobBundle/src/ThirdParty/PrescripteurType.php index a53c16547..aecd3de24 100644 --- a/src/Bundle/ChillJobBundle/src/ThirdParty/PrescripteurType.php +++ b/src/Bundle/ChillJobBundle/src/ThirdParty/PrescripteurType.php @@ -18,6 +18,7 @@ use Chill\ThirdPartyBundle\ThirdPartyType\ThirdPartyTypeProviderInterface; */ class PrescripteurType implements ThirdPartyTypeProviderInterface { + #[\Override] public static function getKey(): string { return 'prescripteur'; diff --git a/src/Bundle/ChillJobBundle/src/migrations/Version20240424095147.php b/src/Bundle/ChillJobBundle/src/migrations/Version20240424095147.php index dd4b98c11..347a48a82 100644 --- a/src/Bundle/ChillJobBundle/src/migrations/Version20240424095147.php +++ b/src/Bundle/ChillJobBundle/src/migrations/Version20240424095147.php @@ -16,11 +16,13 @@ use Doctrine\Migrations\AbstractMigration; final class Version20240424095147 extends AbstractMigration { + #[\Override] public function getDescription(): string { return 'Migration for ChillJobBundle'; } + #[\Override] public function up(Schema $schema): void { $this->addSql('CREATE SCHEMA chill_job'); @@ -104,6 +106,7 @@ final class Version20240424095147 extends AbstractMigration $this->addSql('ALTER TABLE chill_job.rome_appellation ADD CONSTRAINT FK_D9E9CABCED16FA20 FOREIGN KEY (metier_id) REFERENCES chill_job.rome_metier (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); } + #[\Override] public function down(Schema $schema): void { $this->addSql('DROP SEQUENCE chill_job.cv_id_seq CASCADE'); diff --git a/src/Bundle/ChillJobBundle/src/migrations/Version20240424140641.php b/src/Bundle/ChillJobBundle/src/migrations/Version20240424140641.php index 87c9d3623..543763be5 100644 --- a/src/Bundle/ChillJobBundle/src/migrations/Version20240424140641.php +++ b/src/Bundle/ChillJobBundle/src/migrations/Version20240424140641.php @@ -16,11 +16,13 @@ use Doctrine\Migrations\AbstractMigration; final class Version20240424140641 extends AbstractMigration { + #[\Override] public function getDescription(): string { return 'JobBundle: add missing columns to frein, immersion and projet_professionnel tables'; } + #[\Override] public function up(Schema $schema): void { $this->addSql('ALTER TABLE chill_job.frein ADD person_id INT DEFAULT NULL'); @@ -34,6 +36,7 @@ final class Version20240424140641 extends AbstractMigration $this->addSql('CREATE INDEX IDX_12E4FFBF217BBB47 ON chill_job.projet_professionnel (person_id)'); } + #[\Override] public function down(Schema $schema): void { $this->addSql('ALTER TABLE chill_job.projet_professionnel DROP CONSTRAINT FK_12E4FFBF217BBB47'); diff --git a/src/Bundle/ChillJobBundle/src/migrations/Version20240429111628.php b/src/Bundle/ChillJobBundle/src/migrations/Version20240429111628.php index e12318d7c..f1cc83c69 100644 --- a/src/Bundle/ChillJobBundle/src/migrations/Version20240429111628.php +++ b/src/Bundle/ChillJobBundle/src/migrations/Version20240429111628.php @@ -16,11 +16,13 @@ use Doctrine\Migrations\AbstractMigration; final class Version20240429111628 extends AbstractMigration { + #[\Override] public function getDescription(): string { return 'Emploi - Change field type to phonenumber for tuteur and structure acc'; } + #[\Override] public function up(Schema $schema): void { $this->addSql('ALTER TABLE chill_job.immersion ALTER tuteurphonenumber TYPE VARCHAR(35)'); @@ -30,6 +32,7 @@ final class Version20240429111628 extends AbstractMigration $this->addSql('COMMENT ON COLUMN chill_job.immersion.structureAccPhonenumber IS \'(DC2Type:phone_number)\''); } + #[\Override] public function down(Schema $schema): void { $this->addSql('ALTER TABLE chill_job.immersion ALTER tuteurPhoneNumber TYPE TEXT'); diff --git a/src/Bundle/ChillJobBundle/src/migrations/old/Version20191119172511.php b/src/Bundle/ChillJobBundle/src/migrations/old/Version20191119172511.php index 6dccbec42..43695e6e2 100644 --- a/src/Bundle/ChillJobBundle/src/migrations/old/Version20191119172511.php +++ b/src/Bundle/ChillJobBundle/src/migrations/old/Version20191119172511.php @@ -19,6 +19,7 @@ use Doctrine\Migrations\AbstractMigration; */ final class Version20191119172511 extends AbstractMigration { + #[\Override] public function up(Schema $schema): void { $this->skipIf(true, 'Skipping this old migration. Replaced by migration Version20240424095147'); @@ -104,6 +105,7 @@ final class Version20191119172511 extends AbstractMigration $this->addSql('COMMENT ON COLUMN chill_csconnectes.cs_person.accompagnement IS NULL'); } + #[\Override] public function down(Schema $schema): void { $this->abortIf('postgresql' !== $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'postgresql\'.'); diff --git a/src/Bundle/ChillJobBundle/src/migrations/old/Version20191129112321.php b/src/Bundle/ChillJobBundle/src/migrations/old/Version20191129112321.php index 85ca4e137..f20cb84fc 100644 --- a/src/Bundle/ChillJobBundle/src/migrations/old/Version20191129112321.php +++ b/src/Bundle/ChillJobBundle/src/migrations/old/Version20191129112321.php @@ -19,6 +19,7 @@ use Doctrine\Migrations\AbstractMigration; */ final class Version20191129112321 extends AbstractMigration { + #[\Override] public function up(Schema $schema): void { $this->skipIf(true, 'Skipping this old migration. Replaced by migration Version20240424095147'); @@ -38,6 +39,7 @@ final class Version20191129112321 extends AbstractMigration $this->addSql('ALTER TABLE chill_csconnectes.cs_person ALTER person_id DROP NOT NULL'); } + #[\Override] public function down(Schema $schema): void { $this->throwIrreversibleMigrationException('this migration is not reversible (' diff --git a/src/Bundle/ChillJobBundle/src/migrations/old/Version20200113104411.php b/src/Bundle/ChillJobBundle/src/migrations/old/Version20200113104411.php index 1fb74f5f0..108203583 100644 --- a/src/Bundle/ChillJobBundle/src/migrations/old/Version20200113104411.php +++ b/src/Bundle/ChillJobBundle/src/migrations/old/Version20200113104411.php @@ -19,6 +19,7 @@ use Doctrine\Migrations\AbstractMigration; */ final class Version20200113104411 extends AbstractMigration { + #[\Override] public function up(Schema $schema): void { $this->skipIf(true, 'Skipping this old migration. Replaced by migration Version20240424095147'); @@ -39,6 +40,7 @@ final class Version20200113104411 extends AbstractMigration $this->addSql('ALTER TABLE chill_csconnectes.cv_formation ADD CONSTRAINT FK_20BE09E2AE1799D8 FOREIGN KEY (CV_id) REFERENCES chill_csconnectes.cv (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); } + #[\Override] public function down(Schema $schema): void { $this->abortIf('postgresql' !== $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'postgresql\'.'); diff --git a/src/Bundle/ChillJobBundle/src/migrations/old/Version20200113142525.php b/src/Bundle/ChillJobBundle/src/migrations/old/Version20200113142525.php index cabc97d59..a6c010282 100644 --- a/src/Bundle/ChillJobBundle/src/migrations/old/Version20200113142525.php +++ b/src/Bundle/ChillJobBundle/src/migrations/old/Version20200113142525.php @@ -23,6 +23,7 @@ use Doctrine\Migrations\AbstractMigration; */ final class Version20200113142525 extends AbstractMigration { + #[\Override] public function up(Schema $schema): void { $this->skipIf(true, 'Skipping this old migration. Replaced by migration Version20240424095147'); @@ -33,6 +34,7 @@ final class Version20200113142525 extends AbstractMigration $this->addSql('CREATE INDEX IDX_FBB3CBB4B5E04267 ON chill_csconnectes.immersion (structureAccAddress_id)'); } + #[\Override] public function down(Schema $schema): void { $this->abortIf('postgresql' !== $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'postgresql\'.'); diff --git a/src/Bundle/ChillJobBundle/src/migrations/old/Version20200114081435.php b/src/Bundle/ChillJobBundle/src/migrations/old/Version20200114081435.php index a03263bf3..207afe86a 100644 --- a/src/Bundle/ChillJobBundle/src/migrations/old/Version20200114081435.php +++ b/src/Bundle/ChillJobBundle/src/migrations/old/Version20200114081435.php @@ -22,6 +22,7 @@ use Doctrine\Migrations\AbstractMigration; */ final class Version20200114081435 extends AbstractMigration { + #[\Override] public function up(Schema $schema): void { $this->skipIf(true, 'Skipping this old migration. Replaced by migration Version20240424095147'); @@ -33,6 +34,7 @@ final class Version20200114081435 extends AbstractMigration $this->addSql('ALTER TABLE chill_csconnectes.immersion ADD CONSTRAINT FK_FBB3CBB4B5E04267 FOREIGN KEY (structureAccAddress_id) REFERENCES chill_main_address (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); } + #[\Override] public function down(Schema $schema): void { $this->abortIf('postgresql' !== $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'postgresql\'.'); diff --git a/src/Bundle/ChillJobBundle/src/migrations/old/Version20200124130244.php b/src/Bundle/ChillJobBundle/src/migrations/old/Version20200124130244.php index dd1e669ae..9322f71c0 100644 --- a/src/Bundle/ChillJobBundle/src/migrations/old/Version20200124130244.php +++ b/src/Bundle/ChillJobBundle/src/migrations/old/Version20200124130244.php @@ -19,6 +19,7 @@ use Doctrine\Migrations\AbstractMigration; */ final class Version20200124130244 extends AbstractMigration { + #[\Override] public function up(Schema $schema): void { $this->skipIf(true, 'Skipping this old migration. Replaced by migration Version20240424095147'); @@ -27,6 +28,7 @@ final class Version20200124130244 extends AbstractMigration $this->addSql('ALTER TABLE chill_csconnectes.cs_person ADD datecontratIEJ DATE DEFAULT NULL'); } + #[\Override] public function down(Schema $schema): void { $this->abortIf('postgresql' !== $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'postgresql\'.'); diff --git a/src/Bundle/ChillJobBundle/src/migrations/old/Version20200124132321.php b/src/Bundle/ChillJobBundle/src/migrations/old/Version20200124132321.php index 3cf1b3019..30c6ff20c 100644 --- a/src/Bundle/ChillJobBundle/src/migrations/old/Version20200124132321.php +++ b/src/Bundle/ChillJobBundle/src/migrations/old/Version20200124132321.php @@ -19,6 +19,7 @@ use Doctrine\Migrations\AbstractMigration; */ final class Version20200124132321 extends AbstractMigration { + #[\Override] public function up(Schema $schema): void { $this->skipIf(true, 'Skipping this old migration. Replaced by migration Version20240424095147'); @@ -27,6 +28,7 @@ final class Version20200124132321 extends AbstractMigration $this->addSql('ALTER TABLE chill_csconnectes.cs_person ADD typeContratAide TEXT DEFAULT NULL'); } + #[\Override] public function down(Schema $schema): void { $this->abortIf('postgresql' !== $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'postgresql\'.'); diff --git a/src/Bundle/ChillJobBundle/src/migrations/old/Version20200127132932.php b/src/Bundle/ChillJobBundle/src/migrations/old/Version20200127132932.php index 2907c2155..32ab95d6b 100644 --- a/src/Bundle/ChillJobBundle/src/migrations/old/Version20200127132932.php +++ b/src/Bundle/ChillJobBundle/src/migrations/old/Version20200127132932.php @@ -19,6 +19,7 @@ use Doctrine\Migrations\AbstractMigration; */ final class Version20200127132932 extends AbstractMigration { + #[\Override] public function up(Schema $schema): void { $this->skipIf(true, 'Skipping this old migration. Replaced by migration Version20240424095147'); @@ -27,6 +28,7 @@ final class Version20200127132932 extends AbstractMigration $this->addSql('ALTER TABLE chill_csconnectes.immersion ADD objectifsAutre TEXT DEFAULT NULL'); } + #[\Override] public function down(Schema $schema): void { $this->abortIf('postgresql' !== $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'postgresql\'.'); diff --git a/src/Bundle/ChillJobBundle/src/migrations/old/Version20200205132532.php b/src/Bundle/ChillJobBundle/src/migrations/old/Version20200205132532.php index 1372aa308..5e3caa980 100644 --- a/src/Bundle/ChillJobBundle/src/migrations/old/Version20200205132532.php +++ b/src/Bundle/ChillJobBundle/src/migrations/old/Version20200205132532.php @@ -19,6 +19,7 @@ use Doctrine\Migrations\AbstractMigration; */ final class Version20200205132532 extends AbstractMigration { + #[\Override] public function up(Schema $schema): void { $this->skipIf(true, 'Skipping this old migration. Replaced by migration Version20240424095147'); @@ -61,6 +62,7 @@ final class Version20200205132532 extends AbstractMigration $this->addSql('ALTER TABLE chill_csconnectes.projetprofessionnel_valide ADD CONSTRAINT FK_E0501BE07CDE30DD FOREIGN KEY (appellation_id) REFERENCES chill_csconnectes.rome_appellation (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE'); } + #[\Override] public function down(Schema $schema): void { $this->abortIf('postgresql' !== $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'postgresql\'.'); diff --git a/src/Bundle/ChillJobBundle/src/migrations/old/Version20200207224152.php b/src/Bundle/ChillJobBundle/src/migrations/old/Version20200207224152.php index 6fecfda82..c258e7541 100644 --- a/src/Bundle/ChillJobBundle/src/migrations/old/Version20200207224152.php +++ b/src/Bundle/ChillJobBundle/src/migrations/old/Version20200207224152.php @@ -19,6 +19,7 @@ use Doctrine\Migrations\AbstractMigration; */ final class Version20200207224152 extends AbstractMigration { + #[\Override] public function up(Schema $schema): void { $this->skipIf(true, 'Skipping this old migration. Replaced by migration Version20240424095147'); @@ -28,6 +29,7 @@ final class Version20200207224152 extends AbstractMigration $this->addSql('CREATE INDEX code_metier_idx ON chill_csconnectes.rome_metier (code)'); } + #[\Override] public function down(Schema $schema): void { $this->abortIf('postgresql' !== $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'postgresql\'.'); diff --git a/src/Bundle/ChillJobBundle/src/migrations/old/Version20200210105342.php b/src/Bundle/ChillJobBundle/src/migrations/old/Version20200210105342.php index 53d88ec2b..d7ae8f6c2 100644 --- a/src/Bundle/ChillJobBundle/src/migrations/old/Version20200210105342.php +++ b/src/Bundle/ChillJobBundle/src/migrations/old/Version20200210105342.php @@ -19,6 +19,7 @@ use Doctrine\Migrations\AbstractMigration; */ final class Version20200210105342 extends AbstractMigration { + #[\Override] public function up(Schema $schema): void { $this->skipIf(true, 'Skipping this old migration. Replaced by migration Version20240424095147'); @@ -28,6 +29,7 @@ final class Version20200210105342 extends AbstractMigration $this->addSql('DROP INDEX IF EXISTS chill_csconnectes.code_appellation_idx '); } + #[\Override] public function down(Schema $schema): void { $this->addSql('DROP INDEX chill_csconnectes.UNIQ_D9E9CABC77153098'); diff --git a/src/Bundle/ChillJobBundle/src/migrations/old/Version20200313124323.php b/src/Bundle/ChillJobBundle/src/migrations/old/Version20200313124323.php index 1c3ef3be4..09b000e9f 100644 --- a/src/Bundle/ChillJobBundle/src/migrations/old/Version20200313124323.php +++ b/src/Bundle/ChillJobBundle/src/migrations/old/Version20200313124323.php @@ -19,6 +19,7 @@ use Doctrine\Migrations\AbstractMigration; */ final class Version20200313124323 extends AbstractMigration { + #[\Override] public function up(Schema $schema): void { $this->skipIf(true, 'Skipping this old migration. Replaced by migration Version20240424095147'); @@ -55,6 +56,7 @@ final class Version20200313124323 extends AbstractMigration $this->addSql('COMMENT ON COLUMN chill_3party.third_party.types IS NULL'); } + #[\Override] public function down(Schema $schema): void { $this->abortIf('postgresql' !== $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'postgresql\'.'); diff --git a/src/Bundle/ChillJobBundle/src/migrations/old/Version20200403114520.php b/src/Bundle/ChillJobBundle/src/migrations/old/Version20200403114520.php index ab80c48d7..8c4320fe1 100644 --- a/src/Bundle/ChillJobBundle/src/migrations/old/Version20200403114520.php +++ b/src/Bundle/ChillJobBundle/src/migrations/old/Version20200403114520.php @@ -20,6 +20,7 @@ use Doctrine\Migrations\AbstractMigration; */ final class Version20200403114520 extends AbstractMigration { + #[\Override] public function up(Schema $schema): void { $this->skipIf(true, 'Skipping this old migration. Replaced by migration Version20240424095147'); @@ -27,6 +28,7 @@ final class Version20200403114520 extends AbstractMigration $this->addSql('ALTER TABLE chill_csconnectes.projet_professionnel ADD domaineActiviteValide TEXT DEFAULT NULL;'); } + #[\Override] public function down(Schema $schema): void { $this->addSql('ALTER TABLE chill_csconnectes.projet_professionnel DROP domaineActiviteSouhait'); diff --git a/src/Bundle/ChillJobBundle/src/migrations/old/Version20200403123148.php b/src/Bundle/ChillJobBundle/src/migrations/old/Version20200403123148.php index 307cd14c7..a9ad489fd 100644 --- a/src/Bundle/ChillJobBundle/src/migrations/old/Version20200403123148.php +++ b/src/Bundle/ChillJobBundle/src/migrations/old/Version20200403123148.php @@ -19,12 +19,14 @@ use Doctrine\Migrations\AbstractMigration; */ final class Version20200403123148 extends AbstractMigration { + #[\Override] public function up(Schema $schema): void { $this->skipIf(true, 'Skipping this old migration. Replaced by migration Version20240424095147'); $this->addSql('ALTER TABLE chill_csconnectes.cs_person ADD dateavenantIEJ DATE DEFAULT NULL;'); } + #[\Override] public function down(Schema $schema): void { $this->addSql('ALTER TABLE chill_csconnectes.cs_person DROP dateavenantIEJ'); diff --git a/src/Bundle/ChillMainBundle/CRUD/CompilerPass/CRUDControllerCompilerPass.php b/src/Bundle/ChillMainBundle/CRUD/CompilerPass/CRUDControllerCompilerPass.php index 601dc9833..91ddd24c0 100644 --- a/src/Bundle/ChillMainBundle/CRUD/CompilerPass/CRUDControllerCompilerPass.php +++ b/src/Bundle/ChillMainBundle/CRUD/CompilerPass/CRUDControllerCompilerPass.php @@ -21,6 +21,7 @@ use Symfony\Component\DependencyInjection\Definition; class CRUDControllerCompilerPass implements CompilerPassInterface { + #[\Override] public function process(ContainerBuilder $container) { $crudConfig = $container->getParameter('chill_main_crud_route_loader_config'); diff --git a/src/Bundle/ChillMainBundle/CRUD/Controller/AbstractCRUDController.php b/src/Bundle/ChillMainBundle/CRUD/Controller/AbstractCRUDController.php index ea5e55a69..5e2b6b4bc 100644 --- a/src/Bundle/ChillMainBundle/CRUD/Controller/AbstractCRUDController.php +++ b/src/Bundle/ChillMainBundle/CRUD/Controller/AbstractCRUDController.php @@ -57,6 +57,7 @@ abstract class AbstractCRUDController extends AbstractController throw new \RuntimeException(sprintf('the config does not have any role for the method %s nor a global role for the whole action. Add those to your configuration or override the required method', $request->getMethod())); } + #[\Override] public static function getSubscribedServices(): array { return \array_merge( diff --git a/src/Bundle/ChillMainBundle/CRUD/Controller/CRUDController.php b/src/Bundle/ChillMainBundle/CRUD/Controller/CRUDController.php index 2384e32b4..5d2aa7b4b 100644 --- a/src/Bundle/ChillMainBundle/CRUD/Controller/CRUDController.php +++ b/src/Bundle/ChillMainBundle/CRUD/Controller/CRUDController.php @@ -90,6 +90,7 @@ class CRUDController extends AbstractController return []; } + #[\Override] public static function getSubscribedServices(): array { return \array_merge( diff --git a/src/Bundle/ChillMainBundle/CRUD/Resolver/Resolver.php b/src/Bundle/ChillMainBundle/CRUD/Resolver/Resolver.php index 535e47c91..29d69a9af 100644 --- a/src/Bundle/ChillMainBundle/CRUD/Resolver/Resolver.php +++ b/src/Bundle/ChillMainBundle/CRUD/Resolver/Resolver.php @@ -21,17 +21,17 @@ class Resolver /** * The key to get the role necessary for the action. */ - final public const ROLE = 'role'; + final public const string ROLE = 'role'; /** * @deprecated */ - final public const ROLE_EDIT = 'role.edit'; + final public const string ROLE_EDIT = 'role.edit'; /** * @deprecated */ - final public const ROLE_VIEW = 'role.view'; + final public const string ROLE_VIEW = 'role.view'; /** * @var array diff --git a/src/Bundle/ChillMainBundle/CRUD/Routing/CRUDRoutesLoader.php b/src/Bundle/ChillMainBundle/CRUD/Routing/CRUDRoutesLoader.php index b553db0f4..c6db14692 100644 --- a/src/Bundle/ChillMainBundle/CRUD/Routing/CRUDRoutesLoader.php +++ b/src/Bundle/ChillMainBundle/CRUD/Routing/CRUDRoutesLoader.php @@ -18,9 +18,9 @@ use Symfony\Component\Routing\RouteCollection; class CRUDRoutesLoader extends Loader { - private const ALL_INDEX_METHODS = [Request::METHOD_GET, Request::METHOD_HEAD]; + private const array ALL_INDEX_METHODS = [Request::METHOD_GET, Request::METHOD_HEAD]; - private const ALL_SINGLE_METHODS = [ + private const array ALL_SINGLE_METHODS = [ Request::METHOD_GET, Request::METHOD_POST, Request::METHOD_PUT, @@ -39,6 +39,7 @@ class CRUDRoutesLoader extends Loader * * @param mixed|null $type */ + #[\Override] public function load($resource, $type = null): RouteCollection { if (true === $this->isLoaded) { @@ -61,6 +62,7 @@ class CRUDRoutesLoader extends Loader /** * @param null $type */ + #[\Override] public function supports($resource, $type = null): bool { return 'CRUD' === $type; diff --git a/src/Bundle/ChillMainBundle/CRUD/Templating/TwigCRUDResolver.php b/src/Bundle/ChillMainBundle/CRUD/Templating/TwigCRUDResolver.php index 27476fcf2..af4da06c9 100644 --- a/src/Bundle/ChillMainBundle/CRUD/Templating/TwigCRUDResolver.php +++ b/src/Bundle/ChillMainBundle/CRUD/Templating/TwigCRUDResolver.php @@ -47,6 +47,7 @@ class TwigCRUDResolver extends AbstractExtension /** * @return array|TwigFunction[] */ + #[\Override] public function getFunctions() { return [ diff --git a/src/Bundle/ChillMainBundle/ChillMainBundle.php b/src/Bundle/ChillMainBundle/ChillMainBundle.php index ff721784a..b2e2af89f 100644 --- a/src/Bundle/ChillMainBundle/ChillMainBundle.php +++ b/src/Bundle/ChillMainBundle/ChillMainBundle.php @@ -37,6 +37,7 @@ use Symfony\Component\HttpKernel\Bundle\Bundle; class ChillMainBundle extends Bundle { + #[\Override] public function build(ContainerBuilder $container) { parent::build($container); diff --git a/src/Bundle/ChillMainBundle/Command/ChillImportUsersCommand.php b/src/Bundle/ChillMainBundle/Command/ChillImportUsersCommand.php index c7871a346..af4ad46a4 100644 --- a/src/Bundle/ChillMainBundle/Command/ChillImportUsersCommand.php +++ b/src/Bundle/ChillMainBundle/Command/ChillImportUsersCommand.php @@ -83,6 +83,7 @@ class ChillImportUsersCommand extends Command return \implode(';', $str); } + #[\Override] protected function configure() { $this @@ -185,6 +186,7 @@ class ChillImportUsersCommand extends Command return false; } + #[\Override] protected function execute(InputInterface $input, OutputInterface $output): int { $this->tempOutput = $output; diff --git a/src/Bundle/ChillMainBundle/Command/ChillUserSendRenewPasswordCodeCommand.php b/src/Bundle/ChillMainBundle/Command/ChillUserSendRenewPasswordCodeCommand.php index 3e1367a00..5cfb2323c 100644 --- a/src/Bundle/ChillMainBundle/Command/ChillUserSendRenewPasswordCodeCommand.php +++ b/src/Bundle/ChillMainBundle/Command/ChillUserSendRenewPasswordCodeCommand.php @@ -79,6 +79,7 @@ class ChillUserSendRenewPasswordCodeCommand extends Command parent::__construct(); } + #[\Override] protected function configure() { $this @@ -89,6 +90,7 @@ class ChillUserSendRenewPasswordCodeCommand extends Command ->addOption('subject', null, InputOption::VALUE_REQUIRED, 'Subject of the email', 'Recover your password'); } + #[\Override] protected function execute(InputInterface $input, OutputInterface $output): int { $this->input = $input; diff --git a/src/Bundle/ChillMainBundle/Command/ExecuteCronJobCommand.php b/src/Bundle/ChillMainBundle/Command/ExecuteCronJobCommand.php index 6d998f732..c8e654265 100644 --- a/src/Bundle/ChillMainBundle/Command/ExecuteCronJobCommand.php +++ b/src/Bundle/ChillMainBundle/Command/ExecuteCronJobCommand.php @@ -27,6 +27,7 @@ class ExecuteCronJobCommand extends Command parent::__construct('chill:cron-job:execute'); } + #[\Override] protected function configure() { $this @@ -35,6 +36,7 @@ class ExecuteCronJobCommand extends Command ->addUsage(''); } + #[\Override] protected function execute(InputInterface $input, OutputInterface $output): int { if ([] === $input->getArgument('job')) { diff --git a/src/Bundle/ChillMainBundle/Command/LoadAddressesBEFromBestAddressCommand.php b/src/Bundle/ChillMainBundle/Command/LoadAddressesBEFromBestAddressCommand.php index d5dedd169..85a4ca87c 100644 --- a/src/Bundle/ChillMainBundle/Command/LoadAddressesBEFromBestAddressCommand.php +++ b/src/Bundle/ChillMainBundle/Command/LoadAddressesBEFromBestAddressCommand.php @@ -29,6 +29,7 @@ class LoadAddressesBEFromBestAddressCommand extends Command parent::__construct(); } + #[\Override] protected function configure() { $this @@ -37,6 +38,7 @@ class LoadAddressesBEFromBestAddressCommand extends Command ->addArgument('list', InputArgument::IS_ARRAY, "The list to add, for example 'full', or 'extract' (dev) or '1xxx' (brussel CP)"); } + #[\Override] protected function execute(InputInterface $input, OutputInterface $output): int { $this->postalCodeBEFromBestAddressImporter->import(); diff --git a/src/Bundle/ChillMainBundle/Command/LoadAddressesFRFromBANOCommand.php b/src/Bundle/ChillMainBundle/Command/LoadAddressesFRFromBANOCommand.php index 2bfc3be5c..2bf65b6dc 100644 --- a/src/Bundle/ChillMainBundle/Command/LoadAddressesFRFromBANOCommand.php +++ b/src/Bundle/ChillMainBundle/Command/LoadAddressesFRFromBANOCommand.php @@ -26,12 +26,14 @@ class LoadAddressesFRFromBANOCommand extends Command parent::__construct(); } + #[\Override] protected function configure() { $this->setName('chill:main:address-ref-from-bano') ->addArgument('departementNo', InputArgument::REQUIRED | InputArgument::IS_ARRAY, 'a list of departement numbers'); } + #[\Override] protected function execute(InputInterface $input, OutputInterface $output): int { foreach ($input->getArgument('departementNo') as $departementNo) { diff --git a/src/Bundle/ChillMainBundle/Command/LoadAddressesLUFromBDAddressCommand.php b/src/Bundle/ChillMainBundle/Command/LoadAddressesLUFromBDAddressCommand.php index 2477a486d..f31c4aa27 100644 --- a/src/Bundle/ChillMainBundle/Command/LoadAddressesLUFromBDAddressCommand.php +++ b/src/Bundle/ChillMainBundle/Command/LoadAddressesLUFromBDAddressCommand.php @@ -26,11 +26,13 @@ class LoadAddressesLUFromBDAddressCommand extends Command parent::__construct(); } + #[\Override] protected function configure() { $this->setName('chill:main:address-ref-lux'); } + #[\Override] protected function execute(InputInterface $input, OutputInterface $output): int { $this->addressImporter->import(); diff --git a/src/Bundle/ChillMainBundle/Command/LoadAndUpdateLanguagesCommand.php b/src/Bundle/ChillMainBundle/Command/LoadAndUpdateLanguagesCommand.php index 376df4e52..c9f75b5d2 100644 --- a/src/Bundle/ChillMainBundle/Command/LoadAndUpdateLanguagesCommand.php +++ b/src/Bundle/ChillMainBundle/Command/LoadAndUpdateLanguagesCommand.php @@ -25,9 +25,9 @@ use Symfony\Component\Intl\Languages; */ class LoadAndUpdateLanguagesCommand extends Command { - final public const INCLUDE_ANCIENT = 'include_ancient'; + final public const string INCLUDE_ANCIENT = 'include_ancient'; - final public const INCLUDE_REGIONAL_VERSION = 'include_regional'; + final public const string INCLUDE_REGIONAL_VERSION = 'include_regional'; // Array of ancien languages (to exclude) private array $ancientToExclude = ['ang', 'egy', 'fro', 'goh', 'grc', 'la', 'non', 'peo', 'pro', 'sga', @@ -50,6 +50,7 @@ class LoadAndUpdateLanguagesCommand extends Command * * @see \Symfony\Component\Console\Command\Command::configure() */ + #[\Override] protected function configure() { $this @@ -75,6 +76,7 @@ class LoadAndUpdateLanguagesCommand extends Command * * @see \Symfony\Component\Console\Command\Command::execute() */ + #[\Override] protected function execute(InputInterface $input, OutputInterface $output): int { $em = $this->entityManager; diff --git a/src/Bundle/ChillMainBundle/Command/LoadCountriesCommand.php b/src/Bundle/ChillMainBundle/Command/LoadCountriesCommand.php index 3f7f82523..7cc333653 100644 --- a/src/Bundle/ChillMainBundle/Command/LoadCountriesCommand.php +++ b/src/Bundle/ChillMainBundle/Command/LoadCountriesCommand.php @@ -53,6 +53,7 @@ class LoadCountriesCommand extends Command * * @see \Symfony\Component\Console\Command\Command::configure() */ + #[\Override] protected function configure() { $this->setName('chill:main:countries:populate'); @@ -63,6 +64,7 @@ class LoadCountriesCommand extends Command * * @see \Symfony\Component\Console\Command\Command::execute() */ + #[\Override] protected function execute(InputInterface $input, OutputInterface $output): int { $countries = static::prepareCountryList($this->availableLanguages); diff --git a/src/Bundle/ChillMainBundle/Command/LoadPostalCodeFR.php b/src/Bundle/ChillMainBundle/Command/LoadPostalCodeFR.php index eb0bef879..77779e58e 100644 --- a/src/Bundle/ChillMainBundle/Command/LoadPostalCodeFR.php +++ b/src/Bundle/ChillMainBundle/Command/LoadPostalCodeFR.php @@ -25,11 +25,13 @@ class LoadPostalCodeFR extends Command parent::__construct(); } + #[\Override] public function configure(): void { $this->setName('chill:main:postal-code:load:FR'); } + #[\Override] public function execute(InputInterface $input, OutputInterface $output): int { $this->loader->import(); diff --git a/src/Bundle/ChillMainBundle/Command/LoadPostalCodesCommand.php b/src/Bundle/ChillMainBundle/Command/LoadPostalCodesCommand.php index 4f0896114..0ea29c974 100644 --- a/src/Bundle/ChillMainBundle/Command/LoadPostalCodesCommand.php +++ b/src/Bundle/ChillMainBundle/Command/LoadPostalCodesCommand.php @@ -32,6 +32,7 @@ class LoadPostalCodesCommand extends Command parent::__construct(); } + #[\Override] protected function configure() { $this->setName('chill:main:postal-code:populate') @@ -68,6 +69,7 @@ class LoadPostalCodesCommand extends Command ); } + #[\Override] protected function execute(InputInterface $input, OutputInterface $output): int { $csv = $this->getCSVResource($input); diff --git a/src/Bundle/ChillMainBundle/Command/SetPasswordCommand.php b/src/Bundle/ChillMainBundle/Command/SetPasswordCommand.php index 6924b8049..df8284bf2 100644 --- a/src/Bundle/ChillMainBundle/Command/SetPasswordCommand.php +++ b/src/Bundle/ChillMainBundle/Command/SetPasswordCommand.php @@ -54,6 +54,7 @@ class SetPasswordCommand extends Command $this->entityManager->flush($user); } + #[\Override] public function configure() { $this->setName('chill:user:set_password') @@ -62,6 +63,7 @@ class SetPasswordCommand extends Command ->addArgument('password', InputArgument::OPTIONAL, 'the new password'); } + #[\Override] public function execute(InputInterface $input, OutputInterface $output): int { $user = $this->_getUser($input->getArgument('username')); diff --git a/src/Bundle/ChillMainBundle/Command/SynchronizeEntityInfoViewsCommand.php b/src/Bundle/ChillMainBundle/Command/SynchronizeEntityInfoViewsCommand.php index 16a90dbe8..74594ae05 100644 --- a/src/Bundle/ChillMainBundle/Command/SynchronizeEntityInfoViewsCommand.php +++ b/src/Bundle/ChillMainBundle/Command/SynchronizeEntityInfoViewsCommand.php @@ -26,8 +26,10 @@ class SynchronizeEntityInfoViewsCommand extends Command parent::__construct('chill:db:sync-views'); } + #[\Override] protected function configure(): void {} + #[\Override] protected function execute(InputInterface $input, OutputInterface $output): int { $this->viewEntityInfoManager->synchronizeOnDB(); diff --git a/src/Bundle/ChillMainBundle/Controller/AddressReferenceAPIController.php b/src/Bundle/ChillMainBundle/Controller/AddressReferenceAPIController.php index e50cea6bb..153c131ce 100644 --- a/src/Bundle/ChillMainBundle/Controller/AddressReferenceAPIController.php +++ b/src/Bundle/ChillMainBundle/Controller/AddressReferenceAPIController.php @@ -61,6 +61,7 @@ final class AddressReferenceAPIController extends ApiController ); } + #[\Override] protected function customizeQuery(string $action, Request $request, $qb): void { if ($request->query->has('postal_code')) { @@ -70,6 +71,7 @@ final class AddressReferenceAPIController extends ApiController } } + #[\Override] protected function orderQuery(string $action, $query, Request $request, PaginatorInterface $paginator, $_format) { $query->addOrderBy('e.street', 'ASC'); diff --git a/src/Bundle/ChillMainBundle/Controller/CenterController.php b/src/Bundle/ChillMainBundle/Controller/CenterController.php index 8ae9c8a1c..0d000524d 100644 --- a/src/Bundle/ChillMainBundle/Controller/CenterController.php +++ b/src/Bundle/ChillMainBundle/Controller/CenterController.php @@ -20,6 +20,7 @@ use Symfony\Component\HttpFoundation\Request; */ class CenterController extends CRUDController { + #[\Override] protected function orderQuery(string $action, $query, Request $request, PaginatorInterface $paginator) { $query->addOrderBy('e.name', 'ASC'); diff --git a/src/Bundle/ChillMainBundle/Controller/CivilityApiController.php b/src/Bundle/ChillMainBundle/Controller/CivilityApiController.php index 36ed5d89c..4c9a19e86 100644 --- a/src/Bundle/ChillMainBundle/Controller/CivilityApiController.php +++ b/src/Bundle/ChillMainBundle/Controller/CivilityApiController.php @@ -17,6 +17,7 @@ use Symfony\Component\HttpFoundation\Request; class CivilityApiController extends ApiController { + #[\Override] protected function orderQuery(string $action, $query, Request $request, PaginatorInterface $paginator, $_format) { return $query->addOrderBy('e.order', 'ASC'); diff --git a/src/Bundle/ChillMainBundle/Controller/CivilityController.php b/src/Bundle/ChillMainBundle/Controller/CivilityController.php index 63b15c48a..60d67f984 100644 --- a/src/Bundle/ChillMainBundle/Controller/CivilityController.php +++ b/src/Bundle/ChillMainBundle/Controller/CivilityController.php @@ -17,6 +17,7 @@ use Symfony\Component\HttpFoundation\Request; class CivilityController extends CRUDController { + #[\Override] protected function orderQuery(string $action, $query, Request $request, PaginatorInterface $paginator) { $query->addOrderBy('e.order', 'ASC'); diff --git a/src/Bundle/ChillMainBundle/Controller/CountryController.php b/src/Bundle/ChillMainBundle/Controller/CountryController.php index de0ffde9e..ca51eb13e 100644 --- a/src/Bundle/ChillMainBundle/Controller/CountryController.php +++ b/src/Bundle/ChillMainBundle/Controller/CountryController.php @@ -17,6 +17,7 @@ use Symfony\Component\HttpFoundation\Request; class CountryController extends CRUDController { + #[\Override] protected function orderQuery(string $action, $query, Request $request, PaginatorInterface $paginator) { $query->addOrderBy('e.countryCode', 'ASC'); diff --git a/src/Bundle/ChillMainBundle/Controller/LanguageController.php b/src/Bundle/ChillMainBundle/Controller/LanguageController.php index 4e72d8983..0321c507b 100644 --- a/src/Bundle/ChillMainBundle/Controller/LanguageController.php +++ b/src/Bundle/ChillMainBundle/Controller/LanguageController.php @@ -17,6 +17,7 @@ use Symfony\Component\HttpFoundation\Request; class LanguageController extends CRUDController { + #[\Override] protected function orderQuery(string $action, $query, Request $request, PaginatorInterface $paginator) { $query->addOrderBy('e.id', 'ASC'); diff --git a/src/Bundle/ChillMainBundle/Controller/LocationApiController.php b/src/Bundle/ChillMainBundle/Controller/LocationApiController.php index c5b9cd74f..55f3b85cc 100644 --- a/src/Bundle/ChillMainBundle/Controller/LocationApiController.php +++ b/src/Bundle/ChillMainBundle/Controller/LocationApiController.php @@ -21,6 +21,7 @@ use Symfony\Component\HttpFoundation\Request; */ class LocationApiController extends ApiController { + #[\Override] protected function customizeQuery(string $action, Request $request, $query): void { $query @@ -37,6 +38,7 @@ class LocationApiController extends ApiController /** * @param QueryBuilder $query */ + #[\Override] protected function orderQuery(string $action, $query, Request $request, PaginatorInterface $paginator, $_format) { return $query diff --git a/src/Bundle/ChillMainBundle/Controller/LocationController.php b/src/Bundle/ChillMainBundle/Controller/LocationController.php index 78a4f7ba3..0c0ed5f74 100644 --- a/src/Bundle/ChillMainBundle/Controller/LocationController.php +++ b/src/Bundle/ChillMainBundle/Controller/LocationController.php @@ -17,6 +17,7 @@ use Symfony\Component\HttpFoundation\Request; class LocationController extends CRUDController { + #[\Override] protected function createEntity(string $action, Request $request): object { $entity = parent::createEntity($action, $request); @@ -26,11 +27,13 @@ class LocationController extends CRUDController return $entity; } + #[\Override] protected function customizeQuery(string $action, Request $request, $query): void { $query->where('e.availableForUsers = TRUE'); } + #[\Override] protected function orderQuery(string $action, $query, Request $request, PaginatorInterface $paginator) { return $query->addOrderBy('e.name', 'DESC'); diff --git a/src/Bundle/ChillMainBundle/Controller/LocationTypeApiController.php b/src/Bundle/ChillMainBundle/Controller/LocationTypeApiController.php index bd86d72dd..282b13e33 100644 --- a/src/Bundle/ChillMainBundle/Controller/LocationTypeApiController.php +++ b/src/Bundle/ChillMainBundle/Controller/LocationTypeApiController.php @@ -19,6 +19,7 @@ use Symfony\Component\HttpFoundation\Request; */ class LocationTypeApiController extends ApiController { + #[\Override] public function customizeQuery(string $action, Request $request, $query): void { $query->andWhere( diff --git a/src/Bundle/ChillMainBundle/Controller/NewsItemController.php b/src/Bundle/ChillMainBundle/Controller/NewsItemController.php index a94dd55b9..ed12a8198 100644 --- a/src/Bundle/ChillMainBundle/Controller/NewsItemController.php +++ b/src/Bundle/ChillMainBundle/Controller/NewsItemController.php @@ -17,6 +17,7 @@ use Symfony\Component\HttpFoundation\Request; class NewsItemController extends CRUDController { + #[\Override] protected function orderQuery(string $action, $query, Request $request, PaginatorInterface $paginator) { $query->addOrderBy('e.startDate', 'DESC'); diff --git a/src/Bundle/ChillMainBundle/Controller/PostalCodeAPIController.php b/src/Bundle/ChillMainBundle/Controller/PostalCodeAPIController.php index cd13ad455..599ac9d98 100644 --- a/src/Bundle/ChillMainBundle/Controller/PostalCodeAPIController.php +++ b/src/Bundle/ChillMainBundle/Controller/PostalCodeAPIController.php @@ -70,6 +70,7 @@ final class PostalCodeAPIController extends ApiController ); } + #[\Override] protected function customizeQuery(string $action, Request $request, $qb): void { if ($request->query->has('country')) { diff --git a/src/Bundle/ChillMainBundle/Controller/RegroupmentController.php b/src/Bundle/ChillMainBundle/Controller/RegroupmentController.php index c73b03027..607ac81d3 100644 --- a/src/Bundle/ChillMainBundle/Controller/RegroupmentController.php +++ b/src/Bundle/ChillMainBundle/Controller/RegroupmentController.php @@ -17,6 +17,7 @@ use Symfony\Component\HttpFoundation\Request; class RegroupmentController extends CRUDController { + #[\Override] protected function orderQuery(string $action, $query, Request $request, PaginatorInterface $paginator) { $query->addOrderBy('e.id', 'ASC'); diff --git a/src/Bundle/ChillMainBundle/Controller/ScopeApiController.php b/src/Bundle/ChillMainBundle/Controller/ScopeApiController.php index 85041f0f3..439d6134f 100644 --- a/src/Bundle/ChillMainBundle/Controller/ScopeApiController.php +++ b/src/Bundle/ChillMainBundle/Controller/ScopeApiController.php @@ -16,6 +16,7 @@ use Symfony\Component\HttpFoundation\Request; class ScopeApiController extends ApiController { + #[\Override] protected function customizeQuery(string $action, Request $request, $query): void { if ('_index' === $action) { diff --git a/src/Bundle/ChillMainBundle/Controller/UserApiController.php b/src/Bundle/ChillMainBundle/Controller/UserApiController.php index 262bfdfde..0e1d5d2bf 100644 --- a/src/Bundle/ChillMainBundle/Controller/UserApiController.php +++ b/src/Bundle/ChillMainBundle/Controller/UserApiController.php @@ -53,6 +53,7 @@ class UserApiController extends ApiController /** * @param QueryBuilder $query */ + #[\Override] protected function customizeQuery(string $action, Request $request, $query): void { if ('_index' === $action) { @@ -60,6 +61,7 @@ class UserApiController extends ApiController } } + #[\Override] protected function orderQuery(string $action, $query, Request $request, PaginatorInterface $paginator, $_format) { return $query->orderBy('e.label', 'ASC'); diff --git a/src/Bundle/ChillMainBundle/Controller/UserController.php b/src/Bundle/ChillMainBundle/Controller/UserController.php index cc1666494..4b2e0597d 100644 --- a/src/Bundle/ChillMainBundle/Controller/UserController.php +++ b/src/Bundle/ChillMainBundle/Controller/UserController.php @@ -36,7 +36,7 @@ use Symfony\Contracts\Translation\TranslatorInterface; class UserController extends CRUDController { - final public const FORM_GROUP_CENTER_COMPOSED = 'composed_groupcenter'; + final public const string FORM_GROUP_CENTER_COMPOSED = 'composed_groupcenter'; public function __construct( private readonly LoggerInterface $logger, @@ -132,6 +132,7 @@ class UserController extends CRUDController return $this->redirectToRoute('chill_crud_admin_user_edit', ['id' => $uid]); } + #[\Override] public function edit(Request $request, $id): Response { $action = 'edit'; @@ -259,6 +260,7 @@ class UserController extends CRUDController ]); } + #[\Override] protected function buildFilterOrderHelper(string $action, Request $request): ?FilterOrderHelper { return $this->getFilterOrderHelperFactory() @@ -267,6 +269,7 @@ class UserController extends CRUDController ->build(); } + #[\Override] protected function countEntities(string $action, Request $request, ?FilterOrderHelper $filterOrder = null): int { if (!$filterOrder instanceof FilterOrderHelper) { @@ -280,6 +283,7 @@ class UserController extends CRUDController return $this->userRepository->countByUsernameOrEmail($filterOrder->getQueryString()); } + #[\Override] protected function createFormFor(string $action, $entity, ?string $formClass = null, array $formOptions = []): FormInterface { // for "new", add special config @@ -293,6 +297,7 @@ class UserController extends CRUDController return parent::createFormFor($action, $entity, $formClass, $formOptions); } + #[\Override] protected function generateTemplateParameter(string $action, $entity, Request $request, array $defaultTemplateParameters = []) { // add mini-forms for edit action @@ -319,6 +324,7 @@ class UserController extends CRUDController return parent::generateTemplateParameter($action, $entity, $request, $defaultTemplateParameters); } + #[\Override] protected function getQueryResult( string $action, Request $request, @@ -346,6 +352,7 @@ class UserController extends CRUDController ); } + #[\Override] protected function onPrePersist(string $action, $entity, FormInterface $form, Request $request) { // for "new", encode the password @@ -358,6 +365,7 @@ class UserController extends CRUDController parent::onPrePersist($action, $entity, $form, $request); } + #[\Override] protected function orderQuery(string $action, $query, Request $request, PaginatorInterface $paginator) { $query diff --git a/src/Bundle/ChillMainBundle/Controller/UserJobApiController.php b/src/Bundle/ChillMainBundle/Controller/UserJobApiController.php index 1b0dbbf5f..8d2251def 100644 --- a/src/Bundle/ChillMainBundle/Controller/UserJobApiController.php +++ b/src/Bundle/ChillMainBundle/Controller/UserJobApiController.php @@ -16,6 +16,7 @@ use Symfony\Component\HttpFoundation\Request; class UserJobApiController extends ApiController { + #[\Override] protected function customizeQuery(string $action, Request $request, $query): void { if ('_index' === $action) { diff --git a/src/Bundle/ChillMainBundle/Controller/UserJobController.php b/src/Bundle/ChillMainBundle/Controller/UserJobController.php index 098b6ff29..61d7ed7fe 100644 --- a/src/Bundle/ChillMainBundle/Controller/UserJobController.php +++ b/src/Bundle/ChillMainBundle/Controller/UserJobController.php @@ -17,6 +17,7 @@ use Symfony\Component\HttpFoundation\Request; class UserJobController extends CRUDController { + #[\Override] protected function orderQuery(string $action, $query, Request $request, PaginatorInterface $paginator) { $query->addOrderBy('e.id', 'ASC'); diff --git a/src/Bundle/ChillMainBundle/Cron/CronManager.php b/src/Bundle/ChillMainBundle/Cron/CronManager.php index ded78903d..d76de348c 100644 --- a/src/Bundle/ChillMainBundle/Cron/CronManager.php +++ b/src/Bundle/ChillMainBundle/Cron/CronManager.php @@ -39,13 +39,13 @@ use Psr\Log\LoggerInterface; */ final readonly class CronManager implements CronManagerInterface { - private const LOG_PREFIX = '[cron manager] '; + private const string LOG_PREFIX = '[cron manager] '; - private const UPDATE_AFTER_EXEC = 'UPDATE '.CronJobExecution::class.' cr SET cr.lastEnd = :now, cr.lastStatus = :status WHERE cr.key = :key'; + private const string UPDATE_AFTER_EXEC = 'UPDATE '.CronJobExecution::class.' cr SET cr.lastEnd = :now, cr.lastStatus = :status WHERE cr.key = :key'; - private const UPDATE_BEFORE_EXEC = 'UPDATE '.CronJobExecution::class.' cr SET cr.lastStart = :now WHERE cr.key = :key'; + private const string UPDATE_BEFORE_EXEC = 'UPDATE '.CronJobExecution::class.' cr SET cr.lastStart = :now WHERE cr.key = :key'; - private const UPDATE_LAST_EXECUTION_DATA = 'UPDATE '.CronJobExecution::class.' cr SET cr.lastExecutionData = :data WHERE cr.key = :key'; + private const string UPDATE_LAST_EXECUTION_DATA = 'UPDATE '.CronJobExecution::class.' cr SET cr.lastExecutionData = :data WHERE cr.key = :key'; /** * @param CronJobInterface[] $jobs @@ -57,6 +57,7 @@ final readonly class CronManager implements CronManagerInterface private LoggerInterface $logger ) {} + #[\Override] public function run(?string $forceJob = null): void { if (null !== $forceJob) { diff --git a/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadAddressReferences.php b/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadAddressReferences.php index d04ef29e8..12e4c0d37 100644 --- a/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadAddressReferences.php +++ b/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadAddressReferences.php @@ -33,11 +33,13 @@ class LoadAddressReferences extends AbstractFixture implements ContainerAwareInt $this->faker = \Faker\Factory::create('fr_FR'); } + #[\Override] public function getOrder() { return 51; } + #[\Override] public function load(ObjectManager $manager) { echo "loading some reference address... \n"; @@ -50,6 +52,7 @@ class LoadAddressReferences extends AbstractFixture implements ContainerAwareInt $manager->flush(); } + #[\Override] public function setContainer(?ContainerInterface $container = null) { $this->container = $container; diff --git a/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadCenters.php b/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadCenters.php index d835aad38..1b7903418 100644 --- a/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadCenters.php +++ b/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadCenters.php @@ -31,11 +31,13 @@ class LoadCenters extends AbstractFixture implements OrderedFixtureInterface public static $refs = []; + #[\Override] public function getOrder() { return 100; } + #[\Override] public function load(ObjectManager $manager) { foreach (static::$centers as $new) { diff --git a/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadCivility.php b/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadCivility.php index d9893f394..b68dd81a8 100644 --- a/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadCivility.php +++ b/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadCivility.php @@ -18,11 +18,13 @@ use Doctrine\Persistence\ObjectManager; class LoadCivility extends Fixture implements FixtureGroupInterface { + #[\Override] public static function getGroups(): array { return ['civilities']; } + #[\Override] public function load(ObjectManager $manager): void { $civilities = [ diff --git a/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadCountries.php b/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadCountries.php index 3433eebd7..a5dc56843 100644 --- a/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadCountries.php +++ b/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadCountries.php @@ -25,11 +25,13 @@ class LoadCountries extends AbstractFixture implements ContainerAwareInterface, { private ?ContainerInterface $container = null; + #[\Override] public function getOrder() { return 20; } + #[\Override] public function load(ObjectManager $manager) { echo "loading countries... \n"; @@ -43,6 +45,7 @@ class LoadCountries extends AbstractFixture implements ContainerAwareInterface, $manager->flush(); } + #[\Override] public function setContainer(?ContainerInterface $container = null) { $this->container = $container; diff --git a/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadGroupCenters.php b/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadGroupCenters.php index 8254dec1d..bb88530fe 100644 --- a/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadGroupCenters.php +++ b/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadGroupCenters.php @@ -20,11 +20,13 @@ class LoadGroupCenters extends AbstractFixture implements OrderedFixtureInterfac { public static $refs = []; + #[\Override] public function getOrder() { return 500; } + #[\Override] public function load(ObjectManager $manager) { foreach (LoadCenters::$refs as $centerRef) { diff --git a/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadLanguages.php b/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadLanguages.php index c5c03277f..a1e87899d 100644 --- a/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadLanguages.php +++ b/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadLanguages.php @@ -33,11 +33,13 @@ class LoadLanguages extends AbstractFixture implements ContainerAwareInterface, // This array contains regional code to not exclude private array $regionalVersionToInclude = ['ro_MD']; + #[\Override] public function getOrder() { return 10; } + #[\Override] public function load(ObjectManager $manager) { echo "loading languages... \n"; @@ -57,6 +59,7 @@ class LoadLanguages extends AbstractFixture implements ContainerAwareInterface, $manager->flush(); } + #[\Override] public function setContainer(?ContainerInterface $container = null) { $this->container = $container; diff --git a/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadLocationType.php b/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadLocationType.php index aab896add..1bdd28757 100644 --- a/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadLocationType.php +++ b/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadLocationType.php @@ -25,11 +25,13 @@ class LoadLocationType extends AbstractFixture implements ContainerAwareInterfac { private ?ContainerInterface $container = null; + #[\Override] public function getOrder() { return 52; } + #[\Override] public function load(ObjectManager $manager): void { echo "loading some location type... \n"; @@ -65,6 +67,7 @@ class LoadLocationType extends AbstractFixture implements ContainerAwareInterfac $manager->flush(); } + #[\Override] public function setContainer(?ContainerInterface $container = null) { $this->container = $container; diff --git a/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadPermissionsGroup.php b/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadPermissionsGroup.php index 885fc9af6..f901e5a16 100644 --- a/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadPermissionsGroup.php +++ b/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadPermissionsGroup.php @@ -47,11 +47,13 @@ class LoadPermissionsGroup extends AbstractFixture implements OrderedFixtureInte public static $refs = []; + #[\Override] public function getOrder() { return 400; } + #[\Override] public function load(ObjectManager $manager) { foreach (static::$permissionGroup as $new) { diff --git a/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadPostalCodes.php b/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadPostalCodes.php index 29ee21ca6..407aaa662 100644 --- a/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadPostalCodes.php +++ b/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadPostalCodes.php @@ -325,11 +325,13 @@ class LoadPostalCodes extends AbstractFixture implements OrderedFixtureInterface 85800,GIVRAND,FR,85100,46.6822701061,-1.8787272243,INSEE EOF; + #[\Override] public function getOrder() { return 50; } + #[\Override] public function load(ObjectManager $manager) { echo "loading postal codes... \n"; diff --git a/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadRoleScopes.php b/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadRoleScopes.php index 85e3f4ec2..9d3dda324 100644 --- a/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadRoleScopes.php +++ b/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadRoleScopes.php @@ -44,11 +44,13 @@ class LoadRoleScopes extends AbstractFixture implements OrderedFixtureInterface public static $references = []; + #[\Override] public function getOrder() { return 300; } + #[\Override] public function load(ObjectManager $manager) { foreach (static::$permissions as $key => $permission) { diff --git a/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadScopes.php b/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadScopes.php index 10c10de8c..d58a309c4 100644 --- a/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadScopes.php +++ b/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadScopes.php @@ -46,11 +46,13 @@ class LoadScopes extends AbstractFixture implements OrderedFixtureInterface ], ]; + #[\Override] public function getOrder() { return 200; } + #[\Override] public function load(ObjectManager $manager) { foreach ($this->scopes as $new) { diff --git a/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadUsers.php b/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadUsers.php index 1c99a3a74..ca1e91ca1 100644 --- a/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadUsers.php +++ b/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadUsers.php @@ -54,11 +54,13 @@ class LoadUsers extends AbstractFixture implements ContainerAwareInterface, Orde private ?ContainerInterface $container = null; + #[\Override] public function getOrder() { return 1000; } + #[\Override] public function load(ObjectManager $manager) { foreach (self::$refs as $username => $params) { @@ -91,6 +93,7 @@ class LoadUsers extends AbstractFixture implements ContainerAwareInterface, Orde $manager->flush(); } + #[\Override] public function setContainer(?ContainerInterface $container = null) { if (null === $container) { diff --git a/src/Bundle/ChillMainBundle/DependencyInjection/ChillMainExtension.php b/src/Bundle/ChillMainBundle/DependencyInjection/ChillMainExtension.php index 4dde2076c..f3cdbf02a 100644 --- a/src/Bundle/ChillMainBundle/DependencyInjection/ChillMainExtension.php +++ b/src/Bundle/ChillMainBundle/DependencyInjection/ChillMainExtension.php @@ -94,11 +94,13 @@ class ChillMainExtension extends Extension implements */ protected $widgetFactories = []; + #[\Override] public function addWidgetFactory(WidgetFactoryInterface $factory) { $this->widgetFactories[] = $factory; } + #[\Override] public function getConfiguration(array $config, ContainerBuilder $container): Configuration { return new Configuration($this->widgetFactories, $container); @@ -107,6 +109,7 @@ class ChillMainExtension extends Extension implements /** * @return WidgetFactoryInterface[] */ + #[\Override] public function getWidgetFactories() { return $this->widgetFactories; @@ -115,6 +118,7 @@ class ChillMainExtension extends Extension implements /** * @throws \Exception */ + #[\Override] public function load(array $configs, ContainerBuilder $container) { // configuration for main bundle @@ -224,6 +228,7 @@ class ChillMainExtension extends Extension implements // $this->configureSms($config['short_messages'], $container, $loader); } + #[\Override] public function prepend(ContainerBuilder $container) { // add installation_name and date_format to globals diff --git a/src/Bundle/ChillMainBundle/DependencyInjection/CompilerPass/ACLFlagsCompilerPass.php b/src/Bundle/ChillMainBundle/DependencyInjection/CompilerPass/ACLFlagsCompilerPass.php index 6518d6115..da415440f 100644 --- a/src/Bundle/ChillMainBundle/DependencyInjection/CompilerPass/ACLFlagsCompilerPass.php +++ b/src/Bundle/ChillMainBundle/DependencyInjection/CompilerPass/ACLFlagsCompilerPass.php @@ -18,6 +18,7 @@ use Symfony\Component\DependencyInjection\Reference; class ACLFlagsCompilerPass implements CompilerPassInterface { + #[\Override] public function process(ContainerBuilder $container) { $permissionGroupType = $container->getDefinition(PermissionsGroupType::class); diff --git a/src/Bundle/ChillMainBundle/DependencyInjection/CompilerPass/ExportsCompilerPass.php b/src/Bundle/ChillMainBundle/DependencyInjection/CompilerPass/ExportsCompilerPass.php index dbd79c0f4..506a0e5a8 100644 --- a/src/Bundle/ChillMainBundle/DependencyInjection/CompilerPass/ExportsCompilerPass.php +++ b/src/Bundle/ChillMainBundle/DependencyInjection/CompilerPass/ExportsCompilerPass.php @@ -28,6 +28,7 @@ use Symfony\Component\DependencyInjection\Reference; */ class ExportsCompilerPass implements CompilerPassInterface { + #[\Override] public function process(ContainerBuilder $container) { if (!$container->has(ExportManager::class)) { diff --git a/src/Bundle/ChillMainBundle/DependencyInjection/CompilerPass/MenuCompilerPass.php b/src/Bundle/ChillMainBundle/DependencyInjection/CompilerPass/MenuCompilerPass.php index a91436d3b..2117edf33 100644 --- a/src/Bundle/ChillMainBundle/DependencyInjection/CompilerPass/MenuCompilerPass.php +++ b/src/Bundle/ChillMainBundle/DependencyInjection/CompilerPass/MenuCompilerPass.php @@ -18,6 +18,7 @@ use Symfony\Component\DependencyInjection\Reference; class MenuCompilerPass implements CompilerPassInterface { + #[\Override] public function process(ContainerBuilder $container) { if (!$container->hasDefinition('chill.main.menu_composer')) { diff --git a/src/Bundle/ChillMainBundle/DependencyInjection/CompilerPass/NotificationCounterCompilerPass.php b/src/Bundle/ChillMainBundle/DependencyInjection/CompilerPass/NotificationCounterCompilerPass.php index a0ea00e8a..cbd441e4d 100644 --- a/src/Bundle/ChillMainBundle/DependencyInjection/CompilerPass/NotificationCounterCompilerPass.php +++ b/src/Bundle/ChillMainBundle/DependencyInjection/CompilerPass/NotificationCounterCompilerPass.php @@ -18,6 +18,7 @@ use Symfony\Component\DependencyInjection\Reference; class NotificationCounterCompilerPass implements CompilerPassInterface { + #[\Override] public function process(ContainerBuilder $container) { if (!$container->hasDefinition(CountNotificationUser::class)) { diff --git a/src/Bundle/ChillMainBundle/DependencyInjection/CompilerPass/SearchableServicesCompilerPass.php b/src/Bundle/ChillMainBundle/DependencyInjection/CompilerPass/SearchableServicesCompilerPass.php index ee305f964..0a34f1951 100644 --- a/src/Bundle/ChillMainBundle/DependencyInjection/CompilerPass/SearchableServicesCompilerPass.php +++ b/src/Bundle/ChillMainBundle/DependencyInjection/CompilerPass/SearchableServicesCompilerPass.php @@ -22,6 +22,7 @@ class SearchableServicesCompilerPass implements CompilerPassInterface * * @see \Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface::process() */ + #[\Override] public function process(ContainerBuilder $container) { if (!$container->hasDefinition('chill_main.search_provider')) { diff --git a/src/Bundle/ChillMainBundle/DependencyInjection/CompilerPass/ShortMessageCompilerPass.php b/src/Bundle/ChillMainBundle/DependencyInjection/CompilerPass/ShortMessageCompilerPass.php index 9da9154b3..a8ed23042 100644 --- a/src/Bundle/ChillMainBundle/DependencyInjection/CompilerPass/ShortMessageCompilerPass.php +++ b/src/Bundle/ChillMainBundle/DependencyInjection/CompilerPass/ShortMessageCompilerPass.php @@ -31,6 +31,7 @@ use Symfony\Component\DependencyInjection\Reference; class ShortMessageCompilerPass implements CompilerPassInterface { + #[\Override] public function process(ContainerBuilder $container) { $config = $container->resolveEnvPlaceholders($container->getParameter('chill_main.short_messages'), true); diff --git a/src/Bundle/ChillMainBundle/DependencyInjection/CompilerPass/TimelineCompilerClass.php b/src/Bundle/ChillMainBundle/DependencyInjection/CompilerPass/TimelineCompilerClass.php index 28ef7a991..7741d6a4d 100644 --- a/src/Bundle/ChillMainBundle/DependencyInjection/CompilerPass/TimelineCompilerClass.php +++ b/src/Bundle/ChillMainBundle/DependencyInjection/CompilerPass/TimelineCompilerClass.php @@ -21,6 +21,7 @@ use Symfony\Component\DependencyInjection\Reference; */ class TimelineCompilerClass implements CompilerPassInterface { + #[\Override] public function process(ContainerBuilder $container) { if (!$container->hasDefinition('chill_main.timeline_builder')) { diff --git a/src/Bundle/ChillMainBundle/DependencyInjection/CompilerPass/WidgetsCompilerPass.php b/src/Bundle/ChillMainBundle/DependencyInjection/CompilerPass/WidgetsCompilerPass.php index 198d44db1..451edebb8 100644 --- a/src/Bundle/ChillMainBundle/DependencyInjection/CompilerPass/WidgetsCompilerPass.php +++ b/src/Bundle/ChillMainBundle/DependencyInjection/CompilerPass/WidgetsCompilerPass.php @@ -19,6 +19,7 @@ use Symfony\Component\DependencyInjection\ContainerBuilder; */ class WidgetsCompilerPass extends AbstractWidgetsCompilerPass { + #[\Override] public function process(ContainerBuilder $container) { $this->doProcess($container, 'chill_main', 'chill_main.widgets'); diff --git a/src/Bundle/ChillMainBundle/DependencyInjection/ConfigConsistencyCompilerPass.php b/src/Bundle/ChillMainBundle/DependencyInjection/ConfigConsistencyCompilerPass.php index 202d6f468..716959fdf 100644 --- a/src/Bundle/ChillMainBundle/DependencyInjection/ConfigConsistencyCompilerPass.php +++ b/src/Bundle/ChillMainBundle/DependencyInjection/ConfigConsistencyCompilerPass.php @@ -19,6 +19,7 @@ use Symfony\Component\DependencyInjection\ContainerBuilder; */ class ConfigConsistencyCompilerPass implements CompilerPassInterface { + #[\Override] public function process(ContainerBuilder $container) { $availableLanguages = $container diff --git a/src/Bundle/ChillMainBundle/DependencyInjection/Configuration.php b/src/Bundle/ChillMainBundle/DependencyInjection/Configuration.php index 8bd3e35f4..b02d57bbb 100644 --- a/src/Bundle/ChillMainBundle/DependencyInjection/Configuration.php +++ b/src/Bundle/ChillMainBundle/DependencyInjection/Configuration.php @@ -31,6 +31,7 @@ class Configuration implements ConfigurationInterface $this->setWidgetFactories($widgetFactories); } + #[\Override] public function getConfigTreeBuilder() { $treeBuilder = new TreeBuilder('chill_main'); diff --git a/src/Bundle/ChillMainBundle/DependencyInjection/Widget/Factory/AbstractWidgetFactory.php b/src/Bundle/ChillMainBundle/DependencyInjection/Widget/Factory/AbstractWidgetFactory.php index b0c14f27e..4f784ee3c 100644 --- a/src/Bundle/ChillMainBundle/DependencyInjection/Widget/Factory/AbstractWidgetFactory.php +++ b/src/Bundle/ChillMainBundle/DependencyInjection/Widget/Factory/AbstractWidgetFactory.php @@ -34,6 +34,7 @@ abstract class AbstractWidgetFactory implements WidgetFactoryInterface * * @see \Chill\MainBundle\DependencyInjection\Widget\Factory\WidgetFactoryInterface::createDefinition() */ + #[\Override] public function createDefinition(ContainerBuilder $containerBuilder, $place, $order, array $config) { return $containerBuilder->getDefinition( diff --git a/src/Bundle/ChillMainBundle/Doctrine/DQL/Age.php b/src/Bundle/ChillMainBundle/Doctrine/DQL/Age.php index cce2f9ba4..40f61a7ba 100644 --- a/src/Bundle/ChillMainBundle/Doctrine/DQL/Age.php +++ b/src/Bundle/ChillMainBundle/Doctrine/DQL/Age.php @@ -21,6 +21,7 @@ class Age extends FunctionNode private mixed $value2 = null; + #[\Override] public function getSql(SqlWalker $sqlWalker) { if (null !== $this->value2) { @@ -37,6 +38,7 @@ class Age extends FunctionNode ); } + #[\Override] public function parse(Parser $parser) { $parser->match(\Doctrine\ORM\Query\TokenType::T_IDENTIFIER); diff --git a/src/Bundle/ChillMainBundle/Doctrine/DQL/Extract.php b/src/Bundle/ChillMainBundle/Doctrine/DQL/Extract.php index bc6134c60..20003dc6f 100644 --- a/src/Bundle/ChillMainBundle/Doctrine/DQL/Extract.php +++ b/src/Bundle/ChillMainBundle/Doctrine/DQL/Extract.php @@ -33,6 +33,7 @@ class Extract extends FunctionNode // private FunctionNode $value; // private DateDiffFunction $value; + #[\Override] public function getSql(SqlWalker $sqlWalker) { return sprintf( @@ -42,6 +43,7 @@ class Extract extends FunctionNode ); } + #[\Override] public function parse(Parser $parser) { $parser->match(\Doctrine\ORM\Query\TokenType::T_IDENTIFIER); diff --git a/src/Bundle/ChillMainBundle/Doctrine/DQL/GetJsonFieldByKey.php b/src/Bundle/ChillMainBundle/Doctrine/DQL/GetJsonFieldByKey.php index 56b2a9cda..74ebf577d 100644 --- a/src/Bundle/ChillMainBundle/Doctrine/DQL/GetJsonFieldByKey.php +++ b/src/Bundle/ChillMainBundle/Doctrine/DQL/GetJsonFieldByKey.php @@ -21,6 +21,7 @@ class GetJsonFieldByKey extends FunctionNode private ?\Doctrine\ORM\Query\AST\Node $expr2 = null; + #[\Override] public function getSql(SqlWalker $sqlWalker) { return sprintf( @@ -30,6 +31,7 @@ class GetJsonFieldByKey extends FunctionNode ); } + #[\Override] public function parse(Parser $parser) { $parser->match(\Doctrine\ORM\Query\TokenType::T_IDENTIFIER); diff --git a/src/Bundle/ChillMainBundle/Doctrine/DQL/Greatest.php b/src/Bundle/ChillMainBundle/Doctrine/DQL/Greatest.php index 6467b93c5..11bfe22cf 100644 --- a/src/Bundle/ChillMainBundle/Doctrine/DQL/Greatest.php +++ b/src/Bundle/ChillMainBundle/Doctrine/DQL/Greatest.php @@ -30,11 +30,13 @@ class Greatest extends FunctionNode */ private array $exprs = []; + #[\Override] public function getSql(SqlWalker $sqlWalker) { return 'GREATEST('.implode(', ', array_map(static fn (Node $expr) => $expr->dispatch($sqlWalker), $this->exprs)).')'; } + #[\Override] public function parse(Parser $parser) { $this->exprs = []; diff --git a/src/Bundle/ChillMainBundle/Doctrine/DQL/JsonAggregate.php b/src/Bundle/ChillMainBundle/Doctrine/DQL/JsonAggregate.php index 171b069d3..5a46b9ba8 100644 --- a/src/Bundle/ChillMainBundle/Doctrine/DQL/JsonAggregate.php +++ b/src/Bundle/ChillMainBundle/Doctrine/DQL/JsonAggregate.php @@ -25,11 +25,13 @@ class JsonAggregate extends FunctionNode { private ?\Doctrine\ORM\Query\AST\Node $expr = null; + #[\Override] public function getSql(SqlWalker $sqlWalker) { return sprintf('jsonb_agg(%s)', $this->expr->dispatch($sqlWalker)); } + #[\Override] public function parse(Parser $parser) { $parser->match(\Doctrine\ORM\Query\TokenType::T_IDENTIFIER); diff --git a/src/Bundle/ChillMainBundle/Doctrine/DQL/JsonBuildObject.php b/src/Bundle/ChillMainBundle/Doctrine/DQL/JsonBuildObject.php index ea6ea4c53..f17e3729c 100644 --- a/src/Bundle/ChillMainBundle/Doctrine/DQL/JsonBuildObject.php +++ b/src/Bundle/ChillMainBundle/Doctrine/DQL/JsonBuildObject.php @@ -29,11 +29,13 @@ class JsonBuildObject extends FunctionNode */ private array $exprs = []; + #[\Override] public function getSql(SqlWalker $sqlWalker) { return 'JSONB_BUILD_OBJECT('.implode(', ', array_map(static fn (Node $expr) => $expr->dispatch($sqlWalker), $this->exprs)).')'; } + #[\Override] public function parse(Parser $parser) { $lexer = $parser->getLexer(); diff --git a/src/Bundle/ChillMainBundle/Doctrine/DQL/JsonExtract.php b/src/Bundle/ChillMainBundle/Doctrine/DQL/JsonExtract.php index 7abf15972..3140b06d7 100644 --- a/src/Bundle/ChillMainBundle/Doctrine/DQL/JsonExtract.php +++ b/src/Bundle/ChillMainBundle/Doctrine/DQL/JsonExtract.php @@ -21,11 +21,13 @@ class JsonExtract extends FunctionNode private ?\Doctrine\ORM\Query\AST\ArithmeticExpression $keyToExtract = null; + #[\Override] public function getSql(SqlWalker $sqlWalker) { return sprintf('%s->>%s', $this->element->dispatch($sqlWalker), $this->keyToExtract->dispatch($sqlWalker)); } + #[\Override] public function parse(Parser $parser) { $parser->match(\Doctrine\ORM\Query\TokenType::T_IDENTIFIER); diff --git a/src/Bundle/ChillMainBundle/Doctrine/DQL/JsonbArrayLength.php b/src/Bundle/ChillMainBundle/Doctrine/DQL/JsonbArrayLength.php index 84f991fe8..d75ae2dd6 100644 --- a/src/Bundle/ChillMainBundle/Doctrine/DQL/JsonbArrayLength.php +++ b/src/Bundle/ChillMainBundle/Doctrine/DQL/JsonbArrayLength.php @@ -22,6 +22,7 @@ class JsonbArrayLength extends FunctionNode { private ?\Doctrine\ORM\Query\AST\Node $expr1 = null; + #[\Override] public function getSql(SqlWalker $sqlWalker): string { return sprintf( @@ -30,6 +31,7 @@ class JsonbArrayLength extends FunctionNode ); } + #[\Override] public function parse(Parser $parser): void { $parser->match(\Doctrine\ORM\Query\TokenType::T_IDENTIFIER); diff --git a/src/Bundle/ChillMainBundle/Doctrine/DQL/JsonbExistsInArray.php b/src/Bundle/ChillMainBundle/Doctrine/DQL/JsonbExistsInArray.php index 4c6d901d5..c2a1afa89 100644 --- a/src/Bundle/ChillMainBundle/Doctrine/DQL/JsonbExistsInArray.php +++ b/src/Bundle/ChillMainBundle/Doctrine/DQL/JsonbExistsInArray.php @@ -21,6 +21,7 @@ class JsonbExistsInArray extends FunctionNode private ?\Doctrine\ORM\Query\AST\InputParameter $expr2 = null; + #[\Override] public function getSql(SqlWalker $sqlWalker): string { return sprintf( @@ -30,6 +31,7 @@ class JsonbExistsInArray extends FunctionNode ); } + #[\Override] public function parse(Parser $parser): void { $parser->match(\Doctrine\ORM\Query\TokenType::T_IDENTIFIER); diff --git a/src/Bundle/ChillMainBundle/Doctrine/DQL/Least.php b/src/Bundle/ChillMainBundle/Doctrine/DQL/Least.php index aa6844e88..d4a4aacde 100644 --- a/src/Bundle/ChillMainBundle/Doctrine/DQL/Least.php +++ b/src/Bundle/ChillMainBundle/Doctrine/DQL/Least.php @@ -30,11 +30,13 @@ class Least extends FunctionNode */ private array $exprs = []; + #[\Override] public function getSql(SqlWalker $sqlWalker) { return 'LEAST('.implode(', ', array_map(static fn (Node $expr) => $expr->dispatch($sqlWalker), $this->exprs)).')'; } + #[\Override] public function parse(Parser $parser) { $this->exprs = []; diff --git a/src/Bundle/ChillMainBundle/Doctrine/DQL/OverlapsI.php b/src/Bundle/ChillMainBundle/Doctrine/DQL/OverlapsI.php index edf00243f..6bd8074cd 100644 --- a/src/Bundle/ChillMainBundle/Doctrine/DQL/OverlapsI.php +++ b/src/Bundle/ChillMainBundle/Doctrine/DQL/OverlapsI.php @@ -31,6 +31,7 @@ class OverlapsI extends FunctionNode private ?\Doctrine\ORM\Query\AST\Node $secondPeriodStart = null; + #[\Override] public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker) { return sprintf( @@ -42,6 +43,7 @@ class OverlapsI extends FunctionNode ); } + #[\Override] public function parse(Parser $parser): void { $parser->match(\Doctrine\ORM\Query\TokenType::T_IDENTIFIER); diff --git a/src/Bundle/ChillMainBundle/Doctrine/DQL/Replace.php b/src/Bundle/ChillMainBundle/Doctrine/DQL/Replace.php index d4c317f39..7a0bd9a5c 100644 --- a/src/Bundle/ChillMainBundle/Doctrine/DQL/Replace.php +++ b/src/Bundle/ChillMainBundle/Doctrine/DQL/Replace.php @@ -21,6 +21,7 @@ class Replace extends FunctionNode protected $to; + #[\Override] public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker): string { return 'REPLACE('. @@ -32,6 +33,7 @@ class Replace extends FunctionNode ')'; } + #[\Override] public function parse(\Doctrine\ORM\Query\Parser $parser): void { $parser->match(\Doctrine\ORM\Query\TokenType::T_IDENTIFIER); diff --git a/src/Bundle/ChillMainBundle/Doctrine/DQL/STContains.php b/src/Bundle/ChillMainBundle/Doctrine/DQL/STContains.php index 9f3d1b861..13ae943fd 100644 --- a/src/Bundle/ChillMainBundle/Doctrine/DQL/STContains.php +++ b/src/Bundle/ChillMainBundle/Doctrine/DQL/STContains.php @@ -22,12 +22,14 @@ class STContains extends FunctionNode private ?\Doctrine\ORM\Query\AST\Node $secondPart = null; + #[\Override] public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker) { return 'ST_CONTAINS('.$this->firstPart->dispatch($sqlWalker). ', '.$this->secondPart->dispatch($sqlWalker).')'; } + #[\Override] public function parse(\Doctrine\ORM\Query\Parser $parser) { $parser->match(\Doctrine\ORM\Query\TokenType::T_IDENTIFIER); diff --git a/src/Bundle/ChillMainBundle/Doctrine/DQL/STX.php b/src/Bundle/ChillMainBundle/Doctrine/DQL/STX.php index f0d99d837..2df84a76c 100644 --- a/src/Bundle/ChillMainBundle/Doctrine/DQL/STX.php +++ b/src/Bundle/ChillMainBundle/Doctrine/DQL/STX.php @@ -19,11 +19,13 @@ class STX extends FunctionNode { private ?\Doctrine\ORM\Query\AST\ArithmeticExpression $field = null; + #[\Override] public function getSql(SqlWalker $sqlWalker) { return sprintf('ST_X(%s)', $this->field->dispatch($sqlWalker)); } + #[\Override] public function parse(Parser $parser) { $parser->match(\Doctrine\ORM\Query\TokenType::T_IDENTIFIER); diff --git a/src/Bundle/ChillMainBundle/Doctrine/DQL/STY.php b/src/Bundle/ChillMainBundle/Doctrine/DQL/STY.php index 42842605d..c87ad240b 100644 --- a/src/Bundle/ChillMainBundle/Doctrine/DQL/STY.php +++ b/src/Bundle/ChillMainBundle/Doctrine/DQL/STY.php @@ -19,11 +19,13 @@ class STY extends FunctionNode { private ?\Doctrine\ORM\Query\AST\ArithmeticExpression $field = null; + #[\Override] public function getSql(SqlWalker $sqlWalker) { return sprintf('ST_Y(%s)', $this->field->dispatch($sqlWalker)); } + #[\Override] public function parse(Parser $parser) { $parser->match(\Doctrine\ORM\Query\TokenType::T_IDENTIFIER); diff --git a/src/Bundle/ChillMainBundle/Doctrine/DQL/Similarity.php b/src/Bundle/ChillMainBundle/Doctrine/DQL/Similarity.php index 477e0c542..0ccd8e570 100644 --- a/src/Bundle/ChillMainBundle/Doctrine/DQL/Similarity.php +++ b/src/Bundle/ChillMainBundle/Doctrine/DQL/Similarity.php @@ -19,12 +19,14 @@ class Similarity extends FunctionNode private ?\Doctrine\ORM\Query\AST\Node $secondPart = null; + #[\Override] public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker) { return 'SIMILARITY('.$this->firstPart->dispatch($sqlWalker). ', '.$this->secondPart->dispatch($sqlWalker).')'; } + #[\Override] public function parse(\Doctrine\ORM\Query\Parser $parser) { $parser->match(\Doctrine\ORM\Query\TokenType::T_IDENTIFIER); diff --git a/src/Bundle/ChillMainBundle/Doctrine/DQL/StrictWordSimilarityOPS.php b/src/Bundle/ChillMainBundle/Doctrine/DQL/StrictWordSimilarityOPS.php index 0096825a4..1d5f66a5a 100644 --- a/src/Bundle/ChillMainBundle/Doctrine/DQL/StrictWordSimilarityOPS.php +++ b/src/Bundle/ChillMainBundle/Doctrine/DQL/StrictWordSimilarityOPS.php @@ -20,12 +20,14 @@ class StrictWordSimilarityOPS extends \Doctrine\ORM\Query\AST\Functions\Function private ?\Doctrine\ORM\Query\AST\Node $secondPart = null; + #[\Override] public function getSql(SqlWalker $sqlWalker) { return $this->firstPart->dispatch($sqlWalker). ' <<% '.$this->secondPart->dispatch($sqlWalker); } + #[\Override] public function parse(Parser $parser) { $parser->match(\Doctrine\ORM\Query\TokenType::T_IDENTIFIER); diff --git a/src/Bundle/ChillMainBundle/Doctrine/DQL/ToChar.php b/src/Bundle/ChillMainBundle/Doctrine/DQL/ToChar.php index dc73aea92..b9f7a250c 100644 --- a/src/Bundle/ChillMainBundle/Doctrine/DQL/ToChar.php +++ b/src/Bundle/ChillMainBundle/Doctrine/DQL/ToChar.php @@ -24,6 +24,7 @@ class ToChar extends FunctionNode private \Doctrine\ORM\Query\AST\Node|string|null $fmt = null; + #[\Override] public function getSql(SqlWalker $sqlWalker) { return sprintf( @@ -33,6 +34,7 @@ class ToChar extends FunctionNode ); } + #[\Override] public function parse(Parser $parser) { $parser->match(\Doctrine\ORM\Query\TokenType::T_IDENTIFIER); diff --git a/src/Bundle/ChillMainBundle/Doctrine/DQL/Unaccent.php b/src/Bundle/ChillMainBundle/Doctrine/DQL/Unaccent.php index 12a745a0c..dd052cb92 100644 --- a/src/Bundle/ChillMainBundle/Doctrine/DQL/Unaccent.php +++ b/src/Bundle/ChillMainBundle/Doctrine/DQL/Unaccent.php @@ -23,11 +23,13 @@ class Unaccent extends FunctionNode { private ?\Doctrine\ORM\Query\AST\Node $string = null; + #[\Override] public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker) { return 'UNACCENT('.$this->string->dispatch($sqlWalker).')'; } + #[\Override] public function parse(\Doctrine\ORM\Query\Parser $parser) { $parser->match(\Doctrine\ORM\Query\TokenType::T_IDENTIFIER); diff --git a/src/Bundle/ChillMainBundle/Doctrine/Event/TrackCreateUpdateSubscriber.php b/src/Bundle/ChillMainBundle/Doctrine/Event/TrackCreateUpdateSubscriber.php index e6ac2308a..e7b67970e 100644 --- a/src/Bundle/ChillMainBundle/Doctrine/Event/TrackCreateUpdateSubscriber.php +++ b/src/Bundle/ChillMainBundle/Doctrine/Event/TrackCreateUpdateSubscriber.php @@ -23,6 +23,7 @@ class TrackCreateUpdateSubscriber implements EventSubscriber { public function __construct(private readonly Security $security) {} + #[\Override] public function getSubscribedEvents() { return [ diff --git a/src/Bundle/ChillMainBundle/Doctrine/Migrations/VersionComparator.php b/src/Bundle/ChillMainBundle/Doctrine/Migrations/VersionComparator.php index 4c76ba03a..85cb2afe7 100644 --- a/src/Bundle/ChillMainBundle/Doctrine/Migrations/VersionComparator.php +++ b/src/Bundle/ChillMainBundle/Doctrine/Migrations/VersionComparator.php @@ -21,6 +21,7 @@ use Doctrine\Migrations\Version\Version; */ final class VersionComparator implements Comparator { + #[\Override] public function compare(Version $a, Version $b): int { return \strcmp($this->getNumber($a), $this->getNumber($b)); diff --git a/src/Bundle/ChillMainBundle/Doctrine/Model/Point.php b/src/Bundle/ChillMainBundle/Doctrine/Model/Point.php index de6af9625..2401331a0 100644 --- a/src/Bundle/ChillMainBundle/Doctrine/Model/Point.php +++ b/src/Bundle/ChillMainBundle/Doctrine/Model/Point.php @@ -66,6 +66,7 @@ class Point implements \JsonSerializable return $this->lon; } + #[\Override] public function jsonSerialize(): array { return $this->toArrayGeoJson(); diff --git a/src/Bundle/ChillMainBundle/Doctrine/ORM/Hydration/FlatHierarchyEntityHydrator.php b/src/Bundle/ChillMainBundle/Doctrine/ORM/Hydration/FlatHierarchyEntityHydrator.php index 110842a2a..0f1a03ec0 100644 --- a/src/Bundle/ChillMainBundle/Doctrine/ORM/Hydration/FlatHierarchyEntityHydrator.php +++ b/src/Bundle/ChillMainBundle/Doctrine/ORM/Hydration/FlatHierarchyEntityHydrator.php @@ -15,8 +15,9 @@ use Doctrine\ORM\Internal\Hydration\ObjectHydrator; final class FlatHierarchyEntityHydrator extends ObjectHydrator { - public const LIST = 'chill_flat_hierarchy_list'; + public const string LIST = 'chill_flat_hierarchy_list'; + #[\Override] protected function hydrateAllData() { return array_values(iterator_to_array($this->flatListGenerator($this->buildChildrenHashmap(parent::hydrateAllData())))); diff --git a/src/Bundle/ChillMainBundle/Doctrine/Type/NativeDateIntervalType.php b/src/Bundle/ChillMainBundle/Doctrine/Type/NativeDateIntervalType.php index 01de206c8..3269d3ad2 100644 --- a/src/Bundle/ChillMainBundle/Doctrine/Type/NativeDateIntervalType.php +++ b/src/Bundle/ChillMainBundle/Doctrine/Type/NativeDateIntervalType.php @@ -23,6 +23,7 @@ class NativeDateIntervalType extends DateIntervalType { final public const FORMAT = '%rP%YY%MM%DDT%HH%IM%SS'; + #[\Override] public function convertToDatabaseValue($value, AbstractPlatform $platform) { if (null === $value) { @@ -36,6 +37,7 @@ class NativeDateIntervalType extends DateIntervalType throw ConversionException::conversionFailedInvalidType($value, 'string', ['null', 'DateInterval']); } + #[\Override] public function convertToPHPValue($value, AbstractPlatform $platform) { if (null === $value || $value instanceof \DateInterval) { @@ -61,11 +63,13 @@ class NativeDateIntervalType extends DateIntervalType } } + #[\Override] public function getName(): string { return \Doctrine\DBAL\Types\Types::DATEINTERVAL; } + #[\Override] public function getSQLDeclaration(array $fieldDeclaration, AbstractPlatform $platform): string { return 'INTERVAL'; diff --git a/src/Bundle/ChillMainBundle/Doctrine/Type/PointType.php b/src/Bundle/ChillMainBundle/Doctrine/Type/PointType.php index b74ddf875..3a829608d 100644 --- a/src/Bundle/ChillMainBundle/Doctrine/Type/PointType.php +++ b/src/Bundle/ChillMainBundle/Doctrine/Type/PointType.php @@ -21,13 +21,15 @@ use Doctrine\DBAL\Types\Type; */ class PointType extends Type { - final public const POINT = 'point'; + final public const string POINT = 'point'; + #[\Override] public function canRequireSQLConversion() { return true; } + #[\Override] public function convertToDatabaseValue($value, AbstractPlatform $platform) { if (null === $value) { @@ -37,11 +39,13 @@ class PointType extends Type return $value->toWKT(); } + #[\Override] public function convertToDatabaseValueSQL($sqlExpr, AbstractPlatform $platform) { return $sqlExpr; } + #[\Override] public function convertToPHPValue($value, AbstractPlatform $platform): ?Point { if (null === $value) { @@ -51,11 +55,13 @@ class PointType extends Type return Point::fromGeoJson($value); } + #[\Override] public function convertToPHPValueSQL($sqlExpr, $platform) { return 'ST_AsGeoJSON('.$sqlExpr.') '; } + #[\Override] public function getName() { return self::POINT; @@ -64,6 +70,7 @@ class PointType extends Type /** * @return string */ + #[\Override] public function getSQLDeclaration(array $column, AbstractPlatform $platform) { return 'geometry(POINT,'.Point::$SRID.')'; diff --git a/src/Bundle/ChillMainBundle/Entity/Address.php b/src/Bundle/ChillMainBundle/Entity/Address.php index f04783506..dffaf5e5a 100644 --- a/src/Bundle/ChillMainBundle/Entity/Address.php +++ b/src/Bundle/ChillMainBundle/Entity/Address.php @@ -37,19 +37,19 @@ class Address implements TrackCreationInterface, TrackUpdateInterface /** * When an Address does match with the AddressReference. */ - final public const ADDR_REFERENCE_STATUS_MATCH = 'match'; + final public const string ADDR_REFERENCE_STATUS_MATCH = 'match'; /** * When an Address does not match with the AddressReference, and * is pending for a review. */ - final public const ADDR_REFERENCE_STATUS_TO_REVIEW = 'to_review'; + final public const string ADDR_REFERENCE_STATUS_TO_REVIEW = 'to_review'; /** * When an Address does not match with the AddressReference, but * is reviewed. */ - final public const ADDR_REFERENCE_STATUS_REVIEWED = 'reviewed'; + final public const string ADDR_REFERENCE_STATUS_REVIEWED = 'reviewed'; #[Groups(['write'])] #[ORM\ManyToOne(targetEntity: AddressReference::class)] diff --git a/src/Bundle/ChillMainBundle/Entity/Center.php b/src/Bundle/ChillMainBundle/Entity/Center.php index e898fea8c..77e3c6578 100644 --- a/src/Bundle/ChillMainBundle/Entity/Center.php +++ b/src/Bundle/ChillMainBundle/Entity/Center.php @@ -54,6 +54,7 @@ class Center implements HasCenterInterface, \Stringable $this->regroupments = new ArrayCollection(); } + #[\Override] public function __toString(): string { return $this->getName(); @@ -72,6 +73,7 @@ class Center implements HasCenterInterface, \Stringable /** * @return $this|Center */ + #[\Override] public function getCenter() { return $this; diff --git a/src/Bundle/ChillMainBundle/Entity/CronJobExecution.php b/src/Bundle/ChillMainBundle/Entity/CronJobExecution.php index 180a260b8..681c3d45b 100644 --- a/src/Bundle/ChillMainBundle/Entity/CronJobExecution.php +++ b/src/Bundle/ChillMainBundle/Entity/CronJobExecution.php @@ -17,9 +17,9 @@ use Doctrine\ORM\Mapping as ORM; #[ORM\Table(name: 'chill_main_cronjob_execution')] class CronJobExecution { - final public const FAILURE = 100; + final public const int FAILURE = 100; - final public const SUCCESS = 1; + final public const int SUCCESS = 1; #[ORM\Column(type: \Doctrine\DBAL\Types\Types::DATETIME_IMMUTABLE, nullable: true, options: ['default' => null])] private ?\DateTimeImmutable $lastEnd = null; diff --git a/src/Bundle/ChillMainBundle/Entity/Location.php b/src/Bundle/ChillMainBundle/Entity/Location.php index 228fd089f..de5d0dd90 100644 --- a/src/Bundle/ChillMainBundle/Entity/Location.php +++ b/src/Bundle/ChillMainBundle/Entity/Location.php @@ -174,6 +174,7 @@ class Location implements TrackCreationInterface, TrackUpdateInterface return $this; } + #[\Override] public function setCreatedAt(?\DateTimeInterface $createdAt): self { $this->createdAt = $createdAt; @@ -181,6 +182,7 @@ class Location implements TrackCreationInterface, TrackUpdateInterface return $this; } + #[\Override] public function setCreatedBy(?User $createdBy): self { $this->createdBy = $createdBy; @@ -223,6 +225,7 @@ class Location implements TrackCreationInterface, TrackUpdateInterface return $this; } + #[\Override] public function setUpdatedAt(?\DateTimeInterface $updatedAt): self { $this->updatedAt = $updatedAt; @@ -230,6 +233,7 @@ class Location implements TrackCreationInterface, TrackUpdateInterface return $this; } + #[\Override] public function setUpdatedBy(?User $updatedBy): self { $this->updatedBy = $updatedBy; diff --git a/src/Bundle/ChillMainBundle/Entity/LocationType.php b/src/Bundle/ChillMainBundle/Entity/LocationType.php index df212646a..a27612770 100644 --- a/src/Bundle/ChillMainBundle/Entity/LocationType.php +++ b/src/Bundle/ChillMainBundle/Entity/LocationType.php @@ -23,15 +23,15 @@ use Symfony\Component\Serializer\Annotation\DiscriminatorMap; #[ORM\Table(name: 'chill_main_location_type')] class LocationType { - final public const DEFAULT_FOR_3PARTY = 'thirdparty'; + final public const string DEFAULT_FOR_3PARTY = 'thirdparty'; - final public const DEFAULT_FOR_PERSON = 'person'; + final public const string DEFAULT_FOR_PERSON = 'person'; - final public const STATUS_NEVER = 'never'; + final public const string STATUS_NEVER = 'never'; - final public const STATUS_OPTIONAL = 'optional'; + final public const string STATUS_OPTIONAL = 'optional'; - final public const STATUS_REQUIRED = 'required'; + final public const string STATUS_REQUIRED = 'required'; #[Serializer\Groups(['read'])] #[ORM\Column(type: \Doctrine\DBAL\Types\Types::BOOLEAN, nullable: true)] diff --git a/src/Bundle/ChillMainBundle/Entity/Notification.php b/src/Bundle/ChillMainBundle/Entity/Notification.php index 4165da3d0..1cabce110 100644 --- a/src/Bundle/ChillMainBundle/Entity/Notification.php +++ b/src/Bundle/ChillMainBundle/Entity/Notification.php @@ -376,6 +376,7 @@ class Notification implements TrackUpdateInterface return $this; } + #[\Override] public function setUpdatedAt(\DateTimeInterface $datetime): self { $this->updatedAt = $datetime; @@ -383,6 +384,7 @@ class Notification implements TrackUpdateInterface return $this; } + #[\Override] public function setUpdatedBy(User $user): self { $this->updatedBy = $user; diff --git a/src/Bundle/ChillMainBundle/Entity/NotificationComment.php b/src/Bundle/ChillMainBundle/Entity/NotificationComment.php index 53d3fba2f..8ecd485db 100644 --- a/src/Bundle/ChillMainBundle/Entity/NotificationComment.php +++ b/src/Bundle/ChillMainBundle/Entity/NotificationComment.php @@ -124,6 +124,7 @@ class NotificationComment implements TrackCreationInterface, TrackUpdateInterfac return $this; } + #[\Override] public function setCreatedAt(\DateTimeInterface $datetime): self { $this->createdAt = $datetime; @@ -131,6 +132,7 @@ class NotificationComment implements TrackCreationInterface, TrackUpdateInterfac return $this; } + #[\Override] public function setCreatedBy(User $user): self { $this->createdBy = $user; @@ -156,6 +158,7 @@ class NotificationComment implements TrackCreationInterface, TrackUpdateInterfac return $this->setUpdatedAt($updateAt); } + #[\Override] public function setUpdatedAt(\DateTimeInterface $datetime): self { $this->updateAt = $datetime; @@ -163,6 +166,7 @@ class NotificationComment implements TrackCreationInterface, TrackUpdateInterfac return $this; } + #[\Override] public function setUpdatedBy(User $user): self { $this->updatedBy = $user; diff --git a/src/Bundle/ChillMainBundle/Entity/User.php b/src/Bundle/ChillMainBundle/Entity/User.php index f2f299b7f..4b85a240f 100644 --- a/src/Bundle/ChillMainBundle/Entity/User.php +++ b/src/Bundle/ChillMainBundle/Entity/User.php @@ -126,6 +126,7 @@ class User implements UserInterface, \Stringable, PasswordAuthenticatedUserInter $this->jobHistories = new ArrayCollection(); } + #[\Override] public function __toString(): string { return $this->getLabel(); @@ -141,6 +142,7 @@ class User implements UserInterface, \Stringable, PasswordAuthenticatedUserInter return $this; } + #[\Override] public function eraseCredentials() {} public function getAbsenceStart(): ?\DateTimeImmutable @@ -250,16 +252,19 @@ class User implements UserInterface, \Stringable, PasswordAuthenticatedUserInter return new ArrayCollection($sortedScopeHistories); } + #[\Override] public function getPassword(): ?string { return $this->password; } + #[\Override] public function getRoles(): array { return ['ROLE_USER']; } + #[\Override] public function getSalt(): ?string { return $this->salt; @@ -307,6 +312,7 @@ class User implements UserInterface, \Stringable, PasswordAuthenticatedUserInter /** * @return string */ + #[\Override] public function getUsername() { return $this->username; diff --git a/src/Bundle/ChillMainBundle/Export/Formatter/CSVFormatter.php b/src/Bundle/ChillMainBundle/Export/Formatter/CSVFormatter.php index ee7b5d5c3..b551abd62 100644 --- a/src/Bundle/ChillMainBundle/Export/Formatter/CSVFormatter.php +++ b/src/Bundle/ChillMainBundle/Export/Formatter/CSVFormatter.php @@ -59,6 +59,7 @@ class CSVFormatter implements FormatterInterface /** * @uses appendAggregatorForm */ + #[\Override] public function buildForm(FormBuilderInterface $builder, $exportAlias, array $aggregatorAliases) { $aggregators = $this->exportManager->getAggregators($aggregatorAliases); @@ -74,6 +75,7 @@ class CSVFormatter implements FormatterInterface } } + #[\Override] public function getFormDefaultData(array $aggregatorAliases): array { return []; @@ -107,11 +109,13 @@ class CSVFormatter implements FormatterInterface return $descriptions; } + #[\Override] public function getName() { return 'Comma separated values (CSV)'; } + #[\Override] public function getResponse( $result, $formatterData, @@ -140,6 +144,7 @@ class CSVFormatter implements FormatterInterface return $response; } + #[\Override] public function getType() { return 'tabular'; diff --git a/src/Bundle/ChillMainBundle/Export/Formatter/CSVListFormatter.php b/src/Bundle/ChillMainBundle/Export/Formatter/CSVListFormatter.php index 853c177b7..6b6a757a5 100644 --- a/src/Bundle/ChillMainBundle/Export/Formatter/CSVListFormatter.php +++ b/src/Bundle/ChillMainBundle/Export/Formatter/CSVListFormatter.php @@ -65,6 +65,7 @@ class CSVListFormatter implements FormatterInterface * * @param type $exportAlias */ + #[\Override] public function buildForm( FormBuilderInterface $builder, $exportAlias, @@ -81,11 +82,13 @@ class CSVListFormatter implements FormatterInterface ]); } + #[\Override] public function getFormDefaultData(array $aggregatorAliases): array { return ['numerotation' => true]; } + #[\Override] public function getName() { return 'CSV vertical list'; @@ -102,6 +105,7 @@ class CSVListFormatter implements FormatterInterface * * @return Response The response to be shown */ + #[\Override] public function getResponse( $result, $formatterData, @@ -150,6 +154,7 @@ class CSVListFormatter implements FormatterInterface return $response; } + #[\Override] public function getType() { return FormatterInterface::TYPE_LIST; diff --git a/src/Bundle/ChillMainBundle/Export/Formatter/CSVPivotedListFormatter.php b/src/Bundle/ChillMainBundle/Export/Formatter/CSVPivotedListFormatter.php index 8b32714cc..64025c325 100644 --- a/src/Bundle/ChillMainBundle/Export/Formatter/CSVPivotedListFormatter.php +++ b/src/Bundle/ChillMainBundle/Export/Formatter/CSVPivotedListFormatter.php @@ -63,6 +63,7 @@ class CSVPivotedListFormatter implements FormatterInterface * * @param type $exportAlias */ + #[\Override] public function buildForm( FormBuilderInterface $builder, $exportAlias, @@ -80,11 +81,13 @@ class CSVPivotedListFormatter implements FormatterInterface ]); } + #[\Override] public function getFormDefaultData(array $aggregatorAliases): array { return ['numerotation' => true]; } + #[\Override] public function getName() { return 'CSV horizontal list'; @@ -101,6 +104,7 @@ class CSVPivotedListFormatter implements FormatterInterface * * @return Response The response to be shown */ + #[\Override] public function getResponse( $result, $formatterData, @@ -153,6 +157,7 @@ class CSVPivotedListFormatter implements FormatterInterface return $response; } + #[\Override] public function getType() { return FormatterInterface::TYPE_LIST; diff --git a/src/Bundle/ChillMainBundle/Export/Formatter/SpreadSheetFormatter.php b/src/Bundle/ChillMainBundle/Export/Formatter/SpreadSheetFormatter.php index 4147c0016..39cd5132e 100644 --- a/src/Bundle/ChillMainBundle/Export/Formatter/SpreadSheetFormatter.php +++ b/src/Bundle/ChillMainBundle/Export/Formatter/SpreadSheetFormatter.php @@ -126,6 +126,7 @@ class SpreadSheetFormatter implements FormatterInterface $this->exportManager = $exportManager; } + #[\Override] public function buildForm( FormBuilderInterface $builder, $exportAlias, @@ -155,6 +156,7 @@ class SpreadSheetFormatter implements FormatterInterface } } + #[\Override] public function getFormDefaultData(array $aggregatorAliases): array { $data = ['format' => 'xlsx']; @@ -167,11 +169,13 @@ class SpreadSheetFormatter implements FormatterInterface return $data; } + #[\Override] public function getName(): string { return 'SpreadSheet (xlsx, ods)'; } + #[\Override] public function getResponse( $result, $formatterData, @@ -211,6 +215,7 @@ class SpreadSheetFormatter implements FormatterInterface return $response; } + #[\Override] public function getType() { return 'tabular'; diff --git a/src/Bundle/ChillMainBundle/Export/Formatter/SpreadsheetListFormatter.php b/src/Bundle/ChillMainBundle/Export/Formatter/SpreadsheetListFormatter.php index 7284ff70a..20f446f98 100644 --- a/src/Bundle/ChillMainBundle/Export/Formatter/SpreadsheetListFormatter.php +++ b/src/Bundle/ChillMainBundle/Export/Formatter/SpreadsheetListFormatter.php @@ -69,6 +69,7 @@ class SpreadsheetListFormatter implements FormatterInterface * * @param string $exportAlias */ + #[\Override] public function buildForm( FormBuilderInterface $builder, $exportAlias, @@ -93,11 +94,13 @@ class SpreadsheetListFormatter implements FormatterInterface ]); } + #[\Override] public function getFormDefaultData(array $aggregatorAliases): array { return ['numerotation' => true, 'format' => 'xlsx']; } + #[\Override] public function getName() { return 'Spreadsheet list formatter (.xlsx, .ods)'; @@ -114,6 +117,7 @@ class SpreadsheetListFormatter implements FormatterInterface * * @return Response The response to be shown */ + #[\Override] public function getResponse( $result, $formatterData, @@ -209,6 +213,7 @@ class SpreadsheetListFormatter implements FormatterInterface return $response; } + #[\Override] public function getType() { return FormatterInterface::TYPE_LIST; diff --git a/src/Bundle/ChillMainBundle/Export/Helper/ExportAddressHelper.php b/src/Bundle/ChillMainBundle/Export/Helper/ExportAddressHelper.php index 9161316e7..489e10e8f 100644 --- a/src/Bundle/ChillMainBundle/Export/Helper/ExportAddressHelper.php +++ b/src/Bundle/ChillMainBundle/Export/Helper/ExportAddressHelper.php @@ -31,23 +31,23 @@ class ExportAddressHelper self::F_ATTRIBUTES | self::F_BUILDING | self::F_COUNTRY | self::F_GEOM | self::F_POSTAL_CODE | self::F_STREET | self::F_GEOGRAPHICAL_UNITS; - final public const F_AS_STRING = 0b00010000; + final public const int F_AS_STRING = 0b00010000; - final public const F_ATTRIBUTES = 0b01000000; + final public const int F_ATTRIBUTES = 0b01000000; - final public const F_BUILDING = 0b00001000; + final public const int F_BUILDING = 0b00001000; - final public const F_COUNTRY = 0b00000001; + final public const int F_COUNTRY = 0b00000001; - final public const F_GEOGRAPHICAL_UNITS = 0b1000000000; + final public const int F_GEOGRAPHICAL_UNITS = 0b1000000000; - final public const F_GEOM = 0b00100000; + final public const int F_GEOM = 0b00100000; - final public const F_POSTAL_CODE = 0b00000010; + final public const int F_POSTAL_CODE = 0b00000010; - final public const F_STREET = 0b00000100; + final public const int F_STREET = 0b00000100; - private const ALL = [ + private const array ALL = [ 'country' => self::F_COUNTRY, 'postal_code' => self::F_POSTAL_CODE, 'street' => self::F_STREET, @@ -58,7 +58,7 @@ class ExportAddressHelper 'geographical_units' => self::F_GEOGRAPHICAL_UNITS, ]; - private const COLUMN_MAPPING = [ + private const array COLUMN_MAPPING = [ 'country' => ['country'], 'postal_code' => ['postcode_code', 'postcode_name'], 'street' => ['street', 'streetNumber'], diff --git a/src/Bundle/ChillMainBundle/Form/AbsenceType.php b/src/Bundle/ChillMainBundle/Form/AbsenceType.php index d0aed640c..ab6924c2b 100644 --- a/src/Bundle/ChillMainBundle/Form/AbsenceType.php +++ b/src/Bundle/ChillMainBundle/Form/AbsenceType.php @@ -19,6 +19,7 @@ use Symfony\Component\OptionsResolver\OptionsResolver; class AbsenceType extends AbstractType { + #[\Override] public function buildForm(FormBuilderInterface $builder, array $options) { $builder @@ -29,6 +30,7 @@ class AbsenceType extends AbstractType ]); } + #[\Override] public function configureOptions(OptionsResolver $resolver) { $resolver->setDefaults([ diff --git a/src/Bundle/ChillMainBundle/Form/CenterType.php b/src/Bundle/ChillMainBundle/Form/CenterType.php index 62b018f11..1e2c2e2a5 100644 --- a/src/Bundle/ChillMainBundle/Form/CenterType.php +++ b/src/Bundle/ChillMainBundle/Form/CenterType.php @@ -20,6 +20,7 @@ use Symfony\Component\OptionsResolver\OptionsResolver; class CenterType extends AbstractType { + #[\Override] public function buildForm(FormBuilderInterface $builder, array $options) { $builder @@ -32,6 +33,7 @@ class CenterType extends AbstractType ]); } + #[\Override] public function configureOptions(OptionsResolver $resolver) { $resolver diff --git a/src/Bundle/ChillMainBundle/Form/ChoiceLoader/PostalCodeChoiceLoader.php b/src/Bundle/ChillMainBundle/Form/ChoiceLoader/PostalCodeChoiceLoader.php index d2dd47962..5f4c4ee11 100644 --- a/src/Bundle/ChillMainBundle/Form/ChoiceLoader/PostalCodeChoiceLoader.php +++ b/src/Bundle/ChillMainBundle/Form/ChoiceLoader/PostalCodeChoiceLoader.php @@ -42,6 +42,7 @@ class PostalCodeChoiceLoader implements ChoiceLoaderInterface /** * @param null $value */ + #[\Override] public function loadChoiceList($value = null): ChoiceListInterface { return new \Symfony\Component\Form\ChoiceList\ArrayChoiceList( @@ -55,6 +56,7 @@ class PostalCodeChoiceLoader implements ChoiceLoaderInterface * * @return array */ + #[\Override] public function loadChoicesForValues(array $values, $value = null) { $choices = []; @@ -75,6 +77,7 @@ class PostalCodeChoiceLoader implements ChoiceLoaderInterface * * @return array|string[] */ + #[\Override] public function loadValuesForChoices(array $choices, $value = null) { $values = []; diff --git a/src/Bundle/ChillMainBundle/Form/CivilityType.php b/src/Bundle/ChillMainBundle/Form/CivilityType.php index c83d3e7ee..615bc04a6 100644 --- a/src/Bundle/ChillMainBundle/Form/CivilityType.php +++ b/src/Bundle/ChillMainBundle/Form/CivilityType.php @@ -20,6 +20,7 @@ use Symfony\Component\OptionsResolver\OptionsResolver; class CivilityType extends \Symfony\Component\Form\AbstractType { + #[\Override] public function buildForm(FormBuilderInterface $builder, array $options): void { $builder @@ -36,6 +37,7 @@ class CivilityType extends \Symfony\Component\Form\AbstractType ->add('order', IntegerType::class); } + #[\Override] public function configureOptions(OptionsResolver $resolver): void { $resolver->setDefaults([ diff --git a/src/Bundle/ChillMainBundle/Form/CountryType.php b/src/Bundle/ChillMainBundle/Form/CountryType.php index ae4f4dbfb..cfbc8754b 100644 --- a/src/Bundle/ChillMainBundle/Form/CountryType.php +++ b/src/Bundle/ChillMainBundle/Form/CountryType.php @@ -19,6 +19,7 @@ use Symfony\Component\OptionsResolver\OptionsResolver; class CountryType extends \Symfony\Component\Form\AbstractType { + #[\Override] public function buildForm(FormBuilderInterface $builder, array $options): void { $builder @@ -32,6 +33,7 @@ class CountryType extends \Symfony\Component\Form\AbstractType ]); } + #[\Override] public function configureOptions(OptionsResolver $resolver): void { $resolver->setDefaults([ diff --git a/src/Bundle/ChillMainBundle/Form/DataMapper/AddressDataMapper.php b/src/Bundle/ChillMainBundle/Form/DataMapper/AddressDataMapper.php index a4cab4a9b..6997c7b73 100644 --- a/src/Bundle/ChillMainBundle/Form/DataMapper/AddressDataMapper.php +++ b/src/Bundle/ChillMainBundle/Form/DataMapper/AddressDataMapper.php @@ -28,6 +28,7 @@ class AddressDataMapper implements DataMapperInterface * @param Address $address * @param \Iterator $forms */ + #[\Override] public function mapDataToForms($address, \Traversable $forms) { if (null === $address) { @@ -78,6 +79,7 @@ class AddressDataMapper implements DataMapperInterface * @param \Iterator $forms * @param Address $address */ + #[\Override] public function mapFormsToData(\Traversable $forms, &$address) { if (!$address instanceof Address) { diff --git a/src/Bundle/ChillMainBundle/Form/DataMapper/ExportPickCenterDataMapper.php b/src/Bundle/ChillMainBundle/Form/DataMapper/ExportPickCenterDataMapper.php index 2a19c8e0b..94f8a4aae 100644 --- a/src/Bundle/ChillMainBundle/Form/DataMapper/ExportPickCenterDataMapper.php +++ b/src/Bundle/ChillMainBundle/Form/DataMapper/ExportPickCenterDataMapper.php @@ -17,6 +17,7 @@ use Symfony\Component\Form\FormInterface; final readonly class ExportPickCenterDataMapper implements DataMapperInterface { + #[\Override] public function mapDataToForms($viewData, \Traversable $forms): void { if (null === $viewData) { @@ -31,6 +32,7 @@ final readonly class ExportPickCenterDataMapper implements DataMapperInterface // NOTE: we do not map back the regroupments } + #[\Override] public function mapFormsToData(\Traversable $forms, &$viewData): void { /** @var array $forms */ diff --git a/src/Bundle/ChillMainBundle/Form/DataMapper/PrivateCommentDataMapper.php b/src/Bundle/ChillMainBundle/Form/DataMapper/PrivateCommentDataMapper.php index 3f1284db8..341a4e012 100644 --- a/src/Bundle/ChillMainBundle/Form/DataMapper/PrivateCommentDataMapper.php +++ b/src/Bundle/ChillMainBundle/Form/DataMapper/PrivateCommentDataMapper.php @@ -21,6 +21,7 @@ final class PrivateCommentDataMapper extends AbstractType implements DataMapperI { public function __construct(private readonly Security $security) {} + #[\Override] public function mapDataToForms($viewData, \Traversable $forms) { if (null === $viewData) { @@ -36,6 +37,7 @@ final class PrivateCommentDataMapper extends AbstractType implements DataMapperI $forms['comments']->setData($viewData->getCommentForUser($this->security->getUser())); } + #[\Override] public function mapFormsToData(\Traversable $forms, &$viewData) { $forms = iterator_to_array($forms); diff --git a/src/Bundle/ChillMainBundle/Form/DataMapper/RollingDateDataMapper.php b/src/Bundle/ChillMainBundle/Form/DataMapper/RollingDateDataMapper.php index 254860e64..0773aed52 100644 --- a/src/Bundle/ChillMainBundle/Form/DataMapper/RollingDateDataMapper.php +++ b/src/Bundle/ChillMainBundle/Form/DataMapper/RollingDateDataMapper.php @@ -17,6 +17,7 @@ use Symfony\Component\Form\Exception; class RollingDateDataMapper implements DataMapperInterface { + #[\Override] public function mapDataToForms($viewData, \Traversable $forms) { if (null === $viewData) { @@ -33,6 +34,7 @@ class RollingDateDataMapper implements DataMapperInterface $forms['fixedDate']->setData($viewData->getFixedDate()); } + #[\Override] public function mapFormsToData(\Traversable $forms, &$viewData): void { $forms = iterator_to_array($forms); diff --git a/src/Bundle/ChillMainBundle/Form/DataMapper/ScopePickerDataMapper.php b/src/Bundle/ChillMainBundle/Form/DataMapper/ScopePickerDataMapper.php index d6a0cea20..26230ef0a 100644 --- a/src/Bundle/ChillMainBundle/Form/DataMapper/ScopePickerDataMapper.php +++ b/src/Bundle/ChillMainBundle/Form/DataMapper/ScopePickerDataMapper.php @@ -18,6 +18,7 @@ class ScopePickerDataMapper implements DataMapperInterface { public function __construct(private readonly ?Scope $scope = null) {} + #[\Override] public function mapDataToForms($data, \Traversable $forms) { $forms = iterator_to_array($forms); @@ -37,6 +38,7 @@ class ScopePickerDataMapper implements DataMapperInterface } } + #[\Override] public function mapFormsToData(\Traversable $forms, &$data) { $forms = iterator_to_array($forms); diff --git a/src/Bundle/ChillMainBundle/Form/DataTransformer/IdToEntityDataTransformer.php b/src/Bundle/ChillMainBundle/Form/DataTransformer/IdToEntityDataTransformer.php index 1796f7ed2..df56b14ec 100644 --- a/src/Bundle/ChillMainBundle/Form/DataTransformer/IdToEntityDataTransformer.php +++ b/src/Bundle/ChillMainBundle/Form/DataTransformer/IdToEntityDataTransformer.php @@ -45,6 +45,7 @@ class IdToEntityDataTransformer implements DataTransformerInterface * * @return array|object[]|T[]|T|object */ + #[\Override] public function reverseTransform($value) { if ($this->multiple) { @@ -74,6 +75,7 @@ class IdToEntityDataTransformer implements DataTransformerInterface /** * @param object|T|object[]|T[] $value */ + #[\Override] public function transform($value): string { if ($this->multiple) { diff --git a/src/Bundle/ChillMainBundle/Form/EntityWorkflowCommentType.php b/src/Bundle/ChillMainBundle/Form/EntityWorkflowCommentType.php index 965097c1f..ccb81804e 100644 --- a/src/Bundle/ChillMainBundle/Form/EntityWorkflowCommentType.php +++ b/src/Bundle/ChillMainBundle/Form/EntityWorkflowCommentType.php @@ -17,6 +17,7 @@ use Symfony\Component\Form\FormBuilderInterface; class EntityWorkflowCommentType extends AbstractType { + #[\Override] public function buildForm(FormBuilderInterface $builder, array $options) { $builder diff --git a/src/Bundle/ChillMainBundle/Form/Event/CustomizeFormEvent.php b/src/Bundle/ChillMainBundle/Form/Event/CustomizeFormEvent.php index 42606ebd7..7bc2085a1 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\Contracts\EventDispatcher\Event { - final public const NAME = 'chill_main.customize_form'; + final public const string NAME = 'chill_main.customize_form'; public function __construct(protected string $type, protected FormBuilderInterface $builder) {} diff --git a/src/Bundle/ChillMainBundle/Form/LanguageType.php b/src/Bundle/ChillMainBundle/Form/LanguageType.php index f184a66a7..6f9b9730a 100644 --- a/src/Bundle/ChillMainBundle/Form/LanguageType.php +++ b/src/Bundle/ChillMainBundle/Form/LanguageType.php @@ -19,6 +19,7 @@ use Symfony\Component\OptionsResolver\OptionsResolver; class LanguageType extends \Symfony\Component\Form\AbstractType { + #[\Override] public function buildForm(FormBuilderInterface $builder, array $options): void { $builder @@ -32,6 +33,7 @@ class LanguageType extends \Symfony\Component\Form\AbstractType ]); } + #[\Override] public function configureOptions(OptionsResolver $resolver): void { $resolver->setDefaults([ diff --git a/src/Bundle/ChillMainBundle/Form/LocationFormType.php b/src/Bundle/ChillMainBundle/Form/LocationFormType.php index 7f61cccce..d36e5e599 100644 --- a/src/Bundle/ChillMainBundle/Form/LocationFormType.php +++ b/src/Bundle/ChillMainBundle/Form/LocationFormType.php @@ -26,6 +26,7 @@ final class LocationFormType extends AbstractType { public function __construct(private readonly TranslatableStringHelper $translatableStringHelper) {} + #[\Override] public function buildForm(FormBuilderInterface $builder, array $options) { $builder @@ -63,6 +64,7 @@ final class LocationFormType extends AbstractType /** * @param OptionsResolverInterface $resolver */ + #[\Override] public function configureOptions(OptionsResolver $resolver) { $resolver->setDefaults([ @@ -73,6 +75,7 @@ final class LocationFormType extends AbstractType /** * @return string */ + #[\Override] public function getBlockPrefix() { return 'chill_mainbundle_location'; diff --git a/src/Bundle/ChillMainBundle/Form/LocationTypeType.php b/src/Bundle/ChillMainBundle/Form/LocationTypeType.php index d75c40716..0decb0d2e 100644 --- a/src/Bundle/ChillMainBundle/Form/LocationTypeType.php +++ b/src/Bundle/ChillMainBundle/Form/LocationTypeType.php @@ -19,6 +19,7 @@ use Symfony\Component\Form\FormBuilderInterface; final class LocationTypeType extends AbstractType { + #[\Override] public function buildForm(FormBuilderInterface $builder, array $options) { $builder->add( diff --git a/src/Bundle/ChillMainBundle/Form/NewsItemType.php b/src/Bundle/ChillMainBundle/Form/NewsItemType.php index b6a93a0a0..36b2a864f 100644 --- a/src/Bundle/ChillMainBundle/Form/NewsItemType.php +++ b/src/Bundle/ChillMainBundle/Form/NewsItemType.php @@ -21,6 +21,7 @@ use Symfony\Component\OptionsResolver\OptionsResolver; class NewsItemType extends AbstractType { + #[\Override] public function buildForm(FormBuilderInterface $builder, array $options) { $builder @@ -49,6 +50,7 @@ class NewsItemType extends AbstractType /** * @return void */ + #[\Override] public function configureOptions(OptionsResolver $resolver) { $resolver->setDefault('data_class', NewsItem::class); diff --git a/src/Bundle/ChillMainBundle/Form/NotificationCommentType.php b/src/Bundle/ChillMainBundle/Form/NotificationCommentType.php index b94790cb7..310ec1085 100644 --- a/src/Bundle/ChillMainBundle/Form/NotificationCommentType.php +++ b/src/Bundle/ChillMainBundle/Form/NotificationCommentType.php @@ -17,6 +17,7 @@ use Symfony\Component\Form\FormBuilderInterface; class NotificationCommentType extends AbstractType { + #[\Override] public function buildForm(FormBuilderInterface $builder, array $options) { $builder->add('content', ChillTextareaType::class, [ diff --git a/src/Bundle/ChillMainBundle/Form/NotificationType.php b/src/Bundle/ChillMainBundle/Form/NotificationType.php index 2bd8ba820..87dd36e9c 100644 --- a/src/Bundle/ChillMainBundle/Form/NotificationType.php +++ b/src/Bundle/ChillMainBundle/Form/NotificationType.php @@ -26,6 +26,7 @@ use Symfony\Component\Validator\Constraints\NotNull; class NotificationType extends AbstractType { + #[\Override] public function buildForm(FormBuilderInterface $builder, array $options) { $builder @@ -59,6 +60,7 @@ class NotificationType extends AbstractType ]); } + #[\Override] public function configureOptions(OptionsResolver $resolver) { $resolver->setDefault('class', Notification::class); diff --git a/src/Bundle/ChillMainBundle/Form/PermissionsGroupType.php b/src/Bundle/ChillMainBundle/Form/PermissionsGroupType.php index bd9f897e1..6c27ecf88 100644 --- a/src/Bundle/ChillMainBundle/Form/PermissionsGroupType.php +++ b/src/Bundle/ChillMainBundle/Form/PermissionsGroupType.php @@ -20,7 +20,7 @@ use Symfony\Component\OptionsResolver\OptionsResolver; class PermissionsGroupType extends AbstractType { - final public const FLAG_SCOPE = 'permissions_group'; + final public const string FLAG_SCOPE = 'permissions_group'; /** * @var PermissionsGroupFlagProvider[] @@ -32,6 +32,7 @@ class PermissionsGroupType extends AbstractType $this->flagProviders[] = $provider; } + #[\Override] public function buildForm(FormBuilderInterface $builder, array $options) { $builder @@ -53,6 +54,7 @@ class PermissionsGroupType extends AbstractType /** * @param OptionsResolverInterface $resolver */ + #[\Override] public function configureOptions(OptionsResolver $resolver) { $resolver->setDefaults([ @@ -63,6 +65,7 @@ class PermissionsGroupType extends AbstractType /** * @return string */ + #[\Override] public function getBlockPrefix() { return 'chill_mainbundle_permissionsgroup'; diff --git a/src/Bundle/ChillMainBundle/Form/RegroupmentType.php b/src/Bundle/ChillMainBundle/Form/RegroupmentType.php index 22814598a..25a80ee5c 100644 --- a/src/Bundle/ChillMainBundle/Form/RegroupmentType.php +++ b/src/Bundle/ChillMainBundle/Form/RegroupmentType.php @@ -22,6 +22,7 @@ use Symfony\Component\OptionsResolver\OptionsResolver; class RegroupmentType extends AbstractType { + #[\Override] public function buildForm(FormBuilderInterface $builder, array $options) { $builder @@ -39,6 +40,7 @@ class RegroupmentType extends AbstractType ]); } + #[\Override] public function configureOptions(OptionsResolver $resolver) { $resolver diff --git a/src/Bundle/ChillMainBundle/Form/SavedExportType.php b/src/Bundle/ChillMainBundle/Form/SavedExportType.php index 16aa4e42e..b291ce037 100644 --- a/src/Bundle/ChillMainBundle/Form/SavedExportType.php +++ b/src/Bundle/ChillMainBundle/Form/SavedExportType.php @@ -20,6 +20,7 @@ use Symfony\Component\OptionsResolver\OptionsResolver; class SavedExportType extends AbstractType { + #[\Override] public function buildForm(FormBuilderInterface $builder, array $options) { $builder @@ -31,6 +32,7 @@ class SavedExportType extends AbstractType ]); } + #[\Override] public function configureOptions(OptionsResolver $resolver) { $resolver->setDefaults([ diff --git a/src/Bundle/ChillMainBundle/Form/ScopeType.php b/src/Bundle/ChillMainBundle/Form/ScopeType.php index c5a7657b0..bcc0b74d6 100644 --- a/src/Bundle/ChillMainBundle/Form/ScopeType.php +++ b/src/Bundle/ChillMainBundle/Form/ScopeType.php @@ -19,6 +19,7 @@ use Symfony\Component\OptionsResolver\OptionsResolver; class ScopeType extends AbstractType { + #[\Override] public function buildForm(FormBuilderInterface $builder, array $options) { $builder @@ -33,6 +34,7 @@ class ScopeType extends AbstractType /** * @param OptionsResolverInterface $resolver */ + #[\Override] public function configureOptions(OptionsResolver $resolver) { $resolver->setDefaults([ @@ -43,6 +45,7 @@ class ScopeType extends AbstractType /** * @return string */ + #[\Override] public function getBlockPrefix() { return 'chill_mainbundle_scope'; diff --git a/src/Bundle/ChillMainBundle/Form/Type/AddressDateType.php b/src/Bundle/ChillMainBundle/Form/Type/AddressDateType.php index 020a434f6..7ee94d271 100644 --- a/src/Bundle/ChillMainBundle/Form/Type/AddressDateType.php +++ b/src/Bundle/ChillMainBundle/Form/Type/AddressDateType.php @@ -18,6 +18,7 @@ use Symfony\Component\OptionsResolver\OptionsResolver; class AddressDateType extends AbstractType { + #[\Override] public function buildForm(FormBuilderInterface $builder, array $options) { $builder @@ -30,6 +31,7 @@ class AddressDateType extends AbstractType ); } + #[\Override] public function configureOptions(OptionsResolver $resolver) { $resolver->setDefault('data_class', Address::class); diff --git a/src/Bundle/ChillMainBundle/Form/Type/AddressType.php b/src/Bundle/ChillMainBundle/Form/Type/AddressType.php index 8ae05b8b4..2d90b5054 100644 --- a/src/Bundle/ChillMainBundle/Form/Type/AddressType.php +++ b/src/Bundle/ChillMainBundle/Form/Type/AddressType.php @@ -32,6 +32,7 @@ use Symfony\Component\OptionsResolver\OptionsResolver; */ class AddressType extends AbstractType { + #[\Override] public function buildForm(FormBuilderInterface $builder, array $options) { $builder @@ -75,6 +76,7 @@ class AddressType extends AbstractType } } + #[\Override] public function configureOptions(OptionsResolver $resolver) { $resolver diff --git a/src/Bundle/ChillMainBundle/Form/Type/ChillCollectionType.php b/src/Bundle/ChillMainBundle/Form/Type/ChillCollectionType.php index 403aa40d6..3f632de56 100644 --- a/src/Bundle/ChillMainBundle/Form/Type/ChillCollectionType.php +++ b/src/Bundle/ChillMainBundle/Form/Type/ChillCollectionType.php @@ -27,6 +27,7 @@ use Symfony\Component\OptionsResolver\OptionsResolver; */ class ChillCollectionType extends AbstractType { + #[\Override] public function buildView(FormView $view, FormInterface $form, array $options) { $view->vars['button_add_label'] = $options['button_add_label']; @@ -38,6 +39,7 @@ class ChillCollectionType extends AbstractType $view->vars['js_caller'] = $options['js_caller']; } + #[\Override] public function configureOptions(OptionsResolver $resolver) { $resolver @@ -51,6 +53,7 @@ class ChillCollectionType extends AbstractType ]); } + #[\Override] public function getParent() { return \Symfony\Component\Form\Extension\Core\Type\CollectionType::class; diff --git a/src/Bundle/ChillMainBundle/Form/Type/ChillDateTimeType.php b/src/Bundle/ChillMainBundle/Form/Type/ChillDateTimeType.php index 0063ee7d9..b36c989f2 100644 --- a/src/Bundle/ChillMainBundle/Form/Type/ChillDateTimeType.php +++ b/src/Bundle/ChillMainBundle/Form/Type/ChillDateTimeType.php @@ -23,6 +23,7 @@ use Symfony\Component\OptionsResolver\OptionsResolver; */ class ChillDateTimeType extends AbstractType { + #[\Override] public function configureOptions(OptionsResolver $resolver) { $resolver @@ -33,6 +34,7 @@ class ChillDateTimeType extends AbstractType ->setDefault('html5', true); } + #[\Override] public function getParent() { return DateTimeType::class; diff --git a/src/Bundle/ChillMainBundle/Form/Type/ChillDateType.php b/src/Bundle/ChillMainBundle/Form/Type/ChillDateType.php index 95fc9daad..23e665de7 100644 --- a/src/Bundle/ChillMainBundle/Form/Type/ChillDateType.php +++ b/src/Bundle/ChillMainBundle/Form/Type/ChillDateType.php @@ -23,6 +23,7 @@ use Symfony\Component\OptionsResolver\OptionsResolver; */ class ChillDateType extends AbstractType { + #[\Override] public function configureOptions(OptionsResolver $resolver) { $resolver @@ -30,6 +31,7 @@ class ChillDateType extends AbstractType ->setDefault('html5', true); } + #[\Override] public function getParent() { return DateType::class; diff --git a/src/Bundle/ChillMainBundle/Form/Type/ChillPhoneNumberType.php b/src/Bundle/ChillMainBundle/Form/Type/ChillPhoneNumberType.php index 700726619..1961ca645 100644 --- a/src/Bundle/ChillMainBundle/Form/Type/ChillPhoneNumberType.php +++ b/src/Bundle/ChillMainBundle/Form/Type/ChillPhoneNumberType.php @@ -30,6 +30,7 @@ class ChillPhoneNumberType extends AbstractType $this->phoneNumberUtil = PhoneNumberUtil::getInstance(); } + #[\Override] public function configureOptions(OptionsResolver $resolver) { $resolver @@ -38,6 +39,7 @@ class ChillPhoneNumberType extends AbstractType ->setDefault('type', \libphonenumber\PhoneNumberType::FIXED_LINE_OR_MOBILE); } + #[\Override] public function getParent() { return PhoneNumberType::class; diff --git a/src/Bundle/ChillMainBundle/Form/Type/ChillTextareaType.php b/src/Bundle/ChillMainBundle/Form/Type/ChillTextareaType.php index ef3d371b3..9986e13bf 100644 --- a/src/Bundle/ChillMainBundle/Form/Type/ChillTextareaType.php +++ b/src/Bundle/ChillMainBundle/Form/Type/ChillTextareaType.php @@ -28,6 +28,7 @@ use Symfony\Component\OptionsResolver\OptionsResolver; */ final class ChillTextareaType extends AbstractType { + #[\Override] public function buildView(FormView $view, FormInterface $form, array $options) { if (!$options['disable_editor']) { @@ -35,6 +36,7 @@ final class ChillTextareaType extends AbstractType } } + #[\Override] public function configureOptions(OptionsResolver $resolver) { $resolver @@ -43,6 +45,7 @@ final class ChillTextareaType extends AbstractType ->setAllowedTypes('disable_editor', 'bool'); } + #[\Override] public function getParent() { return TextareaType::class; diff --git a/src/Bundle/ChillMainBundle/Form/Type/CommentType.php b/src/Bundle/ChillMainBundle/Form/Type/CommentType.php index 2b1d2f3e0..d6bced3c9 100644 --- a/src/Bundle/ChillMainBundle/Form/Type/CommentType.php +++ b/src/Bundle/ChillMainBundle/Form/Type/CommentType.php @@ -33,6 +33,7 @@ class CommentType extends AbstractType $this->user = $tokenStorage->getToken()->getUser(); } + #[\Override] public function buildForm(FormBuilderInterface $builder, array $options) { $builder @@ -53,11 +54,13 @@ class CommentType extends AbstractType }); } + #[\Override] public function buildView(FormView $view, FormInterface $form, array $options) { $view->vars['fullWidth'] = true; } + #[\Override] public function configureOptions(OptionsResolver $resolver) { $resolver diff --git a/src/Bundle/ChillMainBundle/Form/Type/ComposedGroupCenterType.php b/src/Bundle/ChillMainBundle/Form/Type/ComposedGroupCenterType.php index 92a1e43e5..a4d18864d 100644 --- a/src/Bundle/ChillMainBundle/Form/Type/ComposedGroupCenterType.php +++ b/src/Bundle/ChillMainBundle/Form/Type/ComposedGroupCenterType.php @@ -21,6 +21,7 @@ use Symfony\Component\OptionsResolver\OptionsResolver; class ComposedGroupCenterType extends AbstractType { + #[\Override] public function buildForm(FormBuilderInterface $builder, array $options) { $builder->add('permissionsgroup', EntityType::class, [ @@ -38,11 +39,13 @@ class ComposedGroupCenterType extends AbstractType ]); } + #[\Override] public function configureOptions(OptionsResolver $resolver) { $resolver->setDefault('data_class', \Chill\MainBundle\Entity\GroupCenter::class); } + #[\Override] public function getBlockPrefix() { return 'composed_groupcenter'; diff --git a/src/Bundle/ChillMainBundle/Form/Type/ComposedRoleScopeType.php b/src/Bundle/ChillMainBundle/Form/Type/ComposedRoleScopeType.php index f4b4da609..da060fc77 100644 --- a/src/Bundle/ChillMainBundle/Form/Type/ComposedRoleScopeType.php +++ b/src/Bundle/ChillMainBundle/Form/Type/ComposedRoleScopeType.php @@ -47,6 +47,7 @@ class ComposedRoleScopeType extends AbstractType $this->roleProvider = $roleProvider; } + #[\Override] public function buildForm(FormBuilderInterface $builder, array $options) { // store values used in internal function @@ -82,6 +83,7 @@ class ComposedRoleScopeType extends AbstractType ]); } + #[\Override] public function configureOptions(OptionsResolver $resolver) { $resolver->setDefault('data_class', \Chill\MainBundle\Entity\RoleScope::class); diff --git a/src/Bundle/ChillMainBundle/Form/Type/DataTransformer/AddressToIdDataTransformer.php b/src/Bundle/ChillMainBundle/Form/Type/DataTransformer/AddressToIdDataTransformer.php index 04094537b..c0b58d1d8 100644 --- a/src/Bundle/ChillMainBundle/Form/Type/DataTransformer/AddressToIdDataTransformer.php +++ b/src/Bundle/ChillMainBundle/Form/Type/DataTransformer/AddressToIdDataTransformer.php @@ -19,6 +19,7 @@ final readonly class AddressToIdDataTransformer implements DataTransformerInterf { public function __construct(private AddressRepository $addressRepository) {} + #[\Override] public function reverseTransform($value) { if (null === $value || '' === $value) { @@ -38,6 +39,7 @@ final readonly class AddressToIdDataTransformer implements DataTransformerInterf return $address; } + #[\Override] public function transform($value) { if (null === $value) { diff --git a/src/Bundle/ChillMainBundle/Form/Type/DataTransformer/CenterTransformer.php b/src/Bundle/ChillMainBundle/Form/Type/DataTransformer/CenterTransformer.php index d328d38f0..2009b85e0 100644 --- a/src/Bundle/ChillMainBundle/Form/Type/DataTransformer/CenterTransformer.php +++ b/src/Bundle/ChillMainBundle/Form/Type/DataTransformer/CenterTransformer.php @@ -22,6 +22,7 @@ class CenterTransformer implements DataTransformerInterface { public function __construct(private readonly CenterRepository $centerRepository, private readonly bool $multiple = false) {} + #[\Override] public function reverseTransform($id) { if (null === $id) { @@ -55,6 +56,7 @@ class CenterTransformer implements DataTransformerInterface return $centers[0]; } + #[\Override] public function transform($center) { if (null === $center) { diff --git a/src/Bundle/ChillMainBundle/Form/Type/DataTransformer/DateIntervalTransformer.php b/src/Bundle/ChillMainBundle/Form/Type/DataTransformer/DateIntervalTransformer.php index 7bc447f29..00080a3e7 100644 --- a/src/Bundle/ChillMainBundle/Form/Type/DataTransformer/DateIntervalTransformer.php +++ b/src/Bundle/ChillMainBundle/Form/Type/DataTransformer/DateIntervalTransformer.php @@ -17,6 +17,7 @@ use Symfony\Component\Form\Exception\UnexpectedTypeException; class DateIntervalTransformer implements DataTransformerInterface { + #[\Override] public function reverseTransform($value) { if (empty($value) || empty($value['n'])) { @@ -32,6 +33,7 @@ class DateIntervalTransformer implements DataTransformerInterface } } + #[\Override] public function transform($value) { if (empty($value)) { diff --git a/src/Bundle/ChillMainBundle/Form/Type/DataTransformer/EntityToJsonTransformer.php b/src/Bundle/ChillMainBundle/Form/Type/DataTransformer/EntityToJsonTransformer.php index d193ea2ef..61a30d988 100644 --- a/src/Bundle/ChillMainBundle/Form/Type/DataTransformer/EntityToJsonTransformer.php +++ b/src/Bundle/ChillMainBundle/Form/Type/DataTransformer/EntityToJsonTransformer.php @@ -24,6 +24,7 @@ class EntityToJsonTransformer implements DataTransformerInterface { public function __construct(private readonly DenormalizerInterface $denormalizer, private readonly SerializerInterface $serializer, private readonly bool $multiple, private readonly string $type) {} + #[\Override] public function reverseTransform($value) { if ('' === $value) { @@ -49,6 +50,7 @@ class EntityToJsonTransformer implements DataTransformerInterface /** * @param User|User[] $value */ + #[\Override] public function transform($value): string { if (null === $value) { diff --git a/src/Bundle/ChillMainBundle/Form/Type/DataTransformer/MultipleObjectsToIdTransformer.php b/src/Bundle/ChillMainBundle/Form/Type/DataTransformer/MultipleObjectsToIdTransformer.php index 808093278..7c6d50fe5 100644 --- a/src/Bundle/ChillMainBundle/Form/Type/DataTransformer/MultipleObjectsToIdTransformer.php +++ b/src/Bundle/ChillMainBundle/Form/Type/DataTransformer/MultipleObjectsToIdTransformer.php @@ -22,6 +22,7 @@ class MultipleObjectsToIdTransformer implements DataTransformerInterface /** * Transforms a string (id) to an object (item). */ + #[\Override] public function reverseTransform($array) { $ret = new ArrayCollection(); @@ -42,6 +43,7 @@ class MultipleObjectsToIdTransformer implements DataTransformerInterface * * @param array $array */ + #[\Override] public function transform($array): array { $ret = []; diff --git a/src/Bundle/ChillMainBundle/Form/Type/DataTransformer/ObjectToIdTransformer.php b/src/Bundle/ChillMainBundle/Form/Type/DataTransformer/ObjectToIdTransformer.php index e56778bf2..eb34a1a7b 100644 --- a/src/Bundle/ChillMainBundle/Form/Type/DataTransformer/ObjectToIdTransformer.php +++ b/src/Bundle/ChillMainBundle/Form/Type/DataTransformer/ObjectToIdTransformer.php @@ -26,6 +26,7 @@ class ObjectToIdTransformer implements DataTransformerInterface * * @throws TransformationFailedException if object is not found */ + #[\Override] public function reverseTransform($id): ?object { if (null === $id) { @@ -48,6 +49,7 @@ class ObjectToIdTransformer implements DataTransformerInterface * * @return string */ + #[\Override] public function transform($object) { if (null === $object) { diff --git a/src/Bundle/ChillMainBundle/Form/Type/DataTransformer/PostalCodeToIdTransformer.php b/src/Bundle/ChillMainBundle/Form/Type/DataTransformer/PostalCodeToIdTransformer.php index dde8b7b9e..df0d11538 100644 --- a/src/Bundle/ChillMainBundle/Form/Type/DataTransformer/PostalCodeToIdTransformer.php +++ b/src/Bundle/ChillMainBundle/Form/Type/DataTransformer/PostalCodeToIdTransformer.php @@ -20,6 +20,7 @@ class PostalCodeToIdTransformer implements DataTransformerInterface { public function __construct(private readonly PostalCodeRepositoryInterface $postalCodeRepository) {} + #[\Override] public function reverseTransform($value) { if (null === $value || trim('') === $value) { @@ -33,6 +34,7 @@ class PostalCodeToIdTransformer implements DataTransformerInterface return $this->postalCodeRepository->find((int) $value); } + #[\Override] public function transform($value) { if (null === $value) { diff --git a/src/Bundle/ChillMainBundle/Form/Type/DataTransformer/ScopeTransformer.php b/src/Bundle/ChillMainBundle/Form/Type/DataTransformer/ScopeTransformer.php index 2779f2cdd..7a730994b 100644 --- a/src/Bundle/ChillMainBundle/Form/Type/DataTransformer/ScopeTransformer.php +++ b/src/Bundle/ChillMainBundle/Form/Type/DataTransformer/ScopeTransformer.php @@ -20,6 +20,7 @@ class ScopeTransformer implements DataTransformerInterface { public function __construct(private readonly EntityManagerInterface $em) {} + #[\Override] public function reverseTransform($id) { if (null === $id) { @@ -38,6 +39,7 @@ class ScopeTransformer implements DataTransformerInterface return $scope; } + #[\Override] public function transform($scope) { if (null === $scope) { diff --git a/src/Bundle/ChillMainBundle/Form/Type/DateIntervalType.php b/src/Bundle/ChillMainBundle/Form/Type/DateIntervalType.php index c9bc4dd82..3c30a6cb4 100644 --- a/src/Bundle/ChillMainBundle/Form/Type/DateIntervalType.php +++ b/src/Bundle/ChillMainBundle/Form/Type/DateIntervalType.php @@ -51,6 +51,7 @@ use Symfony\Component\Validator\Constraints\GreaterThan; */ class DateIntervalType extends AbstractType { + #[\Override] public function buildForm(FormBuilderInterface $builder, array $options) { $builder @@ -68,6 +69,7 @@ class DateIntervalType extends AbstractType $builder->addModelTransformer(new DateIntervalTransformer()); } + #[\Override] public function configureOptions(OptionsResolver $resolver) { $resolver diff --git a/src/Bundle/ChillMainBundle/Form/Type/Export/AggregatorType.php b/src/Bundle/ChillMainBundle/Form/Type/Export/AggregatorType.php index 72e501108..dfb3a651a 100644 --- a/src/Bundle/ChillMainBundle/Form/Type/Export/AggregatorType.php +++ b/src/Bundle/ChillMainBundle/Form/Type/Export/AggregatorType.php @@ -21,6 +21,7 @@ use Symfony\Component\OptionsResolver\OptionsResolver; class AggregatorType extends AbstractType { + #[\Override] public function buildForm(FormBuilderInterface $builder, array $options): void { $exportManager = $options['export_manager']; @@ -49,6 +50,7 @@ class AggregatorType extends AbstractType $builder->add($aggregatorFormBuilder); } + #[\Override] public function configureOptions(OptionsResolver $resolver): void { $resolver->setRequired('aggregator_alias') diff --git a/src/Bundle/ChillMainBundle/Form/Type/Export/ExportType.php b/src/Bundle/ChillMainBundle/Form/Type/Export/ExportType.php index e5d0887f3..b1d0f1367 100644 --- a/src/Bundle/ChillMainBundle/Form/Type/Export/ExportType.php +++ b/src/Bundle/ChillMainBundle/Form/Type/Export/ExportType.php @@ -21,16 +21,17 @@ use Symfony\Component\OptionsResolver\OptionsResolver; class ExportType extends AbstractType { - final public const AGGREGATOR_KEY = 'aggregators'; + final public const string AGGREGATOR_KEY = 'aggregators'; - final public const EXPORT_KEY = 'export'; + final public const string EXPORT_KEY = 'export'; - final public const FILTER_KEY = 'filters'; + final public const string FILTER_KEY = 'filters'; - final public const PICK_FORMATTER_KEY = 'pick_formatter'; + final public const string PICK_FORMATTER_KEY = 'pick_formatter'; public function __construct(private readonly ExportManager $exportManager, private readonly SortExportElement $sortExportElement) {} + #[\Override] public function buildForm(FormBuilderInterface $builder, array $options) { $export = $this->exportManager->getExport($options['export_alias']); @@ -103,6 +104,7 @@ class ExportType extends AbstractType } } + #[\Override] public function configureOptions(OptionsResolver $resolver) { $resolver->setRequired(['export_alias', 'picked_centers']) @@ -113,6 +115,7 @@ class ExportType extends AbstractType ]); } + #[\Override] public function getParent() { return FormType::class; diff --git a/src/Bundle/ChillMainBundle/Form/Type/Export/FilterType.php b/src/Bundle/ChillMainBundle/Form/Type/Export/FilterType.php index d4873df83..6b98224f3 100644 --- a/src/Bundle/ChillMainBundle/Form/Type/Export/FilterType.php +++ b/src/Bundle/ChillMainBundle/Form/Type/Export/FilterType.php @@ -22,10 +22,11 @@ use Symfony\Component\OptionsResolver\OptionsResolver; class FilterType extends AbstractType { - final public const ENABLED_FIELD = 'enabled'; + final public const string ENABLED_FIELD = 'enabled'; public function __construct() {} + #[\Override] public function buildForm(FormBuilderInterface $builder, array $options) { $filter = $options['filter']; @@ -53,6 +54,7 @@ class FilterType extends AbstractType $builder->add($filterFormBuilder); } + #[\Override] public function configureOptions(OptionsResolver $resolver) { $resolver diff --git a/src/Bundle/ChillMainBundle/Form/Type/Export/FormatterType.php b/src/Bundle/ChillMainBundle/Form/Type/Export/FormatterType.php index b2b58c809..f82b9616f 100644 --- a/src/Bundle/ChillMainBundle/Form/Type/Export/FormatterType.php +++ b/src/Bundle/ChillMainBundle/Form/Type/Export/FormatterType.php @@ -28,6 +28,7 @@ class FormatterType extends AbstractType $this->exportManager = $manager; } + #[\Override] public function buildForm(FormBuilderInterface $builder, array $options) { $formatter = $this->exportManager->getFormatter($options['formatter_alias']); @@ -39,6 +40,7 @@ class FormatterType extends AbstractType ); } + #[\Override] public function configureOptions(OptionsResolver $resolver) { $resolver->setRequired(['formatter_alias', 'export_alias', diff --git a/src/Bundle/ChillMainBundle/Form/Type/Export/PickCenterType.php b/src/Bundle/ChillMainBundle/Form/Type/Export/PickCenterType.php index a093dda44..cf5d3f9f5 100644 --- a/src/Bundle/ChillMainBundle/Form/Type/Export/PickCenterType.php +++ b/src/Bundle/ChillMainBundle/Form/Type/Export/PickCenterType.php @@ -27,7 +27,7 @@ use Symfony\Component\OptionsResolver\OptionsResolver; */ final class PickCenterType extends AbstractType { - public const CENTERS_IDENTIFIERS = 'c'; + public const string CENTERS_IDENTIFIERS = 'c'; public function __construct( private readonly ExportManager $exportManager, @@ -35,6 +35,7 @@ final class PickCenterType extends AbstractType private readonly AuthorizationHelperForCurrentUserInterface $authorizationHelper ) {} + #[\Override] public function buildForm(FormBuilderInterface $builder, array $options) { $export = $this->exportManager->getExport($options['export_alias']); @@ -70,6 +71,7 @@ final class PickCenterType extends AbstractType $builder->setDataMapper(new ExportPickCenterDataMapper()); } + #[\Override] public function configureOptions(OptionsResolver $resolver) { $resolver->setRequired('export_alias'); diff --git a/src/Bundle/ChillMainBundle/Form/Type/Export/PickFormatterType.php b/src/Bundle/ChillMainBundle/Form/Type/Export/PickFormatterType.php index 8a2883657..4172d2c67 100644 --- a/src/Bundle/ChillMainBundle/Form/Type/Export/PickFormatterType.php +++ b/src/Bundle/ChillMainBundle/Form/Type/Export/PickFormatterType.php @@ -29,6 +29,7 @@ class PickFormatterType extends AbstractType $this->exportManager = $exportManager; } + #[\Override] public function buildForm(FormBuilderInterface $builder, array $options) { $export = $this->exportManager->getExport($options['export_alias']); @@ -49,6 +50,7 @@ class PickFormatterType extends AbstractType ]); } + #[\Override] public function configureOptions(OptionsResolver $resolver) { $resolver->setRequired(['export_alias']); diff --git a/src/Bundle/ChillMainBundle/Form/Type/Listing/FilterOrderType.php b/src/Bundle/ChillMainBundle/Form/Type/Listing/FilterOrderType.php index 5873c0a45..d89993141 100644 --- a/src/Bundle/ChillMainBundle/Form/Type/Listing/FilterOrderType.php +++ b/src/Bundle/ChillMainBundle/Form/Type/Listing/FilterOrderType.php @@ -24,6 +24,7 @@ use Symfony\Component\Form\FormView; final class FilterOrderType extends \Symfony\Component\Form\AbstractType { + #[\Override] public function buildForm(FormBuilderInterface $builder, array $options) { /** @var FilterOrderHelper $helper */ @@ -145,6 +146,7 @@ final class FilterOrderType extends \Symfony\Component\Form\AbstractType ); } + #[\Override] public function buildView(FormView $view, FormInterface $form, array $options) { /** @var FilterOrderHelper $helper */ @@ -157,6 +159,7 @@ final class FilterOrderType extends \Symfony\Component\Form\AbstractType } } + #[\Override] public function configureOptions(\Symfony\Component\OptionsResolver\OptionsResolver $resolver) { $resolver->setRequired('helper') diff --git a/src/Bundle/ChillMainBundle/Form/Type/PickAddressType.php b/src/Bundle/ChillMainBundle/Form/Type/PickAddressType.php index 190e09f30..692773ce8 100644 --- a/src/Bundle/ChillMainBundle/Form/Type/PickAddressType.php +++ b/src/Bundle/ChillMainBundle/Form/Type/PickAddressType.php @@ -43,11 +43,13 @@ final class PickAddressType extends AbstractType { public function __construct(private readonly AddressToIdDataTransformer $addressToIdDataTransformer, private readonly TranslatorInterface $translator) {} + #[\Override] public function buildForm(FormBuilderInterface $builder, array $options) { $builder->addModelTransformer($this->addressToIdDataTransformer); } + #[\Override] public function buildView(FormView $view, FormInterface $form, array $options) { $view->vars['uniqid'] = $view->vars['attr']['data-input-address'] = \uniqid('input_address_'); @@ -57,6 +59,7 @@ final class PickAddressType extends AbstractType $view->vars['attr']['data-button-text-update'] = $this->translator->trans($options['button_text_update']); } + #[\Override] public function configureOptions(OptionsResolver $resolver) { $resolver->setDefaults([ @@ -72,6 +75,7 @@ final class PickAddressType extends AbstractType ]); } + #[\Override] public function getParent() { return HiddenType::class; diff --git a/src/Bundle/ChillMainBundle/Form/Type/PickCenterType.php b/src/Bundle/ChillMainBundle/Form/Type/PickCenterType.php index ba6cc874d..60624b3f1 100644 --- a/src/Bundle/ChillMainBundle/Form/Type/PickCenterType.php +++ b/src/Bundle/ChillMainBundle/Form/Type/PickCenterType.php @@ -39,6 +39,7 @@ class PickCenterType extends AbstractType /** * add a data transformer if user can reach only one center. */ + #[\Override] public function buildForm(FormBuilderInterface $builder, array $options) { $centers = $this->getReachableCenters($options['role'], $options['scopes']); @@ -78,6 +79,7 @@ class PickCenterType extends AbstractType )); } + #[\Override] public function buildView(FormView $view, FormInterface $form, array $options) { $view->vars['is_hidden'] = \count($this->getReachableCenters( @@ -112,6 +114,7 @@ class PickCenterType extends AbstractType * configure default options, i.e. add choices if user can reach multiple * centers. */ + #[\Override] public function configureOptions(OptionsResolver $resolver) { $resolver diff --git a/src/Bundle/ChillMainBundle/Form/Type/PickCivilityType.php b/src/Bundle/ChillMainBundle/Form/Type/PickCivilityType.php index f9aa09ce8..94f4b0f39 100644 --- a/src/Bundle/ChillMainBundle/Form/Type/PickCivilityType.php +++ b/src/Bundle/ChillMainBundle/Form/Type/PickCivilityType.php @@ -23,6 +23,7 @@ class PickCivilityType extends AbstractType { public function __construct(private readonly TranslatableStringHelper $translatableStringHelper) {} + #[\Override] public function configureOptions(OptionsResolver $resolver) { $resolver @@ -41,6 +42,7 @@ class PickCivilityType extends AbstractType ->setDefault('class', Civility::class); } + #[\Override] public function getParent() { return EntityType::class; diff --git a/src/Bundle/ChillMainBundle/Form/Type/PickLocationTypeType.php b/src/Bundle/ChillMainBundle/Form/Type/PickLocationTypeType.php index 8aa216da1..b017eb97f 100644 --- a/src/Bundle/ChillMainBundle/Form/Type/PickLocationTypeType.php +++ b/src/Bundle/ChillMainBundle/Form/Type/PickLocationTypeType.php @@ -21,6 +21,7 @@ class PickLocationTypeType extends AbstractType { public function __construct(private readonly TranslatableStringHelper $translatableStringHelper) {} + #[\Override] public function configureOptions(OptionsResolver $resolver) { $resolver @@ -36,6 +37,7 @@ class PickLocationTypeType extends AbstractType ->setAllowedTypes('multiple', ['bool']); } + #[\Override] public function getParent(): string { return EntityType::class; diff --git a/src/Bundle/ChillMainBundle/Form/Type/PickPostalCodeType.php b/src/Bundle/ChillMainBundle/Form/Type/PickPostalCodeType.php index 1a1ed4354..4d72f5fcf 100644 --- a/src/Bundle/ChillMainBundle/Form/Type/PickPostalCodeType.php +++ b/src/Bundle/ChillMainBundle/Form/Type/PickPostalCodeType.php @@ -23,16 +23,19 @@ class PickPostalCodeType extends AbstractType { public function __construct(private readonly PostalCodeToIdTransformer $postalCodeToIdTransformer) {} + #[\Override] public function buildForm(FormBuilderInterface $builder, array $options) { $builder->addViewTransformer($this->postalCodeToIdTransformer); } + #[\Override] public function buildView(FormView $view, FormInterface $form, array $options) { $view->vars['uniqid'] = $view->vars['attr']['data-input-postal-code'] = uniqid('input_pick_postal_code_'); } + #[\Override] public function configureOptions(OptionsResolver $resolver) { $resolver diff --git a/src/Bundle/ChillMainBundle/Form/Type/PickRollingDateType.php b/src/Bundle/ChillMainBundle/Form/Type/PickRollingDateType.php index ca10530e8..04b78ad6e 100644 --- a/src/Bundle/ChillMainBundle/Form/Type/PickRollingDateType.php +++ b/src/Bundle/ChillMainBundle/Form/Type/PickRollingDateType.php @@ -24,6 +24,7 @@ use Symfony\Component\Validator\Context\ExecutionContextInterface; class PickRollingDateType extends AbstractType { + #[\Override] public function buildForm(FormBuilderInterface $builder, array $options) { $builder @@ -45,11 +46,13 @@ class PickRollingDateType extends AbstractType $builder->setDataMapper(new RollingDateDataMapper()); } + #[\Override] public function buildView(FormView $view, FormInterface $form, array $options) { $view->vars['uniqid'] = uniqid('rollingdate-'); } + #[\Override] public function configureOptions(OptionsResolver $resolver) { $resolver->setDefaults([ diff --git a/src/Bundle/ChillMainBundle/Form/Type/PickUserDynamicType.php b/src/Bundle/ChillMainBundle/Form/Type/PickUserDynamicType.php index aab9d4c51..6d199baf1 100644 --- a/src/Bundle/ChillMainBundle/Form/Type/PickUserDynamicType.php +++ b/src/Bundle/ChillMainBundle/Form/Type/PickUserDynamicType.php @@ -29,11 +29,13 @@ class PickUserDynamicType extends AbstractType { public function __construct(private readonly DenormalizerInterface $denormalizer, private readonly SerializerInterface $serializer, private readonly NormalizerInterface $normalizer) {} + #[\Override] public function buildForm(FormBuilderInterface $builder, array $options) { $builder->addViewTransformer(new EntityToJsonTransformer($this->denormalizer, $this->serializer, $options['multiple'], 'user')); } + #[\Override] public function buildView(FormView $view, FormInterface $form, array $options) { $view->vars['multiple'] = $options['multiple']; @@ -48,6 +50,7 @@ class PickUserDynamicType extends AbstractType } } + #[\Override] public function configureOptions(OptionsResolver $resolver) { $resolver @@ -62,6 +65,7 @@ class PickUserDynamicType extends AbstractType ->setAllowedTypes('submit_on_adding_new_entity', ['bool']); } + #[\Override] public function getBlockPrefix() { return 'pick_entity_dynamic'; diff --git a/src/Bundle/ChillMainBundle/Form/Type/PickUserLocationType.php b/src/Bundle/ChillMainBundle/Form/Type/PickUserLocationType.php index 9d1cdb626..50bdfb5de 100644 --- a/src/Bundle/ChillMainBundle/Form/Type/PickUserLocationType.php +++ b/src/Bundle/ChillMainBundle/Form/Type/PickUserLocationType.php @@ -22,6 +22,7 @@ class PickUserLocationType extends AbstractType { public function __construct(private readonly TranslatableStringHelper $translatableStringHelper, private readonly LocationRepository $locationRepository) {} + #[\Override] public function configureOptions(OptionsResolver $resolver) { $resolver @@ -40,6 +41,7 @@ class PickUserLocationType extends AbstractType ->setAllowedTypes('multiple', ['bool']); } + #[\Override] public function getParent(): string { return EntityType::class; diff --git a/src/Bundle/ChillMainBundle/Form/Type/PostalCodeType.php b/src/Bundle/ChillMainBundle/Form/Type/PostalCodeType.php index b02d069f5..cba711aa3 100644 --- a/src/Bundle/ChillMainBundle/Form/Type/PostalCodeType.php +++ b/src/Bundle/ChillMainBundle/Form/Type/PostalCodeType.php @@ -59,6 +59,7 @@ class PostalCodeType extends AbstractType $this->translator = $translator; } + #[\Override] public function buildView(FormView $view, FormInterface $form, array $options) { $view->vars['attr']['data-postal-code'] = 'data-postal-code'; @@ -71,6 +72,7 @@ class PostalCodeType extends AbstractType $view->vars['attr']['data-searching-label'] = $this->translator->trans('select2.searching'); } + #[\Override] public function configureOptions(OptionsResolver $resolver) { // create a local copy for usage in Closure @@ -83,6 +85,7 @@ class PostalCodeType extends AbstractType ->setDefault('placeholder', 'Select a postal code'); } + #[\Override] public function getParent() { return EntityType::class; diff --git a/src/Bundle/ChillMainBundle/Form/Type/PrivateCommentType.php b/src/Bundle/ChillMainBundle/Form/Type/PrivateCommentType.php index 0d26b5a95..622708786 100644 --- a/src/Bundle/ChillMainBundle/Form/Type/PrivateCommentType.php +++ b/src/Bundle/ChillMainBundle/Form/Type/PrivateCommentType.php @@ -23,6 +23,7 @@ class PrivateCommentType extends AbstractType { public function __construct(protected PrivateCommentDataMapper $dataMapper) {} + #[\Override] public function buildForm(FormBuilderInterface $builder, array $options) { $builder @@ -33,11 +34,13 @@ class PrivateCommentType extends AbstractType ->setDataMapper($this->dataMapper); } + #[\Override] public function buildView(FormView $view, FormInterface $form, array $options) { $view->vars['fullWidth'] = true; } + #[\Override] public function configureOptions(OptionsResolver $resolver) { $resolver diff --git a/src/Bundle/ChillMainBundle/Form/Type/ScopePickerType.php b/src/Bundle/ChillMainBundle/Form/Type/ScopePickerType.php index 10d083bd8..767fa2553 100644 --- a/src/Bundle/ChillMainBundle/Form/Type/ScopePickerType.php +++ b/src/Bundle/ChillMainBundle/Form/Type/ScopePickerType.php @@ -45,6 +45,7 @@ class ScopePickerType extends AbstractType private readonly TranslatableStringHelperInterface $translatableStringHelper ) {} + #[\Override] public function buildForm(FormBuilderInterface $builder, array $options) { $items = array_values( @@ -78,11 +79,13 @@ class ScopePickerType extends AbstractType } } + #[\Override] public function buildView(FormView $view, FormInterface $form, array $options) { $view->vars['fullWidth'] = true; } + #[\Override] public function configureOptions(OptionsResolver $resolver) { $resolver diff --git a/src/Bundle/ChillMainBundle/Form/Type/Select2ChoiceType.php b/src/Bundle/ChillMainBundle/Form/Type/Select2ChoiceType.php index d965a919a..aa47fee65 100644 --- a/src/Bundle/ChillMainBundle/Form/Type/Select2ChoiceType.php +++ b/src/Bundle/ChillMainBundle/Form/Type/Select2ChoiceType.php @@ -20,6 +20,7 @@ use Symfony\Component\OptionsResolver\OptionsResolver; */ class Select2ChoiceType extends AbstractType { + #[\Override] public function configureOptions(OptionsResolver $resolver) { $resolver->setDefaults( @@ -29,6 +30,7 @@ class Select2ChoiceType extends AbstractType ); } + #[\Override] public function getParent() { return ChoiceType::class; diff --git a/src/Bundle/ChillMainBundle/Form/Type/Select2CountryType.php b/src/Bundle/ChillMainBundle/Form/Type/Select2CountryType.php index e9ff503df..179a84265 100644 --- a/src/Bundle/ChillMainBundle/Form/Type/Select2CountryType.php +++ b/src/Bundle/ChillMainBundle/Form/Type/Select2CountryType.php @@ -28,12 +28,14 @@ class Select2CountryType extends AbstractType { public function __construct(private readonly RequestStack $requestStack, private readonly ObjectManager $em, protected TranslatableStringHelper $translatableStringHelper, protected ParameterBagInterface $parameterBag) {} + #[\Override] public function buildForm(FormBuilderInterface $builder, array $options) { $transformer = new ObjectToIdTransformer($this->em, Country::class); $builder->addModelTransformer($transformer); } + #[\Override] public function configureOptions(OptionsResolver $resolver) { $countries = $this->em->getRepository(Country::class)->findAll(); @@ -62,11 +64,13 @@ class Select2CountryType extends AbstractType ]); } + #[\Override] public function getBlockPrefix() { return 'select2_chill_country'; } + #[\Override] public function getParent() { return Select2ChoiceType::class; diff --git a/src/Bundle/ChillMainBundle/Form/Type/Select2EntityType.php b/src/Bundle/ChillMainBundle/Form/Type/Select2EntityType.php index bf300a389..463ce793a 100644 --- a/src/Bundle/ChillMainBundle/Form/Type/Select2EntityType.php +++ b/src/Bundle/ChillMainBundle/Form/Type/Select2EntityType.php @@ -20,6 +20,7 @@ use Symfony\Component\OptionsResolver\OptionsResolver; */ class Select2EntityType extends AbstractType { + #[\Override] public function configureOptions(OptionsResolver $resolver) { $resolver->replaceDefaults( @@ -27,6 +28,7 @@ class Select2EntityType extends AbstractType ); } + #[\Override] public function getParent() { return EntityType::class; diff --git a/src/Bundle/ChillMainBundle/Form/Type/Select2LanguageType.php b/src/Bundle/ChillMainBundle/Form/Type/Select2LanguageType.php index 68a3970ba..07db42b79 100644 --- a/src/Bundle/ChillMainBundle/Form/Type/Select2LanguageType.php +++ b/src/Bundle/ChillMainBundle/Form/Type/Select2LanguageType.php @@ -28,12 +28,14 @@ class Select2LanguageType extends AbstractType { public function __construct(private readonly RequestStack $requestStack, private readonly ObjectManager $em, protected TranslatableStringHelper $translatableStringHelper, protected ParameterBagInterface $parameterBag) {} + #[\Override] public function buildForm(FormBuilderInterface $builder, array $options) { $transformer = new MultipleObjectsToIdTransformer($this->em, Language::class); $builder->addModelTransformer($transformer); } + #[\Override] public function configureOptions(OptionsResolver $resolver) { $languages = $this->em->getRepository(Language::class)->findAll(); @@ -58,11 +60,13 @@ class Select2LanguageType extends AbstractType ]); } + #[\Override] public function getBlockPrefix() { return 'select2_chill_language'; } + #[\Override] public function getParent() { return Select2ChoiceType::class; diff --git a/src/Bundle/ChillMainBundle/Form/Type/TranslatableStringFormType.php b/src/Bundle/ChillMainBundle/Form/Type/TranslatableStringFormType.php index 6945d28fb..80d4368b3 100644 --- a/src/Bundle/ChillMainBundle/Form/Type/TranslatableStringFormType.php +++ b/src/Bundle/ChillMainBundle/Form/Type/TranslatableStringFormType.php @@ -31,6 +31,7 @@ class TranslatableStringFormType extends AbstractType $this->frameworkTranslatorFallback = $translator->getFallbackLocales(); } + #[\Override] public function buildForm(FormBuilderInterface $builder, array $options) { foreach ($this->availableLanguages as $lang) { @@ -46,6 +47,7 @@ class TranslatableStringFormType extends AbstractType } } + #[\Override] public function getBlockPrefix() { return 'translatable_string'; diff --git a/src/Bundle/ChillMainBundle/Form/Type/UserPickerType.php b/src/Bundle/ChillMainBundle/Form/Type/UserPickerType.php index ebda0c34f..f055d44e9 100644 --- a/src/Bundle/ChillMainBundle/Form/Type/UserPickerType.php +++ b/src/Bundle/ChillMainBundle/Form/Type/UserPickerType.php @@ -55,6 +55,7 @@ class UserPickerType extends AbstractType $this->tokenStorage = $tokenStorage; } + #[\Override] public function configureOptions(OptionsResolver $resolver) { $resolver @@ -87,6 +88,7 @@ class UserPickerType extends AbstractType }); } + #[\Override] public function getParent() { return EntityType::class; diff --git a/src/Bundle/ChillMainBundle/Form/UserCurrentLocationType.php b/src/Bundle/ChillMainBundle/Form/UserCurrentLocationType.php index bf6a5d172..5367eec8a 100644 --- a/src/Bundle/ChillMainBundle/Form/UserCurrentLocationType.php +++ b/src/Bundle/ChillMainBundle/Form/UserCurrentLocationType.php @@ -17,6 +17,7 @@ use Symfony\Component\Form\FormBuilderInterface; class UserCurrentLocationType extends AbstractType { + #[\Override] public function buildForm(FormBuilderInterface $builder, array $options) { $builder->add('currentLocation', PickUserLocationType::class); diff --git a/src/Bundle/ChillMainBundle/Form/UserJobType.php b/src/Bundle/ChillMainBundle/Form/UserJobType.php index 32ddc3179..d91fb9b81 100644 --- a/src/Bundle/ChillMainBundle/Form/UserJobType.php +++ b/src/Bundle/ChillMainBundle/Form/UserJobType.php @@ -17,6 +17,7 @@ use Symfony\Component\Form\FormBuilderInterface; class UserJobType extends \Symfony\Component\Form\AbstractType { + #[\Override] public function buildForm(FormBuilderInterface $builder, array $options) { $builder diff --git a/src/Bundle/ChillMainBundle/Form/UserPasswordType.php b/src/Bundle/ChillMainBundle/Form/UserPasswordType.php index b3ae403a3..1817a0419 100644 --- a/src/Bundle/ChillMainBundle/Form/UserPasswordType.php +++ b/src/Bundle/ChillMainBundle/Form/UserPasswordType.php @@ -43,6 +43,7 @@ class UserPasswordType extends AbstractType $this->chillLogger = $chillLogger; } + #[\Override] public function buildForm(FormBuilderInterface $builder, array $options) { $builder @@ -93,6 +94,7 @@ class UserPasswordType extends AbstractType ]); } + #[\Override] public function configureOptions(OptionsResolver $resolver) { $resolver @@ -103,6 +105,7 @@ class UserPasswordType extends AbstractType /** * @return string */ + #[\Override] public function getBlockPrefix() { return 'chill_mainbundle_user_password'; diff --git a/src/Bundle/ChillMainBundle/Form/UserPhonenumberType.php b/src/Bundle/ChillMainBundle/Form/UserPhonenumberType.php index 579829b84..996cb56a2 100644 --- a/src/Bundle/ChillMainBundle/Form/UserPhonenumberType.php +++ b/src/Bundle/ChillMainBundle/Form/UserPhonenumberType.php @@ -19,6 +19,7 @@ use Symfony\Component\OptionsResolver\OptionsResolver; class UserPhonenumberType extends AbstractType { + #[\Override] public function buildForm(FormBuilderInterface $builder, array $options) { $builder @@ -27,6 +28,7 @@ class UserPhonenumberType extends AbstractType ]); } + #[\Override] public function configureOptions(OptionsResolver $resolver) { $resolver->setDefaults([ diff --git a/src/Bundle/ChillMainBundle/Form/UserType.php b/src/Bundle/ChillMainBundle/Form/UserType.php index 9d62fbc6a..c1c6f81d9 100644 --- a/src/Bundle/ChillMainBundle/Form/UserType.php +++ b/src/Bundle/ChillMainBundle/Form/UserType.php @@ -38,6 +38,7 @@ class UserType extends AbstractType { public function __construct(private readonly TranslatableStringHelper $translatableStringHelper, protected ParameterBagInterface $parameterBag) {} + #[\Override] public function buildForm(FormBuilderInterface $builder, array $options) { $builder @@ -153,6 +154,7 @@ class UserType extends AbstractType /** * @param OptionsResolverInterface $resolver */ + #[\Override] public function configureOptions(OptionsResolver $resolver) { $resolver->setDefaults([ @@ -167,6 +169,7 @@ class UserType extends AbstractType /** * @return string */ + #[\Override] public function getBlockPrefix() { return 'chill_mainbundle_user'; diff --git a/src/Bundle/ChillMainBundle/Form/WorkflowStepType.php b/src/Bundle/ChillMainBundle/Form/WorkflowStepType.php index 3a3f1b8d3..6d7deba6f 100644 --- a/src/Bundle/ChillMainBundle/Form/WorkflowStepType.php +++ b/src/Bundle/ChillMainBundle/Form/WorkflowStepType.php @@ -36,6 +36,7 @@ class WorkflowStepType extends AbstractType { public function __construct(private readonly EntityWorkflowManager $entityWorkflowManager, private readonly Registry $registry, private readonly TranslatableStringHelperInterface $translatableStringHelper) {} + #[\Override] public function buildForm(FormBuilderInterface $builder, array $options) { /** @var EntityWorkflow $entityWorkflow */ @@ -181,6 +182,7 @@ class WorkflowStepType extends AbstractType ]); } + #[\Override] public function configureOptions(OptionsResolver $resolver) { $resolver diff --git a/src/Bundle/ChillMainBundle/Form/WorkflowTransitionType.php b/src/Bundle/ChillMainBundle/Form/WorkflowTransitionType.php index bf2646e60..97f772374 100644 --- a/src/Bundle/ChillMainBundle/Form/WorkflowTransitionType.php +++ b/src/Bundle/ChillMainBundle/Form/WorkflowTransitionType.php @@ -18,6 +18,7 @@ use Symfony\Component\OptionsResolver\OptionsResolver; class WorkflowTransitionType extends AbstractType { + #[\Override] public function buildForm(FormBuilderInterface $builder, array $options) { $builder @@ -27,6 +28,7 @@ class WorkflowTransitionType extends AbstractType ]); } + #[\Override] public function configureOptions(OptionsResolver $resolver) { $resolver diff --git a/src/Bundle/ChillMainBundle/Notification/Counter/NotificationByUserCounter.php b/src/Bundle/ChillMainBundle/Notification/Counter/NotificationByUserCounter.php index b61f38a35..e0747f921 100644 --- a/src/Bundle/ChillMainBundle/Notification/Counter/NotificationByUserCounter.php +++ b/src/Bundle/ChillMainBundle/Notification/Counter/NotificationByUserCounter.php @@ -26,6 +26,7 @@ final readonly class NotificationByUserCounter implements NotificationCounterInt { public function __construct(private CacheItemPoolInterface $cacheItemPool, private NotificationRepository $notificationRepository) {} + #[\Override] public function addNotification(UserInterface $u): int { if (!$u instanceof User) { diff --git a/src/Bundle/ChillMainBundle/Notification/EventListener/PersistNotificationOnTerminateEventSubscriber.php b/src/Bundle/ChillMainBundle/Notification/EventListener/PersistNotificationOnTerminateEventSubscriber.php index 3268fee05..de795213c 100644 --- a/src/Bundle/ChillMainBundle/Notification/EventListener/PersistNotificationOnTerminateEventSubscriber.php +++ b/src/Bundle/ChillMainBundle/Notification/EventListener/PersistNotificationOnTerminateEventSubscriber.php @@ -20,6 +20,7 @@ class PersistNotificationOnTerminateEventSubscriber implements EventSubscriberIn { public function __construct(private readonly EntityManagerInterface $em, private readonly NotificationPersisterInterface $persister) {} + #[\Override] public static function getSubscribedEvents() { return [ diff --git a/src/Bundle/ChillMainBundle/Notification/NotificationPersister.php b/src/Bundle/ChillMainBundle/Notification/NotificationPersister.php index c1029e0dc..8c0c15f33 100644 --- a/src/Bundle/ChillMainBundle/Notification/NotificationPersister.php +++ b/src/Bundle/ChillMainBundle/Notification/NotificationPersister.php @@ -20,11 +20,13 @@ class NotificationPersister implements NotificationPersisterInterface /** * @return array|Notification[] */ + #[\Override] public function getWaitingNotifications(): array { return $this->waitingNotifications; } + #[\Override] public function persist(Notification $notification): void { $this->waitingNotifications[] = $notification; diff --git a/src/Bundle/ChillMainBundle/Notification/Templating/NotificationTwigExtension.php b/src/Bundle/ChillMainBundle/Notification/Templating/NotificationTwigExtension.php index dd2fb49ba..54b4346b8 100644 --- a/src/Bundle/ChillMainBundle/Notification/Templating/NotificationTwigExtension.php +++ b/src/Bundle/ChillMainBundle/Notification/Templating/NotificationTwigExtension.php @@ -16,6 +16,7 @@ use Twig\TwigFunction; class NotificationTwigExtension extends AbstractExtension { + #[\Override] public function getFunctions() { return [ diff --git a/src/Bundle/ChillMainBundle/Pagination/ChillItemsPerPageTwig.php b/src/Bundle/ChillMainBundle/Pagination/ChillItemsPerPageTwig.php index d66adb974..857496fd3 100644 --- a/src/Bundle/ChillMainBundle/Pagination/ChillItemsPerPageTwig.php +++ b/src/Bundle/ChillMainBundle/Pagination/ChillItemsPerPageTwig.php @@ -20,6 +20,7 @@ use Twig\TwigFunction; */ class ChillItemsPerPageTwig extends AbstractExtension { + #[\Override] public function getFunctions() { return [ diff --git a/src/Bundle/ChillMainBundle/Pagination/ChillPaginationTwig.php b/src/Bundle/ChillMainBundle/Pagination/ChillPaginationTwig.php index e5883d593..b1e2fc94e 100644 --- a/src/Bundle/ChillMainBundle/Pagination/ChillPaginationTwig.php +++ b/src/Bundle/ChillMainBundle/Pagination/ChillPaginationTwig.php @@ -20,10 +20,11 @@ use Twig\TwigFunction; */ class ChillPaginationTwig extends AbstractExtension { - final public const LONG_TEMPLATE = '@ChillMain/Pagination/long.html.twig'; + final public const string LONG_TEMPLATE = '@ChillMain/Pagination/long.html.twig'; - final public const SHORT_TEMPLATE = '@ChillMain/Pagination/short.html.twig'; + final public const string SHORT_TEMPLATE = '@ChillMain/Pagination/short.html.twig'; + #[\Override] public function getFunctions() { return [ diff --git a/src/Bundle/ChillMainBundle/Pagination/Page.php b/src/Bundle/ChillMainBundle/Pagination/Page.php index 9858a27b8..fd84d0fd5 100644 --- a/src/Bundle/ChillMainBundle/Pagination/Page.php +++ b/src/Bundle/ChillMainBundle/Pagination/Page.php @@ -49,16 +49,19 @@ class Page implements PageInterface $this->urlGenerator = $urlGenerator; } + #[\Override] public function generateUrl(): string { return $this->urlGenerator->generate($this->route, $this->routeParameters); } + #[\Override] public function getFirstItemNumber(): int { return ($this->number - 1) * $this->itemPerPage; } + #[\Override] public function getLastItemNumber(): int { $last = $this->number * $this->itemPerPage - 1; @@ -66,6 +69,7 @@ class Page implements PageInterface return $last < $this->totalItems ? $last : $this->totalItems; } + #[\Override] public function getNumber(): int { return $this->number; diff --git a/src/Bundle/ChillMainBundle/Pagination/PageGenerator.php b/src/Bundle/ChillMainBundle/Pagination/PageGenerator.php index 4c9cb68fe..cbc6674a6 100644 --- a/src/Bundle/ChillMainBundle/Pagination/PageGenerator.php +++ b/src/Bundle/ChillMainBundle/Pagination/PageGenerator.php @@ -20,26 +20,31 @@ class PageGenerator implements \Iterator public function __construct(protected Paginator $paginator) {} + #[\Override] public function current(): Page { return $this->paginator->getPage($this->current); } + #[\Override] public function key(): int { return $this->current; } + #[\Override] public function next(): void { ++$this->current; } + #[\Override] public function rewind(): void { $this->current = 1; } + #[\Override] public function valid(): bool { return 0 < $this->current diff --git a/src/Bundle/ChillMainBundle/Pagination/Paginator.php b/src/Bundle/ChillMainBundle/Pagination/Paginator.php index 34a405a20..31e484021 100644 --- a/src/Bundle/ChillMainBundle/Pagination/Paginator.php +++ b/src/Bundle/ChillMainBundle/Pagination/Paginator.php @@ -59,11 +59,13 @@ class Paginator implements PaginatorInterface protected string $itemPerPageKey ) {} + #[\Override] public function count(): int { return $this->countPages(); } + #[\Override] public function countPages(): int { if (0 === $this->itemPerPage) { @@ -83,16 +85,19 @@ class Paginator implements PaginatorInterface return 0 === $nb ? 1 : (int) $nb; } + #[\Override] public function getCurrentPage(): Page { return $this->getPage($this->currentPageNumber); } + #[\Override] public function getCurrentPageFirstItemNumber(): int { return $this->getCurrentPage()->getFirstItemNumber(); } + #[\Override] public function getItemsPerPage(): int { return $this->itemPerPage; @@ -101,6 +106,7 @@ class Paginator implements PaginatorInterface /** * @throws \RuntimeException if the next page does not exists */ + #[\Override] public function getNextPage(): Page { if (!$this->hasNextPage()) { @@ -110,6 +116,7 @@ class Paginator implements PaginatorInterface return $this->getPage($this->currentPageNumber + 1); } + #[\Override] public function getPage(int $number): Page { if (!$this->hasPage($number)) { @@ -129,6 +136,7 @@ class Paginator implements PaginatorInterface ); } + #[\Override] public function getPagesGenerator(): iterable { for ($i = 1; $this->countPages() >= $i; ++$i) { @@ -141,6 +149,7 @@ class Paginator implements PaginatorInterface * * @throws \RuntimeException if the next page does not exists */ + #[\Override] public function getPreviousPage(): PageInterface { if (!$this->hasPreviousPage()) { @@ -150,16 +159,19 @@ class Paginator implements PaginatorInterface return $this->getPage($this->currentPageNumber - 1); } + #[\Override] public function getTotalItems(): int { return $this->totalItems; } + #[\Override] public function hasNextPage(): bool { return $this->hasPage($this->currentPageNumber + 1); } + #[\Override] public function hasPage($number): bool { if (0 === $this->totalItems) { @@ -170,16 +182,19 @@ class Paginator implements PaginatorInterface && $this->countPages() >= $number; } + #[\Override] public function hasPreviousPage(): bool { return $this->hasPage($this->currentPageNumber - 1); } + #[\Override] public function isCurrentPage(PageInterface $page): bool { return $page->getNumber() === $this->currentPageNumber; } + #[\Override] public function setItemsPerPage(int $itemsPerPage) { $this->itemPerPage = $itemsPerPage; diff --git a/src/Bundle/ChillMainBundle/Pagination/PaginatorFactory.php b/src/Bundle/ChillMainBundle/Pagination/PaginatorFactory.php index 6453db4ae..d20957008 100644 --- a/src/Bundle/ChillMainBundle/Pagination/PaginatorFactory.php +++ b/src/Bundle/ChillMainBundle/Pagination/PaginatorFactory.php @@ -19,11 +19,11 @@ use Symfony\Component\Routing\RouterInterface; */ final readonly class PaginatorFactory implements PaginatorFactoryInterface { - final public const DEFAULT_CURRENT_PAGE_KEY = 'page'; + final public const string DEFAULT_CURRENT_PAGE_KEY = 'page'; - final public const DEFAULT_ITEM_PER_NUMBER_KEY = 'item_per_page'; + final public const string DEFAULT_ITEM_PER_NUMBER_KEY = 'item_per_page'; - final public const DEFAULT_PAGE_NUMBER = 1; + final public const int DEFAULT_PAGE_NUMBER = 1; public function __construct( /** @@ -50,6 +50,7 @@ final readonly class PaginatorFactory implements PaginatorFactoryInterface * @param string|null $route the specific route to use in pages * @param array|null $routeParameters the specific route parameters to use in pages */ + #[\Override] public function create( int $totalItems, ?string $route = null, @@ -67,6 +68,7 @@ final readonly class PaginatorFactory implements PaginatorFactoryInterface ); } + #[\Override] public function getCurrentItemsPerPage(): int { return $this->requestStack @@ -75,12 +77,14 @@ final readonly class PaginatorFactory implements PaginatorFactoryInterface ->getInt(self::DEFAULT_ITEM_PER_NUMBER_KEY, $this->itemPerPage); } + #[\Override] public function getCurrentPageFirstItemNumber(): int { return ($this->getCurrentPageNumber() - 1) * $this->getCurrentItemsPerPage(); } + #[\Override] public function getCurrentPageNumber(): int { return $this->requestStack diff --git a/src/Bundle/ChillMainBundle/Phonenumber/PhonenumberHelper.php b/src/Bundle/ChillMainBundle/Phonenumber/PhonenumberHelper.php index d08d393a3..7c2ef0b4f 100644 --- a/src/Bundle/ChillMainBundle/Phonenumber/PhonenumberHelper.php +++ b/src/Bundle/ChillMainBundle/Phonenumber/PhonenumberHelper.php @@ -25,9 +25,9 @@ use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface; final class PhonenumberHelper implements PhoneNumberHelperInterface { - public const FORMAT_URI = 'https://lookups.twilio.com/v1/PhoneNumbers/%s'; + public const string FORMAT_URI = 'https://lookups.twilio.com/v1/PhoneNumbers/%s'; - public const LOOKUP_URI = 'https://lookups.twilio.com/v1/PhoneNumbers/%s'; + public const string LOOKUP_URI = 'https://lookups.twilio.com/v1/PhoneNumbers/%s'; private readonly array $config; @@ -66,6 +66,7 @@ final class PhonenumberHelper implements PhoneNumberHelperInterface * * @throws NumberParseException */ + #[\Override] public function format(?PhoneNumber $phoneNumber = null): string { if (null === $phoneNumber) { @@ -79,6 +80,7 @@ final class PhonenumberHelper implements PhoneNumberHelperInterface /** * Get type (mobile, landline, ...) for phone number. */ + #[\Override] public function getType(PhoneNumber $phonenumber): string { return match ($this->phoneNumberUtil->getNumberType($phonenumber)) { @@ -91,6 +93,7 @@ final class PhonenumberHelper implements PhoneNumberHelperInterface /** * Return true if the validation is configured and available. */ + #[\Override] public function isPhonenumberValidationConfigured(): bool { return $this->isConfigured; @@ -102,6 +105,7 @@ final class PhonenumberHelper implements PhoneNumberHelperInterface * * @param string|PhoneNumber $phonenumber */ + #[\Override] public function isValidPhonenumberAny($phonenumber): bool { if (false === $this->isPhonenumberValidationConfigured()) { @@ -122,6 +126,7 @@ final class PhonenumberHelper implements PhoneNumberHelperInterface * * @param string|PhoneNumber $phonenumber */ + #[\Override] public function isValidPhonenumberLandOrVoip($phonenumber): bool { if (false === $this->isPhonenumberValidationConfigured()) { @@ -143,6 +148,7 @@ final class PhonenumberHelper implements PhoneNumberHelperInterface * * @param string|PhoneNumber $phonenumber */ + #[\Override] public function isValidPhonenumberMobile($phonenumber): bool { if (false === $this->isPhonenumberValidationConfigured()) { diff --git a/src/Bundle/ChillMainBundle/Phonenumber/Templating.php b/src/Bundle/ChillMainBundle/Phonenumber/Templating.php index 51d57c9e9..ad2297b4e 100644 --- a/src/Bundle/ChillMainBundle/Phonenumber/Templating.php +++ b/src/Bundle/ChillMainBundle/Phonenumber/Templating.php @@ -23,6 +23,7 @@ class Templating extends AbstractExtension return $this->phonenumberHelper->format($phonenumber) ?? $phonenumber; } + #[\Override] public function getFilters() { return [ diff --git a/src/Bundle/ChillMainBundle/Redis/RedisConnectionFactory.php b/src/Bundle/ChillMainBundle/Redis/RedisConnectionFactory.php index d41f9225f..efd0df6ad 100644 --- a/src/Bundle/ChillMainBundle/Redis/RedisConnectionFactory.php +++ b/src/Bundle/ChillMainBundle/Redis/RedisConnectionFactory.php @@ -42,6 +42,7 @@ final class RedisConnectionFactory implements EventSubscriberInterface return $this->redis; } + #[\Override] public static function getSubscribedEvents(): array { return [ diff --git a/src/Bundle/ChillMainBundle/Repository/AddressReferenceRepository.php b/src/Bundle/ChillMainBundle/Repository/AddressReferenceRepository.php index 3e8d060c3..7fd6764c0 100644 --- a/src/Bundle/ChillMainBundle/Repository/AddressReferenceRepository.php +++ b/src/Bundle/ChillMainBundle/Repository/AddressReferenceRepository.php @@ -52,6 +52,7 @@ final readonly class AddressReferenceRepository implements ObjectRepository return (int) $nq->getSingleResult()['c']; } + #[\Override] public function find($id, $lockMode = null, $lockVersion = null): ?AddressReference { return $this->repository->find($id, $lockMode, $lockVersion); @@ -60,6 +61,7 @@ final readonly class AddressReferenceRepository implements ObjectRepository /** * @return AddressReference[] */ + #[\Override] public function findAll(): array { return $this->repository->findAll(); @@ -71,6 +73,7 @@ final readonly class AddressReferenceRepository implements ObjectRepository * * @return AddressReference[] */ + #[\Override] public function findBy(array $criteria, ?array $orderBy = null, $limit = null, $offset = null): array { return $this->repository->findBy($criteria, $orderBy, $limit, $offset); @@ -103,11 +106,13 @@ final readonly class AddressReferenceRepository implements ObjectRepository ->getResult(); } + #[\Override] public function findOneBy(array $criteria, ?array $orderBy = null): ?AddressReference { return $this->repository->findOneBy($criteria, $orderBy); } + #[\Override] public function getClassName() { return AddressReference::class; diff --git a/src/Bundle/ChillMainBundle/Repository/AddressRepository.php b/src/Bundle/ChillMainBundle/Repository/AddressRepository.php index 4dbd09cab..7da3338ae 100644 --- a/src/Bundle/ChillMainBundle/Repository/AddressRepository.php +++ b/src/Bundle/ChillMainBundle/Repository/AddressRepository.php @@ -31,6 +31,7 @@ final readonly class AddressRepository implements ObjectRepository return $this->repository->createQueryBuilder($alias, $indexBy); } + #[\Override] public function find($id, $lockMode = null, $lockVersion = null): ?Address { return $this->repository->find($id, $lockMode, $lockVersion); @@ -39,6 +40,7 @@ final readonly class AddressRepository implements ObjectRepository /** * @return Address[] */ + #[\Override] public function findAll(): array { return $this->repository->findAll(); @@ -50,16 +52,19 @@ final readonly class AddressRepository implements ObjectRepository * * @return Address[] */ + #[\Override] public function findBy(array $criteria, ?array $orderBy = null, $limit = null, $offset = null): array { return $this->repository->findBy($criteria, $orderBy, $limit, $offset); } + #[\Override] public function findOneBy(array $criteria, ?array $orderBy = null): ?Address { return $this->repository->findOneBy($criteria, $orderBy); } + #[\Override] public function getClassName() { return Address::class; diff --git a/src/Bundle/ChillMainBundle/Repository/CenterRepository.php b/src/Bundle/ChillMainBundle/Repository/CenterRepository.php index 1bc5a7405..6e32abdab 100644 --- a/src/Bundle/ChillMainBundle/Repository/CenterRepository.php +++ b/src/Bundle/ChillMainBundle/Repository/CenterRepository.php @@ -24,6 +24,7 @@ final readonly class CenterRepository implements CenterRepositoryInterface $this->repository = $entityManager->getRepository(Center::class); } + #[\Override] public function find($id, $lockMode = null, $lockVersion = null): ?Center { return $this->repository->find($id, $lockMode, $lockVersion); @@ -32,6 +33,7 @@ final readonly class CenterRepository implements CenterRepositoryInterface /** * @return Center[] */ + #[\Override] public function findActive(): array { return $this->repository->findBy(['isActive' => true], ['name' => 'ASC']); @@ -40,6 +42,7 @@ final readonly class CenterRepository implements CenterRepositoryInterface /** * @return Center[] */ + #[\Override] public function findAll(): array { return $this->repository->findAll(); @@ -51,16 +54,19 @@ final readonly class CenterRepository implements CenterRepositoryInterface * * @return Center[] */ + #[\Override] public function findBy(array $criteria, ?array $orderBy = null, $limit = null, $offset = null): array { return $this->repository->findBy($criteria, $orderBy, $limit, $offset); } + #[\Override] public function findOneBy(array $criteria, ?array $orderBy = null): ?Center { return $this->repository->findOneBy($criteria, $orderBy); } + #[\Override] public function getClassName() { return Center::class; diff --git a/src/Bundle/ChillMainBundle/Repository/CivilityRepository.php b/src/Bundle/ChillMainBundle/Repository/CivilityRepository.php index 982d3dd4c..3ebee9e14 100644 --- a/src/Bundle/ChillMainBundle/Repository/CivilityRepository.php +++ b/src/Bundle/ChillMainBundle/Repository/CivilityRepository.php @@ -24,26 +24,31 @@ class CivilityRepository implements CivilityRepositoryInterface $this->repository = $entityManager->getRepository($this->getClassName()); } + #[\Override] public function find($id): ?Civility { return $this->repository->find($id); } + #[\Override] public function findAll(): array { return $this->repository->findAll(); } + #[\Override] public function findBy(array $criteria, ?array $orderBy = null, ?int $limit = null, ?int $offset = null): array { return $this->repository->findBy($criteria, $orderBy, $limit, $offset); } + #[\Override] public function findOneBy(array $criteria): ?Civility { return $this->repository->findOneBy($criteria); } + #[\Override] public function getClassName(): string { return Civility::class; diff --git a/src/Bundle/ChillMainBundle/Repository/CountryRepository.php b/src/Bundle/ChillMainBundle/Repository/CountryRepository.php index ae318e35e..1a505bdc4 100644 --- a/src/Bundle/ChillMainBundle/Repository/CountryRepository.php +++ b/src/Bundle/ChillMainBundle/Repository/CountryRepository.php @@ -31,6 +31,7 @@ final readonly class CountryRepository implements ObjectRepository return $this->repository->createQueryBuilder($alias, $indexBy); } + #[\Override] public function find($id, $lockMode = null, $lockVersion = null): ?Country { return $this->repository->find($id, $lockMode, $lockVersion); @@ -39,6 +40,7 @@ final readonly class CountryRepository implements ObjectRepository /** * @return Country[] */ + #[\Override] public function findAll(): array { return $this->repository->findAll(); @@ -50,16 +52,19 @@ final readonly class CountryRepository implements ObjectRepository * * @return Country[] */ + #[\Override] public function findBy(array $criteria, ?array $orderBy = null, $limit = null, $offset = null): array { return $this->repository->findBy($criteria, $orderBy, $limit, $offset); } + #[\Override] public function findOneBy(array $criteria, ?array $orderBy = null): ?Country { return $this->repository->findOneBy($criteria, $orderBy); } + #[\Override] public function getClassName() { return Country::class; diff --git a/src/Bundle/ChillMainBundle/Repository/CronJobExecutionRepository.php b/src/Bundle/ChillMainBundle/Repository/CronJobExecutionRepository.php index 1f369ef4e..36aeb2108 100644 --- a/src/Bundle/ChillMainBundle/Repository/CronJobExecutionRepository.php +++ b/src/Bundle/ChillMainBundle/Repository/CronJobExecutionRepository.php @@ -24,6 +24,7 @@ class CronJobExecutionRepository implements CronJobExecutionRepositoryInterface $this->repository = $entityManager->getRepository($this->getClassName()); } + #[\Override] public function find($id): ?CronJobExecution { return $this->repository->find($id); @@ -32,6 +33,7 @@ class CronJobExecutionRepository implements CronJobExecutionRepositoryInterface /** * @return array|CronJobExecution[] */ + #[\Override] public function findAll(): array { return $this->repository->findAll(); @@ -40,16 +42,19 @@ class CronJobExecutionRepository implements CronJobExecutionRepositoryInterface /** * @return array|CronJobExecution[] */ + #[\Override] public function findBy(array $criteria, ?array $orderBy = null, ?int $limit = null, ?int $offset = null): array { return $this->repository->findBy($criteria, $orderBy, $limit, $offset); } + #[\Override] public function findOneBy(array $criteria): ?CronJobExecution { return $this->repository->findOneBy($criteria); } + #[\Override] public function getClassName(): string { return CronJobExecution::class; diff --git a/src/Bundle/ChillMainBundle/Repository/GeographicalUnitLayerLayerRepository.php b/src/Bundle/ChillMainBundle/Repository/GeographicalUnitLayerLayerRepository.php index 1135b889d..a71b3a5b3 100644 --- a/src/Bundle/ChillMainBundle/Repository/GeographicalUnitLayerLayerRepository.php +++ b/src/Bundle/ChillMainBundle/Repository/GeographicalUnitLayerLayerRepository.php @@ -24,6 +24,7 @@ final readonly class GeographicalUnitLayerLayerRepository implements Geographica $this->repository = $em->getRepository($this->getClassName()); } + #[\Override] public function find($id): ?GeographicalUnitLayer { return $this->repository->find($id); @@ -32,11 +33,13 @@ final readonly class GeographicalUnitLayerLayerRepository implements Geographica /** * @return array|GeographicalUnitLayer[] */ + #[\Override] public function findAll(): array { return $this->repository->findAll(); } + #[\Override] public function findAllHavingUnits(): array { $qb = $this->repository->createQueryBuilder('l'); @@ -49,16 +52,19 @@ final readonly class GeographicalUnitLayerLayerRepository implements Geographica /** * @return array|GeographicalUnitLayer[] */ + #[\Override] public function findBy(array $criteria, ?array $orderBy = null, ?int $limit = null, ?int $offset = null): array { return $this->repository->findBy($criteria, $orderBy, $limit, $offset); } + #[\Override] public function findOneBy(array $criteria): ?GeographicalUnitLayer { return $this->repository->findOneBy($criteria); } + #[\Override] public function getClassName(): string { return GeographicalUnitLayer::class; diff --git a/src/Bundle/ChillMainBundle/Repository/GeographicalUnitRepository.php b/src/Bundle/ChillMainBundle/Repository/GeographicalUnitRepository.php index 35ec31ff3..dba57ed38 100644 --- a/src/Bundle/ChillMainBundle/Repository/GeographicalUnitRepository.php +++ b/src/Bundle/ChillMainBundle/Repository/GeographicalUnitRepository.php @@ -27,6 +27,7 @@ final readonly class GeographicalUnitRepository implements GeographicalUnitRepos $this->repository = $em->getRepository($this->getClassName()); } + #[\Override] public function countGeographicalUnitContainingAddress(Address $address): int { $qb = $this->buildQueryGeographicalUnitContainingAddress($address); @@ -37,6 +38,7 @@ final readonly class GeographicalUnitRepository implements GeographicalUnitRepos ->getSingleScalarResult(); } + #[\Override] public function findGeographicalUnitContainingAddress(Address $address, int $offset = 0, int $limit = 50): array { $qb = $this->buildQueryGeographicalUnitContainingAddress($address); @@ -65,6 +67,7 @@ final readonly class GeographicalUnitRepository implements GeographicalUnitRepos ; } + #[\Override] public function find($id): ?GeographicalUnit { return $this->repository->find($id); @@ -75,6 +78,7 @@ final readonly class GeographicalUnitRepository implements GeographicalUnitRepos * * @return array|GeographicalUnit[] */ + #[\Override] public function findAll(): array { return $this->repository @@ -86,16 +90,19 @@ final readonly class GeographicalUnitRepository implements GeographicalUnitRepos ->getResult(); } + #[\Override] public function findBy(array $criteria, ?array $orderBy = null, ?int $limit = null, ?int $offset = null): ?GeographicalUnit { return $this->repository->findBy($criteria, $orderBy, $limit, $offset); } + #[\Override] public function findOneBy(array $criteria): ?GeographicalUnit { return $this->repository->findOneBy($criteria); } + #[\Override] public function getClassName(): string { return GeographicalUnit::class; diff --git a/src/Bundle/ChillMainBundle/Repository/GroupCenterRepository.php b/src/Bundle/ChillMainBundle/Repository/GroupCenterRepository.php index d0f5d8561..516619c71 100644 --- a/src/Bundle/ChillMainBundle/Repository/GroupCenterRepository.php +++ b/src/Bundle/ChillMainBundle/Repository/GroupCenterRepository.php @@ -25,6 +25,7 @@ final readonly class GroupCenterRepository implements ObjectRepository $this->repository = $entityManager->getRepository(GroupCenter::class); } + #[\Override] public function find($id, $lockMode = null, $lockVersion = null): ?GroupCenter { return $this->repository->find($id, $lockMode, $lockVersion); @@ -33,6 +34,7 @@ final readonly class GroupCenterRepository implements ObjectRepository /** * @return GroupCenter[] */ + #[\Override] public function findAll(): array { return $this->repository->findAll(); @@ -44,16 +46,19 @@ final readonly class GroupCenterRepository implements ObjectRepository * * @return GroupCenter[] */ + #[\Override] public function findBy(array $criteria, ?array $orderBy = null, $limit = null, $offset = null): array { return $this->repository->findBy($criteria, $orderBy, $limit, $offset); } + #[\Override] public function findOneBy(array $criteria, ?array $orderBy = null): ?GroupCenter { return $this->repository->findOneBy($criteria, $orderBy); } + #[\Override] public function getClassName() { return GroupCenter::class; diff --git a/src/Bundle/ChillMainBundle/Repository/LanguageRepository.php b/src/Bundle/ChillMainBundle/Repository/LanguageRepository.php index 28d21d2c1..aa96a4ea8 100644 --- a/src/Bundle/ChillMainBundle/Repository/LanguageRepository.php +++ b/src/Bundle/ChillMainBundle/Repository/LanguageRepository.php @@ -24,6 +24,7 @@ final readonly class LanguageRepository implements LanguageRepositoryInterface $this->repository = $entityManager->getRepository($this->getClassName()); } + #[\Override] public function find($id, $lockMode = null, $lockVersion = null): ?Language { return $this->repository->find($id, $lockMode, $lockVersion); @@ -32,6 +33,7 @@ final readonly class LanguageRepository implements LanguageRepositoryInterface /** * @return Language[] */ + #[\Override] public function findAll(): array { return $this->repository->findAll(); @@ -43,16 +45,19 @@ final readonly class LanguageRepository implements LanguageRepositoryInterface * * @return Language[] */ + #[\Override] public function findBy(array $criteria, ?array $orderBy = null, $limit = null, $offset = null): array { return $this->repository->findBy($criteria, $orderBy, $limit, $offset); } + #[\Override] public function findOneBy(array $criteria, ?array $orderBy = null): ?Language { return $this->repository->findOneBy($criteria, $orderBy); } + #[\Override] public function getClassName(): string { return Language::class; diff --git a/src/Bundle/ChillMainBundle/Repository/NewsItemRepository.php b/src/Bundle/ChillMainBundle/Repository/NewsItemRepository.php index 4552e2a92..250c59b98 100644 --- a/src/Bundle/ChillMainBundle/Repository/NewsItemRepository.php +++ b/src/Bundle/ChillMainBundle/Repository/NewsItemRepository.php @@ -32,26 +32,31 @@ class NewsItemRepository implements ObjectRepository return $this->repository->createQueryBuilder($alias, $indexBy); } + #[\Override] public function find($id) { return $this->repository->find($id); } + #[\Override] public function findAll() { return $this->repository->findAll(); } + #[\Override] public function findBy(array $criteria, ?array $orderBy = null, ?int $limit = null, ?int $offset = null) { return $this->repository->findBy($criteria, $orderBy, $limit, $offset); } + #[\Override] public function findOneBy(array $criteria) { return $this->repository->findOneBy($criteria); } + #[\Override] public function getClassName() { return NewsItem::class; diff --git a/src/Bundle/ChillMainBundle/Repository/NotificationRepository.php b/src/Bundle/ChillMainBundle/Repository/NotificationRepository.php index ef7e05240..82d711d03 100644 --- a/src/Bundle/ChillMainBundle/Repository/NotificationRepository.php +++ b/src/Bundle/ChillMainBundle/Repository/NotificationRepository.php @@ -27,7 +27,7 @@ final class NotificationRepository implements ObjectRepository private readonly EntityRepository $repository; - private const BASE_COUNTER_SQL = <<<'SQL' + private const string BASE_COUNTER_SQL = <<<'SQL' SELECT SUM((EXISTS (SELECT 1 AS c FROM chill_main_notification_addresses_unread cmnau WHERE user_id = :userid and cmnau.notification_id = cmn.id))::int) AS unread, SUM((cmn.sender_id = :userid)::int) AS sent, @@ -135,6 +135,7 @@ final class NotificationRepository implements ObjectRepository return $qb->getQuery()->getSingleScalarResult(); } + #[\Override] public function find($id, $lockMode = null, $lockVersion = null): ?Notification { return $this->repository->find($id, $lockMode, $lockVersion); @@ -143,6 +144,7 @@ final class NotificationRepository implements ObjectRepository /** * @return Notification[] */ + #[\Override] public function findAll(): array { return $this->repository->findAll(); @@ -194,6 +196,7 @@ final class NotificationRepository implements ObjectRepository * * @return Notification[] */ + #[\Override] public function findBy(array $criteria, ?array $orderBy = null, $limit = null, $offset = null): array { return $this->repository->findBy($criteria, $orderBy, $limit, $offset); @@ -214,6 +217,7 @@ final class NotificationRepository implements ObjectRepository ->getResult(); } + #[\Override] public function findOneBy(array $criteria, ?array $orderBy = null): ?Notification { return $this->repository->findOneBy($criteria, $orderBy); @@ -242,6 +246,7 @@ final class NotificationRepository implements ObjectRepository return $nq->getResult(); } + #[\Override] public function getClassName() { return Notification::class; diff --git a/src/Bundle/ChillMainBundle/Repository/PermissionsGroupRepository.php b/src/Bundle/ChillMainBundle/Repository/PermissionsGroupRepository.php index 598894b61..b7c9280ee 100644 --- a/src/Bundle/ChillMainBundle/Repository/PermissionsGroupRepository.php +++ b/src/Bundle/ChillMainBundle/Repository/PermissionsGroupRepository.php @@ -25,6 +25,7 @@ final readonly class PermissionsGroupRepository implements ObjectRepository $this->repository = $entityManager->getRepository(PermissionsGroup::class); } + #[\Override] public function find($id, $lockMode = null, $lockVersion = null): ?PermissionsGroup { return $this->repository->find($id, $lockMode, $lockVersion); @@ -33,6 +34,7 @@ final readonly class PermissionsGroupRepository implements ObjectRepository /** * @return PermissionsGroup[] */ + #[\Override] public function findAll(): array { return $this->repository->findAll(); @@ -57,16 +59,19 @@ final readonly class PermissionsGroupRepository implements ObjectRepository * * @return PermissionsGroup[] */ + #[\Override] public function findBy(array $criteria, ?array $orderBy = null, $limit = null, $offset = null): array { return $this->repository->findBy($criteria, $orderBy, $limit, $offset); } + #[\Override] public function findOneBy(array $criteria, ?array $orderBy = null): ?PermissionsGroup { return $this->repository->findOneBy($criteria, $orderBy); } + #[\Override] public function getClassName() { return PermissionsGroup::class; diff --git a/src/Bundle/ChillMainBundle/Repository/PostalCodeRepository.php b/src/Bundle/ChillMainBundle/Repository/PostalCodeRepository.php index 0779ea90a..e6f96fdff 100644 --- a/src/Bundle/ChillMainBundle/Repository/PostalCodeRepository.php +++ b/src/Bundle/ChillMainBundle/Repository/PostalCodeRepository.php @@ -31,6 +31,7 @@ final readonly class PostalCodeRepository implements PostalCodeRepositoryInterfa $this->entityManager = $entityManager; } + #[\Override] public function countByPattern(string $pattern, ?Country $country): int { $query = $this->buildQueryByPattern($pattern, $country); @@ -44,21 +45,25 @@ final readonly class PostalCodeRepository implements PostalCodeRepositoryInterfa return (int) $nq->getSingleResult()['c']; } + #[\Override] public function find($id, $lockMode = null, $lockVersion = null): ?PostalCode { return $this->repository->find($id, $lockMode, $lockVersion); } + #[\Override] public function findAll(): array { return $this->repository->findAll(); } + #[\Override] public function findBy(array $criteria, ?array $orderBy = null, $limit = null, $offset = null): array { return $this->repository->findBy($criteria, $orderBy, $limit, $offset); } + #[\Override] public function findByPattern(string $pattern, ?Country $country, ?int $start = 0, ?int $limit = 50): array { $query = $this->buildQueryByPattern($pattern, $country); @@ -79,11 +84,13 @@ final readonly class PostalCodeRepository implements PostalCodeRepositoryInterfa ->getResult(); } + #[\Override] public function findOneBy(array $criteria, ?array $orderBy = null): ?PostalCode { return $this->repository->findOneBy($criteria, $orderBy); } + #[\Override] public function getClassName(): string { return PostalCode::class; diff --git a/src/Bundle/ChillMainBundle/Repository/RegroupmentRepository.php b/src/Bundle/ChillMainBundle/Repository/RegroupmentRepository.php index 793015f5b..c6677be3f 100644 --- a/src/Bundle/ChillMainBundle/Repository/RegroupmentRepository.php +++ b/src/Bundle/ChillMainBundle/Repository/RegroupmentRepository.php @@ -27,6 +27,7 @@ final readonly class RegroupmentRepository implements ObjectRepository $this->repository = $entityManager->getRepository(Regroupment::class); } + #[\Override] public function find($id, $lockMode = null, $lockVersion = null): ?Regroupment { return $this->repository->find($id, $lockMode, $lockVersion); @@ -35,6 +36,7 @@ final readonly class RegroupmentRepository implements ObjectRepository /** * @return Regroupment[] */ + #[\Override] public function findAll(): array { return $this->repository->findAll(); @@ -51,11 +53,13 @@ final readonly class RegroupmentRepository implements ObjectRepository * * @return Regroupment[] */ + #[\Override] public function findBy(array $criteria, ?array $orderBy = null, $limit = null, $offset = null): array { return $this->repository->findBy($criteria, $orderBy, $limit, $offset); } + #[\Override] public function findOneBy(array $criteria, ?array $orderBy = null): ?Regroupment { return $this->repository->findOneBy($criteria, $orderBy); @@ -85,6 +89,7 @@ final readonly class RegroupmentRepository implements ObjectRepository ->getResult(); } + #[\Override] public function getClassName() { return Regroupment::class; diff --git a/src/Bundle/ChillMainBundle/Repository/RoleScopeRepository.php b/src/Bundle/ChillMainBundle/Repository/RoleScopeRepository.php index a00d2ce35..81c46b97a 100644 --- a/src/Bundle/ChillMainBundle/Repository/RoleScopeRepository.php +++ b/src/Bundle/ChillMainBundle/Repository/RoleScopeRepository.php @@ -25,6 +25,7 @@ final readonly class RoleScopeRepository implements ObjectRepository $this->repository = $entityManager->getRepository(RoleScope::class); } + #[\Override] public function find($id, $lockMode = null, $lockVersion = null): ?RoleScope { return $this->repository->find($id, $lockMode, $lockVersion); @@ -33,6 +34,7 @@ final readonly class RoleScopeRepository implements ObjectRepository /** * @return RoleScope[] */ + #[\Override] public function findAll(): array { return $this->repository->findAll(); @@ -44,16 +46,19 @@ final readonly class RoleScopeRepository implements ObjectRepository * * @return RoleScope[] */ + #[\Override] public function findBy(array $criteria, ?array $orderBy = null, $limit = null, $offset = null): array { return $this->repository->findBy($criteria, $orderBy, $limit, $offset); } + #[\Override] public function findOneBy(array $criteria, ?array $orderBy = null): ?RoleScope { return $this->repository->findOneBy($criteria, $orderBy); } + #[\Override] public function getClassName() { return RoleScope::class; diff --git a/src/Bundle/ChillMainBundle/Repository/SavedExportRepository.php b/src/Bundle/ChillMainBundle/Repository/SavedExportRepository.php index 702fdf7d6..b673e4f59 100644 --- a/src/Bundle/ChillMainBundle/Repository/SavedExportRepository.php +++ b/src/Bundle/ChillMainBundle/Repository/SavedExportRepository.php @@ -29,6 +29,7 @@ class SavedExportRepository implements SavedExportRepositoryInterface $this->repository = $entityManager->getRepository($this->getClassName()); } + #[\Override] public function find($id): ?SavedExport { return $this->repository->find($id); @@ -37,16 +38,19 @@ class SavedExportRepository implements SavedExportRepositoryInterface /** * @return array|SavedExport[] */ + #[\Override] public function findAll(): array { return $this->repository->findAll(); } + #[\Override] public function findBy(array $criteria, ?array $orderBy = null, ?int $limit = null, ?int $offset = null): array { return $this->repository->findBy($criteria, $orderBy, $limit, $offset); } + #[\Override] public function findByUser(User $user, ?array $orderBy = [], ?int $limit = null, ?int $offset = null): array { $qb = $this->repository->createQueryBuilder('se'); @@ -70,11 +74,13 @@ class SavedExportRepository implements SavedExportRepositoryInterface return $qb->getQuery()->getResult(); } + #[\Override] public function findOneBy(array $criteria): ?SavedExport { return $this->repository->findOneBy($criteria); } + #[\Override] public function getClassName(): string { return SavedExport::class; diff --git a/src/Bundle/ChillMainBundle/Repository/ScopeRepository.php b/src/Bundle/ChillMainBundle/Repository/ScopeRepository.php index 4f752bce0..1d5c819f0 100644 --- a/src/Bundle/ChillMainBundle/Repository/ScopeRepository.php +++ b/src/Bundle/ChillMainBundle/Repository/ScopeRepository.php @@ -26,11 +26,13 @@ final readonly class ScopeRepository implements ScopeRepositoryInterface $this->repository = $entityManager->getRepository(Scope::class); } + #[\Override] public function createQueryBuilder($alias, $indexBy = null): QueryBuilder { return $this->repository->createQueryBuilder($alias, $indexBy); } + #[\Override] public function find($id, $lockMode = null, $lockVersion = null): ?Scope { return $this->repository->find($id, $lockMode, $lockVersion); @@ -39,11 +41,13 @@ final readonly class ScopeRepository implements ScopeRepositoryInterface /** * @return Scope[] */ + #[\Override] public function findAll(): array { return $this->repository->findAll(); } + #[\Override] public function findAllActive(): array { $scopes = $this->repository->findBy(['active' => true]); @@ -59,16 +63,19 @@ final readonly class ScopeRepository implements ScopeRepositoryInterface * * @return Scope[] */ + #[\Override] public function findBy(array $criteria, ?array $orderBy = null, $limit = null, $offset = null): array { return $this->repository->findBy($criteria, $orderBy, $limit, $offset); } + #[\Override] public function findOneBy(array $criteria, ?array $orderBy = null): ?Scope { return $this->repository->findOneBy($criteria, $orderBy); } + #[\Override] public function getClassName(): string { return Scope::class; diff --git a/src/Bundle/ChillMainBundle/Repository/UserACLAwareRepository.php b/src/Bundle/ChillMainBundle/Repository/UserACLAwareRepository.php index f14424f6f..8d7805f5e 100644 --- a/src/Bundle/ChillMainBundle/Repository/UserACLAwareRepository.php +++ b/src/Bundle/ChillMainBundle/Repository/UserACLAwareRepository.php @@ -21,6 +21,7 @@ class UserACLAwareRepository implements UserACLAwareRepositoryInterface { public function __construct(private readonly ParentRoleHelper $parentRoleHelper, private readonly EntityManagerInterface $em) {} + #[\Override] public function findUsersByReachedACL(string $role, $center, $scope = null, bool $onlyEnabled = true): array { $parents = $this->parentRoleHelper->getParentRoles($role); diff --git a/src/Bundle/ChillMainBundle/Repository/UserJobRepository.php b/src/Bundle/ChillMainBundle/Repository/UserJobRepository.php index 6b793a2c8..2b0570f41 100644 --- a/src/Bundle/ChillMainBundle/Repository/UserJobRepository.php +++ b/src/Bundle/ChillMainBundle/Repository/UserJobRepository.php @@ -25,6 +25,7 @@ readonly class UserJobRepository implements UserJobRepositoryInterface $this->repository = $em->getRepository(UserJob::class); } + #[\Override] public function find($id): ?UserJob { return $this->repository->find($id); @@ -33,11 +34,13 @@ readonly class UserJobRepository implements UserJobRepositoryInterface /** * @return array|UserJob[] */ + #[\Override] public function findAll(): array { return $this->repository->findAll(); } + #[\Override] public function findAllActive(): array { $jobs = $this->repository->findBy(['active' => true]); @@ -47,6 +50,7 @@ readonly class UserJobRepository implements UserJobRepositoryInterface return $jobs; } + #[\Override] public function findAllOrderedByName(): array { $jobs = $this->findAll(); @@ -62,16 +66,19 @@ readonly class UserJobRepository implements UserJobRepositoryInterface * * @return array|object[]|UserJob[] */ + #[\Override] public function findBy(array $criteria, ?array $orderBy = null, $limit = null, $offset = null) { return $this->repository->findBy($criteria, $orderBy, $limit, $offset); } + #[\Override] public function findOneBy(array $criteria): ?UserJob { return $this->repository->findOneBy($criteria); } + #[\Override] public function getClassName(): string { return UserJob::class; diff --git a/src/Bundle/ChillMainBundle/Repository/UserRepository.php b/src/Bundle/ChillMainBundle/Repository/UserRepository.php index 5c5dff4d0..4b02c324a 100644 --- a/src/Bundle/ChillMainBundle/Repository/UserRepository.php +++ b/src/Bundle/ChillMainBundle/Repository/UserRepository.php @@ -26,7 +26,7 @@ final readonly class UserRepository implements UserRepositoryInterface { private EntityRepository $repository; - private const FIELDS = ['id', 'email', 'enabled', 'civility_id', 'civility_abbreviation', 'civility_name', 'label', 'mainCenter_id', + private const array FIELDS = ['id', 'email', 'enabled', 'civility_id', 'civility_abbreviation', 'civility_name', 'label', 'mainCenter_id', 'mainCenter_name', 'mainScope_id', 'mainScope_name', 'userJob_id', 'userJob_name', 'currentLocation_id', 'currentLocation_name', 'mainLocation_id', 'mainLocation_name']; @@ -35,16 +35,19 @@ final readonly class UserRepository implements UserRepositoryInterface $this->repository = $entityManager->getRepository(User::class); } + #[\Override] public function countBy(array $criteria): int { return $this->repository->count($criteria); } + #[\Override] public function countByActive(): int { return $this->countBy(['enabled' => true]); } + #[\Override] public function countByNotHavingAttribute(string $key): int { $rsm = new ResultSetMapping(); @@ -55,6 +58,7 @@ final readonly class UserRepository implements UserRepositoryInterface return $this->entityManager->createNativeQuery($sql, $rsm)->setParameter(':key', $key)->getSingleScalarResult(); } + #[\Override] public function countByUsernameOrEmail(string $pattern): int { $qb = $this->queryByUsernameOrEmail($pattern); @@ -64,6 +68,7 @@ final readonly class UserRepository implements UserRepositoryInterface return (int) $qb->getQuery()->getSingleScalarResult(); } + #[\Override] public function find($id, $lockMode = null, $lockVersion = null): ?User { return $this->repository->find($id, $lockMode, $lockVersion); @@ -72,6 +77,7 @@ final readonly class UserRepository implements UserRepositoryInterface /** * @return User[] */ + #[\Override] public function findAll(): array { return $this->repository->findAll(); @@ -80,6 +86,7 @@ final readonly class UserRepository implements UserRepositoryInterface /** * @throws Exception */ + #[\Override] public function findAllAsArray(string $lang): iterable { $sql = sprintf(<<<'SQL' @@ -130,6 +137,7 @@ final readonly class UserRepository implements UserRepositoryInterface } } + #[\Override] public function findAllUserACLAsArray(): iterable { $sql = <<<'SQL' @@ -164,6 +172,7 @@ final readonly class UserRepository implements UserRepositoryInterface * * @return User[] */ + #[\Override] public function findBy(array $criteria, ?array $orderBy = null, $limit = null, $offset = null): array { return $this->repository->findBy($criteria, $orderBy, $limit, $offset); @@ -172,6 +181,7 @@ final readonly class UserRepository implements UserRepositoryInterface /** * @return array|User[] */ + #[\Override] public function findByActive(?array $orderBy = null, ?int $limit = null, ?int $offset = null): array { return $this->findBy(['enabled' => true], $orderBy, $limit, $offset); @@ -182,6 +192,7 @@ final readonly class UserRepository implements UserRepositoryInterface * * @return array|User[] */ + #[\Override] public function findByNotHavingAttribute(string $key, ?int $limit = null, ?int $offset = null): array { $rsm = new ResultSetMappingBuilder($this->entityManager); @@ -200,6 +211,7 @@ final readonly class UserRepository implements UserRepositoryInterface return $this->entityManager->createNativeQuery($sql, $rsm)->setParameter(':key', $key)->getResult(); } + #[\Override] public function findByUsernameOrEmail(string $pattern, ?array $orderBy = [], ?int $limit = null, ?int $offset = null): array { $qb = $this->queryByUsernameOrEmail($pattern); @@ -221,11 +233,13 @@ final readonly class UserRepository implements UserRepositoryInterface return $qb->getQuery()->getResult(); } + #[\Override] public function findOneBy(array $criteria, ?array $orderBy = null): ?User { return $this->repository->findOneBy($criteria, $orderBy); } + #[\Override] public function findOneByUsernameOrEmail(string $pattern): ?User { $qb = $this->queryByUsernameOrEmail($pattern)->select('u'); @@ -246,6 +260,7 @@ final readonly class UserRepository implements UserRepositoryInterface * * @param \Chill\MainBundle\Entity\User[] $amongstUsers */ + #[\Override] public function findUsersHavingFlags($flag, array $amongstUsers = []): array { $gcs = $this @@ -291,6 +306,7 @@ final readonly class UserRepository implements UserRepositoryInterface return $qb->getQuery()->getResult(); } + #[\Override] public function getClassName(): string { return User::class; diff --git a/src/Bundle/ChillMainBundle/Repository/Workflow/EntityWorkflowRepository.php b/src/Bundle/ChillMainBundle/Repository/Workflow/EntityWorkflowRepository.php index 66b3ab379..b19da49fd 100644 --- a/src/Bundle/ChillMainBundle/Repository/Workflow/EntityWorkflowRepository.php +++ b/src/Bundle/ChillMainBundle/Repository/Workflow/EntityWorkflowRepository.php @@ -86,6 +86,7 @@ class EntityWorkflowRepository implements ObjectRepository return $qb->select('COUNT(w)')->getQuery()->getSingleScalarResult(); } + #[\Override] public function find($id): ?EntityWorkflow { return $this->repository->find($id); @@ -94,6 +95,7 @@ class EntityWorkflowRepository implements ObjectRepository /** * @return array|EntityWorkflow[] */ + #[\Override] public function findAll(): array { return $this->repository->findAll(); @@ -105,6 +107,7 @@ class EntityWorkflowRepository implements ObjectRepository * * @return array|EntityWorkflow[] */ + #[\Override] public function findBy(array $criteria, ?array $orderBy = null, $limit = null, $offset = null): array { return $this->repository->findBy($criteria, $orderBy, $limit, $offset); @@ -175,11 +178,13 @@ class EntityWorkflowRepository implements ObjectRepository return $qb->getQuery()->getResult(); } + #[\Override] public function findOneBy(array $criteria): ?EntityWorkflow { return $this->repository->findOneBy($criteria); } + #[\Override] public function getClassName(): string { return EntityWorkflow::class; diff --git a/src/Bundle/ChillMainBundle/Repository/Workflow/EntityWorkflowStepRepository.php b/src/Bundle/ChillMainBundle/Repository/Workflow/EntityWorkflowStepRepository.php index 545ec2873..14de3c85a 100644 --- a/src/Bundle/ChillMainBundle/Repository/Workflow/EntityWorkflowStepRepository.php +++ b/src/Bundle/ChillMainBundle/Repository/Workflow/EntityWorkflowStepRepository.php @@ -34,26 +34,31 @@ class EntityWorkflowStepRepository implements ObjectRepository return (int) $qb->getQuery()->getSingleScalarResult(); } + #[\Override] public function find($id): ?EntityWorkflowStep { return $this->repository->find($id); } + #[\Override] public function findAll(): array { return $this->repository->findAll(); } + #[\Override] public function findBy(array $criteria, ?array $orderBy = null, $limit = null, $offset = null): array { return $this->repository->findBy($criteria, $orderBy, $limit, $offset); } + #[\Override] public function findOneBy(array $criteria): ?EntityWorkflowStep { return $this->repository->findOneBy($criteria); } + #[\Override] public function getClassName() { return EntityWorkflowStep::class; diff --git a/src/Bundle/ChillMainBundle/Routing/Loader/ChillRoutesLoader.php b/src/Bundle/ChillMainBundle/Routing/Loader/ChillRoutesLoader.php index 37faf98ab..5d0a3af48 100644 --- a/src/Bundle/ChillMainBundle/Routing/Loader/ChillRoutesLoader.php +++ b/src/Bundle/ChillMainBundle/Routing/Loader/ChillRoutesLoader.php @@ -27,6 +27,7 @@ class ChillRoutesLoader extends Loader parent::__construct(); } + #[\Override] public function load($resource, $type = null) { $collection = new RouteCollection(); @@ -40,6 +41,7 @@ class ChillRoutesLoader extends Loader return $collection; } + #[\Override] public function supports($resource, $type = null) { return 'chill_routes' === $type; diff --git a/src/Bundle/ChillMainBundle/Routing/MenuBuilder/AdminLanguageMenuBuilder.php b/src/Bundle/ChillMainBundle/Routing/MenuBuilder/AdminLanguageMenuBuilder.php index 0d91a0438..978278823 100644 --- a/src/Bundle/ChillMainBundle/Routing/MenuBuilder/AdminLanguageMenuBuilder.php +++ b/src/Bundle/ChillMainBundle/Routing/MenuBuilder/AdminLanguageMenuBuilder.php @@ -27,6 +27,7 @@ class AdminLanguageMenuBuilder implements LocalMenuBuilderInterface $this->authorizationChecker = $authorizationChecker; } + #[\Override] public function buildMenu($menuId, MenuItem $menu, array $parameters) { // all the entries below must have ROLE_ADMIN permissions @@ -50,6 +51,7 @@ class AdminLanguageMenuBuilder implements LocalMenuBuilderInterface ])->setExtras(['order' => 1220]); } + #[\Override] public static function getMenuIds(): array { return ['admin_section', 'admin_language']; diff --git a/src/Bundle/ChillMainBundle/Routing/MenuBuilder/AdminLocationMenuBuilder.php b/src/Bundle/ChillMainBundle/Routing/MenuBuilder/AdminLocationMenuBuilder.php index b69399daf..456e0a23e 100644 --- a/src/Bundle/ChillMainBundle/Routing/MenuBuilder/AdminLocationMenuBuilder.php +++ b/src/Bundle/ChillMainBundle/Routing/MenuBuilder/AdminLocationMenuBuilder.php @@ -27,6 +27,7 @@ class AdminLocationMenuBuilder implements LocalMenuBuilderInterface $this->authorizationChecker = $authorizationChecker; } + #[\Override] public function buildMenu($menuId, MenuItem $menu, array $parameters) { // all the entries below must have ROLE_ADMIN permissions @@ -51,6 +52,7 @@ class AdminLocationMenuBuilder implements LocalMenuBuilderInterface ])->setExtras(['order' => 1320]); } + #[\Override] public static function getMenuIds(): array { return ['admin_section', 'admin_location']; diff --git a/src/Bundle/ChillMainBundle/Routing/MenuBuilder/AdminNewsMenuBuilder.php b/src/Bundle/ChillMainBundle/Routing/MenuBuilder/AdminNewsMenuBuilder.php index 08e72884f..44de1dbd6 100644 --- a/src/Bundle/ChillMainBundle/Routing/MenuBuilder/AdminNewsMenuBuilder.php +++ b/src/Bundle/ChillMainBundle/Routing/MenuBuilder/AdminNewsMenuBuilder.php @@ -19,6 +19,7 @@ class AdminNewsMenuBuilder implements LocalMenuBuilderInterface { public function __construct(private readonly AuthorizationCheckerInterface $authorizationChecker) {} + #[\Override] public function buildMenu($menuId, MenuItem $menu, array $parameters) { if (!$this->authorizationChecker->isGranted('ROLE_ADMIN')) { @@ -38,6 +39,7 @@ class AdminNewsMenuBuilder implements LocalMenuBuilderInterface ])->setExtras(['order' => 9000]); } + #[\Override] public static function getMenuIds(): array { return ['admin_section', 'admin_news_item']; diff --git a/src/Bundle/ChillMainBundle/Routing/MenuBuilder/AdminUserMenuBuilder.php b/src/Bundle/ChillMainBundle/Routing/MenuBuilder/AdminUserMenuBuilder.php index 809733287..96b03a81b 100644 --- a/src/Bundle/ChillMainBundle/Routing/MenuBuilder/AdminUserMenuBuilder.php +++ b/src/Bundle/ChillMainBundle/Routing/MenuBuilder/AdminUserMenuBuilder.php @@ -30,6 +30,7 @@ class AdminUserMenuBuilder implements LocalMenuBuilderInterface $this->authorizationChecker = $authorizationChecker; } + #[\Override] public function buildMenu($menuId, MenuItem $menu, array $parameters) { // all the entries below must have ROLE_ADMIN permissions @@ -72,6 +73,7 @@ class AdminUserMenuBuilder implements LocalMenuBuilderInterface ])->setExtras(['order' => 1050]); } + #[\Override] public static function getMenuIds(): array { return ['admin_section', 'admin_user']; diff --git a/src/Bundle/ChillMainBundle/Routing/MenuBuilder/SectionMenuBuilder.php b/src/Bundle/ChillMainBundle/Routing/MenuBuilder/SectionMenuBuilder.php index ab73932b5..ba7e0cf4d 100644 --- a/src/Bundle/ChillMainBundle/Routing/MenuBuilder/SectionMenuBuilder.php +++ b/src/Bundle/ChillMainBundle/Routing/MenuBuilder/SectionMenuBuilder.php @@ -28,6 +28,7 @@ class SectionMenuBuilder implements LocalMenuBuilderInterface */ public function __construct(protected AuthorizationCheckerInterface $authorizationChecker, protected TranslatorInterface $translator, protected ParameterBagInterface $parameterBag) {} + #[\Override] public function buildMenu($menuId, MenuItem $menu, array $parameters) { $menu->addChild($this->translator->trans('Homepage'), [ @@ -68,6 +69,7 @@ class SectionMenuBuilder implements LocalMenuBuilderInterface ]); } + #[\Override] public static function getMenuIds(): array { return ['section']; diff --git a/src/Bundle/ChillMainBundle/Routing/MenuBuilder/UserMenuBuilder.php b/src/Bundle/ChillMainBundle/Routing/MenuBuilder/UserMenuBuilder.php index 3427face3..2c40fd64a 100644 --- a/src/Bundle/ChillMainBundle/Routing/MenuBuilder/UserMenuBuilder.php +++ b/src/Bundle/ChillMainBundle/Routing/MenuBuilder/UserMenuBuilder.php @@ -24,6 +24,7 @@ class UserMenuBuilder implements LocalMenuBuilderInterface { public function __construct(private readonly NotificationByUserCounter $notificationByUserCounter, private readonly WorkflowByUserCounter $workflowByUserCounter, private readonly Security $security, private readonly TranslatorInterface $translator, protected ParameterBagInterface $parameterBag, private readonly RequestStack $requestStack) {} + #[\Override] public function buildMenu($menuId, \Knp\Menu\MenuItem $menu, array $parameters) { $user = $this->security->getUser(); @@ -116,6 +117,7 @@ class UserMenuBuilder implements LocalMenuBuilderInterface ]); } + #[\Override] public static function getMenuIds(): array { return ['user']; diff --git a/src/Bundle/ChillMainBundle/Routing/MenuTwig.php b/src/Bundle/ChillMainBundle/Routing/MenuTwig.php index 3b6ce7e02..b4127c0ae 100644 --- a/src/Bundle/ChillMainBundle/Routing/MenuTwig.php +++ b/src/Bundle/ChillMainBundle/Routing/MenuTwig.php @@ -63,6 +63,7 @@ class MenuTwig extends AbstractExtension return $env->render($layout, $resolvedParams); } + #[\Override] public function getFunctions() { return [new TwigFunction( diff --git a/src/Bundle/ChillMainBundle/Search/Entity/SearchUserApiProvider.php b/src/Bundle/ChillMainBundle/Search/Entity/SearchUserApiProvider.php index 12568287d..6d2197bd9 100644 --- a/src/Bundle/ChillMainBundle/Search/Entity/SearchUserApiProvider.php +++ b/src/Bundle/ChillMainBundle/Search/Entity/SearchUserApiProvider.php @@ -19,11 +19,13 @@ class SearchUserApiProvider implements SearchApiInterface { public function __construct(private readonly UserRepository $userRepository) {} + #[\Override] public function getResult(string $key, array $metadata, float $pertinence) { return $this->userRepository->find($metadata['id']); } + #[\Override] public function prepare(array $metadatas): void { $ids = \array_map(static fn ($m) => $m['id'], $metadatas); @@ -31,6 +33,7 @@ class SearchUserApiProvider implements SearchApiInterface $this->userRepository->findBy(['id' => $ids]); } + #[\Override] public function provideQuery(string $pattern, array $parameters): SearchApiQuery { $query = new SearchApiQuery(); @@ -51,11 +54,13 @@ class SearchUserApiProvider implements SearchApiInterface return $query; } + #[\Override] public function supportsResult(string $key, array $metadatas): bool { return 'user' === $key; } + #[\Override] public function supportsTypes(string $pattern, array $types, array $parameters): bool { return \in_array('user', $types, true); diff --git a/src/Bundle/ChillMainBundle/Search/Utils/ExtractDateFromPattern.php b/src/Bundle/ChillMainBundle/Search/Utils/ExtractDateFromPattern.php index 9cce3fa13..e1d2fe6c2 100644 --- a/src/Bundle/ChillMainBundle/Search/Utils/ExtractDateFromPattern.php +++ b/src/Bundle/ChillMainBundle/Search/Utils/ExtractDateFromPattern.php @@ -13,7 +13,7 @@ namespace Chill\MainBundle\Search\Utils; class ExtractDateFromPattern { - private const DATE_PATTERN = [ + private const array DATE_PATTERN = [ ['([12]\d{3}-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01]))', 'Y-m-d'], // 1981-05-12 ['((0[1-9]|[12]\d|3[01])\/(0[1-9]|1[0-2])\/([12]\d{3}))', 'd/m/Y'], // 15/12/1980 ['((0[1-9]|[12]\d|3[01])-(0[1-9]|1[0-2])-([12]\d{3}))', 'd-m-Y'], // 15/12/1980 diff --git a/src/Bundle/ChillMainBundle/Search/Utils/ExtractPhonenumberFromPattern.php b/src/Bundle/ChillMainBundle/Search/Utils/ExtractPhonenumberFromPattern.php index 2be3d54db..f1e0a29d7 100644 --- a/src/Bundle/ChillMainBundle/Search/Utils/ExtractPhonenumberFromPattern.php +++ b/src/Bundle/ChillMainBundle/Search/Utils/ExtractPhonenumberFromPattern.php @@ -16,7 +16,7 @@ use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface; class ExtractPhonenumberFromPattern { - private const PATTERN = '([\+]{0,1}[0-9\ ]{5,})'; + private const string PATTERN = '([\+]{0,1}[0-9\ ]{5,})'; private readonly string $defaultCarrierCode; diff --git a/src/Bundle/ChillMainBundle/Security/Authorization/AuthorizationHelper.php b/src/Bundle/ChillMainBundle/Security/Authorization/AuthorizationHelper.php index 098b741e6..eeedc0aee 100644 --- a/src/Bundle/ChillMainBundle/Security/Authorization/AuthorizationHelper.php +++ b/src/Bundle/ChillMainBundle/Security/Authorization/AuthorizationHelper.php @@ -85,6 +85,7 @@ class AuthorizationHelper implements AuthorizationHelperInterface * * @return list
*/ + #[\Override] public function getReachableCenters(UserInterface $user, string $role, ?Scope $scope = null): array { if (!$user instanceof User) { @@ -157,6 +158,7 @@ class AuthorizationHelper implements AuthorizationHelperInterface /** * Return all reachable scope for a given user, center and role. */ + #[\Override] public function getReachableScopes(UserInterface $user, string $role, array|Center $center): array { return $this->getReachableCircles($user, $role, $center); diff --git a/src/Bundle/ChillMainBundle/Security/Authorization/AuthorizationHelperForCurrentUser.php b/src/Bundle/ChillMainBundle/Security/Authorization/AuthorizationHelperForCurrentUser.php index bb59cc003..4ad07f192 100644 --- a/src/Bundle/ChillMainBundle/Security/Authorization/AuthorizationHelperForCurrentUser.php +++ b/src/Bundle/ChillMainBundle/Security/Authorization/AuthorizationHelperForCurrentUser.php @@ -19,6 +19,7 @@ class AuthorizationHelperForCurrentUser implements AuthorizationHelperForCurrent { public function __construct(private readonly AuthorizationHelperInterface $authorizationHelper, private readonly Security $security) {} + #[\Override] public function getReachableCenters(string $role, ?Scope $scope = null): array { if (!$this->security->getUser() instanceof User) { @@ -28,6 +29,7 @@ class AuthorizationHelperForCurrentUser implements AuthorizationHelperForCurrent return $this->authorizationHelper->getReachableCenters($this->security->getUser(), $role, $scope); } + #[\Override] public function getReachableScopes(string $role, $center): array { if (!$this->security->getUser() instanceof User) { diff --git a/src/Bundle/ChillMainBundle/Security/Authorization/ChillExportVoter.php b/src/Bundle/ChillMainBundle/Security/Authorization/ChillExportVoter.php index 10552d1f7..04395206a 100644 --- a/src/Bundle/ChillMainBundle/Security/Authorization/ChillExportVoter.php +++ b/src/Bundle/ChillMainBundle/Security/Authorization/ChillExportVoter.php @@ -16,7 +16,7 @@ use Symfony\Component\Security\Core\Authorization\Voter\Voter; class ChillExportVoter extends Voter { - final public const EXPORT = 'chill_export'; + final public const string EXPORT = 'chill_export'; private readonly VoterHelperInterface $helper; @@ -28,11 +28,13 @@ class ChillExportVoter extends Voter ->build(); } + #[\Override] protected function supports($attribute, $subject): bool { return $this->helper->supports($attribute, $subject); } + #[\Override] protected function voteOnAttribute($attribute, $subject, TokenInterface $token): bool { return $this->helper->voteOnAttribute($attribute, $subject, $token); diff --git a/src/Bundle/ChillMainBundle/Security/Authorization/DefaultVoterHelper.php b/src/Bundle/ChillMainBundle/Security/Authorization/DefaultVoterHelper.php index 071388fcf..f85d759a1 100644 --- a/src/Bundle/ChillMainBundle/Security/Authorization/DefaultVoterHelper.php +++ b/src/Bundle/ChillMainBundle/Security/Authorization/DefaultVoterHelper.php @@ -20,6 +20,7 @@ final readonly class DefaultVoterHelper implements VoterHelperInterface private array $configuration ) {} + #[\Override] public function supports($attribute, $subject): bool { foreach ($this->configuration as [$attributes, $subj]) { @@ -35,6 +36,7 @@ final readonly class DefaultVoterHelper implements VoterHelperInterface return false; } + #[\Override] public function voteOnAttribute($attribute, $subject, $token): bool { $user = $token->getUser(); diff --git a/src/Bundle/ChillMainBundle/Security/Authorization/DefaultVoterHelperFactory.php b/src/Bundle/ChillMainBundle/Security/Authorization/DefaultVoterHelperFactory.php index 805ba03e5..be0ef4958 100644 --- a/src/Bundle/ChillMainBundle/Security/Authorization/DefaultVoterHelperFactory.php +++ b/src/Bundle/ChillMainBundle/Security/Authorization/DefaultVoterHelperFactory.php @@ -15,6 +15,7 @@ class DefaultVoterHelperFactory implements VoterHelperFactoryInterface { public function __construct(protected AuthorizationHelper $authorizationHelper) {} + #[\Override] public function generate($context): VoterGeneratorInterface { return new DefaultVoterHelperGenerator( diff --git a/src/Bundle/ChillMainBundle/Security/Authorization/DefaultVoterHelperGenerator.php b/src/Bundle/ChillMainBundle/Security/Authorization/DefaultVoterHelperGenerator.php index 6a1fe5356..d06a306a3 100644 --- a/src/Bundle/ChillMainBundle/Security/Authorization/DefaultVoterHelperGenerator.php +++ b/src/Bundle/ChillMainBundle/Security/Authorization/DefaultVoterHelperGenerator.php @@ -17,6 +17,7 @@ final class DefaultVoterHelperGenerator implements VoterGeneratorInterface public function __construct(private readonly AuthorizationHelper $authorizationHelper) {} + #[\Override] public function addCheckFor(?string $class, array $attributes): self { $this->configuration[] = [$attributes, $class]; @@ -24,6 +25,7 @@ final class DefaultVoterHelperGenerator implements VoterGeneratorInterface return $this; } + #[\Override] public function build(): VoterHelperInterface { return new DefaultVoterHelper( diff --git a/src/Bundle/ChillMainBundle/Security/Authorization/EntityWorkflowVoter.php b/src/Bundle/ChillMainBundle/Security/Authorization/EntityWorkflowVoter.php index 44766a583..3c558b515 100644 --- a/src/Bundle/ChillMainBundle/Security/Authorization/EntityWorkflowVoter.php +++ b/src/Bundle/ChillMainBundle/Security/Authorization/EntityWorkflowVoter.php @@ -19,16 +19,17 @@ use Symfony\Component\Security\Core\Security; class EntityWorkflowVoter extends Voter { - final public const CREATE = 'CHILL_MAIN_WORKFLOW_CREATE'; + final public const string CREATE = 'CHILL_MAIN_WORKFLOW_CREATE'; - final public const DELETE = 'CHILL_MAIN_WORKFLOW_DELETE'; + final public const string DELETE = 'CHILL_MAIN_WORKFLOW_DELETE'; - final public const SEE = 'CHILL_MAIN_WORKFLOW_SEE'; + final public const string SEE = 'CHILL_MAIN_WORKFLOW_SEE'; - final public const SHOW_ENTITY_LINK = 'CHILL_MAIN_WORKFLOW_LINK_SHOW'; + final public const string SHOW_ENTITY_LINK = 'CHILL_MAIN_WORKFLOW_LINK_SHOW'; public function __construct(private readonly EntityWorkflowManager $manager, private readonly Security $security) {} + #[\Override] protected function supports($attribute, $subject) { return $subject instanceof EntityWorkflow && \in_array($attribute, self::getRoles(), true); @@ -37,6 +38,7 @@ class EntityWorkflowVoter extends Voter /** * @param EntityWorkflow $subject */ + #[\Override] protected function voteOnAttribute($attribute, $subject, TokenInterface $token): bool { switch ($attribute) { diff --git a/src/Bundle/ChillMainBundle/Security/Authorization/NotificationVoter.php b/src/Bundle/ChillMainBundle/Security/Authorization/NotificationVoter.php index 9cca4c019..fa4db1555 100644 --- a/src/Bundle/ChillMainBundle/Security/Authorization/NotificationVoter.php +++ b/src/Bundle/ChillMainBundle/Security/Authorization/NotificationVoter.php @@ -24,16 +24,17 @@ final class NotificationVoter extends Voter * * May apply on both @see{NotificationComment::class} and @see{Notification::class}. */ - public const COMMENT_ADD = 'CHILL_MAIN_NOTIFICATION_COMMENT_ADD'; + public const string COMMENT_ADD = 'CHILL_MAIN_NOTIFICATION_COMMENT_ADD'; - public const COMMENT_EDIT = 'CHILL_MAIN_NOTIFICATION_COMMENT_EDIT'; + public const string COMMENT_EDIT = 'CHILL_MAIN_NOTIFICATION_COMMENT_EDIT'; - public const NOTIFICATION_SEE = 'CHILL_MAIN_NOTIFICATION_SEE'; + public const string NOTIFICATION_SEE = 'CHILL_MAIN_NOTIFICATION_SEE'; - public const NOTIFICATION_TOGGLE_READ_STATUS = 'CHILL_MAIIN_NOTIFICATION_TOGGLE_READ_STATUS'; + public const string NOTIFICATION_TOGGLE_READ_STATUS = 'CHILL_MAIIN_NOTIFICATION_TOGGLE_READ_STATUS'; - public const NOTIFICATION_UPDATE = 'CHILL_MAIN_NOTIFICATION_UPDATE'; + public const string NOTIFICATION_UPDATE = 'CHILL_MAIN_NOTIFICATION_UPDATE'; + #[\Override] protected function supports($attribute, $subject): bool { return $subject instanceof Notification || $subject instanceof NotificationComment; @@ -42,6 +43,7 @@ final class NotificationVoter extends Voter /** * @param string $attribute */ + #[\Override] protected function voteOnAttribute($attribute, $subject, TokenInterface $token): bool { $user = $token->getUser(); diff --git a/src/Bundle/ChillMainBundle/Security/Authorization/SavedExportVoter.php b/src/Bundle/ChillMainBundle/Security/Authorization/SavedExportVoter.php index 0e9a7da52..b4cc81d42 100644 --- a/src/Bundle/ChillMainBundle/Security/Authorization/SavedExportVoter.php +++ b/src/Bundle/ChillMainBundle/Security/Authorization/SavedExportVoter.php @@ -17,23 +17,25 @@ use Symfony\Component\Security\Core\Authorization\Voter\Voter; class SavedExportVoter extends Voter { - final public const DELETE = 'CHLL_MAIN_EXPORT_SAVED_DELETE'; + final public const string DELETE = 'CHLL_MAIN_EXPORT_SAVED_DELETE'; - final public const EDIT = 'CHLL_MAIN_EXPORT_SAVED_EDIT'; + final public const string EDIT = 'CHLL_MAIN_EXPORT_SAVED_EDIT'; - final public const GENERATE = 'CHLL_MAIN_EXPORT_SAVED_GENERATE'; + final public const string GENERATE = 'CHLL_MAIN_EXPORT_SAVED_GENERATE'; - private const ALL = [ + private const array ALL = [ self::DELETE, self::EDIT, self::GENERATE, ]; + #[\Override] protected function supports($attribute, $subject): bool { return $subject instanceof SavedExport && \in_array($attribute, self::ALL, true); } + #[\Override] protected function voteOnAttribute($attribute, $subject, TokenInterface $token): bool { return match ($attribute) { diff --git a/src/Bundle/ChillMainBundle/Security/Authorization/WorkflowEntityDeletionVoter.php b/src/Bundle/ChillMainBundle/Security/Authorization/WorkflowEntityDeletionVoter.php index 9718cf013..7dbb94ac0 100644 --- a/src/Bundle/ChillMainBundle/Security/Authorization/WorkflowEntityDeletionVoter.php +++ b/src/Bundle/ChillMainBundle/Security/Authorization/WorkflowEntityDeletionVoter.php @@ -22,6 +22,7 @@ class WorkflowEntityDeletionVoter extends Voter */ public function __construct(private $handlers, private readonly EntityWorkflowRepository $entityWorkflowRepository) {} + #[\Override] protected function supports($attribute, $subject) { if (!\is_object($subject)) { @@ -38,6 +39,7 @@ class WorkflowEntityDeletionVoter extends Voter return false; } + #[\Override] protected function voteOnAttribute($attribute, $subject, TokenInterface $token) { foreach ($this->handlers as $handler) { diff --git a/src/Bundle/ChillMainBundle/Security/ChillSecurity.php b/src/Bundle/ChillMainBundle/Security/ChillSecurity.php index eb21d00df..4181a2cf9 100644 --- a/src/Bundle/ChillMainBundle/Security/ChillSecurity.php +++ b/src/Bundle/ChillMainBundle/Security/ChillSecurity.php @@ -42,6 +42,7 @@ final readonly class ChillSecurity implements AuthorizationCheckerInterface return $user; } + #[\Override] public function isGranted($attribute, $subject = null): bool { return $this->security->isGranted($attribute, $subject); diff --git a/src/Bundle/ChillMainBundle/Security/PasswordRecover/PasswordRecoverEvent.php b/src/Bundle/ChillMainBundle/Security/PasswordRecover/PasswordRecoverEvent.php index 264b77056..56096d146 100644 --- a/src/Bundle/ChillMainBundle/Security/PasswordRecover/PasswordRecoverEvent.php +++ b/src/Bundle/ChillMainBundle/Security/PasswordRecover/PasswordRecoverEvent.php @@ -15,11 +15,11 @@ use Chill\MainBundle\Entity\User; class PasswordRecoverEvent extends \Symfony\Contracts\EventDispatcher\Event { - final public const ASK_TOKEN_INVALID_FORM = 'chill_main.ask_token_invalid_form'; + final public const string ASK_TOKEN_INVALID_FORM = 'chill_main.ask_token_invalid_form'; - final public const ASK_TOKEN_SUCCESS = 'chill_main.ask_token_success'; + final public const string ASK_TOKEN_SUCCESS = 'chill_main.ask_token_success'; - final public const INVALID_TOKEN = 'chill_main.password_recover_invalid_token'; + final public const string INVALID_TOKEN = 'chill_main.password_recover_invalid_token'; /** * @param bool $safelyGenerated true if generated safely (from console command, etc.) diff --git a/src/Bundle/ChillMainBundle/Security/PasswordRecover/PasswordRecoverEventSubscriber.php b/src/Bundle/ChillMainBundle/Security/PasswordRecover/PasswordRecoverEventSubscriber.php index 2e4ec2848..50467231d 100644 --- a/src/Bundle/ChillMainBundle/Security/PasswordRecover/PasswordRecoverEventSubscriber.php +++ b/src/Bundle/ChillMainBundle/Security/PasswordRecover/PasswordRecoverEventSubscriber.php @@ -25,6 +25,7 @@ class PasswordRecoverEventSubscriber implements EventSubscriberInterface $this->locker = $locker; } + #[\Override] public static function getSubscribedEvents(): array { return [ diff --git a/src/Bundle/ChillMainBundle/Security/PasswordRecover/PasswordRecoverLocker.php b/src/Bundle/ChillMainBundle/Security/PasswordRecover/PasswordRecoverLocker.php index 11d14c374..e38a731f4 100644 --- a/src/Bundle/ChillMainBundle/Security/PasswordRecover/PasswordRecoverLocker.php +++ b/src/Bundle/ChillMainBundle/Security/PasswordRecover/PasswordRecoverLocker.php @@ -16,28 +16,28 @@ use Psr\Log\LoggerInterface; class PasswordRecoverLocker { - final public const ASK_TOKEN_INVALID_FORM_TTL = 3600; + final public const int ASK_TOKEN_INVALID_FORM_TTL = 3600; /** * TTL to keep invalid token recorded. */ - final public const INVALID_TOKEN_TTL = 3600; + final public const int INVALID_TOKEN_TTL = 3600; - final public const MAX_ASK_TOKEN_BY_USER = 10; + final public const int MAX_ASK_TOKEN_BY_USER = 10; - final public const MAX_ASK_TOKEN_INVALID_FORM_BY_IP = 10; + final public const int MAX_ASK_TOKEN_INVALID_FORM_BY_IP = 10; - final public const MAX_ASK_TOKEN_INVALID_FORM_GLOBAL = 50; + final public const int MAX_ASK_TOKEN_INVALID_FORM_GLOBAL = 50; /** * The maximum of invalid token by ip. */ - final public const MAX_INVALID_TOKEN_BY_IP = 10; + final public const int MAX_INVALID_TOKEN_BY_IP = 10; /** * The maximum of invalid token globally (across all ip). */ - final public const MAX_INVALID_TOKEN_GLOBAL = 50; + final public const int 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 ab847aa5e..1a7040f28 100644 --- a/src/Bundle/ChillMainBundle/Security/PasswordRecover/PasswordRecoverVoter.php +++ b/src/Bundle/ChillMainBundle/Security/PasswordRecover/PasswordRecoverVoter.php @@ -18,9 +18,9 @@ use Symfony\Component\Security\Core\Authorization\Voter\Voter; class PasswordRecoverVoter extends Voter { - final public const ASK_TOKEN = 'CHILL_PASSWORD_ASK_TOKEN'; + final public const string ASK_TOKEN = 'CHILL_PASSWORD_ASK_TOKEN'; - final public const TRY_TOKEN = 'CHILL_PASSWORD_TRY_TOKEN'; + final public const string TRY_TOKEN = 'CHILL_PASSWORD_TRY_TOKEN'; /** * @var PasswordRecoverLocker @@ -43,6 +43,7 @@ class PasswordRecoverVoter extends Voter $this->requestStack = $requestStack; } + #[\Override] protected function supports($attribute, $subject): bool { if (!\in_array($attribute, $this->supported, true)) { @@ -52,6 +53,7 @@ class PasswordRecoverVoter extends Voter return true; } + #[\Override] protected function voteOnAttribute($attribute, $subject, TokenInterface $token): bool { switch ($attribute) { diff --git a/src/Bundle/ChillMainBundle/Security/PasswordRecover/RecoverPasswordHelper.php b/src/Bundle/ChillMainBundle/Security/PasswordRecover/RecoverPasswordHelper.php index e868262e2..b00040781 100644 --- a/src/Bundle/ChillMainBundle/Security/PasswordRecover/RecoverPasswordHelper.php +++ b/src/Bundle/ChillMainBundle/Security/PasswordRecover/RecoverPasswordHelper.php @@ -18,7 +18,7 @@ use Symfony\Component\Routing\Generator\UrlGeneratorInterface; class RecoverPasswordHelper { - final public const RECOVER_PASSWORD_ROUTE = 'password_recover'; + final public const string RECOVER_PASSWORD_ROUTE = 'password_recover'; 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 acb010ca9..b05690d54 100644 --- a/src/Bundle/ChillMainBundle/Security/PasswordRecover/TokenManager.php +++ b/src/Bundle/ChillMainBundle/Security/PasswordRecover/TokenManager.php @@ -16,15 +16,15 @@ use Psr\Log\LoggerInterface; class TokenManager { - final public const HASH = 'h'; + final public const string HASH = 'h'; - final public const TIMESTAMP = 'ts'; + final public const string TIMESTAMP = 'ts'; - final public const TOKEN = 't'; + final public const string TOKEN = 't'; - final public const TOKEN_LENGTH = 24; + final public const int TOKEN_LENGTH = 24; - final public const USERNAME_CANONICAL = 'u'; + final public const string USERNAME_CANONICAL = 'u'; /** * @var LoggerInterface diff --git a/src/Bundle/ChillMainBundle/Security/Resolver/CenterResolverDispatcher.php b/src/Bundle/ChillMainBundle/Security/Resolver/CenterResolverDispatcher.php index 903b8c5c5..04e955d40 100644 --- a/src/Bundle/ChillMainBundle/Security/Resolver/CenterResolverDispatcher.php +++ b/src/Bundle/ChillMainBundle/Security/Resolver/CenterResolverDispatcher.php @@ -18,6 +18,7 @@ final readonly class CenterResolverDispatcher implements CenterResolverDispatche */ public function __construct(private iterable $resolvers = []) {} + #[\Override] public function resolveCenter($entity, ?array $options = []) { trigger_deprecation( diff --git a/src/Bundle/ChillMainBundle/Security/Resolver/CenterResolverManager.php b/src/Bundle/ChillMainBundle/Security/Resolver/CenterResolverManager.php index f629459b4..356da4fe1 100644 --- a/src/Bundle/ChillMainBundle/Security/Resolver/CenterResolverManager.php +++ b/src/Bundle/ChillMainBundle/Security/Resolver/CenterResolverManager.php @@ -20,6 +20,7 @@ final readonly class CenterResolverManager implements CenterResolverManagerInter */ public function __construct(private iterable $resolvers = []) {} + #[\Override] public function resolveCenters($entity, ?array $options = []): array { foreach ($this->resolvers as $resolver) { diff --git a/src/Bundle/ChillMainBundle/Security/Resolver/DefaultCenterResolver.php b/src/Bundle/ChillMainBundle/Security/Resolver/DefaultCenterResolver.php index 0f9eddd38..5e777c89d 100644 --- a/src/Bundle/ChillMainBundle/Security/Resolver/DefaultCenterResolver.php +++ b/src/Bundle/ChillMainBundle/Security/Resolver/DefaultCenterResolver.php @@ -16,6 +16,7 @@ use Chill\MainBundle\Entity\HasCentersInterface; class DefaultCenterResolver implements CenterResolverInterface { + #[\Override] public static function getDefaultPriority(): int { return -256; @@ -24,6 +25,7 @@ class DefaultCenterResolver implements CenterResolverInterface /** * @param HasCenterInterface $entity */ + #[\Override] public function resolveCenter($entity, ?array $options = []) { if ($entity instanceof HasCenterInterface) { @@ -37,6 +39,7 @@ class DefaultCenterResolver implements CenterResolverInterface throw new \UnexpectedValueException('should be an instanceof'); } + #[\Override] public function supports($entity, ?array $options = []): bool { return $entity instanceof HasCenterInterface || $entity instanceof HasCentersInterface; diff --git a/src/Bundle/ChillMainBundle/Security/Resolver/DefaultScopeResolver.php b/src/Bundle/ChillMainBundle/Security/Resolver/DefaultScopeResolver.php index 1551725e1..902b0a24b 100644 --- a/src/Bundle/ChillMainBundle/Security/Resolver/DefaultScopeResolver.php +++ b/src/Bundle/ChillMainBundle/Security/Resolver/DefaultScopeResolver.php @@ -16,11 +16,13 @@ use Chill\MainBundle\Entity\HasScopesInterface; class DefaultScopeResolver implements ScopeResolverInterface { + #[\Override] public static function getDefaultPriority(): int { return -256; } + #[\Override] public function isConcerned($entity, ?array $options = []): bool { return $entity instanceof HasScopeInterface || $entity instanceof HasScopesInterface; @@ -29,6 +31,7 @@ class DefaultScopeResolver implements ScopeResolverInterface /** * @param HasScopeInterface|HasScopesInterface $entity */ + #[\Override] public function resolveScope($entity, ?array $options = []) { if ($entity instanceof HasScopeInterface) { @@ -42,6 +45,7 @@ class DefaultScopeResolver implements ScopeResolverInterface throw new \UnexpectedValueException(sprintf('should be an instanceof %s or %s', HasScopesInterface::class, HasScopeInterface::class)); } + #[\Override] public function supports($entity, ?array $options = []): bool { return $entity instanceof HasScopeInterface || $entity instanceof HasScopesInterface; diff --git a/src/Bundle/ChillMainBundle/Security/Resolver/ResolverTwigExtension.php b/src/Bundle/ChillMainBundle/Security/Resolver/ResolverTwigExtension.php index 032c28a9b..958bb0d9e 100644 --- a/src/Bundle/ChillMainBundle/Security/Resolver/ResolverTwigExtension.php +++ b/src/Bundle/ChillMainBundle/Security/Resolver/ResolverTwigExtension.php @@ -17,6 +17,7 @@ final class ResolverTwigExtension extends \Twig\Extension\AbstractExtension { public function __construct(private readonly CenterResolverManagerInterface $centerResolverDispatcher, private readonly ScopeResolverDispatcher $scopeResolverDispatcher) {} + #[\Override] public function getFilters() { return [ diff --git a/src/Bundle/ChillMainBundle/Security/UserProvider/UserProvider.php b/src/Bundle/ChillMainBundle/Security/UserProvider/UserProvider.php index a561fe0bc..29e132e66 100644 --- a/src/Bundle/ChillMainBundle/Security/UserProvider/UserProvider.php +++ b/src/Bundle/ChillMainBundle/Security/UserProvider/UserProvider.php @@ -22,6 +22,7 @@ class UserProvider implements UserProviderInterface { public function __construct(protected EntityManagerInterface $em) {} + #[\Override] public function loadUserByUsername($username): UserInterface { try { @@ -41,6 +42,7 @@ class UserProvider implements UserProviderInterface return $user; } + #[\Override] public function refreshUser(UserInterface $user): UserInterface { if (!$user instanceof User) { @@ -56,6 +58,7 @@ class UserProvider implements UserProviderInterface return $reloadedUser; } + #[\Override] public function supportsClass($class): bool { return User::class === $class; diff --git a/src/Bundle/ChillMainBundle/Serializer/Model/Counter.php b/src/Bundle/ChillMainBundle/Serializer/Model/Counter.php index 476d68568..e7e7e7acf 100644 --- a/src/Bundle/ChillMainBundle/Serializer/Model/Counter.php +++ b/src/Bundle/ChillMainBundle/Serializer/Model/Counter.php @@ -20,6 +20,7 @@ class Counter implements \JsonSerializable return $this->counter; } + #[\Override] public function jsonSerialize(): array { return ['count' => $this->counter]; diff --git a/src/Bundle/ChillMainBundle/Serializer/Normalizer/AddressNormalizer.php b/src/Bundle/ChillMainBundle/Serializer/Normalizer/AddressNormalizer.php index bbae6bd40..f5decb628 100644 --- a/src/Bundle/ChillMainBundle/Serializer/Normalizer/AddressNormalizer.php +++ b/src/Bundle/ChillMainBundle/Serializer/Normalizer/AddressNormalizer.php @@ -24,11 +24,11 @@ class AddressNormalizer implements ContextAwareNormalizerInterface, NormalizerAw { use NormalizerAwareTrait; - private const NULL_POSTCODE_COUNTRY = [ + private const array NULL_POSTCODE_COUNTRY = [ 'id', 'name', 'code', ]; - private const NULL_VALUE = [ + private const array NULL_VALUE = [ 'address_id', 'text', 'street', @@ -53,6 +53,7 @@ class AddressNormalizer implements ContextAwareNormalizerInterface, NormalizerAw * @param Address $address * @param string|null $format */ + #[\Override] public function normalize($address, $format = null, array $context = []) { if ($address instanceof Address) { @@ -123,6 +124,7 @@ class AddressNormalizer implements ContextAwareNormalizerInterface, NormalizerAw throw new UnexpectedValueException(); } + #[\Override] public function supportsNormalization($data, $format = null, array $context = []): bool { if ('json' === $format) { diff --git a/src/Bundle/ChillMainBundle/Serializer/Normalizer/CenterNormalizer.php b/src/Bundle/ChillMainBundle/Serializer/Normalizer/CenterNormalizer.php index 7c41bcb8a..6058b6505 100644 --- a/src/Bundle/ChillMainBundle/Serializer/Normalizer/CenterNormalizer.php +++ b/src/Bundle/ChillMainBundle/Serializer/Normalizer/CenterNormalizer.php @@ -22,6 +22,7 @@ class CenterNormalizer implements DenormalizerInterface, NormalizerInterface { public function __construct(private readonly CenterRepository $repository) {} + #[\Override] public function denormalize($data, $type, $format = null, array $context = []) { if (null === $data) { @@ -49,6 +50,7 @@ class CenterNormalizer implements DenormalizerInterface, NormalizerInterface return $center; } + #[\Override] public function normalize($center, $format = null, array $context = []) { /* @var Center $center */ @@ -60,11 +62,13 @@ class CenterNormalizer implements DenormalizerInterface, NormalizerInterface ]; } + #[\Override] public function supportsDenormalization($data, $type, $format = null) { return Center::class === $type; } + #[\Override] public function supportsNormalization($data, $format = null): bool { return $data instanceof Center && 'json' === $format; diff --git a/src/Bundle/ChillMainBundle/Serializer/Normalizer/CollectionNormalizer.php b/src/Bundle/ChillMainBundle/Serializer/Normalizer/CollectionNormalizer.php index 117e18704..04c07d5a7 100644 --- a/src/Bundle/ChillMainBundle/Serializer/Normalizer/CollectionNormalizer.php +++ b/src/Bundle/ChillMainBundle/Serializer/Normalizer/CollectionNormalizer.php @@ -24,6 +24,7 @@ class CollectionNormalizer implements NormalizerAwareInterface, NormalizerInterf * @param Collection $collection * @param string|null $format */ + #[\Override] public function normalize($collection, $format = null, array $context = []) { $paginator = $collection->getPaginator(); @@ -41,6 +42,7 @@ class CollectionNormalizer implements NormalizerAwareInterface, NormalizerInterf ]; } + #[\Override] public function supportsNormalization($data, $format = null): bool { return $data instanceof Collection; diff --git a/src/Bundle/ChillMainBundle/Serializer/Normalizer/CommentEmbeddableDocGenNormalizer.php b/src/Bundle/ChillMainBundle/Serializer/Normalizer/CommentEmbeddableDocGenNormalizer.php index 59f0302f0..5bda9dff1 100644 --- a/src/Bundle/ChillMainBundle/Serializer/Normalizer/CommentEmbeddableDocGenNormalizer.php +++ b/src/Bundle/ChillMainBundle/Serializer/Normalizer/CommentEmbeddableDocGenNormalizer.php @@ -30,6 +30,7 @@ class CommentEmbeddableDocGenNormalizer implements ContextAwareNormalizerInterfa * * @throws ExceptionInterface */ + #[\Override] public function normalize($object, ?string $format = null, array $context = []): array { if (null === $object || $object->isEmpty()) { @@ -63,6 +64,7 @@ class CommentEmbeddableDocGenNormalizer implements ContextAwareNormalizerInterfa ]; } + #[\Override] public function supportsNormalization($data, ?string $format = null, array $context = []): bool { if ('docgen' !== $format) { diff --git a/src/Bundle/ChillMainBundle/Serializer/Normalizer/DateNormalizer.php b/src/Bundle/ChillMainBundle/Serializer/Normalizer/DateNormalizer.php index 9ee8bf158..c91459f10 100644 --- a/src/Bundle/ChillMainBundle/Serializer/Normalizer/DateNormalizer.php +++ b/src/Bundle/ChillMainBundle/Serializer/Normalizer/DateNormalizer.php @@ -22,6 +22,7 @@ class DateNormalizer implements ContextAwareNormalizerInterface, DenormalizerInt { public function __construct(private readonly RequestStack $requestStack, private readonly ParameterBagInterface $parameterBag) {} + #[\Override] public function denormalize($data, $type, $format = null, array $context = []) { if (null === $data) { @@ -51,6 +52,7 @@ class DateNormalizer implements ContextAwareNormalizerInterface, DenormalizerInt return $result; } + #[\Override] public function normalize($date, $format = null, array $context = []) { /* @var DateTimeInterface $date */ @@ -89,6 +91,7 @@ class DateNormalizer implements ContextAwareNormalizerInterface, DenormalizerInt } } + #[\Override] public function supportsDenormalization($data, $type, $format = null): bool { return \DateTimeInterface::class === $type @@ -97,6 +100,7 @@ class DateNormalizer implements ContextAwareNormalizerInterface, DenormalizerInt || (\is_array($data) && \array_key_exists('datetime', $data)); } + #[\Override] public function supportsNormalization($data, $format = null, array $context = []): bool { if ('json' === $format) { diff --git a/src/Bundle/ChillMainBundle/Serializer/Normalizer/DiscriminatedObjectDenormalizer.php b/src/Bundle/ChillMainBundle/Serializer/Normalizer/DiscriminatedObjectDenormalizer.php index 1ecb7824f..4799013a2 100644 --- a/src/Bundle/ChillMainBundle/Serializer/Normalizer/DiscriminatedObjectDenormalizer.php +++ b/src/Bundle/ChillMainBundle/Serializer/Normalizer/DiscriminatedObjectDenormalizer.php @@ -28,13 +28,14 @@ class DiscriminatedObjectDenormalizer implements ContextAwareDenormalizerInterfa * Should be present in context and contains an array of * allowed types. */ - final public const ALLOWED_TYPES = 'denormalize_multi.allowed_types'; + final public const string ALLOWED_TYPES = 'denormalize_multi.allowed_types'; /** * The type to set for enabling this type. */ - final public const TYPE = '@multi'; + final public const string TYPE = '@multi'; + #[\Override] public function denormalize($data, $type, $format = null, array $context = []) { foreach ($context[self::ALLOWED_TYPES] as $localType) { @@ -50,6 +51,7 @@ class DiscriminatedObjectDenormalizer implements ContextAwareDenormalizerInterfa throw new RuntimeException(sprintf('Could not find any denormalizer for those ALLOWED_TYPES: %s', \implode(', ', $context[self::ALLOWED_TYPES]))); } + #[\Override] public function supportsDenormalization($data, $type, $format = null, array $context = []) { if (self::TYPE !== $type) { diff --git a/src/Bundle/ChillMainBundle/Serializer/Normalizer/DoctrineExistingEntityNormalizer.php b/src/Bundle/ChillMainBundle/Serializer/Normalizer/DoctrineExistingEntityNormalizer.php index ed34a45be..ce37b83c3 100644 --- a/src/Bundle/ChillMainBundle/Serializer/Normalizer/DoctrineExistingEntityNormalizer.php +++ b/src/Bundle/ChillMainBundle/Serializer/Normalizer/DoctrineExistingEntityNormalizer.php @@ -21,6 +21,7 @@ class DoctrineExistingEntityNormalizer implements DenormalizerInterface { public function __construct(private readonly EntityManagerInterface $em, private readonly ClassMetadataFactoryInterface $serializerMetadataFactory) {} + #[\Override] public function denormalize($data, $type, $format = null, array $context = []) { if (\array_key_exists(AbstractNormalizer::OBJECT_TO_POPULATE, $context)) { @@ -31,6 +32,7 @@ class DoctrineExistingEntityNormalizer implements DenormalizerInterface ->find($data['id']); } + #[\Override] public function supportsDenormalization($data, $type, $format = null) { if (false === \is_array($data)) { diff --git a/src/Bundle/ChillMainBundle/Serializer/Normalizer/EntityWorkflowNormalizer.php b/src/Bundle/ChillMainBundle/Serializer/Normalizer/EntityWorkflowNormalizer.php index b1f3807ed..271e04ad8 100644 --- a/src/Bundle/ChillMainBundle/Serializer/Normalizer/EntityWorkflowNormalizer.php +++ b/src/Bundle/ChillMainBundle/Serializer/Normalizer/EntityWorkflowNormalizer.php @@ -30,6 +30,7 @@ class EntityWorkflowNormalizer implements NormalizerInterface, NormalizerAwareIn * * @return array */ + #[\Override] public function normalize($object, ?string $format = null, array $context = []) { $workflow = $this->registry->get($object, $object->getWorkflowName()); @@ -48,6 +49,7 @@ class EntityWorkflowNormalizer implements NormalizerInterface, NormalizerAwareIn ]; } + #[\Override] public function supportsNormalization($data, ?string $format = null): bool { return $data instanceof EntityWorkflow && 'json' === $format; diff --git a/src/Bundle/ChillMainBundle/Serializer/Normalizer/EntityWorkflowStepNormalizer.php b/src/Bundle/ChillMainBundle/Serializer/Normalizer/EntityWorkflowStepNormalizer.php index 0f640f38b..0b0e0adbd 100644 --- a/src/Bundle/ChillMainBundle/Serializer/Normalizer/EntityWorkflowStepNormalizer.php +++ b/src/Bundle/ChillMainBundle/Serializer/Normalizer/EntityWorkflowStepNormalizer.php @@ -26,6 +26,7 @@ class EntityWorkflowStepNormalizer implements NormalizerAwareInterface, Normaliz /** * @param EntityWorkflowStep $object */ + #[\Override] public function normalize($object, ?string $format = null, array $context = []): array { $data = [ @@ -75,6 +76,7 @@ class EntityWorkflowStepNormalizer implements NormalizerAwareInterface, Normaliz return $data; } + #[\Override] public function supportsNormalization($data, ?string $format = null): bool { return $data instanceof EntityWorkflowStep && 'json' === $format; diff --git a/src/Bundle/ChillMainBundle/Serializer/Normalizer/NotificationNormalizer.php b/src/Bundle/ChillMainBundle/Serializer/Normalizer/NotificationNormalizer.php index 2f6d57db1..826fe8590 100644 --- a/src/Bundle/ChillMainBundle/Serializer/Normalizer/NotificationNormalizer.php +++ b/src/Bundle/ChillMainBundle/Serializer/Normalizer/NotificationNormalizer.php @@ -30,6 +30,7 @@ class NotificationNormalizer implements NormalizerAwareInterface, NormalizerInte * * @return array|\ArrayObject|bool|float|int|string|void|null */ + #[\Override] public function normalize($object, ?string $format = null, array $context = []) { $entity = $this->entityManager @@ -51,6 +52,7 @@ class NotificationNormalizer implements NormalizerAwareInterface, NormalizerInte ]; } + #[\Override] public function supportsNormalization($data, ?string $format = null) { return $data instanceof Notification && 'json' === $format; diff --git a/src/Bundle/ChillMainBundle/Serializer/Normalizer/PhonenumberNormalizer.php b/src/Bundle/ChillMainBundle/Serializer/Normalizer/PhonenumberNormalizer.php index 28d7c623d..fe5d20f4e 100644 --- a/src/Bundle/ChillMainBundle/Serializer/Normalizer/PhonenumberNormalizer.php +++ b/src/Bundle/ChillMainBundle/Serializer/Normalizer/PhonenumberNormalizer.php @@ -37,6 +37,7 @@ class PhonenumberNormalizer implements ContextAwareNormalizerInterface, Denormal * * @throws UnexpectedValueException */ + #[\Override] public function denormalize($data, $type, $format = null, array $context = []) { if ('' === trim((string) $data)) { @@ -50,6 +51,7 @@ class PhonenumberNormalizer implements ContextAwareNormalizerInterface, Denormal } } + #[\Override] public function normalize($object, ?string $format = null, array $context = []): string { if ('docgen' === $format && null === $object) { @@ -59,11 +61,13 @@ class PhonenumberNormalizer implements ContextAwareNormalizerInterface, Denormal return $this->phoneNumberUtil->formatOutOfCountryCallingNumber($object, $this->defaultCarrierCode); } + #[\Override] public function supportsDenormalization($data, $type, $format = null) { return 'libphonenumber\PhoneNumber' === $type; } + #[\Override] public function supportsNormalization($data, ?string $format = null, array $context = []): bool { if ($data instanceof PhoneNumber && 'json' === $format) { diff --git a/src/Bundle/ChillMainBundle/Serializer/Normalizer/PointNormalizer.php b/src/Bundle/ChillMainBundle/Serializer/Normalizer/PointNormalizer.php index 4084bce44..1c15dae21 100644 --- a/src/Bundle/ChillMainBundle/Serializer/Normalizer/PointNormalizer.php +++ b/src/Bundle/ChillMainBundle/Serializer/Normalizer/PointNormalizer.php @@ -17,6 +17,7 @@ use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; class PointNormalizer implements DenormalizerInterface { + #[\Override] public function denormalize($data, $type, $format = null, array $context = []) { if (!\is_array($data)) { @@ -30,6 +31,7 @@ class PointNormalizer implements DenormalizerInterface return Point::fromLonLat($data[0], $data[1]); } + #[\Override] public function supportsDenormalization($data, $type, $format = null): bool { return Point::class === $type; diff --git a/src/Bundle/ChillMainBundle/Serializer/Normalizer/PrivateCommentEmbeddableNormalizer.php b/src/Bundle/ChillMainBundle/Serializer/Normalizer/PrivateCommentEmbeddableNormalizer.php index 515e831c0..857fee996 100644 --- a/src/Bundle/ChillMainBundle/Serializer/Normalizer/PrivateCommentEmbeddableNormalizer.php +++ b/src/Bundle/ChillMainBundle/Serializer/Normalizer/PrivateCommentEmbeddableNormalizer.php @@ -20,6 +20,7 @@ class PrivateCommentEmbeddableNormalizer implements NormalizerInterface, Denorma { public function __construct(private readonly Security $security) {} + #[\Override] public function denormalize($data, string $type, ?string $format = null, array $context = []): PrivateCommentEmbeddable { $comment = new PrivateCommentEmbeddable(); @@ -33,16 +34,19 @@ class PrivateCommentEmbeddableNormalizer implements NormalizerInterface, Denorma return $comment; } + #[\Override] public function normalize($object, $format = null, array $context = []): string { return $object->getCommentForUser($this->security->getUser()); } + #[\Override] public function supportsDenormalization($data, string $type, ?string $format = null): bool { return PrivateCommentEmbeddable::class === $type; } + #[\Override] public function supportsNormalization($data, ?string $format = null): bool { return $data instanceof PrivateCommentEmbeddable; diff --git a/src/Bundle/ChillMainBundle/Serializer/Normalizer/UserNormalizer.php b/src/Bundle/ChillMainBundle/Serializer/Normalizer/UserNormalizer.php index c05468f6d..43222e6cf 100644 --- a/src/Bundle/ChillMainBundle/Serializer/Normalizer/UserNormalizer.php +++ b/src/Bundle/ChillMainBundle/Serializer/Normalizer/UserNormalizer.php @@ -28,9 +28,9 @@ class UserNormalizer implements ContextAwareNormalizerInterface, NormalizerAware { use NormalizerAwareTrait; - final public const AT_DATE = 'chill:user:at_date'; + final public const string AT_DATE = 'chill:user:at_date'; - final public const NULL_USER = [ + final public const array NULL_USER = [ 'type' => 'user', 'id' => '', 'username' => '', @@ -48,6 +48,7 @@ class UserNormalizer implements ContextAwareNormalizerInterface, NormalizerAware * * @throws \Symfony\Component\Serializer\Exception\ExceptionInterface */ + #[\Override] public function normalize($object, $format = null, array $context = []) { /** @var array{"chill:user:at_date"?: \DateTimeImmutable|\DateTime} $context */ @@ -110,6 +111,7 @@ class UserNormalizer implements ContextAwareNormalizerInterface, NormalizerAware return $data; } + #[\Override] public function supportsNormalization($data, $format = null, array $context = []): bool { if ($data instanceof User && ('json' === $format || 'docgen' === $format)) { diff --git a/src/Bundle/ChillMainBundle/Service/AddressGeographicalUnit/CollateAddressWithReferenceOrPostalCode.php b/src/Bundle/ChillMainBundle/Service/AddressGeographicalUnit/CollateAddressWithReferenceOrPostalCode.php index a4589b836..20b0c993f 100644 --- a/src/Bundle/ChillMainBundle/Service/AddressGeographicalUnit/CollateAddressWithReferenceOrPostalCode.php +++ b/src/Bundle/ChillMainBundle/Service/AddressGeographicalUnit/CollateAddressWithReferenceOrPostalCode.php @@ -16,14 +16,14 @@ use Psr\Log\LoggerInterface; final readonly class CollateAddressWithReferenceOrPostalCode implements CollateAddressWithReferenceOrPostalCodeInterface { - private const LOG_PREFIX = '[collate addresses] '; + private const string LOG_PREFIX = '[collate addresses] '; /** * For the address having an "invented" postal code, find the postal code "reference" with the same code, * and the most similar name. When two reference code match, we add. * * This query intentionally includes also address with reference, as the reference may be wrong. */ - private const FORCE_ORIGINAL_POSTAL_CODE = <<<'SQL' + private const string FORCE_ORIGINAL_POSTAL_CODE = <<<'SQL' WITH recollate AS ( SELECT * FROM ( SELECT cma.id AS address_id, cmpc.id, cmpc.label, cmpc.code, cmpc_reference.id AS cmpc_reference_id, cmpc_reference.label, cmpc_reference.code, @@ -51,7 +51,7 @@ final readonly class CollateAddressWithReferenceOrPostalCode implements CollateA * This query intentionally ignores the existing addressreference_id, to let fixing the address match the * most similar address reference. */ - private const FORCE_MOST_SIMILAR_ADDRESS_REFERENCE = <<<'SQL' + private const string FORCE_MOST_SIMILAR_ADDRESS_REFERENCE = <<<'SQL' WITH recollate AS ( SELECT * FROM ( SELECT cma.id AS address_id, cma.streetnumber, cma.street, cmpc.code, cmpc.label, cmar.id AS address_reference_id, cmar.streetnumber, cmar.street, cmpc_reference.code, cmpc_reference.label, @@ -82,7 +82,7 @@ final readonly class CollateAddressWithReferenceOrPostalCode implements CollateA * - address reference point, if the address match the reference with sufficient similarity * - or the postcal code center */ - private const UPDATE_POINT = <<<'SQL' + private const string UPDATE_POINT = <<<'SQL' WITH address_geom AS ( SELECT cma.id AS address_id, COALESCE(cmar.point, cmpc.center) AS point FROM chill_main_address cma @@ -93,7 +93,7 @@ final readonly class CollateAddressWithReferenceOrPostalCode implements CollateA UPDATE chill_main_address SET point = address_geom.point FROM address_geom WHERE address_geom.address_id = chill_main_address.id SQL; - private const MAX_ADDRESS_ID = <<<'SQL' + private const string MAX_ADDRESS_ID = <<<'SQL' SELECT MAX(id) AS max_id FROM chill_main_address; SQL; @@ -105,6 +105,7 @@ final readonly class CollateAddressWithReferenceOrPostalCode implements CollateA /** * @throws \Throwable */ + #[\Override] public function __invoke(int $sinceId = 0): int { try { diff --git a/src/Bundle/ChillMainBundle/Service/AddressGeographicalUnit/CollateAddressWithReferenceOrPostalCodeCronJob.php b/src/Bundle/ChillMainBundle/Service/AddressGeographicalUnit/CollateAddressWithReferenceOrPostalCodeCronJob.php index 4e64a1f9f..426644544 100644 --- a/src/Bundle/ChillMainBundle/Service/AddressGeographicalUnit/CollateAddressWithReferenceOrPostalCodeCronJob.php +++ b/src/Bundle/ChillMainBundle/Service/AddressGeographicalUnit/CollateAddressWithReferenceOrPostalCodeCronJob.php @@ -17,13 +17,14 @@ use Symfony\Component\Clock\ClockInterface; final readonly class CollateAddressWithReferenceOrPostalCodeCronJob implements CronJobInterface { - private const LAST_MAX_ID = 'last-max-id'; + private const string LAST_MAX_ID = 'last-max-id'; public function __construct( private ClockInterface $clock, private CollateAddressWithReferenceOrPostalCodeInterface $collateAddressWithReferenceOrPostalCode, ) {} + #[\Override] public function canRun(?CronJobExecution $cronJobExecution): bool { if (null === $cronJobExecution) { @@ -35,11 +36,13 @@ final readonly class CollateAddressWithReferenceOrPostalCodeCronJob implements C return $now->sub(new \DateInterval('PT6H')) > $cronJobExecution->getLastStart(); } + #[\Override] public function getKey(): string { return 'collate-address'; } + #[\Override] public function run(array $lastExecutionData): ?array { $maxId = ($this->collateAddressWithReferenceOrPostalCode)($lastExecutionData[self::LAST_MAX_ID] ?? 0); diff --git a/src/Bundle/ChillMainBundle/Service/AddressGeographicalUnit/RefreshAddressToGeographicalUnitMaterializedViewCronJob.php b/src/Bundle/ChillMainBundle/Service/AddressGeographicalUnit/RefreshAddressToGeographicalUnitMaterializedViewCronJob.php index 489e75151..179e21ec6 100644 --- a/src/Bundle/ChillMainBundle/Service/AddressGeographicalUnit/RefreshAddressToGeographicalUnitMaterializedViewCronJob.php +++ b/src/Bundle/ChillMainBundle/Service/AddressGeographicalUnit/RefreshAddressToGeographicalUnitMaterializedViewCronJob.php @@ -23,6 +23,7 @@ final readonly class RefreshAddressToGeographicalUnitMaterializedViewCronJob imp private ClockInterface $clock, ) {} + #[\Override] public function canRun(?CronJobExecution $cronJobExecution): bool { if (null === $cronJobExecution) { @@ -40,11 +41,13 @@ final readonly class RefreshAddressToGeographicalUnitMaterializedViewCronJob imp && 0 === random_int(0, 10); } + #[\Override] public function getKey(): string { return 'refresh-materialized-view-address-to-geog-units'; } + #[\Override] public function run(array $lastExecutionData): ?array { $this->connection->executeQuery('REFRESH MATERIALIZED VIEW view_chill_main_address_geographical_unit'); diff --git a/src/Bundle/ChillMainBundle/Service/Import/AddressReferenceBEFromBestAddress.php b/src/Bundle/ChillMainBundle/Service/Import/AddressReferenceBEFromBestAddress.php index f383bd799..dbaabd675 100644 --- a/src/Bundle/ChillMainBundle/Service/Import/AddressReferenceBEFromBestAddress.php +++ b/src/Bundle/ChillMainBundle/Service/Import/AddressReferenceBEFromBestAddress.php @@ -18,7 +18,7 @@ use Symfony\Contracts\HttpClient\HttpClientInterface; class AddressReferenceBEFromBestAddress { - private const RELEASE = 'https://gitea.champs-libres.be/api/v1/repos/Chill-project/belgian-bestaddresses-transform/releases/tags/v1.1.1'; + private const string RELEASE = 'https://gitea.champs-libres.be/api/v1/repos/Chill-project/belgian-bestaddresses-transform/releases/tags/v1.1.1'; 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 7e4c93b3f..947436f0f 100644 --- a/src/Bundle/ChillMainBundle/Service/Import/AddressReferenceBaseImporter.php +++ b/src/Bundle/ChillMainBundle/Service/Import/AddressReferenceBaseImporter.php @@ -17,7 +17,7 @@ use Psr\Log\LoggerInterface; final class AddressReferenceBaseImporter { - private const INSERT = <<<'SQL' + private const string INSERT = <<<'SQL' INSERT INTO reference_address_temp (postcode_id, refid, street, streetnumber, municipalitycode, source, point) SELECT @@ -30,9 +30,9 @@ final class AddressReferenceBaseImporter JOIN chill_main_postal_code cmpc ON cmpc.refpostalcodeid = i.refpostalcode and cmpc.code = i.postalcode SQL; - private const LOG_PREFIX = '[AddressReferenceImporter] '; + private const string LOG_PREFIX = '[AddressReferenceImporter] '; - private const VALUE = '(?, ?, ?, ?, ?, ?, ?, ?, ?)'; + private const string VALUE = '(?, ?, ?, ?, ?, ?, ?, ?, ?)'; /** * @var array diff --git a/src/Bundle/ChillMainBundle/Service/Import/AddressReferenceLU.php b/src/Bundle/ChillMainBundle/Service/Import/AddressReferenceLU.php index 50ee16401..cbfc3ccac 100644 --- a/src/Bundle/ChillMainBundle/Service/Import/AddressReferenceLU.php +++ b/src/Bundle/ChillMainBundle/Service/Import/AddressReferenceLU.php @@ -17,7 +17,7 @@ use Symfony\Contracts\HttpClient\HttpClientInterface; class AddressReferenceLU { - private const RELEASE = 'https://data.public.lu/fr/datasets/r/5cadc5b8-6a7d-4283-87bc-f9e58dd771f7'; + private const string RELEASE = 'https://data.public.lu/fr/datasets/r/5cadc5b8-6a7d-4283-87bc-f9e58dd771f7'; public function __construct(private readonly HttpClientInterface $client, private readonly AddressReferenceBaseImporter $addressBaseImporter, private readonly PostalCodeBaseImporter $postalCodeBaseImporter, private readonly AddressToReferenceMatcher $addressToReferenceMatcher) {} diff --git a/src/Bundle/ChillMainBundle/Service/Import/AddressToReferenceMatcher.php b/src/Bundle/ChillMainBundle/Service/Import/AddressToReferenceMatcher.php index 6a7bff632..1fbf9ff5e 100644 --- a/src/Bundle/ChillMainBundle/Service/Import/AddressToReferenceMatcher.php +++ b/src/Bundle/ChillMainBundle/Service/Import/AddressToReferenceMatcher.php @@ -21,9 +21,9 @@ use Psr\Log\LoggerInterface; */ final readonly class AddressToReferenceMatcher { - private const LOG_PREFIX = '[address_to_reference_matcher] '; + private const string LOG_PREFIX = '[address_to_reference_matcher] '; - private const SQL_MARK_TO_REVIEW_ADDRESS_UNMATCHING = <<<'SQL' + private const string SQL_MARK_TO_REVIEW_ADDRESS_UNMATCHING = <<<'SQL' UPDATE chill_main_address a SET refstatus = '{{ to_review }}', refstatuslastupdate = NOW() FROM chill_main_address_reference ar WHERE @@ -43,7 +43,7 @@ final readonly class AddressToReferenceMatcher ) SQL; - private const SQL_MARK_MATCHING_ADDRESSES_REVIEWED_OR_TO_REVIEW = <<<'SQL' + private const string SQL_MARK_MATCHING_ADDRESSES_REVIEWED_OR_TO_REVIEW = <<<'SQL' UPDATE chill_main_address a SET refstatus = '{{ matching }}', refstatuslastupdate = NOW() FROM chill_main_address_reference ar WHERE @@ -58,7 +58,7 @@ final readonly class AddressToReferenceMatcher AND ROUND(ST_Y(a.point) * 1000000) = ROUND(ST_Y(ar.point) * 1000000) SQL; - private const SUBSTITUTES = [ + private const array SUBSTITUTES = [ '{{ to_review }}' => Address::ADDR_REFERENCE_STATUS_TO_REVIEW, '{{ matching }}' => Address::ADDR_REFERENCE_STATUS_MATCH, '{{ reviewed }}' => Address::ADDR_REFERENCE_STATUS_REVIEWED, diff --git a/src/Bundle/ChillMainBundle/Service/Import/GeographicalUnitBaseImporter.php b/src/Bundle/ChillMainBundle/Service/Import/GeographicalUnitBaseImporter.php index 705314642..71dbcbea4 100644 --- a/src/Bundle/ChillMainBundle/Service/Import/GeographicalUnitBaseImporter.php +++ b/src/Bundle/ChillMainBundle/Service/Import/GeographicalUnitBaseImporter.php @@ -18,7 +18,7 @@ use Psr\Log\LoggerInterface; final class GeographicalUnitBaseImporter { - private const INSERT = <<<'SQL' + private const string INSERT = <<<'SQL' INSERT INTO geographical_unit_temp (layerKey, layerName, unitName, unitKey, geom) SELECT @@ -30,9 +30,9 @@ final class GeographicalUnitBaseImporter ) AS i (layerKey, layerName, unitName, unitKey, wkt, srid) SQL; - private const LOG_PREFIX = '[GeographicalUnitBAseImporter] '; + private const string LOG_PREFIX = '[GeographicalUnitBAseImporter] '; - private const VALUE = '(?, ?::jsonb, ?, ?, ?, ?::int)'; + private const string VALUE = '(?, ?::jsonb, ?, ?, ?, ?::int)'; /** * @var array diff --git a/src/Bundle/ChillMainBundle/Service/Import/PostalCodeBEFromBestAddress.php b/src/Bundle/ChillMainBundle/Service/Import/PostalCodeBEFromBestAddress.php index a95ba1abc..47c9eca8c 100644 --- a/src/Bundle/ChillMainBundle/Service/Import/PostalCodeBEFromBestAddress.php +++ b/src/Bundle/ChillMainBundle/Service/Import/PostalCodeBEFromBestAddress.php @@ -18,7 +18,7 @@ use Symfony\Contracts\HttpClient\HttpClientInterface; class PostalCodeBEFromBestAddress { - private const RELEASE = 'https://gitea.champs-libres.be/api/v1/repos/Chill-project/belgian-bestaddresses-transform/releases/tags/v1.0.0'; + private const string RELEASE = 'https://gitea.champs-libres.be/api/v1/repos/Chill-project/belgian-bestaddresses-transform/releases/tags/v1.0.0'; public function __construct(private readonly PostalCodeBaseImporter $baseImporter, private readonly HttpClientInterface $client, private readonly LoggerInterface $logger) {} diff --git a/src/Bundle/ChillMainBundle/Service/Import/PostalCodeBaseImporter.php b/src/Bundle/ChillMainBundle/Service/Import/PostalCodeBaseImporter.php index a0fc5a5db..2ec8813f9 100644 --- a/src/Bundle/ChillMainBundle/Service/Import/PostalCodeBaseImporter.php +++ b/src/Bundle/ChillMainBundle/Service/Import/PostalCodeBaseImporter.php @@ -19,7 +19,7 @@ use Doctrine\DBAL\Statement; */ class PostalCodeBaseImporter { - private const QUERY = <<<'SQL' + private const string QUERY = <<<'SQL' WITH g AS ( SELECT DISTINCT country.id AS country_id, @@ -45,7 +45,7 @@ class PostalCodeBaseImporter ON CONFLICT (code, refpostalcodeid, postalcodeSource) WHERE refpostalcodeid IS NOT NULL DO UPDATE SET label = excluded.label, center = excluded.center, updatedAt = NOW() SQL; - private const VALUE = '(?, ?, ?, ?, ?, ?, ?, ?)'; + private const string VALUE = '(?, ?, ?, ?, ?, ?, ?, ?)'; /** * @var array diff --git a/src/Bundle/ChillMainBundle/Service/Import/PostalCodeFRFromOpenData.php b/src/Bundle/ChillMainBundle/Service/Import/PostalCodeFRFromOpenData.php index 8893181a8..6d83afb6c 100644 --- a/src/Bundle/ChillMainBundle/Service/Import/PostalCodeFRFromOpenData.php +++ b/src/Bundle/ChillMainBundle/Service/Import/PostalCodeFRFromOpenData.php @@ -23,7 +23,7 @@ use Symfony\Contracts\HttpClient\HttpClientInterface; */ class PostalCodeFRFromOpenData { - private const CSV = 'https://datanova.laposte.fr/data-fair/api/v1/datasets/laposte-hexasmal/metadata-attachments/base-officielle-codes-postaux.csv'; + private const string CSV = 'https://datanova.laposte.fr/data-fair/api/v1/datasets/laposte-hexasmal/metadata-attachments/base-officielle-codes-postaux.csv'; public function __construct(private readonly PostalCodeBaseImporter $baseImporter, private readonly HttpClientInterface $client, private readonly LoggerInterface $logger) {} diff --git a/src/Bundle/ChillMainBundle/Service/Mailer/ChillMailer.php b/src/Bundle/ChillMainBundle/Service/Mailer/ChillMailer.php index 3edee4763..461d498a3 100644 --- a/src/Bundle/ChillMainBundle/Service/Mailer/ChillMailer.php +++ b/src/Bundle/ChillMainBundle/Service/Mailer/ChillMailer.php @@ -24,6 +24,7 @@ class ChillMailer implements MailerInterface public function __construct(private readonly MailerInterface $initial, private readonly LoggerInterface $chillLogger) {} + #[\Override] public function send(RawMessage $message, ?Envelope $envelope = null): void { if ($message instanceof Email) { diff --git a/src/Bundle/ChillMainBundle/Service/RollingDate/RollingDate.php b/src/Bundle/ChillMainBundle/Service/RollingDate/RollingDate.php index 445b35cb0..0116f0e63 100644 --- a/src/Bundle/ChillMainBundle/Service/RollingDate/RollingDate.php +++ b/src/Bundle/ChillMainBundle/Service/RollingDate/RollingDate.php @@ -13,7 +13,7 @@ namespace Chill\MainBundle\Service\RollingDate; class RollingDate { - final public const ALL_T = [ + final public const array ALL_T = [ self::T_YEAR_PREVIOUS_START, self::T_QUARTER_PREVIOUS_START, self::T_MONTH_PREVIOUS_START, @@ -33,33 +33,33 @@ class RollingDate /** * A given fixed date. */ - final public const T_FIXED_DATE = 'fixed_date'; + final public const string T_FIXED_DATE = 'fixed_date'; - final public const T_MONTH_CURRENT_START = 'month_current_start'; + final public const string T_MONTH_CURRENT_START = 'month_current_start'; - final public const T_MONTH_NEXT_START = 'month_next_start'; + final public const string T_MONTH_NEXT_START = 'month_next_start'; - final public const T_MONTH_PREVIOUS_START = 'month_previous_start'; + final public const string T_MONTH_PREVIOUS_START = 'month_previous_start'; - final public const T_QUARTER_CURRENT_START = 'quarter_current_start'; + final public const string T_QUARTER_CURRENT_START = 'quarter_current_start'; - final public const T_QUARTER_NEXT_START = 'quarter_next_start'; + final public const string T_QUARTER_NEXT_START = 'quarter_next_start'; - final public const T_QUARTER_PREVIOUS_START = 'quarter_previous_start'; + final public const string T_QUARTER_PREVIOUS_START = 'quarter_previous_start'; - final public const T_TODAY = 'today'; + final public const string T_TODAY = 'today'; - final public const T_WEEK_CURRENT_START = 'week_current_start'; + final public const string T_WEEK_CURRENT_START = 'week_current_start'; - final public const T_WEEK_NEXT_START = 'week_next_start'; + final public const string T_WEEK_NEXT_START = 'week_next_start'; - final public const T_WEEK_PREVIOUS_START = 'week_previous_start'; + final public const string T_WEEK_PREVIOUS_START = 'week_previous_start'; - final public const T_YEAR_CURRENT_START = 'year_current_start'; + final public const string T_YEAR_CURRENT_START = 'year_current_start'; - final public const T_YEAR_NEXT_START = 'year_next_start'; + final public const string T_YEAR_NEXT_START = 'year_next_start'; - final public const T_YEAR_PREVIOUS_START = 'year_previous_start'; + final public const string T_YEAR_PREVIOUS_START = 'year_previous_start'; /** * @param string|self::T_* $roll diff --git a/src/Bundle/ChillMainBundle/Service/RollingDate/RollingDateConverter.php b/src/Bundle/ChillMainBundle/Service/RollingDate/RollingDateConverter.php index f569ebf18..cc7943e8a 100644 --- a/src/Bundle/ChillMainBundle/Service/RollingDate/RollingDateConverter.php +++ b/src/Bundle/ChillMainBundle/Service/RollingDate/RollingDateConverter.php @@ -13,6 +13,7 @@ namespace Chill\MainBundle\Service\RollingDate; class RollingDateConverter implements RollingDateConverterInterface { + #[\Override] public function convert(?RollingDate $rollingDate): ?\DateTimeImmutable { if (null === $rollingDate) { diff --git a/src/Bundle/ChillMainBundle/Service/ShortMessage/NullShortMessageSender.php b/src/Bundle/ChillMainBundle/Service/ShortMessage/NullShortMessageSender.php index 16bc87790..4d878d0d5 100644 --- a/src/Bundle/ChillMainBundle/Service/ShortMessage/NullShortMessageSender.php +++ b/src/Bundle/ChillMainBundle/Service/ShortMessage/NullShortMessageSender.php @@ -20,5 +20,6 @@ namespace Chill\MainBundle\Service\ShortMessage; class NullShortMessageSender implements ShortMessageSenderInterface { + #[\Override] public function send(ShortMessage $shortMessage): void {} } diff --git a/src/Bundle/ChillMainBundle/Service/ShortMessage/ShortMessage.php b/src/Bundle/ChillMainBundle/Service/ShortMessage/ShortMessage.php index a2a5b6ed4..ac5ccf9fe 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 { - final public const PRIORITY_LOW = 'low'; + final public const string PRIORITY_LOW = 'low'; - final public const PRIORITY_MEDIUM = 'medium'; + final public const string PRIORITY_MEDIUM = 'medium'; public function __construct(private string $content, private PhoneNumber $phoneNumber, private string $priority = 'low') {} diff --git a/src/Bundle/ChillMainBundle/Service/ShortMessage/ShortMessageTransporter.php b/src/Bundle/ChillMainBundle/Service/ShortMessage/ShortMessageTransporter.php index bbe4f0575..1577b5d85 100644 --- a/src/Bundle/ChillMainBundle/Service/ShortMessage/ShortMessageTransporter.php +++ b/src/Bundle/ChillMainBundle/Service/ShortMessage/ShortMessageTransporter.php @@ -22,6 +22,7 @@ class ShortMessageTransporter implements ShortMessageTransporterInterface { public function __construct(private readonly ShortMessageSenderInterface $sender) {} + #[\Override] public function send(ShortMessage $shortMessage): void { $this->sender->send($shortMessage); diff --git a/src/Bundle/ChillMainBundle/Service/ShortMessageOvh/OvhShortMessageSender.php b/src/Bundle/ChillMainBundle/Service/ShortMessageOvh/OvhShortMessageSender.php index d81123c9a..dec06e01b 100644 --- a/src/Bundle/ChillMainBundle/Service/ShortMessageOvh/OvhShortMessageSender.php +++ b/src/Bundle/ChillMainBundle/Service/ShortMessageOvh/OvhShortMessageSender.php @@ -38,6 +38,7 @@ class OvhShortMessageSender implements ShortMessageSenderInterface private readonly PhoneNumberUtil $phoneNumberUtil ) {} + #[\Override] public function send(ShortMessage $shortMessage): void { $receiver = $this->phoneNumberUtil->format($shortMessage->getPhoneNumber(), PhoneNumberFormat::E164); diff --git a/src/Bundle/ChillMainBundle/Templating/CSVCellTwig.php b/src/Bundle/ChillMainBundle/Templating/CSVCellTwig.php index a3968231e..6f7060f0c 100644 --- a/src/Bundle/ChillMainBundle/Templating/CSVCellTwig.php +++ b/src/Bundle/ChillMainBundle/Templating/CSVCellTwig.php @@ -41,6 +41,7 @@ class CSVCellTwig extends AbstractExtension * * @see Twig_Extension::getFilters() */ + #[\Override] public function getFilters() { return [ diff --git a/src/Bundle/ChillMainBundle/Templating/ChillMarkdownRenderExtension.php b/src/Bundle/ChillMainBundle/Templating/ChillMarkdownRenderExtension.php index 54c9c4f63..39931b4ed 100644 --- a/src/Bundle/ChillMainBundle/Templating/ChillMarkdownRenderExtension.php +++ b/src/Bundle/ChillMainBundle/Templating/ChillMarkdownRenderExtension.php @@ -30,6 +30,7 @@ final class ChillMarkdownRenderExtension extends AbstractExtension $this->parsedown->setSafeMode(true); } + #[\Override] public function getFilters(): array { return [ diff --git a/src/Bundle/ChillMainBundle/Templating/ChillTwigHelper.php b/src/Bundle/ChillMainBundle/Templating/ChillTwigHelper.php index da91fc6f8..6734fc1df 100644 --- a/src/Bundle/ChillMainBundle/Templating/ChillTwigHelper.php +++ b/src/Bundle/ChillMainBundle/Templating/ChillTwigHelper.php @@ -18,6 +18,7 @@ use Twig\TwigFilter; class ChillTwigHelper extends AbstractExtension { + #[\Override] public function getFilters() { return [ diff --git a/src/Bundle/ChillMainBundle/Templating/ChillTwigRoutingHelper.php b/src/Bundle/ChillMainBundle/Templating/ChillTwigRoutingHelper.php index 9a11a7ffc..e3c53bc37 100644 --- a/src/Bundle/ChillMainBundle/Templating/ChillTwigRoutingHelper.php +++ b/src/Bundle/ChillMainBundle/Templating/ChillTwigRoutingHelper.php @@ -43,6 +43,7 @@ class ChillTwigRoutingHelper extends AbstractExtension $this->originalExtension = $originalExtension; } + #[\Override] public function getFilters() { return [ @@ -50,6 +51,7 @@ class ChillTwigRoutingHelper extends AbstractExtension ]; } + #[\Override] public function getFunctions() { return [ diff --git a/src/Bundle/ChillMainBundle/Templating/Entity/AddressRender.php b/src/Bundle/ChillMainBundle/Templating/Entity/AddressRender.php index f59b1cd66..e7570b0d8 100644 --- a/src/Bundle/ChillMainBundle/Templating/Entity/AddressRender.php +++ b/src/Bundle/ChillMainBundle/Templating/Entity/AddressRender.php @@ -19,7 +19,7 @@ use Chill\MainBundle\Templating\TranslatableStringHelperInterface; */ class AddressRender implements ChillEntityRenderInterface { - final public const DEFAULT_OPTIONS = [ + final public const array DEFAULT_OPTIONS = [ 'with_valid_from' => false, 'with_valid_to' => false, 'with_picto' => false, @@ -32,6 +32,7 @@ class AddressRender implements ChillEntityRenderInterface public function __construct(private readonly \Twig\Environment $templating, private readonly TranslatableStringHelperInterface $translatableStringHelper) {} + #[\Override] public function renderBox($addr, array $options): string { $options = \array_merge(self::DEFAULT_OPTIONS, $options); @@ -112,11 +113,13 @@ class AddressRender implements ChillEntityRenderInterface return $res; } + #[\Override] public function renderString($addr, array $options): string { return implode(' — ', $this->renderLines($addr)); } + #[\Override] public function supports($entity, array $options): bool { return $entity instanceof Address; diff --git a/src/Bundle/ChillMainBundle/Templating/Entity/ChillEntityRender.php b/src/Bundle/ChillMainBundle/Templating/Entity/ChillEntityRender.php index 0e2743e8c..be25a2ef8 100644 --- a/src/Bundle/ChillMainBundle/Templating/Entity/ChillEntityRender.php +++ b/src/Bundle/ChillMainBundle/Templating/Entity/ChillEntityRender.php @@ -18,17 +18,20 @@ class ChillEntityRender implements ChillEntityRenderInterface { use BoxUtilsChillEntityRenderTrait; + #[\Override] public function renderBox($entity, array $options): string { return $this->getDefaultOpeningBox('default').$entity .$this->getDefaultClosingBox(); } + #[\Override] public function renderString($entity, array $options): string { return (string) $entity; } + #[\Override] public function supports($entity, array $options): bool { return true; diff --git a/src/Bundle/ChillMainBundle/Templating/Entity/ChillEntityRenderExtension.php b/src/Bundle/ChillMainBundle/Templating/Entity/ChillEntityRenderExtension.php index 9c8d4599e..f2e77f253 100644 --- a/src/Bundle/ChillMainBundle/Templating/Entity/ChillEntityRenderExtension.php +++ b/src/Bundle/ChillMainBundle/Templating/Entity/ChillEntityRenderExtension.php @@ -41,6 +41,7 @@ class ChillEntityRenderExtension extends AbstractExtension /** * @return array|TwigFilter[] */ + #[\Override] public function getFilters() { return [ diff --git a/src/Bundle/ChillMainBundle/Templating/Entity/CommentRender.php b/src/Bundle/ChillMainBundle/Templating/Entity/CommentRender.php index a4d0f48e6..525c82300 100644 --- a/src/Bundle/ChillMainBundle/Templating/Entity/CommentRender.php +++ b/src/Bundle/ChillMainBundle/Templating/Entity/CommentRender.php @@ -23,6 +23,7 @@ class CommentRender implements ChillEntityRenderInterface public function __construct(private readonly UserRepositoryInterface $userRepository, private readonly \Twig\Environment $engine) {} + #[\Override] public function renderBox($entity, array $options): string { // default options @@ -50,11 +51,13 @@ class CommentRender implements ChillEntityRenderInterface ); } + #[\Override] public function renderString($entity, array $options): string { return $entity->getComment(); } + #[\Override] public function supports($entity, array $options): bool { return $entity instanceof CommentEmbeddable; diff --git a/src/Bundle/ChillMainBundle/Templating/Entity/NewsItemRender.php b/src/Bundle/ChillMainBundle/Templating/Entity/NewsItemRender.php index fd2e2e211..b5d6b0d55 100644 --- a/src/Bundle/ChillMainBundle/Templating/Entity/NewsItemRender.php +++ b/src/Bundle/ChillMainBundle/Templating/Entity/NewsItemRender.php @@ -18,16 +18,19 @@ use Chill\MainBundle\Entity\NewsItem; */ final readonly class NewsItemRender implements ChillEntityRenderInterface { + #[\Override] public function renderBox($entity, array $options): string { return ''; } + #[\Override] public function renderString($entity, array $options): string { return $entity->getTitle(); } + #[\Override] public function supports($newsItem, array $options): bool { return $newsItem instanceof NewsItem; diff --git a/src/Bundle/ChillMainBundle/Templating/Entity/UserRender.php b/src/Bundle/ChillMainBundle/Templating/Entity/UserRender.php index 053e8d611..51f9abcde 100644 --- a/src/Bundle/ChillMainBundle/Templating/Entity/UserRender.php +++ b/src/Bundle/ChillMainBundle/Templating/Entity/UserRender.php @@ -26,7 +26,7 @@ use Twig\Error\SyntaxError; */ class UserRender implements ChillEntityRenderInterface { - final public const DEFAULT_OPTIONS = [ + final public const array DEFAULT_OPTIONS = [ 'main_scope' => true, 'user_job' => true, 'absence' => true, @@ -45,6 +45,7 @@ class UserRender implements ChillEntityRenderInterface * @throws RuntimeError * @throws SyntaxError */ + #[\Override] public function renderBox($entity, array $options): string { $opts = \array_merge(self::DEFAULT_OPTIONS, $options); @@ -61,6 +62,7 @@ class UserRender implements ChillEntityRenderInterface ]); } + #[\Override] public function renderString($entity, array $options): string { $opts = \array_merge(self::DEFAULT_OPTIONS, $options); @@ -92,6 +94,7 @@ class UserRender implements ChillEntityRenderInterface return $str; } + #[\Override] public function supports($entity, array $options): bool { return $entity instanceof User; diff --git a/src/Bundle/ChillMainBundle/Templating/Events/DelegatedBlockRenderingEvent.php b/src/Bundle/ChillMainBundle/Templating/Events/DelegatedBlockRenderingEvent.php index afdb32349..2f956f6e5 100644 --- a/src/Bundle/ChillMainBundle/Templating/Events/DelegatedBlockRenderingEvent.php +++ b/src/Bundle/ChillMainBundle/Templating/Events/DelegatedBlockRenderingEvent.php @@ -68,21 +68,25 @@ class DelegatedBlockRenderingEvent extends \Symfony\Contracts\EventDispatcher\Ev return $this->content; } + #[\Override] public function offsetExists($offset): bool { return isset($this->context[$offset]); } + #[\Override] public function offsetGet($offset): mixed { return $this->context[$offset]; } + #[\Override] public function offsetSet($offset, $value): never { throw new \RuntimeException('The event context is read-only, you are not allowed to update it.'); } + #[\Override] 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 48a25670d..8a08049a0 100644 --- a/src/Bundle/ChillMainBundle/Templating/Listing/FilterOrderHelper.php +++ b/src/Bundle/ChillMainBundle/Templating/Listing/FilterOrderHelper.php @@ -28,7 +28,7 @@ final class FilterOrderHelper private array $dateRanges = []; - public const FORM_NAME = 'f'; + public const string FORM_NAME = 'f'; private array $formOptions = []; diff --git a/src/Bundle/ChillMainBundle/Templating/Listing/FilterOrderHelperFactory.php b/src/Bundle/ChillMainBundle/Templating/Listing/FilterOrderHelperFactory.php index 0aff466dc..867ce4b3a 100644 --- a/src/Bundle/ChillMainBundle/Templating/Listing/FilterOrderHelperFactory.php +++ b/src/Bundle/ChillMainBundle/Templating/Listing/FilterOrderHelperFactory.php @@ -18,6 +18,7 @@ class FilterOrderHelperFactory implements FilterOrderHelperFactoryInterface { public function __construct(private readonly FormFactoryInterface $formFactory, private readonly RequestStack $requestStack) {} + #[\Override] public function create(string $context, ?array $options = []): FilterOrderHelperBuilder { return new FilterOrderHelperBuilder($this->formFactory, $this->requestStack); diff --git a/src/Bundle/ChillMainBundle/Templating/Listing/Templating.php b/src/Bundle/ChillMainBundle/Templating/Listing/Templating.php index 6d91cdd83..61f60d0fe 100644 --- a/src/Bundle/ChillMainBundle/Templating/Listing/Templating.php +++ b/src/Bundle/ChillMainBundle/Templating/Listing/Templating.php @@ -27,6 +27,7 @@ class Templating extends AbstractExtension private readonly FilterOrderGetActiveFilterHelper $filterOrderGetActiveFilterHelper, ) {} + #[\Override] public function getFilters(): array { return [ diff --git a/src/Bundle/ChillMainBundle/Templating/TranslatableStringHelper.php b/src/Bundle/ChillMainBundle/Templating/TranslatableStringHelper.php index b7fc7a8cc..9de64abd3 100644 --- a/src/Bundle/ChillMainBundle/Templating/TranslatableStringHelper.php +++ b/src/Bundle/ChillMainBundle/Templating/TranslatableStringHelper.php @@ -24,6 +24,7 @@ final readonly class TranslatableStringHelper implements TranslatableStringHelpe $this->defaultLocale = $parameterBag->get('kernel.default_locale'); } + #[\Override] public function localize(array $translatableStrings): ?string { if ([] === $translatableStrings) { diff --git a/src/Bundle/ChillMainBundle/Templating/TranslatableStringTwig.php b/src/Bundle/ChillMainBundle/Templating/TranslatableStringTwig.php index eceae8d9c..70a5b6c7a 100644 --- a/src/Bundle/ChillMainBundle/Templating/TranslatableStringTwig.php +++ b/src/Bundle/ChillMainBundle/Templating/TranslatableStringTwig.php @@ -31,6 +31,7 @@ class TranslatableStringTwig extends AbstractExtension * * @see Twig_Extension::getFilters() */ + #[\Override] public function getFilters() { return [ diff --git a/src/Bundle/ChillMainBundle/Templating/Widget/WidgetRenderingTwig.php b/src/Bundle/ChillMainBundle/Templating/Widget/WidgetRenderingTwig.php index 7245c62fb..d00181d96 100644 --- a/src/Bundle/ChillMainBundle/Templating/Widget/WidgetRenderingTwig.php +++ b/src/Bundle/ChillMainBundle/Templating/Widget/WidgetRenderingTwig.php @@ -83,6 +83,7 @@ class WidgetRenderingTwig extends AbstractExtension $this->widget[$place][$ordering] = [$widget, $config]; } + #[\Override] public function getFunctions() { return [ diff --git a/src/Bundle/ChillMainBundle/Test/DummyPaginator.php b/src/Bundle/ChillMainBundle/Test/DummyPaginator.php index a44c65e9b..41c6e9dcc 100644 --- a/src/Bundle/ChillMainBundle/Test/DummyPaginator.php +++ b/src/Bundle/ChillMainBundle/Test/DummyPaginator.php @@ -25,6 +25,7 @@ class DummyPaginator implements PaginatorFactoryInterface private readonly array $routeParameters = [] ) {} + #[\Override] public function create(int $totalItems, ?string $route = null, ?array $routeParameters = null): PaginatorInterface { return new Paginator( @@ -39,16 +40,19 @@ class DummyPaginator implements PaginatorFactoryInterface ); } + #[\Override] public function getCurrentItemsPerPage(): int { return 20; } + #[\Override] public function getCurrentPageFirstItemNumber(): int { return 1; } + #[\Override] public function getCurrentPageNumber(): int { return 1; diff --git a/src/Bundle/ChillMainBundle/Test/Export/AbstractAggregatorTest.php b/src/Bundle/ChillMainBundle/Test/Export/AbstractAggregatorTest.php index 12182b96b..ca26d633d 100644 --- a/src/Bundle/ChillMainBundle/Test/Export/AbstractAggregatorTest.php +++ b/src/Bundle/ChillMainBundle/Test/Export/AbstractAggregatorTest.php @@ -22,6 +22,7 @@ use Traversable; */ abstract class AbstractAggregatorTest extends KernelTestCase { + #[\Override] public static function tearDownAfterClass(): void { if (null !== self::getContainer()) { diff --git a/src/Bundle/ChillMainBundle/Test/Export/AbstractFilterTest.php b/src/Bundle/ChillMainBundle/Test/Export/AbstractFilterTest.php index 5c38515fc..5e4331f95 100644 --- a/src/Bundle/ChillMainBundle/Test/Export/AbstractFilterTest.php +++ b/src/Bundle/ChillMainBundle/Test/Export/AbstractFilterTest.php @@ -28,11 +28,13 @@ abstract class AbstractFilterTest extends KernelTestCase */ private $prophet; + #[\Override] protected function setUp(): void { $this->prophet = $this->getProphet(); } + #[\Override] public static function tearDownAfterClass(): void { if (null !== self::getContainer()) { diff --git a/src/Bundle/ChillMainBundle/Tests/Authorization/ParentRoleHelperTest.php b/src/Bundle/ChillMainBundle/Tests/Authorization/ParentRoleHelperTest.php index a9aaaa130..40bd75fb2 100644 --- a/src/Bundle/ChillMainBundle/Tests/Authorization/ParentRoleHelperTest.php +++ b/src/Bundle/ChillMainBundle/Tests/Authorization/ParentRoleHelperTest.php @@ -24,6 +24,7 @@ final class ParentRoleHelperTest extends KernelTestCase { private ParentRoleHelper $parentRoleHelper; + #[\Override] protected function setUp(): void { self::bootKernel(); diff --git a/src/Bundle/ChillMainBundle/Tests/Controller/AddressControllerTest.php b/src/Bundle/ChillMainBundle/Tests/Controller/AddressControllerTest.php index 4a65c434c..772225080 100644 --- a/src/Bundle/ChillMainBundle/Tests/Controller/AddressControllerTest.php +++ b/src/Bundle/ChillMainBundle/Tests/Controller/AddressControllerTest.php @@ -27,6 +27,7 @@ final class AddressControllerTest extends \Symfony\Bundle\FrameworkBundle\Test\W private KernelBrowser $client; + #[\Override] protected function tearDown(): void { self::ensureKernelShutdown(); diff --git a/src/Bundle/ChillMainBundle/Tests/Controller/AddressToReferenceMatcherControllerTest.php b/src/Bundle/ChillMainBundle/Tests/Controller/AddressToReferenceMatcherControllerTest.php index ec4d3fa09..f5e7b7809 100644 --- a/src/Bundle/ChillMainBundle/Tests/Controller/AddressToReferenceMatcherControllerTest.php +++ b/src/Bundle/ChillMainBundle/Tests/Controller/AddressToReferenceMatcherControllerTest.php @@ -30,6 +30,7 @@ class AddressToReferenceMatcherControllerTest extends WebTestCase private AddressRepository $addressRepository; + #[\Override] protected function tearDown(): void { self::ensureKernelShutdown(); diff --git a/src/Bundle/ChillMainBundle/Tests/Controller/NewsItemControllerTest.php b/src/Bundle/ChillMainBundle/Tests/Controller/NewsItemControllerTest.php index 3881188e9..2b86f1b5d 100644 --- a/src/Bundle/ChillMainBundle/Tests/Controller/NewsItemControllerTest.php +++ b/src/Bundle/ChillMainBundle/Tests/Controller/NewsItemControllerTest.php @@ -34,11 +34,13 @@ class NewsItemControllerTest extends WebTestCase private readonly EntityManagerInterface $em; + #[\Override] protected function tearDown(): void { self::ensureKernelShutdown(); } + #[\Override] public static function tearDownAfterClass(): void { self::bootKernel(); diff --git a/src/Bundle/ChillMainBundle/Tests/Controller/NewsItemsHistoryControllerTest.php b/src/Bundle/ChillMainBundle/Tests/Controller/NewsItemsHistoryControllerTest.php index d36fca40c..afc862d90 100644 --- a/src/Bundle/ChillMainBundle/Tests/Controller/NewsItemsHistoryControllerTest.php +++ b/src/Bundle/ChillMainBundle/Tests/Controller/NewsItemsHistoryControllerTest.php @@ -30,6 +30,7 @@ class NewsItemsHistoryControllerTest extends WebTestCase */ private static array $toDelete = []; + #[\Override] public static function tearDownAfterClass(): void { self::bootKernel(); @@ -46,6 +47,7 @@ class NewsItemsHistoryControllerTest extends WebTestCase self::ensureKernelShutdown(); } + #[\Override] protected function tearDown(): void { self::ensureKernelShutdown(); diff --git a/src/Bundle/ChillMainBundle/Tests/Controller/NotificationApiControllerTest.php b/src/Bundle/ChillMainBundle/Tests/Controller/NotificationApiControllerTest.php index 1c19a1466..03319d5fa 100644 --- a/src/Bundle/ChillMainBundle/Tests/Controller/NotificationApiControllerTest.php +++ b/src/Bundle/ChillMainBundle/Tests/Controller/NotificationApiControllerTest.php @@ -30,6 +30,7 @@ final class NotificationApiControllerTest extends WebTestCase private static array $toDelete = []; + #[\Override] protected function tearDown(): void { $em = self::getContainer()->get(EntityManagerInterface::class); diff --git a/src/Bundle/ChillMainBundle/Tests/Controller/PermissionApiControllerTest.php b/src/Bundle/ChillMainBundle/Tests/Controller/PermissionApiControllerTest.php index a99871119..a0b7aa88d 100644 --- a/src/Bundle/ChillMainBundle/Tests/Controller/PermissionApiControllerTest.php +++ b/src/Bundle/ChillMainBundle/Tests/Controller/PermissionApiControllerTest.php @@ -23,6 +23,7 @@ final class PermissionApiControllerTest extends WebTestCase { use PrepareClientTrait; + #[\Override] protected function tearDown(): void { self::ensureKernelShutdown(); diff --git a/src/Bundle/ChillMainBundle/Tests/Cron/CronJobDatabaseInteractionTest.php b/src/Bundle/ChillMainBundle/Tests/Cron/CronJobDatabaseInteractionTest.php index 278cecd1e..362197a44 100644 --- a/src/Bundle/ChillMainBundle/Tests/Cron/CronJobDatabaseInteractionTest.php +++ b/src/Bundle/ChillMainBundle/Tests/Cron/CronJobDatabaseInteractionTest.php @@ -34,6 +34,7 @@ class CronJobDatabaseInteractionTest extends KernelTestCase private CronJobExecutionRepository $cronJobExecutionRepository; + #[\Override] protected function setUp(): void { self::bootKernel(); @@ -41,6 +42,7 @@ class CronJobDatabaseInteractionTest extends KernelTestCase $this->cronJobExecutionRepository = self::getContainer()->get(CronJobExecutionRepository::class); } + #[\Override] public static function tearDownAfterClass(): void { self::bootKernel(); @@ -81,16 +83,19 @@ class CronJobDatabaseInteractionTest extends KernelTestCase class JobWithReturn implements CronJobInterface { + #[\Override] public function canRun(?CronJobExecution $cronJobExecution): bool { return true; } + #[\Override] public function getKey(): string { return 'with-data'; } + #[\Override] public function run(array $lastExecutionData): ?array { return ['data' => 'test']; diff --git a/src/Bundle/ChillMainBundle/Tests/Cron/CronManagerTest.php b/src/Bundle/ChillMainBundle/Tests/Cron/CronManagerTest.php index 548017c90..6a57c0b14 100644 --- a/src/Bundle/ChillMainBundle/Tests/Cron/CronManagerTest.php +++ b/src/Bundle/ChillMainBundle/Tests/Cron/CronManagerTest.php @@ -163,16 +163,19 @@ class JobCanRun implements CronJobInterface { public function __construct(private readonly string $key) {} + #[\Override] public function canRun(?CronJobExecution $cronJobExecution): bool { return true; } + #[\Override] public function getKey(): string { return $this->key; } + #[\Override] public function run(array $lastExecutionData): ?array { return null; @@ -181,16 +184,19 @@ class JobCanRun implements CronJobInterface class JobCannotRun implements CronJobInterface { + #[\Override] public function canRun(?CronJobExecution $cronJobExecution): bool { return false; } + #[\Override] public function getKey(): string { return 'job-b'; } + #[\Override] public function run(array $lastExecutionData): ?array { return null; diff --git a/src/Bundle/ChillMainBundle/Tests/Doctrine/DQL/AgeTest.php b/src/Bundle/ChillMainBundle/Tests/Doctrine/DQL/AgeTest.php index cdb24b4b7..e0bb9aded 100644 --- a/src/Bundle/ChillMainBundle/Tests/Doctrine/DQL/AgeTest.php +++ b/src/Bundle/ChillMainBundle/Tests/Doctrine/DQL/AgeTest.php @@ -24,6 +24,7 @@ final class AgeTest extends KernelTestCase { private EntityManagerInterface $entityManager; + #[\Override] protected function setUp(): void { self::bootKernel(); diff --git a/src/Bundle/ChillMainBundle/Tests/Doctrine/DQL/GreatestTest.php b/src/Bundle/ChillMainBundle/Tests/Doctrine/DQL/GreatestTest.php index 2cf679be7..f744bdea9 100644 --- a/src/Bundle/ChillMainBundle/Tests/Doctrine/DQL/GreatestTest.php +++ b/src/Bundle/ChillMainBundle/Tests/Doctrine/DQL/GreatestTest.php @@ -25,6 +25,7 @@ final class GreatestTest extends KernelTestCase { private EntityManagerInterface $entityManager; + #[\Override] protected function setUp(): void { self::bootKernel(); diff --git a/src/Bundle/ChillMainBundle/Tests/Doctrine/DQL/JsonBuildObjectTest.php b/src/Bundle/ChillMainBundle/Tests/Doctrine/DQL/JsonBuildObjectTest.php index a62b3a92e..c2cacc5a7 100644 --- a/src/Bundle/ChillMainBundle/Tests/Doctrine/DQL/JsonBuildObjectTest.php +++ b/src/Bundle/ChillMainBundle/Tests/Doctrine/DQL/JsonBuildObjectTest.php @@ -26,6 +26,7 @@ class JsonBuildObjectTest extends KernelTestCase { private EntityManagerInterface $entityManager; + #[\Override] protected function setUp(): void { parent::setUp(); diff --git a/src/Bundle/ChillMainBundle/Tests/Doctrine/DQL/JsonExtractTest.php b/src/Bundle/ChillMainBundle/Tests/Doctrine/DQL/JsonExtractTest.php index dec63a64c..35ea91a4a 100644 --- a/src/Bundle/ChillMainBundle/Tests/Doctrine/DQL/JsonExtractTest.php +++ b/src/Bundle/ChillMainBundle/Tests/Doctrine/DQL/JsonExtractTest.php @@ -24,6 +24,7 @@ final class JsonExtractTest extends KernelTestCase { private EntityManagerInterface $em; + #[\Override] protected function setUp(): void { self::bootKernel(); diff --git a/src/Bundle/ChillMainBundle/Tests/Doctrine/DQL/JsonbExistsInArrayTest.php b/src/Bundle/ChillMainBundle/Tests/Doctrine/DQL/JsonbExistsInArrayTest.php index d61f1af0e..fe8f66113 100644 --- a/src/Bundle/ChillMainBundle/Tests/Doctrine/DQL/JsonbExistsInArrayTest.php +++ b/src/Bundle/ChillMainBundle/Tests/Doctrine/DQL/JsonbExistsInArrayTest.php @@ -24,6 +24,7 @@ final class JsonbExistsInArrayTest extends KernelTestCase { private EntityManagerInterface $em; + #[\Override] protected function setUp(): void { self::bootKernel(); diff --git a/src/Bundle/ChillMainBundle/Tests/Doctrine/DQL/LeastTest.php b/src/Bundle/ChillMainBundle/Tests/Doctrine/DQL/LeastTest.php index d7a3dffba..8c0ac497e 100644 --- a/src/Bundle/ChillMainBundle/Tests/Doctrine/DQL/LeastTest.php +++ b/src/Bundle/ChillMainBundle/Tests/Doctrine/DQL/LeastTest.php @@ -25,6 +25,7 @@ final class LeastTest extends KernelTestCase { private EntityManagerInterface $entityManager; + #[\Override] protected function setUp(): void { self::bootKernel(); diff --git a/src/Bundle/ChillMainBundle/Tests/Entity/NotificationTest.php b/src/Bundle/ChillMainBundle/Tests/Entity/NotificationTest.php index 26a9b5980..d7809bb95 100644 --- a/src/Bundle/ChillMainBundle/Tests/Entity/NotificationTest.php +++ b/src/Bundle/ChillMainBundle/Tests/Entity/NotificationTest.php @@ -27,11 +27,13 @@ final class NotificationTest extends KernelTestCase { private array $toDelete = []; + #[\Override] protected function setUp(): void { self::bootKernel(); } + #[\Override] protected function tearDown(): void { $em = self::getContainer()->get(EntityManagerInterface::class); diff --git a/src/Bundle/ChillMainBundle/Tests/Export/AccompanyingCourseExportHelperTest.php b/src/Bundle/ChillMainBundle/Tests/Export/AccompanyingCourseExportHelperTest.php index fc12c3c86..e747fdcb3 100644 --- a/src/Bundle/ChillMainBundle/Tests/Export/AccompanyingCourseExportHelperTest.php +++ b/src/Bundle/ChillMainBundle/Tests/Export/AccompanyingCourseExportHelperTest.php @@ -31,12 +31,14 @@ class AccompanyingCourseExportHelperTest extends KernelTestCase private EntityManagerInterface $em; + #[\Override] protected function setUp(): void { self::bootKernel(); $this->em = self::getContainer()->get(EntityManagerInterface::class); } + #[\Override] public static function tearDownAfterClass(): void { self::bootKernel(); diff --git a/src/Bundle/ChillMainBundle/Tests/Export/ExportManagerTest.php b/src/Bundle/ChillMainBundle/Tests/Export/ExportManagerTest.php index 7739bc7b9..a6148482a 100644 --- a/src/Bundle/ChillMainBundle/Tests/Export/ExportManagerTest.php +++ b/src/Bundle/ChillMainBundle/Tests/Export/ExportManagerTest.php @@ -54,6 +54,7 @@ final class ExportManagerTest extends KernelTestCase private Prophet $prophet; + #[\Override] protected function setUp(): void { self::bootKernel(); @@ -61,6 +62,7 @@ final class ExportManagerTest extends KernelTestCase $this->prophet = new Prophet(); } + #[\Override] protected function tearDown(): void { $this->prophet->checkPredictions(); @@ -534,30 +536,37 @@ class DummyFilterWithApplying implements FilterInterface private readonly string $applyOn ) {} + #[\Override] public function getTitle() { return 'dummy'; } + #[\Override] public function buildForm(FormBuilderInterface $builder) {} + #[\Override] public function getFormDefaultData(): array { return []; } + #[\Override] public function describeAction($data, $format = 'string') { return ['dummy filter', []]; } + #[\Override] public function addRole(): ?string { return $this->role; } + #[\Override] public function alterQuery(QueryBuilder $qb, $data) {} + #[\Override] public function applyOn() { return $this->applyOn; @@ -574,58 +583,70 @@ class DummyExport implements ExportInterface private readonly array $supportedModifiers, ) {} + #[\Override] public function getTitle() { return 'dummy'; } + #[\Override] public function buildForm(FormBuilderInterface $builder) {} + #[\Override] public function getFormDefaultData(): array { return []; } + #[\Override] public function getAllowedFormattersTypes() { return ['test']; } + #[\Override] public function getDescription() { return 'dummy export'; } + #[\Override] public function getLabels($key, array $values, mixed $data) { return []; } + #[\Override] public function getQueryKeys($data) { return []; } + #[\Override] public function getResult($query, $data) { return []; } + #[\Override] public function getType() { return 'dummy'; } + #[\Override] public function initiateQuery(array $requiredModifiers, array $acl, array $data = []) { return null; } + #[\Override] public function requiredRole(): string { return $this->role; } + #[\Override] public function supportsModifiers() { return $this->supportedModifiers; diff --git a/src/Bundle/ChillMainBundle/Tests/Export/SortExportElementTest.php b/src/Bundle/ChillMainBundle/Tests/Export/SortExportElementTest.php index cd820bb1c..3a7a411f5 100644 --- a/src/Bundle/ChillMainBundle/Tests/Export/SortExportElementTest.php +++ b/src/Bundle/ChillMainBundle/Tests/Export/SortExportElementTest.php @@ -29,6 +29,7 @@ class SortExportElementTest extends KernelTestCase { private SortExportElement $sortExportElement; + #[\Override] public function setUp(): void { parent::setUpBeforeClass(); diff --git a/src/Bundle/ChillMainBundle/Tests/Form/Type/PickPostalCodeTypeTest.php b/src/Bundle/ChillMainBundle/Tests/Form/Type/PickPostalCodeTypeTest.php index 19788bea7..128e60751 100644 --- a/src/Bundle/ChillMainBundle/Tests/Form/Type/PickPostalCodeTypeTest.php +++ b/src/Bundle/ChillMainBundle/Tests/Form/Type/PickPostalCodeTypeTest.php @@ -43,6 +43,7 @@ final class PickPostalCodeTypeTest extends TypeTestCase $this->assertEquals(1, $form['postal_code']->getData()->getId()); } + #[\Override] protected function getExtensions() { $postalCodeRepository = $this->prophesize(PostalCodeRepositoryInterface::class); diff --git a/src/Bundle/ChillMainBundle/Tests/Form/Type/PickRollingDateTypeTest.php b/src/Bundle/ChillMainBundle/Tests/Form/Type/PickRollingDateTypeTest.php index fca789541..8a74eab20 100644 --- a/src/Bundle/ChillMainBundle/Tests/Form/Type/PickRollingDateTypeTest.php +++ b/src/Bundle/ChillMainBundle/Tests/Form/Type/PickRollingDateTypeTest.php @@ -43,6 +43,7 @@ final class PickRollingDateTypeTest extends TypeTestCase $this->assertEquals(RollingDate::T_YEAR_PREVIOUS_START, $rollingDate->getRoll()); } + #[\Override] protected function getExtensions(): array { $type = new PickRollingDateType(); diff --git a/src/Bundle/ChillMainBundle/Tests/Form/Type/ScopePickerTypeTest.php b/src/Bundle/ChillMainBundle/Tests/Form/Type/ScopePickerTypeTest.php index 3d3813748..c04330e25 100644 --- a/src/Bundle/ChillMainBundle/Tests/Form/Type/ScopePickerTypeTest.php +++ b/src/Bundle/ChillMainBundle/Tests/Form/Type/ScopePickerTypeTest.php @@ -75,6 +75,7 @@ final class ScopePickerTypeTest extends TypeTestCase $this->assertContains('entity', $view['scope']->vars['block_prefixes']); } + #[\Override] protected function getExtensions() { $user = new User(); diff --git a/src/Bundle/ChillMainBundle/Tests/Pagination/PageTest.php b/src/Bundle/ChillMainBundle/Tests/Pagination/PageTest.php index 14bb7dfe6..c38377d5e 100644 --- a/src/Bundle/ChillMainBundle/Tests/Pagination/PageTest.php +++ b/src/Bundle/ChillMainBundle/Tests/Pagination/PageTest.php @@ -28,6 +28,7 @@ final class PageTest extends KernelTestCase protected $prophet; + #[\Override] protected function setUp(): void { $this->prophet = new \Prophecy\Prophet(); diff --git a/src/Bundle/ChillMainBundle/Tests/Pagination/PaginatorTest.php b/src/Bundle/ChillMainBundle/Tests/Pagination/PaginatorTest.php index 579348196..01cd69194 100644 --- a/src/Bundle/ChillMainBundle/Tests/Pagination/PaginatorTest.php +++ b/src/Bundle/ChillMainBundle/Tests/Pagination/PaginatorTest.php @@ -29,6 +29,7 @@ final class PaginatorTest extends KernelTestCase protected $prophet; + #[\Override] protected function setUp(): void { $this->prophet = new \Prophecy\Prophet(); diff --git a/src/Bundle/ChillMainBundle/Tests/Repository/NewsItemRepositoryTest.php b/src/Bundle/ChillMainBundle/Tests/Repository/NewsItemRepositoryTest.php index 068a7e6fb..61133831a 100644 --- a/src/Bundle/ChillMainBundle/Tests/Repository/NewsItemRepositoryTest.php +++ b/src/Bundle/ChillMainBundle/Tests/Repository/NewsItemRepositoryTest.php @@ -32,12 +32,14 @@ class NewsItemRepositoryTest extends KernelTestCase */ private array $toDelete = []; + #[\Override] protected function setUp(): void { self::bootKernel(); $this->entityManager = self::getContainer()->get(EntityManagerInterface::class); } + #[\Override] protected function tearDown(): void { foreach ($this->toDelete as [$class, $entity]) { diff --git a/src/Bundle/ChillMainBundle/Tests/Routing/Loader/RouteLoaderTest.php b/src/Bundle/ChillMainBundle/Tests/Routing/Loader/RouteLoaderTest.php index bcbf609df..87122db96 100644 --- a/src/Bundle/ChillMainBundle/Tests/Routing/Loader/RouteLoaderTest.php +++ b/src/Bundle/ChillMainBundle/Tests/Routing/Loader/RouteLoaderTest.php @@ -24,6 +24,7 @@ final class RouteLoaderTest extends KernelTestCase { private ?object $router = null; + #[\Override] protected function setUp(): void { self::bootKernel(); diff --git a/src/Bundle/ChillMainBundle/Tests/Search/AbstractSearchTest.php b/src/Bundle/ChillMainBundle/Tests/Search/AbstractSearchTest.php index d783cc22c..b63e481c3 100644 --- a/src/Bundle/ChillMainBundle/Tests/Search/AbstractSearchTest.php +++ b/src/Bundle/ChillMainBundle/Tests/Search/AbstractSearchTest.php @@ -25,6 +25,7 @@ final class AbstractSearchTest extends \PHPUnit\Framework\TestCase */ private \Chill\MainBundle\Search\AbstractSearch&\PHPUnit\Framework\MockObject\MockObject $stub; + #[\Override] protected function setUp(): void { $this->stub = $this->getMockForAbstractClass(\Chill\MainBundle\Search\AbstractSearch::class); diff --git a/src/Bundle/ChillMainBundle/Tests/Search/SearchProviderTest.php b/src/Bundle/ChillMainBundle/Tests/Search/SearchProviderTest.php index d1602f7e2..cf9751153 100644 --- a/src/Bundle/ChillMainBundle/Tests/Search/SearchProviderTest.php +++ b/src/Bundle/ChillMainBundle/Tests/Search/SearchProviderTest.php @@ -27,6 +27,7 @@ final class SearchProviderTest extends TestCase { private SearchProvider $search; + #[\Override] protected function setUp(): void { $this->search = new SearchProvider(); diff --git a/src/Bundle/ChillMainBundle/Tests/Security/Authorization/AuthorizationHelperTest.php b/src/Bundle/ChillMainBundle/Tests/Security/Authorization/AuthorizationHelperTest.php index 1ebe9610d..79ccbd702 100644 --- a/src/Bundle/ChillMainBundle/Tests/Security/Authorization/AuthorizationHelperTest.php +++ b/src/Bundle/ChillMainBundle/Tests/Security/Authorization/AuthorizationHelperTest.php @@ -40,6 +40,7 @@ final class AuthorizationHelperTest extends KernelTestCase use ProphecyTrait; + #[\Override] protected function setUp(): void { self::bootKernel(); diff --git a/src/Bundle/ChillMainBundle/Tests/Security/PasswordRecover/TokenManagerTest.php b/src/Bundle/ChillMainBundle/Tests/Security/PasswordRecover/TokenManagerTest.php index 052e61f64..1cde72892 100644 --- a/src/Bundle/ChillMainBundle/Tests/Security/PasswordRecover/TokenManagerTest.php +++ b/src/Bundle/ChillMainBundle/Tests/Security/PasswordRecover/TokenManagerTest.php @@ -24,6 +24,7 @@ final class TokenManagerTest extends KernelTestCase { protected $tokenManager; + #[\Override] protected function setUp(): void { self::bootKernel(); diff --git a/src/Bundle/ChillMainBundle/Tests/Security/Resolver/CenterResolverDispatcherTest.php b/src/Bundle/ChillMainBundle/Tests/Security/Resolver/CenterResolverDispatcherTest.php index b7a38247f..0fe3321c6 100644 --- a/src/Bundle/ChillMainBundle/Tests/Security/Resolver/CenterResolverDispatcherTest.php +++ b/src/Bundle/ChillMainBundle/Tests/Security/Resolver/CenterResolverDispatcherTest.php @@ -25,6 +25,7 @@ final class CenterResolverDispatcherTest extends KernelTestCase { private CenterResolverDispatcherInterface $dispatcher; + #[\Override] protected function setUp(): void { self::bootKernel(); diff --git a/src/Bundle/ChillMainBundle/Tests/Security/Resolver/DefaultScopeResolverTest.php b/src/Bundle/ChillMainBundle/Tests/Security/Resolver/DefaultScopeResolverTest.php index 733e17fec..9c66b2dbb 100644 --- a/src/Bundle/ChillMainBundle/Tests/Security/Resolver/DefaultScopeResolverTest.php +++ b/src/Bundle/ChillMainBundle/Tests/Security/Resolver/DefaultScopeResolverTest.php @@ -26,6 +26,7 @@ final class DefaultScopeResolverTest extends TestCase { private DefaultScopeResolver $scopeResolver; + #[\Override] protected function setUp(): void { $this->scopeResolver = new DefaultScopeResolver(); diff --git a/src/Bundle/ChillMainBundle/Tests/Security/Resolver/ScopeResolverDispatcherTest.php b/src/Bundle/ChillMainBundle/Tests/Security/Resolver/ScopeResolverDispatcherTest.php index 35245174c..2aa39bcfe 100644 --- a/src/Bundle/ChillMainBundle/Tests/Security/Resolver/ScopeResolverDispatcherTest.php +++ b/src/Bundle/ChillMainBundle/Tests/Security/Resolver/ScopeResolverDispatcherTest.php @@ -27,6 +27,7 @@ final class ScopeResolverDispatcherTest extends TestCase { private ScopeResolverDispatcher $scopeResolverDispatcher; + #[\Override] protected function setUp(): void { $this->scopeResolverDispatcher = new ScopeResolverDispatcher([new DefaultScopeResolver()]); diff --git a/src/Bundle/ChillMainBundle/Tests/Serializer/Normalizer/DateNormalizerTest.php b/src/Bundle/ChillMainBundle/Tests/Serializer/Normalizer/DateNormalizerTest.php index 74f44d05e..67099401d 100644 --- a/src/Bundle/ChillMainBundle/Tests/Serializer/Normalizer/DateNormalizerTest.php +++ b/src/Bundle/ChillMainBundle/Tests/Serializer/Normalizer/DateNormalizerTest.php @@ -27,6 +27,7 @@ final class DateNormalizerTest extends KernelTestCase { private Prophet $prophet; + #[\Override] protected function setUp(): void { $this->prophet = new Prophet(); diff --git a/src/Bundle/ChillMainBundle/Tests/Serializer/Normalizer/DoctrineExistingEntityNormalizerTest.php b/src/Bundle/ChillMainBundle/Tests/Serializer/Normalizer/DoctrineExistingEntityNormalizerTest.php index da1adbf89..91a8ccaee 100644 --- a/src/Bundle/ChillMainBundle/Tests/Serializer/Normalizer/DoctrineExistingEntityNormalizerTest.php +++ b/src/Bundle/ChillMainBundle/Tests/Serializer/Normalizer/DoctrineExistingEntityNormalizerTest.php @@ -26,6 +26,7 @@ final class DoctrineExistingEntityNormalizerTest extends KernelTestCase { protected DoctrineExistingEntityNormalizer $normalizer; + #[\Override] protected function setUp(): void { self::bootKernel(); diff --git a/src/Bundle/ChillMainBundle/Tests/Services/AddressGeographicalUnit/CollateAddressWithReferenceOrPostalCodeTest.php b/src/Bundle/ChillMainBundle/Tests/Services/AddressGeographicalUnit/CollateAddressWithReferenceOrPostalCodeTest.php index 6e1e9428e..37ec51809 100644 --- a/src/Bundle/ChillMainBundle/Tests/Services/AddressGeographicalUnit/CollateAddressWithReferenceOrPostalCodeTest.php +++ b/src/Bundle/ChillMainBundle/Tests/Services/AddressGeographicalUnit/CollateAddressWithReferenceOrPostalCodeTest.php @@ -25,6 +25,7 @@ class CollateAddressWithReferenceOrPostalCodeTest extends KernelTestCase { private Connection $connection; + #[\Override] protected function setUp(): void { self::bootKernel(); diff --git a/src/Bundle/ChillMainBundle/Tests/Services/Import/AddressReferenceBaseImporterTest.php b/src/Bundle/ChillMainBundle/Tests/Services/Import/AddressReferenceBaseImporterTest.php index 076b65f7e..b2298c7da 100644 --- a/src/Bundle/ChillMainBundle/Tests/Services/Import/AddressReferenceBaseImporterTest.php +++ b/src/Bundle/ChillMainBundle/Tests/Services/Import/AddressReferenceBaseImporterTest.php @@ -33,6 +33,7 @@ final class AddressReferenceBaseImporterTest extends KernelTestCase private PostalCodeRepository $postalCodeRepository; + #[\Override] protected function setUp(): void { parent::setUp(); diff --git a/src/Bundle/ChillMainBundle/Tests/Services/Import/AddressToReferenceMatcherTest.php b/src/Bundle/ChillMainBundle/Tests/Services/Import/AddressToReferenceMatcherTest.php index 0e2699fc3..b6c9815ca 100644 --- a/src/Bundle/ChillMainBundle/Tests/Services/Import/AddressToReferenceMatcherTest.php +++ b/src/Bundle/ChillMainBundle/Tests/Services/Import/AddressToReferenceMatcherTest.php @@ -37,6 +37,7 @@ class AddressToReferenceMatcherTest extends KernelTestCase private AddressReferenceBaseImporter $addressReferenceBaseImporter; + #[\Override] protected function setUp(): void { parent::setUp(); diff --git a/src/Bundle/ChillMainBundle/Tests/Services/Import/GeographicalUnitBaseImporterTest.php b/src/Bundle/ChillMainBundle/Tests/Services/Import/GeographicalUnitBaseImporterTest.php index 9154f2056..f1cd5c614 100644 --- a/src/Bundle/ChillMainBundle/Tests/Services/Import/GeographicalUnitBaseImporterTest.php +++ b/src/Bundle/ChillMainBundle/Tests/Services/Import/GeographicalUnitBaseImporterTest.php @@ -28,6 +28,7 @@ final class GeographicalUnitBaseImporterTest extends KernelTestCase private EntityManagerInterface $entityManager; + #[\Override] protected function setUp(): void { parent::setUp(); diff --git a/src/Bundle/ChillMainBundle/Tests/Services/Import/PostalCodeBaseImporterTest.php b/src/Bundle/ChillMainBundle/Tests/Services/Import/PostalCodeBaseImporterTest.php index d7447e7a0..380f7832f 100644 --- a/src/Bundle/ChillMainBundle/Tests/Services/Import/PostalCodeBaseImporterTest.php +++ b/src/Bundle/ChillMainBundle/Tests/Services/Import/PostalCodeBaseImporterTest.php @@ -32,6 +32,7 @@ final class PostalCodeBaseImporterTest extends KernelTestCase private PostalCodeRepository $postalCodeRepository; + #[\Override] protected function setUp(): void { parent::setUp(); diff --git a/src/Bundle/ChillMainBundle/Tests/Services/MenuComposerTest.php b/src/Bundle/ChillMainBundle/Tests/Services/MenuComposerTest.php index ae63557eb..1faf20326 100644 --- a/src/Bundle/ChillMainBundle/Tests/Services/MenuComposerTest.php +++ b/src/Bundle/ChillMainBundle/Tests/Services/MenuComposerTest.php @@ -33,6 +33,7 @@ final class MenuComposerTest extends KernelTestCase */ private $menuComposer; + #[\Override] protected function setUp(): void { self::bootKernel(['environment' => 'test']); diff --git a/src/Bundle/ChillMainBundle/Tests/Services/RollingDate/RollingDateConverterTest.php b/src/Bundle/ChillMainBundle/Tests/Services/RollingDate/RollingDateConverterTest.php index 5b2dfb954..6dde944e2 100644 --- a/src/Bundle/ChillMainBundle/Tests/Services/RollingDate/RollingDateConverterTest.php +++ b/src/Bundle/ChillMainBundle/Tests/Services/RollingDate/RollingDateConverterTest.php @@ -24,6 +24,7 @@ final class RollingDateConverterTest extends TestCase { private RollingDateConverter $converter; + #[\Override] protected function setUp(): void { $this->converter = new RollingDateConverter(); diff --git a/src/Bundle/ChillMainBundle/Tests/Templating/ChillMarkdownRenderExtensionTest.php b/src/Bundle/ChillMainBundle/Tests/Templating/ChillMarkdownRenderExtensionTest.php index d4eb8afa8..69b55085b 100644 --- a/src/Bundle/ChillMainBundle/Tests/Templating/ChillMarkdownRenderExtensionTest.php +++ b/src/Bundle/ChillMainBundle/Tests/Templating/ChillMarkdownRenderExtensionTest.php @@ -25,22 +25,22 @@ use PHPUnit\Framework\TestCase; */ final class ChillMarkdownRenderExtensionTest extends TestCase { - private const SIMPLE_HTML = <<<'HTML' + private const string SIMPLE_HTML = <<<'HTML'

test

Text.

HTML; - private const SIMPLE_MARKDOWN = <<<'MD' + private const string SIMPLE_MARKDOWN = <<<'MD' # test Text. MD; - private const UNAUTHORIZED_HTML = <<<'HTML' + private const string UNAUTHORIZED_HTML = <<<'HTML'

<script>alert("ok");</script>

HTML; - private const UNAUTHORIZED_MARKDOWN = <<<'MD' + private const string UNAUTHORIZED_MARKDOWN = <<<'MD' MD; diff --git a/src/Bundle/ChillMainBundle/Tests/Templating/Entity/AddressRenderTest.php b/src/Bundle/ChillMainBundle/Tests/Templating/Entity/AddressRenderTest.php index 0fbc69eab..e7a3ac935 100644 --- a/src/Bundle/ChillMainBundle/Tests/Templating/Entity/AddressRenderTest.php +++ b/src/Bundle/ChillMainBundle/Tests/Templating/Entity/AddressRenderTest.php @@ -25,6 +25,7 @@ use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase; */ final class AddressRenderTest extends KernelTestCase { + #[\Override] protected function setUp(): void { self::bootKernel(); diff --git a/src/Bundle/ChillMainBundle/Validation/Constraint/PhonenumberConstraint.php b/src/Bundle/ChillMainBundle/Validation/Constraint/PhonenumberConstraint.php index 2c20de854..12d8bb0e0 100644 --- a/src/Bundle/ChillMainBundle/Validation/Constraint/PhonenumberConstraint.php +++ b/src/Bundle/ChillMainBundle/Validation/Constraint/PhonenumberConstraint.php @@ -35,6 +35,7 @@ class PhonenumberConstraint extends Constraint $this->type = $type ?? 'any'; } + #[\Override] public function validatedBy() { return \Chill\MainBundle\Validation\Validator\ValidPhonenumber::class; diff --git a/src/Bundle/ChillMainBundle/Validation/Constraint/RoleScopeScopePresenceConstraint.php b/src/Bundle/ChillMainBundle/Validation/Constraint/RoleScopeScopePresenceConstraint.php index 7528908b7..0b25b7da8 100644 --- a/src/Bundle/ChillMainBundle/Validation/Constraint/RoleScopeScopePresenceConstraint.php +++ b/src/Bundle/ChillMainBundle/Validation/Constraint/RoleScopeScopePresenceConstraint.php @@ -23,11 +23,13 @@ class RoleScopeScopePresenceConstraint extends Constraint public $messagePresenceRequired = 'The role "%role%" require to be associated with ' .'a scope.'; + #[\Override] public function getTargets() { return self::CLASS_CONSTRAINT; } + #[\Override] public function validatedBy() { return 'role_scope_scope_presence'; diff --git a/src/Bundle/ChillMainBundle/Validation/Constraint/UserUniqueEmailAndUsernameConstraint.php b/src/Bundle/ChillMainBundle/Validation/Constraint/UserUniqueEmailAndUsernameConstraint.php index 130d75d31..92ea0349c 100644 --- a/src/Bundle/ChillMainBundle/Validation/Constraint/UserUniqueEmailAndUsernameConstraint.php +++ b/src/Bundle/ChillMainBundle/Validation/Constraint/UserUniqueEmailAndUsernameConstraint.php @@ -20,11 +20,13 @@ class UserUniqueEmailAndUsernameConstraint extends Constraint public $messageDuplicateUsername = 'A user with the same or a close username already exists'; + #[\Override] public function getTargets() { return [self::CLASS_CONSTRAINT]; } + #[\Override] public function validatedBy() { return UserUniqueEmailAndUsername::class; diff --git a/src/Bundle/ChillMainBundle/Validation/Validator/RoleScopeScopePresence.php b/src/Bundle/ChillMainBundle/Validation/Validator/RoleScopeScopePresence.php index 0bbf1d373..376da564b 100644 --- a/src/Bundle/ChillMainBundle/Validation/Validator/RoleScopeScopePresence.php +++ b/src/Bundle/ChillMainBundle/Validation/Validator/RoleScopeScopePresence.php @@ -23,6 +23,7 @@ class RoleScopeScopePresence extends ConstraintValidator { public function __construct(private readonly RoleProvider $roleProvider, private readonly LoggerInterface $logger, private readonly TranslatorInterface $translator) {} + #[\Override] public function validate($value, Constraint $constraint) { if (!$value instanceof RoleScope) { diff --git a/src/Bundle/ChillMainBundle/Validation/Validator/UserUniqueEmailAndUsername.php b/src/Bundle/ChillMainBundle/Validation/Validator/UserUniqueEmailAndUsername.php index a5a16cee0..75d8e01f7 100644 --- a/src/Bundle/ChillMainBundle/Validation/Validator/UserUniqueEmailAndUsername.php +++ b/src/Bundle/ChillMainBundle/Validation/Validator/UserUniqueEmailAndUsername.php @@ -28,6 +28,7 @@ class UserUniqueEmailAndUsername extends ConstraintValidator $this->em = $em; } + #[\Override] public function validate($value, Constraint $constraint) { if (!$value instanceof User) { diff --git a/src/Bundle/ChillMainBundle/Validation/Validator/ValidPhonenumber.php b/src/Bundle/ChillMainBundle/Validation/Validator/ValidPhonenumber.php index 0c02885ad..25d4cc78d 100644 --- a/src/Bundle/ChillMainBundle/Validation/Validator/ValidPhonenumber.php +++ b/src/Bundle/ChillMainBundle/Validation/Validator/ValidPhonenumber.php @@ -24,6 +24,7 @@ final class ValidPhonenumber extends ConstraintValidator * @param string $value * @param \Chill\MainBundle\Validation\Constraint\PhonenumberConstraint $constraint */ + #[\Override] public function validate($value, Constraint $constraint) { if (false === $this->phonenumberHelper->isPhonenumberValidationConfigured()) { diff --git a/src/Bundle/ChillMainBundle/Validator/Constraints/Entity/UserCircleConsistency.php b/src/Bundle/ChillMainBundle/Validator/Constraints/Entity/UserCircleConsistency.php index 3c283a96e..1c5e1db61 100644 --- a/src/Bundle/ChillMainBundle/Validator/Constraints/Entity/UserCircleConsistency.php +++ b/src/Bundle/ChillMainBundle/Validator/Constraints/Entity/UserCircleConsistency.php @@ -24,16 +24,19 @@ class UserCircleConsistency extends Constraint public $role; + #[\Override] public function getDefaultOption() { return 'role'; } + #[\Override] public function getRequiredOptions() { return ['role']; } + #[\Override] public function getTargets() { return self::CLASS_CONSTRAINT; diff --git a/src/Bundle/ChillMainBundle/Validator/Constraints/Entity/UserCircleConsistencyValidator.php b/src/Bundle/ChillMainBundle/Validator/Constraints/Entity/UserCircleConsistencyValidator.php index a18af30d4..fa3dd9b5e 100644 --- a/src/Bundle/ChillMainBundle/Validator/Constraints/Entity/UserCircleConsistencyValidator.php +++ b/src/Bundle/ChillMainBundle/Validator/Constraints/Entity/UserCircleConsistencyValidator.php @@ -31,6 +31,7 @@ class UserCircleConsistencyValidator extends ConstraintValidator * @param object $value * @param UserCircleConsistency $constraint */ + #[\Override] public function validate($value, Constraint $constraint) { /** @var \Chill\MainBundle\Entity\User $user */ diff --git a/src/Bundle/ChillMainBundle/Validator/Constraints/Export/ExportElementConstraint.php b/src/Bundle/ChillMainBundle/Validator/Constraints/Export/ExportElementConstraint.php index 84eed7b93..a9fe344a0 100644 --- a/src/Bundle/ChillMainBundle/Validator/Constraints/Export/ExportElementConstraint.php +++ b/src/Bundle/ChillMainBundle/Validator/Constraints/Export/ExportElementConstraint.php @@ -22,16 +22,19 @@ class ExportElementConstraint extends Constraint { public $element; + #[\Override] public function getRequiredOptions() { return ['element']; } + #[\Override] public function getTargets() { return self::PROPERTY_CONSTRAINT; } + #[\Override] public function validatedBy() { return ExportElementConstraintValidator::class; diff --git a/src/Bundle/ChillMainBundle/Validator/Constraints/Export/ExportElementConstraintValidator.php b/src/Bundle/ChillMainBundle/Validator/Constraints/Export/ExportElementConstraintValidator.php index 7db1f64dc..d7dd66c53 100644 --- a/src/Bundle/ChillMainBundle/Validator/Constraints/Export/ExportElementConstraintValidator.php +++ b/src/Bundle/ChillMainBundle/Validator/Constraints/Export/ExportElementConstraintValidator.php @@ -21,6 +21,7 @@ use Symfony\Component\Validator\ConstraintValidator; */ class ExportElementConstraintValidator extends ConstraintValidator { + #[\Override] public function validate($value, Constraint $constraint) { if ($constraint->element instanceof ExportElementValidatedInterface) { diff --git a/src/Bundle/ChillMainBundle/Workflow/Counter/WorkflowByUserCounter.php b/src/Bundle/ChillMainBundle/Workflow/Counter/WorkflowByUserCounter.php index a1b631265..5054778a4 100644 --- a/src/Bundle/ChillMainBundle/Workflow/Counter/WorkflowByUserCounter.php +++ b/src/Bundle/ChillMainBundle/Workflow/Counter/WorkflowByUserCounter.php @@ -24,6 +24,7 @@ final readonly class WorkflowByUserCounter implements NotificationCounterInterfa { public function __construct(private EntityWorkflowStepRepository $workflowStepRepository, private CacheItemPoolInterface $cacheItemPool) {} + #[\Override] public function addNotification(UserInterface $u): int { if (!$u instanceof User) { @@ -56,6 +57,7 @@ final readonly class WorkflowByUserCounter implements NotificationCounterInterfa return $this->workflowStepRepository->countUnreadByUser($user); } + #[\Override] public static function getSubscribedEvents() { return [ diff --git a/src/Bundle/ChillMainBundle/Workflow/EventSubscriber/EntityWorkflowTransitionEventSubscriber.php b/src/Bundle/ChillMainBundle/Workflow/EventSubscriber/EntityWorkflowTransitionEventSubscriber.php index b1fa80458..d6b7238b5 100644 --- a/src/Bundle/ChillMainBundle/Workflow/EventSubscriber/EntityWorkflowTransitionEventSubscriber.php +++ b/src/Bundle/ChillMainBundle/Workflow/EventSubscriber/EntityWorkflowTransitionEventSubscriber.php @@ -47,6 +47,7 @@ class EntityWorkflowTransitionEventSubscriber implements EventSubscriberInterfac } } + #[\Override] public static function getSubscribedEvents(): array { return [ diff --git a/src/Bundle/ChillMainBundle/Workflow/EventSubscriber/NotificationOnTransition.php b/src/Bundle/ChillMainBundle/Workflow/EventSubscriber/NotificationOnTransition.php index e290a567e..1a966c896 100644 --- a/src/Bundle/ChillMainBundle/Workflow/EventSubscriber/NotificationOnTransition.php +++ b/src/Bundle/ChillMainBundle/Workflow/EventSubscriber/NotificationOnTransition.php @@ -25,6 +25,7 @@ class NotificationOnTransition implements EventSubscriberInterface { public function __construct(private readonly EntityManagerInterface $entityManager, private readonly \Twig\Environment $engine, private readonly MetadataExtractor $metadataExtractor, private readonly Security $security, private readonly Registry $registry) {} + #[\Override] public static function getSubscribedEvents(): array { return [ diff --git a/src/Bundle/ChillMainBundle/Workflow/Notification/WorkflowNotificationHandler.php b/src/Bundle/ChillMainBundle/Workflow/Notification/WorkflowNotificationHandler.php index c9ba7cf79..c3f1d9b90 100644 --- a/src/Bundle/ChillMainBundle/Workflow/Notification/WorkflowNotificationHandler.php +++ b/src/Bundle/ChillMainBundle/Workflow/Notification/WorkflowNotificationHandler.php @@ -22,11 +22,13 @@ class WorkflowNotificationHandler implements NotificationHandlerInterface { public function __construct(private readonly EntityWorkflowRepository $entityWorkflowRepository, private readonly EntityWorkflowManager $entityWorkflowManager, private readonly Security $security) {} + #[\Override] public function getTemplate(Notification $notification, array $options = []): string { return '@ChillMain/Workflow/_notification_include.html.twig'; } + #[\Override] public function getTemplateData(Notification $notification, array $options = []): array { $entityWorkflow = $this->entityWorkflowRepository->find($notification->getRelatedEntityId()); @@ -53,6 +55,7 @@ class WorkflowNotificationHandler implements NotificationHandlerInterface return $notificationCc; } + #[\Override] public function supports(Notification $notification, array $options = []): bool { return EntityWorkflow::class === $notification->getRelatedEntityClass(); diff --git a/src/Bundle/ChillMainBundle/Workflow/RelatedEntityWorkflowSupportsStrategy.php b/src/Bundle/ChillMainBundle/Workflow/RelatedEntityWorkflowSupportsStrategy.php index 966b3317a..ed5eca43f 100644 --- a/src/Bundle/ChillMainBundle/Workflow/RelatedEntityWorkflowSupportsStrategy.php +++ b/src/Bundle/ChillMainBundle/Workflow/RelatedEntityWorkflowSupportsStrategy.php @@ -17,6 +17,7 @@ use Symfony\Component\Workflow\WorkflowInterface; class RelatedEntityWorkflowSupportsStrategy implements WorkflowSupportStrategyInterface { + #[\Override] public function supports(WorkflowInterface $workflow, $subject): bool { if (!$subject instanceof EntityWorkflow) { diff --git a/src/Bundle/ChillMainBundle/Workflow/Templating/WorkflowTwigExtension.php b/src/Bundle/ChillMainBundle/Workflow/Templating/WorkflowTwigExtension.php index b0d459ffe..f86a4cde6 100644 --- a/src/Bundle/ChillMainBundle/Workflow/Templating/WorkflowTwigExtension.php +++ b/src/Bundle/ChillMainBundle/Workflow/Templating/WorkflowTwigExtension.php @@ -16,6 +16,7 @@ use Twig\TwigFunction; class WorkflowTwigExtension extends AbstractExtension { + #[\Override] public function getFunctions() { return [ diff --git a/src/Bundle/ChillMainBundle/Workflow/Validator/EntityWorkflowCreation.php b/src/Bundle/ChillMainBundle/Workflow/Validator/EntityWorkflowCreation.php index 34f024884..10ca146c4 100644 --- a/src/Bundle/ChillMainBundle/Workflow/Validator/EntityWorkflowCreation.php +++ b/src/Bundle/ChillMainBundle/Workflow/Validator/EntityWorkflowCreation.php @@ -27,6 +27,7 @@ class EntityWorkflowCreation extends \Symfony\Component\Validator\Constraint public string $messageWorkflowNotAvailable = 'Workflow is not valid'; + #[\Override] public function getTargets() { return [self::CLASS_CONSTRAINT]; diff --git a/src/Bundle/ChillMainBundle/Workflow/Validator/EntityWorkflowCreationValidator.php b/src/Bundle/ChillMainBundle/Workflow/Validator/EntityWorkflowCreationValidator.php index 2020c7b52..1a070d9fc 100644 --- a/src/Bundle/ChillMainBundle/Workflow/Validator/EntityWorkflowCreationValidator.php +++ b/src/Bundle/ChillMainBundle/Workflow/Validator/EntityWorkflowCreationValidator.php @@ -26,6 +26,7 @@ class EntityWorkflowCreationValidator extends \Symfony\Component\Validator\Const /** * @param EntityWorkflow $value */ + #[\Override] public function validate($value, Constraint $constraint) { if (!$value instanceof EntityWorkflow) { diff --git a/src/Bundle/ChillMainBundle/Workflow/Validator/StepDestValid.php b/src/Bundle/ChillMainBundle/Workflow/Validator/StepDestValid.php index 89d60fb05..bdded59f5 100644 --- a/src/Bundle/ChillMainBundle/Workflow/Validator/StepDestValid.php +++ b/src/Bundle/ChillMainBundle/Workflow/Validator/StepDestValid.php @@ -19,6 +19,7 @@ class StepDestValid extends Constraint public string $messageRequireDest = 'workflow.As the step is not final, dest are required'; + #[\Override] public function getTargets() { return [self::CLASS_CONSTRAINT]; diff --git a/src/Bundle/ChillMainBundle/Workflow/Validator/StepDestValidValidator.php b/src/Bundle/ChillMainBundle/Workflow/Validator/StepDestValidValidator.php index 37543aa6e..d8a2f2933 100644 --- a/src/Bundle/ChillMainBundle/Workflow/Validator/StepDestValidValidator.php +++ b/src/Bundle/ChillMainBundle/Workflow/Validator/StepDestValidValidator.php @@ -24,6 +24,7 @@ class StepDestValidValidator extends ConstraintValidator * * @return void */ + #[\Override] public function validate($value, Constraint $constraint) { if (!$constraint instanceof StepDestValid) { diff --git a/src/Bundle/ChillMainBundle/migrations/Version20100000000000.php b/src/Bundle/ChillMainBundle/migrations/Version20100000000000.php index 55f5a6420..0cc4b2f6c 100644 --- a/src/Bundle/ChillMainBundle/migrations/Version20100000000000.php +++ b/src/Bundle/ChillMainBundle/migrations/Version20100000000000.php @@ -16,8 +16,10 @@ use Doctrine\Migrations\AbstractMigration; class Version20100000000000 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void {} + #[\Override] public function up(Schema $schema): void { $this->addSql('CREATE EXTENSION IF NOT EXISTS unaccent'); diff --git a/src/Bundle/ChillMainBundle/migrations/Version20141128194409.php b/src/Bundle/ChillMainBundle/migrations/Version20141128194409.php index 85d71598a..c5e30af95 100644 --- a/src/Bundle/ChillMainBundle/migrations/Version20141128194409.php +++ b/src/Bundle/ChillMainBundle/migrations/Version20141128194409.php @@ -19,11 +19,13 @@ use Doctrine\Migrations\AbstractMigration; */ class Version20141128194409 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { // this down() migration is auto-generated, please modify it to your needs } + #[\Override] public function up(Schema $schema): void { $this->addSql('CREATE TABLE Country (id INT NOT NULL, name JSON NOT NULL, countryCode VARCHAR(3) NOT NULL, PRIMARY KEY(id));'); diff --git a/src/Bundle/ChillMainBundle/migrations/Version20150821105642.php b/src/Bundle/ChillMainBundle/migrations/Version20150821105642.php index e7672a7e1..2e986ca3d 100644 --- a/src/Bundle/ChillMainBundle/migrations/Version20150821105642.php +++ b/src/Bundle/ChillMainBundle/migrations/Version20150821105642.php @@ -22,6 +22,7 @@ use Doctrine\Migrations\AbstractMigration; */ class Version20150821105642 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->abortIf('postgresql' !== $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'postgresql\'.'); @@ -31,6 +32,7 @@ class Version20150821105642 extends AbstractMigration $this->addSql('ALTER TABLE group_centers DROP permissionGroup_id'); } + #[\Override] public function up(Schema $schema): void { $this->abortIf('postgresql' !== $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'postgresql\'.'); diff --git a/src/Bundle/ChillMainBundle/migrations/Version20150821122935.php b/src/Bundle/ChillMainBundle/migrations/Version20150821122935.php index a323e0416..6e428d17e 100644 --- a/src/Bundle/ChillMainBundle/migrations/Version20150821122935.php +++ b/src/Bundle/ChillMainBundle/migrations/Version20150821122935.php @@ -20,6 +20,7 @@ use Doctrine\Migrations\AbstractMigration; */ class Version20150821122935 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->addSql('ALTER TABLE group_centers ALTER permissionsGroup_id SET DEFAULT NULL'); @@ -31,6 +32,7 @@ class Version20150821122935 extends AbstractMigration $this->addSql('ALTER TABLE groupcenter_permissionsgroup ADD CONSTRAINT fk_55dfec606fa97d46 FOREIGN KEY (permissionsgroup_id) REFERENCES permission_groups (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE'); } + #[\Override] public function up(Schema $schema): void { $this->addSql('DROP TABLE groupcenter_permissionsgroup'); diff --git a/src/Bundle/ChillMainBundle/migrations/Version20160310122322.php b/src/Bundle/ChillMainBundle/migrations/Version20160310122322.php index dade8044a..60edcb2ca 100644 --- a/src/Bundle/ChillMainBundle/migrations/Version20160310122322.php +++ b/src/Bundle/ChillMainBundle/migrations/Version20160310122322.php @@ -19,6 +19,7 @@ use Doctrine\Migrations\AbstractMigration; */ class Version20160310122322 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->abortIf('postgresql' !== $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'postgresql\'.'); @@ -31,6 +32,7 @@ class Version20160310122322 extends AbstractMigration $this->addSql('DROP TABLE chill_main_postal_code'); } + #[\Override] public function up(Schema $schema): void { $this->abortIf('postgresql' !== $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'postgresql\'.'); diff --git a/src/Bundle/ChillMainBundle/migrations/Version20180703191509.php b/src/Bundle/ChillMainBundle/migrations/Version20180703191509.php index e9cdb4a31..e283545bf 100644 --- a/src/Bundle/ChillMainBundle/migrations/Version20180703191509.php +++ b/src/Bundle/ChillMainBundle/migrations/Version20180703191509.php @@ -19,6 +19,7 @@ use Doctrine\Migrations\AbstractMigration; */ final class Version20180703191509 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->abortIf('postgresql' !== $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'postgresql\'.'); @@ -26,6 +27,7 @@ final class Version20180703191509 extends AbstractMigration $this->addSql('DROP INDEX search_name_code'); } + #[\Override] public function up(Schema $schema): void { $this->abortIf('postgresql' !== $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'postgresql\'.'); diff --git a/src/Bundle/ChillMainBundle/migrations/Version20180709181423.php b/src/Bundle/ChillMainBundle/migrations/Version20180709181423.php index a608b07bb..9bebba4b4 100644 --- a/src/Bundle/ChillMainBundle/migrations/Version20180709181423.php +++ b/src/Bundle/ChillMainBundle/migrations/Version20180709181423.php @@ -20,6 +20,7 @@ use Doctrine\Migrations\AbstractMigration; */ final class Version20180709181423 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->abortIf('postgresql' !== $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'postgresql\'.'); @@ -35,6 +36,7 @@ final class Version20180709181423 extends AbstractMigration $this->addSql('DROP FUNCTION canonicalize_user_on_update()'); } + #[\Override] public function up(Schema $schema): void { $this->abortIf('postgresql' !== $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'postgresql\'.'); diff --git a/src/Bundle/ChillMainBundle/migrations/Version20180905101426.php b/src/Bundle/ChillMainBundle/migrations/Version20180905101426.php index 12044b40c..35e3f33d2 100644 --- a/src/Bundle/ChillMainBundle/migrations/Version20180905101426.php +++ b/src/Bundle/ChillMainBundle/migrations/Version20180905101426.php @@ -19,12 +19,14 @@ use Doctrine\Migrations\AbstractMigration; */ final class Version20180905101426 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->addSql('ALTER TABLE permission_groups DROP COLUMN flags'); $this->addSql('ALTER TABLE group_centers ALTER permissionsgroup_id SET DEFAULT NULL'); } + #[\Override] public function up(Schema $schema): void { $this->addSql('ALTER TABLE permission_groups ADD flags JSONB DEFAULT \'[]\' NOT NULL'); diff --git a/src/Bundle/ChillMainBundle/migrations/Version20180911093642.php b/src/Bundle/ChillMainBundle/migrations/Version20180911093642.php index d675d8f84..39ef580a5 100644 --- a/src/Bundle/ChillMainBundle/migrations/Version20180911093642.php +++ b/src/Bundle/ChillMainBundle/migrations/Version20180911093642.php @@ -19,6 +19,7 @@ use Doctrine\Migrations\AbstractMigration; */ final class Version20180911093642 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->addSql('DROP TRIGGER canonicalize_user_on_update ON users'); @@ -34,6 +35,7 @@ final class Version20180911093642 extends AbstractMigration ); } + #[\Override] public function up(Schema $schema): void { $this->addSql('DROP TRIGGER canonicalize_user_on_update ON users'); diff --git a/src/Bundle/ChillMainBundle/migrations/Version20200422122715.php b/src/Bundle/ChillMainBundle/migrations/Version20200422122715.php index 3b91b04c5..4c7fcdeeb 100644 --- a/src/Bundle/ChillMainBundle/migrations/Version20200422122715.php +++ b/src/Bundle/ChillMainBundle/migrations/Version20200422122715.php @@ -19,11 +19,13 @@ use Doctrine\Migrations\AbstractMigration; */ final class Version20200422122715 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->addSql('ALTER TABLE chill_main_address DROP isNoAddress'); } + #[\Override] public function up(Schema $schema): void { $this->addSql('ALTER TABLE chill_main_address ADD isNoAddress BOOLEAN NOT NULL DEFAULT FALSE'); diff --git a/src/Bundle/ChillMainBundle/migrations/Version20210304085819.php b/src/Bundle/ChillMainBundle/migrations/Version20210304085819.php index 6933a5cdf..59c3625f7 100644 --- a/src/Bundle/ChillMainBundle/migrations/Version20210304085819.php +++ b/src/Bundle/ChillMainBundle/migrations/Version20210304085819.php @@ -19,16 +19,19 @@ use Doctrine\Migrations\AbstractMigration; */ final class Version20210304085819 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->addSql('ALTER TABLE users DROP attributes'); } + #[\Override] public function getDescription(): string { return ''; } + #[\Override] public function up(Schema $schema): void { $this->addSql('ALTER TABLE users ADD attributes JSONB DEFAULT NULL'); diff --git a/src/Bundle/ChillMainBundle/migrations/Version20210308111926.php b/src/Bundle/ChillMainBundle/migrations/Version20210308111926.php index 43ea86749..815886917 100644 --- a/src/Bundle/ChillMainBundle/migrations/Version20210308111926.php +++ b/src/Bundle/ChillMainBundle/migrations/Version20210308111926.php @@ -19,6 +19,7 @@ use Doctrine\Migrations\AbstractMigration; */ final class Version20210308111926 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->abortIf('postgresql' !== $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'postgresql\'.'); @@ -26,11 +27,13 @@ final class Version20210308111926 extends AbstractMigration $this->addSql('ALTER TABLE chill_main_address DROP customs'); } + #[\Override] public function getDescription(): string { return 'Add custom data in addresses'; } + #[\Override] public function up(Schema $schema): void { $this->abortIf('postgresql' !== $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'postgresql\'.'); diff --git a/src/Bundle/ChillMainBundle/migrations/Version20210414091001.php b/src/Bundle/ChillMainBundle/migrations/Version20210414091001.php index c3c400c3c..733ec517a 100644 --- a/src/Bundle/ChillMainBundle/migrations/Version20210414091001.php +++ b/src/Bundle/ChillMainBundle/migrations/Version20210414091001.php @@ -19,6 +19,7 @@ use Doctrine\Migrations\AbstractMigration; */ final class Version20210414091001 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->abortIf('postgresql' !== $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'postgresql\'.'); @@ -26,11 +27,13 @@ final class Version20210414091001 extends AbstractMigration $this->addSql('DROP EXTENSION IF NOT EXISTS postgis;'); } + #[\Override] public function getDescription(): string { return 'Enable the postgis extension in public schema'; } + #[\Override] public function up(Schema $schema): void { $this->abortIf('postgresql' !== $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'postgresql\'.'); diff --git a/src/Bundle/ChillMainBundle/migrations/Version20210420115006.php b/src/Bundle/ChillMainBundle/migrations/Version20210420115006.php index da5ddcf32..20fb0d1dd 100644 --- a/src/Bundle/ChillMainBundle/migrations/Version20210420115006.php +++ b/src/Bundle/ChillMainBundle/migrations/Version20210420115006.php @@ -19,6 +19,7 @@ use Doctrine\Migrations\AbstractMigration; */ final class Version20210420115006 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->addSql('ALTER TABLE chill_main_address RENAME COLUMN street TO streetaddress1;'); @@ -34,11 +35,13 @@ final class Version20210420115006 extends AbstractMigration $this->addSql('ALTER TABLE chill_main_address DROP point'); } + #[\Override] public function getDescription(): string { return 'Add a Point data type and modify the Address entity'; } + #[\Override] public function up(Schema $schema): void { $this->addSql('ALTER TABLE chill_main_address RENAME COLUMN streetaddress1 TO street;'); diff --git a/src/Bundle/ChillMainBundle/migrations/Version20210503085107.php b/src/Bundle/ChillMainBundle/migrations/Version20210503085107.php index a036e9125..bf1d3dee7 100644 --- a/src/Bundle/ChillMainBundle/migrations/Version20210503085107.php +++ b/src/Bundle/ChillMainBundle/migrations/Version20210503085107.php @@ -19,17 +19,20 @@ use Doctrine\Migrations\AbstractMigration; */ final class Version20210503085107 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->addSql('DROP SEQUENCE chill_main_address_reference_id_seq CASCADE'); $this->addSql('DROP TABLE chill_main_address_reference'); } + #[\Override] public function getDescription(): string { return 'Add a AddressReference table for storing authoritative address data'; } + #[\Override] public function up(Schema $schema): void { $this->addSql('CREATE SEQUENCE chill_main_address_reference_id_seq INCREMENT BY 1 MINVALUE 1 START 1'); diff --git a/src/Bundle/ChillMainBundle/migrations/Version20210505153727.php b/src/Bundle/ChillMainBundle/migrations/Version20210505153727.php index 4d40aa304..5592579c6 100644 --- a/src/Bundle/ChillMainBundle/migrations/Version20210505153727.php +++ b/src/Bundle/ChillMainBundle/migrations/Version20210505153727.php @@ -19,6 +19,7 @@ use Doctrine\Migrations\AbstractMigration; */ final class Version20210505153727 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->addSql('ALTER TABLE chill_main_address DROP CONSTRAINT FK_165051F6114B8DD9'); @@ -31,11 +32,13 @@ final class Version20210505153727 extends AbstractMigration '); } + #[\Override] public function getDescription(): string { return 'Add linkedToThirdParty field to Address'; } + #[\Override] public function up(Schema $schema): void { $this->addSql('ALTER TABLE chill_main_address ADD linkedToThirdParty_id INT DEFAULT NULL'); diff --git a/src/Bundle/ChillMainBundle/migrations/Version20210525144016.php b/src/Bundle/ChillMainBundle/migrations/Version20210525144016.php index 94ffb3dfa..53d232dbb 100644 --- a/src/Bundle/ChillMainBundle/migrations/Version20210525144016.php +++ b/src/Bundle/ChillMainBundle/migrations/Version20210525144016.php @@ -19,17 +19,20 @@ use Doctrine\Migrations\AbstractMigration; */ final class Version20210525144016 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->addSql('ALTER TABLE chill_main_address DROP CONSTRAINT fk_165051f6114b8dd9'); $this->addSql('ALTER TABLE chill_main_address ADD CONSTRAINT fk_165051f6114b8dd9 FOREIGN KEY (linkedtothirdparty_id) REFERENCES chill_3party.third_party (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); } + #[\Override] public function getDescription(): string { return 'Specify ON DELETE behaviour to handle deletion of parents in associated tables'; } + #[\Override] public function up(Schema $schema): void { $this->addSql('ALTER TABLE chill_main_address DROP CONSTRAINT FK_165051F6114B8DD9'); diff --git a/src/Bundle/ChillMainBundle/migrations/Version20210528090000.php b/src/Bundle/ChillMainBundle/migrations/Version20210528090000.php index e6d2d9d8b..ebd3cdbb2 100644 --- a/src/Bundle/ChillMainBundle/migrations/Version20210528090000.php +++ b/src/Bundle/ChillMainBundle/migrations/Version20210528090000.php @@ -19,16 +19,19 @@ use Doctrine\Migrations\AbstractMigration; */ final class Version20210528090000 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->addSql('DROP EXTENSION btree_gist'); } + #[\Override] public function getDescription(): string { return 'add extension btree_gist'; } + #[\Override] public function up(Schema $schema): void { $this->addSql('CREATE EXTENSION IF NOT EXISTS btree_gist'); diff --git a/src/Bundle/ChillMainBundle/migrations/Version20210610140248.php b/src/Bundle/ChillMainBundle/migrations/Version20210610140248.php index e3de34c0e..db513d68f 100644 --- a/src/Bundle/ChillMainBundle/migrations/Version20210610140248.php +++ b/src/Bundle/ChillMainBundle/migrations/Version20210610140248.php @@ -19,6 +19,7 @@ use Doctrine\Migrations\AbstractMigration; */ final class Version20210610140248 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->addSql('ALTER TABLE chill_main_notification_addresses_user DROP CONSTRAINT FK_E52C5D2BEF1A9D84'); @@ -27,11 +28,13 @@ final class Version20210610140248 extends AbstractMigration $this->addSql('DROP TABLE chill_main_notification_addresses_user'); } + #[\Override] public function getDescription(): string { return 'Add table for ChillMain/Notification'; } + #[\Override] public function up(Schema $schema): void { $this->addSql('CREATE SEQUENCE chill_main_notification_id_seq INCREMENT BY 1 MINVALUE 1 START 1'); diff --git a/src/Bundle/ChillMainBundle/migrations/Version20210616134328.php b/src/Bundle/ChillMainBundle/migrations/Version20210616134328.php index a07b7c52a..f01697ce7 100644 --- a/src/Bundle/ChillMainBundle/migrations/Version20210616134328.php +++ b/src/Bundle/ChillMainBundle/migrations/Version20210616134328.php @@ -19,16 +19,19 @@ use Doctrine\Migrations\AbstractMigration; */ final class Version20210616134328 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->addSql('ALTER TABLE chill_main_postal_code DROP origin'); } + #[\Override] public function getDescription(): string { return ''; } + #[\Override] public function up(Schema $schema): void { $this->addSql('ALTER TABLE chill_main_postal_code ADD origin INT DEFAULT NULL'); diff --git a/src/Bundle/ChillMainBundle/migrations/Version20210903144853.php b/src/Bundle/ChillMainBundle/migrations/Version20210903144853.php index 4bd543e4c..caea35a31 100644 --- a/src/Bundle/ChillMainBundle/migrations/Version20210903144853.php +++ b/src/Bundle/ChillMainBundle/migrations/Version20210903144853.php @@ -19,6 +19,7 @@ use Doctrine\Migrations\AbstractMigration; */ final class Version20210903144853 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->addSql('ALTER TABLE users DROP CONSTRAINT FK_1483A5E964B65C5B'); @@ -33,11 +34,13 @@ final class Version20210903144853 extends AbstractMigration $this->addSql('ALTER TABLE users ALTER usernameCanonical DROP NOT NULL'); } + #[\Override] public function getDescription(): string { return 'Add metadata on users'; } + #[\Override] public function up(Schema $schema): void { $this->addSql('CREATE SEQUENCE chill_main_user_job_id_seq INCREMENT BY 1 MINVALUE 1 START 1'); diff --git a/src/Bundle/ChillMainBundle/migrations/Version20210929192242.php b/src/Bundle/ChillMainBundle/migrations/Version20210929192242.php index 616f3d8c1..69af122ac 100644 --- a/src/Bundle/ChillMainBundle/migrations/Version20210929192242.php +++ b/src/Bundle/ChillMainBundle/migrations/Version20210929192242.php @@ -19,16 +19,19 @@ use Doctrine\Migrations\AbstractMigration; */ final class Version20210929192242 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->addSql('ALTER TABLE chill_main_address DROP addressReference_id'); } + #[\Override] public function getDescription(): string { return 'Add a link between address and address reference'; } + #[\Override] public function up(Schema $schema): void { $this->addSql('ALTER TABLE chill_main_address ADD addressReference_id INT DEFAULT NULL'); diff --git a/src/Bundle/ChillMainBundle/migrations/Version20211006151653.php b/src/Bundle/ChillMainBundle/migrations/Version20211006151653.php index 85e368e49..061b33214 100644 --- a/src/Bundle/ChillMainBundle/migrations/Version20211006151653.php +++ b/src/Bundle/ChillMainBundle/migrations/Version20211006151653.php @@ -19,6 +19,7 @@ use Doctrine\Migrations\AbstractMigration; */ final class Version20211006151653 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->addSql('ALTER TABLE chill_main_postal_code DROP refPostalCodeId'); @@ -26,11 +27,13 @@ final class Version20211006151653 extends AbstractMigration $this->addSql('ALTER TABLE chill_main_postal_code DROP center'); } + #[\Override] public function getDescription(): string { return 'Add some fields to PostalCode'; } + #[\Override] public function up(Schema $schema): void { $this->addSql('ALTER TABLE chill_main_postal_code ADD refPostalCodeId VARCHAR(255) DEFAULT NULL'); diff --git a/src/Bundle/ChillMainBundle/migrations/Version20211007150019.php b/src/Bundle/ChillMainBundle/migrations/Version20211007150019.php index b130c5a95..8eac0a5f3 100644 --- a/src/Bundle/ChillMainBundle/migrations/Version20211007150019.php +++ b/src/Bundle/ChillMainBundle/migrations/Version20211007150019.php @@ -19,17 +19,20 @@ use Doctrine\Migrations\AbstractMigration; */ final class Version20211007150019 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->addSql('DROP SEQUENCE chill_main_civility_id_seq'); $this->addSql('DROP TABLE chill_main_civility'); } + #[\Override] public function getDescription(): string { return 'create civility table'; } + #[\Override] public function up(Schema $schema): void { $this->addSql('CREATE SEQUENCE chill_main_civility_id_seq INCREMENT BY 1 MINVALUE 1 START 1'); diff --git a/src/Bundle/ChillMainBundle/migrations/Version20211012141336.php b/src/Bundle/ChillMainBundle/migrations/Version20211012141336.php index 050996a17..b17c20abc 100644 --- a/src/Bundle/ChillMainBundle/migrations/Version20211012141336.php +++ b/src/Bundle/ChillMainBundle/migrations/Version20211012141336.php @@ -19,6 +19,7 @@ use Doctrine\Migrations\AbstractMigration; */ final class Version20211012141336 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->addSql('ALTER TABLE activity DROP CONSTRAINT FK_AC74095A64D218E'); @@ -36,11 +37,13 @@ final class Version20211012141336 extends AbstractMigration $this->addSql('DROP TABLE chill_main_location_type'); } + #[\Override] public function getDescription(): string { return 'Add Location and LocationType Entities (for activity and calendar)'; } + #[\Override] public function up(Schema $schema): void { $this->addSql('CREATE SEQUENCE chill_main_location_id_seq INCREMENT BY 1 MINVALUE 1 START 1'); diff --git a/src/Bundle/ChillMainBundle/migrations/Version20211013124455.php b/src/Bundle/ChillMainBundle/migrations/Version20211013124455.php index d03d84878..aa8a96f79 100644 --- a/src/Bundle/ChillMainBundle/migrations/Version20211013124455.php +++ b/src/Bundle/ChillMainBundle/migrations/Version20211013124455.php @@ -16,6 +16,7 @@ use Doctrine\Migrations\AbstractMigration; final class Version20211013124455 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->addSql('ALTER TABLE activitytype DROP locationVisible'); @@ -25,11 +26,13 @@ final class Version20211013124455 extends AbstractMigration $this->addSql('ALTER TABLE activitytype ALTER category_id SET DEFAULT 1'); } + #[\Override] public function getDescription(): string { return 'add location visible admin option'; } + #[\Override] public function up(Schema $schema): void { $this->addSql('ALTER TABLE activitytype ADD locationVisible SMALLINT DEFAULT 1 NOT NULL'); diff --git a/src/Bundle/ChillMainBundle/migrations/Version20211015084653.php b/src/Bundle/ChillMainBundle/migrations/Version20211015084653.php index aae480ea3..28d27161a 100644 --- a/src/Bundle/ChillMainBundle/migrations/Version20211015084653.php +++ b/src/Bundle/ChillMainBundle/migrations/Version20211015084653.php @@ -16,17 +16,20 @@ use Doctrine\Migrations\AbstractMigration; final class Version20211015084653 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->addSql('DROP INDEX IDX_90E4736AF5B7AF75'); $this->addSql('CREATE UNIQUE INDEX uniq_90e4736af5b7af75 ON chill_main_location (address_id)'); } + #[\Override] public function getDescription(): string { return 'Location entity: change Address to ManyToOne'; } + #[\Override] public function up(Schema $schema): void { $this->addSql('DROP INDEX uniq_90e4736af5b7af75'); diff --git a/src/Bundle/ChillMainBundle/migrations/Version20211022094429.php b/src/Bundle/ChillMainBundle/migrations/Version20211022094429.php index 81aa5544c..818d96c6d 100644 --- a/src/Bundle/ChillMainBundle/migrations/Version20211022094429.php +++ b/src/Bundle/ChillMainBundle/migrations/Version20211022094429.php @@ -19,17 +19,20 @@ use Doctrine\Migrations\AbstractMigration; */ final class Version20211022094429 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->addSql('ALTER TABLE chill_main_location_type DROP active'); $this->addSql('ALTER TABLE chill_main_location DROP active'); } + #[\Override] public function getDescription(): string { return 'Add active on Location and LocationType'; } + #[\Override] public function up(Schema $schema): void { $this->addSql('ALTER TABLE chill_main_location ADD active BOOLEAN DEFAULT TRUE;'); diff --git a/src/Bundle/ChillMainBundle/migrations/Version20211116162847.php b/src/Bundle/ChillMainBundle/migrations/Version20211116162847.php index 055949893..ca81750e7 100644 --- a/src/Bundle/ChillMainBundle/migrations/Version20211116162847.php +++ b/src/Bundle/ChillMainBundle/migrations/Version20211116162847.php @@ -19,6 +19,7 @@ use Doctrine\Migrations\AbstractMigration; */ final class Version20211116162847 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->addSql('ALTER TABLE users DROP CONSTRAINT FK_1483A5E93C219753'); @@ -26,11 +27,13 @@ final class Version20211116162847 extends AbstractMigration $this->addSql('ALTER TABLE users DROP currentLocation_id'); } + #[\Override] public function getDescription(): string { return 'Add current location to User entity'; } + #[\Override] public function up(Schema $schema): void { $this->addSql('ALTER TABLE users ADD currentLocation_id INT DEFAULT NULL'); diff --git a/src/Bundle/ChillMainBundle/migrations/Version20211119173554.php b/src/Bundle/ChillMainBundle/migrations/Version20211119173554.php index 070311f7d..134f6da75 100644 --- a/src/Bundle/ChillMainBundle/migrations/Version20211119173554.php +++ b/src/Bundle/ChillMainBundle/migrations/Version20211119173554.php @@ -19,16 +19,19 @@ use Doctrine\Migrations\AbstractMigration; */ final class Version20211119173554 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->throwIrreversibleMigrationException(); } + #[\Override] public function getDescription(): string { return 'remove comment on deprecated json_array type'; } + #[\Override] public function up(Schema $schema): void { $columns = [ diff --git a/src/Bundle/ChillMainBundle/migrations/Version20211123093355.php b/src/Bundle/ChillMainBundle/migrations/Version20211123093355.php index 6dc216854..2c80aeb02 100644 --- a/src/Bundle/ChillMainBundle/migrations/Version20211123093355.php +++ b/src/Bundle/ChillMainBundle/migrations/Version20211123093355.php @@ -19,17 +19,20 @@ use Doctrine\Migrations\AbstractMigration; */ final class Version20211123093355 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->addSql('DROP INDEX UNIQ_A459B5CADD3E4105'); $this->addSql('ALTER TABLE chill_main_location_type DROP defaultFor'); } + #[\Override] public function getDescription(): string { return 'Add defaultFor to LocationType'; } + #[\Override] public function up(Schema $schema): void { $this->addSql('ALTER TABLE chill_main_location_type ADD defaultFor VARCHAR(32) DEFAULT NULL'); diff --git a/src/Bundle/ChillMainBundle/migrations/Version20211125142016.php b/src/Bundle/ChillMainBundle/migrations/Version20211125142016.php index 2ab522898..51073a9c6 100644 --- a/src/Bundle/ChillMainBundle/migrations/Version20211125142016.php +++ b/src/Bundle/ChillMainBundle/migrations/Version20211125142016.php @@ -16,6 +16,7 @@ use Doctrine\Migrations\AbstractMigration; final class Version20211125142016 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->addSql('DROP TRIGGER canonicalize_address_reference_on_insert ON chill_main_address_reference'); @@ -24,11 +25,13 @@ final class Version20211125142016 extends AbstractMigration $this->addSql('ALTER TABLE chill_main_address_reference DROP COLUMN addressCanonical'); } + #[\Override] public function getDescription(): string { return 'Add a column "canonicalized" on chill_main_address_reference and add trigger and indexed on it'; } + #[\Override] public function up(Schema $schema): void { $this->addSql('ALTER TABLE chill_main_address_reference ADD addressCanonical TEXT DEFAULT \'\' NOT NULL'); diff --git a/src/Bundle/ChillMainBundle/migrations/Version20211125142017.php b/src/Bundle/ChillMainBundle/migrations/Version20211125142017.php index bd10b0faf..ea023a212 100644 --- a/src/Bundle/ChillMainBundle/migrations/Version20211125142017.php +++ b/src/Bundle/ChillMainBundle/migrations/Version20211125142017.php @@ -16,6 +16,7 @@ use Doctrine\Migrations\AbstractMigration; final class Version20211125142017 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->addSql('DROP TRIGGER canonicalize_postal_code_on_insert ON chill_main_postal_code'); @@ -24,11 +25,13 @@ final class Version20211125142017 extends AbstractMigration $this->addSql('ALTER TABLE chill_main_postal_code DROP COLUMN canonical'); } + #[\Override] public function getDescription(): string { return 'Add a column "canonicalized" on postal code'; } + #[\Override] public function up(Schema $schema): void { $this->addSql('ALTER TABLE chill_main_postal_code ADD canonical TEXT DEFAULT \'\' NOT NULL'); diff --git a/src/Bundle/ChillMainBundle/migrations/Version20211213112628.php b/src/Bundle/ChillMainBundle/migrations/Version20211213112628.php index 027005647..c977d0eb6 100644 --- a/src/Bundle/ChillMainBundle/migrations/Version20211213112628.php +++ b/src/Bundle/ChillMainBundle/migrations/Version20211213112628.php @@ -19,16 +19,19 @@ use Doctrine\Migrations\AbstractMigration; */ final class Version20211213112628 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->addSql('ALTER TABLE chill_main_civility DROP "ordering"'); } + #[\Override] public function getDescription(): string { return 'Add order to civility'; } + #[\Override] public function up(Schema $schema): void { $this->addSql('ALTER TABLE chill_main_civility ADD "ordering" FLOAT DEFAULT 0.0'); diff --git a/src/Bundle/ChillMainBundle/migrations/Version20211216213649.php b/src/Bundle/ChillMainBundle/migrations/Version20211216213649.php index 58e9bdc2d..31388f2ae 100644 --- a/src/Bundle/ChillMainBundle/migrations/Version20211216213649.php +++ b/src/Bundle/ChillMainBundle/migrations/Version20211216213649.php @@ -16,16 +16,19 @@ use Doctrine\Migrations\AbstractMigration; final class Version20211216213649 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->addSql('DROP INDEX address_refid'); } + #[\Override] public function getDescription(): string { return 'add an index on address reference refid'; } + #[\Override] public function up(Schema $schema): void { $this->addSql('CREATE INDEX address_refid ON chill_main_address_reference (refId) WHERE refid != \'\''); diff --git a/src/Bundle/ChillMainBundle/migrations/Version20211225231532.php b/src/Bundle/ChillMainBundle/migrations/Version20211225231532.php index 7394d6dc2..a0f5c6551 100644 --- a/src/Bundle/ChillMainBundle/migrations/Version20211225231532.php +++ b/src/Bundle/ChillMainBundle/migrations/Version20211225231532.php @@ -16,17 +16,20 @@ use Doctrine\Migrations\AbstractMigration; final class Version20211225231532 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->addSql('DROP TABLE chill_main_notification_addresses_unread'); $this->addSql('ALTER TABLE chill_main_notification ADD read JSONB DEFAULT \'[]\''); } + #[\Override] public function getDescription(): string { return 'Store notification readed by user in a specific table'; } + #[\Override] public function up(Schema $schema): void { $this->addSql('CREATE TABLE chill_main_notification_addresses_unread (notification_id INT NOT NULL, user_id INT NOT NULL, PRIMARY KEY(notification_id, user_id))'); diff --git a/src/Bundle/ChillMainBundle/migrations/Version20211228183221.php b/src/Bundle/ChillMainBundle/migrations/Version20211228183221.php index c8ac90d89..7698f5a3d 100644 --- a/src/Bundle/ChillMainBundle/migrations/Version20211228183221.php +++ b/src/Bundle/ChillMainBundle/migrations/Version20211228183221.php @@ -16,17 +16,20 @@ use Doctrine\Migrations\AbstractMigration; final class Version20211228183221 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->addSql('create unique index uniq_5bdc8067567988b4440f6072 on chill_main_notification (relatedentityclass, relatedentityid)'); } + #[\Override] public function getDescription(): string { return 'remove unique index which prevent to notify twice an entity'; } + #[\Override] public function up(Schema $schema): void { $this->addSql('DROP INDEX uniq_5bdc8067567988b4440f6072'); diff --git a/src/Bundle/ChillMainBundle/migrations/Version20211228215919.php b/src/Bundle/ChillMainBundle/migrations/Version20211228215919.php index 7dc08b70b..145b39964 100644 --- a/src/Bundle/ChillMainBundle/migrations/Version20211228215919.php +++ b/src/Bundle/ChillMainBundle/migrations/Version20211228215919.php @@ -16,17 +16,20 @@ use Doctrine\Migrations\AbstractMigration; final class Version20211228215919 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->addSql('DROP SEQUENCE chill_main_notification_comment_id_seq CASCADE'); $this->addSql('DROP TABLE chill_main_notification_comment'); } + #[\Override] public function getDescription(): string { return 'Notifications: add comment on notifications'; } + #[\Override] public function up(Schema $schema): void { $this->addSql('CREATE SEQUENCE chill_main_notification_comment_id_seq INCREMENT BY 1 MINVALUE 1 START 1'); diff --git a/src/Bundle/ChillMainBundle/migrations/Version20211229140308.php b/src/Bundle/ChillMainBundle/migrations/Version20211229140308.php index 13b79cb73..7821891af 100644 --- a/src/Bundle/ChillMainBundle/migrations/Version20211229140308.php +++ b/src/Bundle/ChillMainBundle/migrations/Version20211229140308.php @@ -16,6 +16,7 @@ use Doctrine\Migrations\AbstractMigration; final class Version20211229140308 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->addSql('ALTER TABLE chill_main_notification DROP CONSTRAINT FK_5BDC806765FF1AEC'); @@ -24,11 +25,13 @@ final class Version20211229140308 extends AbstractMigration $this->addSql('ALTER TABLE chill_main_notification DROP updatedBy_id'); } + #[\Override] public function getDescription(): string { return 'Notification: add updated tracking information'; } + #[\Override] public function up(Schema $schema): void { $this->addSql('ALTER TABLE chill_main_notification ADD updatedAt TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL'); diff --git a/src/Bundle/ChillMainBundle/migrations/Version20211230003532.php b/src/Bundle/ChillMainBundle/migrations/Version20211230003532.php index efc08a818..32f32aa3d 100644 --- a/src/Bundle/ChillMainBundle/migrations/Version20211230003532.php +++ b/src/Bundle/ChillMainBundle/migrations/Version20211230003532.php @@ -16,6 +16,7 @@ use Doctrine\Migrations\AbstractMigration; final class Version20211230003532 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->addSql('ALTER TABLE chill_main_notification DROP title'); @@ -23,11 +24,13 @@ final class Version20211230003532 extends AbstractMigration $this->addSql('ALTER TABLE chill_main_notification ALTER updatedAt DROP NOT NULL'); } + #[\Override] public function getDescription(): string { return 'Add title and allow system notification (sender is null)'; } + #[\Override] public function up(Schema $schema): void { $this->addSql('ALTER TABLE chill_main_notification ADD title TEXT DEFAULT \'\' NOT NULL'); diff --git a/src/Bundle/ChillMainBundle/migrations/Version20220112123436.php b/src/Bundle/ChillMainBundle/migrations/Version20220112123436.php index 686961118..61d9792c0 100644 --- a/src/Bundle/ChillMainBundle/migrations/Version20220112123436.php +++ b/src/Bundle/ChillMainBundle/migrations/Version20220112123436.php @@ -16,6 +16,7 @@ use Doctrine\Migrations\AbstractMigration; final class Version20220112123436 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->addSql('ALTER TABLE chill_main_workflow_entity_subscriber_to_final DROP CONSTRAINT FK_C2CE504C7D99CE94'); @@ -31,11 +32,13 @@ final class Version20220112123436 extends AbstractMigration $this->addSql('DROP TABLE chill_main_entity_workflow_step_user'); } + #[\Override] public function getDescription(): string { return 'Create tables for workflow'; } + #[\Override] public function up(Schema $schema): void { $this->addSql('CREATE SEQUENCE chill_main_workflow_entity_id_seq INCREMENT BY 1 MINVALUE 1 START 1'); diff --git a/src/Bundle/ChillMainBundle/migrations/Version20220112150413.php b/src/Bundle/ChillMainBundle/migrations/Version20220112150413.php index 5ef5b8271..384657c27 100644 --- a/src/Bundle/ChillMainBundle/migrations/Version20220112150413.php +++ b/src/Bundle/ChillMainBundle/migrations/Version20220112150413.php @@ -19,16 +19,19 @@ use Doctrine\Migrations\AbstractMigration; */ final class Version20220112150413 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->addSql('ALTER TABLE chill_main_location_type DROP editableByUsers'); } + #[\Override] public function getDescription(): string { return 'Add editableByUsers field to ChillMain/LocationType'; } + #[\Override] public function up(Schema $schema): void { $this->addSql('ALTER TABLE chill_main_location_type ADD editableByUsers BOOLEAN DEFAULT TRUE'); diff --git a/src/Bundle/ChillMainBundle/migrations/Version20220112161136.php b/src/Bundle/ChillMainBundle/migrations/Version20220112161136.php index bcdced1ad..4eb3b7fcf 100644 --- a/src/Bundle/ChillMainBundle/migrations/Version20220112161136.php +++ b/src/Bundle/ChillMainBundle/migrations/Version20220112161136.php @@ -19,6 +19,7 @@ use Doctrine\Migrations\AbstractMigration; */ final class Version20220112161136 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->addSql('ALTER TABLE users DROP CONSTRAINT FK_1483A5E9DB622A42'); @@ -26,11 +27,13 @@ final class Version20220112161136 extends AbstractMigration $this->addSql('ALTER TABLE users DROP mainLocation_id'); } + #[\Override] public function getDescription(): string { return 'Add mainLocation to User'; } + #[\Override] public function up(Schema $schema): void { $this->addSql('ALTER TABLE users ADD mainLocation_id INT DEFAULT NULL'); diff --git a/src/Bundle/ChillMainBundle/migrations/Version20220114132105.php b/src/Bundle/ChillMainBundle/migrations/Version20220114132105.php index fdfd6cdbb..d950cce8a 100644 --- a/src/Bundle/ChillMainBundle/migrations/Version20220114132105.php +++ b/src/Bundle/ChillMainBundle/migrations/Version20220114132105.php @@ -16,6 +16,7 @@ use Doctrine\Migrations\AbstractMigration; final class Version20220114132105 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->addSql('DROP SEQUENCE chill_main_workflow_entity_comment_id_seq CASCADE'); @@ -24,11 +25,13 @@ final class Version20220114132105 extends AbstractMigration $this->addSql('ALTER TABLE chill_main_workflow_entity_step_user RENAME TO chill_main_entity_workflow_step_user'); } + #[\Override] public function getDescription(): string { return 'Add comment to entity workflow'; } + #[\Override] public function up(Schema $schema): void { $this->addSql('CREATE SEQUENCE chill_main_workflow_entity_comment_id_seq INCREMENT BY 1 MINVALUE 1 START 1;'); diff --git a/src/Bundle/ChillMainBundle/migrations/Version20220114165950.php b/src/Bundle/ChillMainBundle/migrations/Version20220114165950.php index 118fa0a4e..3d571bb40 100644 --- a/src/Bundle/ChillMainBundle/migrations/Version20220114165950.php +++ b/src/Bundle/ChillMainBundle/migrations/Version20220114165950.php @@ -19,16 +19,19 @@ use Doctrine\Migrations\AbstractMigration; */ final class Version20220114165950 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->addSql('ALTER TABLE chill_main_workflow_entity_step ALTER transitionat SET NOT NULL'); } + #[\Override] public function getDescription(): string { return 'remove not null on transition at'; } + #[\Override] public function up(Schema $schema): void { $this->addSql('ALTER TABLE chill_main_workflow_entity_step ALTER transitionat DROP NOT NULL'); diff --git a/src/Bundle/ChillMainBundle/migrations/Version20220120155303.php b/src/Bundle/ChillMainBundle/migrations/Version20220120155303.php index bd3d087c5..5f9aca099 100644 --- a/src/Bundle/ChillMainBundle/migrations/Version20220120155303.php +++ b/src/Bundle/ChillMainBundle/migrations/Version20220120155303.php @@ -16,16 +16,19 @@ use Doctrine\Migrations\AbstractMigration; final class Version20220120155303 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->addSql('DROP INDEX chill_main_notification_related_entity_idx'); } + #[\Override] public function getDescription(): string { return 'Create index for counting notifications'; } + #[\Override] public function up(Schema $schema): void { $this->addSql('CREATE INDEX chill_main_notification_related_entity_idx ON chill_main_notification (relatedentityclass, relatedentityid DESC)'); diff --git a/src/Bundle/ChillMainBundle/migrations/Version20220124085957.php b/src/Bundle/ChillMainBundle/migrations/Version20220124085957.php index bd9bb5e04..bc18f8d90 100644 --- a/src/Bundle/ChillMainBundle/migrations/Version20220124085957.php +++ b/src/Bundle/ChillMainBundle/migrations/Version20220124085957.php @@ -19,6 +19,7 @@ use Doctrine\Migrations\AbstractMigration; */ final class Version20220124085957 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->addSql('ALTER TABLE chill_main_address DROP confidential'); @@ -28,11 +29,13 @@ final class Version20220124085957 extends AbstractMigration $this->addSql('ALTER TABLE chill_main_address ALTER steps TYPE VARCHAR(16)'); } + #[\Override] public function getDescription(): string { return 'Alter some address fields + add confidential field on Address'; } + #[\Override] public function up(Schema $schema): void { $this->addSql('ALTER TABLE chill_main_address ADD confidential BOOLEAN DEFAULT FALSE'); diff --git a/src/Bundle/ChillMainBundle/migrations/Version20220125134253.php b/src/Bundle/ChillMainBundle/migrations/Version20220125134253.php index 220f1fb2b..bc5781d19 100644 --- a/src/Bundle/ChillMainBundle/migrations/Version20220125134253.php +++ b/src/Bundle/ChillMainBundle/migrations/Version20220125134253.php @@ -19,17 +19,20 @@ use Doctrine\Migrations\AbstractMigration; */ final class Version20220125134253 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->addSql('DROP SEQUENCE chill_main_residential_address_id_seq CASCADE'); $this->addSql('DROP TABLE chill_main_residential_address'); } + #[\Override] public function getDescription(): string { return 'Create a new entity ResidentialAddress'; } + #[\Override] public function up(Schema $schema): void { $this->addSql('CREATE SEQUENCE chill_main_residential_address_id_seq INCREMENT BY 1 MINVALUE 1 START 1'); diff --git a/src/Bundle/ChillMainBundle/migrations/Version20220128211748.php b/src/Bundle/ChillMainBundle/migrations/Version20220128211748.php index eba606b91..46cb2d57a 100644 --- a/src/Bundle/ChillMainBundle/migrations/Version20220128211748.php +++ b/src/Bundle/ChillMainBundle/migrations/Version20220128211748.php @@ -16,16 +16,19 @@ use Doctrine\Migrations\AbstractMigration; final class Version20220128211748 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->addSql('ALTER TABLE chill_main_workflow_entity_step RENAME COLUMN isFinal TO finalizeAfter;'); } + #[\Override] public function getDescription(): string { return 'rename workflow entity step from finalizeAfter to isFinal'; } + #[\Override] public function up(Schema $schema): void { $this->addSql('ALTER TABLE chill_main_workflow_entity_step RENAME COLUMN finalizeAfter TO isFinal;'); diff --git a/src/Bundle/ChillMainBundle/migrations/Version20220217133607.php b/src/Bundle/ChillMainBundle/migrations/Version20220217133607.php index 0e0b18f7e..9d15fdb69 100644 --- a/src/Bundle/ChillMainBundle/migrations/Version20220217133607.php +++ b/src/Bundle/ChillMainBundle/migrations/Version20220217133607.php @@ -19,17 +19,20 @@ use Doctrine\Migrations\AbstractMigration; */ final class Version20220217133607 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->addSql('ALTER TABLE IF EXISTS chill_person_residential_address RENAME TO chill_main_residential_address;'); $this->addSql('ALTER SEQUENCE IF EXISTS chill_person_residential_address_id_seq RENAME TO chill_main_residential_address_id_seq;'); } + #[\Override] public function getDescription(): string { return 'Rename residential_address table'; } + #[\Override] public function up(Schema $schema): void { $this->addSql('ALTER TABLE IF EXISTS chill_main_residential_address RENAME TO chill_person_residential_address;'); diff --git a/src/Bundle/ChillMainBundle/migrations/Version20220223171457.php b/src/Bundle/ChillMainBundle/migrations/Version20220223171457.php index f24ff2d31..177a4df7f 100644 --- a/src/Bundle/ChillMainBundle/migrations/Version20220223171457.php +++ b/src/Bundle/ChillMainBundle/migrations/Version20220223171457.php @@ -16,17 +16,20 @@ use Doctrine\Migrations\AbstractMigration; final class Version20220223171457 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->addSql('ALTER TABLE chill_main_workflow_entity_step DROP accessKey'); $this->addSql('DROP TABLE chill_main_workflow_entity_step_user_by_accesskey'); } + #[\Override] public function getDescription(): string { return 'Add access key to EntityWorkflowStep'; } + #[\Override] public function up(Schema $schema): void { $this->addSql('ALTER TABLE chill_main_workflow_entity_step ADD accessKey TEXT DEFAULT NULL'); diff --git a/src/Bundle/ChillMainBundle/migrations/Version20220302132728.php b/src/Bundle/ChillMainBundle/migrations/Version20220302132728.php index 040aadf38..7116cc45d 100644 --- a/src/Bundle/ChillMainBundle/migrations/Version20220302132728.php +++ b/src/Bundle/ChillMainBundle/migrations/Version20220302132728.php @@ -21,6 +21,7 @@ final class Version20220302132728 extends AbstractMigration implements Container { use ContainerAwareTrait; + #[\Override] public function down(Schema $schema): void { $this->addSql('ALTER TABLE chill_main_location ALTER phonenumber1 TYPE VARCHAR(64)'); @@ -31,11 +32,13 @@ final class Version20220302132728 extends AbstractMigration implements Container $this->addSql('COMMENT ON COLUMN chill_main_location.phonenumber2 IS NULL'); } + #[\Override] public function getDescription(): string { return 'Upgrade phonenumber on location'; } + #[\Override] public function up(Schema $schema): void { $carrier_code = $this->container diff --git a/src/Bundle/ChillMainBundle/migrations/Version20220325134944.php b/src/Bundle/ChillMainBundle/migrations/Version20220325134944.php index 28291ab2c..8631c88b2 100644 --- a/src/Bundle/ChillMainBundle/migrations/Version20220325134944.php +++ b/src/Bundle/ChillMainBundle/migrations/Version20220325134944.php @@ -19,6 +19,7 @@ use Doctrine\Migrations\AbstractMigration; */ final class Version20220325134944 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->addSql('ALTER TABLE chill_main_address_reference DROP createdAt'); @@ -30,11 +31,13 @@ final class Version20220325134944 extends AbstractMigration where ((refid)::text <> \'\'::text)'); } + #[\Override] public function getDescription(): string { return 'Add 3 fields on AddressReference'; } + #[\Override] public function up(Schema $schema): void { $this->addSql('ALTER TABLE chill_main_address_reference ADD createdAt TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL'); diff --git a/src/Bundle/ChillMainBundle/migrations/Version20220413154743.php b/src/Bundle/ChillMainBundle/migrations/Version20220413154743.php index fd814871e..6b6692e79 100644 --- a/src/Bundle/ChillMainBundle/migrations/Version20220413154743.php +++ b/src/Bundle/ChillMainBundle/migrations/Version20220413154743.php @@ -16,17 +16,20 @@ use Doctrine\Migrations\AbstractMigration; final class Version20220413154743 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->addSql('ALTER TABLE chill_main_notification DROP adressesEmails'); $this->addSql('ALTER TABLE chill_main_notification DROP accessKey'); } + #[\Override] public function getDescription(): string { return 'add access keys and emails dest to notifications'; } + #[\Override] public function up(Schema $schema): void { $this->addSql('ALTER TABLE chill_main_notification ADD addressesEmails JSON NOT NULL DEFAULT \'[]\';'); diff --git a/src/Bundle/ChillMainBundle/migrations/Version20220413225830.php b/src/Bundle/ChillMainBundle/migrations/Version20220413225830.php index 06310fec6..c04c0a076 100644 --- a/src/Bundle/ChillMainBundle/migrations/Version20220413225830.php +++ b/src/Bundle/ChillMainBundle/migrations/Version20220413225830.php @@ -16,16 +16,19 @@ use Doctrine\Migrations\AbstractMigration; final class Version20220413225830 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->addSql('ALTER TABLE chill_main_address ALTER COLUMN postcode_id DROP NOT NULL'); } + #[\Override] public function getDescription(): string { return 'Set postal code in chill_main_address NOT NULL'; } + #[\Override] public function up(Schema $schema): void { $this->addSql('ALTER TABLE chill_main_address ALTER COLUMN postcode_id SET NOT NULL'); diff --git a/src/Bundle/ChillMainBundle/migrations/Version20220413230159.php b/src/Bundle/ChillMainBundle/migrations/Version20220413230159.php index 9d3e4e477..052949283 100644 --- a/src/Bundle/ChillMainBundle/migrations/Version20220413230159.php +++ b/src/Bundle/ChillMainBundle/migrations/Version20220413230159.php @@ -16,16 +16,19 @@ use Doctrine\Migrations\AbstractMigration; final class Version20220413230159 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->addSql('ALTER TABLE chill_main_address DROP CONSTRAINT chill_custom_validfrom_before_validto'); } + #[\Override] public function getDescription(): string { return 'in addresses, validfrom must be lower than validto'; } + #[\Override] public function up(Schema $schema): void { $this->addSql('ALTER TABLE chill_main_address ADD CONSTRAINT chill_custom_validfrom_before_validto CHECK (validfrom <= COALESCE(validto, \'infinity\'::date))'); diff --git a/src/Bundle/ChillMainBundle/migrations/Version20220506131307.php b/src/Bundle/ChillMainBundle/migrations/Version20220506131307.php index 381f0c037..29a55f316 100644 --- a/src/Bundle/ChillMainBundle/migrations/Version20220506131307.php +++ b/src/Bundle/ChillMainBundle/migrations/Version20220506131307.php @@ -16,6 +16,7 @@ use Doctrine\Migrations\AbstractMigration; final class Version20220506131307 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->addSql('DROP INDEX chill_internal_address_reference_canonicalized'); @@ -23,11 +24,13 @@ final class Version20220506131307 extends AbstractMigration on chill_main_address_reference using gist (postcode_id, addresscanonical gist_trgm_ops);'); } + #[\Override] public function getDescription(): string { return 'Adapt search index on address reference canonicalized'; } + #[\Override] public function up(Schema $schema): void { $this->addSql('DROP INDEX chill_internal_address_reference_canonicalized'); diff --git a/src/Bundle/ChillMainBundle/migrations/Version20220506145935.php b/src/Bundle/ChillMainBundle/migrations/Version20220506145935.php index de9194302..8e5c1a888 100644 --- a/src/Bundle/ChillMainBundle/migrations/Version20220506145935.php +++ b/src/Bundle/ChillMainBundle/migrations/Version20220506145935.php @@ -16,16 +16,19 @@ use Doctrine\Migrations\AbstractMigration; final class Version20220506145935 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->addSql('DROP INDEX search_by_reference_code'); } + #[\Override] public function getDescription(): string { return 'Add index to search postal code by references'; } + #[\Override] public function up(Schema $schema): void { $this->addSql('CREATE INDEX search_by_reference_code ON chill_main_postal_code (code, refpostalcodeid)'); diff --git a/src/Bundle/ChillMainBundle/migrations/Version20220506223243.php b/src/Bundle/ChillMainBundle/migrations/Version20220506223243.php index 72d025f2b..23b3ee639 100644 --- a/src/Bundle/ChillMainBundle/migrations/Version20220506223243.php +++ b/src/Bundle/ChillMainBundle/migrations/Version20220506223243.php @@ -23,16 +23,19 @@ use Doctrine\Migrations\AbstractMigration; final class Version20220506223243 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->addSql('ALTER TABLE users ALTER attributes DROP NOT NULL'); } + #[\Override] public function getDescription(): string { return 'Force user attribute to be an array'; } + #[\Override] public function up(Schema $schema): void { $this->addSql('UPDATE users SET attributes = \'{}\'::jsonb WHERE attributes IS NULL'); diff --git a/src/Bundle/ChillMainBundle/migrations/Version20220513151853.php b/src/Bundle/ChillMainBundle/migrations/Version20220513151853.php index 4bd9bd18f..1a2814e95 100644 --- a/src/Bundle/ChillMainBundle/migrations/Version20220513151853.php +++ b/src/Bundle/ChillMainBundle/migrations/Version20220513151853.php @@ -16,13 +16,16 @@ use Doctrine\Migrations\AbstractMigration; final class Version20220513151853 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void {} + #[\Override] public function getDescription(): string { return 'set default on attributes'; } + #[\Override] public function up(Schema $schema): void { $this->addSql('update users set attributes = \'[]\'::json where attributes IS NULL'); diff --git a/src/Bundle/ChillMainBundle/migrations/Version20220516085659.php b/src/Bundle/ChillMainBundle/migrations/Version20220516085659.php index 45110f6ef..dd8661f6b 100644 --- a/src/Bundle/ChillMainBundle/migrations/Version20220516085659.php +++ b/src/Bundle/ChillMainBundle/migrations/Version20220516085659.php @@ -19,6 +19,7 @@ use Doctrine\Migrations\AbstractMigration; */ final class Version20220516085659 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->addSql('ALTER TABLE users DROP CONSTRAINT FK_1483A5E923D6A298'); @@ -26,11 +27,13 @@ final class Version20220516085659 extends AbstractMigration $this->addSql('ALTER TABLE users DROP civility_id'); } + #[\Override] public function getDescription(): string { return 'Add civility to User'; } + #[\Override] public function up(Schema $schema): void { $this->addSql('ALTER TABLE users ADD civility_id INT DEFAULT NULL'); diff --git a/src/Bundle/ChillMainBundle/migrations/Version20220711150006.php b/src/Bundle/ChillMainBundle/migrations/Version20220711150006.php index 31f502f46..313e145cd 100644 --- a/src/Bundle/ChillMainBundle/migrations/Version20220711150006.php +++ b/src/Bundle/ChillMainBundle/migrations/Version20220711150006.php @@ -16,17 +16,20 @@ use Doctrine\Migrations\AbstractMigration; final class Version20220711150006 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->addSql('ALTER TABLE chill_main_workflow_entity_step DROP CONSTRAINT chill_custom_only_one_step_opened'); } + #[\Override] public function getDescription(): string { return 'Add a constraint to ensure that only one step is available at a time'; } + #[\Override] public function up(Schema $schema): void { $this->addSql('ALTER TABLE chill_main_workflow_entity_step diff --git a/src/Bundle/ChillMainBundle/migrations/Version20220729205416.php b/src/Bundle/ChillMainBundle/migrations/Version20220729205416.php index 4fed9eb25..c44a75d90 100644 --- a/src/Bundle/ChillMainBundle/migrations/Version20220729205416.php +++ b/src/Bundle/ChillMainBundle/migrations/Version20220729205416.php @@ -16,6 +16,7 @@ use Doctrine\Migrations\AbstractMigration; final class Version20220729205416 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->addSql('DROP INDEX postal_code_import_unicity'); @@ -27,11 +28,13 @@ final class Version20220729205416 extends AbstractMigration $this->addSql('ALTER TABLE chill_main_postal_code DROP CONSTRAINT chill_internal_postal_code_import_unicity'); } + #[\Override] public function getDescription(): string { return 'postal code: add columns to track creation, update and deletion'; } + #[\Override] public function up(Schema $schema): void { $this->addSql('ALTER TABLE chill_main_postal_code ADD deletedAt TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL'); diff --git a/src/Bundle/ChillMainBundle/migrations/Version20220730204216.php b/src/Bundle/ChillMainBundle/migrations/Version20220730204216.php index 4bd9ce9aa..3c8b282b7 100644 --- a/src/Bundle/ChillMainBundle/migrations/Version20220730204216.php +++ b/src/Bundle/ChillMainBundle/migrations/Version20220730204216.php @@ -16,16 +16,19 @@ use Doctrine\Migrations\AbstractMigration; final class Version20220730204216 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->addSql('DROP INDEX chill_main_address_reference_unicity'); } + #[\Override] public function getDescription(): string { return 'Add an unique constraint on addresses references'; } + #[\Override] public function up(Schema $schema): void { $this->addSql('CREATE UNIQUE INDEX chill_main_address_reference_unicity ON chill_main_address_reference (refId, source)'); diff --git a/src/Bundle/ChillMainBundle/migrations/Version20220829132409.php b/src/Bundle/ChillMainBundle/migrations/Version20220829132409.php index ae31821c5..b14230558 100644 --- a/src/Bundle/ChillMainBundle/migrations/Version20220829132409.php +++ b/src/Bundle/ChillMainBundle/migrations/Version20220829132409.php @@ -19,17 +19,20 @@ use Doctrine\Migrations\AbstractMigration; */ final class Version20220829132409 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->addSql('DROP SEQUENCE chill_main_geographical_unit_id_seq CASCADE'); $this->addSql('DROP TABLE chill_main_geographical_unit'); } + #[\Override] public function getDescription(): string { return 'Add new entity GeographicalUnit'; } + #[\Override] public function up(Schema $schema): void { $this->addSql('CREATE SEQUENCE chill_main_geographical_unit_id_seq INCREMENT BY 1 MINVALUE 1 START 1'); diff --git a/src/Bundle/ChillMainBundle/migrations/Version20220913174922.php b/src/Bundle/ChillMainBundle/migrations/Version20220913174922.php index ab1526e3d..e91dafc4c 100644 --- a/src/Bundle/ChillMainBundle/migrations/Version20220913174922.php +++ b/src/Bundle/ChillMainBundle/migrations/Version20220913174922.php @@ -19,16 +19,19 @@ use Doctrine\Migrations\AbstractMigration; */ final class Version20220913174922 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->addSql('ALTER TABLE chill_main_geographical_unit ALTER COLUMN geom SET DATA TYPE TEXT'); } + #[\Override] public function getDescription(): string { return 'Geographical Unit correction'; } + #[\Override] public function up(Schema $schema): void { $this->addSql('ALTER TABLE chill_main_geographical_unit ALTER COLUMN geom SET DATA TYPE GEOMETRY(MULTIPOLYGON, 4326)'); diff --git a/src/Bundle/ChillMainBundle/migrations/Version20221003112151.php b/src/Bundle/ChillMainBundle/migrations/Version20221003112151.php index 818f63444..c093c984f 100644 --- a/src/Bundle/ChillMainBundle/migrations/Version20221003112151.php +++ b/src/Bundle/ChillMainBundle/migrations/Version20221003112151.php @@ -16,6 +16,7 @@ use Doctrine\Migrations\AbstractMigration; final class Version20221003112151 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->throwIrreversibleMigrationException(); @@ -34,11 +35,13 @@ final class Version20221003112151 extends AbstractMigration */ } + #[\Override] public function getDescription(): string { return 'Add a proper entity for GeographicalUnitLayer'; } + #[\Override] public function up(Schema $schema): void { $this->addSql('CREATE SEQUENCE chill_main_geographical_unit_layer_id_seq INCREMENT BY 1 MINVALUE 1 START 1'); diff --git a/src/Bundle/ChillMainBundle/migrations/Version20221003132620.php b/src/Bundle/ChillMainBundle/migrations/Version20221003132620.php index 1b16f8799..641eacae4 100644 --- a/src/Bundle/ChillMainBundle/migrations/Version20221003132620.php +++ b/src/Bundle/ChillMainBundle/migrations/Version20221003132620.php @@ -16,6 +16,7 @@ use Doctrine\Migrations\AbstractMigration; final class Version20221003132620 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->addSql('DROP INDEX geographical_unit_layer_refid'); @@ -23,11 +24,13 @@ final class Version20221003132620 extends AbstractMigration $this->addSql('DROP INDEX chill_internal_geographical_unit_layer_geom_idx'); } + #[\Override] public function getDescription(): string { return 'Create indexes and unique constraints on geographical unit entities'; } + #[\Override] public function up(Schema $schema): void { $this->addSql('CREATE UNIQUE INDEX geographical_unit_layer_refid ON chill_main_geographical_unit_layer (refId)'); diff --git a/src/Bundle/ChillMainBundle/migrations/Version20221010142417.php b/src/Bundle/ChillMainBundle/migrations/Version20221010142417.php index 117dd4d22..ab3387661 100644 --- a/src/Bundle/ChillMainBundle/migrations/Version20221010142417.php +++ b/src/Bundle/ChillMainBundle/migrations/Version20221010142417.php @@ -16,16 +16,19 @@ use Doctrine\Migrations\AbstractMigration; final class Version20221010142417 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->addSql('ALTER TABLE scopes DROP active'); } + #[\Override] public function getDescription(): string { return 'Allow a scope to be desactivated'; } + #[\Override] public function up(Schema $schema): void { $this->addSql('ALTER TABLE scopes ADD active BOOLEAN DEFAULT true NOT NULL'); diff --git a/src/Bundle/ChillMainBundle/migrations/Version20221107212201.php b/src/Bundle/ChillMainBundle/migrations/Version20221107212201.php index 58285c333..dda4800dd 100644 --- a/src/Bundle/ChillMainBundle/migrations/Version20221107212201.php +++ b/src/Bundle/ChillMainBundle/migrations/Version20221107212201.php @@ -16,16 +16,19 @@ use Doctrine\Migrations\AbstractMigration; final class Version20221107212201 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->addSql('DROP TABLE chill_main_saved_export'); } + #[\Override] public function getDescription(): string { return 'Create table for saved exports'; } + #[\Override] public function up(Schema $schema): void { $this->addSql('CREATE TABLE chill_main_saved_export (id UUID NOT NULL, user_id INT DEFAULT NULL, description TEXT DEFAULT \'\' NOT NULL, exportAlias TEXT DEFAULT \'\' NOT NULL, options JSONB DEFAULT \'[]\' NOT NULL, title TEXT DEFAULT \'\' NOT NULL, createdAt TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL, updatedAt TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL, createdBy_id INT DEFAULT NULL, updatedBy_id INT DEFAULT NULL, PRIMARY KEY(id))'); diff --git a/src/Bundle/ChillMainBundle/migrations/Version20221114105345.php b/src/Bundle/ChillMainBundle/migrations/Version20221114105345.php index 8bc75ac29..e19e47fb2 100644 --- a/src/Bundle/ChillMainBundle/migrations/Version20221114105345.php +++ b/src/Bundle/ChillMainBundle/migrations/Version20221114105345.php @@ -16,16 +16,19 @@ use Doctrine\Migrations\AbstractMigration; final class Version20221114105345 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->addSql('DROP MATERIALIZED VIEW view_chill_main_address_geographical_unit'); } + #[\Override] public function getDescription(): string { return 'Create materialized view to store GeographicalUnitAddress'; } + #[\Override] public function up(Schema $schema): void { $this->addSql('CREATE MATERIALIZED VIEW view_chill_main_address_geographical_unit (address_id, geographical_unit_id) AS diff --git a/src/Bundle/ChillMainBundle/migrations/Version20221212163734.php b/src/Bundle/ChillMainBundle/migrations/Version20221212163734.php index 3ec61d38f..4ca0d8863 100644 --- a/src/Bundle/ChillMainBundle/migrations/Version20221212163734.php +++ b/src/Bundle/ChillMainBundle/migrations/Version20221212163734.php @@ -16,16 +16,19 @@ use Doctrine\Migrations\AbstractMigration; final class Version20221212163734 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->addSql('DROP TABLE chill_main_cronjob_execution'); } + #[\Override] public function getDescription(): string { return 'Table for executed jobs'; } + #[\Override] public function up(Schema $schema): void { $this->addSql('CREATE TABLE chill_main_cronjob_execution (key TEXT NOT NULL, lastEnd TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL, diff --git a/src/Bundle/ChillMainBundle/migrations/Version20230111104315.php b/src/Bundle/ChillMainBundle/migrations/Version20230111104315.php index aa6e0f4c5..cc91ce202 100644 --- a/src/Bundle/ChillMainBundle/migrations/Version20230111104315.php +++ b/src/Bundle/ChillMainBundle/migrations/Version20230111104315.php @@ -16,6 +16,7 @@ use Doctrine\Migrations\AbstractMigration; final class Version20230111104315 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->addSql('DROP SEQUENCE regroupment_id_seq CASCADE'); @@ -25,11 +26,13 @@ final class Version20230111104315 extends AbstractMigration $this->addSql('DROP TABLE regroupment_center'); } + #[\Override] public function getDescription(): string { return 'Add regroupment admin entity'; } + #[\Override] public function up(Schema $schema): void { $this->addSql('CREATE SEQUENCE regroupment_id_seq INCREMENT BY 1 MINVALUE 1 START 1'); diff --git a/src/Bundle/ChillMainBundle/migrations/Version20230111160610.php b/src/Bundle/ChillMainBundle/migrations/Version20230111160610.php index c00a3f521..0618221c1 100644 --- a/src/Bundle/ChillMainBundle/migrations/Version20230111160610.php +++ b/src/Bundle/ChillMainBundle/migrations/Version20230111160610.php @@ -19,16 +19,19 @@ use Doctrine\Migrations\AbstractMigration; */ final class Version20230111160610 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->addSql('ALTER TABLE users DROP absenceStart'); } + #[\Override] public function getDescription(): string { return 'Add absence property to user'; } + #[\Override] public function up(Schema $schema): void { $this->addSql('ALTER TABLE users ADD absenceStart TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL'); diff --git a/src/Bundle/ChillMainBundle/migrations/Version20230301155213.php b/src/Bundle/ChillMainBundle/migrations/Version20230301155213.php index 518789213..b5ad7eded 100644 --- a/src/Bundle/ChillMainBundle/migrations/Version20230301155213.php +++ b/src/Bundle/ChillMainBundle/migrations/Version20230301155213.php @@ -16,16 +16,19 @@ use Doctrine\Migrations\AbstractMigration; final class Version20230301155213 extends AbstractMigration { + #[\Override] public function getDescription(): string { return 'Alter type to TEXT for regroupment.name'; } + #[\Override] public function up(Schema $schema): void { $this->addSql('ALTER TABLE regroupment ALTER name TYPE TEXT'); } + #[\Override] public function down(Schema $schema): void { $this->addSql('ALTER TABLE regroupment ALTER name TYPE VARCHAR(15)'); diff --git a/src/Bundle/ChillMainBundle/migrations/Version20230306142148.php b/src/Bundle/ChillMainBundle/migrations/Version20230306142148.php index 1ae328bf2..decacc6ca 100644 --- a/src/Bundle/ChillMainBundle/migrations/Version20230306142148.php +++ b/src/Bundle/ChillMainBundle/migrations/Version20230306142148.php @@ -16,11 +16,13 @@ use Doctrine\Migrations\AbstractMigration; final class Version20230306142148 extends AbstractMigration { + #[\Override] public function getDescription(): string { return 'Add columns refStatus and refStatusLastUpdate to Address'; } + #[\Override] public function up(Schema $schema): void { $this->addSql('ALTER TABLE chill_main_address ADD refStatus TEXT DEFAULT \'match\' NOT NULL'); @@ -30,6 +32,7 @@ final class Version20230306142148 extends AbstractMigration $this->addSql('UPDATE chill_main_address a SET refStatusLastUpdate = COALESCE(r.updatedat, r.createdat, \'1970-01-01\'::timestamp) FROM chill_main_address_reference r WHERE a.addressreference_id = r.id'); } + #[\Override] public function down(Schema $schema): void { $this->addSql('ALTER TABLE chill_main_address DROP refStatus'); diff --git a/src/Bundle/ChillMainBundle/migrations/Version20230306145728.php b/src/Bundle/ChillMainBundle/migrations/Version20230306145728.php index 32e138f54..54bbf65e8 100644 --- a/src/Bundle/ChillMainBundle/migrations/Version20230306145728.php +++ b/src/Bundle/ChillMainBundle/migrations/Version20230306145728.php @@ -16,11 +16,13 @@ use Doctrine\Migrations\AbstractMigration; final class Version20230306145728 extends AbstractMigration { + #[\Override] public function getDescription(): string { return 'fix inconsistencies in chill_main_address table'; } + #[\Override] public function up(Schema $schema): void { $this->addSql('ALTER TABLE chill_main_address ADD createdAt TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL'); @@ -71,6 +73,7 @@ final class Version20230306145728 extends AbstractMigration $this->addSql('COMMENT ON COLUMN chill_main_address_reference.point IS \'(DC2Type:point)\''); } + #[\Override] public function down(Schema $schema): void { $this->throwIrreversibleMigrationException('down method is not double-checked'); diff --git a/src/Bundle/ChillMainBundle/migrations/Version20230306151218.php b/src/Bundle/ChillMainBundle/migrations/Version20230306151218.php index 0ff928367..55e19dad2 100644 --- a/src/Bundle/ChillMainBundle/migrations/Version20230306151218.php +++ b/src/Bundle/ChillMainBundle/migrations/Version20230306151218.php @@ -16,11 +16,13 @@ use Doctrine\Migrations\AbstractMigration; final class Version20230306151218 extends AbstractMigration { + #[\Override] public function getDescription(): string { return 'fix inconsistencies in chill_main_address_reference table'; } + #[\Override] public function up(Schema $schema): void { $this->addSql('ALTER TABLE chill_main_address_reference ALTER refid TYPE TEXT'); @@ -43,6 +45,7 @@ final class Version20230306151218 extends AbstractMigration $this->addSql('ALTER TABLE chill_main_address_reference ALTER source SET NOT NULL'); } + #[\Override] public function down(Schema $schema): void { $this->throwIrreversibleMigrationException('not double-checked'); diff --git a/src/Bundle/ChillMainBundle/migrations/Version20230321134155.php b/src/Bundle/ChillMainBundle/migrations/Version20230321134155.php index 6f3fabb5d..73d0a0735 100644 --- a/src/Bundle/ChillMainBundle/migrations/Version20230321134155.php +++ b/src/Bundle/ChillMainBundle/migrations/Version20230321134155.php @@ -16,6 +16,7 @@ use Doctrine\Migrations\AbstractMigration; final class Version20230321134155 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->addSql('ALTER TABLE chill_main_workflow_entity_step_cc_user DROP CONSTRAINT FK_9FC79037E6AF9D4'); @@ -23,11 +24,13 @@ final class Version20230321134155 extends AbstractMigration $this->addSql('DROP TABLE chill_main_workflow_entity_step_cc_user'); } + #[\Override] public function getDescription(): string { return 'Add cc User to workflow step'; } + #[\Override] public function up(Schema $schema): void { $this->addSql('CREATE TABLE chill_main_workflow_entity_step_cc_user (entityworkflowstep_id INT NOT NULL, user_id INT NOT NULL, PRIMARY KEY(entityworkflowstep_id, user_id))'); diff --git a/src/Bundle/ChillMainBundle/migrations/Version20230711152947.php b/src/Bundle/ChillMainBundle/migrations/Version20230711152947.php index d11a9f78a..3f3dba0e9 100644 --- a/src/Bundle/ChillMainBundle/migrations/Version20230711152947.php +++ b/src/Bundle/ChillMainBundle/migrations/Version20230711152947.php @@ -16,16 +16,19 @@ use Doctrine\Migrations\AbstractMigration; final class Version20230711152947 extends AbstractMigration { + #[\Override] public function getDescription(): string { return 'Add last execution data to cronjon execution table'; } + #[\Override] public function up(Schema $schema): void { $this->addSql('ALTER TABLE chill_main_cronjob_execution ADD lastExecutionData JSONB DEFAULT \'{}\'::jsonb NOT NULL'); } + #[\Override] public function down(Schema $schema): void { $this->addSql('ALTER TABLE chill_main_cronjob_execution DROP COLUMN lastExecutionData'); diff --git a/src/Bundle/ChillMainBundle/migrations/Version20230906134410.php b/src/Bundle/ChillMainBundle/migrations/Version20230906134410.php index 6a4888801..3947f40ad 100644 --- a/src/Bundle/ChillMainBundle/migrations/Version20230906134410.php +++ b/src/Bundle/ChillMainBundle/migrations/Version20230906134410.php @@ -19,16 +19,19 @@ use Doctrine\Migrations\AbstractMigration; */ final class Version20230906134410 extends AbstractMigration { + #[\Override] public function getDescription(): string { return 'Add the isActive property to the Center entity'; } + #[\Override] public function up(Schema $schema): void { $this->addSql('ALTER TABLE centers ADD isActive BOOLEAN DEFAULT true NOT NULL'); } + #[\Override] public function down(Schema $schema): void { $this->addSql('ALTER TABLE centers DROP isActive'); diff --git a/src/Bundle/ChillMainBundle/migrations/Version20230913114115.php b/src/Bundle/ChillMainBundle/migrations/Version20230913114115.php index fa7b0458a..0cd05855b 100644 --- a/src/Bundle/ChillMainBundle/migrations/Version20230913114115.php +++ b/src/Bundle/ChillMainBundle/migrations/Version20230913114115.php @@ -16,6 +16,7 @@ use Doctrine\Migrations\AbstractMigration; final class Version20230913114115 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { // drop job_history @@ -43,11 +44,13 @@ final class Version20230913114115 extends AbstractMigration $this->addSql('CREATE INDEX idx_1483a5e9115e73f3 ON users (mainscope_id)'); } + #[\Override] public function getDescription(): string { return 'Add new entities UserScopeHistory and UserJobHistory'; } + #[\Override] public function up(Schema $schema): void { // create scope_history diff --git a/src/Bundle/ChillMainBundle/migrations/Version20231020075524.php b/src/Bundle/ChillMainBundle/migrations/Version20231020075524.php index 5ae44d9bd..bb7524402 100644 --- a/src/Bundle/ChillMainBundle/migrations/Version20231020075524.php +++ b/src/Bundle/ChillMainBundle/migrations/Version20231020075524.php @@ -19,17 +19,20 @@ use Doctrine\Migrations\AbstractMigration; */ final class Version20231020075524 extends AbstractMigration { + #[\Override] public function getDescription(): string { return 'Add phonenumber to user profile'; } + #[\Override] public function up(Schema $schema): void { $this->addSql('ALTER TABLE users ADD phonenumber VARCHAR(35) DEFAULT NULL'); $this->addSql('COMMENT ON COLUMN users.phonenumber IS \'(DC2Type:phone_number)\''); } + #[\Override] public function down(Schema $schema): void { $this->addSql('ALTER TABLE users DROP phonenumber'); diff --git a/src/Bundle/ChillMainBundle/migrations/Version20231108141141.php b/src/Bundle/ChillMainBundle/migrations/Version20231108141141.php index d4fe9b561..0fc1ab6c9 100644 --- a/src/Bundle/ChillMainBundle/migrations/Version20231108141141.php +++ b/src/Bundle/ChillMainBundle/migrations/Version20231108141141.php @@ -19,11 +19,13 @@ use Doctrine\Migrations\AbstractMigration; */ final class Version20231108141141 extends AbstractMigration { + #[\Override] public function getDescription(): string { return 'Create dashboard config item and news item'; } + #[\Override] public function up(Schema $schema): void { $this->addSql('CREATE SEQUENCE chill_main_dashboard_config_item_id_seq INCREMENT BY 1 MINVALUE 1 START 1'); @@ -42,6 +44,7 @@ final class Version20231108141141 extends AbstractMigration $this->addSql('ALTER TABLE chill_main_news ADD CONSTRAINT FK_96922AFB65FF1AEC FOREIGN KEY (updatedBy_id) REFERENCES users (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); } + #[\Override] public function down(Schema $schema): void { $this->addSql('DROP SEQUENCE chill_main_dashboard_config_item_id_seq CASCADE'); diff --git a/src/Bundle/ChillPersonBundle/AccompanyingPeriod/Events/PersonAddressMoveEventSubscriber.php b/src/Bundle/ChillPersonBundle/AccompanyingPeriod/Events/PersonAddressMoveEventSubscriber.php index 64d2b8f12..641225e6f 100644 --- a/src/Bundle/ChillPersonBundle/AccompanyingPeriod/Events/PersonAddressMoveEventSubscriber.php +++ b/src/Bundle/ChillPersonBundle/AccompanyingPeriod/Events/PersonAddressMoveEventSubscriber.php @@ -24,6 +24,7 @@ class PersonAddressMoveEventSubscriber implements EventSubscriberInterface { public function __construct(private readonly \Twig\Environment $engine, private readonly NotificationPersisterInterface $notificationPersister, private readonly Security $security, private readonly TranslatorInterface $translator) {} + #[\Override] public static function getSubscribedEvents(): array { return [ diff --git a/src/Bundle/ChillPersonBundle/AccompanyingPeriod/Events/UserRefEventSubscriber.php b/src/Bundle/ChillPersonBundle/AccompanyingPeriod/Events/UserRefEventSubscriber.php index 084fe8ff5..3b5afd26a 100644 --- a/src/Bundle/ChillPersonBundle/AccompanyingPeriod/Events/UserRefEventSubscriber.php +++ b/src/Bundle/ChillPersonBundle/AccompanyingPeriod/Events/UserRefEventSubscriber.php @@ -25,6 +25,7 @@ class UserRefEventSubscriber implements EventSubscriberInterface { public function __construct(private readonly Security $security, private readonly TranslatorInterface $translator, private readonly \Twig\Environment $engine, private readonly NotificationPersisterInterface $notificationPersister) {} + #[\Override] public static function getSubscribedEvents() { return [ diff --git a/src/Bundle/ChillPersonBundle/AccompanyingPeriod/Lifecycle/AccompanyingPeriodStepChangeCronjob.php b/src/Bundle/ChillPersonBundle/AccompanyingPeriod/Lifecycle/AccompanyingPeriodStepChangeCronjob.php index 27553444b..f5a504043 100644 --- a/src/Bundle/ChillPersonBundle/AccompanyingPeriod/Lifecycle/AccompanyingPeriodStepChangeCronjob.php +++ b/src/Bundle/ChillPersonBundle/AccompanyingPeriod/Lifecycle/AccompanyingPeriodStepChangeCronjob.php @@ -22,6 +22,7 @@ readonly class AccompanyingPeriodStepChangeCronjob implements CronJobInterface private AccompanyingPeriodStepChangeRequestor $requestor, ) {} + #[\Override] public function canRun(?CronJobExecution $cronJobExecution): bool { $now = $this->clock->now(); @@ -33,11 +34,13 @@ readonly class AccompanyingPeriodStepChangeCronjob implements CronJobInterface return in_array((int) $now->format('H'), [1, 2, 3, 4, 5, 6], true); } + #[\Override] public function getKey(): string { return 'accompanying-period-step-change'; } + #[\Override] public function run(array $lastExecutionData): ?array { ($this->requestor)(); diff --git a/src/Bundle/ChillPersonBundle/AccompanyingPeriod/Lifecycle/AccompanyingPeriodStepChangeMessageHandler.php b/src/Bundle/ChillPersonBundle/AccompanyingPeriod/Lifecycle/AccompanyingPeriodStepChangeMessageHandler.php index 534672efc..31e2f3c91 100644 --- a/src/Bundle/ChillPersonBundle/AccompanyingPeriod/Lifecycle/AccompanyingPeriodStepChangeMessageHandler.php +++ b/src/Bundle/ChillPersonBundle/AccompanyingPeriod/Lifecycle/AccompanyingPeriodStepChangeMessageHandler.php @@ -18,7 +18,7 @@ use Symfony\Component\Messenger\Handler\MessageHandlerInterface; #[AsMessageHandler] class AccompanyingPeriodStepChangeMessageHandler implements MessageHandlerInterface { - private const LOG_PREFIX = '[accompanying period step change message handler] '; + private const string LOG_PREFIX = '[accompanying period step change message handler] '; public function __construct( private readonly AccompanyingPeriodRepository $accompanyingPeriodRepository, diff --git a/src/Bundle/ChillPersonBundle/AccompanyingPeriod/Lifecycle/AccompanyingPeriodStepChanger.php b/src/Bundle/ChillPersonBundle/AccompanyingPeriod/Lifecycle/AccompanyingPeriodStepChanger.php index fe597a724..378d3f1fa 100644 --- a/src/Bundle/ChillPersonBundle/AccompanyingPeriod/Lifecycle/AccompanyingPeriodStepChanger.php +++ b/src/Bundle/ChillPersonBundle/AccompanyingPeriod/Lifecycle/AccompanyingPeriodStepChanger.php @@ -24,7 +24,7 @@ use Symfony\Component\Workflow\Registry; */ class AccompanyingPeriodStepChanger { - private const LOG_PREFIX = '[AccompanyingPeriodStepChanger] '; + private const string LOG_PREFIX = '[AccompanyingPeriodStepChanger] '; public function __construct( private readonly EntityManagerInterface $entityManager, diff --git a/src/Bundle/ChillPersonBundle/AccompanyingPeriod/Suggestion/ReferralsSuggestion.php b/src/Bundle/ChillPersonBundle/AccompanyingPeriod/Suggestion/ReferralsSuggestion.php index 96896451d..3bda5d758 100644 --- a/src/Bundle/ChillPersonBundle/AccompanyingPeriod/Suggestion/ReferralsSuggestion.php +++ b/src/Bundle/ChillPersonBundle/AccompanyingPeriod/Suggestion/ReferralsSuggestion.php @@ -19,6 +19,7 @@ use Chill\PersonBundle\Entity\AccompanyingPeriod; */ final class ReferralsSuggestion implements ReferralsSuggestionInterface { + #[\Override] public function countReferralSuggested(AccompanyingPeriod $period, ?array $options = []): int { return 0; @@ -27,6 +28,7 @@ final class ReferralsSuggestion implements ReferralsSuggestionInterface /** * @return array|User[] */ + #[\Override] public function findReferralSuggested(AccompanyingPeriod $period, int $limit = 50, int $start = 0): array { return []; diff --git a/src/Bundle/ChillPersonBundle/Actions/ActionEvent.php b/src/Bundle/ChillPersonBundle/Actions/ActionEvent.php index ac3363db0..ee72d7514 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 \Symfony\Contracts\EventDispatcher\Event { - final public const DELETE = 'CHILL_PERSON.DELETE_ASSOCIATED_ENTITY'; + final public const string DELETE = 'CHILL_PERSON.DELETE_ASSOCIATED_ENTITY'; - final public const MOVE = 'CHILL_PERSON.MOVE_ASSOCIATED_ENTITY'; + final public const string MOVE = 'CHILL_PERSON.MOVE_ASSOCIATED_ENTITY'; /** * @var string[] diff --git a/src/Bundle/ChillPersonBundle/Actions/Remove/Handler/PersonMoveAccompanyingPeriodParticipationHandler.php b/src/Bundle/ChillPersonBundle/Actions/Remove/Handler/PersonMoveAccompanyingPeriodParticipationHandler.php index 3cff98292..3877ac360 100644 --- a/src/Bundle/ChillPersonBundle/Actions/Remove/Handler/PersonMoveAccompanyingPeriodParticipationHandler.php +++ b/src/Bundle/ChillPersonBundle/Actions/Remove/Handler/PersonMoveAccompanyingPeriodParticipationHandler.php @@ -17,11 +17,13 @@ use Chill\PersonBundle\Entity\Person; class PersonMoveAccompanyingPeriodParticipationHandler implements PersonMoveSqlHandlerInterface { + #[\Override] public function supports(string $className, string $field): bool { return AccompanyingPeriodParticipation::class === $className; } + #[\Override] public function getSqls(string $className, string $field, Person $from, Person $to): array { $insertSql = sprintf(<<<'SQL' diff --git a/src/Bundle/ChillPersonBundle/Actions/Remove/Handler/PersonMoveCenterHistoryHandler.php b/src/Bundle/ChillPersonBundle/Actions/Remove/Handler/PersonMoveCenterHistoryHandler.php index f08bd7dff..a0978d8cb 100644 --- a/src/Bundle/ChillPersonBundle/Actions/Remove/Handler/PersonMoveCenterHistoryHandler.php +++ b/src/Bundle/ChillPersonBundle/Actions/Remove/Handler/PersonMoveCenterHistoryHandler.php @@ -21,11 +21,13 @@ class PersonMoveCenterHistoryHandler implements PersonMoveSqlHandlerInterface private readonly PersonCenterHistoryRepository $centerHistoryRepository, ) {} + #[\Override] public function supports(string $className, string $field): bool { return Person\PersonCenterHistory::class === $className; } + #[\Override] public function getSqls(string $className, string $field, Person $from, Person $to): array { $sqlStatements = []; diff --git a/src/Bundle/ChillPersonBundle/Actions/Remove/Handler/PersonMoveHouseholdHandler.php b/src/Bundle/ChillPersonBundle/Actions/Remove/Handler/PersonMoveHouseholdHandler.php index 2fc5ca440..368640a9e 100644 --- a/src/Bundle/ChillPersonBundle/Actions/Remove/Handler/PersonMoveHouseholdHandler.php +++ b/src/Bundle/ChillPersonBundle/Actions/Remove/Handler/PersonMoveHouseholdHandler.php @@ -17,11 +17,13 @@ use Chill\PersonBundle\Entity\Person; class PersonMoveHouseholdHandler implements PersonMoveSqlHandlerInterface { + #[\Override] public function supports(string $className, string $field): bool { return HouseholdMember::class === $className; } + #[\Override] public function getSqls(string $className, string $field, Person $from, Person $to): array { $sqlInsert = sprintf(<<<'SQL' diff --git a/src/Bundle/ChillPersonBundle/Actions/Remove/Handler/PersonMoveRelationHandler.php b/src/Bundle/ChillPersonBundle/Actions/Remove/Handler/PersonMoveRelationHandler.php index 3d64515d3..0171e6019 100644 --- a/src/Bundle/ChillPersonBundle/Actions/Remove/Handler/PersonMoveRelationHandler.php +++ b/src/Bundle/ChillPersonBundle/Actions/Remove/Handler/PersonMoveRelationHandler.php @@ -17,11 +17,13 @@ use Chill\PersonBundle\Entity\Relationships\Relationship; class PersonMoveRelationHandler implements PersonMoveSqlHandlerInterface { + #[\Override] public function supports(string $className, string $field): bool { return Relationship::class === $className; } + #[\Override] public function getSqls(string $className, string $field, Person $from, Person $to): array { /* Insert sql statement taking into account two cases. diff --git a/src/Bundle/ChillPersonBundle/CRUD/Controller/EntityPersonCRUDController.php b/src/Bundle/ChillPersonBundle/CRUD/Controller/EntityPersonCRUDController.php index 74f2d44fa..bd47767d9 100644 --- a/src/Bundle/ChillPersonBundle/CRUD/Controller/EntityPersonCRUDController.php +++ b/src/Bundle/ChillPersonBundle/CRUD/Controller/EntityPersonCRUDController.php @@ -25,6 +25,7 @@ class EntityPersonCRUDController extends CRUDController { public function __construct(protected readonly \Doctrine\Persistence\ManagerRegistry $managerRegistry) {} + #[\Override] protected function generateTemplateParameter(string $action, mixed $entity, Request $request, array $defaultTemplateParameters = []) { $templateParameters = parent::generateTemplateParameter($action, $entity, $request, $defaultTemplateParameters); @@ -39,6 +40,7 @@ class EntityPersonCRUDController extends CRUDController * * @return QueryBuilder */ + #[\Override] protected function buildQueryEntities(string $action, Request $request) { $qb = parent::buildQueryEntities($action, $request); @@ -49,6 +51,7 @@ class EntityPersonCRUDController extends CRUDController /** * @param \Chill\MainBundle\CRUD\Controller\string|string $action */ + #[\Override] protected function createEntity($action, Request $request): object { $entity = parent::createEntity($action, $request); @@ -110,6 +113,7 @@ class EntityPersonCRUDController extends CRUDController * * @return string */ + #[\Override] protected function getTemplateFor($action, $entity, Request $request) { if ($this->hasCustomTemplate($action, $entity, $request)) { @@ -126,6 +130,7 @@ class EntityPersonCRUDController extends CRUDController }; } + #[\Override] protected function onBeforeRedirectAfterSubmission(string $action, $entity, \Symfony\Component\Form\FormInterface $form, Request $request): ?Response { $next = $request->request->get('submit', 'save-and-close'); diff --git a/src/Bundle/ChillPersonBundle/CRUD/Controller/OneToOneEntityPersonCRUDController.php b/src/Bundle/ChillPersonBundle/CRUD/Controller/OneToOneEntityPersonCRUDController.php index 55b788cc2..953144749 100644 --- a/src/Bundle/ChillPersonBundle/CRUD/Controller/OneToOneEntityPersonCRUDController.php +++ b/src/Bundle/ChillPersonBundle/CRUD/Controller/OneToOneEntityPersonCRUDController.php @@ -27,6 +27,7 @@ class OneToOneEntityPersonCRUDController extends CRUDController throw new \BadMethodCallException('Not implemented yet.'); } + #[\Override] protected function getEntity($action, $id, Request $request): ?object { $entity = parent::getEntity($action, $id, $request); @@ -44,6 +45,7 @@ class OneToOneEntityPersonCRUDController extends CRUDController return $entity; } + #[\Override] protected function getTemplateFor($action, $entity, Request $request) { if (!empty($this->crudConfig[$action]['template'])) { @@ -58,6 +60,7 @@ class OneToOneEntityPersonCRUDController extends CRUDController }; } + #[\Override] protected function onPostFetchEntity($action, Request $request, $entity): ?Response { if (false === $this->managerRegistry->getManager()->contains($entity)) { @@ -67,6 +70,7 @@ class OneToOneEntityPersonCRUDController extends CRUDController return null; } + #[\Override] protected function onPreFlush(string $action, $entity, FormInterface $form, Request $request) { $this->managerRegistry->getManager()->persist($entity); diff --git a/src/Bundle/ChillPersonBundle/ChillPersonBundle.php b/src/Bundle/ChillPersonBundle/ChillPersonBundle.php index 89477a47b..7ee3d10af 100644 --- a/src/Bundle/ChillPersonBundle/ChillPersonBundle.php +++ b/src/Bundle/ChillPersonBundle/ChillPersonBundle.php @@ -21,6 +21,7 @@ use Symfony\Component\HttpKernel\Bundle\Bundle; class ChillPersonBundle extends Bundle { + #[\Override] public function build(ContainerBuilder $container) { parent::build($container); diff --git a/src/Bundle/ChillPersonBundle/Command/ChillPersonMoveCommand.php b/src/Bundle/ChillPersonBundle/Command/ChillPersonMoveCommand.php index 6472a48f5..b6d51046a 100644 --- a/src/Bundle/ChillPersonBundle/Command/ChillPersonMoveCommand.php +++ b/src/Bundle/ChillPersonBundle/Command/ChillPersonMoveCommand.php @@ -51,6 +51,7 @@ final class ChillPersonMoveCommand extends Command return $ctxt; } + #[\Override] protected function configure() { $this @@ -62,6 +63,7 @@ final class ChillPersonMoveCommand extends Command ->addOption('delete-entity', null, InputOption::VALUE_REQUIRED | InputOption::VALUE_IS_ARRAY, 'entity to delete', []); } + #[\Override] protected function execute(InputInterface $input, OutputInterface $output): int { $repository = $this->em->getRepository(Person::class); @@ -103,6 +105,7 @@ final class ChillPersonMoveCommand extends Command return Command::SUCCESS; } + #[\Override] protected function interact(InputInterface $input, OutputInterface $output) { if (false === $input->hasOption('dump-sql') && false === $input->hasOption('force')) { diff --git a/src/Bundle/ChillPersonBundle/Command/ImportSocialWorkMetadata.php b/src/Bundle/ChillPersonBundle/Command/ImportSocialWorkMetadata.php index 6aab04389..fe02fa40c 100644 --- a/src/Bundle/ChillPersonBundle/Command/ImportSocialWorkMetadata.php +++ b/src/Bundle/ChillPersonBundle/Command/ImportSocialWorkMetadata.php @@ -29,6 +29,7 @@ final class ImportSocialWorkMetadata extends Command parent::__construct('chill:person:import-socialwork'); } + #[\Override] protected function configure() { $description = 'Imports a structured table containing social issues, social actions, objectives, results and evaluations.'; @@ -44,6 +45,7 @@ final class ImportSocialWorkMetadata extends Command ->setHelp($help); } + #[\Override] protected function execute(InputInterface $input, OutputInterface $output): int { $filepath = $input->getOption('filepath'); diff --git a/src/Bundle/ChillPersonBundle/Command/RemoveOldDraftAccompanyingPeriodCommand.php b/src/Bundle/ChillPersonBundle/Command/RemoveOldDraftAccompanyingPeriodCommand.php index 43a74a5e1..84b176ec7 100644 --- a/src/Bundle/ChillPersonBundle/Command/RemoveOldDraftAccompanyingPeriodCommand.php +++ b/src/Bundle/ChillPersonBundle/Command/RemoveOldDraftAccompanyingPeriodCommand.php @@ -27,12 +27,14 @@ class RemoveOldDraftAccompanyingPeriodCommand extends Command parent::__construct('chill:person:remove-old-draft-period'); } + #[\Override] protected function configure(): void { $this ->addArgument('interval', InputArgument::OPTIONAL, 'The interval for unactive periods', 'P15D'); } + #[\Override] protected function execute(InputInterface $input, OutputInterface $output): int { $this->logger->info('['.$this->getName().'] started', [ diff --git a/src/Bundle/ChillPersonBundle/Controller/AccompanyingCourseApiController.php b/src/Bundle/ChillPersonBundle/Controller/AccompanyingCourseApiController.php index 262a4a03d..a0b37ca2d 100644 --- a/src/Bundle/ChillPersonBundle/Controller/AccompanyingCourseApiController.php +++ b/src/Bundle/ChillPersonBundle/Controller/AccompanyingCourseApiController.php @@ -319,6 +319,7 @@ final class AccompanyingCourseApiController extends ApiController ); } + #[\Override] protected function onPostCheckACL(string $action, Request $request, string $_format, $entity): ?Response { $this->eventDispatcher->dispatch( @@ -332,6 +333,7 @@ final class AccompanyingCourseApiController extends ApiController return null; } + #[\Override] protected function validate(string $action, Request $request, string $_format, $entity, array $more = []): ConstraintViolationListInterface { if ('work' !== $action) { diff --git a/src/Bundle/ChillPersonBundle/Controller/AccompanyingCourseWorkApiController.php b/src/Bundle/ChillPersonBundle/Controller/AccompanyingCourseWorkApiController.php index 98467a302..16847d577 100644 --- a/src/Bundle/ChillPersonBundle/Controller/AccompanyingCourseWorkApiController.php +++ b/src/Bundle/ChillPersonBundle/Controller/AccompanyingCourseWorkApiController.php @@ -63,6 +63,7 @@ class AccompanyingCourseWorkApiController extends ApiController return $this->json($collection, 200, [], ['groups' => ['read']]); } + #[\Override] protected function getContextForSerialization(string $action, Request $request, string $_format, $entity): array { switch ($action) { diff --git a/src/Bundle/ChillPersonBundle/Controller/ClosingMotiveController.php b/src/Bundle/ChillPersonBundle/Controller/ClosingMotiveController.php index 0cea8d1f2..a8586cbfd 100644 --- a/src/Bundle/ChillPersonBundle/Controller/ClosingMotiveController.php +++ b/src/Bundle/ChillPersonBundle/Controller/ClosingMotiveController.php @@ -26,6 +26,7 @@ class ClosingMotiveController extends CRUDController /** * @param string $action */ + #[\Override] protected function createEntity($action, Request $request): object { $entity = parent::createEntity($action, $request); @@ -52,6 +53,7 @@ class ClosingMotiveController extends CRUDController * * @return \Doctrine\ORM\QueryBuilder|mixed */ + #[\Override] protected function orderQuery(string $action, $query, Request $request, PaginatorInterface $paginator) { /* @var \Doctrine\ORM\QueryBuilder $query */ diff --git a/src/Bundle/ChillPersonBundle/Controller/HouseholdCompositionTypeApiController.php b/src/Bundle/ChillPersonBundle/Controller/HouseholdCompositionTypeApiController.php index 0d792d6ac..f290b9e73 100644 --- a/src/Bundle/ChillPersonBundle/Controller/HouseholdCompositionTypeApiController.php +++ b/src/Bundle/ChillPersonBundle/Controller/HouseholdCompositionTypeApiController.php @@ -20,6 +20,7 @@ class HouseholdCompositionTypeApiController extends ApiController /** * @param QueryBuilder $query */ + #[\Override] protected function customizeQuery(string $action, Request $request, $query): void { match ($action) { diff --git a/src/Bundle/ChillPersonBundle/Controller/HouseholdCompositionTypeController.php b/src/Bundle/ChillPersonBundle/Controller/HouseholdCompositionTypeController.php index 0a37b1799..bf31e7a0c 100644 --- a/src/Bundle/ChillPersonBundle/Controller/HouseholdCompositionTypeController.php +++ b/src/Bundle/ChillPersonBundle/Controller/HouseholdCompositionTypeController.php @@ -17,6 +17,7 @@ use Symfony\Component\HttpFoundation\Request; class HouseholdCompositionTypeController extends CRUDController { + #[\Override] protected function orderQuery(string $action, $query, Request $request, PaginatorInterface $paginator) { $query->addOrderBy('e.id', 'ASC'); diff --git a/src/Bundle/ChillPersonBundle/Controller/HouseholdPositionController.php b/src/Bundle/ChillPersonBundle/Controller/HouseholdPositionController.php index 2a877056f..0f03eac96 100644 --- a/src/Bundle/ChillPersonBundle/Controller/HouseholdPositionController.php +++ b/src/Bundle/ChillPersonBundle/Controller/HouseholdPositionController.php @@ -17,6 +17,7 @@ use Symfony\Component\HttpFoundation\Request; class HouseholdPositionController extends CRUDController { + #[\Override] protected function orderQuery(string $action, $query, Request $request, PaginatorInterface $paginator) { $query->addOrderBy('e.id', 'ASC'); diff --git a/src/Bundle/ChillPersonBundle/Controller/MaritalStatusController.php b/src/Bundle/ChillPersonBundle/Controller/MaritalStatusController.php index 24e9726a1..8a88ca934 100644 --- a/src/Bundle/ChillPersonBundle/Controller/MaritalStatusController.php +++ b/src/Bundle/ChillPersonBundle/Controller/MaritalStatusController.php @@ -17,6 +17,7 @@ use Symfony\Component\HttpFoundation\Request; class MaritalStatusController extends CRUDController { + #[\Override] protected function orderQuery(string $action, $query, Request $request, PaginatorInterface $paginator) { $query->addOrderBy('e.id', 'ASC'); diff --git a/src/Bundle/ChillPersonBundle/Controller/OpeningApiController.php b/src/Bundle/ChillPersonBundle/Controller/OpeningApiController.php index 88ebd05e9..fbb8737e5 100644 --- a/src/Bundle/ChillPersonBundle/Controller/OpeningApiController.php +++ b/src/Bundle/ChillPersonBundle/Controller/OpeningApiController.php @@ -16,6 +16,7 @@ use Symfony\Component\HttpFoundation\Request; class OpeningApiController extends ApiController { + #[\Override] protected function customizeQuery(string $action, Request $request, $qb): void { $qb->where($qb->expr()->gt('e.noActiveAfter', ':now')) diff --git a/src/Bundle/ChillPersonBundle/Controller/OriginController.php b/src/Bundle/ChillPersonBundle/Controller/OriginController.php index b57fa0c02..985b54996 100644 --- a/src/Bundle/ChillPersonBundle/Controller/OriginController.php +++ b/src/Bundle/ChillPersonBundle/Controller/OriginController.php @@ -17,6 +17,7 @@ use Symfony\Component\HttpFoundation\Request; class OriginController extends CRUDController { + #[\Override] protected function orderQuery(string $action, $query, Request $request, PaginatorInterface $paginator) { $query->addOrderBy('e.id', 'ASC'); diff --git a/src/Bundle/ChillPersonBundle/Controller/PersonResourceKindController.php b/src/Bundle/ChillPersonBundle/Controller/PersonResourceKindController.php index 530c58f30..d490ae414 100644 --- a/src/Bundle/ChillPersonBundle/Controller/PersonResourceKindController.php +++ b/src/Bundle/ChillPersonBundle/Controller/PersonResourceKindController.php @@ -17,6 +17,7 @@ use Symfony\Component\HttpFoundation\Request; class PersonResourceKindController extends CRUDController { + #[\Override] protected function orderQuery(string $action, $query, Request $request, PaginatorInterface $paginator) { $query->addOrderBy('e.id', 'ASC'); diff --git a/src/Bundle/ChillPersonBundle/Controller/RelationController.php b/src/Bundle/ChillPersonBundle/Controller/RelationController.php index 7780b46c4..4cbfd3cba 100644 --- a/src/Bundle/ChillPersonBundle/Controller/RelationController.php +++ b/src/Bundle/ChillPersonBundle/Controller/RelationController.php @@ -17,6 +17,7 @@ use Symfony\Component\HttpFoundation\Request; class RelationController extends CRUDController { + #[\Override] protected function orderQuery(string $action, $query, Request $request, PaginatorInterface $paginator) { $query->addOrderBy('e.id', 'ASC'); diff --git a/src/Bundle/ChillPersonBundle/Controller/SocialIssueApiController.php b/src/Bundle/ChillPersonBundle/Controller/SocialIssueApiController.php index a866ceff7..bebfeaf5e 100644 --- a/src/Bundle/ChillPersonBundle/Controller/SocialIssueApiController.php +++ b/src/Bundle/ChillPersonBundle/Controller/SocialIssueApiController.php @@ -17,6 +17,7 @@ use Symfony\Component\HttpFoundation\Request; class SocialIssueApiController extends ApiController { + #[\Override] protected function customizeQuery(string $action, Request $request, $query): void { $query->where( @@ -28,6 +29,7 @@ class SocialIssueApiController extends ApiController $query->setParameter('now', new \DateTimeImmutable()); } + #[\Override] protected function orderQuery(string $action, $query, Request $request, PaginatorInterface $paginator, $_format) { $query->addOrderBy('e.ordering', 'ASC'); diff --git a/src/Bundle/ChillPersonBundle/Controller/SocialWork/EvaluationController.php b/src/Bundle/ChillPersonBundle/Controller/SocialWork/EvaluationController.php index 13a4aca99..fd58a4d88 100644 --- a/src/Bundle/ChillPersonBundle/Controller/SocialWork/EvaluationController.php +++ b/src/Bundle/ChillPersonBundle/Controller/SocialWork/EvaluationController.php @@ -17,6 +17,7 @@ use Symfony\Component\HttpFoundation\Request; class EvaluationController extends CRUDController { + #[\Override] protected function orderQuery(string $action, $query, Request $request, PaginatorInterface $paginator) { $query->addOrderBy('e.id', 'ASC'); diff --git a/src/Bundle/ChillPersonBundle/Controller/SocialWork/GoalController.php b/src/Bundle/ChillPersonBundle/Controller/SocialWork/GoalController.php index df57b012a..e65ca0ca4 100644 --- a/src/Bundle/ChillPersonBundle/Controller/SocialWork/GoalController.php +++ b/src/Bundle/ChillPersonBundle/Controller/SocialWork/GoalController.php @@ -17,6 +17,7 @@ use Symfony\Component\HttpFoundation\Request; class GoalController extends CRUDController { + #[\Override] protected function orderQuery(string $action, $query, Request $request, PaginatorInterface $paginator) { $query->addOrderBy('e.id', 'ASC'); diff --git a/src/Bundle/ChillPersonBundle/Controller/SocialWork/ResultController.php b/src/Bundle/ChillPersonBundle/Controller/SocialWork/ResultController.php index 274f7136e..bc98d70fa 100644 --- a/src/Bundle/ChillPersonBundle/Controller/SocialWork/ResultController.php +++ b/src/Bundle/ChillPersonBundle/Controller/SocialWork/ResultController.php @@ -17,6 +17,7 @@ use Symfony\Component\HttpFoundation\Request; class ResultController extends CRUDController { + #[\Override] protected function orderQuery(string $action, $query, Request $request, PaginatorInterface $paginator) { $query->addOrderBy('e.id', 'ASC'); diff --git a/src/Bundle/ChillPersonBundle/Controller/SocialWork/SocialActionController.php b/src/Bundle/ChillPersonBundle/Controller/SocialWork/SocialActionController.php index 69bbf7ace..67e985271 100644 --- a/src/Bundle/ChillPersonBundle/Controller/SocialWork/SocialActionController.php +++ b/src/Bundle/ChillPersonBundle/Controller/SocialWork/SocialActionController.php @@ -17,6 +17,7 @@ use Symfony\Component\HttpFoundation\Request; class SocialActionController extends CRUDController { + #[\Override] protected function orderQuery(string $action, $query, Request $request, PaginatorInterface $paginator) { $query->addOrderBy('e.ordering', 'ASC'); diff --git a/src/Bundle/ChillPersonBundle/Controller/SocialWork/SocialIssueController.php b/src/Bundle/ChillPersonBundle/Controller/SocialWork/SocialIssueController.php index 316417583..b5e3c7272 100644 --- a/src/Bundle/ChillPersonBundle/Controller/SocialWork/SocialIssueController.php +++ b/src/Bundle/ChillPersonBundle/Controller/SocialWork/SocialIssueController.php @@ -18,6 +18,7 @@ use Symfony\Component\HttpFoundation\Request; class SocialIssueController extends CRUDController { + #[\Override] protected function createFormFor(string $action, $entity, ?string $formClass = null, array $formOptions = []): FormInterface { if ('new' === $action) { @@ -31,6 +32,7 @@ class SocialIssueController extends CRUDController throw new \LogicException('action is not supported: '.$action); } + #[\Override] protected function orderQuery(string $action, $query, Request $request, PaginatorInterface $paginator) { $query->addOrderBy('e.ordering', 'ASC'); diff --git a/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadAccompanyingPeriodClosingMotive.php b/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadAccompanyingPeriodClosingMotive.php index fb836ed3a..b631dbc11 100644 --- a/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadAccompanyingPeriodClosingMotive.php +++ b/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadAccompanyingPeriodClosingMotive.php @@ -48,11 +48,13 @@ class LoadAccompanyingPeriodClosingMotive extends AbstractFixture implements Ord public static $references = []; + #[\Override] public function getOrder() { return 9500; } + #[\Override] public function load(ObjectManager $manager) { foreach (static::$closingMotives as $ref => $new) { diff --git a/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadAccompanyingPeriodNotifications.php b/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadAccompanyingPeriodNotifications.php index e298c2cc3..0ebb8d2fc 100644 --- a/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadAccompanyingPeriodNotifications.php +++ b/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadAccompanyingPeriodNotifications.php @@ -38,6 +38,7 @@ class LoadAccompanyingPeriodNotifications extends AbstractFixture implements Dep ], ]; + #[\Override] public function getDependencies() { return [ diff --git a/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadAccompanyingPeriodOrigin.php b/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadAccompanyingPeriodOrigin.php index 8eb0688bd..b22ef7ef5 100644 --- a/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadAccompanyingPeriodOrigin.php +++ b/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadAccompanyingPeriodOrigin.php @@ -21,17 +21,19 @@ use Doctrine\Persistence\ObjectManager; */ class LoadAccompanyingPeriodOrigin extends AbstractFixture implements OrderedFixtureInterface { - final public const ACCOMPANYING_PERIOD_ORIGIN = 'accompanying_period_origin'; + final public const string ACCOMPANYING_PERIOD_ORIGIN = 'accompanying_period_origin'; public static $references = []; private array $phoneCall = ['en' => 'phone call', 'fr' => 'appel téléphonique']; + #[\Override] public function getOrder() { return 9000; } + #[\Override] public function load(ObjectManager $manager) { $o = new Origin(); diff --git a/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadAccompanyingPeriodWork.php b/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadAccompanyingPeriodWork.php index 44992ebef..a775f1bdf 100644 --- a/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadAccompanyingPeriodWork.php +++ b/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadAccompanyingPeriodWork.php @@ -28,6 +28,7 @@ class LoadAccompanyingPeriodWork extends \Doctrine\Bundle\FixturesBundle\Fixture public function __construct(private readonly AccompanyingPeriodRepository $periodRepository, private readonly EvaluationRepository $evaluationRepository) {} + #[\Override] public function getDependencies() { return [ @@ -35,6 +36,7 @@ class LoadAccompanyingPeriodWork extends \Doctrine\Bundle\FixturesBundle\Fixture ]; } + #[\Override] public function load(ObjectManager $manager) { // load all the period which are confirmed diff --git a/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadCustomFields.php b/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadCustomFields.php index 2acbcbfbd..eb1d69913 100644 --- a/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadCustomFields.php +++ b/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadCustomFields.php @@ -40,11 +40,13 @@ class LoadCustomFields extends AbstractFixture implements OrderedFixtureInterfac ) {} // put your code here + #[\Override] public function getOrder() { return 10003; } + #[\Override] public function load(ObjectManager $manager) { $this->loadFields($manager); diff --git a/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadHousehold.php b/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadHousehold.php index ba2c67a08..bc7d63a83 100644 --- a/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadHousehold.php +++ b/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadHousehold.php @@ -27,7 +27,7 @@ use Nelmio\Alice\Loader\NativeLoader; class LoadHousehold extends Fixture implements DependentFixtureInterface { - private const NUMBER_OF_HOUSEHOLD = 10; + private const int NUMBER_OF_HOUSEHOLD = 10; private readonly NativeLoader $loader; @@ -38,6 +38,7 @@ class LoadHousehold extends Fixture implements DependentFixtureInterface $this->loader = new NativeLoader(); } + #[\Override] public function getDependencies() { return [ @@ -46,6 +47,7 @@ class LoadHousehold extends Fixture implements DependentFixtureInterface ]; } + #[\Override] public function load(ObjectManager $manager) { // generate two times the participation. This will lead to diff --git a/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadHouseholdCompositionType.php b/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadHouseholdCompositionType.php index c985f26d3..4ce1c6429 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 { - final public const TYPES = [ + final public const array TYPES = [ ['fr' => 'Couple avec enfant(s)'], ['fr' => 'Couple sans enfant'], ['fr' => 'Mère seule'], @@ -29,11 +29,13 @@ class LoadHouseholdCompositionType extends AbstractFixture implements FixtureGro ['fr' => 'Femme seule'], ]; + #[\Override] public static function getGroups(): array { return ['composition-type']; } + #[\Override] public function load(ObjectManager $manager) { foreach (self::TYPES as $type) { diff --git a/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadHouseholdPosition.php b/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadHouseholdPosition.php index f5c28c8c2..086ecb2ac 100644 --- a/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadHouseholdPosition.php +++ b/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadHouseholdPosition.php @@ -17,18 +17,19 @@ use Doctrine\Persistence\ObjectManager; class LoadHouseholdPosition extends Fixture { - final public const ADULT = 'position_adulte'; + final public const string ADULT = 'position_adulte'; - final public const CHILD = 'position_enfant'; + final public const string CHILD = 'position_enfant'; - final public const CHILD_OUT = 'position_enfant_hors'; + final public const string CHILD_OUT = 'position_enfant_hors'; - final public const POSITIONS_DATA = [ + final public const array 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], ]; + #[\Override] public function load(ObjectManager $manager) { foreach ( diff --git a/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadMaritalStatus.php b/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadMaritalStatus.php index ddce77d6c..5570b0aa5 100644 --- a/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadMaritalStatus.php +++ b/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadMaritalStatus.php @@ -31,11 +31,13 @@ class LoadMaritalStatus extends AbstractFixture implements OrderedFixtureInterfa ['id' => 'unknown', 'name' => ['en' => 'unknown', 'fr' => 'indéterminé']], ]; + #[\Override] public function getOrder() { return 9999; } + #[\Override] public function load(ObjectManager $manager) { echo "loading maritalStatuses... \n"; diff --git a/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadPeople.php b/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadPeople.php index e8026d04b..144976cb4 100644 --- a/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadPeople.php +++ b/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadPeople.php @@ -45,7 +45,7 @@ class LoadPeople extends AbstractFixture implements ContainerAwareInterface, Ord { use \Symfony\Component\DependencyInjection\ContainerAwareTrait; - final public const PERSON = 'person'; + final public const string PERSON = 'person'; /** * @var array|Center[] @@ -234,6 +234,7 @@ class LoadPeople extends AbstractFixture implements ContainerAwareInterface, Ord $this->loader = new NativeLoader($this->faker); } + #[\Override] public function getOrder() { return 10000; @@ -295,6 +296,7 @@ class LoadPeople extends AbstractFixture implements ContainerAwareInterface, Ord return $this->cacheMaritalStatuses[array_rand($this->cacheMaritalStatuses)]; } + #[\Override] public function load(ObjectManager $manager) { $this->loadExpectedPeople($manager); diff --git a/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadPersonACL.php b/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadPersonACL.php index 4b57dd048..397732e66 100644 --- a/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadPersonACL.php +++ b/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadPersonACL.php @@ -25,11 +25,13 @@ use Doctrine\Persistence\ObjectManager; */ class LoadPersonACL extends AbstractFixture implements OrderedFixtureInterface { + #[\Override] public function getOrder() { return 9600; } + #[\Override] public function load(ObjectManager $manager) { foreach (LoadPermissionsGroup::$refs as $permissionsGroupRef) { diff --git a/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadRelations.php b/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadRelations.php index 529918377..cf9c726ee 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 { - final public const RELATION_KEY = 'relations'; + final public const string RELATION_KEY = 'relations'; - final public const RELATIONS = [ + final public const array 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']], @@ -30,11 +30,13 @@ class LoadRelations extends Fixture implements FixtureGroupInterface ['title' => ['fr' => 'Oncle·Tante'], 'reverseTitle' => ['fr' => 'Neveu·Nièce']], ]; + #[\Override] public static function getGroups(): array { return ['person_relations']; } + #[\Override] public function load(ObjectManager $manager) { foreach (self::RELATIONS as $key => $value) { diff --git a/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadRelationships.php b/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadRelationships.php index 3efcc6386..e21697f43 100644 --- a/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadRelationships.php +++ b/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadRelationships.php @@ -26,6 +26,7 @@ class LoadRelationships extends Fixture implements DependentFixtureInterface public function __construct(private readonly EntityManagerInterface $em) {} + #[\Override] public function getDependencies(): array { return [ @@ -34,6 +35,7 @@ class LoadRelationships extends Fixture implements DependentFixtureInterface ]; } + #[\Override] public function load(ObjectManager $manager): void { /** @var array> $existing */ diff --git a/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadSocialWorkMetadata.php b/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadSocialWorkMetadata.php index dc1e7b4dd..6146611a8 100644 --- a/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadSocialWorkMetadata.php +++ b/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadSocialWorkMetadata.php @@ -21,11 +21,13 @@ class LoadSocialWorkMetadata extends Fixture implements OrderedFixtureInterface { public function __construct(private readonly SocialWorkMetadata $importer) {} + #[\Override] public function getOrder() { return 9500; } + #[\Override] public function load(ObjectManager $manager) { try { diff --git a/src/Bundle/ChillPersonBundle/DependencyInjection/ChillPersonExtension.php b/src/Bundle/ChillPersonBundle/DependencyInjection/ChillPersonExtension.php index e9e1b79b5..53bcc2a03 100644 --- a/src/Bundle/ChillPersonBundle/DependencyInjection/ChillPersonExtension.php +++ b/src/Bundle/ChillPersonBundle/DependencyInjection/ChillPersonExtension.php @@ -41,6 +41,7 @@ class ChillPersonExtension extends Extension implements PrependExtensionInterfac /** * @throws \Exception */ + #[\Override] public function load(array $configs, ContainerBuilder $container) { $configuration = new Configuration(); @@ -110,6 +111,7 @@ class ChillPersonExtension extends Extension implements PrependExtensionInterfac /** * @throws MissingBundleException */ + #[\Override] public function prepend(ContainerBuilder $container) { $this->prependRoleHierarchy($container); diff --git a/src/Bundle/ChillPersonBundle/DependencyInjection/CompilerPass/AccompanyingPeriodTimelineCompilerPass.php b/src/Bundle/ChillPersonBundle/DependencyInjection/CompilerPass/AccompanyingPeriodTimelineCompilerPass.php index c010196f8..aaf3c37ba 100644 --- a/src/Bundle/ChillPersonBundle/DependencyInjection/CompilerPass/AccompanyingPeriodTimelineCompilerPass.php +++ b/src/Bundle/ChillPersonBundle/DependencyInjection/CompilerPass/AccompanyingPeriodTimelineCompilerPass.php @@ -20,6 +20,7 @@ use Symfony\Component\DependencyInjection\ContainerBuilder; */ class AccompanyingPeriodTimelineCompilerPass implements CompilerPassInterface { + #[\Override] public function process(ContainerBuilder $container) { // remove services when accompanying period are hidden diff --git a/src/Bundle/ChillPersonBundle/DependencyInjection/Configuration.php b/src/Bundle/ChillPersonBundle/DependencyInjection/Configuration.php index 0d935e8c0..55a12280b 100644 --- a/src/Bundle/ChillPersonBundle/DependencyInjection/Configuration.php +++ b/src/Bundle/ChillPersonBundle/DependencyInjection/Configuration.php @@ -25,6 +25,7 @@ class Configuration implements ConfigurationInterface .' any birthdate is not allowed. The birthdate is expressed as ISO8601 : ' .'https://en.wikipedia.org/wiki/ISO_8601#Durations'; + #[\Override] public function getConfigTreeBuilder() { $treeBuilder = new TreeBuilder('cl_chill_person'); diff --git a/src/Bundle/ChillPersonBundle/Doctrine/DQL/AddressPart.php b/src/Bundle/ChillPersonBundle/Doctrine/DQL/AddressPart.php index 2ebc1a859..489b025f8 100644 --- a/src/Bundle/ChillPersonBundle/Doctrine/DQL/AddressPart.php +++ b/src/Bundle/ChillPersonBundle/Doctrine/DQL/AddressPart.php @@ -60,6 +60,7 @@ abstract class AddressPart extends FunctionNode */ abstract public function getPart(); + #[\Override] public function getSql(SqlWalker $sqlWalker) { return sprintf( @@ -70,6 +71,7 @@ abstract class AddressPart extends FunctionNode ); } + #[\Override] public function parse(Parser $parser) { $a = $parser->match(\Doctrine\ORM\Query\TokenType::T_IDENTIFIER); diff --git a/src/Bundle/ChillPersonBundle/Doctrine/DQL/AddressPart/AddressPartAddressId.php b/src/Bundle/ChillPersonBundle/Doctrine/DQL/AddressPart/AddressPartAddressId.php index 78a8648d9..2afa8533d 100644 --- a/src/Bundle/ChillPersonBundle/Doctrine/DQL/AddressPart/AddressPartAddressId.php +++ b/src/Bundle/ChillPersonBundle/Doctrine/DQL/AddressPart/AddressPartAddressId.php @@ -15,6 +15,7 @@ use Chill\PersonBundle\Doctrine\DQL\AddressPart; class AddressPartAddressId extends AddressPart { + #[\Override] public function getPart() { return 'address_id'; diff --git a/src/Bundle/ChillPersonBundle/Doctrine/DQL/AddressPart/AddressPartCountryCode.php b/src/Bundle/ChillPersonBundle/Doctrine/DQL/AddressPart/AddressPartCountryCode.php index 3aea11592..d2bc2e15f 100644 --- a/src/Bundle/ChillPersonBundle/Doctrine/DQL/AddressPart/AddressPartCountryCode.php +++ b/src/Bundle/ChillPersonBundle/Doctrine/DQL/AddressPart/AddressPartCountryCode.php @@ -15,6 +15,7 @@ use Chill\PersonBundle\Doctrine\DQL\AddressPart; class AddressPartCountryCode extends AddressPart { + #[\Override] public function getPart() { return 'country_code'; diff --git a/src/Bundle/ChillPersonBundle/Doctrine/DQL/AddressPart/AddressPartCountryId.php b/src/Bundle/ChillPersonBundle/Doctrine/DQL/AddressPart/AddressPartCountryId.php index 944fd7f19..05eb0fa42 100644 --- a/src/Bundle/ChillPersonBundle/Doctrine/DQL/AddressPart/AddressPartCountryId.php +++ b/src/Bundle/ChillPersonBundle/Doctrine/DQL/AddressPart/AddressPartCountryId.php @@ -15,6 +15,7 @@ use Chill\PersonBundle\Doctrine\DQL\AddressPart; class AddressPartCountryId extends AddressPart { + #[\Override] public function getPart() { return 'country_id'; diff --git a/src/Bundle/ChillPersonBundle/Doctrine/DQL/AddressPart/AddressPartCountryName.php b/src/Bundle/ChillPersonBundle/Doctrine/DQL/AddressPart/AddressPartCountryName.php index c8ebbe37a..2b24921d0 100644 --- a/src/Bundle/ChillPersonBundle/Doctrine/DQL/AddressPart/AddressPartCountryName.php +++ b/src/Bundle/ChillPersonBundle/Doctrine/DQL/AddressPart/AddressPartCountryName.php @@ -15,6 +15,7 @@ use Chill\PersonBundle\Doctrine\DQL\AddressPart; class AddressPartCountryName extends AddressPart { + #[\Override] public function getPart() { return 'country_name'; diff --git a/src/Bundle/ChillPersonBundle/Doctrine/DQL/AddressPart/AddressPartIsNoAddress.php b/src/Bundle/ChillPersonBundle/Doctrine/DQL/AddressPart/AddressPartIsNoAddress.php index 978045a59..32f2cc958 100644 --- a/src/Bundle/ChillPersonBundle/Doctrine/DQL/AddressPart/AddressPartIsNoAddress.php +++ b/src/Bundle/ChillPersonBundle/Doctrine/DQL/AddressPart/AddressPartIsNoAddress.php @@ -15,6 +15,7 @@ use Chill\PersonBundle\Doctrine\DQL\AddressPart; class AddressPartIsNoAddress extends AddressPart { + #[\Override] public function getPart() { return 'isnoaddress'; diff --git a/src/Bundle/ChillPersonBundle/Doctrine/DQL/AddressPart/AddressPartPostCodeCode.php b/src/Bundle/ChillPersonBundle/Doctrine/DQL/AddressPart/AddressPartPostCodeCode.php index 69d547054..1f6d08da2 100644 --- a/src/Bundle/ChillPersonBundle/Doctrine/DQL/AddressPart/AddressPartPostCodeCode.php +++ b/src/Bundle/ChillPersonBundle/Doctrine/DQL/AddressPart/AddressPartPostCodeCode.php @@ -15,6 +15,7 @@ use Chill\PersonBundle\Doctrine\DQL\AddressPart; class AddressPartPostCodeCode extends AddressPart { + #[\Override] public function getPart() { return 'postcode_code'; diff --git a/src/Bundle/ChillPersonBundle/Doctrine/DQL/AddressPart/AddressPartPostCodeId.php b/src/Bundle/ChillPersonBundle/Doctrine/DQL/AddressPart/AddressPartPostCodeId.php index 31f084077..21d553a31 100644 --- a/src/Bundle/ChillPersonBundle/Doctrine/DQL/AddressPart/AddressPartPostCodeId.php +++ b/src/Bundle/ChillPersonBundle/Doctrine/DQL/AddressPart/AddressPartPostCodeId.php @@ -15,6 +15,7 @@ use Chill\PersonBundle\Doctrine\DQL\AddressPart; class AddressPartPostCodeId extends AddressPart { + #[\Override] public function getPart() { return 'postcode_id'; diff --git a/src/Bundle/ChillPersonBundle/Doctrine/DQL/AddressPart/AddressPartPostCodeLabel.php b/src/Bundle/ChillPersonBundle/Doctrine/DQL/AddressPart/AddressPartPostCodeLabel.php index f933e8df5..a8e042485 100644 --- a/src/Bundle/ChillPersonBundle/Doctrine/DQL/AddressPart/AddressPartPostCodeLabel.php +++ b/src/Bundle/ChillPersonBundle/Doctrine/DQL/AddressPart/AddressPartPostCodeLabel.php @@ -15,6 +15,7 @@ use Chill\PersonBundle\Doctrine\DQL\AddressPart; class AddressPartPostCodeLabel extends AddressPart { + #[\Override] public function getPart() { return 'postcode_label'; diff --git a/src/Bundle/ChillPersonBundle/Doctrine/DQL/AddressPart/AddressPartStreetAddress1.php b/src/Bundle/ChillPersonBundle/Doctrine/DQL/AddressPart/AddressPartStreetAddress1.php index 3a2ba4fe1..1c6a0485b 100644 --- a/src/Bundle/ChillPersonBundle/Doctrine/DQL/AddressPart/AddressPartStreetAddress1.php +++ b/src/Bundle/ChillPersonBundle/Doctrine/DQL/AddressPart/AddressPartStreetAddress1.php @@ -15,6 +15,7 @@ use Chill\PersonBundle\Doctrine\DQL\AddressPart; class AddressPartStreetAddress1 extends AddressPart { + #[\Override] public function getPart() { return 'streetaddress1'; diff --git a/src/Bundle/ChillPersonBundle/Doctrine/DQL/AddressPart/AddressPartStreetAddress2.php b/src/Bundle/ChillPersonBundle/Doctrine/DQL/AddressPart/AddressPartStreetAddress2.php index aa2baae21..4720636a8 100644 --- a/src/Bundle/ChillPersonBundle/Doctrine/DQL/AddressPart/AddressPartStreetAddress2.php +++ b/src/Bundle/ChillPersonBundle/Doctrine/DQL/AddressPart/AddressPartStreetAddress2.php @@ -15,6 +15,7 @@ use Chill\PersonBundle\Doctrine\DQL\AddressPart; class AddressPartStreetAddress2 extends AddressPart { + #[\Override] public function getPart() { return 'streetaddress2'; diff --git a/src/Bundle/ChillPersonBundle/Doctrine/DQL/AddressPart/AddressPartValidFrom.php b/src/Bundle/ChillPersonBundle/Doctrine/DQL/AddressPart/AddressPartValidFrom.php index 6618a6b74..5cd8fe2f1 100644 --- a/src/Bundle/ChillPersonBundle/Doctrine/DQL/AddressPart/AddressPartValidFrom.php +++ b/src/Bundle/ChillPersonBundle/Doctrine/DQL/AddressPart/AddressPartValidFrom.php @@ -15,6 +15,7 @@ use Chill\PersonBundle\Doctrine\DQL\AddressPart; class AddressPartValidFrom extends AddressPart { + #[\Override] public function getPart() { return 'validfrom'; diff --git a/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod.php b/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod.php index 21cdaaf37..909fc72de 100644 --- a/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod.php +++ b/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod.php @@ -68,21 +68,21 @@ class AccompanyingPeriod implements TrackCreationInterface, TrackUpdateInterface { - final public const INTENSITIES = [self::INTENSITY_OCCASIONAL, self::INTENSITY_REGULAR]; + final public const array INTENSITIES = [self::INTENSITY_OCCASIONAL, self::INTENSITY_REGULAR]; /** * Mark an accompanying period as "occasional". * * used in INTENSITY */ - final public const INTENSITY_OCCASIONAL = 'occasional'; + final public const string INTENSITY_OCCASIONAL = 'occasional'; /** * Mark an accompanying period as "regular". * * used in INTENSITY */ - final public const INTENSITY_REGULAR = 'regular'; + final public const string INTENSITY_REGULAR = 'regular'; /** * Mark an accompanying period as "closed". @@ -90,7 +90,7 @@ class AccompanyingPeriod implements * This means that the accompanying period **is** * closed by the creator */ - final public const STEP_CLOSED = 'CLOSED'; + final public const string STEP_CLOSED = 'CLOSED'; /** * Mark an accompanying period as "confirmed". @@ -98,7 +98,7 @@ class AccompanyingPeriod implements * This means that the accompanying period **is** * confirmed by the creator */ - final public const STEP_CONFIRMED = 'CONFIRMED'; + final public const string STEP_CONFIRMED = 'CONFIRMED'; /** * Mark an accompanying period as confirmed, but inactive. @@ -107,7 +107,7 @@ class AccompanyingPeriod implements * confirmed, but no activity (Activity, AccompanyingPeriod, ...) * has been associated, or updated, within this accompanying period. */ - final public const STEP_CONFIRMED_INACTIVE_SHORT = 'CONFIRMED_INACTIVE_SHORT'; + final public const string STEP_CONFIRMED_INACTIVE_SHORT = 'CONFIRMED_INACTIVE_SHORT'; /** * Mark an accompanying period as confirmed, but inactive. @@ -116,7 +116,7 @@ class AccompanyingPeriod implements * confirmed, but no activity (Activity, AccompanyingPeriod, ...) * has been associated, or updated, within this accompanying period. */ - final public const STEP_CONFIRMED_INACTIVE_LONG = 'CONFIRMED_INACTIVE_LONG'; + final public const string STEP_CONFIRMED_INACTIVE_LONG = 'CONFIRMED_INACTIVE_LONG'; /** * Mark an accompanying period as "draft". @@ -124,7 +124,7 @@ class AccompanyingPeriod implements * This means that the accompanying period is not yet * confirmed by the creator */ - final public const STEP_DRAFT = 'DRAFT'; + final public const string STEP_DRAFT = 'DRAFT'; #[ORM\ManyToOne(targetEntity: Address::class)] private ?Address $addressLocation = null; @@ -562,6 +562,7 @@ class AccompanyingPeriod implements return $this->getPersons()->first()->getCenter(); } + #[\Override] public function getCenters(): ?iterable { $centers = []; @@ -623,6 +624,7 @@ class AccompanyingPeriod implements return $this->getOpenParticipations(); } + #[\Override] public function getGroupSequence() { if (self::STEP_DRAFT === $this->getStep()) { @@ -905,6 +907,7 @@ class AccompanyingPeriod implements /** * @return Collection|iterable */ + #[\Override] public function getScopes(): Collection { return $this->scopes; @@ -1146,6 +1149,7 @@ class AccompanyingPeriod implements return $this; } + #[\Override] public function setCreatedAt(\DateTimeInterface $datetime): self { $this->createdAt = $datetime; @@ -1153,6 +1157,7 @@ class AccompanyingPeriod implements return $this; } + #[\Override] public function setCreatedBy(User $createdBy): self { $this->createdBy = $createdBy; @@ -1300,6 +1305,7 @@ class AccompanyingPeriod implements return $this; } + #[\Override] public function setUpdatedAt(\DateTimeInterface $datetime): self { $this->updatedAt = $datetime; @@ -1307,6 +1313,7 @@ class AccompanyingPeriod implements return $this; } + #[\Override] public function setUpdatedBy(User $user): self { $this->updatedBy = $user; diff --git a/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/AccompanyingPeriodWork.php b/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/AccompanyingPeriodWork.php index bf708b887..d9b1e899e 100644 --- a/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/AccompanyingPeriodWork.php +++ b/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/AccompanyingPeriodWork.php @@ -218,6 +218,7 @@ class AccompanyingPeriodWork implements AccompanyingPeriodLinkedWithSocialIssues return $this; } + #[\Override] public function getAccompanyingPeriod(): ?AccompanyingPeriod { return $this->accompanyingPeriod; @@ -324,6 +325,7 @@ class AccompanyingPeriodWork implements AccompanyingPeriodLinkedWithSocialIssues return $this->socialAction; } + #[\Override] public function getSocialIssues(): Collection { return new ArrayCollection([$this->getSocialAction()->getIssue()]); @@ -420,6 +422,7 @@ class AccompanyingPeriodWork implements AccompanyingPeriodLinkedWithSocialIssues return $this; } + #[\Override] public function removeSocialIssue(SocialIssue $issue): AccompanyingPeriodLinkedWithSocialIssuesEntityInterface { $this->getSocialIssues()->removeElement($issue); @@ -452,6 +455,7 @@ class AccompanyingPeriodWork implements AccompanyingPeriodLinkedWithSocialIssues return $this; } + #[\Override] public function setCreatedAt(\DateTimeInterface $createdAt): self { $this->createdAt = $createdAt; @@ -473,6 +477,7 @@ class AccompanyingPeriodWork implements AccompanyingPeriodLinkedWithSocialIssues return $this; } + #[\Override] public function setCreatedBy(?User $user): self { $this->createdBy = $user; @@ -522,6 +527,7 @@ class AccompanyingPeriodWork implements AccompanyingPeriodLinkedWithSocialIssues return $this; } + #[\Override] public function setUpdatedAt(\DateTimeInterface $datetime): TrackUpdateInterface { $this->updatedAt = $datetime instanceof \DateTime ? \DateTimeImmutable::createFromMutable($datetime) : $datetime; @@ -529,6 +535,7 @@ class AccompanyingPeriodWork implements AccompanyingPeriodLinkedWithSocialIssues return $this; } + #[\Override] public function setUpdatedBy(User $user): TrackUpdateInterface { $this->updatedBy = $user; diff --git a/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/AccompanyingPeriodWorkEvaluation.php b/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/AccompanyingPeriodWorkEvaluation.php index c259ed495..4549f57c0 100644 --- a/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/AccompanyingPeriodWorkEvaluation.php +++ b/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/AccompanyingPeriodWorkEvaluation.php @@ -241,6 +241,7 @@ class AccompanyingPeriodWorkEvaluation implements TrackCreationInterface, TrackU /** * @param \DateTimeImmutable|null $createdAt */ + #[\Override] public function setCreatedAt(\DateTimeInterface $createdAt): self { $this->createdAt = $createdAt; @@ -248,6 +249,7 @@ class AccompanyingPeriodWorkEvaluation implements TrackCreationInterface, TrackU return $this; } + #[\Override] public function setCreatedBy(?User $createdBy): AccompanyingPeriodWorkEvaluation { $this->createdBy = $createdBy; @@ -316,6 +318,7 @@ class AccompanyingPeriodWorkEvaluation implements TrackCreationInterface, TrackU /** * @param \DateTimeImmutable|null $updatedAt */ + #[\Override] public function setUpdatedAt(\DateTimeInterface $updatedAt): self { $this->updatedAt = $updatedAt; @@ -323,6 +326,7 @@ class AccompanyingPeriodWorkEvaluation implements TrackCreationInterface, TrackU return $this; } + #[\Override] public function setUpdatedBy(?User $updatedBy): AccompanyingPeriodWorkEvaluation { $this->updatedBy = $updatedBy; diff --git a/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/Comment.php b/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/Comment.php index 4d976396d..1f1a606d8 100644 --- a/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/Comment.php +++ b/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/Comment.php @@ -113,6 +113,7 @@ class Comment implements TrackCreationInterface, TrackUpdateInterface return $this; } + #[\Override] public function setCreatedAt(\DateTimeInterface $createdAt): self { $this->createdAt = $createdAt; @@ -120,6 +121,7 @@ class Comment implements TrackCreationInterface, TrackUpdateInterface return $this; } + #[\Override] public function setCreatedBy(User $user): self { return $this->setCreator($user); @@ -137,6 +139,7 @@ class Comment implements TrackCreationInterface, TrackUpdateInterface return $this->getCreator(); } + #[\Override] public function setUpdatedAt(\DateTimeInterface $updatedAt): self { $this->updatedAt = $updatedAt; @@ -144,6 +147,7 @@ class Comment implements TrackCreationInterface, TrackUpdateInterface return $this; } + #[\Override] public function setUpdatedBy(User $updatedBy): self { $this->updatedBy = $updatedBy; diff --git a/src/Bundle/ChillPersonBundle/Entity/Household/Household.php b/src/Bundle/ChillPersonBundle/Entity/Household/Household.php index dbc1769f5..cd9e2b1fe 100644 --- a/src/Bundle/ChillPersonBundle/Entity/Household/Household.php +++ b/src/Bundle/ChillPersonBundle/Entity/Household/Household.php @@ -156,6 +156,7 @@ class Household implements HasCentersInterface return $addresses; } + #[\Override] public function getCenters(): ?iterable { $centers = []; diff --git a/src/Bundle/ChillPersonBundle/Entity/Person.php b/src/Bundle/ChillPersonBundle/Entity/Person.php index ff9e799a3..8a20349ba 100644 --- a/src/Bundle/ChillPersonBundle/Entity/Person.php +++ b/src/Bundle/ChillPersonBundle/Entity/Person.php @@ -58,18 +58,18 @@ use Symfony\Component\Validator\Context\ExecutionContextInterface; #[HouseholdMembershipSequential(groups: ['household_memberships'])] class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateInterface, \Stringable { - final public const BOTH_GENDER = 'both'; + final public const string BOTH_GENDER = 'both'; // have days in commun - final public const ERROR_ADDIND_PERIOD_AFTER_AN_OPEN_PERIOD = 2; // where there exist + final public const int ERROR_ADDIND_PERIOD_AFTER_AN_OPEN_PERIOD = 2; // where there exist - final public const ERROR_PERIODS_ARE_COLLAPSING = 1; // when two different periods + final public const int ERROR_PERIODS_ARE_COLLAPSING = 1; // when two different periods - final public const FEMALE_GENDER = 'woman'; + final public const string FEMALE_GENDER = 'woman'; - final public const MALE_GENDER = 'man'; + final public const string MALE_GENDER = 'man'; - final public const NO_INFORMATION = 'unknown'; + final public const string NO_INFORMATION = 'unknown'; /** * Accept receiving email. @@ -404,6 +404,7 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI $this->centerHistory = new ArrayCollection(); } + #[\Override] public function __toString(): string { return $this->getLabel(); @@ -793,6 +794,7 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI return $this->calendars; } + #[\Override] public function getCenter(): ?Center { if (null !== $this->centerCurrent) { @@ -1489,6 +1491,7 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI return $this; } + #[\Override] public function setCreatedAt(\DateTimeInterface $datetime): self { $this->createdAt = $datetime; @@ -1496,6 +1499,7 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI return $this; } + #[\Override] public function setCreatedBy(User $createdBy): self { $this->createdBy = $createdBy; @@ -1642,6 +1646,7 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI return $this; } + #[\Override] public function setUpdatedAt(\DateTimeInterface $datetime): self { $this->updatedAt = $datetime; @@ -1649,6 +1654,7 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI return $this; } + #[\Override] public function setUpdatedBy(User $user): self { $this->updatedBy = $user; diff --git a/src/Bundle/ChillPersonBundle/Event/Person/PersonAddressMoveEvent.php b/src/Bundle/ChillPersonBundle/Event/Person/PersonAddressMoveEvent.php index cf15018fd..53c0968c8 100644 --- a/src/Bundle/ChillPersonBundle/Event/Person/PersonAddressMoveEvent.php +++ b/src/Bundle/ChillPersonBundle/Event/Person/PersonAddressMoveEvent.php @@ -19,7 +19,7 @@ use Symfony\Contracts\EventDispatcher\Event; class PersonAddressMoveEvent extends Event { - final public const PERSON_MOVE_POST = 'chill_person.person_move_post'; + final public const string PERSON_MOVE_POST = 'chill_person.person_move_post'; private ?Address $nextAddress = null; diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/AdministrativeLocationAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/AdministrativeLocationAggregator.php index 522b2ecdd..fd3325f09 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/AdministrativeLocationAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/AdministrativeLocationAggregator.php @@ -22,11 +22,13 @@ class AdministrativeLocationAggregator implements AggregatorInterface { public function __construct(private readonly LocationRepository $locationRepository, private readonly TranslatableStringHelper $translatableStringHelper) {} + #[\Override] public function addRole(): ?string { return null; } + #[\Override] public function alterQuery(QueryBuilder $qb, $data) { if (!\in_array('acploc', $qb->getAllAliases(), true)) { @@ -37,21 +39,25 @@ class AdministrativeLocationAggregator implements AggregatorInterface $qb->addGroupBy('location_aggregator'); } + #[\Override] public function applyOn(): string { return Declarations::ACP_TYPE; } + #[\Override] public function buildForm(FormBuilderInterface $builder) { // no form } + #[\Override] public function getFormDefaultData(): array { return []; } + #[\Override] public function getLabels($key, array $values, $data) { return function ($value): string { @@ -69,11 +75,13 @@ class AdministrativeLocationAggregator implements AggregatorInterface }; } + #[\Override] public function getQueryKeys($data): array { return ['location_aggregator']; } + #[\Override] public function getTitle() { return 'Group by administrative location'; diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/ByActionNumberAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/ByActionNumberAggregator.php index 8f4797302..907ec5af4 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/ByActionNumberAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/ByActionNumberAggregator.php @@ -19,32 +19,38 @@ use Symfony\Component\Form\FormBuilderInterface; class ByActionNumberAggregator implements AggregatorInterface { + #[\Override] public function addRole(): ?string { return null; } + #[\Override] public function alterQuery(QueryBuilder $qb, $data): void { $qb->addSelect('(SELECT COUNT(acp_by_action_action.id) FROM '.AccompanyingPeriodWork::class.' acp_by_action_action WHERE acp_by_action_action.accompanyingPeriod = acp) AS acp_by_action_number_aggregator') ->addGroupBy('acp_by_action_number_aggregator'); } + #[\Override] public function applyOn(): string { return Declarations::ACP_TYPE; } + #[\Override] public function buildForm(FormBuilderInterface $builder): void { // No form needed } + #[\Override] public function getFormDefaultData(): array { return []; } + #[\Override] public function getLabels($key, array $values, $data) { return static function ($value) { @@ -60,11 +66,13 @@ class ByActionNumberAggregator implements AggregatorInterface }; } + #[\Override] public function getQueryKeys($data): array { return ['acp_by_action_number_aggregator']; } + #[\Override] public function getTitle(): string { return 'Group by number of actions'; diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/ClosingDateAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/ClosingDateAggregator.php index ab6bb6170..297b3989a 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/ClosingDateAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/ClosingDateAggregator.php @@ -24,8 +24,9 @@ use Symfony\Component\Form\FormBuilderInterface; */ final readonly class ClosingDateAggregator implements AggregatorInterface { - private const PREFIX = 'acp_closing_date_agg'; + private const string PREFIX = 'acp_closing_date_agg'; + #[\Override] public function buildForm(FormBuilderInterface $builder): void { $builder->add('frequency', ChoiceType::class, [ @@ -39,6 +40,7 @@ final readonly class ClosingDateAggregator implements AggregatorInterface ]); } + #[\Override] public function getFormDefaultData(): array { return [ @@ -46,6 +48,7 @@ final readonly class ClosingDateAggregator implements AggregatorInterface ]; } + #[\Override] public function getLabels($key, array $values, mixed $data) { return function (?string $value): string { @@ -57,21 +60,25 @@ final readonly class ClosingDateAggregator implements AggregatorInterface }; } + #[\Override] public function getQueryKeys($data) { return [self::PREFIX.'_closing_date']; } + #[\Override] public function getTitle() { return 'export.aggregator.course.by_closing_date.title'; } + #[\Override] public function addRole(): ?string { return null; } + #[\Override] public function alterQuery(QueryBuilder $qb, $data) { $p = self::PREFIX; @@ -81,6 +88,7 @@ final readonly class ClosingDateAggregator implements AggregatorInterface $qb->addOrderBy("{$p}_closing_date", 'DESC'); } + #[\Override] public function applyOn() { return Declarations::ACP_TYPE; diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/ClosingMotiveAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/ClosingMotiveAggregator.php index 259d5fb66..a2452cbec 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/ClosingMotiveAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/ClosingMotiveAggregator.php @@ -22,32 +22,38 @@ class ClosingMotiveAggregator implements AggregatorInterface { public function __construct(private readonly ClosingMotiveRepositoryInterface $motiveRepository, private readonly TranslatableStringHelper $translatableStringHelper) {} + #[\Override] public function addRole(): ?string { return null; } + #[\Override] public function alterQuery(QueryBuilder $qb, $data) { $qb->addSelect('IDENTITY(acp.closingMotive) AS closingmotive_aggregator'); $qb->addGroupBy('closingmotive_aggregator'); } + #[\Override] public function applyOn(): string { return Declarations::ACP_TYPE; } + #[\Override] public function buildForm(FormBuilderInterface $builder) { // no form } + #[\Override] public function getFormDefaultData(): array { return []; } + #[\Override] public function getLabels($key, array $values, $data) { return function ($value): string { @@ -67,11 +73,13 @@ class ClosingMotiveAggregator implements AggregatorInterface }; } + #[\Override] public function getQueryKeys($data) { return ['closingmotive_aggregator']; } + #[\Override] public function getTitle(): string { return 'Group by closing motive'; diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/ConfidentialAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/ConfidentialAggregator.php index 0e3e5f735..6e68d0f92 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/ConfidentialAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/ConfidentialAggregator.php @@ -21,32 +21,38 @@ class ConfidentialAggregator implements AggregatorInterface { public function __construct(private readonly TranslatorInterface $translator) {} + #[\Override] public function addRole(): ?string { return null; } + #[\Override] public function alterQuery(QueryBuilder $qb, $data) { $qb->addSelect('acp.confidential AS confidential_aggregator'); $qb->addGroupBy('confidential_aggregator'); } + #[\Override] public function applyOn(): string { return Declarations::ACP_TYPE; } + #[\Override] public function buildForm(FormBuilderInterface $builder) { // no form } + #[\Override] public function getFormDefaultData(): array { return []; } + #[\Override] public function getLabels($key, array $values, $data) { return function ($value): string { @@ -62,11 +68,13 @@ class ConfidentialAggregator implements AggregatorInterface }; } + #[\Override] public function getQueryKeys($data): array { return ['confidential_aggregator']; } + #[\Override] public function getTitle(): string { return 'Group by confidential'; diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/CreatorJobAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/CreatorJobAggregator.php index bc18315c1..b81618147 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/CreatorJobAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/CreatorJobAggregator.php @@ -22,18 +22,20 @@ use Symfony\Component\Form\FormBuilderInterface; class CreatorJobAggregator implements AggregatorInterface { - private const PREFIX = 'acp_agg_creator_job'; + private const string PREFIX = 'acp_agg_creator_job'; public function __construct( private readonly UserJobRepository $jobRepository, private readonly TranslatableStringHelper $translatableStringHelper ) {} + #[\Override] public function addRole(): ?string { return null; } + #[\Override] public function alterQuery(QueryBuilder $qb, $data) { $p = self::PREFIX; @@ -73,18 +75,22 @@ class CreatorJobAggregator implements AggregatorInterface ->addGroupBy("{$p}_select"); } + #[\Override] public function applyOn(): string { return Declarations::ACP_TYPE; } + #[\Override] public function buildForm(FormBuilderInterface $builder) {} + #[\Override] public function getFormDefaultData(): array { return []; } + #[\Override] public function getLabels($key, array $values, $data) { return function ($value): string { @@ -102,11 +108,13 @@ class CreatorJobAggregator implements AggregatorInterface }; } + #[\Override] public function getQueryKeys($data): array { return [self::PREFIX.'_select']; } + #[\Override] public function getTitle(): string { return 'export.aggregator.course.by_creator_job.Group by creator job'; diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/DurationAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/DurationAggregator.php index f5dc99115..4a655f7bf 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\Contracts\Translation\TranslatorInterface; final readonly class DurationAggregator implements AggregatorInterface { - private const CHOICES = [ + private const array CHOICES = [ 'month', 'week', 'day', @@ -28,11 +28,13 @@ final readonly class DurationAggregator implements AggregatorInterface public function __construct(private TranslatorInterface $translator) {} + #[\Override] public function addRole(): ?string { return null; } + #[\Override] public function alterQuery(QueryBuilder $qb, $data) { match ($data['precision']) { @@ -49,11 +51,13 @@ final readonly class DurationAggregator implements AggregatorInterface ->addOrderBy('duration_aggregator'); } + #[\Override] public function applyOn(): string { return Declarations::ACP_TYPE; } + #[\Override] public function buildForm(FormBuilderInterface $builder) { $builder->add('precision', ChoiceType::class, [ @@ -65,11 +69,13 @@ final readonly class DurationAggregator implements AggregatorInterface ]); } + #[\Override] public function getFormDefaultData(): array { return []; } + #[\Override] public function getLabels($key, array $values, $data) { return static function ($value) use ($data) { @@ -85,11 +91,13 @@ final readonly class DurationAggregator implements AggregatorInterface }; } + #[\Override] public function getQueryKeys($data): array { return ['duration_aggregator']; } + #[\Override] public function getTitle(): string { return 'Group by duration'; diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/EmergencyAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/EmergencyAggregator.php index 0217166d2..6df42315a 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/EmergencyAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/EmergencyAggregator.php @@ -21,32 +21,38 @@ class EmergencyAggregator implements AggregatorInterface { public function __construct(private readonly TranslatorInterface $translator) {} + #[\Override] public function addRole(): ?string { return null; } + #[\Override] public function alterQuery(QueryBuilder $qb, $data) { $qb->addSelect('acp.emergency AS emergency_aggregator'); $qb->addGroupBy('emergency_aggregator'); } + #[\Override] public function applyOn(): string { return Declarations::ACP_TYPE; } + #[\Override] public function buildForm(FormBuilderInterface $builder) { // no form } + #[\Override] public function getFormDefaultData(): array { return []; } + #[\Override] public function getLabels($key, array $values, $data) { return function ($value): string { @@ -62,11 +68,13 @@ class EmergencyAggregator implements AggregatorInterface }; } + #[\Override] public function getQueryKeys($data): array { return ['emergency_aggregator']; } + #[\Override] public function getTitle(): string { return 'Group by emergency'; diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/EvaluationAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/EvaluationAggregator.php index a90896ccd..b783ee8f4 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/EvaluationAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/EvaluationAggregator.php @@ -22,11 +22,13 @@ final readonly class EvaluationAggregator implements AggregatorInterface { public function __construct(private EvaluationRepository $evaluationRepository, private TranslatableStringHelper $translatableStringHelper) {} + #[\Override] public function addRole(): ?string { return null; } + #[\Override] public function alterQuery(QueryBuilder $qb, $data) { if (!\in_array('acpw', $qb->getAllAliases(), true)) { @@ -41,21 +43,25 @@ final readonly class EvaluationAggregator implements AggregatorInterface $qb->addGroupBy('evaluation_aggregator'); } + #[\Override] public function applyOn(): string { return Declarations::ACP_TYPE; } + #[\Override] public function buildForm(FormBuilderInterface $builder) { // no form } + #[\Override] public function getFormDefaultData(): array { return []; } + #[\Override] public function getLabels($key, array $values, $data) { return function ($value): string { @@ -75,11 +81,13 @@ final readonly class EvaluationAggregator implements AggregatorInterface }; } + #[\Override] public function getQueryKeys($data): array { return ['evaluation_aggregator']; } + #[\Override] public function getTitle(): string { return 'Group by evaluation'; diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/GeographicalUnitStatAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/GeographicalUnitStatAggregator.php index fde825a88..8711ee82b 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/GeographicalUnitStatAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/GeographicalUnitStatAggregator.php @@ -30,11 +30,13 @@ final readonly class GeographicalUnitStatAggregator implements AggregatorInterfa { public function __construct(private GeographicalUnitLayerRepositoryInterface $geographicalUnitLayerRepository, private TranslatableStringHelperInterface $translatableStringHelper, private RollingDateConverterInterface $rollingDateConverter) {} + #[\Override] public function addRole(): ?string { return null; } + #[\Override] public function alterQuery(QueryBuilder $qb, $data) { $qb->leftJoin('acp.locationHistories', 'acp_geog_agg_location_history'); @@ -100,11 +102,13 @@ final readonly class GeographicalUnitStatAggregator implements AggregatorInterfa ->addGroupBy('acp_geog_agg_unitrefid'); } + #[\Override] public function applyOn(): string { return Declarations::ACP_TYPE; } + #[\Override] public function buildForm(FormBuilderInterface $builder) { $builder @@ -123,11 +127,13 @@ final readonly class GeographicalUnitStatAggregator implements AggregatorInterfa ]); } + #[\Override] public function getFormDefaultData(): array { return ['date_calc' => new RollingDate(RollingDate::T_TODAY)]; } + #[\Override] public function getLabels($key, array $values, $data) { return match ($key) { @@ -157,11 +163,13 @@ final readonly class GeographicalUnitStatAggregator implements AggregatorInterfa }; } + #[\Override] public function getQueryKeys($data): array { return ['acp_geog_agg_unitname', 'acp_geog_agg_unitrefid']; } + #[\Override] public function getTitle(): string { return 'Group by geographical unit'; diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/IntensityAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/IntensityAggregator.php index de42039c1..56360f1de 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/IntensityAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/IntensityAggregator.php @@ -21,32 +21,38 @@ class IntensityAggregator implements AggregatorInterface { public function __construct(private readonly TranslatorInterface $translator) {} + #[\Override] public function addRole(): ?string { return null; } + #[\Override] public function alterQuery(QueryBuilder $qb, $data) { $qb->addSelect('acp.intensity AS intensity_aggregator'); $qb->addGroupBy('intensity_aggregator'); } + #[\Override] public function applyOn(): string { return Declarations::ACP_TYPE; } + #[\Override] public function buildForm(FormBuilderInterface $builder) { // no form } + #[\Override] public function getFormDefaultData(): array { return []; } + #[\Override] public function getLabels($key, array $values, $data) { return function ($value): string { @@ -62,11 +68,13 @@ class IntensityAggregator implements AggregatorInterface }; } + #[\Override] public function getQueryKeys($data): array { return ['intensity_aggregator']; } + #[\Override] public function getTitle(): string { return 'Group by intensity'; diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/JobWorkingOnCourseAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/JobWorkingOnCourseAggregator.php index bac34096f..39fe90ede 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/JobWorkingOnCourseAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/JobWorkingOnCourseAggregator.php @@ -23,18 +23,20 @@ use Symfony\Component\Form\FormBuilderInterface; final readonly class JobWorkingOnCourseAggregator implements AggregatorInterface { - private const PREFIX = 'acp_agg_user_job_working_on_course'; + private const string PREFIX = 'acp_agg_user_job_working_on_course'; public function __construct( private UserJobRepositoryInterface $userJobRepository, private TranslatableStringHelperInterface $translatableStringHelper, ) {} + #[\Override] public function addRole(): ?string { return null; } + #[\Override] public function alterQuery(QueryBuilder $qb, $data) { $p = self::PREFIX; @@ -67,18 +69,22 @@ final readonly class JobWorkingOnCourseAggregator implements AggregatorInterface ->addGroupBy("{$p}_select"); } + #[\Override] public function applyOn(): string { return Declarations::ACP_TYPE; } + #[\Override] public function buildForm(FormBuilderInterface $builder) {} + #[\Override] public function getFormDefaultData(): array { return []; } + #[\Override] public function getLabels($key, array $values, $data): \Closure { return function (int|string|null $jobId) { @@ -98,11 +104,13 @@ final readonly class JobWorkingOnCourseAggregator implements AggregatorInterface }; } + #[\Override] public function getQueryKeys($data): array { return [self::PREFIX.'_select']; } + #[\Override] public function getTitle(): string { return 'export.aggregator.course.by_job_working.title'; diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/OpeningDateAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/OpeningDateAggregator.php index d0d121c2a..951d2b556 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/OpeningDateAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/OpeningDateAggregator.php @@ -24,8 +24,9 @@ use Symfony\Component\Form\FormBuilderInterface; */ final readonly class OpeningDateAggregator implements AggregatorInterface { - private const PREFIX = 'acp_opening_date_agg'; + private const string PREFIX = 'acp_opening_date_agg'; + #[\Override] public function buildForm(FormBuilderInterface $builder): void { $builder->add('frequency', ChoiceType::class, [ @@ -39,6 +40,7 @@ final readonly class OpeningDateAggregator implements AggregatorInterface ]); } + #[\Override] public function getFormDefaultData(): array { return [ @@ -46,6 +48,7 @@ final readonly class OpeningDateAggregator implements AggregatorInterface ]; } + #[\Override] public function getLabels($key, array $values, mixed $data) { return function (?string $value): string { @@ -57,21 +60,25 @@ final readonly class OpeningDateAggregator implements AggregatorInterface }; } + #[\Override] public function getQueryKeys($data) { return [self::PREFIX.'_opening_date']; } + #[\Override] public function getTitle() { return 'export.aggregator.course.by_opening_date.title'; } + #[\Override] public function addRole(): ?string { return null; } + #[\Override] public function alterQuery(QueryBuilder $qb, $data) { $p = self::PREFIX; @@ -81,6 +88,7 @@ final readonly class OpeningDateAggregator implements AggregatorInterface $qb->addOrderBy("{$p}_opening_date", 'DESC'); } + #[\Override] public function applyOn() { return Declarations::ACP_TYPE; diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/OriginAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/OriginAggregator.php index e15539fb1..ae3d5073f 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/OriginAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/OriginAggregator.php @@ -31,11 +31,13 @@ final readonly class OriginAggregator implements AggregatorInterface $this->repository = $em->getRepository(Origin::class); } + #[\Override] public function addRole(): ?string { return null; } + #[\Override] public function alterQuery(QueryBuilder $qb, $data) { if (!\in_array('acporigin', $qb->getAllAliases(), true)) { @@ -46,21 +48,25 @@ final readonly class OriginAggregator implements AggregatorInterface $qb->addGroupBy('origin_aggregator'); } + #[\Override] public function applyOn(): string { return Declarations::ACP_TYPE; } + #[\Override] public function buildForm(FormBuilderInterface $builder) { // no form } + #[\Override] public function getFormDefaultData(): array { return []; } + #[\Override] public function getLabels($key, array $values, $data) { return function ($value): string { @@ -80,11 +86,13 @@ final readonly class OriginAggregator implements AggregatorInterface }; } + #[\Override] public function getQueryKeys($data): array { return ['origin_aggregator']; } + #[\Override] public function getTitle(): string { return 'Group by origin'; diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/PersonParticipatingAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/PersonParticipatingAggregator.php index 3859eded5..92d2b2c88 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/PersonParticipatingAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/PersonParticipatingAggregator.php @@ -19,22 +19,25 @@ use Symfony\Component\Form\FormBuilderInterface; final readonly class PersonParticipatingAggregator implements AggregatorInterface { - private const KEY = 'acp_person_part_agg'; + private const string KEY = 'acp_person_part_agg'; public function __construct( private LabelPersonHelper $labelPersonHelper, ) {} + #[\Override] public function buildForm(FormBuilderInterface $builder) { // nothing to do here } + #[\Override] public function getFormDefaultData(): array { return []; } + #[\Override] public function getLabels($key, array $values, mixed $data) { return match ($key) { @@ -43,21 +46,25 @@ final readonly class PersonParticipatingAggregator implements AggregatorInterfac }; } + #[\Override] public function getQueryKeys($data) { return [self::KEY]; } + #[\Override] public function getTitle() { return 'export.aggregator.course.by-user.title'; } + #[\Override] public function addRole(): ?string { return null; } + #[\Override] public function alterQuery(QueryBuilder $qb, $data) { $k = self::KEY; @@ -70,6 +77,7 @@ final readonly class PersonParticipatingAggregator implements AggregatorInterfac ->addGroupBy($k); } + #[\Override] public function applyOn() { return Declarations::ACP_TYPE; diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/ReferrerAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/ReferrerAggregator.php index 8e987a606..6caf40fd5 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/ReferrerAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/ReferrerAggregator.php @@ -24,9 +24,9 @@ use Symfony\Component\Form\FormBuilderInterface; final readonly class ReferrerAggregator implements AggregatorInterface, DataTransformerInterface { - private const A = 'acp_ref_agg_uhistory'; + private const string A = 'acp_ref_agg_uhistory'; - private const P = 'acp_ref_agg_date'; + private const string P = 'acp_ref_agg_date'; public function __construct( private UserRepository $userRepository, @@ -34,11 +34,13 @@ final readonly class ReferrerAggregator implements AggregatorInterface, DataTran private RollingDateConverterInterface $rollingDateConverter ) {} + #[\Override] public function addRole(): ?string { return null; } + #[\Override] public function alterQuery(QueryBuilder $qb, $data) { $qb @@ -61,11 +63,13 @@ final readonly class ReferrerAggregator implements AggregatorInterface, DataTran ->setParameter(':'.self::P.'_start_date', $this->rollingDateConverter->convert($data['end_date'])); } + #[\Override] public function applyOn(): string { return Declarations::ACP_TYPE; } + #[\Override] public function buildForm(FormBuilderInterface $builder) { $builder @@ -79,6 +83,7 @@ final readonly class ReferrerAggregator implements AggregatorInterface, DataTran ]); } + #[\Override] public function getFormDefaultData(): array { return [ @@ -87,6 +92,7 @@ final readonly class ReferrerAggregator implements AggregatorInterface, DataTran ]; } + #[\Override] public function transformData(?array $before): array { $default = $this->getFormDefaultData(); @@ -102,6 +108,7 @@ final readonly class ReferrerAggregator implements AggregatorInterface, DataTran return $data; } + #[\Override] public function getLabels($key, array $values, $data) { return function ($value): string { @@ -119,11 +126,13 @@ final readonly class ReferrerAggregator implements AggregatorInterface, DataTran }; } + #[\Override] public function getQueryKeys($data): array { return ['referrer_aggregator']; } + #[\Override] public function getTitle(): string { return 'Group by referrers'; diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/ReferrerScopeAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/ReferrerScopeAggregator.php index aec57c10a..2a84a8e94 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/ReferrerScopeAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/ReferrerScopeAggregator.php @@ -26,7 +26,7 @@ use Symfony\Component\Form\FormBuilderInterface; readonly class ReferrerScopeAggregator implements AggregatorInterface, DataTransformerInterface { - private const PREFIX = 'acp_agg_referrer_scope'; + private const string PREFIX = 'acp_agg_referrer_scope'; public function __construct( private ScopeRepositoryInterface $scopeRepository, @@ -34,11 +34,13 @@ readonly class ReferrerScopeAggregator implements AggregatorInterface, DataTrans private RollingDateConverterInterface $rollingDateConverter, ) {} + #[\Override] public function addRole(): ?string { return null; } + #[\Override] public function alterQuery(QueryBuilder $qb, $data) { $p = self::PREFIX; @@ -89,11 +91,13 @@ readonly class ReferrerScopeAggregator implements AggregatorInterface, DataTrans ->addGroupBy("{$p}_select"); } + #[\Override] public function applyOn(): string { return Declarations::ACP_TYPE; } + #[\Override] public function buildForm(FormBuilderInterface $builder) { $builder @@ -107,6 +111,7 @@ readonly class ReferrerScopeAggregator implements AggregatorInterface, DataTrans ]); } + #[\Override] public function getFormDefaultData(): array { return [ @@ -115,6 +120,7 @@ readonly class ReferrerScopeAggregator implements AggregatorInterface, DataTrans ]; } + #[\Override] public function transformData(?array $before): array { $default = $this->getFormDefaultData(); @@ -126,6 +132,7 @@ readonly class ReferrerScopeAggregator implements AggregatorInterface, DataTrans return $data; } + #[\Override] public function getLabels($key, array $values, $data) { return function ($value) { @@ -147,11 +154,13 @@ readonly class ReferrerScopeAggregator implements AggregatorInterface, DataTrans }; } + #[\Override] public function getQueryKeys($data): array { return [self::PREFIX.'_select']; } + #[\Override] public function getTitle(): string { return 'export.aggregator.course.by_user_scope.Group course by referrer\'s scope'; diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/RequestorAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/RequestorAggregator.php index ec168ceaf..6fed2998d 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/RequestorAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/RequestorAggregator.php @@ -21,11 +21,13 @@ final readonly class RequestorAggregator implements AggregatorInterface { public function __construct(private TranslatorInterface $translator) {} + #[\Override] public function addRole(): ?string { return null; } + #[\Override] public function alterQuery(QueryBuilder $qb, $data) { if (!\in_array('acppart', $qb->getAllAliases(), true)) { @@ -53,21 +55,25 @@ final readonly class RequestorAggregator implements AggregatorInterface $qb->addGroupBy('requestor_aggregator'); } + #[\Override] public function applyOn(): string { return Declarations::ACP_TYPE; } + #[\Override] public function buildForm(FormBuilderInterface $builder) { // no form } + #[\Override] public function getFormDefaultData(): array { return []; } + #[\Override] public function getLabels($key, array $values, $data) { return function ($value): string { @@ -79,11 +85,13 @@ final readonly class RequestorAggregator implements AggregatorInterface }; } + #[\Override] public function getQueryKeys($data): array { return ['requestor_aggregator']; } + #[\Override] public function getTitle(): string { return 'Group by requestor'; diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/ScopeAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/ScopeAggregator.php index 06dbc906d..112a4ca89 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/ScopeAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/ScopeAggregator.php @@ -22,11 +22,13 @@ final readonly class ScopeAggregator implements AggregatorInterface { public function __construct(private ScopeRepository $scopeRepository, private TranslatableStringHelper $translatableStringHelper) {} + #[\Override] public function addRole(): ?string { return null; } + #[\Override] public function alterQuery(QueryBuilder $qb, $data) { if (!\in_array('acpscope', $qb->getAllAliases(), true)) { @@ -37,21 +39,25 @@ final readonly class ScopeAggregator implements AggregatorInterface $qb->addGroupBy('scope_aggregator'); } + #[\Override] public function applyOn(): string { return Declarations::ACP_TYPE; } + #[\Override] public function buildForm(FormBuilderInterface $builder) { // no form } + #[\Override] public function getFormDefaultData(): array { return []; } + #[\Override] public function getLabels($key, array $values, $data) { return function ($value): string { @@ -73,11 +79,13 @@ final readonly class ScopeAggregator implements AggregatorInterface }; } + #[\Override] public function getQueryKeys($data): array { return ['scope_aggregator']; } + #[\Override] public function getTitle(): string { return 'export.aggregator.course.by_scope.Group course by scope'; diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/ScopeWorkingOnCourseAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/ScopeWorkingOnCourseAggregator.php index dd33603b4..3d3f62cdd 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/ScopeWorkingOnCourseAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/ScopeWorkingOnCourseAggregator.php @@ -23,18 +23,20 @@ use Symfony\Component\Form\FormBuilderInterface; final readonly class ScopeWorkingOnCourseAggregator implements AggregatorInterface { - private const PREFIX = 'acp_agg_user_scope_working_on_course'; + private const string PREFIX = 'acp_agg_user_scope_working_on_course'; public function __construct( private ScopeRepositoryInterface $scopeRepository, private TranslatableStringHelperInterface $translatableStringHelper, ) {} + #[\Override] public function addRole(): ?string { return null; } + #[\Override] public function alterQuery(QueryBuilder $qb, $data) { $p = self::PREFIX; @@ -67,18 +69,22 @@ final readonly class ScopeWorkingOnCourseAggregator implements AggregatorInterfa ->addGroupBy("{$p}_select"); } + #[\Override] public function applyOn(): string { return Declarations::ACP_TYPE; } + #[\Override] public function buildForm(FormBuilderInterface $builder) {} + #[\Override] public function getFormDefaultData(): array { return []; } + #[\Override] public function getLabels($key, array $values, $data): \Closure { return function (int|string|null $scopeId) { @@ -98,11 +104,13 @@ final readonly class ScopeWorkingOnCourseAggregator implements AggregatorInterfa }; } + #[\Override] public function getQueryKeys($data): array { return [self::PREFIX.'_select']; } + #[\Override] public function getTitle(): string { return 'export.aggregator.course.by_scope_working.title'; diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/SocialActionAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/SocialActionAggregator.php index 7abad2602..98a0b2621 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/SocialActionAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/SocialActionAggregator.php @@ -22,11 +22,13 @@ final readonly class SocialActionAggregator implements AggregatorInterface { public function __construct(private SocialActionRender $actionRender, private SocialActionRepository $actionRepository) {} + #[\Override] public function addRole(): ?string { return null; } + #[\Override] public function alterQuery(QueryBuilder $qb, $data) { if (!\in_array('acpw', $qb->getAllAliases(), true)) { @@ -38,21 +40,25 @@ final readonly class SocialActionAggregator implements AggregatorInterface $qb->addGroupBy('socialaction_aggregator'); } + #[\Override] public function applyOn(): string { return Declarations::ACP_TYPE; } + #[\Override] public function buildForm(FormBuilderInterface $builder) { // no form } + #[\Override] public function getFormDefaultData(): array { return []; } + #[\Override] public function getLabels($key, array $values, $data) { return function ($value) { @@ -72,11 +78,13 @@ final readonly class SocialActionAggregator implements AggregatorInterface }; } + #[\Override] public function getQueryKeys($data): array { return ['socialaction_aggregator']; } + #[\Override] public function getTitle(): string { return 'Group by social action'; diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/SocialIssueAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/SocialIssueAggregator.php index 8c0cbfbd5..7ac65ea83 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/SocialIssueAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/SocialIssueAggregator.php @@ -22,11 +22,13 @@ final readonly class SocialIssueAggregator implements AggregatorInterface { public function __construct(private SocialIssueRepository $issueRepository, private SocialIssueRender $issueRender) {} + #[\Override] public function addRole(): ?string { return null; } + #[\Override] public function alterQuery(QueryBuilder $qb, $data) { if (!\in_array('acpsocialissue', $qb->getAllAliases(), true)) { @@ -38,21 +40,25 @@ final readonly class SocialIssueAggregator implements AggregatorInterface $qb->addGroupBy('socialissue_aggregator'); } + #[\Override] public function applyOn(): string { return Declarations::ACP_TYPE; } + #[\Override] public function buildForm(FormBuilderInterface $builder) { // no form } + #[\Override] public function getFormDefaultData(): array { return []; } + #[\Override] public function getLabels($key, array $values, $data) { return function ($value): string { @@ -70,11 +76,13 @@ final readonly class SocialIssueAggregator implements AggregatorInterface }; } + #[\Override] public function getQueryKeys($data): array { return ['socialissue_aggregator']; } + #[\Override] public function getTitle(): string { return 'Group by social issue'; diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/StepAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/StepAggregator.php index a9439a63f..67464ab33 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/StepAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/StepAggregator.php @@ -23,17 +23,19 @@ use Symfony\Contracts\Translation\TranslatorInterface; final readonly class StepAggregator implements AggregatorInterface { - private const A = 'acpstephistories'; + private const string A = 'acpstephistories'; - private const P = 'acp_step_agg_date'; + private const string P = 'acp_step_agg_date'; public function __construct(private RollingDateConverterInterface $rollingDateConverter, private TranslatorInterface $translator) {} + #[\Override] public function addRole(): ?string { return null; } + #[\Override] public function alterQuery(QueryBuilder $qb, $data) { if (!\in_array(self::A, $qb->getAllAliases(), true)) { @@ -58,21 +60,25 @@ final readonly class StepAggregator implements AggregatorInterface ->addGroupBy('step_aggregator'); } + #[\Override] public function applyOn(): string { return Declarations::ACP_TYPE; } + #[\Override] public function buildForm(FormBuilderInterface $builder) { $builder->add('on_date', PickRollingDateType::class, []); } + #[\Override] public function getFormDefaultData(): array { return ['on_date' => new RollingDate(RollingDate::T_TODAY)]; } + #[\Override] public function getLabels($key, array $values, $data) { return function ($value): string { @@ -105,11 +111,13 @@ final readonly class StepAggregator implements AggregatorInterface }; } + #[\Override] public function getQueryKeys($data): array { return ['step_aggregator']; } + #[\Override] public function getTitle(): string { return 'Group by step'; diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/UserJobAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/UserJobAggregator.php index b5d6566e7..4ab4f12e3 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/UserJobAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/UserJobAggregator.php @@ -26,7 +26,7 @@ use Symfony\Component\Form\FormBuilderInterface; final readonly class UserJobAggregator implements AggregatorInterface, DataTransformerInterface { - private const PREFIX = 'acp_agg_user_job'; + private const string PREFIX = 'acp_agg_user_job'; public function __construct( private UserJobRepository $jobRepository, @@ -34,11 +34,13 @@ final readonly class UserJobAggregator implements AggregatorInterface, DataTrans private RollingDateConverterInterface $rollingDateConverter, ) {} + #[\Override] public function addRole(): ?string { return null; } + #[\Override] public function alterQuery(QueryBuilder $qb, $data) { $p = self::PREFIX; @@ -88,11 +90,13 @@ final readonly class UserJobAggregator implements AggregatorInterface, DataTrans ->addGroupBy("{$p}_select"); } + #[\Override] public function applyOn(): string { return Declarations::ACP_TYPE; } + #[\Override] public function buildForm(FormBuilderInterface $builder) { $builder @@ -106,6 +110,7 @@ final readonly class UserJobAggregator implements AggregatorInterface, DataTrans ]); } + #[\Override] public function getFormDefaultData(): array { return [ @@ -114,6 +119,7 @@ final readonly class UserJobAggregator implements AggregatorInterface, DataTrans ]; } + #[\Override] public function transformData(?array $before): array { $default = $this->getFormDefaultData(); @@ -125,6 +131,7 @@ final readonly class UserJobAggregator implements AggregatorInterface, DataTrans return $data; } + #[\Override] public function getLabels($key, array $values, $data) { return function ($value): string { @@ -146,11 +153,13 @@ final readonly class UserJobAggregator implements AggregatorInterface, DataTrans }; } + #[\Override] public function getQueryKeys($data): array { return [self::PREFIX.'_select']; } + #[\Override] public function getTitle(): string { return 'export.aggregator.course.by_user_job.Group by user job'; diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/UserWorkingOnCourseAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/UserWorkingOnCourseAggregator.php index 321801e28..cad80ae7d 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/UserWorkingOnCourseAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/UserWorkingOnCourseAggregator.php @@ -22,23 +22,26 @@ use Symfony\Component\Form\FormBuilderInterface; final readonly class UserWorkingOnCourseAggregator implements AggregatorInterface { - private const COLUMN_NAME = 'user_working_on_course_user_id'; + private const string COLUMN_NAME = 'user_working_on_course_user_id'; public function __construct( private UserRender $userRender, private UserRepositoryInterface $userRepository, ) {} + #[\Override] public function buildForm(FormBuilderInterface $builder) { // nothing to add here } + #[\Override] public function getFormDefaultData(): array { return []; } + #[\Override] public function getLabels($key, array $values, $data): \Closure { return function (int|string|null $userId) { @@ -58,21 +61,25 @@ final readonly class UserWorkingOnCourseAggregator implements AggregatorInterfac }; } + #[\Override] public function getQueryKeys($data) { return [self::COLUMN_NAME]; } + #[\Override] public function getTitle() { return 'export.aggregator.course.by_user_working.title'; } + #[\Override] public function addRole(): ?string { return null; } + #[\Override] public function alterQuery(QueryBuilder $qb, $data) { if (!in_array('acpinfo', $qb->getAllAliases(), true)) { @@ -92,6 +99,7 @@ final readonly class UserWorkingOnCourseAggregator implements AggregatorInterfac $qb->addGroupBy('acpinfo_user.id'); } + #[\Override] public function applyOn() { return Declarations::ACP_TYPE; diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingPeriodStepHistoryAggregators/ByClosingMotiveAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingPeriodStepHistoryAggregators/ByClosingMotiveAggregator.php index 6b6a5ce4a..84bd2f9c7 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingPeriodStepHistoryAggregators/ByClosingMotiveAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingPeriodStepHistoryAggregators/ByClosingMotiveAggregator.php @@ -20,23 +20,26 @@ use Symfony\Component\Form\FormBuilderInterface; final readonly class ByClosingMotiveAggregator implements AggregatorInterface { - private const KEY = 'acpstephistory_by_closing_motive_agg'; + private const string KEY = 'acpstephistory_by_closing_motive_agg'; public function __construct( private ClosingMotiveRepositoryInterface $closingMotiveRepository, private ClosingMotiveRender $closingMotiveRender, ) {} + #[\Override] public function buildForm(FormBuilderInterface $builder) { // nothing to add here } + #[\Override] public function getFormDefaultData(): array { return []; } + #[\Override] public function getLabels($key, array $values, mixed $data) { return function (int|string|null $value): string { @@ -52,6 +55,7 @@ final readonly class ByClosingMotiveAggregator implements AggregatorInterface }; } + #[\Override] public function getQueryKeys($data) { return [ @@ -59,16 +63,19 @@ final readonly class ByClosingMotiveAggregator implements AggregatorInterface ]; } + #[\Override] public function getTitle() { return 'export.aggregator.step_history.by_closing_motive.title'; } + #[\Override] public function addRole(): ?string { return null; } + #[\Override] public function alterQuery(QueryBuilder $qb, $data) { $qb @@ -76,6 +83,7 @@ final readonly class ByClosingMotiveAggregator implements AggregatorInterface ->addGroupBy(self::KEY); } + #[\Override] public function applyOn() { return Declarations::ACP_STEP_HISTORY; diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingPeriodStepHistoryAggregators/ByDateAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingPeriodStepHistoryAggregators/ByDateAggregator.php index fbd80c7a5..f6128b06b 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingPeriodStepHistoryAggregators/ByDateAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingPeriodStepHistoryAggregators/ByDateAggregator.php @@ -24,8 +24,9 @@ use Symfony\Component\Form\FormBuilderInterface; */ final readonly class ByDateAggregator implements AggregatorInterface { - private const KEY = 'acpstephistory_by_date_agg'; + private const string KEY = 'acpstephistory_by_date_agg'; + #[\Override] public function buildForm(FormBuilderInterface $builder) { $builder->add('frequency', ChoiceType::class, [ @@ -39,11 +40,13 @@ final readonly class ByDateAggregator implements AggregatorInterface ]); } + #[\Override] public function getFormDefaultData(): array { return ['frequency' => DateGroupingChoiceEnum::YEAR->value]; } + #[\Override] public function getLabels($key, array $values, mixed $data) { return function (?string $value): string { @@ -59,21 +62,25 @@ final readonly class ByDateAggregator implements AggregatorInterface }; } + #[\Override] public function getQueryKeys($data) { return [self::KEY]; } + #[\Override] public function getTitle() { return 'export.aggregator.step_history.by_date.title'; } + #[\Override] public function addRole(): ?string { return null; } + #[\Override] public function alterQuery(QueryBuilder $qb, $data) { $p = self::KEY; @@ -83,6 +90,7 @@ final readonly class ByDateAggregator implements AggregatorInterface $qb->addOrderBy($p, 'DESC'); } + #[\Override] public function applyOn() { return Declarations::ACP_STEP_HISTORY; diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingPeriodStepHistoryAggregators/ByStepAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingPeriodStepHistoryAggregators/ByStepAggregator.php index e2494526a..d721955a8 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingPeriodStepHistoryAggregators/ByStepAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingPeriodStepHistoryAggregators/ByStepAggregator.php @@ -23,22 +23,25 @@ use Symfony\Contracts\Translation\TranslatorInterface; */ final readonly class ByStepAggregator implements AggregatorInterface { - private const KEY = 'acpstephistory_step_agg'; + private const string KEY = 'acpstephistory_step_agg'; public function __construct( private TranslatorInterface $translator ) {} + #[\Override] public function buildForm(FormBuilderInterface $builder) { // nothing in this form } + #[\Override] public function getFormDefaultData(): array { return []; } + #[\Override] public function getLabels($key, array $values, mixed $data) { return function (?string $step): string { @@ -54,6 +57,7 @@ final readonly class ByStepAggregator implements AggregatorInterface }; } + #[\Override] public function getQueryKeys($data) { return [ @@ -61,16 +65,19 @@ final readonly class ByStepAggregator implements AggregatorInterface ]; } + #[\Override] public function getTitle() { return 'export.aggregator.step_history.by_step.title'; } + #[\Override] public function addRole(): ?string { return null; } + #[\Override] public function alterQuery(QueryBuilder $qb, $data) { $qb @@ -78,6 +85,7 @@ final readonly class ByStepAggregator implements AggregatorInterface ->addGroupBy(self::KEY); } + #[\Override] public function applyOn() { return Declarations::ACP_STEP_HISTORY; diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/EvaluationAggregators/ByEndDateAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/EvaluationAggregators/ByEndDateAggregator.php index 07c182421..6f52fe8d0 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/EvaluationAggregators/ByEndDateAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/EvaluationAggregators/ByEndDateAggregator.php @@ -19,19 +19,21 @@ use Symfony\Component\Form\FormBuilderInterface; final class ByEndDateAggregator implements AggregatorInterface { - private const CHOICES = [ + private const array CHOICES = [ 'by week' => 'week', 'by month' => 'month', 'by year' => 'year', ]; - private const DEFAULT_CHOICE = 'year'; + private const string DEFAULT_CHOICE = 'year'; + #[\Override] public function addRole(): ?string { return null; } + #[\Override] public function alterQuery(QueryBuilder $qb, $data) { $fmt = match ($data['frequency']) { @@ -46,11 +48,13 @@ final class ByEndDateAggregator implements AggregatorInterface $qb->addOrderBy(' eval_by_end_date_aggregator', 'ASC'); } + #[\Override] public function applyOn(): string { return Declarations::EVAL_TYPE; } + #[\Override] public function buildForm(FormBuilderInterface $builder) { $builder->add('frequency', ChoiceType::class, [ @@ -61,11 +65,13 @@ final class ByEndDateAggregator implements AggregatorInterface ]); } + #[\Override] public function getFormDefaultData(): array { return ['frequency' => self::DEFAULT_CHOICE]; } + #[\Override] public function getLabels($key, array $values, $data) { return static function ($value): string { @@ -81,11 +87,13 @@ final class ByEndDateAggregator implements AggregatorInterface }; } + #[\Override] public function getQueryKeys($data): array { return ['eval_by_end_date_aggregator']; } + #[\Override] public function getTitle(): string { return 'export.aggregator.eval.by_end_date.Group by end date evaluations'; diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/EvaluationAggregators/ByMaxDateAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/EvaluationAggregators/ByMaxDateAggregator.php index 9193dc5a9..9adf0a532 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/EvaluationAggregators/ByMaxDateAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/EvaluationAggregators/ByMaxDateAggregator.php @@ -19,19 +19,21 @@ use Symfony\Component\Form\FormBuilderInterface; final class ByMaxDateAggregator implements AggregatorInterface { - private const CHOICES = [ + private const array CHOICES = [ 'by week' => 'week', 'by month' => 'month', 'by year' => 'year', ]; - private const DEFAULT_CHOICE = 'year'; + private const string DEFAULT_CHOICE = 'year'; + #[\Override] public function addRole(): ?string { return null; } + #[\Override] public function alterQuery(QueryBuilder $qb, $data) { $fmt = match ($data['frequency']) { @@ -46,11 +48,13 @@ final class ByMaxDateAggregator implements AggregatorInterface $qb->addOrderBy(' eval_by_max_date_aggregator', 'ASC'); } + #[\Override] public function applyOn(): string { return Declarations::EVAL_TYPE; } + #[\Override] public function buildForm(FormBuilderInterface $builder) { $builder->add('frequency', ChoiceType::class, [ @@ -61,11 +65,13 @@ final class ByMaxDateAggregator implements AggregatorInterface ]); } + #[\Override] public function getFormDefaultData(): array { return ['frequency' => self::DEFAULT_CHOICE]; } + #[\Override] public function getLabels($key, array $values, $data) { return static function ($value): string { @@ -81,11 +87,13 @@ final class ByMaxDateAggregator implements AggregatorInterface }; } + #[\Override] public function getQueryKeys($data): array { return ['eval_by_max_date_aggregator']; } + #[\Override] public function getTitle(): string { return 'export.aggregator.eval.by_max_date.Group by max date evaluations'; diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/EvaluationAggregators/ByStartDateAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/EvaluationAggregators/ByStartDateAggregator.php index e797d5ae7..fff2b07ff 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/EvaluationAggregators/ByStartDateAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/EvaluationAggregators/ByStartDateAggregator.php @@ -19,19 +19,21 @@ use Symfony\Component\Form\FormBuilderInterface; final class ByStartDateAggregator implements AggregatorInterface { - private const CHOICES = [ + private const array CHOICES = [ 'by week' => 'week', 'by month' => 'month', 'by year' => 'year', ]; - private const DEFAULT_CHOICE = 'year'; + private const string DEFAULT_CHOICE = 'year'; + #[\Override] public function addRole(): ?string { return null; } + #[\Override] public function alterQuery(QueryBuilder $qb, $data) { $fmt = match ($data['frequency']) { @@ -46,11 +48,13 @@ final class ByStartDateAggregator implements AggregatorInterface $qb->addOrderBy(' eval_by_start_date_aggregator', 'ASC'); } + #[\Override] public function applyOn(): string { return Declarations::EVAL_TYPE; } + #[\Override] public function buildForm(FormBuilderInterface $builder) { $builder->add('frequency', ChoiceType::class, [ @@ -61,11 +65,13 @@ final class ByStartDateAggregator implements AggregatorInterface ]); } + #[\Override] public function getFormDefaultData(): array { return ['frequency' => self::DEFAULT_CHOICE]; } + #[\Override] public function getLabels($key, array $values, $data) { return static function ($value): string { @@ -81,11 +87,13 @@ final class ByStartDateAggregator implements AggregatorInterface }; } + #[\Override] public function getQueryKeys($data): array { return ['eval_by_start_date_aggregator']; } + #[\Override] public function getTitle(): string { return 'export.aggregator.eval.by_start_date_period.Group by start date evaluations'; diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/EvaluationAggregators/EvaluationTypeAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/EvaluationAggregators/EvaluationTypeAggregator.php index 9ff2ad50a..58f9ac91c 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/EvaluationAggregators/EvaluationTypeAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/EvaluationAggregators/EvaluationTypeAggregator.php @@ -22,32 +22,38 @@ class EvaluationTypeAggregator implements AggregatorInterface { public function __construct(private readonly EvaluationRepository $evaluationRepository, private readonly TranslatableStringHelper $translatableStringHelper) {} + #[\Override] public function addRole(): ?string { return null; } + #[\Override] public function alterQuery(QueryBuilder $qb, $data) { $qb->addSelect('IDENTITY(workeval.evaluation) AS eval_evaluationtype_aggregator'); $qb->addGroupBy('eval_evaluationtype_aggregator'); } + #[\Override] public function applyOn(): string { return Declarations::EVAL_TYPE; } + #[\Override] public function buildForm(FormBuilderInterface $builder) { // no form } + #[\Override] public function getFormDefaultData(): array { return []; } + #[\Override] public function getLabels($key, array $values, $data) { return function ($value): string { @@ -65,11 +71,13 @@ class EvaluationTypeAggregator implements AggregatorInterface }; } + #[\Override] public function getQueryKeys($data): array { return ['eval_evaluationtype_aggregator']; } + #[\Override] public function getTitle(): string { return 'Group by evaluation type'; diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/EvaluationAggregators/HavingEndDateAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/EvaluationAggregators/HavingEndDateAggregator.php index 4dfddab81..f7b59eee6 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/EvaluationAggregators/HavingEndDateAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/EvaluationAggregators/HavingEndDateAggregator.php @@ -21,11 +21,13 @@ class HavingEndDateAggregator implements AggregatorInterface { public function __construct(private readonly TranslatorInterface $translator) {} + #[\Override] public function addRole(): ?string { return null; } + #[\Override] public function alterQuery(QueryBuilder $qb, $data) { $qb @@ -33,21 +35,25 @@ class HavingEndDateAggregator implements AggregatorInterface ->addGroupBy('eval_enddate_aggregator'); } + #[\Override] public function applyOn(): string { return Declarations::EVAL_TYPE; } + #[\Override] public function buildForm(FormBuilderInterface $builder) { // No form needed } + #[\Override] public function getFormDefaultData(): array { return []; } + #[\Override] public function getLabels($key, array $values, $data) { return function ($value): string { @@ -63,11 +69,13 @@ class HavingEndDateAggregator implements AggregatorInterface }; } + #[\Override] public function getQueryKeys($data): array { return ['eval_enddate_aggregator']; } + #[\Override] public function getTitle(): string { return 'export.aggregator.eval.by_end_date.Group evaluations having end date'; diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/HouseholdAggregators/ChildrenNumberAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/HouseholdAggregators/ChildrenNumberAggregator.php index e013c2f0f..02ba2a8de 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/HouseholdAggregators/ChildrenNumberAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/HouseholdAggregators/ChildrenNumberAggregator.php @@ -24,11 +24,13 @@ class ChildrenNumberAggregator implements AggregatorInterface { public function __construct(private readonly RollingDateConverterInterface $rollingDateConverter) {} + #[\Override] public function addRole(): ?string { return null; } + #[\Override] public function alterQuery(QueryBuilder $qb, $data) { if (!\in_array('composition_children', $qb->getAllAliases(), true)) { @@ -53,21 +55,25 @@ class ChildrenNumberAggregator implements AggregatorInterface ); } + #[\Override] public function applyOn(): string { return Declarations::HOUSEHOLD_TYPE; } + #[\Override] public function buildForm(FormBuilderInterface $builder) { $builder->add('on_date', PickRollingDateType::class, []); } + #[\Override] public function getFormDefaultData(): array { return ['on_date' => new RollingDate(RollingDate::T_TODAY)]; } + #[\Override] public function getLabels($key, array $values, $data) { return static function (int|string|null $value): string { @@ -83,11 +89,13 @@ class ChildrenNumberAggregator implements AggregatorInterface }; } + #[\Override] public function getQueryKeys($data): array { return ['childrennumber_aggregator']; } + #[\Override] public function getTitle(): string { return 'Group by number of children'; diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/HouseholdAggregators/CompositionAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/HouseholdAggregators/CompositionAggregator.php index 3dc3a1398..020de70e2 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/HouseholdAggregators/CompositionAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/HouseholdAggregators/CompositionAggregator.php @@ -26,11 +26,13 @@ class CompositionAggregator implements AggregatorInterface { public function __construct(private readonly HouseholdCompositionTypeRepository $typeRepository, private readonly TranslatableStringHelper $translatableStringHelper, private readonly RollingDateConverterInterface $rollingDateConverter) {} + #[\Override] public function addRole(): ?string { return null; } + #[\Override] public function alterQuery(QueryBuilder $qb, $data) { if (!\in_array('composition_type', $qb->getAllAliases(), true)) { @@ -55,21 +57,25 @@ class CompositionAggregator implements AggregatorInterface ); } + #[\Override] public function applyOn(): string { return Declarations::HOUSEHOLD_TYPE; } + #[\Override] public function buildForm(FormBuilderInterface $builder) { $builder->add('on_date', PickRollingDateType::class, []); } + #[\Override] public function getFormDefaultData(): array { return ['on_date' => new RollingDate(RollingDate::T_TODAY)]; } + #[\Override] public function getLabels($key, array $values, $data) { return function ($value): string { @@ -89,11 +95,13 @@ class CompositionAggregator implements AggregatorInterface }; } + #[\Override] public function getQueryKeys($data): array { return ['composition_aggregator']; } + #[\Override] public function getTitle(): string { return 'Group by composition'; diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/AgeAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/AgeAggregator.php index 2ca286b57..fabead269 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/AgeAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/AgeAggregator.php @@ -26,11 +26,13 @@ final readonly class AgeAggregator implements AggregatorInterface, ExportElement private RollingDateConverterInterface $rollingDateConverter, ) {} + #[\Override] public function addRole(): ?string { return null; } + #[\Override] public function alterQuery(QueryBuilder $qb, $data) { $qb->addSelect('DATE_DIFF(:date_age_calculation, person.birthdate)/365 as person_age'); @@ -38,11 +40,13 @@ final readonly class AgeAggregator implements AggregatorInterface, ExportElement $qb->addGroupBy('person_age'); } + #[\Override] public function applyOn() { return 'person'; } + #[\Override] public function buildForm(FormBuilderInterface $builder) { $builder->add('date_age_calculation', PickRollingDateType::class, [ @@ -50,11 +54,13 @@ final readonly class AgeAggregator implements AggregatorInterface, ExportElement ]); } + #[\Override] public function getFormDefaultData(): array { return ['date_age_calculation' => new RollingDate(RollingDate::T_TODAY)]; } + #[\Override] public function getLabels($key, array $values, $data) { return function ($value) { @@ -66,6 +72,7 @@ final readonly class AgeAggregator implements AggregatorInterface, ExportElement }; } + #[\Override] public function getQueryKeys($data) { return [ @@ -73,11 +80,13 @@ final readonly class AgeAggregator implements AggregatorInterface, ExportElement ]; } + #[\Override] public function getTitle() { return 'Aggregate by age'; } + #[\Override] public function validateForm($data, ExecutionContextInterface $context) { if (null === $data['date_age_calculation']) { diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/ByHouseholdCompositionAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/ByHouseholdCompositionAggregator.php index af1018f6e..abd202777 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/ByHouseholdCompositionAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/ByHouseholdCompositionAggregator.php @@ -25,15 +25,17 @@ use Symfony\Component\Form\FormBuilderInterface; class ByHouseholdCompositionAggregator implements AggregatorInterface { - private const PREFIX = 'acp_by_household_compo_agg'; + private const string PREFIX = 'acp_by_household_compo_agg'; public function __construct(private readonly RollingDateConverterInterface $rollingDateConverter, private readonly HouseholdCompositionTypeRepositoryInterface $householdCompositionTypeRepository, private readonly TranslatableStringHelperInterface $translatableStringHelper) {} + #[\Override] public function addRole(): ?string { return null; } + #[\Override] public function alterQuery(QueryBuilder $qb, $data) { $p = self::PREFIX; @@ -71,11 +73,13 @@ class ByHouseholdCompositionAggregator implements AggregatorInterface ->addGroupBy("{$p}_select"); } + #[\Override] public function applyOn() { return Declarations::PERSON_TYPE; } + #[\Override] public function buildForm(FormBuilderInterface $builder) { $builder->add('date_calc', PickRollingDateType::class, [ @@ -83,11 +87,13 @@ class ByHouseholdCompositionAggregator implements AggregatorInterface ]); } + #[\Override] public function getFormDefaultData(): array { return ['date_calc' => new RollingDate(RollingDate::T_TODAY)]; } + #[\Override] public function getLabels($key, array $values, $data) { return function ($value) { @@ -107,11 +113,13 @@ class ByHouseholdCompositionAggregator implements AggregatorInterface }; } + #[\Override] public function getQueryKeys($data) { return [self::PREFIX.'_select']; } + #[\Override] public function getTitle() { return 'export.aggregator.person.by_household_composition.Group course by household composition'; diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/CenterAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/CenterAggregator.php index cd48a3f51..a14f74dd8 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/CenterAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/CenterAggregator.php @@ -22,13 +22,14 @@ use Symfony\Component\Form\FormBuilderInterface; final readonly class CenterAggregator implements AggregatorInterface { - private const COLUMN_NAME = 'person_center_aggregator'; + private const string COLUMN_NAME = 'person_center_aggregator'; public function __construct( private CenterRepositoryInterface $centerRepository, private RollingDateConverterInterface $rollingDateConverter, ) {} + #[\Override] public function buildForm(FormBuilderInterface $builder) { $builder->add('at_date', PickRollingDateType::class, [ @@ -36,6 +37,7 @@ final readonly class CenterAggregator implements AggregatorInterface ]); } + #[\Override] public function getFormDefaultData(): array { return [ @@ -43,6 +45,7 @@ final readonly class CenterAggregator implements AggregatorInterface ]; } + #[\Override] public function getLabels($key, array $values, $data): \Closure { return function (int|string|null $value) { @@ -58,21 +61,25 @@ final readonly class CenterAggregator implements AggregatorInterface }; } + #[\Override] public function getQueryKeys($data) { return [self::COLUMN_NAME]; } + #[\Override] public function getTitle() { return 'export.aggregator.person.by_center.title'; } + #[\Override] public function addRole(): ?string { return null; } + #[\Override] public function alterQuery(QueryBuilder $qb, $data) { $alias = 'pers_center_agg'; @@ -94,6 +101,7 @@ final readonly class CenterAggregator implements AggregatorInterface $qb->addGroupBy(self::COLUMN_NAME); } + #[\Override] public function applyOn() { return Declarations::PERSON_TYPE; diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/CountryOfBirthAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/CountryOfBirthAggregator.php index b8d204dc5..06ac5e013 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/CountryOfBirthAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/CountryOfBirthAggregator.php @@ -27,11 +27,13 @@ final readonly class CountryOfBirthAggregator implements AggregatorInterface, Ex { public function __construct(private CountryRepository $countriesRepository, private TranslatableStringHelper $translatableStringHelper, private TranslatorInterface $translator) {} + #[\Override] public function addRole(): ?string { return null; } + #[\Override] public function alterQuery(QueryBuilder $qb, $data): void { // add a clause in select part @@ -75,11 +77,13 @@ final readonly class CountryOfBirthAggregator implements AggregatorInterface, Ex $qb->addGroupBy('country_of_birth_aggregator'); } + #[\Override] public function applyOn() { return 'person'; } + #[\Override] public function buildForm(FormBuilderInterface $builder) { $builder->add('group_by_level', ChoiceType::class, [ @@ -92,11 +96,13 @@ final readonly class CountryOfBirthAggregator implements AggregatorInterface, Ex ]); } + #[\Override] public function getFormDefaultData(): array { return []; } + #[\Override] public function getLabels($key, array $values, $data) { $labels = []; @@ -138,16 +144,19 @@ final readonly class CountryOfBirthAggregator implements AggregatorInterface, Ex return static fn (?string $value): string => $labels[(string) $value]; } + #[\Override] public function getQueryKeys($data) { return ['country_of_birth_aggregator']; } + #[\Override] public function getTitle() { return 'Group people by country of birth'; } + #[\Override] public function validateForm($data, ExecutionContextInterface $context) { if (null === $data['group_by_level']) { diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/GenderAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/GenderAggregator.php index 0181c6e7b..6e5ccdcaf 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/GenderAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/GenderAggregator.php @@ -22,11 +22,13 @@ final readonly class GenderAggregator implements AggregatorInterface { public function __construct(private TranslatorInterface $translator) {} + #[\Override] public function addRole(): ?string { return null; } + #[\Override] public function alterQuery(QueryBuilder $qb, $data) { $qb->addSelect('person.gender as gender'); @@ -34,18 +36,22 @@ final readonly class GenderAggregator implements AggregatorInterface $qb->addGroupBy('gender'); } + #[\Override] public function applyOn() { return Declarations::PERSON_TYPE; } + #[\Override] public function buildForm(FormBuilderInterface $builder) {} + #[\Override] public function getFormDefaultData(): array { return []; } + #[\Override] public function getLabels($key, array $values, $data) { return function ($value) { @@ -75,11 +81,13 @@ final readonly class GenderAggregator implements AggregatorInterface }; } + #[\Override] public function getQueryKeys($data) { return ['gender']; } + #[\Override] public function getTitle() { return 'Group people by gender'; diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/GeographicalUnitAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/GeographicalUnitAggregator.php index 8ce51a3ab..ff05fa414 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/GeographicalUnitAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/GeographicalUnitAggregator.php @@ -28,11 +28,13 @@ class GeographicalUnitAggregator implements AggregatorInterface { public function __construct(private readonly GeographicalUnitLayerRepositoryInterface $geographicalUnitLayerRepository, private readonly TranslatableStringHelperInterface $translatableStringHelper, private readonly RollingDateConverterInterface $rollingDateConverter) {} + #[\Override] public function addRole(): ?string { return null; } + #[\Override] public function alterQuery(QueryBuilder $qb, $data): void { $qb @@ -73,11 +75,13 @@ class GeographicalUnitAggregator implements AggregatorInterface ->addGroupBy('geog_unit_key'); } + #[\Override] public function applyOn() { return Declarations::PERSON_TYPE; } + #[\Override] public function buildForm(FormBuilderInterface $builder) { $builder @@ -96,6 +100,7 @@ class GeographicalUnitAggregator implements AggregatorInterface ]); } + #[\Override] public function getFormDefaultData(): array { return ['date_calc' => new RollingDate(RollingDate::T_TODAY)]; @@ -106,6 +111,7 @@ class GeographicalUnitAggregator implements AggregatorInterface return 'person_geog_agg'; } + #[\Override] public function getLabels($key, array $values, $data) { return match ($key) { @@ -135,11 +141,13 @@ class GeographicalUnitAggregator implements AggregatorInterface }; } + #[\Override] public function getQueryKeys($data) { return ['geog_unit_name', 'geog_unit_key']; } + #[\Override] public function getTitle() { return 'Group people by geographical unit based on his address'; diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/HouseholdPositionAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/HouseholdPositionAggregator.php index eb1e52d9b..32730f03b 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/HouseholdPositionAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/HouseholdPositionAggregator.php @@ -30,11 +30,13 @@ final readonly class HouseholdPositionAggregator implements AggregatorInterface, { public function __construct(private TranslatorInterface $translator, private TranslatableStringHelper $translatableStringHelper, private PositionRepository $positionRepository, private RollingDateConverterInterface $rollingDateConverter) {} + #[\Override] public function addRole(): ?string { return null; } + #[\Override] public function alterQuery(QueryBuilder $qb, $data) { if (!\in_array('householdmember', $qb->getAllAliases(), true)) { @@ -62,11 +64,13 @@ final readonly class HouseholdPositionAggregator implements AggregatorInterface, $qb->addGroupBy('household_position_aggregator'); } + #[\Override] public function applyOn() { return Declarations::PERSON_TYPE; } + #[\Override] public function buildForm(FormBuilderInterface $builder) { $builder->add('date_position', PickRollingDateType::class, [ @@ -74,11 +78,13 @@ final readonly class HouseholdPositionAggregator implements AggregatorInterface, ]); } + #[\Override] public function getFormDefaultData(): array { return ['date_position' => new RollingDate(RollingDate::T_TODAY)]; } + #[\Override] public function getLabels($key, array $values, $data) { return function ($value) { @@ -96,6 +102,7 @@ final readonly class HouseholdPositionAggregator implements AggregatorInterface, }; } + #[\Override] public function getQueryKeys($data) { return [ @@ -103,11 +110,13 @@ final readonly class HouseholdPositionAggregator implements AggregatorInterface, ]; } + #[\Override] public function getTitle() { return 'Aggregate by household position'; } + #[\Override] public function validateForm($data, ExecutionContextInterface $context) { if (null === $data['date_position']) { diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/MaritalStatusAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/MaritalStatusAggregator.php index 1555a5a12..9f8f14cb2 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/MaritalStatusAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/MaritalStatusAggregator.php @@ -22,11 +22,13 @@ final readonly class MaritalStatusAggregator implements AggregatorInterface { public function __construct(private MaritalStatusRepository $maritalStatusRepository, private TranslatableStringHelper $translatableStringHelper) {} + #[\Override] public function addRole(): ?string { return null; } + #[\Override] public function alterQuery(QueryBuilder $qb, $data) { if (!\in_array('personmarital', $qb->getAllAliases(), true)) { @@ -37,21 +39,25 @@ final readonly class MaritalStatusAggregator implements AggregatorInterface $qb->addGroupBy('marital_status_aggregator'); } + #[\Override] public function applyOn() { return Declarations::PERSON_TYPE; } + #[\Override] public function buildForm(FormBuilderInterface $builder) { // no form } + #[\Override] public function getFormDefaultData(): array { return []; } + #[\Override] public function getLabels($key, array $values, $data) { return function ($value): string { @@ -69,11 +75,13 @@ final readonly class MaritalStatusAggregator implements AggregatorInterface }; } + #[\Override] public function getQueryKeys($data) { return ['marital_status_aggregator']; } + #[\Override] public function getTitle() { return 'Group people by marital status'; diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/NationalityAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/NationalityAggregator.php index 9daca5b34..f786259d2 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/NationalityAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/NationalityAggregator.php @@ -26,11 +26,13 @@ final readonly class NationalityAggregator implements AggregatorInterface, Expor { public function __construct(private CountryRepository $countriesRepository, private TranslatableStringHelper $translatableStringHelper, private TranslatorInterface $translator) {} + #[\Override] public function addRole(): ?string { return null; } + #[\Override] public function alterQuery(QueryBuilder $qb, $data) { // add a clause in select part @@ -70,11 +72,13 @@ final readonly class NationalityAggregator implements AggregatorInterface, Expor $qb->addGroupBy('nationality_aggregator'); } + #[\Override] public function applyOn() { return 'person'; } + #[\Override] public function buildForm(FormBuilderInterface $builder) { $builder->add('group_by_level', ChoiceType::class, [ @@ -87,6 +91,7 @@ final readonly class NationalityAggregator implements AggregatorInterface, Expor ]); } + #[\Override] public function getFormDefaultData(): array { return [ @@ -94,6 +99,7 @@ final readonly class NationalityAggregator implements AggregatorInterface, Expor ]; } + #[\Override] public function getLabels($key, array $values, $data) { $labels = []; @@ -135,16 +141,19 @@ final readonly class NationalityAggregator implements AggregatorInterface, Expor return static fn ($value): string => $labels[$value]; } + #[\Override] public function getQueryKeys($data) { return ['nationality_aggregator']; } + #[\Override] public function getTitle() { return 'Group people by nationality'; } + #[\Override] public function validateForm($data, ExecutionContextInterface $context) { if (null === $data['group_by_level']) { diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/PostalCodeAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/PostalCodeAggregator.php index a8ec614d4..ec763b1c9 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/PostalCodeAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/PostalCodeAggregator.php @@ -22,12 +22,13 @@ use Symfony\Component\Form\FormBuilderInterface; final readonly class PostalCodeAggregator implements AggregatorInterface { - private const PREFIX = 'person_postal_code_agg'; + private const string PREFIX = 'person_postal_code_agg'; public function __construct( private RollingDateConverterInterface $rollingDateConverter, ) {} + #[\Override] public function buildForm(FormBuilderInterface $builder) { $builder @@ -36,11 +37,13 @@ final readonly class PostalCodeAggregator implements AggregatorInterface ]); } + #[\Override] public function getFormDefaultData(): array { return ['calc_date' => new RollingDate(RollingDate::T_TODAY)]; } + #[\Override] public function getLabels($key, array $values, mixed $data) { return function (int|string|null $value): string { @@ -56,21 +59,25 @@ final readonly class PostalCodeAggregator implements AggregatorInterface }; } + #[\Override] public function getQueryKeys($data) { return [self::PREFIX.'_postal_code_code', self::PREFIX.'_postal_code_label']; } + #[\Override] public function getTitle() { return 'export.aggregator.person.by_postal_code.title'; } + #[\Override] public function addRole(): ?string { return null; } + #[\Override] public function alterQuery(QueryBuilder $qb, $data) { $p = self::PREFIX; @@ -92,6 +99,7 @@ final readonly class PostalCodeAggregator implements AggregatorInterface ; } + #[\Override] public function applyOn() { return Declarations::PERSON_TYPE; diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/ActionTypeAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/ActionTypeAggregator.php index 9abf5c1e7..d7b6f8e1d 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/ActionTypeAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/ActionTypeAggregator.php @@ -24,11 +24,13 @@ final readonly class ActionTypeAggregator implements AggregatorInterface { public function __construct(private SocialActionRepository $socialActionRepository, private SocialActionRender $actionRender, private SocialIssueRender $socialIssueRender, private SocialIssueRepository $socialIssueRepository) {} + #[\Override] public function addRole(): ?string { return null; } + #[\Override] public function alterQuery(QueryBuilder $qb, $data) { if (!\in_array('acpwsocialaction', $qb->getAllAliases(), true)) { @@ -46,21 +48,25 @@ final readonly class ActionTypeAggregator implements AggregatorInterface ->addGroupBy('social_action_type_aggregator'); } + #[\Override] public function applyOn() { return Declarations::SOCIAL_WORK_ACTION_TYPE; } + #[\Override] public function buildForm(FormBuilderInterface $builder) { // no form } + #[\Override] public function getFormDefaultData(): array { return []; } + #[\Override] public function getLabels($key, array $values, $data) { return match ($key) { @@ -90,11 +96,13 @@ final readonly class ActionTypeAggregator implements AggregatorInterface }; } + #[\Override] public function getQueryKeys($data) { return ['social_action_type_aggregator', 'action_type_aggregator']; } + #[\Override] public function getTitle() { return 'Group social work actions by action type'; diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/CreatorAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/CreatorAggregator.php index f7c203a4e..8f16c4aa9 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/CreatorAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/CreatorAggregator.php @@ -20,18 +20,20 @@ use Symfony\Component\Form\FormBuilderInterface; class CreatorAggregator implements AggregatorInterface { - private const PREFIX = 'acpw_aggr_creator'; + private const string PREFIX = 'acpw_aggr_creator'; public function __construct( private readonly UserRepository $userRepository, private readonly UserRender $userRender ) {} + #[\Override] public function addRole(): ?string { return null; } + #[\Override] public function alterQuery(QueryBuilder $qb, $data) { $p = self::PREFIX; @@ -41,18 +43,22 @@ class CreatorAggregator implements AggregatorInterface ->addGroupBy("{$p}_select"); } + #[\Override] public function applyOn(): string { return Declarations::SOCIAL_WORK_ACTION_TYPE; } + #[\Override] public function buildForm(FormBuilderInterface $builder) {} + #[\Override] public function getFormDefaultData(): array { return []; } + #[\Override] public function getLabels($key, array $values, mixed $data) { return function ($value): string { @@ -70,11 +76,13 @@ class CreatorAggregator implements AggregatorInterface }; } + #[\Override] public function getQueryKeys($data): array { return [self::PREFIX.'_select']; } + #[\Override] public function getTitle(): string { return 'export.aggregator.course_work.by_creator.title'; diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/CreatorJobAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/CreatorJobAggregator.php index 1f7fdca5a..139ad42cf 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/CreatorJobAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/CreatorJobAggregator.php @@ -22,18 +22,20 @@ use Symfony\Component\Form\FormBuilderInterface; class CreatorJobAggregator implements AggregatorInterface { - private const PREFIX = 'acpw_aggr_creator_job'; + private const string PREFIX = 'acpw_aggr_creator_job'; public function __construct( private readonly UserJobRepository $jobRepository, private readonly TranslatableStringHelper $translatableStringHelper ) {} + #[\Override] public function addRole(): ?string { return null; } + #[\Override] public function alterQuery(QueryBuilder $qb, $data) { $p = self::PREFIX; @@ -58,18 +60,22 @@ class CreatorJobAggregator implements AggregatorInterface ->addGroupBy("{$p}_select"); } + #[\Override] public function applyOn(): string { return Declarations::SOCIAL_WORK_ACTION_TYPE; } + #[\Override] public function buildForm(FormBuilderInterface $builder) {} + #[\Override] public function getFormDefaultData(): array { return []; } + #[\Override] public function getLabels($key, array $values, mixed $data) { return function ($value): string { @@ -87,11 +93,13 @@ class CreatorJobAggregator implements AggregatorInterface }; } + #[\Override] public function getQueryKeys($data): array { return [self::PREFIX.'_select']; } + #[\Override] public function getTitle(): string { return 'export.aggregator.course_work.by_creator_job.title'; diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/CreatorScopeAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/CreatorScopeAggregator.php index c57607693..055d67462 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/CreatorScopeAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/CreatorScopeAggregator.php @@ -22,18 +22,20 @@ use Symfony\Component\Form\FormBuilderInterface; class CreatorScopeAggregator implements AggregatorInterface { - private const PREFIX = 'acpw_aggr_creator_scope'; + private const string PREFIX = 'acpw_aggr_creator_scope'; public function __construct( private readonly ScopeRepository $scopeRepository, private readonly TranslatableStringHelper $translatableStringHelper ) {} + #[\Override] public function addRole(): ?string { return null; } + #[\Override] public function alterQuery(QueryBuilder $qb, $data) { $p = self::PREFIX; @@ -58,18 +60,22 @@ class CreatorScopeAggregator implements AggregatorInterface ->addGroupBy("{$p}_select"); } + #[\Override] public function applyOn(): string { return Declarations::SOCIAL_WORK_ACTION_TYPE; } + #[\Override] public function buildForm(FormBuilderInterface $builder) {} + #[\Override] public function getFormDefaultData(): array { return []; } + #[\Override] public function getLabels($key, array $values, mixed $data) { return function ($value): string { @@ -87,11 +93,13 @@ class CreatorScopeAggregator implements AggregatorInterface }; } + #[\Override] public function getQueryKeys($data): array { return [self::PREFIX.'_select']; } + #[\Override] public function getTitle(): string { return 'export.aggregator.course_work.by_creator_scope.title'; diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/CurrentActionAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/CurrentActionAggregator.php index a9f8e020a..75fac7518 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/CurrentActionAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/CurrentActionAggregator.php @@ -21,11 +21,13 @@ class CurrentActionAggregator implements AggregatorInterface { public function __construct(private readonly TranslatorInterface $translator) {} + #[\Override] public function addRole(): ?string { return null; } + #[\Override] public function alterQuery(QueryBuilder $qb, $data): void { $qb @@ -36,21 +38,25 @@ class CurrentActionAggregator implements AggregatorInterface ->addGroupBy('acpw_current_action_aggregator'); } + #[\Override] public function applyOn(): string { return Declarations::SOCIAL_WORK_ACTION_TYPE; } + #[\Override] public function buildForm(FormBuilderInterface $builder): void { // No form needed } + #[\Override] public function getFormDefaultData(): array { return []; } + #[\Override] public function getLabels($key, array $values, $data) { return function ($value): string { @@ -66,11 +72,13 @@ class CurrentActionAggregator implements AggregatorInterface }; } + #[\Override] public function getQueryKeys($data): array { return ['acpw_current_action_aggregator']; } + #[\Override] public function getTitle(): string { return 'export.aggregator.course_work.by_current_action.Group by current actions'; diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/GoalAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/GoalAggregator.php index ce1e381f2..476025c92 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/GoalAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/GoalAggregator.php @@ -22,11 +22,13 @@ final readonly class GoalAggregator implements AggregatorInterface { public function __construct(private GoalRepository $goalRepository, private TranslatableStringHelper $translatableStringHelper) {} + #[\Override] public function addRole(): ?string { return null; } + #[\Override] public function alterQuery(QueryBuilder $qb, $data) { if (!\in_array('goal', $qb->getAllAliases(), true)) { @@ -37,21 +39,25 @@ final readonly class GoalAggregator implements AggregatorInterface $qb->addGroupBy('acpw_goal_aggregator'); } + #[\Override] public function applyOn(): string { return Declarations::SOCIAL_WORK_ACTION_TYPE; } + #[\Override] public function buildForm(FormBuilderInterface $builder) { // no form } + #[\Override] public function getFormDefaultData(): array { return []; } + #[\Override] public function getLabels($key, array $values, $data) { return function ($value): string { @@ -71,11 +77,13 @@ final readonly class GoalAggregator implements AggregatorInterface }; } + #[\Override] public function getQueryKeys($data): array { return ['acpw_goal_aggregator']; } + #[\Override] public function getTitle(): string { return 'Group social work actions by goal'; diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/GoalResultAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/GoalResultAggregator.php index e1549f315..c25bf3bf8 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/GoalResultAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/GoalResultAggregator.php @@ -23,11 +23,13 @@ class GoalResultAggregator implements AggregatorInterface { public function __construct(private readonly ResultRepository $resultRepository, private readonly GoalRepository $goalRepository, private readonly TranslatableStringHelper $translatableStringHelper) {} + #[\Override] public function addRole(): ?string { return null; } + #[\Override] public function alterQuery(QueryBuilder $qb, $data) { if (!\in_array('goal', $qb->getAllAliases(), true)) { @@ -43,21 +45,25 @@ class GoalResultAggregator implements AggregatorInterface $qb->addGroupBy('goal_aggregator')->addGroupBy('result_aggregator'); } + #[\Override] public function applyOn(): string { return Declarations::SOCIAL_WORK_ACTION_TYPE; } + #[\Override] public function buildForm(FormBuilderInterface $builder) { // no form } + #[\Override] public function getFormDefaultData(): array { return []; } + #[\Override] public function getLabels($key, array $values, $data) { return function ($value) use ($key): string { @@ -94,6 +100,7 @@ class GoalResultAggregator implements AggregatorInterface }; } + #[\Override] public function getQueryKeys($data): array { return [ @@ -102,6 +109,7 @@ class GoalResultAggregator implements AggregatorInterface ]; } + #[\Override] public function getTitle(): string { return 'Group social work actions by goal and result'; diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/HandlingThirdPartyAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/HandlingThirdPartyAggregator.php index f58246a25..577ecf9cb 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/HandlingThirdPartyAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/HandlingThirdPartyAggregator.php @@ -23,40 +23,47 @@ use Symfony\Component\Form\FormBuilderInterface; */ final readonly class HandlingThirdPartyAggregator implements AggregatorInterface { - private const PREFIX = 'acpw_handling3party_agg'; + private const string PREFIX = 'acpw_handling3party_agg'; public function __construct(private LabelThirdPartyHelper $labelThirdPartyHelper) {} + #[\Override] public function buildForm(FormBuilderInterface $builder) { // no form needed here } + #[\Override] public function getFormDefaultData(): array { return []; } + #[\Override] public function getLabels($key, array $values, mixed $data) { return $this->labelThirdPartyHelper->getLabel($key, $values, 'export.aggregator.course_work.by_handling_third_party.header'); } + #[\Override] public function getQueryKeys($data) { return [self::PREFIX.'_h3party']; } + #[\Override] public function getTitle() { return 'export.aggregator.course_work.by_handling_third_party.title'; } + #[\Override] public function addRole(): ?string { return null; } + #[\Override] public function alterQuery(QueryBuilder $qb, $data) { $p = self::PREFIX; @@ -66,6 +73,7 @@ final readonly class HandlingThirdPartyAggregator implements AggregatorInterface ->addGroupBy("{$p}_h3party"); } + #[\Override] public function applyOn() { return Declarations::SOCIAL_WORK_ACTION_TYPE; diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/JobAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/JobAggregator.php index c8336b09b..f16c3576d 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/JobAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/JobAggregator.php @@ -23,18 +23,20 @@ use Symfony\Component\Form\FormBuilderInterface; final readonly class JobAggregator implements AggregatorInterface { - private const PREFIX = 'acp_work_action_agg_user_job'; + private const string PREFIX = 'acp_work_action_agg_user_job'; public function __construct( private UserJobRepository $jobRepository, private TranslatableStringHelper $translatableStringHelper ) {} + #[\Override] public function addRole(): ?string { return null; } + #[\Override] public function alterQuery(QueryBuilder $qb, $data) { $p = self::PREFIX; @@ -53,18 +55,22 @@ final readonly class JobAggregator implements AggregatorInterface ->addGroupBy("{$p}_select"); } + #[\Override] public function applyOn(): string { return Declarations::SOCIAL_WORK_ACTION_TYPE; } + #[\Override] public function buildForm(FormBuilderInterface $builder) {} + #[\Override] public function getFormDefaultData(): array { return []; } + #[\Override] public function getLabels($key, array $values, $data) { return function ($value): string { @@ -86,11 +92,13 @@ final readonly class JobAggregator implements AggregatorInterface }; } + #[\Override] public function getQueryKeys($data): array { return [self::PREFIX.'_select']; } + #[\Override] public function getTitle(): string { return 'export.aggregator.course_work.by_agent_job.Group by treating agent job'; diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/ReferrerAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/ReferrerAggregator.php index c97229048..4a4495aa3 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/ReferrerAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/ReferrerAggregator.php @@ -23,7 +23,7 @@ use Symfony\Component\Form\FormBuilderInterface; final readonly class ReferrerAggregator implements AggregatorInterface { - private const PREFIX = 'acpw_referrer_aggregator'; + private const string PREFIX = 'acpw_referrer_aggregator'; public function __construct( private UserRepository $userRepository, @@ -31,11 +31,13 @@ final readonly class ReferrerAggregator implements AggregatorInterface private RollingDateConverterInterface $rollingDateConverter ) {} + #[\Override] public function addRole(): ?string { return null; } + #[\Override] public function alterQuery(QueryBuilder $qb, $data) { $p = self::PREFIX; @@ -51,11 +53,13 @@ final readonly class ReferrerAggregator implements AggregatorInterface $qb->addGroupBy('referrer_aggregator'); } + #[\Override] public function applyOn(): string { return Declarations::SOCIAL_WORK_ACTION_TYPE; } + #[\Override] public function buildForm(FormBuilderInterface $builder) { $builder->add('referrer_at', PickRollingDateType::class, [ @@ -63,6 +67,7 @@ final readonly class ReferrerAggregator implements AggregatorInterface ]); } + #[\Override] public function getFormDefaultData(): array { return [ @@ -70,6 +75,7 @@ final readonly class ReferrerAggregator implements AggregatorInterface ]; } + #[\Override] public function getLabels($key, array $values, $data) { return function ($value): string { @@ -87,11 +93,13 @@ final readonly class ReferrerAggregator implements AggregatorInterface }; } + #[\Override] public function getQueryKeys($data): array { return ['referrer_aggregator']; } + #[\Override] public function getTitle(): string { return 'export.aggregator.course_work.by_treating_agent.Group by treating agent'; diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/ResultAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/ResultAggregator.php index 63a037f21..5848d946d 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/ResultAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/ResultAggregator.php @@ -22,11 +22,13 @@ final readonly class ResultAggregator implements AggregatorInterface { public function __construct(private ResultRepository $resultRepository, private TranslatableStringHelper $translatableStringHelper) {} + #[\Override] public function addRole(): ?string { return null; } + #[\Override] public function alterQuery(QueryBuilder $qb, $data) { if (!\in_array('result', $qb->getAllAliases(), true)) { @@ -37,21 +39,25 @@ final readonly class ResultAggregator implements AggregatorInterface $qb->addGroupBy('acpw_result_aggregator'); } + #[\Override] public function applyOn(): string { return Declarations::SOCIAL_WORK_ACTION_TYPE; } + #[\Override] public function buildForm(FormBuilderInterface $builder) { // no form } + #[\Override] public function getFormDefaultData(): array { return []; } + #[\Override] public function getLabels($key, array $values, $data) { return function ($value): string { @@ -71,11 +77,13 @@ final readonly class ResultAggregator implements AggregatorInterface }; } + #[\Override] public function getQueryKeys($data): array { return ['acpw_result_aggregator']; } + #[\Override] public function getTitle(): string { return 'Group social work actions by result'; diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/ScopeAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/ScopeAggregator.php index dfffaa9e4..e59b05519 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/ScopeAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/SocialWorkAggregators/ScopeAggregator.php @@ -23,18 +23,20 @@ use Symfony\Component\Form\FormBuilderInterface; final readonly class ScopeAggregator implements AggregatorInterface { - private const PREFIX = 'acp_work_action_agg_user_scope'; + private const string PREFIX = 'acp_work_action_agg_user_scope'; public function __construct( private ScopeRepository $scopeRepository, private TranslatableStringHelper $translatableStringHelper ) {} + #[\Override] public function addRole(): ?string { return null; } + #[\Override] public function alterQuery(QueryBuilder $qb, $data) { $p = self::PREFIX; @@ -53,18 +55,22 @@ final readonly class ScopeAggregator implements AggregatorInterface ->addGroupBy("{$p}_select"); } + #[\Override] public function applyOn(): string { return Declarations::SOCIAL_WORK_ACTION_TYPE; } + #[\Override] public function buildForm(FormBuilderInterface $builder) {} + #[\Override] public function getFormDefaultData(): array { return []; } + #[\Override] public function getLabels($key, array $values, $data) { return function ($value): string { @@ -86,11 +92,13 @@ final readonly class ScopeAggregator implements AggregatorInterface }; } + #[\Override] public function getQueryKeys($data): array { return [self::PREFIX.'_select']; } + #[\Override] public function getTitle(): string { return 'export.aggregator.course_work.by_agent_scope.Group by treating agent scope'; diff --git a/src/Bundle/ChillPersonBundle/Export/Export/AvgDurationAPWorkPersonAssociatedOnAccompanyingPeriod.php b/src/Bundle/ChillPersonBundle/Export/Export/AvgDurationAPWorkPersonAssociatedOnAccompanyingPeriod.php index ad3f8f745..c6293b574 100644 --- a/src/Bundle/ChillPersonBundle/Export/Export/AvgDurationAPWorkPersonAssociatedOnAccompanyingPeriod.php +++ b/src/Bundle/ChillPersonBundle/Export/Export/AvgDurationAPWorkPersonAssociatedOnAccompanyingPeriod.php @@ -34,28 +34,34 @@ class AvgDurationAPWorkPersonAssociatedOnAccompanyingPeriod implements ExportInt $this->filterStatsByCenters = $parameterBag->get('chill_main')['acl']['filter_stats_by_center']; } + #[\Override] public function buildForm(FormBuilderInterface $builder) {} + #[\Override] public function getFormDefaultData(): array { return []; } + #[\Override] public function getAllowedFormattersTypes(): array { return [FormatterInterface::TYPE_TABULAR]; } + #[\Override] public function getDescription(): string { return 'export.export.avg_duration_acpw_associate_on_period.description'; } + #[\Override] public function getGroup(): string { return 'Exports of social work actions'; } + #[\Override] public function getLabels($key, array $values, $data) { if ('export_result' !== $key) { @@ -65,26 +71,31 @@ class AvgDurationAPWorkPersonAssociatedOnAccompanyingPeriod implements ExportInt return static fn ($value) => '_header' === $value ? 'export.export.avg_duration_acpw_associate_on_period.header' : $value; } + #[\Override] public function getQueryKeys($data): array { return ['export_result']; } + #[\Override] public function getResult($query, $data) { return $query->getQuery()->getResult(Query::HYDRATE_SCALAR); } + #[\Override] public function getTitle(): string { return 'export.export.avg_duration_acpw_associate_on_period.title'; } + #[\Override] public function getType(): string { return Declarations::SOCIAL_WORK_ACTION_TYPE; } + #[\Override] public function initiateQuery(array $requiredModifiers, array $acl, array $data = []) { $centers = array_map(static fn ($el) => $el['center'], $acl); @@ -115,11 +126,13 @@ class AvgDurationAPWorkPersonAssociatedOnAccompanyingPeriod implements ExportInt return $qb; } + #[\Override] public function requiredRole(): string { return AccompanyingPeriodVoter::STATS; } + #[\Override] public function supportsModifiers(): array { return [ diff --git a/src/Bundle/ChillPersonBundle/Export/Export/AvgDurationAPWorkPersonAssociatedOnWork.php b/src/Bundle/ChillPersonBundle/Export/Export/AvgDurationAPWorkPersonAssociatedOnWork.php index 8d34837ae..47b4f4957 100644 --- a/src/Bundle/ChillPersonBundle/Export/Export/AvgDurationAPWorkPersonAssociatedOnWork.php +++ b/src/Bundle/ChillPersonBundle/Export/Export/AvgDurationAPWorkPersonAssociatedOnWork.php @@ -34,28 +34,34 @@ class AvgDurationAPWorkPersonAssociatedOnWork implements ExportInterface, Groupe $this->filterStatsByCenters = $parameterBag->get('chill_main')['acl']['filter_stats_by_center']; } + #[\Override] public function buildForm(FormBuilderInterface $builder) {} + #[\Override] public function getFormDefaultData(): array { return []; } + #[\Override] public function getAllowedFormattersTypes(): array { return [FormatterInterface::TYPE_TABULAR]; } + #[\Override] public function getDescription(): string { return 'export.export.avg_duration_acpw_associate_on_work.description'; } + #[\Override] public function getGroup(): string { return 'Exports of social work actions'; } + #[\Override] public function getLabels($key, array $values, $data) { if ('export_result' !== $key) { @@ -65,26 +71,31 @@ class AvgDurationAPWorkPersonAssociatedOnWork implements ExportInterface, Groupe return static fn ($value) => '_header' === $value ? 'export.export.avg_duration_acpw_associate_on_work.header' : $value; } + #[\Override] public function getQueryKeys($data): array { return ['export_result']; } + #[\Override] public function getResult($query, $data) { return $query->getQuery()->getResult(Query::HYDRATE_SCALAR); } + #[\Override] public function getTitle(): string { return 'export.export.avg_duration_acpw_associate_on_work.title'; } + #[\Override] public function getType(): string { return Declarations::SOCIAL_WORK_ACTION_TYPE; } + #[\Override] public function initiateQuery(array $requiredModifiers, array $acl, array $data = []) { $centers = array_map(static fn ($el) => $el['center'], $acl); @@ -114,11 +125,13 @@ class AvgDurationAPWorkPersonAssociatedOnWork implements ExportInterface, Groupe return $qb; } + #[\Override] public function requiredRole(): string { return AccompanyingPeriodVoter::STATS; } + #[\Override] public function supportsModifiers(): array { return [ diff --git a/src/Bundle/ChillPersonBundle/Export/Export/CountAccompanyingCourse.php b/src/Bundle/ChillPersonBundle/Export/Export/CountAccompanyingCourse.php index 1118b2cc4..4a1ac6301 100644 --- a/src/Bundle/ChillPersonBundle/Export/Export/CountAccompanyingCourse.php +++ b/src/Bundle/ChillPersonBundle/Export/Export/CountAccompanyingCourse.php @@ -39,31 +39,37 @@ class CountAccompanyingCourse implements ExportInterface, GroupedExportInterface $this->filterStatsByCenters = $parameterBag->get('chill_main')['acl']['filter_stats_by_center']; } + #[\Override] public function buildForm(FormBuilderInterface $builder): void { // Nothing to add here } + #[\Override] public function getFormDefaultData(): array { return []; } + #[\Override] public function getAllowedFormattersTypes(): array { return [FormatterInterface::TYPE_TABULAR]; } + #[\Override] public function getDescription(): string { return 'Count accompanying courses by various parameters'; } + #[\Override] public function getGroup(): string { return 'Exports of accompanying courses'; } + #[\Override] public function getLabels($key, array $values, $data) { if ('export_result' !== $key) { @@ -76,26 +82,31 @@ class CountAccompanyingCourse implements ExportInterface, GroupedExportInterface return static fn ($value) => $labels[$value]; } + #[\Override] public function getQueryKeys($data): array { return ['export_result']; } + #[\Override] public function getResult($query, $data) { return $query->getQuery()->getResult(Query::HYDRATE_SCALAR); } + #[\Override] public function getTitle(): string { return 'Count accompanying courses'; } + #[\Override] public function getType(): string { return Declarations::ACP_TYPE; } + #[\Override] public function initiateQuery(array $requiredModifiers, array $acl, array $data = []): QueryBuilder { $centers = array_map(static fn ($el) => $el['center'], $acl); @@ -127,11 +138,13 @@ class CountAccompanyingCourse implements ExportInterface, GroupedExportInterface return $qb; } + #[\Override] public function requiredRole(): string { return AccompanyingPeriodVoter::STATS; } + #[\Override] public function supportsModifiers(): array { return [ diff --git a/src/Bundle/ChillPersonBundle/Export/Export/CountAccompanyingCourseStepHistory.php b/src/Bundle/ChillPersonBundle/Export/Export/CountAccompanyingCourseStepHistory.php index 4f620fa34..88c43f5e8 100644 --- a/src/Bundle/ChillPersonBundle/Export/Export/CountAccompanyingCourseStepHistory.php +++ b/src/Bundle/ChillPersonBundle/Export/Export/CountAccompanyingCourseStepHistory.php @@ -39,31 +39,37 @@ class CountAccompanyingCourseStepHistory implements ExportInterface, GroupedExpo $this->filterStatsByCenters = $parameterBag->get('chill_main')['acl']['filter_stats_by_center']; } + #[\Override] public function buildForm(FormBuilderInterface $builder): void { // Nothing to add here } + #[\Override] public function getFormDefaultData(): array { return []; } + #[\Override] public function getAllowedFormattersTypes(): array { return [FormatterInterface::TYPE_TABULAR]; } + #[\Override] public function getDescription(): string { return 'export.export.acp_closing.description'; } + #[\Override] public function getGroup(): string { return 'Exports of accompanying courses'; } + #[\Override] public function getLabels($key, array $values, $data) { if ('export_result' !== $key) { @@ -73,26 +79,31 @@ class CountAccompanyingCourseStepHistory implements ExportInterface, GroupedExpo return fn ($value) => '_header' === $value ? $this->getTitle() : $value; } + #[\Override] public function getQueryKeys($data): array { return ['export_result']; } + #[\Override] public function getResult($query, $data) { return $query->getQuery()->getResult(Query::HYDRATE_SCALAR); } + #[\Override] public function getTitle(): string { return 'export.export.acp_closing.title'; } + #[\Override] public function getType(): string { return Declarations::ACP_TYPE; } + #[\Override] public function initiateQuery(array $requiredModifiers, array $acl, array $data = []): QueryBuilder { $centers = array_map(static fn ($el) => $el['center'], $acl); @@ -123,11 +134,13 @@ class CountAccompanyingCourseStepHistory implements ExportInterface, GroupedExpo return $qb; } + #[\Override] public function requiredRole(): string { return AccompanyingPeriodVoter::STATS; } + #[\Override] public function supportsModifiers(): array { return [ diff --git a/src/Bundle/ChillPersonBundle/Export/Export/CountAccompanyingPeriodWorkAssociatePersonOnAccompanyingPeriod.php b/src/Bundle/ChillPersonBundle/Export/Export/CountAccompanyingPeriodWorkAssociatePersonOnAccompanyingPeriod.php index a73e4f037..736a0ab8d 100644 --- a/src/Bundle/ChillPersonBundle/Export/Export/CountAccompanyingPeriodWorkAssociatePersonOnAccompanyingPeriod.php +++ b/src/Bundle/ChillPersonBundle/Export/Export/CountAccompanyingPeriodWorkAssociatePersonOnAccompanyingPeriod.php @@ -36,31 +36,37 @@ class CountAccompanyingPeriodWorkAssociatePersonOnAccompanyingPeriod implements $this->filterStatsByCenters = $parameterBag->get('chill_main')['acl']['filter_stats_by_center']; } + #[\Override] public function buildForm(FormBuilderInterface $builder): void { // No form necessary? } + #[\Override] public function getFormDefaultData(): array { return []; } + #[\Override] public function getAllowedFormattersTypes(): array { return [FormatterInterface::TYPE_TABULAR]; } + #[\Override] public function getDescription(): string { return 'export.export.count_accompanying_period_work_associate_person.description'; } + #[\Override] public function getGroup(): string { return 'Exports of social work actions'; } + #[\Override] public function getLabels($key, array $values, $data) { if ('export_result' !== $key) { @@ -73,26 +79,31 @@ class CountAccompanyingPeriodWorkAssociatePersonOnAccompanyingPeriod implements return static fn ($value) => $labels[$value]; } + #[\Override] public function getQueryKeys($data): array { return ['export_result']; } + #[\Override] public function getResult($query, $data) { return $query->getQuery()->getResult(Query::HYDRATE_SCALAR); } + #[\Override] public function getTitle(): string { return 'export.export.count_accompanying_period_work_associate_person.title'; } + #[\Override] public function getType(): string { return Declarations::SOCIAL_WORK_ACTION_TYPE; } + #[\Override] public function initiateQuery(array $requiredModifiers, array $acl, array $data = []): QueryBuilder { $centers = array_map(static fn ($el) => $el['center'], $acl); @@ -124,11 +135,13 @@ class CountAccompanyingPeriodWorkAssociatePersonOnAccompanyingPeriod implements return $qb; } + #[\Override] public function requiredRole(): string { return AccompanyingPeriodVoter::STATS; } + #[\Override] public function supportsModifiers(): array { return [ diff --git a/src/Bundle/ChillPersonBundle/Export/Export/CountAccompanyingPeriodWorkAssociatePersonOnWork.php b/src/Bundle/ChillPersonBundle/Export/Export/CountAccompanyingPeriodWorkAssociatePersonOnWork.php index 4f43a78b0..9e93e2ee7 100644 --- a/src/Bundle/ChillPersonBundle/Export/Export/CountAccompanyingPeriodWorkAssociatePersonOnWork.php +++ b/src/Bundle/ChillPersonBundle/Export/Export/CountAccompanyingPeriodWorkAssociatePersonOnWork.php @@ -36,31 +36,37 @@ class CountAccompanyingPeriodWorkAssociatePersonOnWork implements ExportInterfac $this->filterStatsByCenters = $parameterBag->get('chill_main')['acl']['filter_stats_by_center']; } + #[\Override] public function buildForm(FormBuilderInterface $builder): void { // No form necessary? } + #[\Override] public function getFormDefaultData(): array { return []; } + #[\Override] public function getAllowedFormattersTypes(): array { return [FormatterInterface::TYPE_TABULAR]; } + #[\Override] public function getDescription(): string { return 'export.export.count_accompanying_period_work_associate_work.description'; } + #[\Override] public function getGroup(): string { return 'Exports of social work actions'; } + #[\Override] public function getLabels($key, array $values, $data) { if ('export_result' !== $key) { @@ -73,26 +79,31 @@ class CountAccompanyingPeriodWorkAssociatePersonOnWork implements ExportInterfac return static fn ($value) => $labels[$value]; } + #[\Override] public function getQueryKeys($data): array { return ['export_result']; } + #[\Override] public function getResult($query, $data) { return $query->getQuery()->getResult(Query::HYDRATE_SCALAR); } + #[\Override] public function getTitle(): string { return 'export.export.count_accompanying_period_work_associate_work.title'; } + #[\Override] public function getType(): string { return Declarations::SOCIAL_WORK_ACTION_TYPE; } + #[\Override] public function initiateQuery(array $requiredModifiers, array $acl, array $data = []): QueryBuilder { $centers = array_map(static fn ($el) => $el['center'], $acl); @@ -123,11 +134,13 @@ class CountAccompanyingPeriodWorkAssociatePersonOnWork implements ExportInterfac return $qb; } + #[\Override] public function requiredRole(): string { return AccompanyingPeriodVoter::STATS; } + #[\Override] public function supportsModifiers(): array { return [ diff --git a/src/Bundle/ChillPersonBundle/Export/Export/CountEvaluation.php b/src/Bundle/ChillPersonBundle/Export/Export/CountEvaluation.php index 0cbe7b3e8..7353955be 100644 --- a/src/Bundle/ChillPersonBundle/Export/Export/CountEvaluation.php +++ b/src/Bundle/ChillPersonBundle/Export/Export/CountEvaluation.php @@ -35,28 +35,34 @@ class CountEvaluation implements ExportInterface, GroupedExportInterface $this->filterStatsByCenters = $parameterBag->get('chill_main')['acl']['filter_stats_by_center']; } + #[\Override] public function buildForm(FormBuilderInterface $builder) {} + #[\Override] public function getFormDefaultData(): array { return []; } + #[\Override] public function getAllowedFormattersTypes(): array { return [FormatterInterface::TYPE_TABULAR]; } + #[\Override] public function getDescription(): string { return 'Count evaluation by various parameters.'; } + #[\Override] public function getGroup(): string { return 'Exports of evaluations'; } + #[\Override] public function getLabels($key, array $values, $data) { if ('export_result' !== $key) { @@ -69,26 +75,31 @@ class CountEvaluation implements ExportInterface, GroupedExportInterface return static fn ($value) => $labels[$value]; } + #[\Override] public function getQueryKeys($data): array { return ['export_result']; } + #[\Override] public function getResult($query, $data) { return $query->getQuery()->getResult(Query::HYDRATE_SCALAR); } + #[\Override] public function getTitle(): string { return 'Count evaluations'; } + #[\Override] public function getType(): string { return Declarations::EVAL_TYPE; } + #[\Override] public function initiateQuery(array $requiredModifiers, array $acl, array $data = []) { $centers = array_map(static fn ($el) => $el['center'], $acl); @@ -121,11 +132,13 @@ class CountEvaluation implements ExportInterface, GroupedExportInterface return $qb; } + #[\Override] public function requiredRole(): string { return AccompanyingPeriodVoter::STATS; } + #[\Override] public function supportsModifiers(): array { return [ diff --git a/src/Bundle/ChillPersonBundle/Export/Export/CountHouseholdInPeriod.php b/src/Bundle/ChillPersonBundle/Export/Export/CountHouseholdInPeriod.php index a65dcb217..2ec08f3b8 100644 --- a/src/Bundle/ChillPersonBundle/Export/Export/CountHouseholdInPeriod.php +++ b/src/Bundle/ChillPersonBundle/Export/Export/CountHouseholdInPeriod.php @@ -29,7 +29,7 @@ use Symfony\Component\Form\FormBuilderInterface; class CountHouseholdInPeriod implements ExportInterface, GroupedExportInterface { - private const TR_PREFIX = 'export.export.nb_household_with_course.'; + private const string TR_PREFIX = 'export.export.nb_household_with_course.'; private readonly bool $filterStatsByCenters; public function __construct( @@ -40,6 +40,7 @@ class CountHouseholdInPeriod implements ExportInterface, GroupedExportInterface $this->filterStatsByCenters = $parameterBag->get('chill_main')['acl']['filter_stats_by_center']; } + #[\Override] public function buildForm(FormBuilderInterface $builder) { $builder @@ -49,26 +50,31 @@ class CountHouseholdInPeriod implements ExportInterface, GroupedExportInterface ]); } + #[\Override] public function getFormDefaultData(): array { return ['calc_date' => new RollingDate(RollingDate::T_TODAY)]; } + #[\Override] public function getAllowedFormattersTypes(): array { return [FormatterInterface::TYPE_TABULAR]; } + #[\Override] public function getDescription(): string { return self::TR_PREFIX.'Count household with accompanying course by various parameters.'; } + #[\Override] public function getGroup(): string { return 'Exports of households'; } + #[\Override] public function getLabels($key, array $values, $data) { return static function ($value) use ($key) { @@ -88,26 +94,31 @@ class CountHouseholdInPeriod implements ExportInterface, GroupedExportInterface }; } + #[\Override] public function getQueryKeys($data): array { return ['household_export_result', 'acp_export_result']; } + #[\Override] public function getResult($query, $data) { return $query->getQuery()->getResult(Query::HYDRATE_SCALAR); } + #[\Override] public function getTitle(): string { return self::TR_PREFIX.'Count households with accompanying course'; } + #[\Override] public function getType(): string { return Declarations::HOUSEHOLD_TYPE; } + #[\Override] public function initiateQuery(array $requiredModifiers, array $acl, array $data = []) { $centers = array_map(static fn ($el) => $el['center'], $acl); @@ -145,11 +156,13 @@ class CountHouseholdInPeriod implements ExportInterface, GroupedExportInterface return $qb; } + #[\Override] public function requiredRole(): string { return HouseholdVoter::STATS; } + #[\Override] public function supportsModifiers(): array { return [ diff --git a/src/Bundle/ChillPersonBundle/Export/Export/CountPerson.php b/src/Bundle/ChillPersonBundle/Export/Export/CountPerson.php index a1e855b0e..d766237a8 100644 --- a/src/Bundle/ChillPersonBundle/Export/Export/CountPerson.php +++ b/src/Bundle/ChillPersonBundle/Export/Export/CountPerson.php @@ -34,31 +34,37 @@ class CountPerson implements ExportInterface, GroupedExportInterface $this->filterStatsByCenters = $parameterBag->get('chill_main')['acl']['filter_stats_by_center']; } + #[\Override] public function buildForm(FormBuilderInterface $builder) { // No form necessary } + #[\Override] public function getFormDefaultData(): array { return []; } + #[\Override] public function getAllowedFormattersTypes() { return [FormatterInterface::TYPE_TABULAR]; } + #[\Override] public function getDescription() { return 'Count people by various parameters.'; } + #[\Override] public function getGroup(): string { return 'Exports of persons'; } + #[\Override] public function getLabels($key, array $values, $data) { if ('export_result' !== $key) { @@ -71,21 +77,25 @@ class CountPerson implements ExportInterface, GroupedExportInterface return static fn ($value) => $labels[$value]; } + #[\Override] public function getQueryKeys($data) { return ['export_result']; } + #[\Override] public function getResult($query, $data) { return $query->getQuery()->getResult(Query::HYDRATE_SCALAR); } + #[\Override] public function getTitle() { return 'Count people'; } + #[\Override] public function getType() { return Declarations::PERSON_TYPE; @@ -96,6 +106,7 @@ class CountPerson implements ExportInterface, GroupedExportInterface * * @return QueryBuilder */ + #[\Override] public function initiateQuery(array $requiredModifiers, array $acl, array $data = []) { $centers = array_map(static fn ($el) => $el['center'], $acl); @@ -117,11 +128,13 @@ class CountPerson implements ExportInterface, GroupedExportInterface return $qb; } + #[\Override] public function requiredRole(): string { return PersonVoter::STATS; } + #[\Override] public function supportsModifiers() { return [ diff --git a/src/Bundle/ChillPersonBundle/Export/Export/CountPersonOnAccompanyingPeriodWorkAssociatePersonOnWork.php b/src/Bundle/ChillPersonBundle/Export/Export/CountPersonOnAccompanyingPeriodWorkAssociatePersonOnWork.php index 13dd0d512..15572edf5 100644 --- a/src/Bundle/ChillPersonBundle/Export/Export/CountPersonOnAccompanyingPeriodWorkAssociatePersonOnWork.php +++ b/src/Bundle/ChillPersonBundle/Export/Export/CountPersonOnAccompanyingPeriodWorkAssociatePersonOnWork.php @@ -36,31 +36,37 @@ class CountPersonOnAccompanyingPeriodWorkAssociatePersonOnWork implements Export $this->filterStatsByCenters = $parameterBag->get('chill_main')['acl']['filter_stats_by_center']; } + #[\Override] public function buildForm(FormBuilderInterface $builder): void { // No form necessary? } + #[\Override] public function getFormDefaultData(): array { return []; } + #[\Override] public function getAllowedFormattersTypes(): array { return [FormatterInterface::TYPE_TABULAR]; } + #[\Override] public function getDescription(): string { return 'export.export.count_person_on_acpw_associate_person_on_work.description'; } + #[\Override] public function getGroup(): string { return 'Exports of social work actions'; } + #[\Override] public function getLabels($key, array $values, $data) { if ('export_result' !== $key) { @@ -73,26 +79,31 @@ class CountPersonOnAccompanyingPeriodWorkAssociatePersonOnWork implements Export return static fn ($value) => $labels[$value]; } + #[\Override] public function getQueryKeys($data): array { return ['export_result']; } + #[\Override] public function getResult($query, $data) { return $query->getQuery()->getResult(Query::HYDRATE_SCALAR); } + #[\Override] public function getTitle(): string { return 'export.export.count_person_on_acpw_associate_person_on_work.title'; } + #[\Override] public function getType(): string { return Declarations::SOCIAL_WORK_ACTION_TYPE; } + #[\Override] public function initiateQuery(array $requiredModifiers, array $acl, array $data = []): QueryBuilder { $centers = array_map(static fn ($el) => $el['center'], $acl); @@ -123,11 +134,13 @@ class CountPersonOnAccompanyingPeriodWorkAssociatePersonOnWork implements Export return $qb; } + #[\Override] public function requiredRole(): string { return AccompanyingPeriodVoter::STATS; } + #[\Override] public function supportsModifiers(): array { return [ diff --git a/src/Bundle/ChillPersonBundle/Export/Export/CountPersonWithAccompanyingCourse.php b/src/Bundle/ChillPersonBundle/Export/Export/CountPersonWithAccompanyingCourse.php index ef000603a..5227f7829 100644 --- a/src/Bundle/ChillPersonBundle/Export/Export/CountPersonWithAccompanyingCourse.php +++ b/src/Bundle/ChillPersonBundle/Export/Export/CountPersonWithAccompanyingCourse.php @@ -38,31 +38,37 @@ class CountPersonWithAccompanyingCourse implements ExportInterface, GroupedExpor $this->filterStatsByCenters = $parameterBag->get('chill_main')['acl']['filter_stats_by_center']; } + #[\Override] public function buildForm(FormBuilderInterface $builder) { // TODO: Implement buildForm() method. } + #[\Override] public function getFormDefaultData(): array { return []; } + #[\Override] public function getAllowedFormattersTypes(): array { return [FormatterInterface::TYPE_TABULAR]; } + #[\Override] public function getDescription(): string { return 'Count people participating in an accompanying course by various parameters.'; } + #[\Override] public function getGroup(): string { return 'Exports of persons'; } + #[\Override] public function getLabels($key, array $values, $data) { if ('export_result' !== $key) { @@ -75,26 +81,31 @@ class CountPersonWithAccompanyingCourse implements ExportInterface, GroupedExpor return static fn ($value) => $labels[$value]; } + #[\Override] public function getQueryKeys($data): array { return ['export_result']; } + #[\Override] public function getResult($query, $data) { return $query->getQuery()->getResult(Query::HYDRATE_SCALAR); } + #[\Override] public function getTitle(): string { return 'Count people participating in an accompanying course'; } + #[\Override] public function getType(): string { return Declarations::HOUSEHOLD_TYPE; } + #[\Override] public function initiateQuery(array $requiredModifiers, array $acl, array $data = []) { $centers = array_map(static fn ($el) => $el['center'], $acl); @@ -124,11 +135,13 @@ class CountPersonWithAccompanyingCourse implements ExportInterface, GroupedExpor return $qb; } + #[\Override] public function requiredRole(): string { return AccompanyingPeriodVoter::STATS; } + #[\Override] public function supportsModifiers(): array { return [ diff --git a/src/Bundle/ChillPersonBundle/Export/Export/ListAccompanyingPeriod.php b/src/Bundle/ChillPersonBundle/Export/Export/ListAccompanyingPeriod.php index 7d0e52169..0aa0b1324 100644 --- a/src/Bundle/ChillPersonBundle/Export/Export/ListAccompanyingPeriod.php +++ b/src/Bundle/ChillPersonBundle/Export/Export/ListAccompanyingPeriod.php @@ -36,6 +36,7 @@ final readonly class ListAccompanyingPeriod implements ListInterface, GroupedExp private FilterListAccompanyingPeriodHelperInterface $filterListAccompanyingPeriodHelper, ) {} + #[\Override] public function buildForm(FormBuilderInterface $builder) { $builder @@ -46,6 +47,7 @@ final readonly class ListAccompanyingPeriod implements ListInterface, GroupedExp ]); } + #[\Override] public function getFormDefaultData(): array { return [ @@ -53,46 +55,55 @@ final readonly class ListAccompanyingPeriod implements ListInterface, GroupedExp ]; } + #[\Override] public function getAllowedFormattersTypes() { return [FormatterInterface::TYPE_LIST]; } + #[\Override] public function getDescription() { return 'export.list.acp.Generate a list of accompanying periods, filtered on different parameters.'; } + #[\Override] public function getGroup(): string { return 'Exports of accompanying courses'; } + #[\Override] public function getLabels($key, array $values, $data) { return $this->listAccompanyingPeriodHelper->getLabels($key, $values, $data); } + #[\Override] public function getQueryKeys($data) { return $this->listAccompanyingPeriodHelper->getQueryKeys($data); } + #[\Override] public function getResult($query, $data) { return $query->getQuery()->getResult(AbstractQuery::HYDRATE_SCALAR); } + #[\Override] public function getTitle() { return 'export.list.acp.List of accompanying periods'; } + #[\Override] public function getType() { return Declarations::PERSON_TYPE; } + #[\Override] public function initiateQuery(array $requiredModifiers, array $acl, array $data = []) { $qb = $this->entityManager->createQueryBuilder(); @@ -116,11 +127,13 @@ final readonly class ListAccompanyingPeriod implements ListInterface, GroupedExp return $qb; } + #[\Override] public function requiredRole(): string { return PersonVoter::LISTS; } + #[\Override] public function supportsModifiers() { return [ diff --git a/src/Bundle/ChillPersonBundle/Export/Export/ListAccompanyingPeriodWorkAssociatePersonOnAccompanyingPeriod.php b/src/Bundle/ChillPersonBundle/Export/Export/ListAccompanyingPeriodWorkAssociatePersonOnAccompanyingPeriod.php index 8f63b1584..30fdada69 100644 --- a/src/Bundle/ChillPersonBundle/Export/Export/ListAccompanyingPeriodWorkAssociatePersonOnAccompanyingPeriod.php +++ b/src/Bundle/ChillPersonBundle/Export/Export/ListAccompanyingPeriodWorkAssociatePersonOnAccompanyingPeriod.php @@ -48,7 +48,7 @@ use Symfony\Component\Form\FormBuilderInterface; final readonly class ListAccompanyingPeriodWorkAssociatePersonOnAccompanyingPeriod implements ListInterface, GroupedExportInterface { - private const FIELDS = [ + private const array FIELDS = [ 'id', 'socialActionId', 'socialAction', @@ -93,6 +93,7 @@ final readonly class ListAccompanyingPeriodWorkAssociatePersonOnAccompanyingPeri private readonly FilterListAccompanyingPeriodHelperInterface $filterListAccompanyingPeriodHelper, ) {} + #[\Override] public function buildForm(FormBuilderInterface $builder) { $builder @@ -103,26 +104,31 @@ final readonly class ListAccompanyingPeriodWorkAssociatePersonOnAccompanyingPeri ]); } + #[\Override] public function getFormDefaultData(): array { return ['calc_date' => new RollingDate(RollingDate::T_TODAY)]; } + #[\Override] public function getAllowedFormattersTypes() { return [FormatterInterface::TYPE_LIST]; } + #[\Override] public function getDescription(): string { return 'export.list.acpw_associate_period.List description'; } + #[\Override] public function getGroup(): string { return 'Exports of social work actions'; } + #[\Override] public function getLabels($key, array $values, $data) { return match ($key) { @@ -177,26 +183,31 @@ final readonly class ListAccompanyingPeriodWorkAssociatePersonOnAccompanyingPeri }; } + #[\Override] public function getQueryKeys($data) { return self::FIELDS; } + #[\Override] public function getResult($query, $data) { return $query->getQuery()->getResult(AbstractQuery::HYDRATE_SCALAR); } + #[\Override] public function getTitle(): string { return 'export.list.acpw_associate_period.List of accompanying period works'; } + #[\Override] public function getType(): string { return Declarations::SOCIAL_WORK_ACTION_TYPE; } + #[\Override] public function initiateQuery(array $requiredModifiers, array $acl, array $data = []) { $centers = array_map(static fn ($el) => $el['center'], $acl); @@ -226,11 +237,13 @@ final readonly class ListAccompanyingPeriodWorkAssociatePersonOnAccompanyingPeri return $qb; } + #[\Override] public function requiredRole(): string { return AccompanyingPeriodVoter::STATS; } + #[\Override] public function supportsModifiers(): array { return [ diff --git a/src/Bundle/ChillPersonBundle/Export/Export/ListAccompanyingPeriodWorkAssociatePersonOnWork.php b/src/Bundle/ChillPersonBundle/Export/Export/ListAccompanyingPeriodWorkAssociatePersonOnWork.php index fe200ca02..1d26a8648 100644 --- a/src/Bundle/ChillPersonBundle/Export/Export/ListAccompanyingPeriodWorkAssociatePersonOnWork.php +++ b/src/Bundle/ChillPersonBundle/Export/Export/ListAccompanyingPeriodWorkAssociatePersonOnWork.php @@ -48,7 +48,7 @@ use Symfony\Component\Form\FormBuilderInterface; final readonly class ListAccompanyingPeriodWorkAssociatePersonOnWork implements ListInterface, GroupedExportInterface { - private const FIELDS = [ + private const array FIELDS = [ 'id', 'socialActionId', 'socialAction', @@ -93,6 +93,7 @@ final readonly class ListAccompanyingPeriodWorkAssociatePersonOnWork implements private FilterListAccompanyingPeriodHelperInterface $filterListAccompanyingPeriodHelper, ) {} + #[\Override] public function buildForm(FormBuilderInterface $builder) { $builder @@ -103,26 +104,31 @@ final readonly class ListAccompanyingPeriodWorkAssociatePersonOnWork implements ]); } + #[\Override] public function getFormDefaultData(): array { return ['calc_date' => new RollingDate(RollingDate::T_TODAY)]; } + #[\Override] public function getAllowedFormattersTypes() { return [FormatterInterface::TYPE_LIST]; } + #[\Override] public function getDescription(): string { return 'export.list.acpw_associate_work.List description'; } + #[\Override] public function getGroup(): string { return 'Exports of social work actions'; } + #[\Override] public function getLabels($key, array $values, $data) { return match ($key) { @@ -177,26 +183,31 @@ final readonly class ListAccompanyingPeriodWorkAssociatePersonOnWork implements }; } + #[\Override] public function getQueryKeys($data) { return self::FIELDS; } + #[\Override] public function getResult($query, $data) { return $query->getQuery()->getResult(AbstractQuery::HYDRATE_SCALAR); } + #[\Override] public function getTitle(): string { return 'export.list.acpw_associate_work.List of accompanying period works'; } + #[\Override] public function getType(): string { return Declarations::SOCIAL_WORK_ACTION_TYPE; } + #[\Override] public function initiateQuery(array $requiredModifiers, array $acl, array $data = []) { $centers = array_map(static fn ($el) => $el['center'], $acl); @@ -221,11 +232,13 @@ final readonly class ListAccompanyingPeriodWorkAssociatePersonOnWork implements return $qb; } + #[\Override] public function requiredRole(): string { return AccompanyingPeriodVoter::STATS; } + #[\Override] public function supportsModifiers(): array { return [ diff --git a/src/Bundle/ChillPersonBundle/Export/Export/ListEvaluation.php b/src/Bundle/ChillPersonBundle/Export/Export/ListEvaluation.php index 71d9924be..e5c30be2e 100644 --- a/src/Bundle/ChillPersonBundle/Export/Export/ListEvaluation.php +++ b/src/Bundle/ChillPersonBundle/Export/Export/ListEvaluation.php @@ -41,7 +41,7 @@ use Symfony\Component\Form\FormBuilderInterface; final readonly class ListEvaluation implements ListInterface, GroupedExportInterface { - private const FIELDS = [ + private const array FIELDS = [ 'id', 'startDate', 'endDate', @@ -83,6 +83,7 @@ final readonly class ListEvaluation implements ListInterface, GroupedExportInter private FilterListAccompanyingPeriodHelperInterface $filterListAccompanyingPeriodHelper, ) {} + #[\Override] public function buildForm(FormBuilderInterface $builder) { $builder @@ -93,26 +94,31 @@ final readonly class ListEvaluation implements ListInterface, GroupedExportInter ]); } + #[\Override] public function getFormDefaultData(): array { return ['calc_date' => new RollingDate(RollingDate::T_TODAY)]; } + #[\Override] public function getAllowedFormattersTypes() { return [FormatterInterface::TYPE_LIST]; } + #[\Override] public function getDescription(): string { return 'export.list.eval.Generate a list of evaluations, filtered on different parameters'; } + #[\Override] public function getGroup(): string { return 'Exports of evaluations'; } + #[\Override] public function getLabels($key, array $values, $data) { return match ($key) { @@ -165,26 +171,31 @@ final readonly class ListEvaluation implements ListInterface, GroupedExportInter }; } + #[\Override] public function getQueryKeys($data) { return self::FIELDS; } + #[\Override] public function getResult($query, $data) { return $query->getQuery()->getResult(AbstractQuery::HYDRATE_SCALAR); } + #[\Override] public function getTitle(): string { return 'export.list.eval.List of evaluations'; } + #[\Override] public function getType(): string { return Declarations::EVAL_TYPE; } + #[\Override] public function initiateQuery(array $requiredModifiers, array $acl, array $data = []) { $centers = array_map(static fn ($el) => $el['center'], $acl); @@ -215,11 +226,13 @@ final readonly class ListEvaluation implements ListInterface, GroupedExportInter return $qb; } + #[\Override] public function requiredRole(): string { return AccompanyingPeriodVoter::STATS; } + #[\Override] public function supportsModifiers(): array { return [ diff --git a/src/Bundle/ChillPersonBundle/Export/Export/ListHouseholdInPeriod.php b/src/Bundle/ChillPersonBundle/Export/Export/ListHouseholdInPeriod.php index 21f7a5923..116b3d844 100644 --- a/src/Bundle/ChillPersonBundle/Export/Export/ListHouseholdInPeriod.php +++ b/src/Bundle/ChillPersonBundle/Export/Export/ListHouseholdInPeriod.php @@ -35,7 +35,7 @@ use Symfony\Component\Form\FormBuilderInterface; class ListHouseholdInPeriod implements ListInterface, GroupedExportInterface { - private const FIELDS = [ + private const array FIELDS = [ 'id', 'membersCount', 'membersId', @@ -57,6 +57,7 @@ class ListHouseholdInPeriod implements ListInterface, GroupedExportInterface $this->filterStatsByCenters = $parameterBag->get('chill_main')['acl']['filter_stats_by_center']; } + #[\Override] public function buildForm(FormBuilderInterface $builder) { $builder @@ -67,26 +68,31 @@ class ListHouseholdInPeriod implements ListInterface, GroupedExportInterface ]); } + #[\Override] public function getFormDefaultData(): array { return ['calc_date' => new RollingDate(RollingDate::T_TODAY)]; } + #[\Override] public function getAllowedFormattersTypes() { return [FormatterInterface::TYPE_LIST]; } + #[\Override] public function getDescription(): string { return 'export.list.household.List description'; } + #[\Override] public function getGroup(): string { return 'Exports of households'; } + #[\Override] public function getLabels($key, array $values, $data) { if (str_starts_with($key, 'address_fields')) { @@ -106,6 +112,7 @@ class ListHouseholdInPeriod implements ListInterface, GroupedExportInterface }; } + #[\Override] public function getQueryKeys($data): array { return array_merge( @@ -114,21 +121,25 @@ class ListHouseholdInPeriod implements ListInterface, GroupedExportInterface ); } + #[\Override] public function getResult($query, $data) { return $query->getQuery()->getResult(AbstractQuery::HYDRATE_SCALAR); } + #[\Override] public function getTitle(): string { return 'export.list.household.List household associated with accompanying period title'; } + #[\Override] public function getType(): string { return Declarations::HOUSEHOLD_TYPE; } + #[\Override] public function initiateQuery(array $requiredModifiers, array $acl, array $data = []) { $centers = array_map(static fn ($el) => $el['center'], $acl); @@ -166,11 +177,13 @@ class ListHouseholdInPeriod implements ListInterface, GroupedExportInterface return $qb; } + #[\Override] public function requiredRole(): string { return HouseholdVoter::STATS; } + #[\Override] public function supportsModifiers(): array { return [ diff --git a/src/Bundle/ChillPersonBundle/Export/Export/ListPerson.php b/src/Bundle/ChillPersonBundle/Export/Export/ListPerson.php index 2b8bfad20..1d76adc24 100644 --- a/src/Bundle/ChillPersonBundle/Export/Export/ListPerson.php +++ b/src/Bundle/ChillPersonBundle/Export/Export/ListPerson.php @@ -46,6 +46,7 @@ class ListPerson implements ListInterface, GroupedExportInterface $this->filterStatsByCenters = $parameterBag->get('chill_main')['acl']['filter_stats_by_center']; } + #[\Override] public function buildForm(FormBuilderInterface $builder) { // add a date field for addresses @@ -56,26 +57,31 @@ class ListPerson implements ListInterface, GroupedExportInterface ]); } + #[\Override] public function getFormDefaultData(): array { return ['address_date' => new \DateTimeImmutable()]; } + #[\Override] public function getAllowedFormattersTypes() { return [FormatterInterface::TYPE_LIST]; } + #[\Override] public function getDescription() { return 'Create a list of people according to various filters.'; } + #[\Override] public function getGroup(): string { return 'Exports of persons'; } + #[\Override] public function getLabels($key, array $values, $data) { if (\in_array($key, $this->listPersonHelper->getAllKeys(), true)) { @@ -85,6 +91,7 @@ class ListPerson implements ListInterface, GroupedExportInterface return $this->getLabelForCustomField($key, $values, $data); } + #[\Override] public function getQueryKeys($data) { $fields = []; @@ -97,16 +104,19 @@ class ListPerson implements ListInterface, GroupedExportInterface return [...$fields, ...\array_keys($this->slugs)]; } + #[\Override] public function getResult($query, $data) { return $query->getQuery()->getResult(Query::HYDRATE_SCALAR); } + #[\Override] public function getTitle() { return 'List peoples'; } + #[\Override] public function getType() { return Declarations::PERSON_TYPE; @@ -115,6 +125,7 @@ class ListPerson implements ListInterface, GroupedExportInterface /** * param array{fields: string[], address_date: DateTimeImmutable} $data. */ + #[\Override] public function initiateQuery(array $requiredModifiers, array $acl, array $data = []) { $centers = array_map(static fn ($el) => $el['center'], $acl); @@ -165,11 +176,13 @@ class ListPerson implements ListInterface, GroupedExportInterface return $qb; } + #[\Override] public function requiredRole(): string { return PersonVoter::LISTS; } + #[\Override] public function supportsModifiers() { return [Declarations::PERSON_TYPE]; diff --git a/src/Bundle/ChillPersonBundle/Export/Export/ListPersonDuplicate.php b/src/Bundle/ChillPersonBundle/Export/Export/ListPersonDuplicate.php index 1a1fd0316..0c2de050f 100644 --- a/src/Bundle/ChillPersonBundle/Export/Export/ListPersonDuplicate.php +++ b/src/Bundle/ChillPersonBundle/Export/Export/ListPersonDuplicate.php @@ -35,7 +35,7 @@ class ListPersonDuplicate implements DirectExportInterface, ExportElementValidat /** * @var float */ - private const PRECISION_DEFAULT_VALUE = 0.7; + private const float PRECISION_DEFAULT_VALUE = 0.7; /** * @var string @@ -58,6 +58,7 @@ class ListPersonDuplicate implements DirectExportInterface, ExportElementValidat '://'.$routeParameters['host']; } + #[\Override] public function buildForm(FormBuilderInterface $builder) { $builder->add('precision', NumberType::class, [ @@ -65,11 +66,13 @@ class ListPersonDuplicate implements DirectExportInterface, ExportElementValidat ]); } + #[\Override] public function getFormDefaultData(): array { return ['precision' => self::PRECISION_DEFAULT_VALUE]; } + #[\Override] public function generate(array $acl, array $data = []): Response { $values = []; @@ -112,11 +115,13 @@ class ListPersonDuplicate implements DirectExportInterface, ExportElementValidat return $response; } + #[\Override] public function getDescription(): string { return 'Create a list of duplicate people'; } + #[\Override] public function getGroup(): string { return 'Exports of persons'; @@ -125,16 +130,19 @@ class ListPersonDuplicate implements DirectExportInterface, ExportElementValidat /** * @return string */ + #[\Override] public function getTitle() { return 'List duplicates'; } + #[\Override] public function requiredRole(): string { return PersonVoter::DUPLICATE; } + #[\Override] public function validateForm($data, ExecutionContextInterface $context) {} protected function getHeaders(): array diff --git a/src/Bundle/ChillPersonBundle/Export/Export/ListPersonHavingAccompanyingPeriod.php b/src/Bundle/ChillPersonBundle/Export/Export/ListPersonHavingAccompanyingPeriod.php index 4a44f2dc5..68a775718 100644 --- a/src/Bundle/ChillPersonBundle/Export/Export/ListPersonHavingAccompanyingPeriod.php +++ b/src/Bundle/ChillPersonBundle/Export/Export/ListPersonHavingAccompanyingPeriod.php @@ -48,6 +48,7 @@ final readonly class ListPersonHavingAccompanyingPeriod implements ListInterface $this->filterStatsByCenters = $parameterBag->get('chill_main')['acl']['filter_stats_by_center']; } + #[\Override] public function buildForm(FormBuilderInterface $builder) { $builder->add('address_date_rolling', PickRollingDateType::class, [ @@ -56,46 +57,55 @@ final readonly class ListPersonHavingAccompanyingPeriod implements ListInterface ]); } + #[\Override] public function getFormDefaultData(): array { return ['address_date_rolling' => new RollingDate(RollingDate::T_TODAY)]; } + #[\Override] public function getAllowedFormattersTypes() { return [FormatterInterface::TYPE_LIST]; } + #[\Override] public function getDescription() { return 'export.list.person_with_acp.Create a list of people having an accompaying periods, according to various filters.'; } + #[\Override] public function getGroup(): string { return 'Exports of persons'; } + #[\Override] public function getLabels($key, array $values, $data) { return $this->listPersonHelper->getLabels($key, $values, $data); } + #[\Override] public function getQueryKeys($data) { return $this->listPersonHelper->getAllKeys(); } + #[\Override] public function getResult($query, $data) { return $query->getQuery()->getResult(AbstractQuery::HYDRATE_SCALAR); } + #[\Override] public function getTitle() { return 'export.list.person_with_acp.List peoples having an accompanying period'; } + #[\Override] public function getType() { return Declarations::PERSON_TYPE; @@ -104,6 +114,7 @@ final readonly class ListPersonHavingAccompanyingPeriod implements ListInterface /** * param array{fields: string[], address_date: DateTimeImmutable} $data. */ + #[\Override] public function initiateQuery(array $requiredModifiers, array $acl, array $data = []) { $centers = array_map(static fn ($el) => $el['center'], $acl); @@ -136,11 +147,13 @@ final readonly class ListPersonHavingAccompanyingPeriod implements ListInterface return $qb; } + #[\Override] public function requiredRole(): string { return PersonVoter::LISTS; } + #[\Override] public function supportsModifiers() { return [Declarations::PERSON_TYPE, Declarations::ACP_TYPE]; diff --git a/src/Bundle/ChillPersonBundle/Export/Export/ListPersonWithAccompanyingPeriodDetails.php b/src/Bundle/ChillPersonBundle/Export/Export/ListPersonWithAccompanyingPeriodDetails.php index 42a2205a1..84af2fef0 100644 --- a/src/Bundle/ChillPersonBundle/Export/Export/ListPersonWithAccompanyingPeriodDetails.php +++ b/src/Bundle/ChillPersonBundle/Export/Export/ListPersonWithAccompanyingPeriodDetails.php @@ -43,6 +43,7 @@ final readonly class ListPersonWithAccompanyingPeriodDetails implements ListInte private FilterListAccompanyingPeriodHelperInterface $filterListAccompanyingPeriodHelper, ) {} + #[\Override] public function buildForm(FormBuilderInterface $builder) { $builder->add('address_date', PickRollingDateType::class, [ @@ -51,26 +52,31 @@ final readonly class ListPersonWithAccompanyingPeriodDetails implements ListInte ]); } + #[\Override] public function getFormDefaultData(): array { return ['address_date' => new RollingDate(RollingDate::T_TODAY)]; } + #[\Override] public function getAllowedFormattersTypes() { return [FormatterInterface::TYPE_LIST]; } + #[\Override] public function getDescription() { return 'export.list.person_with_acp.Create a list of people having an accompaying periods with details of period, according to various filters.'; } + #[\Override] public function getGroup(): string { return 'Exports of persons'; } + #[\Override] public function getLabels($key, array $values, $data) { if (\in_array($key, $this->listPersonHelper->getAllKeys(), true)) { @@ -80,6 +86,7 @@ final readonly class ListPersonWithAccompanyingPeriodDetails implements ListInte return $this->listAccompanyingPeriodHelper->getLabels($key, $values, $data); } + #[\Override] public function getQueryKeys($data) { return array_merge( @@ -88,16 +95,19 @@ final readonly class ListPersonWithAccompanyingPeriodDetails implements ListInte ); } + #[\Override] public function getResult($query, $data) { return $query->getQuery()->getResult(AbstractQuery::HYDRATE_SCALAR); } + #[\Override] public function getTitle() { return 'export.list.person_with_acp.List peoples having an accompanying period with period details'; } + #[\Override] public function getType() { return Declarations::PERSON_TYPE; @@ -106,6 +116,7 @@ final readonly class ListPersonWithAccompanyingPeriodDetails implements ListInte /** * param array{fields: string[], address_date: DateTimeImmutable} $data. */ + #[\Override] public function initiateQuery(array $requiredModifiers, array $acl, array $data = []) { $centers = array_map(static fn ($el) => $el['center'], $acl); @@ -133,11 +144,13 @@ final readonly class ListPersonWithAccompanyingPeriodDetails implements ListInte return $qb; } + #[\Override] public function requiredRole(): string { return PersonVoter::LISTS; } + #[\Override] public function supportsModifiers() { return [Declarations::PERSON_TYPE, Declarations::ACP_TYPE]; diff --git a/src/Bundle/ChillPersonBundle/Export/Export/StatAccompanyingCourseDuration.php b/src/Bundle/ChillPersonBundle/Export/Export/StatAccompanyingCourseDuration.php index 58f06ab7e..ec96688f7 100644 --- a/src/Bundle/ChillPersonBundle/Export/Export/StatAccompanyingCourseDuration.php +++ b/src/Bundle/ChillPersonBundle/Export/Export/StatAccompanyingCourseDuration.php @@ -44,6 +44,7 @@ final readonly class StatAccompanyingCourseDuration implements ExportInterface, $this->filterStatsByCenters = $parameterBag->get('chill_main')['acl']['filter_stats_by_center']; } + #[\Override] public function buildForm(FormBuilderInterface $builder): void { $builder->add('closingdate_rolling', PickRollingDateType::class, [ @@ -51,26 +52,31 @@ final readonly class StatAccompanyingCourseDuration implements ExportInterface, ]); } + #[\Override] public function getFormDefaultData(): array { return ['closingdate_rolling' => new RollingDate(RollingDate::T_TODAY)]; } + #[\Override] public function getAllowedFormattersTypes(): array { return [FormatterInterface::TYPE_TABULAR]; } + #[\Override] public function getDescription(): string { return 'Create an average of accompanying courses duration of each person participation to accompanying course, according to filters on persons, accompanying course'; } + #[\Override] public function getGroup(): string { return 'Exports of accompanying courses'; } + #[\Override] public function getLabels($key, array $values, $data) { return static function ($value) use ($key) { @@ -92,26 +98,31 @@ final readonly class StatAccompanyingCourseDuration implements ExportInterface, }; } + #[\Override] public function getQueryKeys($data): array { return ['avg_export_result', 'count_acp_export_result', 'count_acppart_export_result', 'count_pers_export_result']; } + #[\Override] public function getResult($query, $data) { return $query->getQuery()->getResult(Query::HYDRATE_SCALAR); } + #[\Override] public function getTitle(): string { return 'Accompanying courses participation duration and number of participations'; } + #[\Override] public function getType(): string { return Declarations::ACP_TYPE; } + #[\Override] public function initiateQuery(array $requiredModifiers, array $acl, array $data = []): QueryBuilder { $centers = array_map(static fn ($el) => $el['center'], $acl); @@ -150,11 +161,13 @@ final readonly class StatAccompanyingCourseDuration implements ExportInterface, return $qb; } + #[\Override] public function requiredRole(): string { return AccompanyingPeriodVoter::STATS; } + #[\Override] public function supportsModifiers(): array { return [ diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/ActiveOnDateFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/ActiveOnDateFilter.php index 6bcb4f8b8..fd0cfcee7 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/ActiveOnDateFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/ActiveOnDateFilter.php @@ -24,11 +24,13 @@ class ActiveOnDateFilter implements FilterInterface { public function __construct(private readonly RollingDateConverterInterface $rollingDateConverter) {} + #[\Override] public function addRole(): ?string { return null; } + #[\Override] public function alterQuery(QueryBuilder $qb, $data) { $where = $qb->getDQLPart('where'); @@ -54,22 +56,26 @@ class ActiveOnDateFilter implements FilterInterface ); } + #[\Override] public function applyOn(): string { return Declarations::ACP_TYPE; } + #[\Override] public function buildForm(FormBuilderInterface $builder) { $builder ->add('on_date', PickRollingDateType::class, []); } + #[\Override] public function getFormDefaultData(): array { return ['on_date' => new RollingDate(RollingDate::T_TODAY)]; } + #[\Override] public function describeAction($data, $format = 'string'): array { return ['Filtered by actives courses: active on %ondate%', [ @@ -77,6 +83,7 @@ class ActiveOnDateFilter implements FilterInterface ]]; } + #[\Override] public function getTitle(): string { return 'Filter by active on date'; diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/ActiveOneDayBetweenDatesFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/ActiveOneDayBetweenDatesFilter.php index 3b7c4fe25..ada8bdfab 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/ActiveOneDayBetweenDatesFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/ActiveOneDayBetweenDatesFilter.php @@ -23,11 +23,13 @@ class ActiveOneDayBetweenDatesFilter implements FilterInterface { public function __construct(private readonly RollingDateConverterInterface $rollingDateConverter) {} + #[\Override] public function addRole(): ?string { return null; } + #[\Override] public function alterQuery(QueryBuilder $qb, $data) { $clause = "OVERLAPSI (acp.openingDate, acp.closingDate), (:datefrom, :dateto) = 'TRUE'"; @@ -43,11 +45,13 @@ class ActiveOneDayBetweenDatesFilter implements FilterInterface ); } + #[\Override] public function applyOn(): string { return Declarations::ACP_TYPE; } + #[\Override] public function buildForm(FormBuilderInterface $builder) { $builder @@ -55,11 +59,13 @@ class ActiveOneDayBetweenDatesFilter implements FilterInterface ->add('date_to', PickRollingDateType::class, []); } + #[\Override] public function getFormDefaultData(): array { return ['date_from' => new RollingDate(RollingDate::T_YEAR_PREVIOUS_START), 'date_to' => new RollingDate(RollingDate::T_TODAY)]; } + #[\Override] public function describeAction($data, $format = 'string'): array { return ['Filtered by actives courses: at least one day between %datefrom% and %dateto%', [ @@ -68,6 +74,7 @@ class ActiveOneDayBetweenDatesFilter implements FilterInterface ]]; } + #[\Override] public function getTitle(): string { return 'Filter by active at least one day between dates'; diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/AdministrativeLocationFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/AdministrativeLocationFilter.php index 915a2c9e6..8b1da69cc 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/AdministrativeLocationFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/AdministrativeLocationFilter.php @@ -22,11 +22,13 @@ class AdministrativeLocationFilter implements FilterInterface { public function __construct(private readonly TranslatableStringHelper $translatableStringHelper) {} + #[\Override] public function addRole(): ?string { return null; } + #[\Override] public function alterQuery(QueryBuilder $qb, $data) { $clause = $qb->expr()->in('acp.administrativeLocation', ':locations'); @@ -35,11 +37,13 @@ class AdministrativeLocationFilter implements FilterInterface ->setParameter('locations', $data['accepted_locations']); } + #[\Override] public function applyOn(): string { return Declarations::ACP_TYPE; } + #[\Override] public function buildForm(FormBuilderInterface $builder) { $builder->add('accepted_locations', PickUserLocationType::class, [ @@ -48,11 +52,13 @@ class AdministrativeLocationFilter implements FilterInterface ]); } + #[\Override] public function getFormDefaultData(): array { return []; } + #[\Override] public function describeAction($data, $format = 'string'): array { $locations = []; @@ -66,6 +72,7 @@ class AdministrativeLocationFilter implements FilterInterface ]]; } + #[\Override] public function getTitle(): string { return 'Filter by administrative location'; diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/ClosingMotiveFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/ClosingMotiveFilter.php index 7fb032050..08899d3b1 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/ClosingMotiveFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/ClosingMotiveFilter.php @@ -24,11 +24,13 @@ class ClosingMotiveFilter implements FilterInterface { public function __construct(private readonly TranslatableStringHelper $translatableStringHelper) {} + #[\Override] public function addRole(): ?string { return null; } + #[\Override] public function alterQuery(QueryBuilder $qb, $data) { $where = $qb->getDQLPart('where'); @@ -44,11 +46,13 @@ class ClosingMotiveFilter implements FilterInterface $qb->setParameter('closingmotive', $data['accepted_closingmotives']); } + #[\Override] public function applyOn(): string { return Declarations::ACP_TYPE; } + #[\Override] public function buildForm(FormBuilderInterface $builder) { $builder->add('accepted_closingmotives', EntityType::class, [ @@ -59,11 +63,13 @@ class ClosingMotiveFilter implements FilterInterface ]); } + #[\Override] public function getFormDefaultData(): array { return []; } + #[\Override] public function describeAction($data, $format = 'string'): array { $motives = []; @@ -78,6 +84,7 @@ class ClosingMotiveFilter implements FilterInterface ], ]; } + #[\Override] public function getTitle(): string { return 'Filter by closing motive'; diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/ConfidentialFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/ConfidentialFilter.php index 4c8baf147..846b7a845 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/ConfidentialFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/ConfidentialFilter.php @@ -21,20 +21,22 @@ use Symfony\Contracts\Translation\TranslatorInterface; class ConfidentialFilter implements FilterInterface { - private const CHOICES = [ + private const array CHOICES = [ 'is not confidential' => 'false', 'is confidential' => 'true', ]; - private const DEFAULT_CHOICE = 'false'; + private const string DEFAULT_CHOICE = 'false'; public function __construct(private readonly TranslatorInterface $translator) {} + #[\Override] public function addRole(): ?string { return null; } + #[\Override] public function alterQuery(QueryBuilder $qb, $data) { $where = $qb->getDQLPart('where'); @@ -50,11 +52,13 @@ class ConfidentialFilter implements FilterInterface $qb->setParameter('confidential', $data['accepted_confidentials']); } + #[\Override] public function applyOn(): string { return Declarations::ACP_TYPE; } + #[\Override] public function buildForm(FormBuilderInterface $builder) { $builder->add('accepted_confidentials', ChoiceType::class, [ @@ -65,11 +69,13 @@ class ConfidentialFilter implements FilterInterface ]); } + #[\Override] public function getFormDefaultData(): array { return ['accepted_confidentials' => self::DEFAULT_CHOICE]; } + #[\Override] public function describeAction($data, $format = 'string'): array { return [ @@ -81,6 +87,7 @@ class ConfidentialFilter implements FilterInterface ]; } + #[\Override] public function getTitle(): string { return 'Filter by confidential'; diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/CreatorFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/CreatorFilter.php index 4fa2c2d1d..c31a701fa 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/CreatorFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/CreatorFilter.php @@ -21,11 +21,13 @@ use Symfony\Component\Form\FormBuilderInterface; class CreatorFilter implements FilterInterface { + #[\Override] public function addRole(): ?string { return null; } + #[\Override] public function alterQuery(QueryBuilder $qb, $data) { if (!\in_array('acp_creator', $qb->getAllAliases(), true)) { @@ -37,11 +39,13 @@ class CreatorFilter implements FilterInterface ->setParameter('creators', $data['accepted_creators']); } + #[\Override] public function applyOn(): string { return Declarations::ACP_TYPE; } + #[\Override] public function buildForm(FormBuilderInterface $builder) { $builder @@ -51,11 +55,13 @@ class CreatorFilter implements FilterInterface ]); } + #[\Override] public function getFormDefaultData(): array { return []; } + #[\Override] public function describeAction($data, $format = 'string'): array { return [ @@ -70,6 +76,7 @@ class CreatorFilter implements FilterInterface ], ]; } + #[\Override] public function getTitle(): string { return 'Filter by creator'; diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/CreatorJobFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/CreatorJobFilter.php index cc7e21b08..7c98df737 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/CreatorJobFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/CreatorJobFilter.php @@ -24,18 +24,20 @@ use Symfony\Component\Form\FormBuilderInterface; class CreatorJobFilter implements FilterInterface { - private const PREFIX = 'acp_filter_creator_job'; + private const string PREFIX = 'acp_filter_creator_job'; public function __construct( private readonly TranslatableStringHelper $translatableStringHelper, private readonly UserJobRepositoryInterface $userJobRepository ) {} + #[\Override] public function addRole(): ?string { return null; } + #[\Override] public function alterQuery(QueryBuilder $qb, $data) { $p = self::PREFIX; @@ -78,11 +80,13 @@ class CreatorJobFilter implements FilterInterface ); } + #[\Override] public function applyOn(): string { return Declarations::ACP_TYPE; } + #[\Override] public function buildForm(FormBuilderInterface $builder) { $builder @@ -98,6 +102,7 @@ class CreatorJobFilter implements FilterInterface ]); } + #[\Override] public function describeAction($data, $format = 'string'): array { $creatorJobs = []; @@ -113,6 +118,7 @@ class CreatorJobFilter implements FilterInterface ]]; } + #[\Override] public function getFormDefaultData(): array { return [ @@ -120,6 +126,7 @@ class CreatorJobFilter implements FilterInterface ]; } + #[\Override] public function getTitle(): string { return 'export.filter.course.creator_job.Filter by creator job'; diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/EmergencyFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/EmergencyFilter.php index 671b87407..15eef7edd 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/EmergencyFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/EmergencyFilter.php @@ -21,20 +21,22 @@ use Symfony\Contracts\Translation\TranslatorInterface; class EmergencyFilter implements FilterInterface { - private const CHOICES = [ + private const array CHOICES = [ 'is emergency' => 'true', 'is not emergency' => 'false', ]; - private const DEFAULT_CHOICE = 'false'; + private const string DEFAULT_CHOICE = 'false'; public function __construct(private readonly TranslatorInterface $translator) {} + #[\Override] public function addRole(): ?string { return null; } + #[\Override] public function alterQuery(QueryBuilder $qb, $data) { $where = $qb->getDQLPart('where'); @@ -50,11 +52,13 @@ class EmergencyFilter implements FilterInterface $qb->setParameter('emergency', $data['accepted_emergency']); } + #[\Override] public function applyOn(): string { return Declarations::ACP_TYPE; } + #[\Override] public function buildForm(FormBuilderInterface $builder) { $builder->add('accepted_emergency', ChoiceType::class, [ @@ -65,11 +69,13 @@ class EmergencyFilter implements FilterInterface ]); } + #[\Override] public function getFormDefaultData(): array { return ['accepted_emergency' => self::DEFAULT_CHOICE]; } + #[\Override] public function describeAction($data, $format = 'string'): array { return [ @@ -81,6 +87,7 @@ class EmergencyFilter implements FilterInterface ]; } + #[\Override] public function getTitle(): string { return 'Filter by emergency'; diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/EvaluationFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/EvaluationFilter.php index bec01c249..ec378cc45 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/EvaluationFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/EvaluationFilter.php @@ -24,11 +24,13 @@ class EvaluationFilter implements FilterInterface { public function __construct(private readonly EvaluationRepositoryInterface $evaluationRepository, private readonly TranslatableStringHelper $translatableStringHelper) {} + #[\Override] public function addRole(): ?string { return null; } + #[\Override] public function alterQuery(QueryBuilder $qb, $data) { if (!\in_array('acpw', $qb->getAllAliases(), true)) { @@ -48,11 +50,13 @@ class EvaluationFilter implements FilterInterface $qb->setParameter('evaluations', $data['accepted_evaluations']); } + #[\Override] public function applyOn(): string { return Declarations::ACP_TYPE; } + #[\Override] public function buildForm(FormBuilderInterface $builder) { $builder->add('accepted_evaluations', EntityType::class, [ @@ -65,11 +69,13 @@ class EvaluationFilter implements FilterInterface ]); } + #[\Override] public function getFormDefaultData(): array { return []; } + #[\Override] public function describeAction($data, $format = 'string'): array { $evaluations = []; @@ -83,6 +89,7 @@ class EvaluationFilter implements FilterInterface ]]; } + #[\Override] public function getTitle(): string { return 'Filter by evaluation'; diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/GeographicalUnitStatFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/GeographicalUnitStatFilter.php index 7adf03d13..9b2f48516 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/GeographicalUnitStatFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/GeographicalUnitStatFilter.php @@ -40,11 +40,13 @@ class GeographicalUnitStatFilter implements FilterInterface private readonly RollingDateConverterInterface $rollingDateConverter ) {} + #[\Override] public function addRole(): ?string { return null; } + #[\Override] public function alterQuery(QueryBuilder $qb, $data) { $subQueryDql = @@ -81,11 +83,13 @@ class GeographicalUnitStatFilter implements FilterInterface )); } + #[\Override] public function applyOn(): string { return Declarations::ACP_TYPE; } + #[\Override] public function buildForm(FormBuilderInterface $builder) { $builder @@ -106,11 +110,13 @@ class GeographicalUnitStatFilter implements FilterInterface ]); } + #[\Override] public function getFormDefaultData(): array { return ['date_calc' => new RollingDate(RollingDate::T_TODAY)]; } + #[\Override] public function describeAction($data, $format = 'string'): array { return ['Filtered by geographic unit: computed at %date%, only in %units%', [ @@ -125,6 +131,7 @@ class GeographicalUnitStatFilter implements FilterInterface ]]; } + #[\Override] public function getTitle(): string { return 'Filter by geographical unit'; diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/HandlingThirdPartyFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/HandlingThirdPartyFilter.php index 8a9f734aa..6ca5c65bc 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/HandlingThirdPartyFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/HandlingThirdPartyFilter.php @@ -22,17 +22,19 @@ use Symfony\Component\Form\FormBuilderInterface; final readonly class HandlingThirdPartyFilter implements FilterInterface { - private const PREFIX = 'acpw_handling_3party_filter'; + private const string PREFIX = 'acpw_handling_3party_filter'; public function __construct( private ThirdPartyRender $thirdPartyRender, ) {} + #[\Override] public function getTitle() { return 'export.filter.work.by_handling3party.title'; } + #[\Override] public function buildForm(FormBuilderInterface $builder) { $builder->add('handling_3parties', PickThirdpartyDynamicType::class, [ @@ -41,11 +43,13 @@ final readonly class HandlingThirdPartyFilter implements FilterInterface ]); } + #[\Override] public function getFormDefaultData(): array { return ['handling_3parties' => []]; } + #[\Override] public function describeAction($data, $format = 'string') { return [ @@ -62,11 +66,13 @@ final readonly class HandlingThirdPartyFilter implements FilterInterface ]; } + #[\Override] public function addRole(): ?string { return null; } + #[\Override] public function alterQuery(QueryBuilder $qb, $data) { $p = self::PREFIX; @@ -75,6 +81,7 @@ final readonly class HandlingThirdPartyFilter implements FilterInterface $qb->setParameter("{$p}_3ps", $data['handling_3parties']); } + #[\Override] public function applyOn() { return Declarations::SOCIAL_WORK_ACTION_TYPE; diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/HasNoActionFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/HasNoActionFilter.php index 3ac083b32..a5a7140eb 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/HasNoActionFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/HasNoActionFilter.php @@ -19,36 +19,43 @@ use Symfony\Component\Form\FormBuilderInterface; class HasNoActionFilter implements FilterInterface { + #[\Override] public function addRole(): ?string { return null; } + #[\Override] public function alterQuery(QueryBuilder $qb, $data): void { $qb->andWhere('NOT EXISTS (SELECT 1 FROM '.AccompanyingPeriodWork::class.' work WHERE work.accompanyingPeriod = acp)'); } + #[\Override] public function applyOn(): string { return Declarations::ACP_TYPE; } + #[\Override] public function buildForm(FormBuilderInterface $builder): void { // no form } + #[\Override] public function getFormDefaultData(): array { return []; } + #[\Override] public function describeAction($data, $format = 'string'): array { return ['Filtered acp which has no actions']; } + #[\Override] public function getTitle(): string { return 'Filter by which has no action'; diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/HasNoReferrerFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/HasNoReferrerFilter.php index 72bcce39e..a8abb3731 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/HasNoReferrerFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/HasNoReferrerFilter.php @@ -24,11 +24,13 @@ class HasNoReferrerFilter implements FilterInterface { public function __construct(private readonly RollingDateConverterInterface $rollingDateConverter) {} + #[\Override] public function addRole(): ?string { return null; } + #[\Override] public function alterQuery(QueryBuilder $qb, $data) { $qb @@ -49,11 +51,13 @@ class HasNoReferrerFilter implements FilterInterface ); } + #[\Override] public function applyOn(): string { return Declarations::ACP_TYPE; } + #[\Override] public function buildForm(FormBuilderInterface $builder) { $builder @@ -62,11 +66,13 @@ class HasNoReferrerFilter implements FilterInterface ]); } + #[\Override] public function getFormDefaultData(): array { return ['calc_date' => new RollingDate(RollingDate::T_TODAY)]; } + #[\Override] public function describeAction($data, $format = 'string'): array { return ['Filtered acp which has no referrer on date: %date%', [ @@ -74,6 +80,7 @@ class HasNoReferrerFilter implements FilterInterface ]]; } + #[\Override] public function getTitle(): string { return 'Filter by which has no referrer'; diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/HasTemporaryLocationFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/HasTemporaryLocationFilter.php index 778e4181a..129cc4689 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/HasTemporaryLocationFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/HasTemporaryLocationFilter.php @@ -24,11 +24,13 @@ class HasTemporaryLocationFilter implements FilterInterface { public function __construct(private readonly RollingDateConverterInterface $rollingDateConverter) {} + #[\Override] public function addRole(): ?string { return null; } + #[\Override] public function alterQuery(QueryBuilder $qb, $data) { $qb @@ -47,11 +49,13 @@ class HasTemporaryLocationFilter implements FilterInterface }; } + #[\Override] public function applyOn(): string { return Declarations::ACP_TYPE; } + #[\Override] public function buildForm(FormBuilderInterface $builder) { $builder @@ -73,11 +77,13 @@ class HasTemporaryLocationFilter implements FilterInterface ]); } + #[\Override] public function getFormDefaultData(): array { return ['calc_date' => new RollingDate(RollingDate::T_TODAY)]; } + #[\Override] public function describeAction($data, $format = 'string'): array { return match ($data['having_temporarily']) { @@ -87,6 +93,7 @@ class HasTemporaryLocationFilter implements FilterInterface }; } + #[\Override] public function getTitle(): string { return 'Filter by temporary location'; diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/HavingAnAccompanyingPeriodInfoWithinDatesFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/HavingAnAccompanyingPeriodInfoWithinDatesFilter.php index d6436f8b4..6513f507c 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/HavingAnAccompanyingPeriodInfoWithinDatesFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/HavingAnAccompanyingPeriodInfoWithinDatesFilter.php @@ -31,6 +31,7 @@ final readonly class HavingAnAccompanyingPeriodInfoWithinDatesFilter implements private RollingDateConverterInterface $rollingDateConverter, ) {} + #[\Override] public function buildForm(FormBuilderInterface $builder): void { $builder @@ -42,16 +43,19 @@ final readonly class HavingAnAccompanyingPeriodInfoWithinDatesFilter implements ]); } + #[\Override] public function getFormDefaultData(): array { return ['start_date' => new RollingDate(RollingDate::T_TODAY), 'end_date' => new RollingDate(RollingDate::T_TODAY)]; } + #[\Override] public function getTitle(): string { return 'export.filter.course.having_info_within_interval.title'; } + #[\Override] public function describeAction($data, $format = 'string'): array { return [ @@ -63,11 +67,13 @@ final readonly class HavingAnAccompanyingPeriodInfoWithinDatesFilter implements ]; } + #[\Override] public function addRole(): ?string { return null; } + #[\Override] public function alterQuery(QueryBuilder $qb, $data): void { $ai = 'having_ai_within_interval_acc_info'; @@ -84,6 +90,7 @@ final readonly class HavingAnAccompanyingPeriodInfoWithinDatesFilter implements ->setParameter($ae, $this->rollingDateConverter->convert($data['end_date']), Types::DATETIME_IMMUTABLE); } + #[\Override] public function applyOn(): string { return Declarations::ACP_TYPE; diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/IntensityFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/IntensityFilter.php index 3eb8bbb24..f9b413cec 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/IntensityFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/IntensityFilter.php @@ -21,20 +21,22 @@ use Symfony\Contracts\Translation\TranslatorInterface; class IntensityFilter implements FilterInterface { - private const CHOICES = [ + private const array CHOICES = [ 'is occasional' => 'occasional', 'is regular' => 'regular', ]; - private const DEFAULT_CHOICE = 'occasional'; + private const string DEFAULT_CHOICE = 'occasional'; public function __construct(private readonly TranslatorInterface $translator) {} + #[\Override] public function addRole(): ?string { return null; } + #[\Override] public function alterQuery(QueryBuilder $qb, $data) { $where = $qb->getDQLPart('where'); @@ -50,11 +52,13 @@ class IntensityFilter implements FilterInterface $qb->setParameter('intensity', $data['accepted_intensities']); } + #[\Override] public function applyOn(): string { return Declarations::ACP_TYPE; } + #[\Override] public function buildForm(FormBuilderInterface $builder) { $builder->add('accepted_intensities', ChoiceType::class, [ @@ -65,11 +69,13 @@ class IntensityFilter implements FilterInterface ]); } + #[\Override] public function getFormDefaultData(): array { return ['accepted_intensities' => self::DEFAULT_CHOICE]; } + #[\Override] public function describeAction($data, $format = 'string'): array { return [ @@ -79,6 +85,7 @@ class IntensityFilter implements FilterInterface ]; } + #[\Override] public function getTitle(): string { return 'Filter by intensity'; diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/JobWorkingOnCourseFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/JobWorkingOnCourseFilter.php index 622aa5801..585d8db23 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/JobWorkingOnCourseFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/JobWorkingOnCourseFilter.php @@ -33,7 +33,7 @@ use Symfony\Component\Form\FormBuilderInterface; */ readonly class JobWorkingOnCourseFilter implements FilterInterface { - private const PREFIX = 'acp_filter_user_job_working_on_course'; + private const string PREFIX = 'acp_filter_user_job_working_on_course'; public function __construct( private UserJobRepositoryInterface $userJobRepository, @@ -41,11 +41,13 @@ readonly class JobWorkingOnCourseFilter implements FilterInterface private TranslatableStringHelperInterface $translatableStringHelper, ) {} + #[\Override] public function addRole(): ?string { return null; } + #[\Override] public function alterQuery(QueryBuilder $qb, $data): void { $p = self::PREFIX; @@ -76,11 +78,13 @@ readonly class JobWorkingOnCourseFilter implements FilterInterface ; } + #[\Override] public function applyOn(): string { return Declarations::ACP_TYPE; } + #[\Override] public function buildForm(FormBuilderInterface $builder): void { $builder @@ -105,6 +109,7 @@ readonly class JobWorkingOnCourseFilter implements FilterInterface ; } + #[\Override] public function describeAction($data, $format = 'string'): array { return [ @@ -122,6 +127,7 @@ readonly class JobWorkingOnCourseFilter implements FilterInterface ]; } + #[\Override] public function getFormDefaultData(): array { return [ @@ -132,6 +138,7 @@ readonly class JobWorkingOnCourseFilter implements FilterInterface ]; } + #[\Override] public function getTitle(): string { return 'export.filter.course.by_job_working.title'; diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/NotAssociatedWithAReferenceAddressFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/NotAssociatedWithAReferenceAddressFilter.php index 60486371e..d5fc1a028 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/NotAssociatedWithAReferenceAddressFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/NotAssociatedWithAReferenceAddressFilter.php @@ -28,11 +28,13 @@ final readonly class NotAssociatedWithAReferenceAddressFilter implements FilterI private RollingDateConverterInterface $rollingDateConverter, ) {} + #[\Override] public function getTitle() { return 'export.filter.course.not_having_address_reference.title'; } + #[\Override] public function buildForm(FormBuilderInterface $builder) { $builder->add('date_calc', PickRollingDateType::class, [ @@ -40,6 +42,7 @@ final readonly class NotAssociatedWithAReferenceAddressFilter implements FilterI ]); } + #[\Override] public function getFormDefaultData(): array { return [ @@ -47,6 +50,7 @@ final readonly class NotAssociatedWithAReferenceAddressFilter implements FilterI ]; } + #[\Override] public function describeAction($data, $format = 'string') { return [ @@ -57,11 +61,13 @@ final readonly class NotAssociatedWithAReferenceAddressFilter implements FilterI ]; } + #[\Override] public function addRole(): ?string { return null; } + #[\Override] public function alterQuery(QueryBuilder $qb, $data) { $k = 'acp_not_associated_ref_filter'; @@ -91,6 +97,7 @@ final readonly class NotAssociatedWithAReferenceAddressFilter implements FilterI $qb->setParameter("{$k}_date_calc", $this->rollingDateConverter->convert($data['date_calc'])); } + #[\Override] public function applyOn() { return Declarations::ACP_TYPE; diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/OpenBetweenDatesFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/OpenBetweenDatesFilter.php index 1b85f6cd7..792ed4555 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/OpenBetweenDatesFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/OpenBetweenDatesFilter.php @@ -24,11 +24,13 @@ class OpenBetweenDatesFilter implements FilterInterface { public function __construct(private readonly RollingDateConverterInterface $rollingDateConverter) {} + #[\Override] public function addRole(): ?string { return null; } + #[\Override] public function alterQuery(QueryBuilder $qb, $data) { $clause = $qb->expr()->andX( @@ -41,11 +43,13 @@ class OpenBetweenDatesFilter implements FilterInterface $qb->setParameter('dateto', $this->rollingDateConverter->convert($data['date_to']), Types::DATE_IMMUTABLE); } + #[\Override] public function applyOn(): string { return Declarations::ACP_TYPE; } + #[\Override] public function buildForm(FormBuilderInterface $builder) { $builder @@ -53,11 +57,13 @@ class OpenBetweenDatesFilter implements FilterInterface ->add('date_to', PickRollingDateType::class, []); } + #[\Override] public function getFormDefaultData(): array { return ['date_from' => new RollingDate(RollingDate::T_MONTH_PREVIOUS_START), 'date_to' => new RollingDate(RollingDate::T_TODAY)]; } + #[\Override] public function describeAction($data, $format = 'string'): array { return ['Filtered by opening dates: between %datefrom% and %dateto%', [ @@ -66,6 +72,7 @@ class OpenBetweenDatesFilter implements FilterInterface ]]; } + #[\Override] public function getTitle(): string { return 'Filter by opened between dates'; diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/OriginFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/OriginFilter.php index 617577cde..b06a83ac4 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/OriginFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/OriginFilter.php @@ -24,11 +24,13 @@ class OriginFilter implements FilterInterface { public function __construct(private readonly TranslatableStringHelper $translatableStringHelper) {} + #[\Override] public function addRole(): ?string { return null; } + #[\Override] public function alterQuery(QueryBuilder $qb, $data) { $where = $qb->getDQLPart('where'); @@ -44,11 +46,13 @@ class OriginFilter implements FilterInterface $qb->setParameter('origin', $data['accepted_origins']); } + #[\Override] public function applyOn(): string { return Declarations::ACP_TYPE; } + #[\Override] public function buildForm(FormBuilderInterface $builder) { $builder->add('accepted_origins', EntityType::class, [ @@ -59,11 +63,13 @@ class OriginFilter implements FilterInterface ]); } + #[\Override] public function getFormDefaultData(): array { return []; } + #[\Override] public function describeAction($data, $format = 'string'): array { $origins = []; @@ -77,6 +83,7 @@ class OriginFilter implements FilterInterface ]]; } + #[\Override] public function getTitle(): string { return 'Filter by origin'; diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/ReferrerFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/ReferrerFilter.php index 30f67f664..63a32c4f4 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/ReferrerFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/ReferrerFilter.php @@ -22,19 +22,21 @@ use Symfony\Component\Form\FormBuilderInterface; class ReferrerFilter implements FilterInterface { - private const A = 'acp_referrer_filter_uhistory'; + private const string A = 'acp_referrer_filter_uhistory'; - private const P = 'acp_referrer_filter_date'; + private const string P = 'acp_referrer_filter_date'; - private const PU = 'acp_referrer_filter_users'; + private const string PU = 'acp_referrer_filter_users'; public function __construct(private readonly RollingDateConverterInterface $rollingDateConverter) {} + #[\Override] public function addRole(): ?string { return null; } + #[\Override] public function alterQuery(QueryBuilder $qb, $data) { $qb @@ -58,11 +60,13 @@ class ReferrerFilter implements FilterInterface ); } + #[\Override] public function applyOn(): string { return Declarations::ACP_TYPE; } + #[\Override] public function buildForm(FormBuilderInterface $builder) { $builder @@ -75,11 +79,13 @@ class ReferrerFilter implements FilterInterface ]); } + #[\Override] public function getFormDefaultData(): array { return ['date_calc' => new RollingDate(RollingDate::T_TODAY), 'accepted_referrers' => []]; } + #[\Override] public function describeAction($data, $format = 'string'): array { $users = []; @@ -94,6 +100,7 @@ class ReferrerFilter implements FilterInterface ], ]; } + #[\Override] public function getTitle(): string { return 'Filter by referrers'; diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/ReferrerFilterBetweenDates.php b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/ReferrerFilterBetweenDates.php index a5b43375f..131d348c9 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/ReferrerFilterBetweenDates.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/ReferrerFilterBetweenDates.php @@ -32,23 +32,25 @@ use Symfony\Component\Form\FormBuilderInterface; */ final readonly class ReferrerFilterBetweenDates implements FilterInterface { - private const A = 'acp_referrer_filter_uhistory'; + private const string A = 'acp_referrer_filter_uhistory'; - private const P = 'acp_referrer_filter_date_start'; - private const Q = 'acp_referrer_filter_date_end'; + private const string P = 'acp_referrer_filter_date_start'; + private const string Q = 'acp_referrer_filter_date_end'; - private const PU = 'acp_referrer_filter_users'; + private const string PU = 'acp_referrer_filter_users'; public function __construct( private RollingDateConverterInterface $rollingDateConverter, private UserRender $userRender ) {} + #[\Override] public function addRole(): ?string { return null; } + #[\Override] public function alterQuery(QueryBuilder $qb, $data) { $history = self::A; @@ -69,11 +71,13 @@ final readonly class ReferrerFilterBetweenDates implements FilterInterface ->setParameter($end, $this->rollingDateConverter->convert($data['end_date'])); } + #[\Override] public function applyOn(): string { return Declarations::ACP_TYPE; } + #[\Override] public function buildForm(FormBuilderInterface $builder) { $builder @@ -90,6 +94,7 @@ final readonly class ReferrerFilterBetweenDates implements FilterInterface ]); } + #[\Override] public function getFormDefaultData(): array { return [ @@ -99,6 +104,7 @@ final readonly class ReferrerFilterBetweenDates implements FilterInterface ]; } + #[\Override] public function describeAction($data, $format = 'string'): array { $users = []; @@ -115,6 +121,7 @@ final readonly class ReferrerFilterBetweenDates implements FilterInterface ], ]; } + #[\Override] public function getTitle(): string { return 'export.filter.course.by_referrer_between_dates.title'; diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/RequestorFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/RequestorFilter.php index 0b7ce6994..4cf3018cc 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/RequestorFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/RequestorFilter.php @@ -22,9 +22,9 @@ use Symfony\Contracts\Translation\TranslatorInterface; final readonly class RequestorFilter implements FilterInterface { - private const DEFAULT_CHOICE = 'participation'; + private const string DEFAULT_CHOICE = 'participation'; - private const REQUESTOR_CHOICES = [ + private const array REQUESTOR_CHOICES = [ 'is person concerned' => 'participation', 'is other person' => 'other_person', 'is thirdparty' => 'thirdparty', @@ -33,11 +33,13 @@ final readonly class RequestorFilter implements FilterInterface public function __construct(private TranslatorInterface $translator, private EntityManagerInterface $em) {} + #[\Override] public function addRole(): ?string { return null; } + #[\Override] public function alterQuery(QueryBuilder $qb, $data) { $where = $qb->getDQLPart('where'); @@ -102,11 +104,13 @@ final readonly class RequestorFilter implements FilterInterface $qb->add('where', $where); } + #[\Override] public function applyOn(): string { return Declarations::ACP_TYPE; } + #[\Override] public function buildForm(FormBuilderInterface $builder) { $builder->add('accepted_choices', ChoiceType::class, [ @@ -117,11 +121,13 @@ final readonly class RequestorFilter implements FilterInterface ]); } + #[\Override] public function getFormDefaultData(): array { return ['accepted_choices' => self::DEFAULT_CHOICE]; } + #[\Override] public function describeAction($data, $format = 'string'): array { $choice = array_flip(self::REQUESTOR_CHOICES)[$data['accepted_choices']]; @@ -131,6 +137,7 @@ final readonly class RequestorFilter implements FilterInterface ]]; } + #[\Override] public function getTitle(): string { return 'Filter by requestor'; diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/ScopeWorkingOnCourseFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/ScopeWorkingOnCourseFilter.php index 63d93805f..aeceb1527 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/ScopeWorkingOnCourseFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/ScopeWorkingOnCourseFilter.php @@ -33,7 +33,7 @@ use Symfony\Component\Form\FormBuilderInterface; */ readonly class ScopeWorkingOnCourseFilter implements FilterInterface { - private const PREFIX = 'acp_filter_user_scope_working_on_course'; + private const string PREFIX = 'acp_filter_user_scope_working_on_course'; public function __construct( private ScopeRepositoryInterface $scopeRepository, @@ -41,11 +41,13 @@ readonly class ScopeWorkingOnCourseFilter implements FilterInterface private TranslatableStringHelperInterface $translatableStringHelper, ) {} + #[\Override] public function addRole(): ?string { return null; } + #[\Override] public function alterQuery(QueryBuilder $qb, $data): void { $p = self::PREFIX; @@ -76,11 +78,13 @@ readonly class ScopeWorkingOnCourseFilter implements FilterInterface ; } + #[\Override] public function applyOn(): string { return Declarations::ACP_TYPE; } + #[\Override] public function buildForm(FormBuilderInterface $builder): void { $builder @@ -100,6 +104,7 @@ readonly class ScopeWorkingOnCourseFilter implements FilterInterface ; } + #[\Override] public function describeAction($data, $format = 'string'): array { return [ @@ -117,6 +122,7 @@ readonly class ScopeWorkingOnCourseFilter implements FilterInterface ]; } + #[\Override] public function getFormDefaultData(): array { return [ @@ -126,6 +132,7 @@ readonly class ScopeWorkingOnCourseFilter implements FilterInterface ]; } + #[\Override] public function getTitle(): string { return 'export.filter.course.by_scope_working.title'; diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/SocialActionFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/SocialActionFilter.php index dc5ffa042..e60c015fa 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/SocialActionFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/SocialActionFilter.php @@ -25,7 +25,7 @@ use Symfony\Contracts\Translation\TranslatorInterface; final readonly class SocialActionFilter implements FilterInterface { - private const PREFIX = 'acp_by_social_action_filter'; + private const string PREFIX = 'acp_by_social_action_filter'; public function __construct( private SocialActionRender $actionRender, @@ -33,11 +33,13 @@ final readonly class SocialActionFilter implements FilterInterface private TranslatorInterface $translator ) {} + #[\Override] public function addRole(): ?string { return null; } + #[\Override] public function alterQuery(QueryBuilder $qb, $data) { $p = self::PREFIX; @@ -76,11 +78,13 @@ final readonly class SocialActionFilter implements FilterInterface $qb->andWhere($qb->expr()->exists($dql)); } + #[\Override] public function applyOn(): string { return Declarations::ACP_TYPE; } + #[\Override] public function buildForm(FormBuilderInterface $builder) { $builder @@ -112,6 +116,7 @@ final readonly class SocialActionFilter implements FilterInterface ; } + #[\Override] public function getFormDefaultData(): array { return [ @@ -123,6 +128,7 @@ final readonly class SocialActionFilter implements FilterInterface ]; } + #[\Override] public function describeAction($data, $format = 'string'): array { $actions = []; @@ -144,6 +150,7 @@ final readonly class SocialActionFilter implements FilterInterface ]]; } + #[\Override] public function getTitle(): string { return 'export.filter.course.by_social_action.title'; diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/SocialIssueFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/SocialIssueFilter.php index 52010ff81..1abfbf640 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/SocialIssueFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/SocialIssueFilter.php @@ -35,11 +35,13 @@ class SocialIssueFilter implements FilterInterface $this->translator = $translator; } + #[\Override] public function addRole(): ?string { return null; } + #[\Override] public function alterQuery(QueryBuilder $qb, $data) { if (!\in_array('acpsocialissue', $qb->getAllAliases(), true)) { @@ -57,11 +59,13 @@ class SocialIssueFilter implements FilterInterface ); } + #[\Override] public function applyOn() { return Declarations::ACP_TYPE; } + #[\Override] public function buildForm(FormBuilderInterface $builder) { $builder->add('accepted_socialissues', PickSocialIssueType::class, [ @@ -69,11 +73,13 @@ class SocialIssueFilter implements FilterInterface ]); } + #[\Override] public function getFormDefaultData(): array { return []; } + #[\Override] public function describeAction($data, $format = 'string'): array { $issues = []; @@ -92,6 +98,7 @@ class SocialIssueFilter implements FilterInterface ], ]; } + #[\Override] public function getTitle(): string { return 'Filter by social issue'; diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/StepFilterBetweenDates.php b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/StepFilterBetweenDates.php index dfd627eda..6bc74ee49 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/StepFilterBetweenDates.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/StepFilterBetweenDates.php @@ -25,13 +25,13 @@ use Symfony\Contracts\Translation\TranslatorInterface; class StepFilterBetweenDates implements FilterInterface { - private const DEFAULT_CHOICE = [ + private const array DEFAULT_CHOICE = [ AccompanyingPeriod::STEP_CONFIRMED, AccompanyingPeriod::STEP_CONFIRMED_INACTIVE_SHORT, AccompanyingPeriod::STEP_CONFIRMED_INACTIVE_LONG, ]; - private const STEPS = [ + private const array STEPS = [ 'course.draft' => AccompanyingPeriod::STEP_DRAFT, 'course.confirmed' => AccompanyingPeriod::STEP_CONFIRMED, 'course.closed' => AccompanyingPeriod::STEP_CLOSED, @@ -41,11 +41,13 @@ class StepFilterBetweenDates implements FilterInterface public function __construct(private readonly RollingDateConverterInterface $rollingDateConverter, private readonly TranslatorInterface $translator) {} + #[\Override] public function addRole(): ?string { return null; } + #[\Override] public function alterQuery(QueryBuilder $qb, $data) { $alias = 'acp_filter_by_step_between_dat_alias'; @@ -66,11 +68,13 @@ class StepFilterBetweenDates implements FilterInterface ->setParameter($steps, $data['accepted_steps_multi']); } + #[\Override] public function applyOn() { return Declarations::ACP_TYPE; } + #[\Override] public function buildForm(FormBuilderInterface $builder) { $builder @@ -88,6 +92,7 @@ class StepFilterBetweenDates implements FilterInterface ]); } + #[\Override] public function getFormDefaultData(): array { return [ @@ -97,6 +102,7 @@ class StepFilterBetweenDates implements FilterInterface ]; } + #[\Override] public function describeAction($data, $format = 'string') { $steps = array_map( @@ -111,6 +117,7 @@ class StepFilterBetweenDates implements FilterInterface ]]; } + #[\Override] public function getTitle() { return 'export.filter.course.by_step.Filter by step between dates'; diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/StepFilterOnDate.php b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/StepFilterOnDate.php index 8b36b1b5b..21b5a3183 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/StepFilterOnDate.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/StepFilterOnDate.php @@ -25,17 +25,17 @@ use Symfony\Contracts\Translation\TranslatorInterface; class StepFilterOnDate implements FilterInterface { - private const A = 'acp_filter_bystep_stephistories'; + private const string A = 'acp_filter_bystep_stephistories'; - private const DEFAULT_CHOICE = [ + private const array DEFAULT_CHOICE = [ AccompanyingPeriod::STEP_CONFIRMED, AccompanyingPeriod::STEP_CONFIRMED_INACTIVE_SHORT, AccompanyingPeriod::STEP_CONFIRMED_INACTIVE_LONG, ]; - private const P = 'acp_step_filter_date'; + private const string P = 'acp_step_filter_date'; - private const STEPS = [ + private const array STEPS = [ 'course.draft' => AccompanyingPeriod::STEP_DRAFT, 'course.confirmed' => AccompanyingPeriod::STEP_CONFIRMED, 'course.closed' => AccompanyingPeriod::STEP_CLOSED, @@ -45,11 +45,13 @@ class StepFilterOnDate implements FilterInterface public function __construct(private readonly RollingDateConverterInterface $rollingDateConverter, private readonly TranslatorInterface $translator) {} + #[\Override] public function addRole(): ?string { return null; } + #[\Override] public function alterQuery(QueryBuilder $qb, $data) { if (!\in_array(self::A, $qb->getAllAliases(), true)) { @@ -73,11 +75,13 @@ class StepFilterOnDate implements FilterInterface ->setParameter('acp_filter_by_step_steps', $data['accepted_steps_multi']); } + #[\Override] public function applyOn() { return Declarations::ACP_TYPE; } + #[\Override] public function buildForm(FormBuilderInterface $builder) { $builder @@ -92,6 +96,7 @@ class StepFilterOnDate implements FilterInterface ]); } + #[\Override] public function getFormDefaultData(): array { return [ @@ -100,6 +105,7 @@ class StepFilterOnDate implements FilterInterface ]; } + #[\Override] public function describeAction($data, $format = 'string') { $steps = array_map( @@ -112,6 +118,7 @@ class StepFilterOnDate implements FilterInterface ]]; } + #[\Override] public function getTitle() { return 'export.filter.course.by_step.Filter by step'; diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/UserJobFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/UserJobFilter.php index c328e9b21..5f2643d85 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/UserJobFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/UserJobFilter.php @@ -29,7 +29,7 @@ use Symfony\Component\Form\FormBuilderInterface; final readonly class UserJobFilter implements FilterInterface, DataTransformerInterface { - private const PREFIX = 'acp_filter_user_job'; + private const string PREFIX = 'acp_filter_user_job'; public function __construct( private TranslatableStringHelper $translatableStringHelper, @@ -37,11 +37,13 @@ final readonly class UserJobFilter implements FilterInterface, DataTransformerIn private RollingDateConverterInterface $rollingDateConverter, ) {} + #[\Override] public function addRole(): ?string { return null; } + #[\Override] public function alterQuery(QueryBuilder $qb, $data) { $p = self::PREFIX; @@ -74,11 +76,13 @@ final readonly class UserJobFilter implements FilterInterface, DataTransformerIn ; } + #[\Override] public function applyOn() { return Declarations::ACP_TYPE; } + #[\Override] public function buildForm(FormBuilderInterface $builder) { $builder @@ -99,6 +103,7 @@ final readonly class UserJobFilter implements FilterInterface, DataTransformerIn ; } + #[\Override] public function describeAction($data, $format = 'string') { return [ @@ -116,6 +121,7 @@ final readonly class UserJobFilter implements FilterInterface, DataTransformerIn ]; } + #[\Override] public function getFormDefaultData(): array { return [ @@ -125,6 +131,7 @@ final readonly class UserJobFilter implements FilterInterface, DataTransformerIn ]; } + #[\Override] public function transformData(?array $before): array { $default = $this->getFormDefaultData(); @@ -144,6 +151,7 @@ final readonly class UserJobFilter implements FilterInterface, DataTransformerIn return $before; } + #[\Override] public function getTitle(): string { return 'export.filter.course.by_user_job.Filter by user job'; diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/UserScopeFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/UserScopeFilter.php index 3489b8cb3..3c0bd5303 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/UserScopeFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/UserScopeFilter.php @@ -29,7 +29,7 @@ use Symfony\Component\Form\FormBuilderInterface; final readonly class UserScopeFilter implements FilterInterface, DataTransformerInterface { - private const PREFIX = 'acp_filter_main_scope'; + private const string PREFIX = 'acp_filter_main_scope'; public function __construct( private ScopeRepositoryInterface $scopeRepository, @@ -37,11 +37,13 @@ final readonly class UserScopeFilter implements FilterInterface, DataTransformer private RollingDateConverterInterface $rollingDateConverter, ) {} + #[\Override] public function addRole(): ?string { return null; } + #[\Override] public function alterQuery(QueryBuilder $qb, $data): void { $p = self::PREFIX; @@ -73,11 +75,13 @@ final readonly class UserScopeFilter implements FilterInterface, DataTransformer ->setParameter("{$p}_endDate", $this->rollingDateConverter->convert($data['end_date'])); } + #[\Override] public function applyOn(): string { return Declarations::ACP_TYPE; } + #[\Override] public function buildForm(FormBuilderInterface $builder) { $builder @@ -96,6 +100,7 @@ final readonly class UserScopeFilter implements FilterInterface, DataTransformer ]); } + #[\Override] public function describeAction($data, $format = 'string') { return [ @@ -113,6 +118,7 @@ final readonly class UserScopeFilter implements FilterInterface, DataTransformer ]; } + #[\Override] public function getFormDefaultData(): array { return [ @@ -122,6 +128,7 @@ final readonly class UserScopeFilter implements FilterInterface, DataTransformer ]; } + #[\Override] public function transformData(?array $before): array { $default = $this->getFormDefaultData(); @@ -141,6 +148,7 @@ final readonly class UserScopeFilter implements FilterInterface, DataTransformer return $before; } + #[\Override] public function getTitle(): string { return 'export.filter.course.by_user_scope.Filter by user scope'; diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/UserWorkingOnCourseFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/UserWorkingOnCourseFilter.php index 85d5db9d6..dfe51e829 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/UserWorkingOnCourseFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/UserWorkingOnCourseFilter.php @@ -36,6 +36,7 @@ final readonly class UserWorkingOnCourseFilter implements FilterInterface private RollingDateConverterInterface $rollingDateConverter, ) {} + #[\Override] public function buildForm(FormBuilderInterface $builder): void { $builder @@ -51,6 +52,7 @@ final readonly class UserWorkingOnCourseFilter implements FilterInterface ; } + #[\Override] public function getFormDefaultData(): array { return [ @@ -60,11 +62,13 @@ final readonly class UserWorkingOnCourseFilter implements FilterInterface ]; } + #[\Override] public function getTitle(): string { return 'export.filter.course.by_user_working.title'; } + #[\Override] public function describeAction($data, $format = 'string'): array { return [ @@ -82,11 +86,13 @@ final readonly class UserWorkingOnCourseFilter implements FilterInterface ]; } + #[\Override] public function addRole(): ?string { return null; } + #[\Override] public function alterQuery(QueryBuilder $qb, $data): void { $ai_alias = 'user_working_on_course_filter_acc_info'; @@ -107,6 +113,7 @@ final readonly class UserWorkingOnCourseFilter implements FilterInterface ; } + #[\Override] public function applyOn(): string { return Declarations::ACP_TYPE; diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingPeriodStepHistoryFilters/ByDateFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingPeriodStepHistoryFilters/ByDateFilter.php index 1625953f6..ca94034be 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingPeriodStepHistoryFilters/ByDateFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingPeriodStepHistoryFilters/ByDateFilter.php @@ -35,11 +35,13 @@ final readonly class ByDateFilter implements FilterInterface private RollingDateConverterInterface $rollingDateConverter ) {} + #[\Override] public function getTitle() { return 'export.filter.step_history.by_date.title'; } + #[\Override] public function buildForm(FormBuilderInterface $builder) { $builder @@ -51,6 +53,7 @@ final readonly class ByDateFilter implements FilterInterface ]); } + #[\Override] public function getFormDefaultData(): array { return [ @@ -59,6 +62,7 @@ final readonly class ByDateFilter implements FilterInterface ]; } + #[\Override] public function describeAction($data, $format = 'string') { return [ @@ -70,11 +74,13 @@ final readonly class ByDateFilter implements FilterInterface ]; } + #[\Override] public function addRole(): ?string { return null; } + #[\Override] public function alterQuery(QueryBuilder $qb, $data) { $startDate = 'acp_step_history_by_date_start_filter'; @@ -88,6 +94,7 @@ final readonly class ByDateFilter implements FilterInterface ->setParameter($endDate, $this->rollingDateConverter->convert($data['end_date'])); } + #[\Override] public function applyOn() { return Declarations::ACP_STEP_HISTORY; diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingPeriodStepHistoryFilters/ByStepFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingPeriodStepHistoryFilters/ByStepFilter.php index 337c30a89..6128a6d56 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingPeriodStepHistoryFilters/ByStepFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingPeriodStepHistoryFilters/ByStepFilter.php @@ -25,11 +25,13 @@ final readonly class ByStepFilter implements FilterInterface private TranslatorInterface $translator, ) {} + #[\Override] public function getTitle() { return 'export.filter.step_history.by_step.title'; } + #[\Override] public function buildForm(FormBuilderInterface $builder) { $steps = [ @@ -50,6 +52,7 @@ final readonly class ByStepFilter implements FilterInterface ]); } + #[\Override] public function getFormDefaultData(): array { return [ @@ -57,6 +60,7 @@ final readonly class ByStepFilter implements FilterInterface ]; } + #[\Override] public function describeAction($data, $format = 'string') { return [ @@ -67,11 +71,13 @@ final readonly class ByStepFilter implements FilterInterface ]; } + #[\Override] public function addRole(): ?string { return null; } + #[\Override] public function alterQuery(QueryBuilder $qb, $data) { $qb @@ -79,6 +85,7 @@ final readonly class ByStepFilter implements FilterInterface ->setParameter('acpstephistory_by_step_filter_steps', $data['steps']); } + #[\Override] public function applyOn() { return Declarations::ACP_STEP_HISTORY; diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/EvaluationFilters/ByEndDateFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/EvaluationFilters/ByEndDateFilter.php index a0d8d0033..e240bcaba 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/EvaluationFilters/ByEndDateFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/EvaluationFilters/ByEndDateFilter.php @@ -23,11 +23,13 @@ class ByEndDateFilter implements FilterInterface { public function __construct(private readonly RollingDateConverterInterface $rollingDateConverter) {} + #[\Override] public function addRole(): ?string { return null; } + #[\Override] public function alterQuery(QueryBuilder $qb, $data): void { $qb @@ -42,11 +44,13 @@ class ByEndDateFilter implements FilterInterface ); } + #[\Override] public function applyOn(): string { return Declarations::EVAL_TYPE; } + #[\Override] public function buildForm(FormBuilderInterface $builder): void { $builder @@ -58,11 +62,13 @@ class ByEndDateFilter implements FilterInterface ]); } + #[\Override] public function getFormDefaultData(): array { return ['start_date' => new RollingDate(RollingDate::T_YEAR_PREVIOUS_START), 'end_date' => new RollingDate(RollingDate::T_TODAY)]; } + #[\Override] public function describeAction($data, $format = 'string'): array { return ['Filtered by end date: between %start_date% and %end_date%', [ @@ -71,6 +77,7 @@ class ByEndDateFilter implements FilterInterface ]]; } + #[\Override] public function getTitle(): string { return 'Filter by end date evaluations'; diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/EvaluationFilters/ByStartDateFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/EvaluationFilters/ByStartDateFilter.php index 401cd79a5..59dd1526e 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/EvaluationFilters/ByStartDateFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/EvaluationFilters/ByStartDateFilter.php @@ -23,11 +23,13 @@ class ByStartDateFilter implements FilterInterface { public function __construct(private readonly RollingDateConverterInterface $rollingDateConverter) {} + #[\Override] public function addRole(): ?string { return null; } + #[\Override] public function alterQuery(QueryBuilder $qb, $data): void { $qb @@ -42,11 +44,13 @@ class ByStartDateFilter implements FilterInterface ); } + #[\Override] public function applyOn(): string { return Declarations::EVAL_TYPE; } + #[\Override] public function buildForm(FormBuilderInterface $builder): void { $builder @@ -58,11 +62,13 @@ class ByStartDateFilter implements FilterInterface ]); } + #[\Override] public function getFormDefaultData(): array { return ['start_date' => new RollingDate(RollingDate::T_YEAR_PREVIOUS_START), 'end_date' => new RollingDate(RollingDate::T_TODAY)]; } + #[\Override] public function describeAction($data, $format = 'string'): array { return ['Filtered by start date: between %start_date% and %end_date%', [ @@ -71,6 +77,7 @@ class ByStartDateFilter implements FilterInterface ]]; } + #[\Override] public function getTitle(): string { return 'Filter by start date evaluations'; diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/EvaluationFilters/CurrentEvaluationsFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/EvaluationFilters/CurrentEvaluationsFilter.php index 360b47f2d..90bed6660 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/EvaluationFilters/CurrentEvaluationsFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/EvaluationFilters/CurrentEvaluationsFilter.php @@ -18,36 +18,43 @@ use Symfony\Component\Form\FormBuilderInterface; class CurrentEvaluationsFilter implements FilterInterface { + #[\Override] public function addRole(): ?string { return null; } + #[\Override] public function alterQuery(QueryBuilder $qb, $data): void { $qb->andWhere('workeval.endDate IS NULL'); } + #[\Override] public function applyOn(): string { return Declarations::EVAL_TYPE; } + #[\Override] public function buildForm(FormBuilderInterface $builder): void { // no form needed } + #[\Override] public function getFormDefaultData(): array { return []; } + #[\Override] public function describeAction($data, $format = 'string'): array { return ['Filtered by current evaluations']; } + #[\Override] public function getTitle(): string { return 'Filter by current evaluations'; diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/EvaluationFilters/EvaluationTypeFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/EvaluationFilters/EvaluationTypeFilter.php index 20472420c..60f960ec6 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/EvaluationFilters/EvaluationTypeFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/EvaluationFilters/EvaluationTypeFilter.php @@ -24,11 +24,13 @@ final readonly class EvaluationTypeFilter implements FilterInterface { public function __construct(private TranslatableStringHelper $translatableStringHelper, private EvaluationRepositoryInterface $evaluationRepository) {} + #[\Override] public function addRole(): ?string { return null; } + #[\Override] public function alterQuery(QueryBuilder $qb, $data) { $qb->andWhere( @@ -37,11 +39,13 @@ final readonly class EvaluationTypeFilter implements FilterInterface $qb->setParameter('evaluationtype', $data['accepted_evaluationtype']); } + #[\Override] public function applyOn(): string { return Declarations::EVAL_TYPE; } + #[\Override] public function buildForm(FormBuilderInterface $builder) { $evaluations = $this->evaluationRepository->findAllActive(); @@ -58,11 +62,13 @@ final readonly class EvaluationTypeFilter implements FilterInterface ]); } + #[\Override] public function getFormDefaultData(): array { return []; } + #[\Override] public function describeAction($data, $format = 'string'): array { $evals = []; @@ -76,6 +82,7 @@ final readonly class EvaluationTypeFilter implements FilterInterface ]]; } + #[\Override] public function getTitle(): string { return 'Filter by evaluation type'; diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/EvaluationFilters/MaxDateFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/EvaluationFilters/MaxDateFilter.php index 6094d56ee..33eda354e 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/EvaluationFilters/MaxDateFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/EvaluationFilters/MaxDateFilter.php @@ -20,18 +20,20 @@ use Symfony\Contracts\Translation\TranslatorInterface; class MaxDateFilter implements FilterInterface { - private const MAXDATE_CHOICES = [ + private const array MAXDATE_CHOICES = [ 'maxdate is specified' => true, 'maxdate is not specified' => false, ]; public function __construct(private readonly TranslatorInterface $translator) {} + #[\Override] public function addRole(): ?string { return null; } + #[\Override] public function alterQuery(QueryBuilder $qb, $data) { if (true === $data['maxdate']) { @@ -43,11 +45,13 @@ class MaxDateFilter implements FilterInterface $qb->andWhere($clause); } + #[\Override] public function applyOn(): string { return Declarations::EVAL_TYPE; } + #[\Override] public function buildForm(FormBuilderInterface $builder) { $builder->add('maxdate', ChoiceType::class, [ @@ -57,11 +61,13 @@ class MaxDateFilter implements FilterInterface ]); } + #[\Override] public function getFormDefaultData(): array { return []; } + #[\Override] public function describeAction($data, $format = 'string'): array { return ['Filtered by maxdate: only %choice%', [ @@ -71,6 +77,7 @@ class MaxDateFilter implements FilterInterface ]]; } + #[\Override] public function getTitle(): string { return 'Filter evaluations by maxdate mention'; diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/HouseholdFilters/CompositionFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/HouseholdFilters/CompositionFilter.php index 733e41480..36a721da8 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/HouseholdFilters/CompositionFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/HouseholdFilters/CompositionFilter.php @@ -30,11 +30,13 @@ readonly class CompositionFilter implements FilterInterface private RollingDateConverterInterface $rollingDateConverter ) {} + #[\Override] public function addRole(): ?string { return null; } + #[\Override] public function alterQuery(QueryBuilder $qb, $data): void { // there is no test on the aliases here: the name should be unique @@ -59,11 +61,13 @@ readonly class CompositionFilter implements FilterInterface ); } + #[\Override] public function applyOn(): string { return Declarations::HOUSEHOLD_TYPE; } + #[\Override] public function buildForm(FormBuilderInterface $builder): void { $builder @@ -78,11 +82,13 @@ readonly class CompositionFilter implements FilterInterface ->add('on_date', PickRollingDateType::class, []); } + #[\Override] public function getFormDefaultData(): array { return ['on_date' => new RollingDate(RollingDate::T_TODAY)]; } + #[\Override] public function describeAction($data, $format = 'string'): array { $compositions = []; @@ -99,6 +105,7 @@ readonly class CompositionFilter implements FilterInterface ]]; } + #[\Override] public function getTitle(): string { return 'Filter by composition'; diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/AddressRefStatusFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/AddressRefStatusFilter.php index 8cd675abe..03ee2ecc6 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/AddressRefStatusFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/AddressRefStatusFilter.php @@ -25,11 +25,13 @@ class AddressRefStatusFilter implements \Chill\MainBundle\Export\FilterInterface { public function __construct(private readonly RollingDateConverterInterface $rollingDateConverter) {} + #[\Override] public function addRole(): ?string { return null; } + #[\Override] public function alterQuery(QueryBuilder $qb, $data) { $subQuery = @@ -57,11 +59,13 @@ class AddressRefStatusFilter implements \Chill\MainBundle\Export\FilterInterface ->setParameter('person_filter_having_address_to_review_ref_statuses', $data['ref_statuses'] ?? [Address::ADDR_REFERENCE_STATUS_TO_REVIEW]); } + #[\Override] public function applyOn() { return Declarations::PERSON_TYPE; } + #[\Override] public function buildForm(FormBuilderInterface $builder) { $builder @@ -78,11 +82,13 @@ class AddressRefStatusFilter implements \Chill\MainBundle\Export\FilterInterface ]); } + #[\Override] public function getFormDefaultData(): array { return ['date_calc' => new RollingDate(RollingDate::T_TODAY), 'ref_statuses' => [Address::ADDR_REFERENCE_STATUS_TO_REVIEW]]; } + #[\Override] public function describeAction($data, $format = 'string') { return [ @@ -100,6 +106,7 @@ class AddressRefStatusFilter implements \Chill\MainBundle\Export\FilterInterface ]; } + #[\Override] public function getTitle(): string { return 'export.filter.person.by_address_ref_status.Filter by person\'s address ref status'; diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/AgeFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/AgeFilter.php index aa97ad54c..d1bbb5d64 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/AgeFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/AgeFilter.php @@ -27,11 +27,13 @@ class AgeFilter implements ExportElementValidatedInterface, FilterInterface { public function __construct(private readonly RollingDateConverterInterface $rollingDateConverter) {} + #[\Override] public function addRole(): ?string { return null; } + #[\Override] public function alterQuery(QueryBuilder $qb, $data) { $where = $qb->getDQLPart('where'); @@ -65,11 +67,13 @@ class AgeFilter implements ExportElementValidatedInterface, FilterInterface $qb->setParameter('max_date', $maxDate); } + #[\Override] public function applyOn() { return Declarations::PERSON_TYPE; } + #[\Override] public function buildForm(FormBuilderInterface $builder) { $builder->add('min_age', IntegerType::class, [ @@ -86,6 +90,7 @@ class AgeFilter implements ExportElementValidatedInterface, FilterInterface ]); } + #[\Override] public function getFormDefaultData(): array { return [ @@ -95,6 +100,7 @@ class AgeFilter implements ExportElementValidatedInterface, FilterInterface ]; } + #[\Override] public function describeAction($data, $format = 'string') { return ['Filtered by person\'s age: ' @@ -104,11 +110,13 @@ class AgeFilter implements ExportElementValidatedInterface, FilterInterface ], ]; } + #[\Override] public function getTitle() { return 'Filter by person\'s age'; } + #[\Override] public function validateForm($data, ExecutionContextInterface $context) { $min = $data['min_age']; diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/BirthdateFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/BirthdateFilter.php index dd14c71ef..55598d82b 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/BirthdateFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/BirthdateFilter.php @@ -26,11 +26,13 @@ class BirthdateFilter implements ExportElementValidatedInterface, FilterInterfac { public function __construct(private readonly RollingDateConverterInterface $rollingDateConverter) {} + #[\Override] public function addRole(): ?string { return null; } + #[\Override] public function alterQuery(QueryBuilder $qb, $data) { $where = $qb->getDQLPart('where'); @@ -57,11 +59,13 @@ class BirthdateFilter implements ExportElementValidatedInterface, FilterInterfac ); } + #[\Override] public function applyOn() { return Declarations::PERSON_TYPE; } + #[\Override] public function buildForm(FormBuilderInterface $builder) { $builder->add('date_from', PickRollingDateType::class, [ @@ -73,11 +77,13 @@ class BirthdateFilter implements ExportElementValidatedInterface, FilterInterfac ]); } + #[\Override] public function getFormDefaultData(): array { return ['date_from' => new RollingDate(RollingDate::T_YEAR_PREVIOUS_START), 'date_to' => new RollingDate(RollingDate::T_TODAY)]; } + #[\Override] public function describeAction($data, $format = 'string') { return ['Filtered by person\'s birthdate: ' @@ -87,11 +93,13 @@ class BirthdateFilter implements ExportElementValidatedInterface, FilterInterfac ], ]; } + #[\Override] public function getTitle() { return 'Filter by person\'s birthdate'; } + #[\Override] public function validateForm($data, ExecutionContextInterface $context) { $date_from = $data['date_from']; diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/ByHouseholdCompositionFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/ByHouseholdCompositionFilter.php index e873a6598..bc3e36cf2 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/ByHouseholdCompositionFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/ByHouseholdCompositionFilter.php @@ -31,11 +31,13 @@ class ByHouseholdCompositionFilter implements FilterInterface { public function __construct(private readonly HouseholdCompositionTypeRepositoryInterface $householdCompositionTypeRepository, private readonly RollingDateConverterInterface $rollingDateConverter, private readonly TranslatableStringHelperInterface $translatableStringHelper) {} + #[\Override] public function addRole(): ?string { return null; } + #[\Override] public function alterQuery(QueryBuilder $qb, $data) { $p = 'person_by_household_compo_filter'; @@ -55,11 +57,13 @@ class ByHouseholdCompositionFilter implements FilterInterface ->setParameter("{$p}_date", $this->rollingDateConverter->convert($data['calc_date']), Types::DATE_IMMUTABLE); } + #[\Override] public function applyOn() { return Declarations::PERSON_TYPE; } + #[\Override] public function buildForm(FormBuilderInterface $builder) { $builder @@ -76,11 +80,13 @@ class ByHouseholdCompositionFilter implements FilterInterface ]); } + #[\Override] public function getFormDefaultData(): array { return ['calc_date' => new RollingDate(RollingDate::T_TODAY)]; } + #[\Override] public function describeAction($data, $format = 'string') { $compos = array_map( @@ -94,6 +100,7 @@ class ByHouseholdCompositionFilter implements FilterInterface ]]; } + #[\Override] public function getTitle() { return 'export.filter.person.by_composition.Filter by household composition'; diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/DeadOrAliveFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/DeadOrAliveFilter.php index 82cda25ed..2b1d575ce 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/DeadOrAliveFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/DeadOrAliveFilter.php @@ -25,11 +25,13 @@ class DeadOrAliveFilter implements FilterInterface { public function __construct(private readonly RollingDateConverterInterface $rollingDateConverter) {} + #[\Override] public function addRole(): ?string { return null; } + #[\Override] public function alterQuery(QueryBuilder $qb, $data) { $where = $qb->getDQLPart('where'); @@ -78,11 +80,13 @@ class DeadOrAliveFilter implements FilterInterface $qb->setParameter('date_calc', $calc); } + #[\Override] public function applyOn() { return Declarations::PERSON_TYPE; } + #[\Override] public function buildForm(FormBuilderInterface $builder) { $builder->add('person_state', ChoiceType::class, [ @@ -99,11 +103,13 @@ class DeadOrAliveFilter implements FilterInterface ]); } + #[\Override] public function getFormDefaultData(): array { return ['date_calc' => new RollingDate(RollingDate::T_TODAY)]; } + #[\Override] public function describeAction($data, $format = 'string') { return ['Filtered by a state of %deadOrAlive%: ' @@ -113,6 +119,7 @@ class DeadOrAliveFilter implements FilterInterface ], ]; } + #[\Override] public function getTitle() { return "Filter by person's that are alive or have deceased at a certain date"; diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/DeathdateFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/DeathdateFilter.php index 1bc32d9bb..7b880fe9e 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/DeathdateFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/DeathdateFilter.php @@ -26,11 +26,13 @@ class DeathdateFilter implements ExportElementValidatedInterface, FilterInterfac { public function __construct(private readonly RollingDateConverterInterface $rollingDateConverter) {} + #[\Override] public function addRole(): ?string { return null; } + #[\Override] public function alterQuery(QueryBuilder $qb, $data) { $where = $qb->getDQLPart('where'); @@ -57,11 +59,13 @@ class DeathdateFilter implements ExportElementValidatedInterface, FilterInterfac ); } + #[\Override] public function applyOn() { return Declarations::PERSON_TYPE; } + #[\Override] public function buildForm(FormBuilderInterface $builder) { $builder->add('date_from', PickRollingDateType::class, [ @@ -73,11 +77,13 @@ class DeathdateFilter implements ExportElementValidatedInterface, FilterInterfac ]); } + #[\Override] public function getFormDefaultData(): array { return ['date_from' => new RollingDate(RollingDate::T_YEAR_PREVIOUS_START), 'date_to' => new RollingDate(RollingDate::T_TODAY)]; } + #[\Override] public function describeAction($data, $format = 'string') { return ['Filtered by person\'s deathdate: ' @@ -87,11 +93,13 @@ class DeathdateFilter implements ExportElementValidatedInterface, FilterInterfac ], ]; } + #[\Override] public function getTitle() { return 'Filter by person\'s deathdate'; } + #[\Override] public function validateForm($data, ExecutionContextInterface $context) { $date_from = $data['date_from']; diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/GenderFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/GenderFilter.php index 5009e37d0..e26432dca 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/GenderFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/GenderFilter.php @@ -36,11 +36,13 @@ class GenderFilter implements $this->translator = $translator; } + #[\Override] public function addRole(): ?string { return null; } + #[\Override] public function alterQuery(QueryBuilder $qb, $data) { $where = $qb->getDQLPart('where'); @@ -65,11 +67,13 @@ class GenderFilter implements )); } + #[\Override] public function applyOn() { return Declarations::PERSON_TYPE; } + #[\Override] public function buildForm(FormBuilderInterface $builder) { $builder->add('accepted_genders', ChoiceType::class, [ @@ -85,11 +89,13 @@ class GenderFilter implements ]); } + #[\Override] public function getFormDefaultData(): array { return []; } + #[\Override] public function describeAction($data, $format = 'string') { $genders = []; @@ -113,11 +119,13 @@ class GenderFilter implements * * @return string */ + #[\Override] public function getTitle() { return 'Filter by person gender'; } + #[\Override] public function validateForm($data, ExecutionContextInterface $context) { if (!\is_array($data['accepted_genders']) || 0 === \count($data['accepted_genders'])) { diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/GeographicalUnitFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/GeographicalUnitFilter.php index e2041c3fa..f3b26ef78 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/GeographicalUnitFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/GeographicalUnitFilter.php @@ -29,11 +29,13 @@ class GeographicalUnitFilter implements \Chill\MainBundle\Export\FilterInterface { public function __construct(private readonly GeographicalUnitRepositoryInterface $geographicalUnitRepository, private readonly GeographicalUnitLayerRepositoryInterface $geographicalUnitLayerRepository, private readonly TranslatableStringHelperInterface $translatableStringHelper, private readonly RollingDateConverterInterface $rollingDateConverter) {} + #[\Override] public function addRole(): ?string { return null; } + #[\Override] public function alterQuery(QueryBuilder $qb, $data) { $subQuery = @@ -63,11 +65,13 @@ class GeographicalUnitFilter implements \Chill\MainBundle\Export\FilterInterface ->setParameter('person_filter_geog_units', array_map(static fn (SimpleGeographicalUnitDTO $unitDTO) => $unitDTO->id, $data['units'])); } + #[\Override] public function applyOn() { return Declarations::PERSON_TYPE; } + #[\Override] public function buildForm(FormBuilderInterface $builder) { $builder @@ -88,11 +92,13 @@ class GeographicalUnitFilter implements \Chill\MainBundle\Export\FilterInterface ]); } + #[\Override] public function getFormDefaultData(): array { return ['date_calc' => new RollingDate(RollingDate::T_TODAY)]; } + #[\Override] public function describeAction($data, $format = 'string') { return [ @@ -110,6 +116,7 @@ class GeographicalUnitFilter implements \Chill\MainBundle\Export\FilterInterface ]; } + #[\Override] public function getTitle(): string { return 'Filter by person\'s geographical unit (based on address)'; diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/MaritalStatusFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/MaritalStatusFilter.php index 6c4cdf802..d79a764ea 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/MaritalStatusFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/MaritalStatusFilter.php @@ -21,11 +21,13 @@ class MaritalStatusFilter implements FilterInterface { public function __construct(private readonly TranslatableStringHelper $translatableStringHelper) {} + #[\Override] public function addRole(): ?string { return null; } + #[\Override] public function alterQuery(\Doctrine\ORM\QueryBuilder $qb, $data) { $qb->andWhere( @@ -34,11 +36,13 @@ class MaritalStatusFilter implements FilterInterface $qb->setParameter('maritalStatus', $data['maritalStatus']); } + #[\Override] public function applyOn() { return Declarations::PERSON_TYPE; } + #[\Override] public function buildForm(\Symfony\Component\Form\FormBuilderInterface $builder) { $builder->add('maritalStatus', EntityType::class, [ @@ -51,16 +55,19 @@ class MaritalStatusFilter implements FilterInterface ]); } + #[\Override] public function getFormDefaultData(): array { return []; } + #[\Override] public function describeAction($data, $format = 'string') { return ['Filtered by person\'s marital status']; } + #[\Override] public function getTitle() { return 'Filter by person\'s marital status'; diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/NationalityFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/NationalityFilter.php index 4c83fafe3..f3c579519 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/NationalityFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/NationalityFilter.php @@ -28,11 +28,13 @@ class NationalityFilter implements { public function __construct(private readonly TranslatableStringHelper $translatableStringHelper) {} + #[\Override] public function addRole(): ?string { return null; } + #[\Override] public function alterQuery(QueryBuilder $qb, $data) { $where = $qb->getDQLPart('where'); @@ -48,11 +50,13 @@ class NationalityFilter implements $qb->setParameter('person_nationality', [$data['nationalities']]); } + #[\Override] public function applyOn() { return Declarations::PERSON_TYPE; } + #[\Override] public function buildForm(FormBuilderInterface $builder) { $builder->add('nationalities', Select2CountryType::class, [ @@ -60,11 +64,13 @@ class NationalityFilter implements ]); } + #[\Override] public function getFormDefaultData(): array { return []; } + #[\Override] public function describeAction($data, $format = 'string') { $countries = $data['nationalities']; @@ -77,11 +83,13 @@ class NationalityFilter implements ]; } + #[\Override] public function getTitle() { return "Filter by person's nationality"; } + #[\Override] public function validateForm($data, ExecutionContextInterface $context) { if (null === $data['nationalities']) { diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/ResidentialAddressAtThirdpartyFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/ResidentialAddressAtThirdpartyFilter.php index ea8e01baf..200969d4e 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/ResidentialAddressAtThirdpartyFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/ResidentialAddressAtThirdpartyFilter.php @@ -28,11 +28,13 @@ class ResidentialAddressAtThirdpartyFilter implements FilterInterface { public function __construct(private readonly RollingDateConverterInterface $rollingDateConverter, private readonly TranslatableStringHelper $translatableStringHelper) {} + #[\Override] public function addRole(): ?string { return null; } + #[\Override] public function alterQuery(QueryBuilder $qb, $data) { if (!\in_array('resaddr', $qb->getAllAliases(), true)) { @@ -79,11 +81,13 @@ class ResidentialAddressAtThirdpartyFilter implements FilterInterface $qb->add('where', $where); } + #[\Override] public function applyOn() { return Declarations::PERSON_TYPE; } + #[\Override] public function buildForm(FormBuilderInterface $builder) { $builder->add('thirdparty_cat', EntityType::class, [ @@ -99,11 +103,13 @@ class ResidentialAddressAtThirdpartyFilter implements FilterInterface ]); } + #[\Override] public function getFormDefaultData(): array { return ['date_calc' => new RollingDate(RollingDate::T_TODAY)]; } + #[\Override] public function describeAction($data, $format = 'string') { return ['Filtered by person\'s who have a residential address located at a thirdparty of type %thirdparty_type% and valid on %date_calc%', [ @@ -112,6 +118,7 @@ class ResidentialAddressAtThirdpartyFilter implements FilterInterface ]]; } + #[\Override] public function getTitle() { return "Filter by person's who have a residential address located at a thirdparty of type"; diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/ResidentialAddressAtUserFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/ResidentialAddressAtUserFilter.php index 3c2d7a3a6..e450d43cf 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/ResidentialAddressAtUserFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/ResidentialAddressAtUserFilter.php @@ -25,11 +25,13 @@ class ResidentialAddressAtUserFilter implements FilterInterface { public function __construct(private readonly RollingDateConverterInterface $rollingDateConverter) {} + #[\Override] public function addRole(): ?string { return null; } + #[\Override] public function alterQuery(QueryBuilder $qb, $data) { if (!\in_array('resaddr', $qb->getAllAliases(), true)) { @@ -66,11 +68,13 @@ class ResidentialAddressAtUserFilter implements FilterInterface $qb->add('where', $where); } + #[\Override] public function applyOn() { return Declarations::PERSON_TYPE; } + #[\Override] public function buildForm(\Symfony\Component\Form\FormBuilderInterface $builder) { $builder->add('date_calc', PickRollingDateType::class, [ @@ -78,16 +82,19 @@ class ResidentialAddressAtUserFilter implements FilterInterface ]); } + #[\Override] public function getFormDefaultData(): array { return ['date_calc' => new RollingDate(RollingDate::T_TODAY)]; } + #[\Override] public function describeAction($data, $format = 'string') { return ["Filtered by person's who have a residential address located at another user"]; } + #[\Override] public function getTitle() { return "Filter by person's who have a residential address located at another user"; diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/WithParticipationBetweenDatesFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/WithParticipationBetweenDatesFilter.php index 289af5f07..56a3c08e4 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/WithParticipationBetweenDatesFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/WithParticipationBetweenDatesFilter.php @@ -27,11 +27,13 @@ final readonly class WithParticipationBetweenDatesFilter implements FilterInterf private RollingDateConverterInterface $rollingDateConverter, ) {} + #[\Override] public function addRole(): ?string { return null; } + #[\Override] public function alterQuery(QueryBuilder $qb, $data) { $p = 'with_participation_between_dates_filter'; @@ -49,11 +51,13 @@ final readonly class WithParticipationBetweenDatesFilter implements FilterInterf ->setParameter("{$p}_date_before", $this->rollingDateConverter->convert($data['date_before']), Types::DATE_IMMUTABLE); } + #[\Override] public function applyOn(): string { return Declarations::PERSON_TYPE; } + #[\Override] public function buildForm(FormBuilderInterface $builder) { $builder->add('date_after', PickRollingDateType::class, [ @@ -65,6 +69,7 @@ final readonly class WithParticipationBetweenDatesFilter implements FilterInterf ]); } + #[\Override] public function getFormDefaultData(): array { return [ @@ -73,6 +78,7 @@ final readonly class WithParticipationBetweenDatesFilter implements FilterInterf ]; } + #[\Override] public function describeAction($data, $format = 'string') { return ['export.filter.person.with_participation_between_dates.Filtered by participations during period: between %dateafter% and %datebefore%', [ @@ -81,6 +87,7 @@ final readonly class WithParticipationBetweenDatesFilter implements FilterInterf ]]; } + #[\Override] public function getTitle() { return 'export.filter.person.with_participation_between_dates.title'; diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/WithoutHouseholdComposition.php b/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/WithoutHouseholdComposition.php index c34c7eb40..3afb50d81 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/WithoutHouseholdComposition.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/WithoutHouseholdComposition.php @@ -26,11 +26,13 @@ class WithoutHouseholdComposition implements FilterInterface { public function __construct(private readonly RollingDateConverterInterface $rollingDateConverter) {} + #[\Override] public function addRole(): ?string { return null; } + #[\Override] public function alterQuery(QueryBuilder $qb, $data) { $p = 'person_by_household_no_compo_filter'; @@ -50,11 +52,13 @@ class WithoutHouseholdComposition implements FilterInterface ->setParameter("{$p}_date", $this->rollingDateConverter->convert($data['calc_date']), Types::DATE_IMMUTABLE); } + #[\Override] public function applyOn() { return Declarations::PERSON_TYPE; } + #[\Override] public function buildForm(FormBuilderInterface $builder) { $builder @@ -63,11 +67,13 @@ class WithoutHouseholdComposition implements FilterInterface ]); } + #[\Override] public function getFormDefaultData(): array { return ['calc_date' => new RollingDate(RollingDate::T_TODAY)]; } + #[\Override] public function describeAction($data, $format = 'string') { return ['export.filter.person.by_no_composition.Persons filtered by no composition at %date%', [ @@ -75,6 +81,7 @@ class WithoutHouseholdComposition implements FilterInterface ]]; } + #[\Override] public function getTitle() { return 'export.filter.person.by_no_composition.Filter persons without household composition'; diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/SocialWorkFilters/AccompanyingPeriodWorkEndDateBetweenDateFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/SocialWorkFilters/AccompanyingPeriodWorkEndDateBetweenDateFilter.php index 32bbbaf6e..909d7cf2b 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/SocialWorkFilters/AccompanyingPeriodWorkEndDateBetweenDateFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/SocialWorkFilters/AccompanyingPeriodWorkEndDateBetweenDateFilter.php @@ -26,6 +26,7 @@ final readonly class AccompanyingPeriodWorkEndDateBetweenDateFilter implements F private RollingDateConverterInterface $rollingDateConverter, ) {} + #[\Override] public function buildForm(FormBuilderInterface $builder): void { $builder @@ -41,16 +42,19 @@ final readonly class AccompanyingPeriodWorkEndDateBetweenDateFilter implements F ]); } + #[\Override] public function getFormDefaultData(): array { return ['start_date' => new RollingDate(RollingDate::T_TODAY), 'end_date' => new RollingDate(RollingDate::T_TODAY)]; } + #[\Override] public function getTitle(): string { return 'export.filter.work.end_between_dates.title'; } + #[\Override] public function describeAction($data, $format = 'string'): array { return [ @@ -62,11 +66,13 @@ final readonly class AccompanyingPeriodWorkEndDateBetweenDateFilter implements F ]; } + #[\Override] public function addRole(): ?string { return null; } + #[\Override] public function alterQuery(QueryBuilder $qb, $data): void { $as = 'acc_pe_work_end_between_filter_start'; @@ -108,6 +114,7 @@ final readonly class AccompanyingPeriodWorkEndDateBetweenDateFilter implements F } } + #[\Override] public function applyOn(): string { return Declarations::SOCIAL_WORK_ACTION_TYPE; diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/SocialWorkFilters/AccompanyingPeriodWorkStartDateBetweenDateFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/SocialWorkFilters/AccompanyingPeriodWorkStartDateBetweenDateFilter.php index 880543355..95211bfc5 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/SocialWorkFilters/AccompanyingPeriodWorkStartDateBetweenDateFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/SocialWorkFilters/AccompanyingPeriodWorkStartDateBetweenDateFilter.php @@ -26,6 +26,7 @@ final readonly class AccompanyingPeriodWorkStartDateBetweenDateFilter implements private RollingDateConverterInterface $rollingDateConverter, ) {} + #[\Override] public function buildForm(FormBuilderInterface $builder): void { $builder @@ -41,16 +42,19 @@ final readonly class AccompanyingPeriodWorkStartDateBetweenDateFilter implements ]); } + #[\Override] public function getFormDefaultData(): array { return ['start_date' => new RollingDate(RollingDate::T_TODAY), 'end_date' => new RollingDate(RollingDate::T_TODAY)]; } + #[\Override] public function getTitle(): string { return 'export.filter.work.start_between_dates.title'; } + #[\Override] public function describeAction($data, $format = 'string'): array { return [ @@ -62,11 +66,13 @@ final readonly class AccompanyingPeriodWorkStartDateBetweenDateFilter implements ]; } + #[\Override] public function addRole(): ?string { return null; } + #[\Override] public function alterQuery(QueryBuilder $qb, $data): void { $as = 'acc_pe_work_start_between_filter_start'; @@ -108,6 +114,7 @@ final readonly class AccompanyingPeriodWorkStartDateBetweenDateFilter implements } } + #[\Override] public function applyOn(): string { return Declarations::SOCIAL_WORK_ACTION_TYPE; diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/SocialWorkFilters/AccompanyingPeriodWorkWithEvaluationBetweenDatesFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/SocialWorkFilters/AccompanyingPeriodWorkWithEvaluationBetweenDatesFilter.php index e0c4da1e9..e4317599b 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/SocialWorkFilters/AccompanyingPeriodWorkWithEvaluationBetweenDatesFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/SocialWorkFilters/AccompanyingPeriodWorkWithEvaluationBetweenDatesFilter.php @@ -26,6 +26,7 @@ final readonly class AccompanyingPeriodWorkWithEvaluationBetweenDatesFilter impl private RollingDateConverterInterface $rollingDateConverter, ) {} + #[\Override] public function buildForm(FormBuilderInterface $builder): void { $builder @@ -37,16 +38,19 @@ final readonly class AccompanyingPeriodWorkWithEvaluationBetweenDatesFilter impl ]); } + #[\Override] public function getFormDefaultData(): array { return ['start_date' => new RollingDate(RollingDate::T_YEAR_CURRENT_START), 'end_date' => new RollingDate(RollingDate::T_TODAY)]; } + #[\Override] public function getTitle(): string { return 'export.filter.work.evaluation_between_dates.title'; } + #[\Override] public function describeAction($data, $format = 'string'): array { return [ @@ -58,11 +62,13 @@ final readonly class AccompanyingPeriodWorkWithEvaluationBetweenDatesFilter impl ]; } + #[\Override] public function addRole(): ?string { return null; } + #[\Override] public function alterQuery(QueryBuilder $qb, $data): void { $s = 'workeval_between_filter_start'; @@ -77,6 +83,7 @@ final readonly class AccompanyingPeriodWorkWithEvaluationBetweenDatesFilter impl ->setParameter($e, $this->rollingDateConverter->convert($data['end_date'])); } + #[\Override] public function applyOn(): string { return Declarations::SOCIAL_WORK_ACTION_TYPE; diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/SocialWorkFilters/CreatorFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/SocialWorkFilters/CreatorFilter.php index c990e658e..4b2494679 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/SocialWorkFilters/CreatorFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/SocialWorkFilters/CreatorFilter.php @@ -21,13 +21,15 @@ use Symfony\Component\Form\FormBuilderInterface; class CreatorFilter implements FilterInterface { - private const PREFIX = 'acpw_filter_creator'; + private const string PREFIX = 'acpw_filter_creator'; + #[\Override] public function addRole(): ?string { return null; } + #[\Override] public function alterQuery(QueryBuilder $qb, $data) { $p = self::PREFIX; @@ -38,11 +40,13 @@ class CreatorFilter implements FilterInterface ->setParameter("{$p}_creators", $data['creators']); } + #[\Override] public function applyOn(): string { return Declarations::SOCIAL_WORK_ACTION_TYPE; } + #[\Override] public function buildForm(FormBuilderInterface $builder) { $builder @@ -52,6 +56,7 @@ class CreatorFilter implements FilterInterface ]); } + #[\Override] public function describeAction($data, $format = 'string'): array { return [ @@ -67,6 +72,7 @@ class CreatorFilter implements FilterInterface ]; } + #[\Override] public function getFormDefaultData(): array { return [ @@ -74,6 +80,7 @@ class CreatorFilter implements FilterInterface ]; } + #[\Override] public function getTitle(): string { return 'export.filter.work.by_creator.title'; diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/SocialWorkFilters/CreatorJobFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/SocialWorkFilters/CreatorJobFilter.php index 2b7a6ef07..5629e4bcf 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/SocialWorkFilters/CreatorJobFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/SocialWorkFilters/CreatorJobFilter.php @@ -24,18 +24,20 @@ use Symfony\Component\Form\FormBuilderInterface; class CreatorJobFilter implements FilterInterface { - private const PREFIX = 'acpw_filter_creator_job'; + private const string PREFIX = 'acpw_filter_creator_job'; public function __construct( private readonly UserJobRepository $userJobRepository, private readonly TranslatableStringHelper $translatableStringHelper ) {} + #[\Override] public function addRole(): ?string { return null; } + #[\Override] public function alterQuery(QueryBuilder $qb, $data) { $p = self::PREFIX; @@ -60,11 +62,13 @@ class CreatorJobFilter implements FilterInterface ->setParameter("{$p}_jobs", $data['jobs']); } + #[\Override] public function applyOn(): string { return Declarations::SOCIAL_WORK_ACTION_TYPE; } + #[\Override] public function buildForm(FormBuilderInterface $builder) { $builder @@ -78,6 +82,7 @@ class CreatorJobFilter implements FilterInterface ]); } + #[\Override] public function describeAction($data, $format = 'string'): array { $creatorJobs = []; @@ -93,6 +98,7 @@ class CreatorJobFilter implements FilterInterface ]]; } + #[\Override] public function getFormDefaultData(): array { return [ @@ -100,6 +106,7 @@ class CreatorJobFilter implements FilterInterface ]; } + #[\Override] public function getTitle(): string { return 'export.filter.work.by_creator_job.title'; diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/SocialWorkFilters/CreatorScopeFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/SocialWorkFilters/CreatorScopeFilter.php index 16ed52755..4184d3bc6 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/SocialWorkFilters/CreatorScopeFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/SocialWorkFilters/CreatorScopeFilter.php @@ -24,18 +24,20 @@ use Symfony\Component\Form\FormBuilderInterface; class CreatorScopeFilter implements FilterInterface { - private const PREFIX = 'acpw_filter_creator_scope'; + private const string PREFIX = 'acpw_filter_creator_scope'; public function __construct( private readonly ScopeRepository $scopeRepository, private readonly TranslatableStringHelper $translatableStringHelper ) {} + #[\Override] public function addRole(): ?string { return null; } + #[\Override] public function alterQuery(QueryBuilder $qb, $data) { $p = self::PREFIX; @@ -60,11 +62,13 @@ class CreatorScopeFilter implements FilterInterface ->setParameter("{$p}_scopes", $data['scopes']); } + #[\Override] public function applyOn(): string { return Declarations::SOCIAL_WORK_ACTION_TYPE; } + #[\Override] public function buildForm(FormBuilderInterface $builder) { $builder @@ -78,6 +82,7 @@ class CreatorScopeFilter implements FilterInterface ]); } + #[\Override] public function describeAction($data, $format = 'string'): array { $creatorScopes = []; @@ -93,6 +98,7 @@ class CreatorScopeFilter implements FilterInterface ]]; } + #[\Override] public function getFormDefaultData(): array { return [ @@ -100,6 +106,7 @@ class CreatorScopeFilter implements FilterInterface ]; } + #[\Override] public function getTitle(): string { return 'export.filter.work.by_creator_scope.title'; diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/SocialWorkFilters/CurrentActionFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/SocialWorkFilters/CurrentActionFilter.php index b11d2a93c..a445dfab1 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/SocialWorkFilters/CurrentActionFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/SocialWorkFilters/CurrentActionFilter.php @@ -18,36 +18,43 @@ use Symfony\Component\Form\FormBuilderInterface; class CurrentActionFilter implements FilterInterface { + #[\Override] public function addRole(): ?string { return null; } + #[\Override] public function alterQuery(QueryBuilder $qb, $data): void { $qb->andWhere('acpw.endDate IS NULL'); } + #[\Override] public function applyOn(): string { return Declarations::SOCIAL_WORK_ACTION_TYPE; } + #[\Override] public function buildForm(FormBuilderInterface $builder): void { // no form } + #[\Override] public function getFormDefaultData(): array { return []; } + #[\Override] public function describeAction($data, $format = 'string'): array { return ['Filtered actions without end date']; } + #[\Override] public function getTitle(): string { return 'Filter actions without end date'; diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/SocialWorkFilters/JobFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/SocialWorkFilters/JobFilter.php index 25e762a9c..6787ebd9c 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/SocialWorkFilters/JobFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/SocialWorkFilters/JobFilter.php @@ -25,7 +25,7 @@ use Symfony\Contracts\Translation\TranslatorInterface; class JobFilter implements FilterInterface { - private const PREFIX = 'acp_work_action_filter_user_job'; + private const string PREFIX = 'acp_work_action_filter_user_job'; public function __construct( protected TranslatorInterface $translator, @@ -33,11 +33,13 @@ class JobFilter implements FilterInterface private readonly UserJobRepositoryInterface $userJobRepository, ) {} + #[\Override] public function addRole(): ?string { return null; } + #[\Override] public function alterQuery(QueryBuilder $qb, $data) { $p = self::PREFIX; @@ -52,11 +54,13 @@ class JobFilter implements FilterInterface $qb->setParameter("{$p}_job", $data['job']); } + #[\Override] public function applyOn(): string { return Declarations::SOCIAL_WORK_ACTION_TYPE; } + #[\Override] public function buildForm(FormBuilderInterface $builder) { $builder @@ -72,6 +76,7 @@ class JobFilter implements FilterInterface ; } + #[\Override] public function describeAction($data, $format = 'string') { $userjobs = []; @@ -87,6 +92,7 @@ class JobFilter implements FilterInterface ]]; } + #[\Override] public function getFormDefaultData(): array { return [ @@ -95,6 +101,7 @@ class JobFilter implements FilterInterface ]; } + #[\Override] public function getTitle(): string { return 'export.filter.work.by_user_job.Filter by treating agent job'; diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/SocialWorkFilters/ReferrerFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/SocialWorkFilters/ReferrerFilter.php index 4d456fdb2..f55fad0a9 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/SocialWorkFilters/ReferrerFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/SocialWorkFilters/ReferrerFilter.php @@ -22,15 +22,17 @@ use Symfony\Component\Form\FormBuilderInterface; final readonly class ReferrerFilter implements FilterInterface { - private const PREFIX = 'acpw_referrer_filter'; + private const string PREFIX = 'acpw_referrer_filter'; public function __construct(private RollingDateConverterInterface $rollingDateConverter) {} + #[\Override] public function addRole(): ?string { return null; } + #[\Override] public function alterQuery(QueryBuilder $qb, $data) { $p = self::PREFIX; @@ -48,11 +50,13 @@ final readonly class ReferrerFilter implements FilterInterface ; } + #[\Override] public function applyOn(): string { return Declarations::SOCIAL_WORK_ACTION_TYPE; } + #[\Override] public function buildForm(FormBuilderInterface $builder) { $builder @@ -67,6 +71,7 @@ final readonly class ReferrerFilter implements FilterInterface ; } + #[\Override] public function getFormDefaultData(): array { return [ @@ -75,6 +80,7 @@ final readonly class ReferrerFilter implements FilterInterface ]; } + #[\Override] public function describeAction($data, $format = 'string'): array { $users = []; @@ -90,6 +96,7 @@ final readonly class ReferrerFilter implements FilterInterface ], ]; } + #[\Override] public function getTitle(): string { return 'export.filter.work.by_treating_agent.Filter by treating agent'; diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/SocialWorkFilters/ScopeFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/SocialWorkFilters/ScopeFilter.php index e22c84696..e74104cc9 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/SocialWorkFilters/ScopeFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/SocialWorkFilters/ScopeFilter.php @@ -25,7 +25,7 @@ use Symfony\Contracts\Translation\TranslatorInterface; class ScopeFilter implements FilterInterface { - private const PREFIX = 'acp_work_action_filter_user_scope'; + private const string PREFIX = 'acp_work_action_filter_user_scope'; public function __construct( protected TranslatorInterface $translator, @@ -33,11 +33,13 @@ class ScopeFilter implements FilterInterface private readonly ScopeRepositoryInterface $scopeRepository ) {} + #[\Override] public function addRole(): ?string { return null; } + #[\Override] public function alterQuery(QueryBuilder $qb, $data) { $p = self::PREFIX; @@ -51,11 +53,13 @@ class ScopeFilter implements FilterInterface ->setParameter("{$p}_scope", $data['scope']); } + #[\Override] public function applyOn() { return Declarations::SOCIAL_WORK_ACTION_TYPE; } + #[\Override] public function buildForm(FormBuilderInterface $builder) { $builder @@ -71,6 +75,7 @@ class ScopeFilter implements FilterInterface ; } + #[\Override] public function describeAction($data, $format = 'string'): array { $scopes = []; @@ -86,6 +91,7 @@ class ScopeFilter implements FilterInterface ]]; } + #[\Override] public function getFormDefaultData(): array { return [ @@ -94,6 +100,7 @@ class ScopeFilter implements FilterInterface ]; } + #[\Override] public function getTitle(): string { return 'export.filter.work.by_user_scope.Filter by treating agent scope'; diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/SocialWorkFilters/SocialWorkTypeFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/SocialWorkFilters/SocialWorkTypeFilter.php index c84ed7f40..c9f7f0521 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/SocialWorkFilters/SocialWorkTypeFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/SocialWorkFilters/SocialWorkTypeFilter.php @@ -28,11 +28,13 @@ class SocialWorkTypeFilter implements FilterInterface { public function __construct(private readonly SocialActionRender $socialActionRender, private readonly TranslatableStringHelper $translatableStringHelper, private readonly EntityManagerInterface $em) {} + #[\Override] public function addRole(): ?string { return null; } + #[\Override] public function alterQuery(QueryBuilder $qb, $data) { if (\count($data['actionType']) > 0) { @@ -68,11 +70,13 @@ class SocialWorkTypeFilter implements FilterInterface } } + #[\Override] public function applyOn(): string { return Declarations::SOCIAL_WORK_ACTION_TYPE; } + #[\Override] public function buildForm(FormBuilderInterface $builder) { $builder @@ -95,11 +99,13 @@ class SocialWorkTypeFilter implements FilterInterface ); } + #[\Override] public function getFormDefaultData(): array { return ['action_type' => [], 'goal' => [], 'result' => []]; } + #[\Override] public function describeAction($data, $format = 'string'): array { $actionTypes = []; @@ -129,6 +135,7 @@ class SocialWorkTypeFilter implements FilterInterface ]]; } + #[\Override] public function getTitle(): string { return 'Filter by type of action, goals and results'; diff --git a/src/Bundle/ChillPersonBundle/Export/Helper/FilterListAccompanyingPeriodHelper.php b/src/Bundle/ChillPersonBundle/Export/Helper/FilterListAccompanyingPeriodHelper.php index 2c42d931f..d28723178 100644 --- a/src/Bundle/ChillPersonBundle/Export/Helper/FilterListAccompanyingPeriodHelper.php +++ b/src/Bundle/ChillPersonBundle/Export/Helper/FilterListAccompanyingPeriodHelper.php @@ -38,6 +38,7 @@ final readonly class FilterListAccompanyingPeriodHelper implements FilterListAcc $this->filterStatsByCenters = $parameterBag->get('chill_main')['acl']['filter_stats_by_center']; } + #[\Override] public function addFilterAccompanyingPeriods(QueryBuilder &$qb, array $requiredModifiers, array $acl, array $data = []): void { $centers = match ($this->filterStatsByCenters) { diff --git a/src/Bundle/ChillPersonBundle/Export/Helper/ListAccompanyingPeriodHelper.php b/src/Bundle/ChillPersonBundle/Export/Helper/ListAccompanyingPeriodHelper.php index 87ed9eec0..dd5058e95 100644 --- a/src/Bundle/ChillPersonBundle/Export/Helper/ListAccompanyingPeriodHelper.php +++ b/src/Bundle/ChillPersonBundle/Export/Helper/ListAccompanyingPeriodHelper.php @@ -35,7 +35,7 @@ use Symfony\Contracts\Translation\TranslatorInterface; final readonly class ListAccompanyingPeriodHelper { - public const FIELDS = [ + public const array FIELDS = [ 'acpId', 'step', 'stepSince', diff --git a/src/Bundle/ChillPersonBundle/Export/Helper/ListPersonHelper.php b/src/Bundle/ChillPersonBundle/Export/Helper/ListPersonHelper.php index 393d246ea..d907c1269 100644 --- a/src/Bundle/ChillPersonBundle/Export/Helper/ListPersonHelper.php +++ b/src/Bundle/ChillPersonBundle/Export/Helper/ListPersonHelper.php @@ -37,7 +37,7 @@ use Symfony\Contracts\Translation\TranslatorInterface; */ final readonly class ListPersonHelper { - private const FIELDS = [ + private const array FIELDS = [ 'personId', 'civility', 'firstName', diff --git a/src/Bundle/ChillPersonBundle/Form/AccompanyingCourseCommentType.php b/src/Bundle/ChillPersonBundle/Form/AccompanyingCourseCommentType.php index 897fa36c0..dc57a0fd0 100644 --- a/src/Bundle/ChillPersonBundle/Form/AccompanyingCourseCommentType.php +++ b/src/Bundle/ChillPersonBundle/Form/AccompanyingCourseCommentType.php @@ -22,6 +22,7 @@ class AccompanyingCourseCommentType extends AbstractType /** * @return void */ + #[\Override] public function buildForm(FormBuilderInterface $builder, array $options) { $builder->add('content', ChillTextareaType::class, [ @@ -33,6 +34,7 @@ class AccompanyingCourseCommentType extends AbstractType /** * @return void */ + #[\Override] public function configureOptions(OptionsResolver $resolver) { $resolver->setDefault('class', Comment::class); diff --git a/src/Bundle/ChillPersonBundle/Form/AccompanyingCourseType.php b/src/Bundle/ChillPersonBundle/Form/AccompanyingCourseType.php index 450f8a15b..3d5888ed2 100644 --- a/src/Bundle/ChillPersonBundle/Form/AccompanyingCourseType.php +++ b/src/Bundle/ChillPersonBundle/Form/AccompanyingCourseType.php @@ -18,6 +18,7 @@ use Symfony\Component\Form\FormBuilderInterface; class AccompanyingCourseType extends AbstractType { + #[\Override] public function buildForm(FormBuilderInterface $builder, array $options) { $builder->add( diff --git a/src/Bundle/ChillPersonBundle/Form/AccompanyingPeriodType.php b/src/Bundle/ChillPersonBundle/Form/AccompanyingPeriodType.php index 77c27c86d..871e6778c 100644 --- a/src/Bundle/ChillPersonBundle/Form/AccompanyingPeriodType.php +++ b/src/Bundle/ChillPersonBundle/Form/AccompanyingPeriodType.php @@ -46,6 +46,7 @@ class AccompanyingPeriodType extends AbstractType $this->config = $config; } + #[\Override] public function buildForm(FormBuilderInterface $builder, array $options) { // if the period_action is close, date opening should not be seen @@ -89,11 +90,13 @@ class AccompanyingPeriodType extends AbstractType ]); } + #[\Override] public function buildView(FormView $view, FormInterface $form, array $options) { $view->vars['action'] = $options['period_action']; } + #[\Override] public function configureOptions(OptionsResolver $resolver) { $resolver->setDefaults([ @@ -111,6 +114,7 @@ class AccompanyingPeriodType extends AbstractType /** * @return string */ + #[\Override] public function getBlockPrefix() { return 'chill_personbundle_accompanyingperiod'; diff --git a/src/Bundle/ChillPersonBundle/Form/ChoiceLoader/PersonChoiceLoader.php b/src/Bundle/ChillPersonBundle/Form/ChoiceLoader/PersonChoiceLoader.php index 9de66b272..2ad27e8b6 100644 --- a/src/Bundle/ChillPersonBundle/Form/ChoiceLoader/PersonChoiceLoader.php +++ b/src/Bundle/ChillPersonBundle/Form/ChoiceLoader/PersonChoiceLoader.php @@ -37,6 +37,7 @@ class PersonChoiceLoader implements ChoiceLoaderInterface /** * @param null $value */ + #[\Override] public function loadChoiceList($value = null): ChoiceListInterface { return new \Symfony\Component\Form\ChoiceList\ArrayChoiceList( @@ -50,6 +51,7 @@ class PersonChoiceLoader implements ChoiceLoaderInterface * * @return array */ + #[\Override] public function loadChoicesForValues(array $values, $value = null) { $choices = []; @@ -79,6 +81,7 @@ class PersonChoiceLoader implements ChoiceLoaderInterface * * @return array|string[] */ + #[\Override] public function loadValuesForChoices(array $choices, $value = null) { $values = []; diff --git a/src/Bundle/ChillPersonBundle/Form/ClosingMotiveType.php b/src/Bundle/ChillPersonBundle/Form/ClosingMotiveType.php index fd7ef3ecb..472183e99 100644 --- a/src/Bundle/ChillPersonBundle/Form/ClosingMotiveType.php +++ b/src/Bundle/ChillPersonBundle/Form/ClosingMotiveType.php @@ -28,6 +28,7 @@ class ClosingMotiveType extends AbstractType { public function __construct(private readonly TranslatorInterface $translator) {} + #[\Override] public function buildForm(FormBuilderInterface $builder, array $options) { $builder @@ -57,6 +58,7 @@ class ClosingMotiveType extends AbstractType ]); } + #[\Override] public function configureOptions(OptionsResolver $resolver) { $resolver diff --git a/src/Bundle/ChillPersonBundle/Form/CreationPersonType.php b/src/Bundle/ChillPersonBundle/Form/CreationPersonType.php index 01814af38..f47e9ac0a 100644 --- a/src/Bundle/ChillPersonBundle/Form/CreationPersonType.php +++ b/src/Bundle/ChillPersonBundle/Form/CreationPersonType.php @@ -38,7 +38,7 @@ final class CreationPersonType extends AbstractType { // TODO: This is only used in test. // TODO: See if this is still valid and update accordingly. - public const NAME = 'chill_personbundle_person_creation'; + public const string NAME = 'chill_personbundle_person_creation'; private readonly bool $askCenters; @@ -50,6 +50,7 @@ final class CreationPersonType extends AbstractType $this->askCenters = $parameterBag->get('chill_main')['acl']['form_show_centers']; } + #[\Override] public function buildForm(FormBuilderInterface $builder, array $options) { $builder @@ -109,6 +110,7 @@ final class CreationPersonType extends AbstractType ); } + #[\Override] public function configureOptions(OptionsResolver $resolver) { $resolver->setDefaults([ @@ -122,6 +124,7 @@ final class CreationPersonType extends AbstractType /** * @return string */ + #[\Override] public function getBlockPrefix() { return self::NAME; diff --git a/src/Bundle/ChillPersonBundle/Form/DataMapper/PersonAltNameDataMapper.php b/src/Bundle/ChillPersonBundle/Form/DataMapper/PersonAltNameDataMapper.php index 3a2a61cad..dae782666 100644 --- a/src/Bundle/ChillPersonBundle/Form/DataMapper/PersonAltNameDataMapper.php +++ b/src/Bundle/ChillPersonBundle/Form/DataMapper/PersonAltNameDataMapper.php @@ -19,6 +19,7 @@ use Symfony\Component\Form\Exception\UnexpectedTypeException; class PersonAltNameDataMapper implements DataMapperInterface { + #[\Override] public function mapDataToForms($viewData, \Traversable $forms): void { if (null === $viewData) { @@ -43,6 +44,7 @@ class PersonAltNameDataMapper implements DataMapperInterface } } + #[\Override] public function mapFormsToData(\Traversable $forms, &$viewData): void { $mapIndexToKey = []; diff --git a/src/Bundle/ChillPersonBundle/Form/HouseholdCompositionType.php b/src/Bundle/ChillPersonBundle/Form/HouseholdCompositionType.php index 2df66039f..6877c9956 100644 --- a/src/Bundle/ChillPersonBundle/Form/HouseholdCompositionType.php +++ b/src/Bundle/ChillPersonBundle/Form/HouseholdCompositionType.php @@ -24,6 +24,7 @@ class HouseholdCompositionType extends AbstractType { public function __construct(private readonly HouseholdCompositionTypeRepository $householdCompositionTypeRepository, private readonly TranslatableStringHelperInterface $translatableStringHelper) {} + #[\Override] public function buildForm(FormBuilderInterface $builder, array $options) { $types = $this->householdCompositionTypeRepository->findAllActive(); diff --git a/src/Bundle/ChillPersonBundle/Form/HouseholdCompositionTypeType.php b/src/Bundle/ChillPersonBundle/Form/HouseholdCompositionTypeType.php index f05216379..b8268f60b 100644 --- a/src/Bundle/ChillPersonBundle/Form/HouseholdCompositionTypeType.php +++ b/src/Bundle/ChillPersonBundle/Form/HouseholdCompositionTypeType.php @@ -20,6 +20,7 @@ use Symfony\Component\OptionsResolver\OptionsResolver; class HouseholdCompositionTypeType extends AbstractType { + #[\Override] public function buildForm(FormBuilderInterface $builder, array $options) { $builder @@ -30,6 +31,7 @@ class HouseholdCompositionTypeType extends AbstractType ]); } + #[\Override] public function configureOptions(OptionsResolver $resolver) { $resolver diff --git a/src/Bundle/ChillPersonBundle/Form/HouseholdMemberType.php b/src/Bundle/ChillPersonBundle/Form/HouseholdMemberType.php index 158bc90f2..0396be81c 100644 --- a/src/Bundle/ChillPersonBundle/Form/HouseholdMemberType.php +++ b/src/Bundle/ChillPersonBundle/Form/HouseholdMemberType.php @@ -18,6 +18,7 @@ use Symfony\Component\Form\FormBuilderInterface; class HouseholdMemberType extends AbstractType { + #[\Override] public function buildForm(FormBuilderInterface $builder, array $options) { $builder diff --git a/src/Bundle/ChillPersonBundle/Form/HouseholdPositionType.php b/src/Bundle/ChillPersonBundle/Form/HouseholdPositionType.php index 67257e2eb..e5db35438 100644 --- a/src/Bundle/ChillPersonBundle/Form/HouseholdPositionType.php +++ b/src/Bundle/ChillPersonBundle/Form/HouseholdPositionType.php @@ -21,6 +21,7 @@ use Symfony\Component\OptionsResolver\OptionsResolver; class HouseholdPositionType extends AbstractType { + #[\Override] public function buildForm(FormBuilderInterface $builder, array $options) { $builder @@ -39,6 +40,7 @@ class HouseholdPositionType extends AbstractType ]); } + #[\Override] public function configureOptions(OptionsResolver $resolver) { $resolver diff --git a/src/Bundle/ChillPersonBundle/Form/HouseholdType.php b/src/Bundle/ChillPersonBundle/Form/HouseholdType.php index ae9bcb45f..3cc994cdb 100644 --- a/src/Bundle/ChillPersonBundle/Form/HouseholdType.php +++ b/src/Bundle/ChillPersonBundle/Form/HouseholdType.php @@ -21,6 +21,7 @@ use Symfony\Component\OptionsResolver\OptionsResolver; class HouseholdType extends AbstractType { + #[\Override] public function buildForm(FormBuilderInterface $builder, array $options) { $builder @@ -39,6 +40,7 @@ class HouseholdType extends AbstractType ]); } + #[\Override] public function configureOptions(OptionsResolver $resolver) { $resolver->setDefaults([ diff --git a/src/Bundle/ChillPersonBundle/Form/MaritalStatusType.php b/src/Bundle/ChillPersonBundle/Form/MaritalStatusType.php index 6d71158d0..5116bdffe 100644 --- a/src/Bundle/ChillPersonBundle/Form/MaritalStatusType.php +++ b/src/Bundle/ChillPersonBundle/Form/MaritalStatusType.php @@ -22,6 +22,7 @@ use Symfony\Component\OptionsResolver\OptionsResolver; */ class MaritalStatusType extends AbstractType { + #[\Override] public function buildForm(FormBuilderInterface $builder, array $options) { $builder @@ -30,6 +31,7 @@ class MaritalStatusType extends AbstractType ]); } + #[\Override] public function configureOptions(OptionsResolver $resolver) { $resolver diff --git a/src/Bundle/ChillPersonBundle/Form/OriginType.php b/src/Bundle/ChillPersonBundle/Form/OriginType.php index bd28b80e5..90df5972a 100644 --- a/src/Bundle/ChillPersonBundle/Form/OriginType.php +++ b/src/Bundle/ChillPersonBundle/Form/OriginType.php @@ -20,6 +20,7 @@ use Symfony\Component\OptionsResolver\OptionsResolver; class OriginType extends AbstractType { + #[\Override] public function buildForm(FormBuilderInterface $builder, array $options) { $builder @@ -31,6 +32,7 @@ class OriginType extends AbstractType ]); } + #[\Override] public function configureOptions(OptionsResolver $resolver) { $resolver diff --git a/src/Bundle/ChillPersonBundle/Form/PersonConfimDuplicateType.php b/src/Bundle/ChillPersonBundle/Form/PersonConfimDuplicateType.php index 6c65c3371..0c31069c5 100644 --- a/src/Bundle/ChillPersonBundle/Form/PersonConfimDuplicateType.php +++ b/src/Bundle/ChillPersonBundle/Form/PersonConfimDuplicateType.php @@ -17,6 +17,7 @@ use Symfony\Component\Form\FormBuilderInterface; class PersonConfimDuplicateType extends AbstractType { + #[\Override] public function buildForm(FormBuilderInterface $builder, array $options) { $builder @@ -29,6 +30,7 @@ class PersonConfimDuplicateType extends AbstractType /** * @return string */ + #[\Override] public function getBlockPrefix() { return 'chill_personbundle_person_confirm_duplicate'; diff --git a/src/Bundle/ChillPersonBundle/Form/PersonFindManuallyDuplicateType.php b/src/Bundle/ChillPersonBundle/Form/PersonFindManuallyDuplicateType.php index 1d7697332..f78361c7b 100644 --- a/src/Bundle/ChillPersonBundle/Form/PersonFindManuallyDuplicateType.php +++ b/src/Bundle/ChillPersonBundle/Form/PersonFindManuallyDuplicateType.php @@ -18,6 +18,7 @@ use Symfony\Component\Form\FormBuilderInterface; class PersonFindManuallyDuplicateType extends AbstractType { + #[\Override] public function buildForm(FormBuilderInterface $builder, array $options) { $builder @@ -33,6 +34,7 @@ class PersonFindManuallyDuplicateType extends AbstractType /** * @return string */ + #[\Override] public function getBlockPrefix() { return 'chill_personbundle_person_find_manually_duplicate'; diff --git a/src/Bundle/ChillPersonBundle/Form/PersonResourceKindType.php b/src/Bundle/ChillPersonBundle/Form/PersonResourceKindType.php index b0f933a42..25979ce15 100644 --- a/src/Bundle/ChillPersonBundle/Form/PersonResourceKindType.php +++ b/src/Bundle/ChillPersonBundle/Form/PersonResourceKindType.php @@ -20,6 +20,7 @@ use Symfony\Component\OptionsResolver\OptionsResolver; class PersonResourceKindType extends AbstractType { + #[\Override] public function buildForm(FormBuilderInterface $builder, array $options) { $builder @@ -32,6 +33,7 @@ class PersonResourceKindType extends AbstractType ]); } + #[\Override] public function configureOptions(OptionsResolver $resolver) { $resolver diff --git a/src/Bundle/ChillPersonBundle/Form/PersonResourceType.php b/src/Bundle/ChillPersonBundle/Form/PersonResourceType.php index 2063b0e21..4907c1700 100644 --- a/src/Bundle/ChillPersonBundle/Form/PersonResourceType.php +++ b/src/Bundle/ChillPersonBundle/Form/PersonResourceType.php @@ -31,6 +31,7 @@ final class PersonResourceType extends AbstractType { public function __construct(private readonly ResourceKindRender $resourceKindRender, private readonly PersonRenderInterface $personRender, private readonly ThirdPartyRender $thirdPartyRender, private readonly TranslatorInterface $translator) {} + #[\Override] public function buildForm(FormBuilderInterface $builder, array $options) { $builder @@ -67,6 +68,7 @@ final class PersonResourceType extends AbstractType ]); } + #[\Override] public function configureOptions(OptionsResolver $resolver): void { $resolver->setDefaults([ @@ -74,6 +76,7 @@ final class PersonResourceType extends AbstractType ]); } + #[\Override] public function getBlockPrefix(): string { return 'chill_personbundle_person_resource'; diff --git a/src/Bundle/ChillPersonBundle/Form/PersonType.php b/src/Bundle/ChillPersonBundle/Form/PersonType.php index 21717a25b..0e29b657e 100644 --- a/src/Bundle/ChillPersonBundle/Form/PersonType.php +++ b/src/Bundle/ChillPersonBundle/Form/PersonType.php @@ -67,6 +67,7 @@ class PersonType extends AbstractType $this->configAltNamesHelper = $configAltNamesHelper; } + #[\Override] public function buildForm(FormBuilderInterface $builder, array $options) { $builder @@ -223,6 +224,7 @@ class PersonType extends AbstractType /** * @param OptionsResolverInterface $resolver */ + #[\Override] public function configureOptions(OptionsResolver $resolver) { $resolver->setDefaults([ @@ -242,6 +244,7 @@ class PersonType extends AbstractType /** * @return string */ + #[\Override] public function getBlockPrefix() { return 'chill_personbundle_person'; diff --git a/src/Bundle/ChillPersonBundle/Form/RelationType.php b/src/Bundle/ChillPersonBundle/Form/RelationType.php index e77199c95..e271c252a 100644 --- a/src/Bundle/ChillPersonBundle/Form/RelationType.php +++ b/src/Bundle/ChillPersonBundle/Form/RelationType.php @@ -20,6 +20,7 @@ use Symfony\Component\OptionsResolver\OptionsResolver; class RelationType extends AbstractType { + #[\Override] public function buildForm(FormBuilderInterface $builder, array $options) { $builder @@ -34,6 +35,7 @@ class RelationType extends AbstractType ]); } + #[\Override] public function configureOptions(OptionsResolver $resolver) { $resolver diff --git a/src/Bundle/ChillPersonBundle/Form/ResidentialAddressType.php b/src/Bundle/ChillPersonBundle/Form/ResidentialAddressType.php index 38b2bdeca..7e01702ef 100644 --- a/src/Bundle/ChillPersonBundle/Form/ResidentialAddressType.php +++ b/src/Bundle/ChillPersonBundle/Form/ResidentialAddressType.php @@ -23,6 +23,7 @@ use Symfony\Component\OptionsResolver\OptionsResolver; final class ResidentialAddressType extends AbstractType { + #[\Override] public function buildForm(FormBuilderInterface $builder, array $options) { $builder @@ -65,6 +66,7 @@ final class ResidentialAddressType extends AbstractType } } + #[\Override] public function configureOptions(OptionsResolver $resolver) { $resolver->setDefaults([ diff --git a/src/Bundle/ChillPersonBundle/Form/SocialWork/EvaluationType.php b/src/Bundle/ChillPersonBundle/Form/SocialWork/EvaluationType.php index 668a00276..79ea7f91e 100644 --- a/src/Bundle/ChillPersonBundle/Form/SocialWork/EvaluationType.php +++ b/src/Bundle/ChillPersonBundle/Form/SocialWork/EvaluationType.php @@ -36,6 +36,7 @@ class EvaluationType extends AbstractType $this->translatableStringHelper = $translatableStringHelper; } + #[\Override] public function buildForm(FormBuilderInterface $builder, array $options) { $builder @@ -64,6 +65,7 @@ class EvaluationType extends AbstractType ]); } + #[\Override] public function configureOptions(OptionsResolver $resolver) { $resolver diff --git a/src/Bundle/ChillPersonBundle/Form/SocialWork/GoalType.php b/src/Bundle/ChillPersonBundle/Form/SocialWork/GoalType.php index a6f55e917..d680e70b8 100644 --- a/src/Bundle/ChillPersonBundle/Form/SocialWork/GoalType.php +++ b/src/Bundle/ChillPersonBundle/Form/SocialWork/GoalType.php @@ -36,6 +36,7 @@ class GoalType extends AbstractType $this->translatableStringHelper = $translatableStringHelper; } + #[\Override] public function buildForm(FormBuilderInterface $builder, array $options) { $builder @@ -55,6 +56,7 @@ class GoalType extends AbstractType ]); } + #[\Override] public function configureOptions(OptionsResolver $resolver) { $resolver diff --git a/src/Bundle/ChillPersonBundle/Form/SocialWork/ResultType.php b/src/Bundle/ChillPersonBundle/Form/SocialWork/ResultType.php index 22a08c3a7..75b796084 100644 --- a/src/Bundle/ChillPersonBundle/Form/SocialWork/ResultType.php +++ b/src/Bundle/ChillPersonBundle/Form/SocialWork/ResultType.php @@ -34,6 +34,7 @@ class ResultType extends AbstractType $this->translatableStringHelper = $translatableStringHelper; } + #[\Override] public function buildForm(FormBuilderInterface $builder, array $options) { $builder @@ -47,6 +48,7 @@ class ResultType extends AbstractType ]); } + #[\Override] public function configureOptions(OptionsResolver $resolver) { $resolver diff --git a/src/Bundle/ChillPersonBundle/Form/SocialWork/SocialActionType.php b/src/Bundle/ChillPersonBundle/Form/SocialWork/SocialActionType.php index 0b6cbe73d..3e509d7a5 100644 --- a/src/Bundle/ChillPersonBundle/Form/SocialWork/SocialActionType.php +++ b/src/Bundle/ChillPersonBundle/Form/SocialWork/SocialActionType.php @@ -41,6 +41,7 @@ class SocialActionType extends AbstractType $this->translatableStringHelper = $translatableStringHelper; } + #[\Override] public function buildForm(FormBuilderInterface $builder, array $options) { $builder @@ -95,6 +96,7 @@ class SocialActionType extends AbstractType ]); } + #[\Override] public function configureOptions(OptionsResolver $resolver) { $resolver diff --git a/src/Bundle/ChillPersonBundle/Form/SocialWork/SocialIssueType.php b/src/Bundle/ChillPersonBundle/Form/SocialWork/SocialIssueType.php index 0d7a3bb4b..c409971e3 100644 --- a/src/Bundle/ChillPersonBundle/Form/SocialWork/SocialIssueType.php +++ b/src/Bundle/ChillPersonBundle/Form/SocialWork/SocialIssueType.php @@ -25,6 +25,7 @@ class SocialIssueType extends AbstractType { public function __construct(protected TranslatableStringHelperInterface $translatableStringHelper) {} + #[\Override] public function buildForm(FormBuilderInterface $builder, array $options) { $builder @@ -53,6 +54,7 @@ class SocialIssueType extends AbstractType ]); } + #[\Override] public function configureOptions(OptionsResolver $resolver) { $resolver->setDefault('class', SocialIssue::class); diff --git a/src/Bundle/ChillPersonBundle/Form/Type/ClosingMotivePickerType.php b/src/Bundle/ChillPersonBundle/Form/Type/ClosingMotivePickerType.php index 49e23f7c6..bbdaa2154 100644 --- a/src/Bundle/ChillPersonBundle/Form/Type/ClosingMotivePickerType.php +++ b/src/Bundle/ChillPersonBundle/Form/Type/ClosingMotivePickerType.php @@ -54,6 +54,7 @@ class ClosingMotivePickerType extends AbstractType $this->repository = $closingMotiveRepository; } + #[\Override] public function configureOptions(OptionsResolver $resolver) { $resolver->setDefaults([ @@ -73,11 +74,13 @@ class ClosingMotivePickerType extends AbstractType /** * @return string */ + #[\Override] public function getBlockPrefix() { return 'closing_motive'; } + #[\Override] public function getParent(): ?string { return EntityType::class; diff --git a/src/Bundle/ChillPersonBundle/Form/Type/GenderType.php b/src/Bundle/ChillPersonBundle/Form/Type/GenderType.php index 2989b3ec4..9b5717adf 100644 --- a/src/Bundle/ChillPersonBundle/Form/Type/GenderType.php +++ b/src/Bundle/ChillPersonBundle/Form/Type/GenderType.php @@ -21,6 +21,7 @@ use Symfony\Component\OptionsResolver\OptionsResolver; */ class GenderType extends AbstractType { + #[\Override] public function configureOptions(OptionsResolver $resolver) { $a = [ @@ -37,6 +38,7 @@ class GenderType extends AbstractType ]); } + #[\Override] public function getParent() { return ChoiceType::class; diff --git a/src/Bundle/ChillPersonBundle/Form/Type/PersonAltNameType.php b/src/Bundle/ChillPersonBundle/Form/Type/PersonAltNameType.php index 6d983be37..16e4ed370 100644 --- a/src/Bundle/ChillPersonBundle/Form/Type/PersonAltNameType.php +++ b/src/Bundle/ChillPersonBundle/Form/Type/PersonAltNameType.php @@ -23,6 +23,7 @@ class PersonAltNameType extends AbstractType { public function __construct(private readonly ConfigPersonAltNamesHelper $configHelper, private readonly TranslatableStringHelper $translatableStringHelper) {} + #[\Override] public function buildForm(FormBuilderInterface $builder, array $options) { foreach ($this->getKeyChoices() as $label => $key) { @@ -39,6 +40,7 @@ class PersonAltNameType extends AbstractType $builder->setDataMapper(new \Chill\PersonBundle\Form\DataMapper\PersonAltNameDataMapper()); } + #[\Override] public function configureOptions(OptionsResolver $resolver) { $resolver diff --git a/src/Bundle/ChillPersonBundle/Form/Type/PersonPhoneType.php b/src/Bundle/ChillPersonBundle/Form/Type/PersonPhoneType.php index 0e84bfc83..cf67408be 100644 --- a/src/Bundle/ChillPersonBundle/Form/Type/PersonPhoneType.php +++ b/src/Bundle/ChillPersonBundle/Form/Type/PersonPhoneType.php @@ -26,6 +26,7 @@ class PersonPhoneType extends AbstractType { public function __construct(private readonly PhonenumberHelper $phonenumberHelper, private readonly EntityManagerInterface $em) {} + #[\Override] public function buildForm(FormBuilderInterface $builder, array $options) { $builder->add('phonenumber', ChillPhoneNumberType::class, [ @@ -52,6 +53,7 @@ class PersonPhoneType extends AbstractType }); } + #[\Override] public function configureOptions(OptionsResolver $resolver) { $resolver diff --git a/src/Bundle/ChillPersonBundle/Form/Type/PickPersonDynamicType.php b/src/Bundle/ChillPersonBundle/Form/Type/PickPersonDynamicType.php index 01e3b3585..0aa237ad5 100644 --- a/src/Bundle/ChillPersonBundle/Form/Type/PickPersonDynamicType.php +++ b/src/Bundle/ChillPersonBundle/Form/Type/PickPersonDynamicType.php @@ -28,11 +28,13 @@ class PickPersonDynamicType extends AbstractType { public function __construct(private readonly DenormalizerInterface $denormalizer, private readonly SerializerInterface $serializer, private readonly NormalizerInterface $normalizer) {} + #[\Override] public function buildForm(FormBuilderInterface $builder, array $options) { $builder->addViewTransformer(new EntityToJsonTransformer($this->denormalizer, $this->serializer, $options['multiple'], 'person')); } + #[\Override] public function buildView(FormView $view, FormInterface $form, array $options) { $view->vars['multiple'] = $options['multiple']; @@ -47,6 +49,7 @@ class PickPersonDynamicType extends AbstractType } } + #[\Override] public function configureOptions(OptionsResolver $resolver) { $resolver @@ -60,6 +63,7 @@ class PickPersonDynamicType extends AbstractType ->setAllowedTypes('submit_on_adding_new_entity', ['bool']); } + #[\Override] public function getBlockPrefix() { return 'pick_entity_dynamic'; diff --git a/src/Bundle/ChillPersonBundle/Form/Type/PickPersonType.php b/src/Bundle/ChillPersonBundle/Form/Type/PickPersonType.php index f8086369f..a7a3eb1a8 100644 --- a/src/Bundle/ChillPersonBundle/Form/Type/PickPersonType.php +++ b/src/Bundle/ChillPersonBundle/Form/Type/PickPersonType.php @@ -51,6 +51,7 @@ final class PickPersonType extends AbstractType private readonly TranslatorInterface $translator ) {} + #[\Override] public function buildView(\Symfony\Component\Form\FormView $view, \Symfony\Component\Form\FormInterface $form, array $options) { $view->vars['attr']['data-person-picker'] = true; @@ -63,6 +64,7 @@ final class PickPersonType extends AbstractType $view->vars['attr']['data-searching-label'] = $this->translator->trans('select2.searching'); } + #[\Override] public function configureOptions(OptionsResolver $resolver) { parent::configureOptions($resolver); @@ -92,6 +94,7 @@ final class PickPersonType extends AbstractType ]); } + #[\Override] public function getParent() { return EntityType::class; diff --git a/src/Bundle/ChillPersonBundle/Form/Type/PickSocialActionType.php b/src/Bundle/ChillPersonBundle/Form/Type/PickSocialActionType.php index 19258f23d..784f1f5b9 100644 --- a/src/Bundle/ChillPersonBundle/Form/Type/PickSocialActionType.php +++ b/src/Bundle/ChillPersonBundle/Form/Type/PickSocialActionType.php @@ -22,6 +22,7 @@ class PickSocialActionType extends AbstractType { public function __construct(private readonly SocialActionRender $actionRender, private readonly SocialActionRepository $actionRepository) {} + #[\Override] public function configureOptions(OptionsResolver $resolver) { $resolver @@ -38,6 +39,7 @@ class PickSocialActionType extends AbstractType ->setAllowedTypes('multiple', ['bool']); } + #[\Override] public function getParent(): string { return EntityType::class; diff --git a/src/Bundle/ChillPersonBundle/Form/Type/PickSocialIssueType.php b/src/Bundle/ChillPersonBundle/Form/Type/PickSocialIssueType.php index b61343423..90bbbaf5a 100644 --- a/src/Bundle/ChillPersonBundle/Form/Type/PickSocialIssueType.php +++ b/src/Bundle/ChillPersonBundle/Form/Type/PickSocialIssueType.php @@ -22,6 +22,7 @@ class PickSocialIssueType extends AbstractType { public function __construct(private readonly SocialIssueRender $issueRender, private readonly SocialIssueRepository $issueRepository) {} + #[\Override] public function configureOptions(OptionsResolver $resolver) { $resolver @@ -38,6 +39,7 @@ class PickSocialIssueType extends AbstractType ->setAllowedTypes('multiple', ['bool']); } + #[\Override] public function getParent(): string { return EntityType::class; diff --git a/src/Bundle/ChillPersonBundle/Form/Type/Select2MaritalStatusType.php b/src/Bundle/ChillPersonBundle/Form/Type/Select2MaritalStatusType.php index 2016fb80a..9e392fcc4 100644 --- a/src/Bundle/ChillPersonBundle/Form/Type/Select2MaritalStatusType.php +++ b/src/Bundle/ChillPersonBundle/Form/Type/Select2MaritalStatusType.php @@ -27,12 +27,14 @@ class Select2MaritalStatusType extends AbstractType { public function __construct(private readonly TranslatableStringHelper $translatableStringHelper, private readonly EntityManagerInterface $em) {} + #[\Override] public function buildForm(FormBuilderInterface $builder, array $options) { $transformer = new ObjectToIdTransformer($this->em, MaritalStatus::class); $builder->addModelTransformer($transformer); } + #[\Override] public function configureOptions(OptionsResolver $resolver) { $maritalStatuses = $this->em->getRepository(MaritalStatus::class)->findAll(); @@ -50,11 +52,13 @@ class Select2MaritalStatusType extends AbstractType ]); } + #[\Override] public function getBlockPrefix() { return 'select2_chill_marital_status'; } + #[\Override] public function getParent() { return Select2ChoiceType::class; diff --git a/src/Bundle/ChillPersonBundle/Household/MembersEditor.php b/src/Bundle/ChillPersonBundle/Household/MembersEditor.php index ee93efd6b..3b46d72f4 100644 --- a/src/Bundle/ChillPersonBundle/Household/MembersEditor.php +++ b/src/Bundle/ChillPersonBundle/Household/MembersEditor.php @@ -24,11 +24,11 @@ use Symfony\Contracts\EventDispatcher\EventDispatcherInterface; class MembersEditor { - final public const VALIDATION_GROUP_AFFECTED = 'household_memberships'; + final public const string VALIDATION_GROUP_AFFECTED = 'household_memberships'; - final public const VALIDATION_GROUP_COMPOSITION = 'household_composition'; + final public const string VALIDATION_GROUP_COMPOSITION = 'household_composition'; - final public const VALIDATION_GROUP_CREATED = 'household_memberships_created'; + final public const string VALIDATION_GROUP_CREATED = 'household_memberships_created'; private array $events = []; diff --git a/src/Bundle/ChillPersonBundle/Menu/AccompanyingCourseMenuBuilder.php b/src/Bundle/ChillPersonBundle/Menu/AccompanyingCourseMenuBuilder.php index 79cd19db9..e77ef2c9b 100644 --- a/src/Bundle/ChillPersonBundle/Menu/AccompanyingCourseMenuBuilder.php +++ b/src/Bundle/ChillPersonBundle/Menu/AccompanyingCourseMenuBuilder.php @@ -35,6 +35,7 @@ class AccompanyingCourseMenuBuilder implements LocalMenuBuilderInterface $this->translator = $translator; } + #[\Override] public function buildMenu($menuId, MenuItem $menu, array $parameters): void { /** @var AccompanyingPeriod $period */ @@ -112,6 +113,7 @@ class AccompanyingCourseMenuBuilder implements LocalMenuBuilderInterface } } + #[\Override] public static function getMenuIds(): array { return ['accompanyingCourse']; diff --git a/src/Bundle/ChillPersonBundle/Menu/AdminAccompanyingCourseMenuBuilder.php b/src/Bundle/ChillPersonBundle/Menu/AdminAccompanyingCourseMenuBuilder.php index 42c5dd4c2..9c430fc36 100644 --- a/src/Bundle/ChillPersonBundle/Menu/AdminAccompanyingCourseMenuBuilder.php +++ b/src/Bundle/ChillPersonBundle/Menu/AdminAccompanyingCourseMenuBuilder.php @@ -27,6 +27,7 @@ class AdminAccompanyingCourseMenuBuilder implements LocalMenuBuilderInterface $this->authorizationChecker = $authorizationChecker; } + #[\Override] public function buildMenu($menuId, MenuItem $menu, array $parameters) { if (!$this->authorizationChecker->isGranted('ROLE_ADMIN')) { @@ -50,6 +51,7 @@ class AdminAccompanyingCourseMenuBuilder implements LocalMenuBuilderInterface ])->setExtras(['order' => 2210]); } + #[\Override] public static function getMenuIds(): array { return ['admin_section', 'admin_accompanying_course']; diff --git a/src/Bundle/ChillPersonBundle/Menu/AdminHouseholdMenuBuilder.php b/src/Bundle/ChillPersonBundle/Menu/AdminHouseholdMenuBuilder.php index 0cbc48330..944f869ca 100644 --- a/src/Bundle/ChillPersonBundle/Menu/AdminHouseholdMenuBuilder.php +++ b/src/Bundle/ChillPersonBundle/Menu/AdminHouseholdMenuBuilder.php @@ -27,6 +27,7 @@ class AdminHouseholdMenuBuilder implements LocalMenuBuilderInterface $this->authorizationChecker = $authorizationChecker; } + #[\Override] public function buildMenu($menuId, MenuItem $menu, array $parameters) { if (!$this->authorizationChecker->isGranted('ROLE_ADMIN')) { @@ -54,6 +55,7 @@ class AdminHouseholdMenuBuilder implements LocalMenuBuilderInterface ])->setExtras(['order' => 2130]); } + #[\Override] public static function getMenuIds(): array { return ['admin_section', 'admin_household']; diff --git a/src/Bundle/ChillPersonBundle/Menu/AdminPersonMenuBuilder.php b/src/Bundle/ChillPersonBundle/Menu/AdminPersonMenuBuilder.php index ee2dad9dc..282e4c524 100644 --- a/src/Bundle/ChillPersonBundle/Menu/AdminPersonMenuBuilder.php +++ b/src/Bundle/ChillPersonBundle/Menu/AdminPersonMenuBuilder.php @@ -27,6 +27,7 @@ class AdminPersonMenuBuilder implements LocalMenuBuilderInterface $this->authorizationChecker = $authorizationChecker; } + #[\Override] public function buildMenu($menuId, MenuItem $menu, array $parameters) { if (!$this->authorizationChecker->isGranted('ROLE_ADMIN')) { @@ -54,6 +55,7 @@ class AdminPersonMenuBuilder implements LocalMenuBuilderInterface ])->setExtras(['order' => 2030]); } + #[\Override] public static function getMenuIds(): array { return ['admin_section', 'admin_person']; diff --git a/src/Bundle/ChillPersonBundle/Menu/AdminSocialWorkMenuBuilder.php b/src/Bundle/ChillPersonBundle/Menu/AdminSocialWorkMenuBuilder.php index 2b98c98a6..1db7d9212 100644 --- a/src/Bundle/ChillPersonBundle/Menu/AdminSocialWorkMenuBuilder.php +++ b/src/Bundle/ChillPersonBundle/Menu/AdminSocialWorkMenuBuilder.php @@ -27,6 +27,7 @@ class AdminSocialWorkMenuBuilder implements LocalMenuBuilderInterface $this->authorizationChecker = $authorizationChecker; } + #[\Override] public function buildMenu($menuId, MenuItem $menu, array $parameters) { if (!$this->authorizationChecker->isGranted('ROLE_ADMIN')) { @@ -62,6 +63,7 @@ class AdminSocialWorkMenuBuilder implements LocalMenuBuilderInterface ])->setExtras(['order' => 2330]); } + #[\Override] public static function getMenuIds(): array { return ['admin_section', 'admin_social_work']; diff --git a/src/Bundle/ChillPersonBundle/Menu/HouseholdMenuBuilder.php b/src/Bundle/ChillPersonBundle/Menu/HouseholdMenuBuilder.php index d30adaf5d..5b928f76a 100644 --- a/src/Bundle/ChillPersonBundle/Menu/HouseholdMenuBuilder.php +++ b/src/Bundle/ChillPersonBundle/Menu/HouseholdMenuBuilder.php @@ -29,6 +29,7 @@ class HouseholdMenuBuilder implements LocalMenuBuilderInterface $this->translator = $translator; } + #[\Override] public function buildMenu($menuId, MenuItem $menu, array $parameters): void { /** @var \Chill\PersonBundle\Entity\Household\Household $household */ @@ -72,6 +73,7 @@ class HouseholdMenuBuilder implements LocalMenuBuilderInterface ->setExtras(['order' => 30]); } + #[\Override] public static function getMenuIds(): array { return ['household']; diff --git a/src/Bundle/ChillPersonBundle/Menu/PersonMenuBuilder.php b/src/Bundle/ChillPersonBundle/Menu/PersonMenuBuilder.php index 5dce8c477..e48f4a437 100644 --- a/src/Bundle/ChillPersonBundle/Menu/PersonMenuBuilder.php +++ b/src/Bundle/ChillPersonBundle/Menu/PersonMenuBuilder.php @@ -52,6 +52,7 @@ class PersonMenuBuilder implements LocalMenuBuilderInterface * * @return void */ + #[\Override] public function buildMenu($menuId, MenuItem $menu, array $parameters) { $menu->addChild($this->translator->trans('Person details'), [ @@ -127,6 +128,7 @@ class PersonMenuBuilder implements LocalMenuBuilderInterface } } + #[\Override] public static function getMenuIds(): array { return ['person']; diff --git a/src/Bundle/ChillPersonBundle/Menu/PersonQuickMenuBuilder.php b/src/Bundle/ChillPersonBundle/Menu/PersonQuickMenuBuilder.php index f6b857b90..8692fb782 100644 --- a/src/Bundle/ChillPersonBundle/Menu/PersonQuickMenuBuilder.php +++ b/src/Bundle/ChillPersonBundle/Menu/PersonQuickMenuBuilder.php @@ -20,11 +20,13 @@ final readonly class PersonQuickMenuBuilder implements LocalMenuBuilderInterface { public function __construct(private AuthorizationCheckerInterface $authorizationChecker) {} + #[\Override] public static function getMenuIds(): array { return ['person_quick_menu']; } + #[\Override] public function buildMenu($menuId, MenuItem $menu, array $parameters) { /** @var \Chill\PersonBundle\Entity\Person $person */ diff --git a/src/Bundle/ChillPersonBundle/Menu/SectionMenuBuilder.php b/src/Bundle/ChillPersonBundle/Menu/SectionMenuBuilder.php index c82038b40..d1ca64abd 100644 --- a/src/Bundle/ChillPersonBundle/Menu/SectionMenuBuilder.php +++ b/src/Bundle/ChillPersonBundle/Menu/SectionMenuBuilder.php @@ -30,6 +30,7 @@ class SectionMenuBuilder implements LocalMenuBuilderInterface */ public function __construct(protected ParameterBagInterface $parameterBag, private readonly Security $security, protected TranslatorInterface $translator) {} + #[\Override] public function buildMenu($menuId, MenuItem $menu, array $parameters) { if ($this->security->isGranted(PersonVoter::CREATE) && $this->parameterBag->get('chill_person.create_person_allowed')) { @@ -73,6 +74,7 @@ class SectionMenuBuilder implements LocalMenuBuilderInterface } } + #[\Override] public static function getMenuIds(): array { return ['section']; diff --git a/src/Bundle/ChillPersonBundle/Menu/UserMenuBuilder.php b/src/Bundle/ChillPersonBundle/Menu/UserMenuBuilder.php index 4e95d9275..9d860ae3d 100644 --- a/src/Bundle/ChillPersonBundle/Menu/UserMenuBuilder.php +++ b/src/Bundle/ChillPersonBundle/Menu/UserMenuBuilder.php @@ -34,6 +34,7 @@ class UserMenuBuilder implements LocalMenuBuilderInterface $this->authorizationChecker = $authorizationChecker; } + #[\Override] public function buildMenu($menuId, MenuItem $menu, array $parameters) { if ($this->authorizationChecker->isGranted('ROLE_USER')) { @@ -54,6 +55,7 @@ class UserMenuBuilder implements LocalMenuBuilderInterface } } + #[\Override] public static function getMenuIds(): array { return ['user']; diff --git a/src/Bundle/ChillPersonBundle/Notification/AccompanyingPeriodNotificationHandler.php b/src/Bundle/ChillPersonBundle/Notification/AccompanyingPeriodNotificationHandler.php index 668f868ae..083c5e72f 100644 --- a/src/Bundle/ChillPersonBundle/Notification/AccompanyingPeriodNotificationHandler.php +++ b/src/Bundle/ChillPersonBundle/Notification/AccompanyingPeriodNotificationHandler.php @@ -20,11 +20,13 @@ final readonly class AccompanyingPeriodNotificationHandler implements Notificati { public function __construct(private AccompanyingPeriodRepository $accompanyingPeriodRepository) {} + #[\Override] public function getTemplate(Notification $notification, array $options = []): string { return '@ChillPerson/AccompanyingPeriod/showInNotification.html.twig'; } + #[\Override] public function getTemplateData(Notification $notification, array $options = []): array { return [ @@ -33,6 +35,7 @@ final readonly class AccompanyingPeriodNotificationHandler implements Notificati ]; } + #[\Override] public function supports(Notification $notification, array $options = []): bool { return AccompanyingPeriod::class === $notification->getRelatedEntityClass(); diff --git a/src/Bundle/ChillPersonBundle/Notification/AccompanyingPeriodWorkEvaluationDocumentNotificationHandler.php b/src/Bundle/ChillPersonBundle/Notification/AccompanyingPeriodWorkEvaluationDocumentNotificationHandler.php index 40aff8570..e8115531a 100644 --- a/src/Bundle/ChillPersonBundle/Notification/AccompanyingPeriodWorkEvaluationDocumentNotificationHandler.php +++ b/src/Bundle/ChillPersonBundle/Notification/AccompanyingPeriodWorkEvaluationDocumentNotificationHandler.php @@ -20,11 +20,13 @@ final readonly class AccompanyingPeriodWorkEvaluationDocumentNotificationHandler { public function __construct(private AccompanyingPeriodWorkEvaluationDocumentRepository $accompanyingPeriodWorkEvaluationDocumentRepository) {} + #[\Override] public function getTemplate(Notification $notification, array $options = []): string { return '@ChillPerson/AccompanyingCourseWork/showEvaluationDocumentInNotification.html.twig'; } + #[\Override] public function getTemplateData(Notification $notification, array $options = []): array { return [ @@ -34,6 +36,7 @@ final readonly class AccompanyingPeriodWorkEvaluationDocumentNotificationHandler ]; } + #[\Override] public function supports(Notification $notification, array $options = []): bool { return AccompanyingPeriodWorkEvaluationDocument::class === $notification->getRelatedEntityClass(); diff --git a/src/Bundle/ChillPersonBundle/Notification/AccompanyingPeriodWorkNotificationHandler.php b/src/Bundle/ChillPersonBundle/Notification/AccompanyingPeriodWorkNotificationHandler.php index e147fa520..a30a4c128 100644 --- a/src/Bundle/ChillPersonBundle/Notification/AccompanyingPeriodWorkNotificationHandler.php +++ b/src/Bundle/ChillPersonBundle/Notification/AccompanyingPeriodWorkNotificationHandler.php @@ -20,11 +20,13 @@ final readonly class AccompanyingPeriodWorkNotificationHandler implements Notifi { public function __construct(private AccompanyingPeriodWorkRepository $accompanyingPeriodWorkRepository) {} + #[\Override] public function getTemplate(Notification $notification, array $options = []): string { return '@ChillPerson/AccompanyingCourseWork/showInNotification.html.twig'; } + #[\Override] public function getTemplateData(Notification $notification, array $options = []): array { return [ @@ -33,6 +35,7 @@ final readonly class AccompanyingPeriodWorkNotificationHandler implements Notifi ]; } + #[\Override] public function supports(Notification $notification, array $options = []): bool { return AccompanyingPeriodWork::class === $notification->getRelatedEntityClass(); diff --git a/src/Bundle/ChillPersonBundle/Privacy/AccompanyingPeriodPrivacyEvent.php b/src/Bundle/ChillPersonBundle/Privacy/AccompanyingPeriodPrivacyEvent.php index 739387941..36d9f69b4 100644 --- a/src/Bundle/ChillPersonBundle/Privacy/AccompanyingPeriodPrivacyEvent.php +++ b/src/Bundle/ChillPersonBundle/Privacy/AccompanyingPeriodPrivacyEvent.php @@ -35,7 +35,7 @@ use Chill\PersonBundle\Entity\AccompanyingPeriod; class AccompanyingPeriodPrivacyEvent extends \Symfony\Contracts\EventDispatcher\Event { - final public const ACCOMPANYING_PERIOD_PRIVACY_EVENT = 'chill_person.accompanying_period_privacy_event'; + final public const string 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 df57a08fd..e756fdbd6 100644 --- a/src/Bundle/ChillPersonBundle/Privacy/PrivacyEvent.php +++ b/src/Bundle/ChillPersonBundle/Privacy/PrivacyEvent.php @@ -41,7 +41,7 @@ use Chill\PersonBundle\Entity\Person; */ class PrivacyEvent extends \Symfony\Contracts\EventDispatcher\Event { - final public const PERSON_PRIVACY_EVENT = 'chill_person.privacy_event'; + final public const string PERSON_PRIVACY_EVENT = 'chill_person.privacy_event'; private array $persons = []; diff --git a/src/Bundle/ChillPersonBundle/Privacy/PrivacyEventSubscriber.php b/src/Bundle/ChillPersonBundle/Privacy/PrivacyEventSubscriber.php index 00ffa47f5..31355f85e 100644 --- a/src/Bundle/ChillPersonBundle/Privacy/PrivacyEventSubscriber.php +++ b/src/Bundle/ChillPersonBundle/Privacy/PrivacyEventSubscriber.php @@ -47,6 +47,7 @@ final readonly class PrivacyEventSubscriber implements EventSubscriberInterface private TokenStorageInterface $token ) {} + #[\Override] public static function getSubscribedEvents() { return [ diff --git a/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriod/AccompanyingPeriodInfoRepository.php b/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriod/AccompanyingPeriodInfoRepository.php index 88c89af7c..2f16bc856 100644 --- a/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriod/AccompanyingPeriodInfoRepository.php +++ b/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriod/AccompanyingPeriodInfoRepository.php @@ -27,6 +27,7 @@ readonly class AccompanyingPeriodInfoRepository implements AccompanyingPeriodInf $this->entityRepository = $em->getRepository($this->getClassName()); } + #[\Override] public function findAccompanyingPeriodIdInactiveAfter(\DateInterval $interval, array $statuses = []): array { $query = $this->em->createQuery(); @@ -45,6 +46,7 @@ readonly class AccompanyingPeriodInfoRepository implements AccompanyingPeriodInf ->getSingleColumnResult(); } + #[\Override] public function findAccompanyingPeriodIdActiveSince(\DateInterval $interval, array $statuses = []): array { $query = $this->em->createQuery(); @@ -63,26 +65,31 @@ readonly class AccompanyingPeriodInfoRepository implements AccompanyingPeriodInf ->getSingleColumnResult(); } + #[\Override] public function find($id): never { throw new \LogicException('Calling an accompanying period info by his id does not make sense'); } + #[\Override] public function findAll(): array { return $this->entityRepository->findAll(); } + #[\Override] public function findBy(array $criteria, ?array $orderBy = null, ?int $limit = null, ?int $offset = null): array { return $this->entityRepository->findBy($criteria, $orderBy, $limit, $offset); } + #[\Override] public function findOneBy(array $criteria): ?AccompanyingPeriodInfo { return $this->entityRepository->findOneBy($criteria); } + #[\Override] public function getClassName(): string { return AccompanyingPeriodInfo::class; diff --git a/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriod/AccompanyingPeriodWorkEvaluationDocumentRepository.php b/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriod/AccompanyingPeriodWorkEvaluationDocumentRepository.php index 59bb3f915..9585e4bd3 100644 --- a/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriod/AccompanyingPeriodWorkEvaluationDocumentRepository.php +++ b/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriod/AccompanyingPeriodWorkEvaluationDocumentRepository.php @@ -25,6 +25,7 @@ class AccompanyingPeriodWorkEvaluationDocumentRepository implements ObjectReposi $this->repository = $em->getRepository(AccompanyingPeriodWorkEvaluationDocument::class); } + #[\Override] public function find($id): ?AccompanyingPeriodWorkEvaluationDocument { return $this->repository->find($id); @@ -33,6 +34,7 @@ class AccompanyingPeriodWorkEvaluationDocumentRepository implements ObjectReposi /** * @return array|object[]|AccompanyingPeriodWorkEvaluationDocument[] */ + #[\Override] public function findAll(): array { return $this->repository->findAll(); @@ -44,16 +46,19 @@ class AccompanyingPeriodWorkEvaluationDocumentRepository implements ObjectReposi * * @return array|object[]|AccompanyingPeriodWorkEvaluationDocument[] */ + #[\Override] public function findBy(array $criteria, ?array $orderBy = null, $limit = null, $offset = null): array { return $this->repository->findBy($criteria, $orderBy, $limit, $offset); } + #[\Override] public function findOneBy(array $criteria): ?AccompanyingPeriodWorkEvaluationDocument { return $this->repository->findOneBy($criteria); } + #[\Override] public function getClassName(): string { return AccompanyingPeriodWorkEvaluationDocument::class; diff --git a/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriod/AccompanyingPeriodWorkEvaluationRepository.php b/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriod/AccompanyingPeriodWorkEvaluationRepository.php index 6110f8bb0..a86de05c9 100644 --- a/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriod/AccompanyingPeriodWorkEvaluationRepository.php +++ b/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriod/AccompanyingPeriodWorkEvaluationRepository.php @@ -35,6 +35,7 @@ class AccompanyingPeriodWorkEvaluationRepository implements ObjectRepository ->select('count(e)')->getQuery()->getSingleScalarResult(); } + #[\Override] public function find($id): ?AccompanyingPeriodWorkEvaluation { return $this->repository->find($id); @@ -43,6 +44,7 @@ class AccompanyingPeriodWorkEvaluationRepository implements ObjectRepository /** * @return array|AccompanyingPeriodWorkEvaluation[] */ + #[\Override] public function findAll(): array { return $this->repository->findAll(); @@ -54,6 +56,7 @@ class AccompanyingPeriodWorkEvaluationRepository implements ObjectRepository * * @return array|AccompanyingPeriodWorkEvaluation[] */ + #[\Override] public function findBy(array $criteria, ?array $orderBy = null, $limit = null, $offset = null): array { return $this->repository->findBy($criteria, $orderBy, $limit, $offset); @@ -69,11 +72,13 @@ class AccompanyingPeriodWorkEvaluationRepository implements ObjectRepository ->getResult(); } + #[\Override] public function findOneBy(array $criteria): ?AccompanyingPeriodWorkEvaluation { return $this->repository->findOneBy($criteria); } + #[\Override] public function getClassName(): string { return AccompanyingPeriodWorkEvaluation::class; diff --git a/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriod/AccompanyingPeriodWorkRepository.php b/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriod/AccompanyingPeriodWorkRepository.php index 95b995e74..91f2c7944 100644 --- a/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriod/AccompanyingPeriodWorkRepository.php +++ b/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriod/AccompanyingPeriodWorkRepository.php @@ -57,16 +57,19 @@ final readonly class AccompanyingPeriodWorkRepository implements ObjectRepositor return $this->repository->createQueryBuilder($alias, $indexBy); } + #[\Override] public function find($id): ?AccompanyingPeriodWork { return $this->repository->find($id); } + #[\Override] public function findAll(): array { return $this->repository->findAll(); } + #[\Override] public function findBy(array $criteria, ?array $orderBy = null, $limit = null, $offset = null): array { return $this->repository->findBy($criteria, $orderBy, $limit, $offset); @@ -197,11 +200,13 @@ final readonly class AccompanyingPeriodWorkRepository implements ObjectRepositor ->getResult(); } + #[\Override] public function findOneBy(array $criteria): ?AccompanyingPeriodWork { return $this->repository->findOneBy($criteria); } + #[\Override] public function getClassName() { return AccompanyingPeriodWork::class; diff --git a/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriod/ClosingMotiveRepository.php b/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriod/ClosingMotiveRepository.php index de5df1347..94f4fc08b 100644 --- a/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriod/ClosingMotiveRepository.php +++ b/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriod/ClosingMotiveRepository.php @@ -25,6 +25,7 @@ final readonly class ClosingMotiveRepository implements ClosingMotiveRepositoryI $this->repository = $entityManager->getRepository(ClosingMotive::class); } + #[\Override] public function find($id): ?ClosingMotive { return $this->repository->find($id); @@ -33,6 +34,7 @@ final readonly class ClosingMotiveRepository implements ClosingMotiveRepositoryI /** * @return array|ClosingMotive[] */ + #[\Override] public function findAll(): array { return $this->repository->findAll(); @@ -41,16 +43,19 @@ final readonly class ClosingMotiveRepository implements ClosingMotiveRepositoryI /** * @return array|ClosingMotive[] */ + #[\Override] public function findBy(array $criteria, ?array $orderBy = null, ?int $limit = null, ?int $offset = null): array { return $this->repository->findBy($criteria, $orderBy, $limit, $offset); } + #[\Override] public function findOneBy(array $criteria): ?ClosingMotive { return $this->findOneBy($criteria); } + #[\Override] public function getActiveClosingMotive(bool $onlyLeaf = true) { $rsm = new ResultSetMappingBuilder($this->entityManager); @@ -75,6 +80,7 @@ final readonly class ClosingMotiveRepository implements ClosingMotiveRepositoryI ->getResult(); } + #[\Override] public function getClassName(): string { return ClosingMotive::class; diff --git a/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriodACLAwareRepository.php b/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriodACLAwareRepository.php index 32c2a6f80..e971123ac 100644 --- a/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriodACLAwareRepository.php +++ b/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriodACLAwareRepository.php @@ -77,6 +77,7 @@ final readonly class AccompanyingPeriodACLAwareRepository implements Accompanyin * @throws NonUniqueResultException * @throws NoResultException */ + #[\Override] public function countByUnDispatched(array $jobs, array $services, array $administrativeLocations): int { $qb = $this->addACLMultiCenterOnQuery( @@ -89,6 +90,7 @@ final readonly class AccompanyingPeriodACLAwareRepository implements Accompanyin return $qb->getQuery()->getSingleScalarResult(); } + #[\Override] public function countByUserAndPostalCodesOpenedAccompanyingPeriod(?User $user, array $postalCodes): int { if (null === $user) { @@ -103,6 +105,7 @@ final readonly class AccompanyingPeriodACLAwareRepository implements Accompanyin return $qb->getQuery()->getSingleScalarResult(); } + #[\Override] public function findByPerson( Person $person, string $role, @@ -230,6 +233,7 @@ final readonly class AccompanyingPeriodACLAwareRepository implements Accompanyin return $centerOnScopes; } + #[\Override] public function findByUnDispatched(array $jobs, array $services, array $administrativeAdministrativeLocations, ?array $orderBy = null, ?int $limit = null, ?int $offset = null): array { $qb = $this->buildQueryUnDispatched($jobs, $services, $administrativeAdministrativeLocations); @@ -241,6 +245,7 @@ final readonly class AccompanyingPeriodACLAwareRepository implements Accompanyin return $qb->getQuery()->getResult(); } + #[\Override] public function findByUserAndPostalCodesOpenedAccompanyingPeriod(?User $user, array $postalCodes, array $orderBy = [], int $limit = 0, int $offset = 50): array { if (null === $user) { diff --git a/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriodRepository.php b/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriodRepository.php index 73f1beecb..1607dc94b 100644 --- a/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriodRepository.php +++ b/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriodRepository.php @@ -44,6 +44,7 @@ final readonly class AccompanyingPeriodRepository implements ObjectRepository return $this->repository->createQueryBuilder($alias, $indexBy); } + #[\Override] public function find($id): ?AccompanyingPeriod { return $this->repository->find($id); @@ -52,11 +53,13 @@ final readonly class AccompanyingPeriodRepository implements ObjectRepository /** * @return AccompanyingPeriod[] */ + #[\Override] public function findAll(): array { return $this->repository->findAll(); } + #[\Override] public function findBy(array $criteria, ?array $orderBy = null, $limit = null, $offset = null): array { return $this->repository->findBy($criteria, $orderBy, $limit, $offset); @@ -87,11 +90,13 @@ final readonly class AccompanyingPeriodRepository implements ObjectRepository return $qb; } + #[\Override] public function findOneBy(array $criteria): ?AccompanyingPeriod { return $this->findOneBy($criteria); } + #[\Override] public function getClassName() { return AccompanyingPeriod::class; diff --git a/src/Bundle/ChillPersonBundle/Repository/Household/HouseholdACLAwareRepository.php b/src/Bundle/ChillPersonBundle/Repository/Household/HouseholdACLAwareRepository.php index 26121ffdc..47808ec49 100644 --- a/src/Bundle/ChillPersonBundle/Repository/Household/HouseholdACLAwareRepository.php +++ b/src/Bundle/ChillPersonBundle/Repository/Household/HouseholdACLAwareRepository.php @@ -72,6 +72,7 @@ final readonly class HouseholdACLAwareRepository implements HouseholdACLAwareRep return $qb; } + #[\Override] public function countByAddressReference(AddressReference $addressReference): int { $qb = $this->buildQueryByAddressReference($addressReference); @@ -82,6 +83,7 @@ final readonly class HouseholdACLAwareRepository implements HouseholdACLAwareRep ->getSingleScalarResult(); } + #[\Override] public function findByAddressReference( AddressReference $addressReference, ?int $firstResult = 0, diff --git a/src/Bundle/ChillPersonBundle/Repository/Household/HouseholdCompositionRepository.php b/src/Bundle/ChillPersonBundle/Repository/Household/HouseholdCompositionRepository.php index 1bd72fd35..b796ead67 100644 --- a/src/Bundle/ChillPersonBundle/Repository/Household/HouseholdCompositionRepository.php +++ b/src/Bundle/ChillPersonBundle/Repository/Household/HouseholdCompositionRepository.php @@ -25,11 +25,13 @@ final readonly class HouseholdCompositionRepository implements HouseholdComposit $this->repository = $entityManager->getRepository(HouseholdComposition::class); } + #[\Override] public function countByHousehold(Household $household): int { return $this->repository->count(['household' => $household]); } + #[\Override] public function find($id): ?HouseholdComposition { return $this->repository->find($id); @@ -38,6 +40,7 @@ final readonly class HouseholdCompositionRepository implements HouseholdComposit /** * @return array|HouseholdComposition[] */ + #[\Override] public function findAll(): array { return $this->repository->findAll(); @@ -49,6 +52,7 @@ final readonly class HouseholdCompositionRepository implements HouseholdComposit * * @return array|object[]|HouseholdComposition[] */ + #[\Override] public function findBy(array $criteria, ?array $orderBy = null, $limit = null, $offset = null): array { return $this->repository->findBy($criteria, $orderBy, $limit, $offset); @@ -57,16 +61,19 @@ final readonly class HouseholdCompositionRepository implements HouseholdComposit /** * @return array|HouseholdComposition[]|object[] */ + #[\Override] public function findByHousehold(Household $household, ?array $orderBy = null, ?int $limit = null, ?int $offset = null): array { return $this->findBy(['household' => $household], $orderBy, $limit, $offset); } + #[\Override] public function findOneBy(array $criteria): ?HouseholdComposition { return $this->repository->findOneBy($criteria); } + #[\Override] public function getClassName(): string { return HouseholdComposition::class; diff --git a/src/Bundle/ChillPersonBundle/Repository/Household/HouseholdCompositionTypeRepository.php b/src/Bundle/ChillPersonBundle/Repository/Household/HouseholdCompositionTypeRepository.php index 666895696..93829e9cc 100644 --- a/src/Bundle/ChillPersonBundle/Repository/Household/HouseholdCompositionTypeRepository.php +++ b/src/Bundle/ChillPersonBundle/Repository/Household/HouseholdCompositionTypeRepository.php @@ -24,6 +24,7 @@ final readonly class HouseholdCompositionTypeRepository implements HouseholdComp $this->repository = $entityManager->getRepository(HouseholdCompositionType::class); } + #[\Override] public function find($id): ?HouseholdCompositionType { return $this->repository->find($id); @@ -32,6 +33,7 @@ final readonly class HouseholdCompositionTypeRepository implements HouseholdComp /** * @return array|HouseholdCompositionType[]|object[] */ + #[\Override] public function findAll(): array { return $this->repository->findAll(); @@ -40,6 +42,7 @@ final readonly class HouseholdCompositionTypeRepository implements HouseholdComp /** * @return array|HouseholdCompositionType[] */ + #[\Override] public function findAllActive(): array { return $this->findBy(['active' => true]); @@ -51,16 +54,19 @@ final readonly class HouseholdCompositionTypeRepository implements HouseholdComp * * @return array|HouseholdCompositionType[]|object[] */ + #[\Override] public function findBy(array $criteria, ?array $orderBy = null, $limit = null, $offset = null): array { return $this->repository->findBy($criteria, $orderBy, $limit, $offset); } + #[\Override] public function findOneBy(array $criteria): ?HouseholdCompositionType { return $this->repository->findOneBy($criteria); } + #[\Override] public function getClassName(): string { return HouseholdCompositionType::class; diff --git a/src/Bundle/ChillPersonBundle/Repository/Household/HouseholdRepository.php b/src/Bundle/ChillPersonBundle/Repository/Household/HouseholdRepository.php index 271883080..f75bc9ba2 100644 --- a/src/Bundle/ChillPersonBundle/Repository/Household/HouseholdRepository.php +++ b/src/Bundle/ChillPersonBundle/Repository/Household/HouseholdRepository.php @@ -20,7 +20,7 @@ use Doctrine\Persistence\ObjectRepository; final readonly class HouseholdRepository implements ObjectRepository { - private const SQL_BY_ACCOMPANYING_PERIOD_PARTICIPATION = <<<'SQL' + private const string SQL_BY_ACCOMPANYING_PERIOD_PARTICIPATION = <<<'SQL' WITH participations AS ( SELECT DISTINCT part.accompanyingperiod_id FROM chill_person_accompanying_period_participation AS part @@ -55,16 +55,19 @@ final readonly class HouseholdRepository implements ObjectRepository return $this->buildQueryByAccompanyingPeriodParticipation($person, true); } + #[\Override] public function find($id) { return $this->repository->find($id); } + #[\Override] public function findAll() { return $this->repository->findAll(); } + #[\Override] public function findBy(array $criteria, ?array $orderBy = null, $limit = null, $offset = null) { return $this->repository->findBy($criteria, $orderBy, $limit, $offset); @@ -75,11 +78,13 @@ final readonly class HouseholdRepository implements ObjectRepository return $this->buildQueryByAccompanyingPeriodParticipation($person, false, $limit, $offset); } + #[\Override] public function findOneBy(array $criteria) { return $this->findOneBy($criteria); } + #[\Override] public function getClassName() { return Household::class; diff --git a/src/Bundle/ChillPersonBundle/Repository/Household/PersonHouseholdAddressRepository.php b/src/Bundle/ChillPersonBundle/Repository/Household/PersonHouseholdAddressRepository.php index f9132c2bd..b0bdf420a 100644 --- a/src/Bundle/ChillPersonBundle/Repository/Household/PersonHouseholdAddressRepository.php +++ b/src/Bundle/ChillPersonBundle/Repository/Household/PersonHouseholdAddressRepository.php @@ -25,6 +25,7 @@ final readonly class PersonHouseholdAddressRepository implements ObjectRepositor $this->repository = $em->getRepository(PersonHouseholdAddress::class); } + #[\Override] public function find($id, $lockMode = null, $lockVersion = null): ?PersonHouseholdAddress { return $this->repository->find($id, $lockMode, $lockVersion); @@ -33,6 +34,7 @@ final readonly class PersonHouseholdAddressRepository implements ObjectRepositor /** * @return PersonHouseholdAddress[] */ + #[\Override] public function findAll(): array { return $this->repository->findAll(); @@ -44,16 +46,19 @@ final readonly class PersonHouseholdAddressRepository implements ObjectRepositor * * @return PersonHouseholdAddress[] */ + #[\Override] public function findBy(array $criteria, ?array $orderBy = null, $limit = null, $offset = null): array { return $this->repository->findBy($criteria, $orderBy, $limit, $offset); } + #[\Override] public function findOneBy(array $criteria, ?array $orderBy = null): ?PersonHouseholdAddress { return $this->repository->findOneBy($criteria, $orderBy); } + #[\Override] public function getClassName() { return PersonHouseholdAddress::class; diff --git a/src/Bundle/ChillPersonBundle/Repository/Household/PositionRepository.php b/src/Bundle/ChillPersonBundle/Repository/Household/PositionRepository.php index 585f2aedb..2a17e9179 100644 --- a/src/Bundle/ChillPersonBundle/Repository/Household/PositionRepository.php +++ b/src/Bundle/ChillPersonBundle/Repository/Household/PositionRepository.php @@ -30,6 +30,7 @@ final readonly class PositionRepository implements ObjectRepository /** * @return Position */ + #[\Override] public function find($id) { return $this->repository->find($id); @@ -38,6 +39,7 @@ final readonly class PositionRepository implements ObjectRepository /** * @return Position[] */ + #[\Override] public function findAll(): array { return $this->repository->findAll(); @@ -49,6 +51,7 @@ final readonly class PositionRepository implements ObjectRepository * * @return Position[] */ + #[\Override] public function findBy(array $criteria, ?array $orderBy = null, $limit = null, $offset = null): array { return $this->repository->findBy($criteria, $orderBy, $limit, $offset); @@ -69,11 +72,13 @@ final readonly class PositionRepository implements ObjectRepository /** * @return Position[] */ + #[\Override] public function findOneBy(array $criteria): array { return $this->repository->findOneBy($criteria); } + #[\Override] public function getClassName() { return Position::class; diff --git a/src/Bundle/ChillPersonBundle/Repository/MaritalStatusRepository.php b/src/Bundle/ChillPersonBundle/Repository/MaritalStatusRepository.php index 3324ee444..d955b592e 100644 --- a/src/Bundle/ChillPersonBundle/Repository/MaritalStatusRepository.php +++ b/src/Bundle/ChillPersonBundle/Repository/MaritalStatusRepository.php @@ -24,26 +24,31 @@ class MaritalStatusRepository implements MaritalStatusRepositoryInterface $this->repository = $entityManager->getRepository(MaritalStatus::class); } + #[\Override] public function find($id): ?MaritalStatus { return $this->repository->find($id); } + #[\Override] public function findAll(): array { return $this->repository->findAll(); } + #[\Override] public function findBy(array $criteria, ?array $orderBy = null, $limit = null, $offset = null): array { return $this->repository->findBy($criteria, $orderBy, $limit, $offset); } + #[\Override] public function findOneBy(array $criteria): ?MaritalStatus { return $this->findOneBy($criteria); } + #[\Override] public function getClassName(): string { return MaritalStatus::class; diff --git a/src/Bundle/ChillPersonBundle/Repository/Person/PersonCenterHistoryRepository.php b/src/Bundle/ChillPersonBundle/Repository/Person/PersonCenterHistoryRepository.php index b6d80a721..ab0c70dac 100644 --- a/src/Bundle/ChillPersonBundle/Repository/Person/PersonCenterHistoryRepository.php +++ b/src/Bundle/ChillPersonBundle/Repository/Person/PersonCenterHistoryRepository.php @@ -24,6 +24,7 @@ class PersonCenterHistoryRepository implements PersonCenterHistoryInterface $this->repository = $em->getRepository($this->getClassName()); } + #[\Override] public function find($id): ?PersonCenterHistory { return $this->repository->find($id); @@ -32,6 +33,7 @@ class PersonCenterHistoryRepository implements PersonCenterHistoryInterface /** * @return array|PersonCenterHistory[] */ + #[\Override] public function findAll(): array { return $this->repository->findAll(); @@ -40,16 +42,19 @@ class PersonCenterHistoryRepository implements PersonCenterHistoryInterface /** * @return array|PersonCenterHistory[] */ + #[\Override] public function findBy(array $criteria, ?array $orderBy = null, ?int $limit = null, ?int $offset = null): array { return $this->repository->findBy($criteria, $orderBy, $limit, $offset); } + #[\Override] public function findOneBy(array $criteria): ?PersonCenterHistory { return $this->repository->findOneBy($criteria); } + #[\Override] public function getClassName(): string { return PersonCenterHistory::class; diff --git a/src/Bundle/ChillPersonBundle/Repository/PersonACLAwareRepository.php b/src/Bundle/ChillPersonBundle/Repository/PersonACLAwareRepository.php index 303773c3e..0368c80be 100644 --- a/src/Bundle/ChillPersonBundle/Repository/PersonACLAwareRepository.php +++ b/src/Bundle/ChillPersonBundle/Repository/PersonACLAwareRepository.php @@ -27,6 +27,7 @@ final readonly class PersonACLAwareRepository implements PersonACLAwareRepositor { public function __construct(private Security $security, private EntityManagerInterface $em, private CountryRepository $countryRepository, private AuthorizationHelperInterface $authorizationHelper) {} + #[\Override] public function buildAuthorizedQuery( ?string $default = null, ?string $firstname = null, @@ -55,6 +56,7 @@ final readonly class PersonACLAwareRepository implements PersonACLAwareRepositor return $this->addAuthorizations($query); } + #[\Override] public function countBySearchCriteria( ?string $default = null, ?string $firstname = null, @@ -243,6 +245,7 @@ final readonly class PersonACLAwareRepository implements PersonACLAwareRepositor * @throws NonUniqueResultException * @throws ParsingException */ + #[\Override] public function findBySearchCriteria( int $start, int $limit, diff --git a/src/Bundle/ChillPersonBundle/Repository/PersonRepository.php b/src/Bundle/ChillPersonBundle/Repository/PersonRepository.php index b7104a843..d3254a1e4 100644 --- a/src/Bundle/ChillPersonBundle/Repository/PersonRepository.php +++ b/src/Bundle/ChillPersonBundle/Repository/PersonRepository.php @@ -49,16 +49,19 @@ class PersonRepository implements ObjectRepository return $this->repository->createQueryBuilder($alias, $indexBy); } + #[\Override] public function find($id, $lockMode = null, $lockVersion = null): ?Person { return $this->repository->find($id, $lockMode, $lockVersion); } + #[\Override] public function findAll() { return $this->repository->findAll(); } + #[\Override] public function findBy(array $criteria, ?array $orderBy = null, $limit = null, $offset = null) { return $this->repository->findBy($criteria, $orderBy, $limit, $offset); @@ -91,11 +94,13 @@ class PersonRepository implements ObjectRepository return $qb->getQuery()->getResult(); } + #[\Override] public function findOneBy(array $criteria) { return $this->repository->findOneBy($criteria); } + #[\Override] public function getClassName() { return Person::class; diff --git a/src/Bundle/ChillPersonBundle/Repository/PersonResourceRepository.php b/src/Bundle/ChillPersonBundle/Repository/PersonResourceRepository.php index 3caae8444..4857ca832 100644 --- a/src/Bundle/ChillPersonBundle/Repository/PersonResourceRepository.php +++ b/src/Bundle/ChillPersonBundle/Repository/PersonResourceRepository.php @@ -31,6 +31,7 @@ final readonly class PersonResourceRepository implements ObjectRepository return $this->repository->createQueryBuilder($alias, $indexBy); } + #[\Override] public function find($id): ?PersonResource { return $this->repository->find($id); @@ -39,6 +40,7 @@ final readonly class PersonResourceRepository implements ObjectRepository /** * @return PersonResource[] */ + #[\Override] public function findAll(): array { return $this->repository->findAll(); @@ -50,16 +52,19 @@ final readonly class PersonResourceRepository implements ObjectRepository * * @return PersonResource[] */ + #[\Override] public function findBy(array $criteria, ?array $orderBy = null, $limit = null, $offset = null): array { return $this->repository->findBy($criteria, $orderBy, $limit, $offset); } + #[\Override] public function findOneBy(array $criteria): ?PersonResource { return $this->repository->findOneBy($criteria); } + #[\Override] public function getClassName(): string { return PersonResource::class; diff --git a/src/Bundle/ChillPersonBundle/Repository/Relationships/RelationRepository.php b/src/Bundle/ChillPersonBundle/Repository/Relationships/RelationRepository.php index d3fe813dc..483140224 100644 --- a/src/Bundle/ChillPersonBundle/Repository/Relationships/RelationRepository.php +++ b/src/Bundle/ChillPersonBundle/Repository/Relationships/RelationRepository.php @@ -25,26 +25,31 @@ class RelationRepository implements ObjectRepository $this->repository = $entityManager->getRepository(Relation::class); } + #[\Override] public function find($id): ?Relation { return $this->repository->find($id); } + #[\Override] public function findAll(): array { return $this->repository->findAll(); } + #[\Override] public function findBy(array $criteria, ?array $orderBy = null, $limit = null, $offset = null): array { return $this->repository->findBy($criteria, $orderBy, $limit, $offset); } + #[\Override] public function findOneBy(array $criteria): ?Relation { return $this->findOneBy($criteria); } + #[\Override] public function getClassName(): string { return Relation::class; diff --git a/src/Bundle/ChillPersonBundle/Repository/Relationships/RelationshipRepository.php b/src/Bundle/ChillPersonBundle/Repository/Relationships/RelationshipRepository.php index 932b872c5..110e3f99a 100644 --- a/src/Bundle/ChillPersonBundle/Repository/Relationships/RelationshipRepository.php +++ b/src/Bundle/ChillPersonBundle/Repository/Relationships/RelationshipRepository.php @@ -38,16 +38,19 @@ class RelationshipRepository implements ObjectRepository ->getSingleScalarResult(); } + #[\Override] public function find($id): ?Relationship { return $this->repository->find($id); } + #[\Override] public function findAll(): array { return $this->repository->findAll(); } + #[\Override] public function findBy(array $criteria, ?array $orderBy = null, $limit = null, $offset = null): array { return $this->repository->findBy($criteria, $orderBy, $limit, $offset); @@ -64,11 +67,13 @@ class RelationshipRepository implements ObjectRepository ->getResult(); } + #[\Override] public function findOneBy(array $criteria): ?Relationship { return $this->findOneBy($criteria); } + #[\Override] public function getClassName(): string { return Relationship::class; diff --git a/src/Bundle/ChillPersonBundle/Repository/SocialWork/EvaluationRepository.php b/src/Bundle/ChillPersonBundle/Repository/SocialWork/EvaluationRepository.php index 1c89a98f6..40b0c0b07 100644 --- a/src/Bundle/ChillPersonBundle/Repository/SocialWork/EvaluationRepository.php +++ b/src/Bundle/ChillPersonBundle/Repository/SocialWork/EvaluationRepository.php @@ -24,6 +24,7 @@ final readonly class EvaluationRepository implements EvaluationRepositoryInterfa $this->repository = $entityManager->getRepository(Evaluation::class); } + #[\Override] public function find($id): ?Evaluation { return $this->repository->find($id); @@ -32,11 +33,13 @@ final readonly class EvaluationRepository implements EvaluationRepositoryInterfa /** * @return array */ + #[\Override] public function findAll(): array { return $this->repository->findAll(); } + #[\Override] public function findAllActive(): array { return $this->findBy(['active' => true]); @@ -48,11 +51,13 @@ final readonly class EvaluationRepository implements EvaluationRepositoryInterfa * * @return array */ + #[\Override] public function findBy(array $criteria, ?array $orderBy = null, $limit = null, $offset = null): array { return $this->repository->findBy($criteria, $orderBy, $limit, $offset); } + #[\Override] public function findOneBy(array $criteria, ?array $orderBy = null): ?Evaluation { return $this->repository->findOneBy($criteria, $orderBy); @@ -61,6 +66,7 @@ final readonly class EvaluationRepository implements EvaluationRepositoryInterfa /** * @return class-string */ + #[\Override] public function getClassName(): string { return Evaluation::class; diff --git a/src/Bundle/ChillPersonBundle/Repository/SocialWork/GoalRepository.php b/src/Bundle/ChillPersonBundle/Repository/SocialWork/GoalRepository.php index ec89c597d..b398fa129 100644 --- a/src/Bundle/ChillPersonBundle/Repository/SocialWork/GoalRepository.php +++ b/src/Bundle/ChillPersonBundle/Repository/SocialWork/GoalRepository.php @@ -37,6 +37,7 @@ final readonly class GoalRepository implements ObjectRepository ->getSingleScalarResult(); } + #[\Override] public function find($id): ?Goal { return $this->repository->find($id); @@ -45,6 +46,7 @@ final readonly class GoalRepository implements ObjectRepository /** * @return array */ + #[\Override] public function findAll(): array { return $this->repository->findAll(); @@ -56,6 +58,7 @@ final readonly class GoalRepository implements ObjectRepository * * @return array */ + #[\Override] public function findBy(array $criteria, ?array $orderBy = null, $limit = null, $offset = null): array { return $this->repository->findBy($criteria, $orderBy, $limit, $offset); @@ -88,6 +91,7 @@ final readonly class GoalRepository implements ObjectRepository ->getResult(); } + #[\Override] public function findOneBy(array $criteria, ?array $orderBy = null): ?Goal { return $this->repository->findOneBy($criteria, $orderBy); @@ -96,6 +100,7 @@ final readonly class GoalRepository implements ObjectRepository /** * @return class-string */ + #[\Override] public function getClassName(): string { return Goal::class; diff --git a/src/Bundle/ChillPersonBundle/Repository/SocialWork/ResultRepository.php b/src/Bundle/ChillPersonBundle/Repository/SocialWork/ResultRepository.php index 0d470d2d7..b636b6bdf 100644 --- a/src/Bundle/ChillPersonBundle/Repository/SocialWork/ResultRepository.php +++ b/src/Bundle/ChillPersonBundle/Repository/SocialWork/ResultRepository.php @@ -48,6 +48,7 @@ final readonly class ResultRepository implements ObjectRepository ->getSingleScalarResult(); } + #[\Override] public function find($id): ?Result { return $this->repository->find($id); @@ -56,6 +57,7 @@ final readonly class ResultRepository implements ObjectRepository /** * @return array */ + #[\Override] public function findAll(): array { return $this->repository->findAll(); @@ -67,6 +69,7 @@ final readonly class ResultRepository implements ObjectRepository * * @return array */ + #[\Override] public function findBy(array $criteria, ?array $orderBy = null, $limit = null, $offset = null): array { return $this->repository->findBy($criteria, $orderBy, $limit, $offset); @@ -112,6 +115,7 @@ final readonly class ResultRepository implements ObjectRepository ->getResult(); } + #[\Override] public function findOneBy(array $criteria, ?array $orderBy = null): ?Result { return $this->repository->findOneBy($criteria, $orderBy); @@ -120,6 +124,7 @@ final readonly class ResultRepository implements ObjectRepository /** * @return class-string */ + #[\Override] public function getClassName(): string { return Result::class; diff --git a/src/Bundle/ChillPersonBundle/Repository/SocialWork/SocialActionRepository.php b/src/Bundle/ChillPersonBundle/Repository/SocialWork/SocialActionRepository.php index fe530e84b..3289451f8 100644 --- a/src/Bundle/ChillPersonBundle/Repository/SocialWork/SocialActionRepository.php +++ b/src/Bundle/ChillPersonBundle/Repository/SocialWork/SocialActionRepository.php @@ -31,6 +31,7 @@ final readonly class SocialActionRepository implements ObjectRepository return $this->repository->createQueryBuilder($alias, $indexBy); } + #[\Override] public function find($id): ?SocialAction { return $this->repository->find($id); @@ -39,6 +40,7 @@ final readonly class SocialActionRepository implements ObjectRepository /** * @return array */ + #[\Override] public function findAll(): array { return $this->repository->findAll(); @@ -58,11 +60,13 @@ final readonly class SocialActionRepository implements ObjectRepository * * @return array */ + #[\Override] public function findBy(array $criteria, ?array $orderBy = null, $limit = null, $offset = null): array { return $this->repository->findBy($criteria, $orderBy, $limit, $offset); } + #[\Override] public function findOneBy(array $criteria, ?array $orderBy = null): ?SocialAction { return $this->repository->findOneBy($criteria, $orderBy); @@ -71,6 +75,7 @@ final readonly class SocialActionRepository implements ObjectRepository /** * @return class-string */ + #[\Override] public function getClassName(): string { return SocialAction::class; diff --git a/src/Bundle/ChillPersonBundle/Repository/SocialWork/SocialIssueRepository.php b/src/Bundle/ChillPersonBundle/Repository/SocialWork/SocialIssueRepository.php index c9bb3a189..1d90316ad 100644 --- a/src/Bundle/ChillPersonBundle/Repository/SocialWork/SocialIssueRepository.php +++ b/src/Bundle/ChillPersonBundle/Repository/SocialWork/SocialIssueRepository.php @@ -26,6 +26,7 @@ final readonly class SocialIssueRepository implements ObjectRepository $this->repository = $entityManager->getRepository(SocialIssue::class); } + #[\Override] public function find($id): ?SocialIssue { return $this->repository->find($id); @@ -34,6 +35,7 @@ final readonly class SocialIssueRepository implements ObjectRepository /** * @return array */ + #[\Override] public function findAll(): array { return $this->repository->findAll(); @@ -53,11 +55,13 @@ final readonly class SocialIssueRepository implements ObjectRepository * * @return array */ + #[\Override] public function findBy(array $criteria, ?array $orderBy = null, $limit = null, $offset = null): array { return $this->repository->findBy($criteria, $orderBy, $limit, $offset); } + #[\Override] public function findOneBy(array $criteria, ?array $orderBy = null): ?SocialIssue { return $this->repository->findOneBy($criteria, $orderBy); @@ -66,6 +70,7 @@ final readonly class SocialIssueRepository implements ObjectRepository /** * @return class-string */ + #[\Override] public function getClassName(): string { return SocialIssue::class; diff --git a/src/Bundle/ChillPersonBundle/Search/PersonSearch.php b/src/Bundle/ChillPersonBundle/Search/PersonSearch.php index 9ca72ecac..c88f91725 100644 --- a/src/Bundle/ChillPersonBundle/Search/PersonSearch.php +++ b/src/Bundle/ChillPersonBundle/Search/PersonSearch.php @@ -29,15 +29,16 @@ use Symfony\Component\Form\FormBuilderInterface; class PersonSearch extends AbstractSearch implements HasAdvancedSearchFormInterface { - final public const NAME = 'person_regular'; + final public const string NAME = 'person_regular'; - private const POSSIBLE_KEYS = [ + private const array POSSIBLE_KEYS = [ '_default', 'firstname', 'lastname', 'birthdate', 'birthdate-before', 'birthdate-after', 'gender', 'nationality', 'phonenumber', 'city', ]; public function __construct(private readonly \Twig\Environment $templating, private readonly ExtractDateFromPattern $extractDateFromPattern, private readonly ExtractPhonenumberFromPattern $extractPhonenumberFromPattern, private readonly PaginatorFactory $paginatorFactory, private readonly PersonACLAwareRepositoryInterface $personACLAwareRepository) {} + #[\Override] public function buildForm(FormBuilderInterface $builder) { $builder @@ -81,6 +82,7 @@ class PersonSearch extends AbstractSearch implements HasAdvancedSearchFormInterf ]); } + #[\Override] public function convertFormDataToQuery(array $data) { $string = '@person '; @@ -106,6 +108,7 @@ class PersonSearch extends AbstractSearch implements HasAdvancedSearchFormInterf return $string; } + #[\Override] public function convertTermsToFormData(array $terms) { $data = []; @@ -140,6 +143,7 @@ class PersonSearch extends AbstractSearch implements HasAdvancedSearchFormInterf return $data; } + #[\Override] public function getAdvancedSearchTitle(): string { return 'Search within persons'; @@ -155,6 +159,7 @@ class PersonSearch extends AbstractSearch implements HasAdvancedSearchFormInterf * * @see \Chill\MainBundle\Search\SearchInterface::getOrder() */ + #[\Override] public function getOrder() { return 100; @@ -165,11 +170,13 @@ class PersonSearch extends AbstractSearch implements HasAdvancedSearchFormInterf * * @see \Chill\MainBundle\Search\SearchInterface::isActiveByDefault() */ + #[\Override] public function isActiveByDefault() { return true; } + #[\Override] public function renderResult(array $terms, $start = 0, $limit = 50, array $options = [], $format = 'html') { $terms = $this->findAdditionnalInDefault($terms); @@ -204,6 +211,7 @@ class PersonSearch extends AbstractSearch implements HasAdvancedSearchFormInterf ]; } + #[\Override] public function supports($domain, $format) { return 'person' === $domain; diff --git a/src/Bundle/ChillPersonBundle/Search/SearchHouseholdApiProvider.php b/src/Bundle/ChillPersonBundle/Search/SearchHouseholdApiProvider.php index 6fdd66a84..6052663d3 100644 --- a/src/Bundle/ChillPersonBundle/Search/SearchHouseholdApiProvider.php +++ b/src/Bundle/ChillPersonBundle/Search/SearchHouseholdApiProvider.php @@ -24,11 +24,13 @@ class SearchHouseholdApiProvider implements SearchApiInterface { public function __construct(private readonly HouseholdRepository $householdRepository, private readonly PersonACLAwareRepositoryInterface $personACLAwareRepository, private readonly Security $security, private readonly AuthorizationHelperInterface $authorizationHelper, private readonly ExtractDateFromPattern $extractDateFromPattern, private readonly ExtractPhonenumberFromPattern $extractPhonenumberFromPattern) {} + #[\Override] public function getResult(string $key, array $metadata, float $pertinence) { return $this->householdRepository->find($metadata['id']); } + #[\Override] public function prepare(array $metadatas): void { $ids = \array_map(static fn ($m) => $m['id'], $metadatas); @@ -36,6 +38,7 @@ class SearchHouseholdApiProvider implements SearchApiInterface $this->householdRepository->findBy(['id' => $ids]); } + #[\Override] public function provideQuery(string $pattern, array $parameters): SearchApiQuery { $datesResult = $this->extractDateFromPattern->extractDates($pattern); @@ -71,11 +74,13 @@ class SearchHouseholdApiProvider implements SearchApiInterface return $query; } + #[\Override] public function supportsResult(string $key, array $metadatas): bool { return 'household' === $key; } + #[\Override] public function supportsTypes(string $pattern, array $types, array $parameters): bool { return \in_array('household', $types, true); diff --git a/src/Bundle/ChillPersonBundle/Search/SearchPersonApiProvider.php b/src/Bundle/ChillPersonBundle/Search/SearchPersonApiProvider.php index 8444a41ec..c0f253327 100644 --- a/src/Bundle/ChillPersonBundle/Search/SearchPersonApiProvider.php +++ b/src/Bundle/ChillPersonBundle/Search/SearchPersonApiProvider.php @@ -24,11 +24,13 @@ class SearchPersonApiProvider implements SearchApiInterface { public function __construct(private readonly PersonRepository $personRepository, private readonly PersonACLAwareRepositoryInterface $personACLAwareRepository, private readonly Security $security, private readonly AuthorizationHelperInterface $authorizationHelper, private readonly ExtractDateFromPattern $extractDateFromPattern, private readonly ExtractPhonenumberFromPattern $extractPhonenumberFromPattern) {} + #[\Override] public function getResult(string $key, array $metadata, float $pertinence) { return $this->personRepository->find($metadata['id']); } + #[\Override] public function prepare(array $metadatas): void { $ids = \array_map(static fn ($m) => $m['id'], $metadatas); @@ -36,6 +38,7 @@ class SearchPersonApiProvider implements SearchApiInterface $this->personRepository->findByIds($ids); } + #[\Override] public function provideQuery(string $pattern, array $parameters): SearchApiQuery { $datesResult = $this->extractDateFromPattern->extractDates($pattern); @@ -57,11 +60,13 @@ class SearchPersonApiProvider implements SearchApiInterface ->setSelectJsonbMetadata("jsonb_build_object('id', person.id)"); } + #[\Override] public function supportsResult(string $key, array $metadatas): bool { return 'person' === $key; } + #[\Override] public function supportsTypes(string $pattern, array $types, array $parameters): bool { return \in_array('person', $types, true); diff --git a/src/Bundle/ChillPersonBundle/Search/SimilarPersonMatcher.php b/src/Bundle/ChillPersonBundle/Search/SimilarPersonMatcher.php index 74deb91e1..c36486756 100644 --- a/src/Bundle/ChillPersonBundle/Search/SimilarPersonMatcher.php +++ b/src/Bundle/ChillPersonBundle/Search/SimilarPersonMatcher.php @@ -21,9 +21,9 @@ use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInt class SimilarPersonMatcher { - final public const SIMILAR_SEARCH_ORDER_BY_ALPHABETICAL = 'alphabetical'; + final public const string SIMILAR_SEARCH_ORDER_BY_ALPHABETICAL = 'alphabetical'; - final public const SIMILAR_SEARCH_ORDER_BY_SIMILARITY = 'similarity'; + final public const string 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 3bba4f5c5..791190fd0 100644 --- a/src/Bundle/ChillPersonBundle/Security/Authorization/AccompanyingPeriodCommentVoter.php +++ b/src/Bundle/ChillPersonBundle/Security/Authorization/AccompanyingPeriodCommentVoter.php @@ -18,17 +18,19 @@ use Symfony\Component\Security\Core\Security; class AccompanyingPeriodCommentVoter extends Voter { - final public const DELETE = 'CHILL_PERSON_ACCOMPANYING_PERIOD_COMMENT_DELETE'; + final public const string DELETE = 'CHILL_PERSON_ACCOMPANYING_PERIOD_COMMENT_DELETE'; - final public const EDIT = 'CHILL_PERSON_ACCOMPANYING_PERIOD_COMMENT_EDIT'; + final public const string EDIT = 'CHILL_PERSON_ACCOMPANYING_PERIOD_COMMENT_EDIT'; public function __construct(private readonly Security $security) {} + #[\Override] protected function supports($attribute, $subject) { return $subject instanceof Comment; } + #[\Override] protected function voteOnAttribute($attribute, $subject, TokenInterface $token) { return match ($attribute) { diff --git a/src/Bundle/ChillPersonBundle/Security/Authorization/AccompanyingPeriodResourceVoter.php b/src/Bundle/ChillPersonBundle/Security/Authorization/AccompanyingPeriodResourceVoter.php index 5750a7b58..3f749eae0 100644 --- a/src/Bundle/ChillPersonBundle/Security/Authorization/AccompanyingPeriodResourceVoter.php +++ b/src/Bundle/ChillPersonBundle/Security/Authorization/AccompanyingPeriodResourceVoter.php @@ -18,15 +18,17 @@ use Symfony\Component\Security\Core\Authorization\Voter\Voter; class AccompanyingPeriodResourceVoter extends Voter { - final public const EDIT = 'CHILL_PERSON_ACCOMPANYING_PERIOD_RESOURCE_EDIT'; + final public const string EDIT = 'CHILL_PERSON_ACCOMPANYING_PERIOD_RESOURCE_EDIT'; public function __construct(private readonly AccessDecisionManagerInterface $accessDecisionManager) {} + #[\Override] protected function supports($attribute, $subject) { return $subject instanceof Resource && self::EDIT === $attribute; } + #[\Override] protected function voteOnAttribute($attribute, $subject, TokenInterface $token) { return match ($attribute) { diff --git a/src/Bundle/ChillPersonBundle/Security/Authorization/AccompanyingPeriodVoter.php b/src/Bundle/ChillPersonBundle/Security/Authorization/AccompanyingPeriodVoter.php index 9aadd3d95..ce7d63150 100644 --- a/src/Bundle/ChillPersonBundle/Security/Authorization/AccompanyingPeriodVoter.php +++ b/src/Bundle/ChillPersonBundle/Security/Authorization/AccompanyingPeriodVoter.php @@ -28,7 +28,7 @@ class AccompanyingPeriodVoter extends AbstractChillVoter implements ProvideRoleH /** * all the roles that are linked to an accompanying period. */ - final public const ALL = [ + final public const array ALL = [ self::SEE, self::SEE_DETAILS, self::CREATE, @@ -40,26 +40,26 @@ class AccompanyingPeriodVoter extends AbstractChillVoter implements ProvideRoleH self::RE_OPEN_COURSE, ]; - final public const CREATE = 'CHILL_PERSON_ACCOMPANYING_PERIOD_CREATE'; + final public const string 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. */ - final public const DELETE = 'CHILL_PERSON_ACCOMPANYING_PERIOD_DELETE'; + final public const string DELETE = 'CHILL_PERSON_ACCOMPANYING_PERIOD_DELETE'; /** * role to EDIT the course. * * If the course is closed, it will be always false. */ - final public const EDIT = 'CHILL_PERSON_ACCOMPANYING_PERIOD_UPDATE'; + final public const string EDIT = 'CHILL_PERSON_ACCOMPANYING_PERIOD_UPDATE'; /** * Give all the right above. */ - final public const FULL = 'CHILL_PERSON_ACCOMPANYING_PERIOD_FULL'; + final public const string FULL = 'CHILL_PERSON_ACCOMPANYING_PERIOD_FULL'; /** * Reopen a closed course. @@ -67,43 +67,43 @@ class AccompanyingPeriodVoter extends AbstractChillVoter implements ProvideRoleH * This forward to the EDIT role, without taking into account that the course * is closed */ - final public const RE_OPEN_COURSE = 'CHILL_PERSON_ACCOMPANYING_PERIOD_REOPEN'; + final public const string RE_OPEN_COURSE = 'CHILL_PERSON_ACCOMPANYING_PERIOD_REOPEN'; /** * Allow user to bulk reassign the courses. */ - final public const REASSIGN_BULK = 'CHILL_PERSON_ACCOMPANYING_COURSE_REASSIGN_BULK'; + final public const string REASSIGN_BULK = 'CHILL_PERSON_ACCOMPANYING_COURSE_REASSIGN_BULK'; - final public const SEE = 'CHILL_PERSON_ACCOMPANYING_PERIOD_SEE'; + final public const string SEE = 'CHILL_PERSON_ACCOMPANYING_PERIOD_SEE'; /** * details are for seeing:. * * * SocialIssues */ - final public const SEE_DETAILS = 'CHILL_PERSON_ACCOMPANYING_PERIOD_SEE_DETAILS'; + final public const string SEE_DETAILS = 'CHILL_PERSON_ACCOMPANYING_PERIOD_SEE_DETAILS'; /** * Give the ability to see statistics. */ - final public const STATS = 'CHILL_PERSON_ACCOMPANYING_PERIOD_STATS'; + final public const string STATS = 'CHILL_PERSON_ACCOMPANYING_PERIOD_STATS'; /** * Right to toggle confidentiality. */ - final public const TOGGLE_CONFIDENTIAL = 'CHILL_PERSON_ACCOMPANYING_PERIOD_TOGGLE_CONFIDENTIAL'; + final public const string TOGGLE_CONFIDENTIAL = 'CHILL_PERSON_ACCOMPANYING_PERIOD_TOGGLE_CONFIDENTIAL'; - final public const TOGGLE_CONFIDENTIAL_ALL = 'CHILL_PERSON_ACCOMPANYING_PERIOD_TOGGLE_CONFIDENTIAL_ALL'; + final public const string TOGGLE_CONFIDENTIAL_ALL = 'CHILL_PERSON_ACCOMPANYING_PERIOD_TOGGLE_CONFIDENTIAL_ALL'; /** * Right to toggle urgency of parcours. */ - final public const TOGGLE_INTENSITY = 'CHILL_PERSON_ACCOMPANYING_PERIOD_TOGGLE_INTENSITY'; + final public const string TOGGLE_INTENSITY = 'CHILL_PERSON_ACCOMPANYING_PERIOD_TOGGLE_INTENSITY'; /** * Right to see confidential period even if not referrer. */ - final public const SEE_CONFIDENTIAL_ALL = 'CHILL_PERSON_ACCOMPANYING_PERIOD_SEE_CONFIDENTIAL'; + final public const string SEE_CONFIDENTIAL_ALL = 'CHILL_PERSON_ACCOMPANYING_PERIOD_SEE_CONFIDENTIAL'; private readonly VoterHelperInterface $voterHelper; @@ -121,6 +121,7 @@ class AccompanyingPeriodVoter extends AbstractChillVoter implements ProvideRoleH ->build(); } + #[\Override] public function getRoles(): array { return [ @@ -137,21 +138,25 @@ class AccompanyingPeriodVoter extends AbstractChillVoter implements ProvideRoleH ]; } + #[\Override] public function getRolesWithHierarchy(): array { return ['Accompanying period' => $this->getRoles()]; } + #[\Override] public function getRolesWithoutScope(): array { return []; } + #[\Override] protected function supports($attribute, $subject) { return $this->voterHelper->supports($attribute, $subject); } + #[\Override] protected function voteOnAttribute($attribute, $subject, TokenInterface $token): bool { if (!$token->getUser() instanceof User) { diff --git a/src/Bundle/ChillPersonBundle/Security/Authorization/AccompanyingPeriodWorkEvaluationDocumentVoter.php b/src/Bundle/ChillPersonBundle/Security/Authorization/AccompanyingPeriodWorkEvaluationDocumentVoter.php index 77c131cd9..b99083dfc 100644 --- a/src/Bundle/ChillPersonBundle/Security/Authorization/AccompanyingPeriodWorkEvaluationDocumentVoter.php +++ b/src/Bundle/ChillPersonBundle/Security/Authorization/AccompanyingPeriodWorkEvaluationDocumentVoter.php @@ -23,10 +23,11 @@ use Symfony\Component\Security\Core\Authorization\Voter\Voter; */ class AccompanyingPeriodWorkEvaluationDocumentVoter extends Voter { - final public const SEE = 'CHILL_MAIN_ACCOMPANYING_PERIOD_WORK_EVALUATION_DOCUMENT_SHOW'; + final public const string SEE = 'CHILL_MAIN_ACCOMPANYING_PERIOD_WORK_EVALUATION_DOCUMENT_SHOW'; public function __construct(private readonly AccessDecisionManagerInterface $accessDecisionManager) {} + #[\Override] protected function supports($attribute, $subject) { return $subject instanceof AccompanyingPeriodWorkEvaluationDocument @@ -39,6 +40,7 @@ class AccompanyingPeriodWorkEvaluationDocumentVoter extends Voter * * @return bool|void */ + #[\Override] protected function voteOnAttribute($attribute, $subject, TokenInterface $token): bool { return match ($attribute) { diff --git a/src/Bundle/ChillPersonBundle/Security/Authorization/AccompanyingPeriodWorkEvaluationVoter.php b/src/Bundle/ChillPersonBundle/Security/Authorization/AccompanyingPeriodWorkEvaluationVoter.php index ce5faca8d..5978427be 100644 --- a/src/Bundle/ChillPersonBundle/Security/Authorization/AccompanyingPeriodWorkEvaluationVoter.php +++ b/src/Bundle/ChillPersonBundle/Security/Authorization/AccompanyingPeriodWorkEvaluationVoter.php @@ -19,17 +19,18 @@ use Symfony\Component\Security\Core\Security; class AccompanyingPeriodWorkEvaluationVoter extends Voter implements ChillVoterInterface { - final public const ALL = [ + final public const array ALL = [ self::SEE, self::STATS, ]; - final public const SEE = 'CHILL_MAIN_ACCOMPANYING_PERIOD_WORK_EVALUATION_SHOW'; + final public const string SEE = 'CHILL_MAIN_ACCOMPANYING_PERIOD_WORK_EVALUATION_SHOW'; - final public const STATS = 'CHILL_MAIN_ACCOMPANYING_PERIOD_WORK_EVALUATION_STATS'; + final public const string STATS = 'CHILL_MAIN_ACCOMPANYING_PERIOD_WORK_EVALUATION_STATS'; public function __construct(private readonly Security $security) {} + #[\Override] protected function supports($attribute, $subject) { return $subject instanceof AccompanyingPeriodWorkEvaluation @@ -40,6 +41,7 @@ class AccompanyingPeriodWorkEvaluationVoter extends Voter implements ChillVoterI * @param string $attribute * @param AccompanyingPeriodWorkEvaluation $subject */ + #[\Override] protected function voteOnAttribute($attribute, $subject, TokenInterface $token): bool { return match ($attribute) { diff --git a/src/Bundle/ChillPersonBundle/Security/Authorization/AccompanyingPeriodWorkVoter.php b/src/Bundle/ChillPersonBundle/Security/Authorization/AccompanyingPeriodWorkVoter.php index 64b25498c..565e47ccf 100644 --- a/src/Bundle/ChillPersonBundle/Security/Authorization/AccompanyingPeriodWorkVoter.php +++ b/src/Bundle/ChillPersonBundle/Security/Authorization/AccompanyingPeriodWorkVoter.php @@ -24,20 +24,20 @@ use Symfony\Component\Security\Core\Security; class AccompanyingPeriodWorkVoter extends Voter implements ProvideRoleHierarchyInterface, ChillVoterInterface { - final public const ALL = [ + final public const array ALL = [ self::SEE, self::CREATE, self::UPDATE, self::DELETE, ]; - final public const CREATE = 'CHILL_MAIN_ACCOMPANYING_PERIOD_WORK_CREATE'; + final public const string CREATE = 'CHILL_MAIN_ACCOMPANYING_PERIOD_WORK_CREATE'; - final public const DELETE = 'CHILL_MAIN_ACCOMPANYING_PERIOD_WORK_DELETE'; + final public const string DELETE = 'CHILL_MAIN_ACCOMPANYING_PERIOD_WORK_DELETE'; - final public const SEE = 'CHILL_MAIN_ACCOMPANYING_PERIOD_WORK_SEE'; + final public const string SEE = 'CHILL_MAIN_ACCOMPANYING_PERIOD_WORK_SEE'; - final public const UPDATE = 'CHILL_MAIN_ACCOMPANYING_PERIOD_WORK_UPDATE'; + final public const string UPDATE = 'CHILL_MAIN_ACCOMPANYING_PERIOD_WORK_UPDATE'; private readonly VoterHelperInterface $voterHelper; @@ -53,6 +53,7 @@ class AccompanyingPeriodWorkVoter extends Voter implements ProvideRoleHierarchyI ->build(); } + #[\Override] public function getRoles(): array { return [ @@ -63,16 +64,19 @@ class AccompanyingPeriodWorkVoter extends Voter implements ProvideRoleHierarchyI ]; } + #[\Override] public function getRolesWithHierarchy(): array { return ['Social actions' => $this->getRoles()]; } + #[\Override] public function getRolesWithoutScope(): array { return []; } + #[\Override] protected function supports($attribute, $subject): bool { return @@ -89,6 +93,7 @@ class AccompanyingPeriodWorkVoter extends Voter implements ProvideRoleHierarchyI * @param string $attribute * @param AccompanyingPeriodWork $subject */ + #[\Override] protected function voteOnAttribute($attribute, $subject, TokenInterface $token): bool { if ($subject instanceof AccompanyingPeriodWork) { diff --git a/src/Bundle/ChillPersonBundle/Security/Authorization/HouseholdVoter.php b/src/Bundle/ChillPersonBundle/Security/Authorization/HouseholdVoter.php index 415154457..b3baddd7a 100644 --- a/src/Bundle/ChillPersonBundle/Security/Authorization/HouseholdVoter.php +++ b/src/Bundle/ChillPersonBundle/Security/Authorization/HouseholdVoter.php @@ -24,18 +24,18 @@ use Symfony\Component\Security\Core\Security; class HouseholdVoter extends Voter implements ProvideRoleHierarchyInterface, ChillVoterInterface { - final public const EDIT = 'CHILL_PERSON_HOUSEHOLD_EDIT'; + final public const string EDIT = 'CHILL_PERSON_HOUSEHOLD_EDIT'; - final public const SEE = 'CHILL_PERSON_HOUSEHOLD_SEE'; + final public const string SEE = 'CHILL_PERSON_HOUSEHOLD_SEE'; /** * @deprecated use @see{self::SEE} instead */ - final public const SHOW = self::SEE; + final public const string SHOW = self::SEE; - final public const STATS = 'CHILL_PERSON_HOUSEHOLD_STATS'; + final public const string STATS = 'CHILL_PERSON_HOUSEHOLD_STATS'; - private const ALL = [ + private const array ALL = [ self::SEE, self::EDIT, self::STATS, @@ -51,21 +51,25 @@ class HouseholdVoter extends Voter implements ProvideRoleHierarchyInterface, Chi ->build(); } + #[\Override] public function getRoles(): array { return [self::STATS]; } + #[\Override] public function getRolesWithHierarchy(): array { return ['Household' => $this->getRoles()]; } + #[\Override] public function getRolesWithoutScope(): array { return $this->getRoles(); } + #[\Override] protected function supports($attribute, $subject) { return ($subject instanceof Household @@ -73,6 +77,7 @@ class HouseholdVoter extends Voter implements ProvideRoleHierarchyInterface, Chi || $this->helper->supports($attribute, $subject); } + #[\Override] protected function voteOnAttribute($attribute, $subject, TokenInterface $token): bool { return match ($attribute) { diff --git a/src/Bundle/ChillPersonBundle/Security/Authorization/PersonVoter.php b/src/Bundle/ChillPersonBundle/Security/Authorization/PersonVoter.php index 2de8a1554..24e1c5760 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 { - final public const CREATE = 'CHILL_PERSON_CREATE'; + final public const string CREATE = 'CHILL_PERSON_CREATE'; - final public const DUPLICATE = 'CHILL_PERSON_DUPLICATE'; + final public const string DUPLICATE = 'CHILL_PERSON_DUPLICATE'; - final public const LISTS = 'CHILL_PERSON_LISTS'; + final public const string LISTS = 'CHILL_PERSON_LISTS'; - final public const SEE = 'CHILL_PERSON_SEE'; + final public const string SEE = 'CHILL_PERSON_SEE'; - final public const STATS = 'CHILL_PERSON_STATS'; + final public const string STATS = 'CHILL_PERSON_STATS'; - final public const UPDATE = 'CHILL_PERSON_UPDATE'; + final public const string UPDATE = 'CHILL_PERSON_UPDATE'; protected VoterHelperInterface $voter; @@ -46,26 +46,31 @@ class PersonVoter extends AbstractChillVoter implements ProvideRoleHierarchyInte ->build(); } + #[\Override] public function getRoles(): array { return $this->getAttributes(); } + #[\Override] public function getRolesWithHierarchy(): array { return ['Person' => $this->getRoles()]; } + #[\Override] public function getRolesWithoutScope(): array { return $this->getAttributes(); } + #[\Override] protected function supports($attribute, $subject) { return $this->voter->supports($attribute, $subject); } + #[\Override] protected function voteOnAttribute($attribute, $subject, TokenInterface $token) { return $this->voter->voteOnAttribute($attribute, $subject, $token); diff --git a/src/Bundle/ChillPersonBundle/Security/AuthorizedCenterOnPersonCreation.php b/src/Bundle/ChillPersonBundle/Security/AuthorizedCenterOnPersonCreation.php index ae5f5281b..e336fb140 100644 --- a/src/Bundle/ChillPersonBundle/Security/AuthorizedCenterOnPersonCreation.php +++ b/src/Bundle/ChillPersonBundle/Security/AuthorizedCenterOnPersonCreation.php @@ -24,6 +24,7 @@ class AuthorizedCenterOnPersonCreation implements AuthorizedCenterOnPersonCreati $this->showCenters = $parameterBag->get('chill_main')['acl']['form_show_centers']; } + #[\Override] public function getCenters(): array { if (!$this->showCenters) { diff --git a/src/Bundle/ChillPersonBundle/Serializer/Normalizer/AccompanyingPeriodDocGenNormalizer.php b/src/Bundle/ChillPersonBundle/Serializer/Normalizer/AccompanyingPeriodDocGenNormalizer.php index cc1053f1f..5d121a3e0 100644 --- a/src/Bundle/ChillPersonBundle/Serializer/Normalizer/AccompanyingPeriodDocGenNormalizer.php +++ b/src/Bundle/ChillPersonBundle/Serializer/Normalizer/AccompanyingPeriodDocGenNormalizer.php @@ -37,9 +37,9 @@ class AccompanyingPeriodDocGenNormalizer implements ContextAwareNormalizerInterf { use NormalizerAwareTrait; - private const IGNORE_FIRST_PASS_KEY = 'acc_period_ignore_first_pass'; + private const string IGNORE_FIRST_PASS_KEY = 'acc_period_ignore_first_pass'; - private const PERIOD_NULL = [ + private const array PERIOD_NULL = [ 'id', 'closingDate' => \DateTime::class, 'closingMotive' => AccompanyingPeriod\ClosingMotive::class, @@ -78,6 +78,7 @@ class AccompanyingPeriodDocGenNormalizer implements ContextAwareNormalizerInterf * @param AccompanyingPeriod|null $period * @param string|null $format */ + #[\Override] public function normalize($period, $format = null, array $context = []) { if ($period instanceof AccompanyingPeriod) { @@ -167,6 +168,7 @@ class AccompanyingPeriodDocGenNormalizer implements ContextAwareNormalizerInterf throw new InvalidArgumentException('This neither an accompanying period or null.'); } + #[\Override] public function supportsNormalization($data, $format = null, array $context = []): bool { if ('docgen' !== $format) { diff --git a/src/Bundle/ChillPersonBundle/Serializer/Normalizer/AccompanyingPeriodOriginNormalizer.php b/src/Bundle/ChillPersonBundle/Serializer/Normalizer/AccompanyingPeriodOriginNormalizer.php index 2b1b767c0..2c9d3b7d1 100644 --- a/src/Bundle/ChillPersonBundle/Serializer/Normalizer/AccompanyingPeriodOriginNormalizer.php +++ b/src/Bundle/ChillPersonBundle/Serializer/Normalizer/AccompanyingPeriodOriginNormalizer.php @@ -23,6 +23,7 @@ final class AccompanyingPeriodOriginNormalizer implements NormalizerInterface * @param Origin $origin * @param string|null $format */ + #[\Override] public function normalize($origin, $format = null, array $context = []) { return [ @@ -33,6 +34,7 @@ final class AccompanyingPeriodOriginNormalizer implements NormalizerInterface ]; } + #[\Override] public function supportsNormalization($data, $format = null): bool { return $data instanceof Origin && 'json' === $format; diff --git a/src/Bundle/ChillPersonBundle/Serializer/Normalizer/AccompanyingPeriodParticipationNormalizer.php b/src/Bundle/ChillPersonBundle/Serializer/Normalizer/AccompanyingPeriodParticipationNormalizer.php index ce0a4707d..5e79d7487 100644 --- a/src/Bundle/ChillPersonBundle/Serializer/Normalizer/AccompanyingPeriodParticipationNormalizer.php +++ b/src/Bundle/ChillPersonBundle/Serializer/Normalizer/AccompanyingPeriodParticipationNormalizer.php @@ -23,6 +23,7 @@ class AccompanyingPeriodParticipationNormalizer implements NormalizerAwareInterf * @param AccompanyingPeriodParticipation $participation * @param string|null $format */ + #[\Override] public function normalize($participation, $format = null, array $context = []) { return [ @@ -33,11 +34,13 @@ class AccompanyingPeriodParticipationNormalizer implements NormalizerAwareInterf ]; } + #[\Override] public function setNormalizer(NormalizerInterface $normalizer) { $this->normalizer = $normalizer; } + #[\Override] public function supportsNormalization($data, $format = null): bool { // @TODO Fix this. diff --git a/src/Bundle/ChillPersonBundle/Serializer/Normalizer/AccompanyingPeriodResourceNormalizer.php b/src/Bundle/ChillPersonBundle/Serializer/Normalizer/AccompanyingPeriodResourceNormalizer.php index 2e26e96c4..9e50e0dde 100644 --- a/src/Bundle/ChillPersonBundle/Serializer/Normalizer/AccompanyingPeriodResourceNormalizer.php +++ b/src/Bundle/ChillPersonBundle/Serializer/Normalizer/AccompanyingPeriodResourceNormalizer.php @@ -30,6 +30,7 @@ class AccompanyingPeriodResourceNormalizer implements DenormalizerAwareInterface public function __construct(private readonly ResourceRepository $repository) {} + #[\Override] public function denormalize($data, $type, $format = null, array $context = []) { $resource = $this->extractObjectToPopulate($type, $context); @@ -91,6 +92,7 @@ class AccompanyingPeriodResourceNormalizer implements DenormalizerAwareInterface ]; } + #[\Override] public function supportsDenormalization($data, $type, $format = null) { return Resource::class === $type; diff --git a/src/Bundle/ChillPersonBundle/Serializer/Normalizer/AccompanyingPeriodWorkDenormalizer.php b/src/Bundle/ChillPersonBundle/Serializer/Normalizer/AccompanyingPeriodWorkDenormalizer.php index e5cd50f09..ac7f183a9 100644 --- a/src/Bundle/ChillPersonBundle/Serializer/Normalizer/AccompanyingPeriodWorkDenormalizer.php +++ b/src/Bundle/ChillPersonBundle/Serializer/Normalizer/AccompanyingPeriodWorkDenormalizer.php @@ -31,12 +31,13 @@ class AccompanyingPeriodWorkDenormalizer implements ContextAwareDenormalizerInte use ObjectToPopulateTrait; - final public const GROUP_CREATE = 'accompanying_period_work:create'; + final public const string GROUP_CREATE = 'accompanying_period_work:create'; - final public const GROUP_EDIT = 'accompanying_period_work:edit'; + final public const string GROUP_EDIT = 'accompanying_period_work:edit'; public function __construct(private readonly AccompanyingPeriodWorkRepository $workRepository, private readonly EntityManagerInterface $em) {} + #[\Override] public function denormalize($data, $type, $format = null, array $context = []) { $work = $this->denormalizer->denormalize($data, $type, $format, \array_merge( @@ -51,6 +52,7 @@ class AccompanyingPeriodWorkDenormalizer implements ContextAwareDenormalizerInte return $work; } + #[\Override] public function supportsDenormalization($data, $type, $format = null, array $context = []): bool { return AccompanyingPeriodWork::class === $type diff --git a/src/Bundle/ChillPersonBundle/Serializer/Normalizer/AccompanyingPeriodWorkEvaluationDenormalizer.php b/src/Bundle/ChillPersonBundle/Serializer/Normalizer/AccompanyingPeriodWorkEvaluationDenormalizer.php index a5dcfb840..8dcddad33 100644 --- a/src/Bundle/ChillPersonBundle/Serializer/Normalizer/AccompanyingPeriodWorkEvaluationDenormalizer.php +++ b/src/Bundle/ChillPersonBundle/Serializer/Normalizer/AccompanyingPeriodWorkEvaluationDenormalizer.php @@ -29,6 +29,7 @@ class AccompanyingPeriodWorkEvaluationDenormalizer implements ContextAwareDenorm use ObjectToPopulateTrait; + #[\Override] public function denormalize($data, $type, $format = null, array $context = []) { $evaluation = $this->denormalizer->denormalize($data, $type, $format, \array_merge( @@ -41,6 +42,7 @@ class AccompanyingPeriodWorkEvaluationDenormalizer implements ContextAwareDenorm return $evaluation; } + #[\Override] public function supportsDenormalization($data, $type, $format = null, array $context = []): bool { return AccompanyingPeriodWorkEvaluation::class === $type diff --git a/src/Bundle/ChillPersonBundle/Serializer/Normalizer/AccompanyingPeriodWorkEvaluationDocumentNormalizer.php b/src/Bundle/ChillPersonBundle/Serializer/Normalizer/AccompanyingPeriodWorkEvaluationDocumentNormalizer.php index 1e42dac06..d853ecff0 100644 --- a/src/Bundle/ChillPersonBundle/Serializer/Normalizer/AccompanyingPeriodWorkEvaluationDocumentNormalizer.php +++ b/src/Bundle/ChillPersonBundle/Serializer/Normalizer/AccompanyingPeriodWorkEvaluationDocumentNormalizer.php @@ -23,10 +23,11 @@ class AccompanyingPeriodWorkEvaluationDocumentNormalizer implements ContextAware { use NormalizerAwareTrait; - private const SKIP = 'accompanying_period_work_evaluation_document_skip'; + private const string SKIP = 'accompanying_period_work_evaluation_document_skip'; public function __construct(private readonly EntityWorkflowRepository $entityWorkflowRepository, private readonly MetadataExtractor $metadataExtractor, private readonly Registry $registry) {} + #[\Override] public function normalize($object, ?string $format = null, array $context = []): array { $initial = $this->normalizer->normalize($object, $format, array_merge($context, [ @@ -47,6 +48,7 @@ class AccompanyingPeriodWorkEvaluationDocumentNormalizer implements ContextAware return $initial; } + #[\Override] public function supportsNormalization($data, ?string $format = null, array $context = []) { return $data instanceof AccompanyingPeriodWorkEvaluationDocument diff --git a/src/Bundle/ChillPersonBundle/Serializer/Normalizer/AccompanyingPeriodWorkEvaluationNormalizer.php b/src/Bundle/ChillPersonBundle/Serializer/Normalizer/AccompanyingPeriodWorkEvaluationNormalizer.php index efab6babf..c26ae6a74 100644 --- a/src/Bundle/ChillPersonBundle/Serializer/Normalizer/AccompanyingPeriodWorkEvaluationNormalizer.php +++ b/src/Bundle/ChillPersonBundle/Serializer/Normalizer/AccompanyingPeriodWorkEvaluationNormalizer.php @@ -24,13 +24,14 @@ class AccompanyingPeriodWorkEvaluationNormalizer implements ContextAwareNormaliz { use NormalizerAwareTrait; - private const IGNORE_EVALUATION = 'evaluation:ignore'; + private const string IGNORE_EVALUATION = 'evaluation:ignore'; public function __construct(private readonly Registry $registry, private readonly EntityWorkflowRepository $entityWorkflowRepository, private readonly MetadataExtractor $metadataExtractor) {} /** * @param AccompanyingPeriodWorkEvaluation $object */ + #[\Override] public function normalize($object, ?string $format = null, array $context = []): array { $initial = $this->normalizer->normalize($object, $format, array_merge( @@ -64,6 +65,7 @@ class AccompanyingPeriodWorkEvaluationNormalizer implements ContextAwareNormaliz return $initial; } + #[\Override] public function supportsNormalization($data, ?string $format = null, array $context = []): bool { return 'json' === $format diff --git a/src/Bundle/ChillPersonBundle/Serializer/Normalizer/AccompanyingPeriodWorkNormalizer.php b/src/Bundle/ChillPersonBundle/Serializer/Normalizer/AccompanyingPeriodWorkNormalizer.php index 57848584a..76fbfb1e4 100644 --- a/src/Bundle/ChillPersonBundle/Serializer/Normalizer/AccompanyingPeriodWorkNormalizer.php +++ b/src/Bundle/ChillPersonBundle/Serializer/Normalizer/AccompanyingPeriodWorkNormalizer.php @@ -30,10 +30,11 @@ class AccompanyingPeriodWorkNormalizer implements ContextAwareNormalizerInterfac { use NormalizerAwareTrait; - private const IGNORE_WORK = 'ignore:work'; + private const string IGNORE_WORK = 'ignore:work'; public function __construct(private readonly Registry $registry, private readonly EntityWorkflowRepository $entityWorkflowRepository, private readonly MetadataExtractor $metadataExtractor) {} + #[\Override] public function normalize($object, ?string $format = null, array $context = []): array|\ArrayObject|bool|float|int|string|null { if (!$object instanceof AccompanyingPeriodWork && 'json' === $format) { @@ -128,6 +129,7 @@ class AccompanyingPeriodWorkNormalizer implements ContextAwareNormalizerInterfac return $initial; } + #[\Override] public function supportsNormalization($data, ?string $format = null, array $context = []): bool { return match ($format) { diff --git a/src/Bundle/ChillPersonBundle/Serializer/Normalizer/MembersEditorNormalizer.php b/src/Bundle/ChillPersonBundle/Serializer/Normalizer/MembersEditorNormalizer.php index 0e358483e..c94767af9 100644 --- a/src/Bundle/ChillPersonBundle/Serializer/Normalizer/MembersEditorNormalizer.php +++ b/src/Bundle/ChillPersonBundle/Serializer/Normalizer/MembersEditorNormalizer.php @@ -29,6 +29,7 @@ class MembersEditorNormalizer implements DenormalizerAwareInterface, Denormalize public function __construct(private readonly MembersEditorFactory $factory) {} + #[\Override] public function denormalize($data, $type, $format = null, array $context = []) { // some test about schema first... @@ -44,6 +45,7 @@ class MembersEditorNormalizer implements DenormalizerAwareInterface, Denormalize return $this->denormalizeMove($data, $type, $format, $context); } + #[\Override] public function supportsDenormalization($data, $type, $format = null) { return MembersEditor::class === $type; diff --git a/src/Bundle/ChillPersonBundle/Serializer/Normalizer/PersonDocGenNormalizer.php b/src/Bundle/ChillPersonBundle/Serializer/Normalizer/PersonDocGenNormalizer.php index c8f9cf455..bba85d223 100644 --- a/src/Bundle/ChillPersonBundle/Serializer/Normalizer/PersonDocGenNormalizer.php +++ b/src/Bundle/ChillPersonBundle/Serializer/Normalizer/PersonDocGenNormalizer.php @@ -38,10 +38,11 @@ class PersonDocGenNormalizer implements { use NormalizerAwareTrait; - private const CIRCULAR_KEY = 'person:circular'; + private const string CIRCULAR_KEY = 'person:circular'; public function __construct(private readonly PersonRenderInterface $personRender, private readonly RelationshipRepository $relationshipRepository, private readonly TranslatorInterface $translator, private readonly TranslatableStringHelper $translatableStringHelper, private readonly SummaryBudgetInterface $summaryBudget) {} + #[\Override] public function normalize($person, $format = null, array $context = []) { try { @@ -148,6 +149,7 @@ class PersonDocGenNormalizer implements return $data; } + #[\Override] public function supportsNormalization($data, $format = null, array $context = []) { if ('docgen' !== $format) { diff --git a/src/Bundle/ChillPersonBundle/Serializer/Normalizer/PersonJsonNormalizer.php b/src/Bundle/ChillPersonBundle/Serializer/Normalizer/PersonJsonNormalizer.php index eae33f399..ac843ad16 100644 --- a/src/Bundle/ChillPersonBundle/Serializer/Normalizer/PersonJsonNormalizer.php +++ b/src/Bundle/ChillPersonBundle/Serializer/Normalizer/PersonJsonNormalizer.php @@ -50,6 +50,7 @@ class PersonJsonNormalizer implements DenormalizerAwareInterface, NormalizerAwar private readonly PhoneNumberHelperInterface $phoneNumberHelper ) {} + #[\Override] public function denormalize($data, $type, $format = null, array $context = []) { $person = $this->extractObjectToPopulate($type, $context); @@ -175,6 +176,7 @@ class PersonJsonNormalizer implements DenormalizerAwareInterface, NormalizerAwar * @param Person $person * @param string|null $format */ + #[\Override] public function normalize($person, $format = null, array $context = []) { $groups = $context[AbstractNormalizer::GROUPS] ?? []; @@ -212,11 +214,13 @@ class PersonJsonNormalizer implements DenormalizerAwareInterface, NormalizerAwar null]; } + #[\Override] public function supportsDenormalization($data, $type, $format = null) { return Person::class === $type && 'person' === ($data['type'] ?? null); } + #[\Override] public function supportsNormalization($data, $format = null): bool { return $data instanceof Person && 'json' === $format; diff --git a/src/Bundle/ChillPersonBundle/Serializer/Normalizer/RelationshipDocGenNormalizer.php b/src/Bundle/ChillPersonBundle/Serializer/Normalizer/RelationshipDocGenNormalizer.php index 402f5ff03..d327baa46 100644 --- a/src/Bundle/ChillPersonBundle/Serializer/Normalizer/RelationshipDocGenNormalizer.php +++ b/src/Bundle/ChillPersonBundle/Serializer/Normalizer/RelationshipDocGenNormalizer.php @@ -28,6 +28,7 @@ class RelationshipDocGenNormalizer implements ContextAwareNormalizerInterface, N * @param Relationship $relation * @param string|null $format */ + #[\Override] public function normalize($relation, $format = null, array $context = []) { $counterpart = $context['docgen:relationship:counterpart'] ?? null; @@ -74,6 +75,7 @@ class RelationshipDocGenNormalizer implements ContextAwareNormalizerInterface, N ]; } + #[\Override] public function supportsNormalization($data, $format = null, array $context = []) { if ('docgen' !== $format) { diff --git a/src/Bundle/ChillPersonBundle/Serializer/Normalizer/SocialActionNormalizer.php b/src/Bundle/ChillPersonBundle/Serializer/Normalizer/SocialActionNormalizer.php index 19b36f05b..36c880e22 100644 --- a/src/Bundle/ChillPersonBundle/Serializer/Normalizer/SocialActionNormalizer.php +++ b/src/Bundle/ChillPersonBundle/Serializer/Normalizer/SocialActionNormalizer.php @@ -23,6 +23,7 @@ class SocialActionNormalizer implements NormalizerAwareInterface, NormalizerInte public function __construct(private readonly SocialActionRender $render) {} + #[\Override] public function normalize($socialAction, $format = null, array $context = []) { switch ($format) { @@ -57,6 +58,7 @@ class SocialActionNormalizer implements NormalizerAwareInterface, NormalizerInte } } + #[\Override] public function supportsNormalization($data, $format = null, array $context = []) { if ($data instanceof SocialAction && 'json' === $format) { diff --git a/src/Bundle/ChillPersonBundle/Serializer/Normalizer/SocialIssueNormalizer.php b/src/Bundle/ChillPersonBundle/Serializer/Normalizer/SocialIssueNormalizer.php index 778336d2b..93443f891 100644 --- a/src/Bundle/ChillPersonBundle/Serializer/Normalizer/SocialIssueNormalizer.php +++ b/src/Bundle/ChillPersonBundle/Serializer/Normalizer/SocialIssueNormalizer.php @@ -23,6 +23,7 @@ class SocialIssueNormalizer implements ContextAwareNormalizerInterface, Normaliz public function __construct(private readonly SocialIssueRender $render) {} + #[\Override] public function normalize($socialIssue, $format = null, array $context = []) { /* @var SocialIssue $socialIssue */ @@ -51,6 +52,7 @@ class SocialIssueNormalizer implements ContextAwareNormalizerInterface, Normaliz } } + #[\Override] public function supportsNormalization($data, $format = null, array $context = []) { if ($data instanceof SocialIssue && 'json' === $format) { diff --git a/src/Bundle/ChillPersonBundle/Serializer/Normalizer/WorkflowNormalizer.php b/src/Bundle/ChillPersonBundle/Serializer/Normalizer/WorkflowNormalizer.php index b7257fc87..7926b5fb7 100644 --- a/src/Bundle/ChillPersonBundle/Serializer/Normalizer/WorkflowNormalizer.php +++ b/src/Bundle/ChillPersonBundle/Serializer/Normalizer/WorkflowNormalizer.php @@ -24,7 +24,7 @@ class WorkflowNormalizer implements ContextAwareNormalizerInterface, NormalizerA { use NormalizerAwareTrait; - private const IGNORE_ENTITY_WORKFLOW = 'ignore:entity_workflow'; + private const string IGNORE_ENTITY_WORKFLOW = 'ignore:entity_workflow'; public function __construct(private readonly Registry $registry, private readonly MetadataExtractor $metadataExtractor) {} @@ -35,6 +35,7 @@ class WorkflowNormalizer implements ContextAwareNormalizerInterface, NormalizerA * * @throws ExceptionInterface */ + #[\Override] public function normalize($object, ?string $format = null, array $context = []): array { $data = $this->normalizer->normalize($object, $format, array_merge( @@ -52,6 +53,7 @@ class WorkflowNormalizer implements ContextAwareNormalizerInterface, NormalizerA return $data; } + #[\Override] public function supportsNormalization($data, ?string $format = null, array $context = []): bool { return 'json' === $format diff --git a/src/Bundle/ChillPersonBundle/Service/AccompanyingPeriod/OldDraftAccompanyingPeriodRemover.php b/src/Bundle/ChillPersonBundle/Service/AccompanyingPeriod/OldDraftAccompanyingPeriodRemover.php index 44d2e38d5..c8179073b 100644 --- a/src/Bundle/ChillPersonBundle/Service/AccompanyingPeriod/OldDraftAccompanyingPeriodRemover.php +++ b/src/Bundle/ChillPersonBundle/Service/AccompanyingPeriod/OldDraftAccompanyingPeriodRemover.php @@ -22,6 +22,7 @@ class OldDraftAccompanyingPeriodRemover implements OldDraftAccompanyingPeriodRem { public function __construct(private readonly EntityManagerInterface $em, private readonly LoggerInterface $logger) {} + #[\Override] public function remove(\DateInterval $interval): void { $this->logger->debug('['.self::class.'] start to remove old periods', [ diff --git a/src/Bundle/ChillPersonBundle/Service/DocGenerator/AccompanyingPeriodContext.php b/src/Bundle/ChillPersonBundle/Service/DocGenerator/AccompanyingPeriodContext.php index 61edc0205..bd53f3fa6 100644 --- a/src/Bundle/ChillPersonBundle/Service/DocGenerator/AccompanyingPeriodContext.php +++ b/src/Bundle/ChillPersonBundle/Service/DocGenerator/AccompanyingPeriodContext.php @@ -62,6 +62,7 @@ class AccompanyingPeriodContext implements private readonly ThirdPartyRepository $thirdPartyRepository ) {} + #[\Override] public function adminFormReverseTransform(array $data): array { if (\array_key_exists('category', $data)) { @@ -74,6 +75,7 @@ class AccompanyingPeriodContext implements return $data; } + #[\Override] public function adminFormTransform(array $data): array { $r = [ @@ -94,6 +96,7 @@ class AccompanyingPeriodContext implements return $r; } + #[\Override] public function buildAdminForm(FormBuilderInterface $builder): void { $builder @@ -142,6 +145,7 @@ class AccompanyingPeriodContext implements /** * @param AccompanyingPeriod $entity */ + #[\Override] public function buildPublicForm(FormBuilderInterface $builder, DocGeneratorTemplate $template, mixed $entity): void { $options = $template->getOptions(); @@ -203,6 +207,7 @@ class AccompanyingPeriodContext implements } } + #[\Override] public function getData(DocGeneratorTemplate $template, $entity, array $contextGenerationData = []): array { if (!$entity instanceof AccompanyingPeriod) { @@ -236,16 +241,19 @@ class AccompanyingPeriodContext implements return $data; } + #[\Override] public function getDescription(): string { return 'docgen.A basic context for accompanying period'; } + #[\Override] public function getEntityClass(): string { return AccompanyingPeriod::class; } + #[\Override] public function getFormData(DocGeneratorTemplate $template, $entity): array { return [ @@ -253,21 +261,25 @@ class AccompanyingPeriodContext implements ]; } + #[\Override] public static function getKey(): string { return self::class; } + #[\Override] public function getName(): string { return 'docgen.Accompanying Period basic'; } + #[\Override] public function hasAdminForm(): bool { return true; } + #[\Override] public function hasPublicForm(DocGeneratorTemplate $template, $entity): bool { $options = $template->getOptions(); @@ -275,6 +287,7 @@ class AccompanyingPeriodContext implements return $options['mainPerson'] || $options['person1'] || $options['person2'] || $options['thirdParty']; } + #[\Override] public function contextGenerationDataNormalize(DocGeneratorTemplate $template, $entity, array $data): array { $normalized = []; @@ -287,6 +300,7 @@ class AccompanyingPeriodContext implements return $normalized; } + #[\Override] public function contextGenerationDataDenormalize(DocGeneratorTemplate $template, $entity, array $data): array { $denormalized = []; @@ -308,6 +322,7 @@ class AccompanyingPeriodContext implements return $denormalized; } + #[\Override] public function storeGenerated(DocGeneratorTemplate $template, StoredObject $storedObject, object $entity, array $contextGenerationData): void { $doc = new AccompanyingCourseDocument(); diff --git a/src/Bundle/ChillPersonBundle/Service/DocGenerator/AccompanyingPeriodWorkContext.php b/src/Bundle/ChillPersonBundle/Service/DocGenerator/AccompanyingPeriodWorkContext.php index 4c1be8159..bbd5deee1 100644 --- a/src/Bundle/ChillPersonBundle/Service/DocGenerator/AccompanyingPeriodWorkContext.php +++ b/src/Bundle/ChillPersonBundle/Service/DocGenerator/AccompanyingPeriodWorkContext.php @@ -48,11 +48,13 @@ class AccompanyingPeriodWorkContext implements DocGeneratorContextWithPublicForm $builder->remove('category'); } + #[\Override] public function buildPublicForm(FormBuilderInterface $builder, DocGeneratorTemplate $template, $entity): void { $this->periodContext->buildPublicForm($builder, $template, $entity->getAccompanyingPeriod()); } + #[\Override] public function getData(DocGeneratorTemplate $template, $entity, array $contextGenerationData = []): array { $data = $this->periodContext->getData($template, $entity->getAccompanyingPeriod(), $contextGenerationData); @@ -64,26 +66,31 @@ class AccompanyingPeriodWorkContext implements DocGeneratorContextWithPublicForm return $data; } + #[\Override] public function getDescription(): string { return 'docgen.A context for accompanying period work'; } + #[\Override] public function getEntityClass(): string { return AccompanyingPeriodWork::class; } + #[\Override] public function getFormData(DocGeneratorTemplate $template, $entity): array { return $this->periodContext->getFormData($template, $entity->getAccompanyingPeriod()); } + #[\Override] public static function getKey(): string { return 'accompanying_period_work_regular'; } + #[\Override] public function getName(): string { return 'docgen.Accompanying period work'; @@ -94,21 +101,25 @@ class AccompanyingPeriodWorkContext implements DocGeneratorContextWithPublicForm return $this->periodContext->hasAdminForm(); } + #[\Override] public function hasPublicForm(DocGeneratorTemplate $template, $entity): bool { return $this->periodContext->hasPublicForm($template, $entity->getAccompanyingPeriod()); } + #[\Override] public function contextGenerationDataNormalize(DocGeneratorTemplate $template, $entity, array $data): array { return $this->periodContext->contextGenerationDataNormalize($template, $entity->getAccompanyingPeriod(), $data); } + #[\Override] public function contextGenerationDataDenormalize(DocGeneratorTemplate $template, $entity, array $data): array { return $this->periodContext->contextGenerationDataDenormalize($template, $entity->getAccompanyingPeriod(), $data); } + #[\Override] public function storeGenerated(DocGeneratorTemplate $template, StoredObject $storedObject, object $entity, array $contextGenerationData): void { // currently, no document associated with a AccompanyingPeriodWork diff --git a/src/Bundle/ChillPersonBundle/Service/DocGenerator/AccompanyingPeriodWorkEvaluationContext.php b/src/Bundle/ChillPersonBundle/Service/DocGenerator/AccompanyingPeriodWorkEvaluationContext.php index 6ecaa99b4..d63dfb01a 100644 --- a/src/Bundle/ChillPersonBundle/Service/DocGenerator/AccompanyingPeriodWorkEvaluationContext.php +++ b/src/Bundle/ChillPersonBundle/Service/DocGenerator/AccompanyingPeriodWorkEvaluationContext.php @@ -39,6 +39,7 @@ class AccompanyingPeriodWorkEvaluationContext implements { public function __construct(private readonly AccompanyingPeriodWorkContext $accompanyingPeriodWorkContext, private readonly EntityManagerInterface $em, private readonly EvaluationRepository $evaluationRepository, private readonly NormalizerInterface $normalizer, private readonly TranslatableStringHelperInterface $translatableStringHelper, private readonly ThirdPartyRender $thirdPartyRender, private readonly TranslatorInterface $translator) {} + #[\Override] public function adminFormReverseTransform(array $data): array { return array_merge( @@ -52,6 +53,7 @@ class AccompanyingPeriodWorkEvaluationContext implements ); } + #[\Override] public function adminFormTransform(array $data): array { return array_merge( @@ -65,6 +67,7 @@ class AccompanyingPeriodWorkEvaluationContext implements ); } + #[\Override] public function buildAdminForm(FormBuilderInterface $builder): void { $this->accompanyingPeriodWorkContext->buildAdminForm($builder); @@ -81,6 +84,7 @@ class AccompanyingPeriodWorkEvaluationContext implements ]); } + #[\Override] public function buildPublicForm(FormBuilderInterface $builder, DocGeneratorTemplate $template, $entity): void { $this->accompanyingPeriodWorkContext->buildPublicForm($builder, $template, $entity->getAccompanyingPeriodWork()); @@ -111,6 +115,7 @@ class AccompanyingPeriodWorkEvaluationContext implements } } + #[\Override] public function getData(DocGeneratorTemplate $template, $entity, array $contextGenerationData = []): array { $data = $this->accompanyingPeriodWorkContext @@ -127,16 +132,19 @@ class AccompanyingPeriodWorkEvaluationContext implements return $data; } + #[\Override] public function getDescription(): string { return 'docgen.A context for accompanying period work evaluation'; } + #[\Override] public function getEntityClass(): string { return AccompanyingPeriodWorkEvaluation::class; } + #[\Override] public function getFormData(DocGeneratorTemplate $template, $entity): array { return $this->accompanyingPeriodWorkContext->getFormData( @@ -145,16 +153,19 @@ class AccompanyingPeriodWorkEvaluationContext implements ); } + #[\Override] public static function getKey(): string { return 'accompanying_period_work_evaluation_regular'; } + #[\Override] public function getName(): string { return 'docgen.Accompanying period work context'; } + #[\Override] public function hasAdminForm(): bool { return true; @@ -163,24 +174,28 @@ class AccompanyingPeriodWorkEvaluationContext implements /** * @param AccompanyingPeriodWorkEvaluation $entity */ + #[\Override] public function hasPublicForm(DocGeneratorTemplate $template, $entity): bool { return $this->accompanyingPeriodWorkContext ->hasPublicForm($template, $entity->getAccompanyingPeriodWork()); } + #[\Override] public function contextGenerationDataNormalize(DocGeneratorTemplate $template, $entity, array $data): array { return $this->accompanyingPeriodWorkContext ->contextGenerationDataNormalize($template, $entity->getAccompanyingPeriodWork(), $data); } + #[\Override] public function contextGenerationDataDenormalize(DocGeneratorTemplate $template, $entity, array $data): array { return $this->accompanyingPeriodWorkContext ->contextGenerationDataDenormalize($template, $entity->getAccompanyingPeriodWork(), $data); } + #[\Override] public function storeGenerated(DocGeneratorTemplate $template, StoredObject $storedObject, object $entity, array $contextGenerationData): void { $doc = new AccompanyingPeriodWorkEvaluationDocument(); diff --git a/src/Bundle/ChillPersonBundle/Service/DocGenerator/PersonContext.php b/src/Bundle/ChillPersonBundle/Service/DocGenerator/PersonContext.php index 890fa40ff..8598e79c7 100644 --- a/src/Bundle/ChillPersonBundle/Service/DocGenerator/PersonContext.php +++ b/src/Bundle/ChillPersonBundle/Service/DocGenerator/PersonContext.php @@ -70,6 +70,7 @@ final readonly class PersonContext implements PersonContextInterface $this->showScopes = $parameterBag->get('chill_main')['acl']['form_show_scopes']; } + #[\Override] public function adminFormReverseTransform(array $data): array { if (\array_key_exists('category', $data)) { @@ -82,6 +83,7 @@ final readonly class PersonContext implements PersonContextInterface return $data; } + #[\Override] public function adminFormTransform(array $data): array { $r = [ @@ -98,6 +100,7 @@ final readonly class PersonContext implements PersonContextInterface return $r; } + #[\Override] public function buildAdminForm(FormBuilderInterface $builder): void { $builder @@ -123,6 +126,7 @@ final readonly class PersonContext implements PersonContextInterface /** * @param Person $entity */ + #[\Override] public function buildPublicForm(FormBuilderInterface $builder, DocGeneratorTemplate $template, $entity): void { $options = $template->getOptions(); @@ -175,6 +179,7 @@ final readonly class PersonContext implements PersonContextInterface } } + #[\Override] public function getData(DocGeneratorTemplate $template, $entity, array $contextGenerationData = []): array { $data = []; @@ -197,16 +202,19 @@ final readonly class PersonContext implements PersonContextInterface return $data; } + #[\Override] public function getDescription(): string { return 'docgen.A basic context for person'; } + #[\Override] public function getEntityClass(): string { return Person::class; } + #[\Override] public function getFormData(DocGeneratorTemplate $template, $entity): array { return [ @@ -214,16 +222,19 @@ final readonly class PersonContext implements PersonContextInterface ]; } + #[\Override] public static function getKey(): string { return self::class; } + #[\Override] public function getName(): string { return 'docgen.Person basic'; } + #[\Override] public function hasAdminForm(): bool { return true; @@ -232,6 +243,7 @@ final readonly class PersonContext implements PersonContextInterface /** * @param Person $entity */ + #[\Override] public function hasPublicForm(DocGeneratorTemplate $template, $entity): bool { return true; @@ -240,6 +252,7 @@ final readonly class PersonContext implements PersonContextInterface /** * @param Person $entity */ + #[\Override] public function contextGenerationDataNormalize(DocGeneratorTemplate $template, $entity, array $data): array { $scope = $data['scope'] ?? null; @@ -254,6 +267,7 @@ final readonly class PersonContext implements PersonContextInterface /** * @param Person $entity */ + #[\Override] public function contextGenerationDataDenormalize(DocGeneratorTemplate $template, $entity, array $data): array { if (!isset($data['scope'])) { @@ -271,6 +285,7 @@ final readonly class PersonContext implements PersonContextInterface ]; } + #[\Override] public function storeGenerated(DocGeneratorTemplate $template, StoredObject $storedObject, object $entity, array $contextGenerationData): void { $doc = new PersonDocument(); diff --git a/src/Bundle/ChillPersonBundle/Service/DocGenerator/PersonContextWithThirdParty.php b/src/Bundle/ChillPersonBundle/Service/DocGenerator/PersonContextWithThirdParty.php index 7f142fdbf..bf6090be7 100644 --- a/src/Bundle/ChillPersonBundle/Service/DocGenerator/PersonContextWithThirdParty.php +++ b/src/Bundle/ChillPersonBundle/Service/DocGenerator/PersonContextWithThirdParty.php @@ -33,6 +33,7 @@ class PersonContextWithThirdParty implements DocGeneratorContextWithAdminFormInt private readonly ThirdPartyRepository $thirdPartyRepository ) {} + #[\Override] public function adminFormReverseTransform(array $data): array { return array_merge( @@ -41,6 +42,7 @@ class PersonContextWithThirdParty implements DocGeneratorContextWithAdminFormInt ); } + #[\Override] public function adminFormTransform(array $data): array { return array_merge( @@ -49,6 +51,7 @@ class PersonContextWithThirdParty implements DocGeneratorContextWithAdminFormInt ); } + #[\Override] public function buildAdminForm(FormBuilderInterface $builder): void { $this->personContext->buildAdminForm($builder); @@ -59,6 +62,7 @@ class PersonContextWithThirdParty implements DocGeneratorContextWithAdminFormInt ]); } + #[\Override] public function buildPublicForm(FormBuilderInterface $builder, DocGeneratorTemplate $template, $entity): void { $this->personContext->buildPublicForm($builder, $template, $entity); @@ -70,6 +74,7 @@ class PersonContextWithThirdParty implements DocGeneratorContextWithAdminFormInt ]); } + #[\Override] public function getData(DocGeneratorTemplate $template, $entity, array $contextGenerationData = []): array { $data = $this->personContext->getData($template, $entity, $contextGenerationData); @@ -83,41 +88,49 @@ class PersonContextWithThirdParty implements DocGeneratorContextWithAdminFormInt return $data; } + #[\Override] public function getDescription(): string { return 'docgen.A context for person with a third party (for sending mail)'; } + #[\Override] public function getEntityClass(): string { return $this->personContext->getEntityClass(); } + #[\Override] public function getFormData(DocGeneratorTemplate $template, $entity): array { return $this->personContext->getFormData($template, $entity); } + #[\Override] public static function getKey(): string { return self::class; } + #[\Override] public function getName(): string { return 'docgen.Person with third party'; } + #[\Override] public function hasAdminForm(): bool { return true; } + #[\Override] public function hasPublicForm(DocGeneratorTemplate $template, $entity): bool { return true; } + #[\Override] public function contextGenerationDataNormalize(DocGeneratorTemplate $template, $entity, array $data): array { return array_merge( @@ -128,6 +141,7 @@ class PersonContextWithThirdParty implements DocGeneratorContextWithAdminFormInt ); } + #[\Override] public function contextGenerationDataDenormalize(DocGeneratorTemplate $template, $entity, array $data): array { return array_merge( @@ -138,6 +152,7 @@ class PersonContextWithThirdParty implements DocGeneratorContextWithAdminFormInt ); } + #[\Override] public function storeGenerated(DocGeneratorTemplate $template, StoredObject $storedObject, object $entity, array $contextGenerationData): void { $this->personContext->storeGenerated($template, $storedObject, $entity, $contextGenerationData); diff --git a/src/Bundle/ChillPersonBundle/Service/EntityInfo/AccompanyingPeriodInfoQueryBuilder.php b/src/Bundle/ChillPersonBundle/Service/EntityInfo/AccompanyingPeriodInfoQueryBuilder.php index 7945f13d6..1797b7aca 100644 --- a/src/Bundle/ChillPersonBundle/Service/EntityInfo/AccompanyingPeriodInfoQueryBuilder.php +++ b/src/Bundle/ChillPersonBundle/Service/EntityInfo/AccompanyingPeriodInfoQueryBuilder.php @@ -16,7 +16,7 @@ namespace Chill\PersonBundle\Service\EntityInfo; */ class AccompanyingPeriodInfoQueryBuilder { - private const BASE_QUERY = <<<'SQL' + private const string BASE_QUERY = <<<'SQL' SELECT {period_id_column} AS accompanyingperiod_id, '{related_entity_column_id}' AS relatedentity, diff --git a/src/Bundle/ChillPersonBundle/Service/EntityInfo/AccompanyingPeriodInfoQueryPart/AccompanyingPeriodStartQueryPartForAccompanyingPeriodInfo.php b/src/Bundle/ChillPersonBundle/Service/EntityInfo/AccompanyingPeriodInfoQueryPart/AccompanyingPeriodStartQueryPartForAccompanyingPeriodInfo.php index 19272900a..b35ce037e 100644 --- a/src/Bundle/ChillPersonBundle/Service/EntityInfo/AccompanyingPeriodInfoQueryPart/AccompanyingPeriodStartQueryPartForAccompanyingPeriodInfo.php +++ b/src/Bundle/ChillPersonBundle/Service/EntityInfo/AccompanyingPeriodInfoQueryPart/AccompanyingPeriodStartQueryPartForAccompanyingPeriodInfo.php @@ -16,46 +16,55 @@ use Chill\PersonBundle\Service\EntityInfo\AccompanyingPeriodInfoUnionQueryPartIn class AccompanyingPeriodStartQueryPartForAccompanyingPeriodInfo implements AccompanyingPeriodInfoUnionQueryPartInterface { + #[\Override] public function getAccompanyingPeriodIdColumn(): string { return 'a.id'; } + #[\Override] public function getRelatedEntityColumn(): string { return AccompanyingPeriod::class; } + #[\Override] public function getRelatedEntityIdColumn(): string { return 'a.id'; } + #[\Override] public function getUserIdColumn(): string { return 'NULL'; } + #[\Override] public function getDateTimeColumn(): string { return 'a.openingDate'; } + #[\Override] public function getDiscriminator(): string { return 'accompanying_period_start'; } + #[\Override] public function getMetadataColumn(): string { return '\'{}\'::jsonb'; } + #[\Override] public function getFromStatement(): string { return 'chill_person_accompanying_period a'; } + #[\Override] public function getWhereClause(): string { return ''; diff --git a/src/Bundle/ChillPersonBundle/Service/EntityInfo/AccompanyingPeriodInfoQueryPart/AccompanyingPeriodWorkEndQueryPartForAccompanyingPeriodInfo.php b/src/Bundle/ChillPersonBundle/Service/EntityInfo/AccompanyingPeriodInfoQueryPart/AccompanyingPeriodWorkEndQueryPartForAccompanyingPeriodInfo.php index f0b38b635..68f3ce0e2 100644 --- a/src/Bundle/ChillPersonBundle/Service/EntityInfo/AccompanyingPeriodInfoQueryPart/AccompanyingPeriodWorkEndQueryPartForAccompanyingPeriodInfo.php +++ b/src/Bundle/ChillPersonBundle/Service/EntityInfo/AccompanyingPeriodInfoQueryPart/AccompanyingPeriodWorkEndQueryPartForAccompanyingPeriodInfo.php @@ -16,47 +16,56 @@ use Chill\PersonBundle\Service\EntityInfo\AccompanyingPeriodInfoUnionQueryPartIn class AccompanyingPeriodWorkEndQueryPartForAccompanyingPeriodInfo implements AccompanyingPeriodInfoUnionQueryPartInterface { + #[\Override] public function getAccompanyingPeriodIdColumn(): string { return 'w.accompanyingperiod_id'; } + #[\Override] public function getRelatedEntityColumn(): string { return AccompanyingPeriodWork::class; } + #[\Override] public function getRelatedEntityIdColumn(): string { return 'w.id'; } + #[\Override] public function getUserIdColumn(): string { return 'cpapwr.user_id'; } + #[\Override] public function getDateTimeColumn(): string { return 'w.endDate'; } + #[\Override] public function getMetadataColumn(): string { return "'{}'::jsonb"; } + #[\Override] public function getDiscriminator(): string { return 'accompanying_period_work_end'; } + #[\Override] public function getFromStatement(): string { return 'chill_person_accompanying_period_work w LEFT JOIN chill_person_accompanying_period_work_referrer cpapwr ON w.id = cpapwr.accompanyingperiodwork_id AND daterange(cpapwr.startDate, cpapwr.endDate) @> w.endDate'; } + #[\Override] public function getWhereClause(): string { return 'w.endDate IS NOT NULL'; diff --git a/src/Bundle/ChillPersonBundle/Service/EntityInfo/AccompanyingPeriodInfoQueryPart/AccompanyingPeriodWorkEvaluationCreationQueryPartForAccompanyingPeriodInfo.php b/src/Bundle/ChillPersonBundle/Service/EntityInfo/AccompanyingPeriodInfoQueryPart/AccompanyingPeriodWorkEvaluationCreationQueryPartForAccompanyingPeriodInfo.php index a0215957c..b58015a91 100644 --- a/src/Bundle/ChillPersonBundle/Service/EntityInfo/AccompanyingPeriodInfoQueryPart/AccompanyingPeriodWorkEvaluationCreationQueryPartForAccompanyingPeriodInfo.php +++ b/src/Bundle/ChillPersonBundle/Service/EntityInfo/AccompanyingPeriodInfoQueryPart/AccompanyingPeriodWorkEvaluationCreationQueryPartForAccompanyingPeriodInfo.php @@ -16,41 +16,49 @@ use Chill\PersonBundle\Service\EntityInfo\AccompanyingPeriodInfoUnionQueryPartIn class AccompanyingPeriodWorkEvaluationCreationQueryPartForAccompanyingPeriodInfo implements AccompanyingPeriodInfoUnionQueryPartInterface { + #[\Override] public function getAccompanyingPeriodIdColumn(): string { return 'cpapw.accompanyingperiod_id'; } + #[\Override] public function getRelatedEntityColumn(): string { return AccompanyingPeriodWorkEvaluation::class; } + #[\Override] public function getRelatedEntityIdColumn(): string { return 'e.id'; } + #[\Override] public function getUserIdColumn(): string { return 'e.createdBy_id'; } + #[\Override] public function getDateTimeColumn(): string { return 'e.createdAt'; } + #[\Override] public function getMetadataColumn(): string { return "'{}'::jsonb"; } + #[\Override] public function getDiscriminator(): string { return 'accompanying_period_work_evaluation_creation'; } + #[\Override] public function getFromStatement(): string { return 'chill_person_accompanying_period_work_evaluation e @@ -58,6 +66,7 @@ class AccompanyingPeriodWorkEvaluationCreationQueryPartForAccompanyingPeriodInfo LEFT JOIN chill_person_accompanying_period_work_referrer cpapwr ON cpapw.id = cpapwr.accompanyingperiodwork_id AND daterange(cpapwr.startDate, cpapwr.endDate) @> e.startDate'; } + #[\Override] public function getWhereClause(): string { return 'e.createdAt IS NOT NULL'; diff --git a/src/Bundle/ChillPersonBundle/Service/EntityInfo/AccompanyingPeriodInfoQueryPart/AccompanyingPeriodWorkEvaluationDocumentUpdateQueryPartForAccompanyingPeriodInfo.php b/src/Bundle/ChillPersonBundle/Service/EntityInfo/AccompanyingPeriodInfoQueryPart/AccompanyingPeriodWorkEvaluationDocumentUpdateQueryPartForAccompanyingPeriodInfo.php index cae8c96de..a3383d3d1 100644 --- a/src/Bundle/ChillPersonBundle/Service/EntityInfo/AccompanyingPeriodInfoQueryPart/AccompanyingPeriodWorkEvaluationDocumentUpdateQueryPartForAccompanyingPeriodInfo.php +++ b/src/Bundle/ChillPersonBundle/Service/EntityInfo/AccompanyingPeriodInfoQueryPart/AccompanyingPeriodWorkEvaluationDocumentUpdateQueryPartForAccompanyingPeriodInfo.php @@ -16,47 +16,56 @@ use Chill\PersonBundle\Service\EntityInfo\AccompanyingPeriodInfoUnionQueryPartIn class AccompanyingPeriodWorkEvaluationDocumentUpdateQueryPartForAccompanyingPeriodInfo implements AccompanyingPeriodInfoUnionQueryPartInterface { + #[\Override] public function getAccompanyingPeriodIdColumn(): string { return 'cpapw.accompanyingperiod_id'; } + #[\Override] public function getRelatedEntityColumn(): string { return AccompanyingPeriodWorkEvaluation::class; } + #[\Override] public function getRelatedEntityIdColumn(): string { return 'e.id'; } + #[\Override] public function getUserIdColumn(): string { return 'e.updatedby_id'; } + #[\Override] public function getDateTimeColumn(): string { return 'e.updatedAt'; } + #[\Override] public function getMetadataColumn(): string { return "'{}'::jsonb"; } + #[\Override] public function getDiscriminator(): string { return 'accompanying_period_work_evaluation_updated_at'; } + #[\Override] public function getFromStatement(): string { return 'chill_person_accompanying_period_work_evaluation e JOIN chill_person_accompanying_period_work cpapw ON cpapw.id = e.accompanyingperiodwork_id'; } + #[\Override] public function getWhereClause(): string { return 'e.updatedAt IS NOT NULL'; diff --git a/src/Bundle/ChillPersonBundle/Service/EntityInfo/AccompanyingPeriodInfoQueryPart/AccompanyingPeriodWorkEvaluationMaxQueryPartForAccompanyingPeriodInfo.php b/src/Bundle/ChillPersonBundle/Service/EntityInfo/AccompanyingPeriodInfoQueryPart/AccompanyingPeriodWorkEvaluationMaxQueryPartForAccompanyingPeriodInfo.php index ce8dd22f8..2ce9cf921 100644 --- a/src/Bundle/ChillPersonBundle/Service/EntityInfo/AccompanyingPeriodInfoQueryPart/AccompanyingPeriodWorkEvaluationMaxQueryPartForAccompanyingPeriodInfo.php +++ b/src/Bundle/ChillPersonBundle/Service/EntityInfo/AccompanyingPeriodInfoQueryPart/AccompanyingPeriodWorkEvaluationMaxQueryPartForAccompanyingPeriodInfo.php @@ -16,41 +16,49 @@ use Chill\PersonBundle\Service\EntityInfo\AccompanyingPeriodInfoUnionQueryPartIn class AccompanyingPeriodWorkEvaluationMaxQueryPartForAccompanyingPeriodInfo implements AccompanyingPeriodInfoUnionQueryPartInterface { + #[\Override] public function getAccompanyingPeriodIdColumn(): string { return 'cpapw.accompanyingperiod_id'; } + #[\Override] public function getRelatedEntityColumn(): string { return AccompanyingPeriodWorkEvaluation::class; } + #[\Override] public function getRelatedEntityIdColumn(): string { return 'e.id'; } + #[\Override] public function getUserIdColumn(): string { return 'cpapwr.user_id'; } + #[\Override] public function getDateTimeColumn(): string { return 'e.maxDate'; } + #[\Override] public function getMetadataColumn(): string { return "'{}'::jsonb"; } + #[\Override] public function getDiscriminator(): string { return 'accompanying_period_work_evaluation_start'; } + #[\Override] public function getFromStatement(): string { return 'chill_person_accompanying_period_work_evaluation e @@ -58,6 +66,7 @@ class AccompanyingPeriodWorkEvaluationMaxQueryPartForAccompanyingPeriodInfo impl LEFT JOIN chill_person_accompanying_period_work_referrer cpapwr ON cpapw.id = cpapwr.accompanyingperiodwork_id AND daterange(cpapwr.startDate, cpapwr.endDate) @> e.maxDate'; } + #[\Override] public function getWhereClause(): string { return 'e.maxDate IS NOT NULL'; diff --git a/src/Bundle/ChillPersonBundle/Service/EntityInfo/AccompanyingPeriodInfoQueryPart/AccompanyingPeriodWorkEvaluationStartQueryPartForAccompanyingPeriodInfo.php b/src/Bundle/ChillPersonBundle/Service/EntityInfo/AccompanyingPeriodInfoQueryPart/AccompanyingPeriodWorkEvaluationStartQueryPartForAccompanyingPeriodInfo.php index ecf366483..96e5bc42d 100644 --- a/src/Bundle/ChillPersonBundle/Service/EntityInfo/AccompanyingPeriodInfoQueryPart/AccompanyingPeriodWorkEvaluationStartQueryPartForAccompanyingPeriodInfo.php +++ b/src/Bundle/ChillPersonBundle/Service/EntityInfo/AccompanyingPeriodInfoQueryPart/AccompanyingPeriodWorkEvaluationStartQueryPartForAccompanyingPeriodInfo.php @@ -16,41 +16,49 @@ use Chill\PersonBundle\Service\EntityInfo\AccompanyingPeriodInfoUnionQueryPartIn class AccompanyingPeriodWorkEvaluationStartQueryPartForAccompanyingPeriodInfo implements AccompanyingPeriodInfoUnionQueryPartInterface { + #[\Override] public function getAccompanyingPeriodIdColumn(): string { return 'cpapw.accompanyingperiod_id'; } + #[\Override] public function getRelatedEntityColumn(): string { return AccompanyingPeriodWorkEvaluation::class; } + #[\Override] public function getRelatedEntityIdColumn(): string { return 'e.id'; } + #[\Override] public function getUserIdColumn(): string { return 'cpapwr.user_id'; } + #[\Override] public function getDateTimeColumn(): string { return 'e.startDate'; } + #[\Override] public function getMetadataColumn(): string { return "'{}'::jsonb"; } + #[\Override] public function getDiscriminator(): string { return 'accompanying_period_work_evaluation_start'; } + #[\Override] public function getFromStatement(): string { return 'chill_person_accompanying_period_work_evaluation e @@ -58,6 +66,7 @@ class AccompanyingPeriodWorkEvaluationStartQueryPartForAccompanyingPeriodInfo im LEFT JOIN chill_person_accompanying_period_work_referrer cpapwr ON cpapw.id = cpapwr.accompanyingperiodwork_id AND daterange(cpapwr.startDate, cpapwr.endDate) @> e.startDate'; } + #[\Override] public function getWhereClause(): string { return 'e.startDate IS NOT NULL'; diff --git a/src/Bundle/ChillPersonBundle/Service/EntityInfo/AccompanyingPeriodInfoQueryPart/AccompanyingPeriodWorkEvaluationUpdateQueryPartForAccompanyingPeriodInfo.php b/src/Bundle/ChillPersonBundle/Service/EntityInfo/AccompanyingPeriodInfoQueryPart/AccompanyingPeriodWorkEvaluationUpdateQueryPartForAccompanyingPeriodInfo.php index ff29c558d..828b3f227 100644 --- a/src/Bundle/ChillPersonBundle/Service/EntityInfo/AccompanyingPeriodInfoQueryPart/AccompanyingPeriodWorkEvaluationUpdateQueryPartForAccompanyingPeriodInfo.php +++ b/src/Bundle/ChillPersonBundle/Service/EntityInfo/AccompanyingPeriodInfoQueryPart/AccompanyingPeriodWorkEvaluationUpdateQueryPartForAccompanyingPeriodInfo.php @@ -16,41 +16,49 @@ use Chill\PersonBundle\Service\EntityInfo\AccompanyingPeriodInfoUnionQueryPartIn class AccompanyingPeriodWorkEvaluationUpdateQueryPartForAccompanyingPeriodInfo implements AccompanyingPeriodInfoUnionQueryPartInterface { + #[\Override] public function getAccompanyingPeriodIdColumn(): string { return 'cpapw.accompanyingperiod_id'; } + #[\Override] public function getRelatedEntityColumn(): string { return AccompanyingPeriodWorkEvaluationDocument::class; } + #[\Override] public function getRelatedEntityIdColumn(): string { return 'doc.id'; } + #[\Override] public function getUserIdColumn(): string { return 'doc.updatedby_id'; } + #[\Override] public function getDateTimeColumn(): string { return 'doc.updatedAt'; } + #[\Override] public function getMetadataColumn(): string { return "'{}'::jsonb"; } + #[\Override] public function getDiscriminator(): string { return 'accompanying_period_work_evaluation_document_updated_at'; } + #[\Override] public function getFromStatement(): string { return 'chill_person_accompanying_period_work_evaluation_document doc @@ -58,6 +66,7 @@ class AccompanyingPeriodWorkEvaluationUpdateQueryPartForAccompanyingPeriodInfo i JOIN chill_person_accompanying_period_work cpapw ON cpapw.id = e.accompanyingperiodwork_id'; } + #[\Override] public function getWhereClause(): string { return 'doc.updatedAt IS NOT NULL'; diff --git a/src/Bundle/ChillPersonBundle/Service/EntityInfo/AccompanyingPeriodInfoQueryPart/AccompanyingPeriodWorkNewReferrerQueryPartForAccompanyingPeriodInfo.php b/src/Bundle/ChillPersonBundle/Service/EntityInfo/AccompanyingPeriodInfoQueryPart/AccompanyingPeriodWorkNewReferrerQueryPartForAccompanyingPeriodInfo.php index 2208c2975..c8bf08f0b 100644 --- a/src/Bundle/ChillPersonBundle/Service/EntityInfo/AccompanyingPeriodInfoQueryPart/AccompanyingPeriodWorkNewReferrerQueryPartForAccompanyingPeriodInfo.php +++ b/src/Bundle/ChillPersonBundle/Service/EntityInfo/AccompanyingPeriodInfoQueryPart/AccompanyingPeriodWorkNewReferrerQueryPartForAccompanyingPeriodInfo.php @@ -16,47 +16,56 @@ use Chill\PersonBundle\Service\EntityInfo\AccompanyingPeriodInfoUnionQueryPartIn class AccompanyingPeriodWorkNewReferrerQueryPartForAccompanyingPeriodInfo implements AccompanyingPeriodInfoUnionQueryPartInterface { + #[\Override] public function getAccompanyingPeriodIdColumn(): string { return 'w.accompanyingperiod_id'; } + #[\Override] public function getRelatedEntityColumn(): string { return AccompanyingPeriodWork::class; } + #[\Override] public function getRelatedEntityIdColumn(): string { return 'w.id'; } + #[\Override] public function getUserIdColumn(): string { return 'cpapwr.user_id'; } + #[\Override] public function getDateTimeColumn(): string { return 'cpapwr.startDate'; } + #[\Override] public function getMetadataColumn(): string { return "'{}'::jsonb"; } + #[\Override] public function getDiscriminator(): string { return 'accompanying_period_work_referrer_new'; } + #[\Override] public function getFromStatement(): string { return 'chill_person_accompanying_period_work w JOIN chill_person_accompanying_period_work_referrer cpapwr on w.id = cpapwr.accompanyingperiodwork_id'; } + #[\Override] public function getWhereClause(): string { return ''; diff --git a/src/Bundle/ChillPersonBundle/Service/EntityInfo/AccompanyingPeriodInfoQueryPart/AccompanyingPeriodWorkStartQueryPartForAccompanyingPeriodInfo.php b/src/Bundle/ChillPersonBundle/Service/EntityInfo/AccompanyingPeriodInfoQueryPart/AccompanyingPeriodWorkStartQueryPartForAccompanyingPeriodInfo.php index c4e6710dc..629db0fc0 100644 --- a/src/Bundle/ChillPersonBundle/Service/EntityInfo/AccompanyingPeriodInfoQueryPart/AccompanyingPeriodWorkStartQueryPartForAccompanyingPeriodInfo.php +++ b/src/Bundle/ChillPersonBundle/Service/EntityInfo/AccompanyingPeriodInfoQueryPart/AccompanyingPeriodWorkStartQueryPartForAccompanyingPeriodInfo.php @@ -16,47 +16,56 @@ use Chill\PersonBundle\Service\EntityInfo\AccompanyingPeriodInfoUnionQueryPartIn class AccompanyingPeriodWorkStartQueryPartForAccompanyingPeriodInfo implements AccompanyingPeriodInfoUnionQueryPartInterface { + #[\Override] public function getAccompanyingPeriodIdColumn(): string { return 'w.accompanyingperiod_id'; } + #[\Override] public function getRelatedEntityColumn(): string { return AccompanyingPeriodWork::class; } + #[\Override] public function getRelatedEntityIdColumn(): string { return 'w.id'; } + #[\Override] public function getUserIdColumn(): string { return 'cpapwr.user_id'; } + #[\Override] public function getDateTimeColumn(): string { return 'w.startDate'; } + #[\Override] public function getMetadataColumn(): string { return "'{}'::jsonb"; } + #[\Override] public function getDiscriminator(): string { return 'accompanying_period_work_start'; } + #[\Override] public function getFromStatement(): string { return 'chill_person_accompanying_period_work w LEFT JOIN chill_person_accompanying_period_work_referrer cpapwr on w.id = cpapwr.accompanyingperiodwork_id AND daterange(cpapwr.startDate, cpapwr.endDate) @> w.startDate'; } + #[\Override] public function getWhereClause(): string { return ''; diff --git a/src/Bundle/ChillPersonBundle/Service/EntityInfo/AccompanyingPeriodViewEntityInfoProvider.php b/src/Bundle/ChillPersonBundle/Service/EntityInfo/AccompanyingPeriodViewEntityInfoProvider.php index 19059ef47..9a4b5af7a 100644 --- a/src/Bundle/ChillPersonBundle/Service/EntityInfo/AccompanyingPeriodViewEntityInfoProvider.php +++ b/src/Bundle/ChillPersonBundle/Service/EntityInfo/AccompanyingPeriodViewEntityInfoProvider.php @@ -23,6 +23,7 @@ class AccompanyingPeriodViewEntityInfoProvider implements ViewEntityInfoProvider private readonly AccompanyingPeriodInfoQueryBuilder $builder, ) {} + #[\Override] public function getViewQuery(): string { return implode( @@ -34,6 +35,7 @@ class AccompanyingPeriodViewEntityInfoProvider implements ViewEntityInfoProvider ); } + #[\Override] public function getViewName(): string { return 'view_chill_person_accompanying_period_info'; diff --git a/src/Bundle/ChillPersonBundle/Service/GenericDoc/Providers/AccompanyingPeriodWorkEvaluationGenericDocProvider.php b/src/Bundle/ChillPersonBundle/Service/GenericDoc/Providers/AccompanyingPeriodWorkEvaluationGenericDocProvider.php index a9617e3c9..464b17159 100644 --- a/src/Bundle/ChillPersonBundle/Service/GenericDoc/Providers/AccompanyingPeriodWorkEvaluationGenericDocProvider.php +++ b/src/Bundle/ChillPersonBundle/Service/GenericDoc/Providers/AccompanyingPeriodWorkEvaluationGenericDocProvider.php @@ -25,13 +25,14 @@ use Symfony\Component\Security\Core\Security; final readonly class AccompanyingPeriodWorkEvaluationGenericDocProvider implements GenericDocForAccompanyingPeriodProviderInterface, GenericDocForPersonProviderInterface { - public const KEY = 'accompanying_period_work_evaluation_document'; + public const string KEY = 'accompanying_period_work_evaluation_document'; public function __construct( private Security $security, private EntityManagerInterface $entityManager, ) {} + #[\Override] public function buildFetchQueryForAccompanyingPeriod(AccompanyingPeriod $accompanyingPeriod, ?\DateTimeImmutable $startDate = null, ?\DateTimeImmutable $endDate = null, ?string $content = null, ?string $origin = null): FetchQueryInterface { $accompanyingPeriodWorkMetadata = $this->entityManager->getClassMetadata(AccompanyingPeriod\AccompanyingPeriodWork::class); @@ -46,6 +47,7 @@ final readonly class AccompanyingPeriodWorkEvaluationGenericDocProvider implemen return $this->addWhereClausesToQuery($query, $startDate, $endDate, $content); } + #[\Override] public function isAllowedForAccompanyingPeriod(AccompanyingPeriod $accompanyingPeriod): bool { return $this->security->isGranted(AccompanyingPeriodWorkVoter::SEE, $accompanyingPeriod); @@ -83,6 +85,7 @@ final readonly class AccompanyingPeriodWorkEvaluationGenericDocProvider implemen return $query; } + #[\Override] public function buildFetchQueryForPerson(Person $person, ?\DateTimeImmutable $startDate = null, ?\DateTimeImmutable $endDate = null, ?string $content = null, ?string $origin = null): FetchQueryInterface { $storedObjectMetadata = $this->entityManager->getClassMetadata(StoredObject::class); @@ -120,6 +123,7 @@ final readonly class AccompanyingPeriodWorkEvaluationGenericDocProvider implemen return $this->addWhereClausesToQuery($query, $startDate, $endDate, $content); } + #[\Override] public function isAllowedForPerson(Person $person): bool { // this will be filtered during query diff --git a/src/Bundle/ChillPersonBundle/Service/GenericDoc/Renderer/AccompanyingPeriodWorkEvaluationGenericDocRenderer.php b/src/Bundle/ChillPersonBundle/Service/GenericDoc/Renderer/AccompanyingPeriodWorkEvaluationGenericDocRenderer.php index 7c6f2264f..68b7253ad 100644 --- a/src/Bundle/ChillPersonBundle/Service/GenericDoc/Renderer/AccompanyingPeriodWorkEvaluationGenericDocRenderer.php +++ b/src/Bundle/ChillPersonBundle/Service/GenericDoc/Renderer/AccompanyingPeriodWorkEvaluationGenericDocRenderer.php @@ -22,16 +22,19 @@ final readonly class AccompanyingPeriodWorkEvaluationGenericDocRenderer implemen private AccompanyingPeriodWorkEvaluationDocumentRepository $accompanyingPeriodWorkEvaluationDocumentRepository, ) {} + #[\Override] public function supports(GenericDocDTO $genericDocDTO, $options = []): bool { return AccompanyingPeriodWorkEvaluationGenericDocProvider::KEY === $genericDocDTO->key; } + #[\Override] public function getTemplate(GenericDocDTO $genericDocDTO, $options = []): string { return '@ChillPerson/GenericDoc/evaluation_document.html.twig'; } + #[\Override] public function getTemplateData(GenericDocDTO $genericDocDTO, $options = []): array { return [ diff --git a/src/Bundle/ChillPersonBundle/Service/Import/SocialWorkMetadata.php b/src/Bundle/ChillPersonBundle/Service/Import/SocialWorkMetadata.php index 21406072d..8980d8834 100644 --- a/src/Bundle/ChillPersonBundle/Service/Import/SocialWorkMetadata.php +++ b/src/Bundle/ChillPersonBundle/Service/Import/SocialWorkMetadata.php @@ -32,6 +32,7 @@ final readonly class SocialWorkMetadata implements SocialWorkMetadataInterface /** * @throws \Exception */ + #[\Override] public function import(iterable $dataset): bool { // Initialisation of the previous result row with the proper data structure. diff --git a/src/Bundle/ChillPersonBundle/Templating/Entity/ClosingMotiveRender.php b/src/Bundle/ChillPersonBundle/Templating/Entity/ClosingMotiveRender.php index 29ed4226a..fd5edeaf0 100644 --- a/src/Bundle/ChillPersonBundle/Templating/Entity/ClosingMotiveRender.php +++ b/src/Bundle/ChillPersonBundle/Templating/Entity/ClosingMotiveRender.php @@ -25,13 +25,14 @@ use Symfony\Contracts\Translation\TranslatorInterface; final readonly class ClosingMotiveRender implements ChillEntityRenderInterface { use BoxUtilsChillEntityRenderTrait; - private const SEPARATOR = ' > '; + private const string SEPARATOR = ' > '; public function __construct( private TranslatableStringHelperInterface $translatableStringHelper, private TranslatorInterface $translator ) {} + #[\Override] public function renderBox($entity, array $options): string { return @@ -40,6 +41,7 @@ final readonly class ClosingMotiveRender implements ChillEntityRenderInterface $this->getDefaultClosingBox(); } + #[\Override] public function renderString($entity, array $options): string { return $this->renderStringRecursive( @@ -49,6 +51,7 @@ final readonly class ClosingMotiveRender implements ChillEntityRenderInterface ); } + #[\Override] public function supports($entity, array $options): bool { return $entity instanceof ClosingMotive; diff --git a/src/Bundle/ChillPersonBundle/Templating/Entity/PersonRender.php b/src/Bundle/ChillPersonBundle/Templating/Entity/PersonRender.php index a09ad11f5..bb009610d 100644 --- a/src/Bundle/ChillPersonBundle/Templating/Entity/PersonRender.php +++ b/src/Bundle/ChillPersonBundle/Templating/Entity/PersonRender.php @@ -25,6 +25,7 @@ class PersonRender implements PersonRenderInterface public function __construct(private readonly ConfigPersonAltNamesHelper $configAltNamesHelper, private readonly \Twig\Environment $engine, private readonly TranslatorInterface $translator) {} + #[\Override] public function renderBox($person, array $options): string { $params = [ @@ -54,6 +55,7 @@ class PersonRender implements PersonRenderInterface $this->getDefaultClosingBox(); } + #[\Override] public function renderString($person, array $options): string { $options = array_merge(['addAge' => true], $options); @@ -73,6 +75,7 @@ class PersonRender implements PersonRenderInterface .$this->addAltNames($person, false); } + #[\Override] public function supports($entity, array $options): bool { return $entity instanceof Person; diff --git a/src/Bundle/ChillPersonBundle/Templating/Entity/ResourceKindRender.php b/src/Bundle/ChillPersonBundle/Templating/Entity/ResourceKindRender.php index b9cf28fb7..f028b3fe9 100644 --- a/src/Bundle/ChillPersonBundle/Templating/Entity/ResourceKindRender.php +++ b/src/Bundle/ChillPersonBundle/Templating/Entity/ResourceKindRender.php @@ -22,6 +22,7 @@ final readonly class ResourceKindRender implements ChillEntityRenderInterface { public function __construct(private TranslatableStringHelper $translatableStringHelper) {} + #[\Override] public function renderBox($entity, array $options): string { return @@ -32,6 +33,7 @@ final readonly class ResourceKindRender implements ChillEntityRenderInterface ''; } + #[\Override] public function renderString($entity, array $options): string { $title = ''; @@ -43,6 +45,7 @@ final readonly class ResourceKindRender implements ChillEntityRenderInterface return $title; } + #[\Override] public function supports($entity, array $options): bool { return $entity instanceof PersonResourceKind; diff --git a/src/Bundle/ChillPersonBundle/Templating/Entity/SocialActionRender.php b/src/Bundle/ChillPersonBundle/Templating/Entity/SocialActionRender.php index 657ed0f53..b9bc5e558 100644 --- a/src/Bundle/ChillPersonBundle/Templating/Entity/SocialActionRender.php +++ b/src/Bundle/ChillPersonBundle/Templating/Entity/SocialActionRender.php @@ -21,9 +21,9 @@ use Symfony\Contracts\Translation\TranslatorInterface; */ class SocialActionRender implements ChillEntityRenderInterface { - final public const AND_CHILDREN_MENTION = 'show_and_children_mention'; + final public const string AND_CHILDREN_MENTION = 'show_and_children_mention'; - final public const DEFAULT_ARGS = [ + final public const array DEFAULT_ARGS = [ self::SEPARATOR_KEY => ' > ', self::NO_BADGE => false, self::SHOW_AND_CHILDREN => false, @@ -33,18 +33,19 @@ class SocialActionRender implements ChillEntityRenderInterface /** * if true, the action will not be encapsulated into a "badge". */ - final public const NO_BADGE = 'no-badge'; + final public const string NO_BADGE = 'no-badge'; - final public const SEPARATOR_KEY = 'default.separator'; + final public const string SEPARATOR_KEY = 'default.separator'; /** * Show a mention "and children" on each SocialAction, if the social action * has at least one child. */ - final public const SHOW_AND_CHILDREN = 'show_and_children'; + final public const string SHOW_AND_CHILDREN = 'show_and_children'; public function __construct(private readonly TranslatableStringHelper $translatableStringHelper, private readonly \Twig\Environment $engine, private readonly TranslatorInterface $translator) {} + #[\Override] public function renderBox($socialAction, array $options): string { $options = \array_merge(self::DEFAULT_ARGS, $options); @@ -58,6 +59,7 @@ class SocialActionRender implements ChillEntityRenderInterface ]); } + #[\Override] public function renderString($socialAction, array $options): string { /** @var SocialAction $socialAction */ @@ -82,6 +84,7 @@ class SocialActionRender implements ChillEntityRenderInterface return $title; } + #[\Override] public function supports($entity, array $options): bool { return $entity instanceof SocialAction; diff --git a/src/Bundle/ChillPersonBundle/Templating/Entity/SocialIssueRender.php b/src/Bundle/ChillPersonBundle/Templating/Entity/SocialIssueRender.php index af8622f67..306a707ec 100644 --- a/src/Bundle/ChillPersonBundle/Templating/Entity/SocialIssueRender.php +++ b/src/Bundle/ChillPersonBundle/Templating/Entity/SocialIssueRender.php @@ -21,24 +21,25 @@ use Symfony\Contracts\Translation\TranslatorInterface; */ final readonly class SocialIssueRender implements ChillEntityRenderInterface { - public const AND_CHILDREN_MENTION = 'show_and_children_mention'; + public const string AND_CHILDREN_MENTION = 'show_and_children_mention'; - public const DEFAULT_ARGS = [ + public const array DEFAULT_ARGS = [ self::SEPARATOR_KEY => ' > ', self::SHOW_AND_CHILDREN => false, self::AND_CHILDREN_MENTION => 'social_issue.and children', ]; - public const SEPARATOR_KEY = 'default.separator'; + public const string SEPARATOR_KEY = 'default.separator'; /** * Show a mention "and children" on each SocialIssue, if the social issue * has at least one child. */ - public const SHOW_AND_CHILDREN = 'show_and_children'; + public const string SHOW_AND_CHILDREN = 'show_and_children'; public function __construct(private TranslatableStringHelper $translatableStringHelper, private \Twig\Environment $engine, private TranslatorInterface $translator) {} + #[\Override] public function renderBox($socialIssue, array $options): string { $options = array_merge(self::DEFAULT_ARGS, $options); @@ -57,6 +58,7 @@ final readonly class SocialIssueRender implements ChillEntityRenderInterface ); } + #[\Override] public function renderString($socialIssue, array $options): string { /** @var SocialIssue $socialIssue */ @@ -83,6 +85,7 @@ final readonly class SocialIssueRender implements ChillEntityRenderInterface return $title; } + #[\Override] public function supports($entity, array $options): bool { return $entity instanceof SocialIssue; diff --git a/src/Bundle/ChillPersonBundle/Tests/AccompanyingPeriod/AccompanyingPeriodConfidentialTest.php b/src/Bundle/ChillPersonBundle/Tests/AccompanyingPeriod/AccompanyingPeriodConfidentialTest.php index 948228ce2..a98b3fec8 100644 --- a/src/Bundle/ChillPersonBundle/Tests/AccompanyingPeriod/AccompanyingPeriodConfidentialTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/AccompanyingPeriod/AccompanyingPeriodConfidentialTest.php @@ -31,11 +31,13 @@ final class AccompanyingPeriodConfidentialTest extends WebTestCase /** * Setup before each test method (see phpunit doc). */ + #[\Override] protected function setUp(): void { $this->client = $this->getClientAuthenticated(); } + #[\Override] protected function tearDown(): void { self::ensureKernelShutdown(); diff --git a/src/Bundle/ChillPersonBundle/Tests/Action/Remove/PersonMoveTest.php b/src/Bundle/ChillPersonBundle/Tests/Action/Remove/PersonMoveTest.php index b64b2cdeb..219a426f3 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Action/Remove/PersonMoveTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Action/Remove/PersonMoveTest.php @@ -51,6 +51,7 @@ class PersonMoveTest extends KernelTestCase */ private static array $entitiesToDelete = []; + #[\Override] public function setUp(): void { self::bootKernel(); @@ -61,6 +62,7 @@ class PersonMoveTest extends KernelTestCase $this->personCenterHistory = self::getContainer()->get(PersonCenterHistoryInterface::class); } + #[\Override] public static function tearDownAfterClass(): void { self::bootKernel(); diff --git a/src/Bundle/ChillPersonBundle/Tests/Controller/AccompanyingCoursWorkApiController/ConflictTest.php b/src/Bundle/ChillPersonBundle/Tests/Controller/AccompanyingCoursWorkApiController/ConflictTest.php index 8f182cac5..55be70e91 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Controller/AccompanyingCoursWorkApiController/ConflictTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Controller/AccompanyingCoursWorkApiController/ConflictTest.php @@ -29,11 +29,13 @@ class ConflictTest extends WebTestCase { use PrepareClientTrait; + #[\Override] protected function setUp(): void { self::ensureKernelShutdown(); } + #[\Override] protected function tearDown(): void { self::ensureKernelShutdown(); diff --git a/src/Bundle/ChillPersonBundle/Tests/Controller/AccompanyingCourseApiControllerTest.php b/src/Bundle/ChillPersonBundle/Tests/Controller/AccompanyingCourseApiControllerTest.php index 301d90056..31fa7ffbb 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Controller/AccompanyingCourseApiControllerTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Controller/AccompanyingCourseApiControllerTest.php @@ -43,6 +43,7 @@ final class AccompanyingCourseApiControllerTest extends WebTestCase private ?int $personId = null; + #[\Override] protected function tearDown(): void { self::ensureKernelShutdown(); diff --git a/src/Bundle/ChillPersonBundle/Tests/Controller/AccompanyingCourseControllerTest.php b/src/Bundle/ChillPersonBundle/Tests/Controller/AccompanyingCourseControllerTest.php index 240c3ab98..f1280143b 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Controller/AccompanyingCourseControllerTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Controller/AccompanyingCourseControllerTest.php @@ -31,11 +31,13 @@ final class AccompanyingCourseControllerTest extends WebTestCase private KernelBrowser $client; + #[\Override] protected function setUp(): void { $this->client = $this->getClientAuthenticated(); } + #[\Override] protected function tearDown(): void { self::ensureKernelShutdown(); diff --git a/src/Bundle/ChillPersonBundle/Tests/Controller/AccompanyingPeriodControllerTest.php b/src/Bundle/ChillPersonBundle/Tests/Controller/AccompanyingPeriodControllerTest.php index 9d8fa2321..7b3a98dcf 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Controller/AccompanyingPeriodControllerTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Controller/AccompanyingPeriodControllerTest.php @@ -28,11 +28,11 @@ use Symfony\Bundle\FrameworkBundle\Test\WebTestCase; */ final class AccompanyingPeriodControllerTest extends WebTestCase { - public const CLOSING_INPUT = 'chill_personbundle_accompanyingperiod[closingDate]'; + public const string CLOSING_INPUT = 'chill_personbundle_accompanyingperiod[closingDate]'; - public const CLOSING_MOTIVE_INPUT = 'chill_personbundle_accompanyingperiod[closingMotive]'; + public const string CLOSING_MOTIVE_INPUT = 'chill_personbundle_accompanyingperiod[closingMotive]'; - public const OPENING_INPUT = 'chill_personbundle_accompanyingperiod[openingDate]'; + public const string OPENING_INPUT = 'chill_personbundle_accompanyingperiod[openingDate]'; /** * @var \Symfony\Component\BrowserKit\AbstractBrowser @@ -52,6 +52,7 @@ final class AccompanyingPeriodControllerTest extends WebTestCase /** * Setup before the first test of this class (see phpunit doc). */ + #[\Override] public static function setUpBeforeClass(): void { self::bootKernel(); @@ -62,6 +63,7 @@ final class AccompanyingPeriodControllerTest extends WebTestCase /** * Setup before each test method (see phpunit doc). */ + #[\Override] protected function setUp(): void { $this->client = self::createClient([], [ @@ -85,6 +87,7 @@ final class AccompanyingPeriodControllerTest extends WebTestCase /** * TearDown after each test method (see phpunit doc). */ + #[\Override] protected function tearDown(): void { self::$em->refresh($this->person); diff --git a/src/Bundle/ChillPersonBundle/Tests/Controller/HouseholdControllerTest.php b/src/Bundle/ChillPersonBundle/Tests/Controller/HouseholdControllerTest.php index 1012480b2..9ca65a47c 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Controller/HouseholdControllerTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Controller/HouseholdControllerTest.php @@ -29,11 +29,13 @@ final class HouseholdControllerTest extends WebTestCase private ?KernelBrowser $client = null; + #[\Override] protected function setUp(): void { $this->client = $this->getClientAuthenticated(); } + #[\Override] protected function tearDown(): void { self::ensureKernelShutdown(); diff --git a/src/Bundle/ChillPersonBundle/Tests/Controller/PersonAddressControllerTest.php b/src/Bundle/ChillPersonBundle/Tests/Controller/PersonAddressControllerTest.php index b62c06489..6da61fd55 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Controller/PersonAddressControllerTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Controller/PersonAddressControllerTest.php @@ -41,6 +41,7 @@ final class PersonAddressControllerTest extends WebTestCase */ protected $postalCode; + #[\Override] public static function setUpBeforeClass(): void { self::bootKernel(); @@ -64,6 +65,7 @@ final class PersonAddressControllerTest extends WebTestCase /** * Prepare client and create a random person. */ + #[\Override] protected function setUp(): void { self::bootKernel(); diff --git a/src/Bundle/ChillPersonBundle/Tests/Controller/PersonControllerCreateTest.php b/src/Bundle/ChillPersonBundle/Tests/Controller/PersonControllerCreateTest.php index 900a08ebd..553190ceb 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Controller/PersonControllerCreateTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Controller/PersonControllerCreateTest.php @@ -28,22 +28,23 @@ final class PersonControllerCreateTest extends WebTestCase { use PrepareClientTrait; - public const BIRTHDATE_INPUT = 'chill_personbundle_person_creation[birthdate]'; + public const string BIRTHDATE_INPUT = 'chill_personbundle_person_creation[birthdate]'; - public const CENTER_INPUT = 'chill_personbundle_person_creation[center]'; + public const string CENTER_INPUT = 'chill_personbundle_person_creation[center]'; - public const CREATEDATE_INPUT = 'chill_personbundle_person_creation[creation_date]'; + public const string CREATEDATE_INPUT = 'chill_personbundle_person_creation[creation_date]'; - public const FIRSTNAME_INPUT = 'chill_personbundle_person_creation[firstName]'; + public const string FIRSTNAME_INPUT = 'chill_personbundle_person_creation[firstName]'; - public const GENDER_INPUT = 'chill_personbundle_person_creation[gender]'; + public const string GENDER_INPUT = 'chill_personbundle_person_creation[gender]'; - public const LASTNAME_INPUT = 'chill_personbundle_person_creation[lastName]'; + public const string LASTNAME_INPUT = 'chill_personbundle_person_creation[lastName]'; - public const LONG_TEXT = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer nec odio. Praesent libero. Sed cursus ante dapibus diam. Sed nisi. Nulla quis sem at nibh elementum imperdiet. Duis sagittis ipsum. Praesent mauris. Fusce nec tellus sed augue semper porta. Mauris massa. Vestibulum lacinia arcu eget nulla. Class aptent taciti sociosq. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer nec odio. Praesent libero. Sed cursus ante dapibus diam. Sed nisi. Nulla quis sem at nibh elementum imperdiet. Duis sagittis ipsum. Praesent mauris. Fusce nec tellus sed augue semper porta.Mauris massa. Vestibulum lacinia arcu eget nulla. Class aptent taciti sociosq.'; + public const string LONG_TEXT = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer nec odio. Praesent libero. Sed cursus ante dapibus diam. Sed nisi. Nulla quis sem at nibh elementum imperdiet. Duis sagittis ipsum. Praesent mauris. Fusce nec tellus sed augue semper porta. Mauris massa. Vestibulum lacinia arcu eget nulla. Class aptent taciti sociosq. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer nec odio. Praesent libero. Sed cursus ante dapibus diam. Sed nisi. Nulla quis sem at nibh elementum imperdiet. Duis sagittis ipsum. Praesent mauris. Fusce nec tellus sed augue semper porta.Mauris massa. Vestibulum lacinia arcu eget nulla. Class aptent taciti sociosq.'; private readonly KernelBrowser $client; + #[\Override] public static function tearDownAfterClass(): void { self::bootKernel(); @@ -67,6 +68,7 @@ final class PersonControllerCreateTest extends WebTestCase self::ensureKernelShutdown(); } + #[\Override] protected function tearDown(): void { self::ensureKernelShutdown(); diff --git a/src/Bundle/ChillPersonBundle/Tests/Controller/PersonControllerUpdateTest.php b/src/Bundle/ChillPersonBundle/Tests/Controller/PersonControllerUpdateTest.php index ee2373e11..6bb365a75 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Controller/PersonControllerUpdateTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Controller/PersonControllerUpdateTest.php @@ -43,13 +43,16 @@ final class PersonControllerUpdateTest extends WebTestCase /** * Prepare client and create a random person. */ + #[\Override] protected function setUp(): void {} + #[\Override] protected function tearDown(): void { self::ensureKernelShutdown(); } + #[\Override] public static function tearDownAfterClass(): void { self::bootKernel(); diff --git a/src/Bundle/ChillPersonBundle/Tests/Controller/PersonControllerUpdateWithHiddenFieldsTest.php b/src/Bundle/ChillPersonBundle/Tests/Controller/PersonControllerUpdateWithHiddenFieldsTest.php index a290e56e8..91fb7ddf6 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Controller/PersonControllerUpdateWithHiddenFieldsTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Controller/PersonControllerUpdateWithHiddenFieldsTest.php @@ -44,6 +44,7 @@ final class PersonControllerUpdateWithHiddenFieldsTest extends WebTestCase /** * Prepare client and create a random person. */ + #[\Override] protected function setUp(): void { self::bootKernel(['environment' => 'test_with_hidden_fields']); @@ -77,6 +78,7 @@ final class PersonControllerUpdateWithHiddenFieldsTest extends WebTestCase ); } + #[\Override] protected function tearDown(): void { $this->refreshPerson(); diff --git a/src/Bundle/ChillPersonBundle/Tests/Controller/PersonControllerViewTest.php b/src/Bundle/ChillPersonBundle/Tests/Controller/PersonControllerViewTest.php index 5a33f88a9..6407071a1 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Controller/PersonControllerViewTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Controller/PersonControllerViewTest.php @@ -31,11 +31,13 @@ final class PersonControllerViewTest extends WebTestCase */ private static array $toDelete = []; + #[\Override] protected function tearDown(): void { self::ensureKernelShutdown(); } + #[\Override] public static function tearDownAfterClass(): void { self::bootKernel(); diff --git a/src/Bundle/ChillPersonBundle/Tests/Controller/PersonControllerViewWithHiddenFieldsTest.php b/src/Bundle/ChillPersonBundle/Tests/Controller/PersonControllerViewWithHiddenFieldsTest.php index 6463c246b..6cdaa4e12 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Controller/PersonControllerViewWithHiddenFieldsTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Controller/PersonControllerViewWithHiddenFieldsTest.php @@ -30,6 +30,7 @@ final class PersonControllerViewWithHiddenFieldsTest extends WebTestCase */ private readonly string $viewUrl; + #[\Override] protected function setUp(): void { /* @@ -54,6 +55,7 @@ final class PersonControllerViewWithHiddenFieldsTest extends WebTestCase */ } + #[\Override] protected function tearDown(): void { /* diff --git a/src/Bundle/ChillPersonBundle/Tests/Controller/RelationshipApiControllerTest.php b/src/Bundle/ChillPersonBundle/Tests/Controller/RelationshipApiControllerTest.php index 206314939..a5f1852d3 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Controller/RelationshipApiControllerTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Controller/RelationshipApiControllerTest.php @@ -35,6 +35,7 @@ final class RelationshipApiControllerTest extends WebTestCase */ private static ?array $relations = null; + #[\Override] protected function tearDown(): void { self::ensureKernelShutdown(); diff --git a/src/Bundle/ChillPersonBundle/Tests/Controller/SocialIssueApiControllerTest.php b/src/Bundle/ChillPersonBundle/Tests/Controller/SocialIssueApiControllerTest.php index c7ca4c4bb..80afeaed2 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Controller/SocialIssueApiControllerTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Controller/SocialIssueApiControllerTest.php @@ -24,6 +24,7 @@ final class SocialIssueApiControllerTest extends WebTestCase { use PrepareClientTrait; + #[\Override] protected function tearDown(): void { self::ensureKernelShutdown(); diff --git a/src/Bundle/ChillPersonBundle/Tests/Controller/SocialWorkEvaluationApiControllerTest.php b/src/Bundle/ChillPersonBundle/Tests/Controller/SocialWorkEvaluationApiControllerTest.php index ad41af989..a33106e43 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Controller/SocialWorkEvaluationApiControllerTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Controller/SocialWorkEvaluationApiControllerTest.php @@ -30,6 +30,7 @@ final class SocialWorkEvaluationApiControllerTest extends WebTestCase private static ?Evaluation $evaluationToReset = null; + #[\Override] protected function tearDown(): void { if (null === self::$evaluationToReset) { diff --git a/src/Bundle/ChillPersonBundle/Tests/Export/Aggregator/AccompanyingCourseAggregators/AdministrativeLocationAggregatorTest.php b/src/Bundle/ChillPersonBundle/Tests/Export/Aggregator/AccompanyingCourseAggregators/AdministrativeLocationAggregatorTest.php index 94284efb6..2f0f4afbb 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Export/Aggregator/AccompanyingCourseAggregators/AdministrativeLocationAggregatorTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Export/Aggregator/AccompanyingCourseAggregators/AdministrativeLocationAggregatorTest.php @@ -25,6 +25,7 @@ final class AdministrativeLocationAggregatorTest extends AbstractAggregatorTest { private AdministrativeLocationAggregator $aggregator; + #[\Override] protected function setUp(): void { self::bootKernel(); @@ -32,11 +33,13 @@ final class AdministrativeLocationAggregatorTest extends AbstractAggregatorTest $this->aggregator = self::getContainer()->get('chill.person.export.aggregator_administrative_location'); } + #[\Override] public function getAggregator() { return $this->aggregator; } + #[\Override] public static function getFormData(): array { return [ @@ -44,6 +47,7 @@ final class AdministrativeLocationAggregatorTest extends AbstractAggregatorTest ]; } + #[\Override] public static function getQueryBuilders(): iterable { self::bootKernel(); diff --git a/src/Bundle/ChillPersonBundle/Tests/Export/Aggregator/AccompanyingCourseAggregators/ClosingDateAggregatorTest.php b/src/Bundle/ChillPersonBundle/Tests/Export/Aggregator/AccompanyingCourseAggregators/ClosingDateAggregatorTest.php index ed459fbfd..04e5c6312 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Export/Aggregator/AccompanyingCourseAggregators/ClosingDateAggregatorTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Export/Aggregator/AccompanyingCourseAggregators/ClosingDateAggregatorTest.php @@ -27,6 +27,7 @@ class ClosingDateAggregatorTest extends AbstractAggregatorTest private static EntityManagerInterface $entityManager; + #[\Override] public static function setUpBeforeClass(): void { parent::setUpBeforeClass(); @@ -36,11 +37,13 @@ class ClosingDateAggregatorTest extends AbstractAggregatorTest self::$entityManager = self::getContainer()->get(EntityManagerInterface::class); } + #[\Override] public function getAggregator() { return self::$closingDateAggregator; } + #[\Override] public static function getFormData(): array { return [ @@ -50,6 +53,7 @@ class ClosingDateAggregatorTest extends AbstractAggregatorTest ]; } + #[\Override] public static function getQueryBuilders(): iterable { self::bootKernel(); diff --git a/src/Bundle/ChillPersonBundle/Tests/Export/Aggregator/AccompanyingCourseAggregators/ClosingMotiveAggregatorTest.php b/src/Bundle/ChillPersonBundle/Tests/Export/Aggregator/AccompanyingCourseAggregators/ClosingMotiveAggregatorTest.php index 4b4978d3c..a64b12b5e 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Export/Aggregator/AccompanyingCourseAggregators/ClosingMotiveAggregatorTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Export/Aggregator/AccompanyingCourseAggregators/ClosingMotiveAggregatorTest.php @@ -25,6 +25,7 @@ final class ClosingMotiveAggregatorTest extends AbstractAggregatorTest { private ClosingMotiveAggregator $aggregator; + #[\Override] protected function setUp(): void { self::bootKernel(); @@ -32,11 +33,13 @@ final class ClosingMotiveAggregatorTest extends AbstractAggregatorTest $this->aggregator = self::getContainer()->get('chill.person.export.aggregator_closingmotive'); } + #[\Override] public function getAggregator() { return $this->aggregator; } + #[\Override] public static function getFormData(): array { return [ @@ -44,6 +47,7 @@ final class ClosingMotiveAggregatorTest extends AbstractAggregatorTest ]; } + #[\Override] public static function getQueryBuilders(): iterable { self::bootKernel(); diff --git a/src/Bundle/ChillPersonBundle/Tests/Export/Aggregator/AccompanyingCourseAggregators/ConfidentialAggregatorTest.php b/src/Bundle/ChillPersonBundle/Tests/Export/Aggregator/AccompanyingCourseAggregators/ConfidentialAggregatorTest.php index 752b6ba0b..c2c568a98 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Export/Aggregator/AccompanyingCourseAggregators/ConfidentialAggregatorTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Export/Aggregator/AccompanyingCourseAggregators/ConfidentialAggregatorTest.php @@ -25,6 +25,7 @@ final class ConfidentialAggregatorTest extends AbstractAggregatorTest { private ConfidentialAggregator $aggregator; + #[\Override] protected function setUp(): void { self::bootKernel(); @@ -32,11 +33,13 @@ final class ConfidentialAggregatorTest extends AbstractAggregatorTest $this->aggregator = self::getContainer()->get('chill.person.export.aggregator_confidential'); } + #[\Override] public function getAggregator() { return $this->aggregator; } + #[\Override] public static function getFormData(): array { return [ @@ -44,6 +47,7 @@ final class ConfidentialAggregatorTest extends AbstractAggregatorTest ]; } + #[\Override] public static function getQueryBuilders(): iterable { self::bootKernel(); diff --git a/src/Bundle/ChillPersonBundle/Tests/Export/Aggregator/AccompanyingCourseAggregators/DurationAggregatorTest.php b/src/Bundle/ChillPersonBundle/Tests/Export/Aggregator/AccompanyingCourseAggregators/DurationAggregatorTest.php index 8cb9031c6..f18fcfa8d 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Export/Aggregator/AccompanyingCourseAggregators/DurationAggregatorTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Export/Aggregator/AccompanyingCourseAggregators/DurationAggregatorTest.php @@ -25,6 +25,7 @@ final class DurationAggregatorTest extends AbstractAggregatorTest { private DurationAggregator $aggregator; + #[\Override] protected function setUp(): void { self::bootKernel(); @@ -32,11 +33,13 @@ final class DurationAggregatorTest extends AbstractAggregatorTest $this->aggregator = self::getContainer()->get('chill.person.export.aggregator_duration'); } + #[\Override] public function getAggregator() { return $this->aggregator; } + #[\Override] public static function getFormData(): array { return [ @@ -46,6 +49,7 @@ final class DurationAggregatorTest extends AbstractAggregatorTest ]; } + #[\Override] public static function getQueryBuilders(): iterable { self::bootKernel(); diff --git a/src/Bundle/ChillPersonBundle/Tests/Export/Aggregator/AccompanyingCourseAggregators/EmergencyAggregatorTest.php b/src/Bundle/ChillPersonBundle/Tests/Export/Aggregator/AccompanyingCourseAggregators/EmergencyAggregatorTest.php index e63564664..f91486185 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Export/Aggregator/AccompanyingCourseAggregators/EmergencyAggregatorTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Export/Aggregator/AccompanyingCourseAggregators/EmergencyAggregatorTest.php @@ -25,6 +25,7 @@ final class EmergencyAggregatorTest extends AbstractAggregatorTest { private EmergencyAggregator $aggregator; + #[\Override] protected function setUp(): void { self::bootKernel(); @@ -32,11 +33,13 @@ final class EmergencyAggregatorTest extends AbstractAggregatorTest $this->aggregator = self::getContainer()->get('chill.person.export.aggregator_emergency'); } + #[\Override] public function getAggregator() { return $this->aggregator; } + #[\Override] public static function getFormData(): array { return [ @@ -44,6 +47,7 @@ final class EmergencyAggregatorTest extends AbstractAggregatorTest ]; } + #[\Override] public static function getQueryBuilders(): iterable { self::bootKernel(); diff --git a/src/Bundle/ChillPersonBundle/Tests/Export/Aggregator/AccompanyingCourseAggregators/EvaluationAggregatorTest.php b/src/Bundle/ChillPersonBundle/Tests/Export/Aggregator/AccompanyingCourseAggregators/EvaluationAggregatorTest.php index 1a322a998..7cbd47f89 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Export/Aggregator/AccompanyingCourseAggregators/EvaluationAggregatorTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Export/Aggregator/AccompanyingCourseAggregators/EvaluationAggregatorTest.php @@ -25,6 +25,7 @@ final class EvaluationAggregatorTest extends AbstractAggregatorTest { private EvaluationAggregator $aggregator; + #[\Override] protected function setUp(): void { self::bootKernel(); @@ -32,11 +33,13 @@ final class EvaluationAggregatorTest extends AbstractAggregatorTest $this->aggregator = self::getContainer()->get('chill.person.export.aggregator_evaluation'); } + #[\Override] public function getAggregator() { return $this->aggregator; } + #[\Override] public static function getFormData(): array { return [ @@ -44,6 +47,7 @@ final class EvaluationAggregatorTest extends AbstractAggregatorTest ]; } + #[\Override] public static function getQueryBuilders(): iterable { self::bootKernel(); diff --git a/src/Bundle/ChillPersonBundle/Tests/Export/Aggregator/AccompanyingCourseAggregators/GeographicalUnitStatAggregatorTest.php b/src/Bundle/ChillPersonBundle/Tests/Export/Aggregator/AccompanyingCourseAggregators/GeographicalUnitStatAggregatorTest.php index 85a61ac14..1ab5617cb 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Export/Aggregator/AccompanyingCourseAggregators/GeographicalUnitStatAggregatorTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Export/Aggregator/AccompanyingCourseAggregators/GeographicalUnitStatAggregatorTest.php @@ -27,6 +27,7 @@ final class GeographicalUnitStatAggregatorTest extends AbstractAggregatorTest { private GeographicalUnitStatAggregator $aggregator; + #[\Override] protected function setUp(): void { self::bootKernel(); @@ -34,11 +35,13 @@ final class GeographicalUnitStatAggregatorTest extends AbstractAggregatorTest $this->aggregator = self::getContainer()->get('chill.person.export.aggregator_geographicalunitstat'); } + #[\Override] public function getAggregator() { return $this->aggregator; } + #[\Override] public static function getFormData(): array { self::bootKernel(); @@ -50,6 +53,7 @@ final class GeographicalUnitStatAggregatorTest extends AbstractAggregatorTest ]; } + #[\Override] public static function getQueryBuilders(): iterable { if (null === self::$kernel) { diff --git a/src/Bundle/ChillPersonBundle/Tests/Export/Aggregator/AccompanyingCourseAggregators/IntensityAggregatorTest.php b/src/Bundle/ChillPersonBundle/Tests/Export/Aggregator/AccompanyingCourseAggregators/IntensityAggregatorTest.php index 483f9a330..e74b6202c 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Export/Aggregator/AccompanyingCourseAggregators/IntensityAggregatorTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Export/Aggregator/AccompanyingCourseAggregators/IntensityAggregatorTest.php @@ -25,6 +25,7 @@ final class IntensityAggregatorTest extends AbstractAggregatorTest { private IntensityAggregator $aggregator; + #[\Override] protected function setUp(): void { self::bootKernel(); @@ -32,11 +33,13 @@ final class IntensityAggregatorTest extends AbstractAggregatorTest $this->aggregator = self::getContainer()->get('chill.person.export.aggregator_intensity'); } + #[\Override] public function getAggregator() { return $this->aggregator; } + #[\Override] public static function getFormData(): array { return [ @@ -44,6 +47,7 @@ final class IntensityAggregatorTest extends AbstractAggregatorTest ]; } + #[\Override] public static function getQueryBuilders(): iterable { self::bootKernel(); diff --git a/src/Bundle/ChillPersonBundle/Tests/Export/Aggregator/AccompanyingCourseAggregators/OpeningDateAggregatorTest.php b/src/Bundle/ChillPersonBundle/Tests/Export/Aggregator/AccompanyingCourseAggregators/OpeningDateAggregatorTest.php index 48e937106..54615ee72 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Export/Aggregator/AccompanyingCourseAggregators/OpeningDateAggregatorTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Export/Aggregator/AccompanyingCourseAggregators/OpeningDateAggregatorTest.php @@ -27,6 +27,7 @@ class OpeningDateAggregatorTest extends AbstractAggregatorTest private static EntityManagerInterface $entityManager; + #[\Override] public static function setUpBeforeClass(): void { parent::setUpBeforeClass(); @@ -36,11 +37,13 @@ class OpeningDateAggregatorTest extends AbstractAggregatorTest self::$entityManager = self::getContainer()->get(EntityManagerInterface::class); } + #[\Override] public function getAggregator() { return self::$openingDateAggregator; } + #[\Override] public static function getFormData(): array { return [['frequency' => 'YYYY'], @@ -48,6 +51,7 @@ class OpeningDateAggregatorTest extends AbstractAggregatorTest ['frequency' => 'YYYY-IV']]; } + #[\Override] public static function getQueryBuilders(): iterable { self::bootKernel(); diff --git a/src/Bundle/ChillPersonBundle/Tests/Export/Aggregator/AccompanyingCourseAggregators/OriginAggregatorTest.php b/src/Bundle/ChillPersonBundle/Tests/Export/Aggregator/AccompanyingCourseAggregators/OriginAggregatorTest.php index ab8e4b4bb..56bb6253a 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Export/Aggregator/AccompanyingCourseAggregators/OriginAggregatorTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Export/Aggregator/AccompanyingCourseAggregators/OriginAggregatorTest.php @@ -25,6 +25,7 @@ final class OriginAggregatorTest extends AbstractAggregatorTest { private OriginAggregator $aggregator; + #[\Override] protected function setUp(): void { self::bootKernel(); @@ -32,11 +33,13 @@ final class OriginAggregatorTest extends AbstractAggregatorTest $this->aggregator = self::getContainer()->get('chill.person.export.aggregator_origin'); } + #[\Override] public function getAggregator() { return $this->aggregator; } + #[\Override] public static function getFormData(): array { return [ @@ -44,6 +47,7 @@ final class OriginAggregatorTest extends AbstractAggregatorTest ]; } + #[\Override] public static function getQueryBuilders(): iterable { self::bootKernel(); diff --git a/src/Bundle/ChillPersonBundle/Tests/Export/Aggregator/AccompanyingCourseAggregators/PersonParticipatingAggregatorTest.php b/src/Bundle/ChillPersonBundle/Tests/Export/Aggregator/AccompanyingCourseAggregators/PersonParticipatingAggregatorTest.php index 813575749..0d777ce8a 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Export/Aggregator/AccompanyingCourseAggregators/PersonParticipatingAggregatorTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Export/Aggregator/AccompanyingCourseAggregators/PersonParticipatingAggregatorTest.php @@ -26,22 +26,26 @@ final class PersonParticipatingAggregatorTest extends AbstractAggregatorTest { private LabelPersonHelper $labelPersonHelper; + #[\Override] protected function setUp(): void { self::bootKernel(); $this->labelPersonHelper = self::getContainer()->get(LabelPersonHelper::class); } + #[\Override] public function getAggregator() { return new PersonParticipatingAggregator($this->labelPersonHelper); } + #[\Override] public static function getFormData(): array { return [[]]; } + #[\Override] public static function getQueryBuilders(): iterable { self::bootKernel(); diff --git a/src/Bundle/ChillPersonBundle/Tests/Export/Aggregator/AccompanyingCourseAggregators/ReferrerAggregatorTest.php b/src/Bundle/ChillPersonBundle/Tests/Export/Aggregator/AccompanyingCourseAggregators/ReferrerAggregatorTest.php index d89e0ea2a..818f327f5 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Export/Aggregator/AccompanyingCourseAggregators/ReferrerAggregatorTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Export/Aggregator/AccompanyingCourseAggregators/ReferrerAggregatorTest.php @@ -26,6 +26,7 @@ final class ReferrerAggregatorTest extends AbstractAggregatorTest { private ReferrerAggregator $aggregator; + #[\Override] protected function setUp(): void { self::bootKernel(); @@ -66,11 +67,13 @@ final class ReferrerAggregatorTest extends AbstractAggregatorTest ]; } + #[\Override] public function getAggregator(): ReferrerAggregator { return $this->aggregator; } + #[\Override] public static function getFormData(): array { return [ @@ -81,6 +84,7 @@ final class ReferrerAggregatorTest extends AbstractAggregatorTest ]; } + #[\Override] public static function getQueryBuilders(): iterable { self::bootKernel(); diff --git a/src/Bundle/ChillPersonBundle/Tests/Export/Aggregator/AccompanyingCourseAggregators/ReferrerScopeAggregatorTest.php b/src/Bundle/ChillPersonBundle/Tests/Export/Aggregator/AccompanyingCourseAggregators/ReferrerScopeAggregatorTest.php index 738769b7b..31d786607 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Export/Aggregator/AccompanyingCourseAggregators/ReferrerScopeAggregatorTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Export/Aggregator/AccompanyingCourseAggregators/ReferrerScopeAggregatorTest.php @@ -33,6 +33,7 @@ final class ReferrerScopeAggregatorTest extends AbstractAggregatorTest { use ProphecyTrait; + #[\Override] public function getAggregator() { $translatableStringHelper = $this->prophesize(TranslatableStringHelperInterface::class); @@ -53,6 +54,7 @@ final class ReferrerScopeAggregatorTest extends AbstractAggregatorTest ); } + #[\Override] public static function getFormData(): array { return [ @@ -92,6 +94,7 @@ final class ReferrerScopeAggregatorTest extends AbstractAggregatorTest ]; } + #[\Override] public static function getQueryBuilders(): iterable { self::bootKernel(); diff --git a/src/Bundle/ChillPersonBundle/Tests/Export/Aggregator/AccompanyingCourseAggregators/RequestorAggregatorTest.php b/src/Bundle/ChillPersonBundle/Tests/Export/Aggregator/AccompanyingCourseAggregators/RequestorAggregatorTest.php index 785809c38..e6cebae1a 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Export/Aggregator/AccompanyingCourseAggregators/RequestorAggregatorTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Export/Aggregator/AccompanyingCourseAggregators/RequestorAggregatorTest.php @@ -25,6 +25,7 @@ final class RequestorAggregatorTest extends AbstractAggregatorTest { private RequestorAggregator $aggregator; + #[\Override] protected function setUp(): void { self::bootKernel(); @@ -32,11 +33,13 @@ final class RequestorAggregatorTest extends AbstractAggregatorTest $this->aggregator = self::getContainer()->get('chill.person.export.aggregator_requestor'); } + #[\Override] public function getAggregator() { return $this->aggregator; } + #[\Override] public static function getFormData(): array { return [ @@ -44,6 +47,7 @@ final class RequestorAggregatorTest extends AbstractAggregatorTest ]; } + #[\Override] public static function getQueryBuilders(): iterable { self::bootKernel(); diff --git a/src/Bundle/ChillPersonBundle/Tests/Export/Aggregator/AccompanyingCourseAggregators/ScopeAggregatorTest.php b/src/Bundle/ChillPersonBundle/Tests/Export/Aggregator/AccompanyingCourseAggregators/ScopeAggregatorTest.php index 939966c78..c22f41e1c 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Export/Aggregator/AccompanyingCourseAggregators/ScopeAggregatorTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Export/Aggregator/AccompanyingCourseAggregators/ScopeAggregatorTest.php @@ -25,6 +25,7 @@ final class ScopeAggregatorTest extends AbstractAggregatorTest { private ScopeAggregator $aggregator; + #[\Override] protected function setUp(): void { self::bootKernel(); @@ -32,11 +33,13 @@ final class ScopeAggregatorTest extends AbstractAggregatorTest $this->aggregator = self::getContainer()->get('chill.person.export.aggregator_referrer_scope'); } + #[\Override] public function getAggregator() { return $this->aggregator; } + #[\Override] public static function getFormData(): array { return [ @@ -44,6 +47,7 @@ final class ScopeAggregatorTest extends AbstractAggregatorTest ]; } + #[\Override] public static function getQueryBuilders(): iterable { self::bootKernel(); diff --git a/src/Bundle/ChillPersonBundle/Tests/Export/Aggregator/AccompanyingCourseAggregators/SocialActionAggregatorTest.php b/src/Bundle/ChillPersonBundle/Tests/Export/Aggregator/AccompanyingCourseAggregators/SocialActionAggregatorTest.php index f76452fd8..01da09617 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Export/Aggregator/AccompanyingCourseAggregators/SocialActionAggregatorTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Export/Aggregator/AccompanyingCourseAggregators/SocialActionAggregatorTest.php @@ -25,6 +25,7 @@ final class SocialActionAggregatorTest extends AbstractAggregatorTest { private SocialActionAggregator $aggregator; + #[\Override] protected function setUp(): void { self::bootKernel(); @@ -32,11 +33,13 @@ final class SocialActionAggregatorTest extends AbstractAggregatorTest $this->aggregator = self::getContainer()->get('chill.person.export.aggregator_socialaction'); } + #[\Override] public function getAggregator() { return $this->aggregator; } + #[\Override] public static function getFormData(): array { return [ @@ -44,6 +47,7 @@ final class SocialActionAggregatorTest extends AbstractAggregatorTest ]; } + #[\Override] public static function getQueryBuilders(): iterable { self::bootKernel(); diff --git a/src/Bundle/ChillPersonBundle/Tests/Export/Aggregator/AccompanyingCourseAggregators/SocialIssueAggregatorTest.php b/src/Bundle/ChillPersonBundle/Tests/Export/Aggregator/AccompanyingCourseAggregators/SocialIssueAggregatorTest.php index bad9cec20..9c10c5d22 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Export/Aggregator/AccompanyingCourseAggregators/SocialIssueAggregatorTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Export/Aggregator/AccompanyingCourseAggregators/SocialIssueAggregatorTest.php @@ -25,6 +25,7 @@ final class SocialIssueAggregatorTest extends AbstractAggregatorTest { private SocialIssueAggregator $aggregator; + #[\Override] protected function setUp(): void { self::bootKernel(); @@ -32,11 +33,13 @@ final class SocialIssueAggregatorTest extends AbstractAggregatorTest $this->aggregator = self::getContainer()->get('chill.person.export.aggregator_socialissue'); } + #[\Override] public function getAggregator() { return $this->aggregator; } + #[\Override] public static function getFormData(): array { return [ @@ -44,6 +47,7 @@ final class SocialIssueAggregatorTest extends AbstractAggregatorTest ]; } + #[\Override] public static function getQueryBuilders(): iterable { self::bootKernel(); diff --git a/src/Bundle/ChillPersonBundle/Tests/Export/Aggregator/AccompanyingCourseAggregators/StepAggregatorTest.php b/src/Bundle/ChillPersonBundle/Tests/Export/Aggregator/AccompanyingCourseAggregators/StepAggregatorTest.php index f4a34e271..a222bc530 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Export/Aggregator/AccompanyingCourseAggregators/StepAggregatorTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Export/Aggregator/AccompanyingCourseAggregators/StepAggregatorTest.php @@ -26,6 +26,7 @@ final class StepAggregatorTest extends AbstractAggregatorTest { private StepAggregator $aggregator; + #[\Override] protected function setUp(): void { self::bootKernel(); @@ -33,11 +34,13 @@ final class StepAggregatorTest extends AbstractAggregatorTest $this->aggregator = self::getContainer()->get('chill.person.export.aggregator_step'); } + #[\Override] public function getAggregator() { return $this->aggregator; } + #[\Override] public static function getFormData(): array { return [ @@ -47,6 +50,7 @@ final class StepAggregatorTest extends AbstractAggregatorTest ]; } + #[\Override] public static function getQueryBuilders(): iterable { self::bootKernel(); diff --git a/src/Bundle/ChillPersonBundle/Tests/Export/Aggregator/AccompanyingCourseAggregators/UserJobAggregatorTest.php b/src/Bundle/ChillPersonBundle/Tests/Export/Aggregator/AccompanyingCourseAggregators/UserJobAggregatorTest.php index 37100110a..857fa7188 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Export/Aggregator/AccompanyingCourseAggregators/UserJobAggregatorTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Export/Aggregator/AccompanyingCourseAggregators/UserJobAggregatorTest.php @@ -26,6 +26,7 @@ final class UserJobAggregatorTest extends AbstractAggregatorTest { private UserJobAggregator $aggregator; + #[\Override] protected function setUp(): void { self::bootKernel(); @@ -65,11 +66,13 @@ final class UserJobAggregatorTest extends AbstractAggregatorTest ]; } + #[\Override] public function getAggregator(): UserJobAggregator { return $this->aggregator; } + #[\Override] public static function getFormData(): array { return [ @@ -77,6 +80,7 @@ final class UserJobAggregatorTest extends AbstractAggregatorTest ]; } + #[\Override] public static function getQueryBuilders(): iterable { self::bootKernel(); diff --git a/src/Bundle/ChillPersonBundle/Tests/Export/Aggregator/AccompanyingPeriodStepHistoryAggregators/ByClosingMotiveAggregatorTest.php b/src/Bundle/ChillPersonBundle/Tests/Export/Aggregator/AccompanyingPeriodStepHistoryAggregators/ByClosingMotiveAggregatorTest.php index c816799b8..94770fcd3 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Export/Aggregator/AccompanyingPeriodStepHistoryAggregators/ByClosingMotiveAggregatorTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Export/Aggregator/AccompanyingPeriodStepHistoryAggregators/ByClosingMotiveAggregatorTest.php @@ -28,6 +28,7 @@ class ByClosingMotiveAggregatorTest extends AbstractAggregatorTest private ClosingMotiveRender $closingMotiveRender; private ClosingMotiveRepositoryInterface $closingMotiveRepository; + #[\Override] protected function setUp(): void { parent::setUp(); @@ -36,6 +37,7 @@ class ByClosingMotiveAggregatorTest extends AbstractAggregatorTest $this->closingMotiveRepository = self::getContainer()->get(ClosingMotiveRepositoryInterface::class); } + #[\Override] public function getAggregator() { return new ByClosingMotiveAggregator( @@ -44,6 +46,7 @@ class ByClosingMotiveAggregatorTest extends AbstractAggregatorTest ); } + #[\Override] public static function getFormData(): array { return [ @@ -51,6 +54,7 @@ class ByClosingMotiveAggregatorTest extends AbstractAggregatorTest ]; } + #[\Override] public static function getQueryBuilders(): iterable { self::bootKernel(); diff --git a/src/Bundle/ChillPersonBundle/Tests/Export/Aggregator/AccompanyingPeriodStepHistoryAggregators/ByDateAggregatorTest.php b/src/Bundle/ChillPersonBundle/Tests/Export/Aggregator/AccompanyingPeriodStepHistoryAggregators/ByDateAggregatorTest.php index 1fee0d997..acb3ac67e 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Export/Aggregator/AccompanyingPeriodStepHistoryAggregators/ByDateAggregatorTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Export/Aggregator/AccompanyingPeriodStepHistoryAggregators/ByDateAggregatorTest.php @@ -24,11 +24,13 @@ use Chill\PersonBundle\Export\Aggregator\AccompanyingPeriodStepHistoryAggregator */ class ByDateAggregatorTest extends AbstractAggregatorTest { + #[\Override] public function getAggregator() { return new ByDateAggregator(); } + #[\Override] public static function getFormData(): array { return [ @@ -44,6 +46,7 @@ class ByDateAggregatorTest extends AbstractAggregatorTest ]; } + #[\Override] public static function getQueryBuilders(): iterable { self::bootKernel(); diff --git a/src/Bundle/ChillPersonBundle/Tests/Export/Aggregator/AccompanyingPeriodStepHistoryAggregators/ByStepAggregatorTest.php b/src/Bundle/ChillPersonBundle/Tests/Export/Aggregator/AccompanyingPeriodStepHistoryAggregators/ByStepAggregatorTest.php index 58e3e5f61..6ccb345a9 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Export/Aggregator/AccompanyingPeriodStepHistoryAggregators/ByStepAggregatorTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Export/Aggregator/AccompanyingPeriodStepHistoryAggregators/ByStepAggregatorTest.php @@ -24,6 +24,7 @@ use Symfony\Contracts\Translation\TranslatorInterface; */ class ByStepAggregatorTest extends AbstractAggregatorTest { + #[\Override] public function getAggregator() { $translator = new class () implements TranslatorInterface { @@ -36,11 +37,13 @@ class ByStepAggregatorTest extends AbstractAggregatorTest return new ByStepAggregator($translator); } + #[\Override] public static function getFormData(): array { return [[]]; } + #[\Override] public static function getQueryBuilders(): iterable { self::bootKernel(); diff --git a/src/Bundle/ChillPersonBundle/Tests/Export/Aggregator/EvaluationAggregators/EvaluationTypeAggregatorTest.php b/src/Bundle/ChillPersonBundle/Tests/Export/Aggregator/EvaluationAggregators/EvaluationTypeAggregatorTest.php index b275be336..acdb46127 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Export/Aggregator/EvaluationAggregators/EvaluationTypeAggregatorTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Export/Aggregator/EvaluationAggregators/EvaluationTypeAggregatorTest.php @@ -25,6 +25,7 @@ final class EvaluationTypeAggregatorTest extends AbstractAggregatorTest { private EvaluationTypeAggregator $aggregator; + #[\Override] protected function setUp(): void { self::bootKernel(); @@ -32,11 +33,13 @@ final class EvaluationTypeAggregatorTest extends AbstractAggregatorTest $this->aggregator = self::getContainer()->get('chill.person.export.aggregator_evaluationtype'); } + #[\Override] public function getAggregator() { return $this->aggregator; } + #[\Override] public static function getFormData(): array { return [ @@ -44,6 +47,7 @@ final class EvaluationTypeAggregatorTest extends AbstractAggregatorTest ]; } + #[\Override] public static function getQueryBuilders(): iterable { self::bootKernel(); diff --git a/src/Bundle/ChillPersonBundle/Tests/Export/Aggregator/HouseholdAggregators/ChildrenNumberAggregatorTest.php b/src/Bundle/ChillPersonBundle/Tests/Export/Aggregator/HouseholdAggregators/ChildrenNumberAggregatorTest.php index 50b3f5b1f..3194f1571 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Export/Aggregator/HouseholdAggregators/ChildrenNumberAggregatorTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Export/Aggregator/HouseholdAggregators/ChildrenNumberAggregatorTest.php @@ -26,6 +26,7 @@ final class ChildrenNumberAggregatorTest extends AbstractAggregatorTest { private ChildrenNumberAggregator $aggregator; + #[\Override] protected function setUp(): void { self::bootKernel(); @@ -33,11 +34,13 @@ final class ChildrenNumberAggregatorTest extends AbstractAggregatorTest $this->aggregator = self::getContainer()->get('chill.person.export.aggregator_household_childrennumber'); } + #[\Override] public function getAggregator() { return $this->aggregator; } + #[\Override] public static function getFormData(): array { return [ @@ -47,6 +50,7 @@ final class ChildrenNumberAggregatorTest extends AbstractAggregatorTest ]; } + #[\Override] public static function getQueryBuilders(): iterable { self::bootKernel(); diff --git a/src/Bundle/ChillPersonBundle/Tests/Export/Aggregator/HouseholdAggregators/CompositionAggregatorTest.php b/src/Bundle/ChillPersonBundle/Tests/Export/Aggregator/HouseholdAggregators/CompositionAggregatorTest.php index 2bfbb83a6..607e6389c 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Export/Aggregator/HouseholdAggregators/CompositionAggregatorTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Export/Aggregator/HouseholdAggregators/CompositionAggregatorTest.php @@ -26,6 +26,7 @@ final class CompositionAggregatorTest extends AbstractAggregatorTest { private CompositionAggregator $aggregator; + #[\Override] protected function setUp(): void { self::bootKernel(); @@ -33,11 +34,13 @@ final class CompositionAggregatorTest extends AbstractAggregatorTest $this->aggregator = self::getContainer()->get('chill.person.export.aggregator_household_composition'); } + #[\Override] public function getAggregator() { return $this->aggregator; } + #[\Override] public static function getFormData(): array { return [ @@ -47,6 +50,7 @@ final class CompositionAggregatorTest extends AbstractAggregatorTest ]; } + #[\Override] public static function getQueryBuilders(): iterable { self::bootKernel(); diff --git a/src/Bundle/ChillPersonBundle/Tests/Export/Aggregator/PersonAggregators/AgeAggregatorTest.php b/src/Bundle/ChillPersonBundle/Tests/Export/Aggregator/PersonAggregators/AgeAggregatorTest.php index 39240dc83..b1637dd54 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Export/Aggregator/PersonAggregators/AgeAggregatorTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Export/Aggregator/PersonAggregators/AgeAggregatorTest.php @@ -26,6 +26,7 @@ final class AgeAggregatorTest extends AbstractAggregatorTest { private AgeAggregator $aggregator; + #[\Override] protected function setUp(): void { self::bootKernel(); @@ -33,11 +34,13 @@ final class AgeAggregatorTest extends AbstractAggregatorTest $this->aggregator = self::getContainer()->get('chill.person.export.aggregator_age'); } + #[\Override] public function getAggregator() { return $this->aggregator; } + #[\Override] public static function getFormData(): array { return [ @@ -47,6 +50,7 @@ final class AgeAggregatorTest extends AbstractAggregatorTest ]; } + #[\Override] public static function getQueryBuilders(): iterable { self::bootKernel(); diff --git a/src/Bundle/ChillPersonBundle/Tests/Export/Aggregator/PersonAggregators/CountryOfBirthAggregatorTest.php b/src/Bundle/ChillPersonBundle/Tests/Export/Aggregator/PersonAggregators/CountryOfBirthAggregatorTest.php index 499484587..da5e9cfa3 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Export/Aggregator/PersonAggregators/CountryOfBirthAggregatorTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Export/Aggregator/PersonAggregators/CountryOfBirthAggregatorTest.php @@ -25,6 +25,7 @@ final class CountryOfBirthAggregatorTest extends AbstractAggregatorTest { private CountryOfBirthAggregator $aggregator; + #[\Override] protected function setUp(): void { self::bootKernel(); @@ -32,11 +33,13 @@ final class CountryOfBirthAggregatorTest extends AbstractAggregatorTest $this->aggregator = self::getContainer()->get('chill.person.export.aggregator_country_of_birth'); } + #[\Override] public function getAggregator() { return $this->aggregator; } + #[\Override] public static function getFormData(): array { return [ @@ -45,6 +48,7 @@ final class CountryOfBirthAggregatorTest extends AbstractAggregatorTest ]; } + #[\Override] public static function getQueryBuilders(): iterable { self::bootKernel(); diff --git a/src/Bundle/ChillPersonBundle/Tests/Export/Aggregator/PersonAggregators/GenderAggregatorTest.php b/src/Bundle/ChillPersonBundle/Tests/Export/Aggregator/PersonAggregators/GenderAggregatorTest.php index 7b6978279..8743915e3 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Export/Aggregator/PersonAggregators/GenderAggregatorTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Export/Aggregator/PersonAggregators/GenderAggregatorTest.php @@ -25,6 +25,7 @@ final class GenderAggregatorTest extends AbstractAggregatorTest { private GenderAggregator $aggregator; + #[\Override] protected function setUp(): void { self::bootKernel(); @@ -32,11 +33,13 @@ final class GenderAggregatorTest extends AbstractAggregatorTest $this->aggregator = self::getContainer()->get('chill.person.export.aggregator_gender'); } + #[\Override] public function getAggregator() { return $this->aggregator; } + #[\Override] public static function getFormData(): array { return [ @@ -44,6 +47,7 @@ final class GenderAggregatorTest extends AbstractAggregatorTest ]; } + #[\Override] public static function getQueryBuilders(): iterable { self::bootKernel(); diff --git a/src/Bundle/ChillPersonBundle/Tests/Export/Aggregator/PersonAggregators/HouseholdPositionAggregatorTest.php b/src/Bundle/ChillPersonBundle/Tests/Export/Aggregator/PersonAggregators/HouseholdPositionAggregatorTest.php index 951932126..f17a88b52 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Export/Aggregator/PersonAggregators/HouseholdPositionAggregatorTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Export/Aggregator/PersonAggregators/HouseholdPositionAggregatorTest.php @@ -28,6 +28,7 @@ final class HouseholdPositionAggregatorTest extends AbstractAggregatorTest { private HouseholdPositionAggregator $aggregator; + #[\Override] protected function setUp(): void { self::bootKernel(); @@ -35,11 +36,13 @@ final class HouseholdPositionAggregatorTest extends AbstractAggregatorTest $this->aggregator = self::getContainer()->get('chill.person.export.aggregator_household_position'); } + #[\Override] public function getAggregator() { return $this->aggregator; } + #[\Override] public static function getFormData(): array { return [ @@ -49,6 +52,7 @@ final class HouseholdPositionAggregatorTest extends AbstractAggregatorTest ]; } + #[\Override] public static function getQueryBuilders(): iterable { self::bootKernel(); diff --git a/src/Bundle/ChillPersonBundle/Tests/Export/Aggregator/PersonAggregators/MaritalStatusAggregatorTest.php b/src/Bundle/ChillPersonBundle/Tests/Export/Aggregator/PersonAggregators/MaritalStatusAggregatorTest.php index 6c19379d2..389fc19c1 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Export/Aggregator/PersonAggregators/MaritalStatusAggregatorTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Export/Aggregator/PersonAggregators/MaritalStatusAggregatorTest.php @@ -25,6 +25,7 @@ final class MaritalStatusAggregatorTest extends AbstractAggregatorTest { private MaritalStatusAggregator $aggregator; + #[\Override] protected function setUp(): void { self::bootKernel(); @@ -32,11 +33,13 @@ final class MaritalStatusAggregatorTest extends AbstractAggregatorTest $this->aggregator = self::getContainer()->get('chill.person.export.aggregator_marital_status'); } + #[\Override] public function getAggregator() { return $this->aggregator; } + #[\Override] public static function getFormData(): array { return [ @@ -44,6 +47,7 @@ final class MaritalStatusAggregatorTest extends AbstractAggregatorTest ]; } + #[\Override] public static function getQueryBuilders(): iterable { self::bootKernel(); diff --git a/src/Bundle/ChillPersonBundle/Tests/Export/Aggregator/PersonAggregators/NationalityAggregatorTest.php b/src/Bundle/ChillPersonBundle/Tests/Export/Aggregator/PersonAggregators/NationalityAggregatorTest.php index 73a060f9c..3b241912a 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Export/Aggregator/PersonAggregators/NationalityAggregatorTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Export/Aggregator/PersonAggregators/NationalityAggregatorTest.php @@ -25,6 +25,7 @@ final class NationalityAggregatorTest extends AbstractAggregatorTest { private NationalityAggregator $aggregator; + #[\Override] protected function setUp(): void { self::bootKernel(); @@ -32,11 +33,13 @@ final class NationalityAggregatorTest extends AbstractAggregatorTest $this->aggregator = self::getContainer()->get('chill.person.export.aggregator_nationality'); } + #[\Override] public function getAggregator() { return $this->aggregator; } + #[\Override] public static function getFormData(): array { return [ @@ -45,6 +48,7 @@ final class NationalityAggregatorTest extends AbstractAggregatorTest ]; } + #[\Override] public static function getQueryBuilders(): iterable { self::bootKernel(); diff --git a/src/Bundle/ChillPersonBundle/Tests/Export/Aggregator/PersonAggregators/PostalCodeAggregatorTest.php b/src/Bundle/ChillPersonBundle/Tests/Export/Aggregator/PersonAggregators/PostalCodeAggregatorTest.php index 98e7f1ba7..a66f1c753 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Export/Aggregator/PersonAggregators/PostalCodeAggregatorTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Export/Aggregator/PersonAggregators/PostalCodeAggregatorTest.php @@ -27,17 +27,20 @@ class PostalCodeAggregatorTest extends AbstractAggregatorTest { private RollingDateConverterInterface $rollingDateConverter; + #[\Override] protected function setUp(): void { self::bootKernel(); $this->rollingDateConverter = self::getContainer()->get(RollingDateConverterInterface::class); } + #[\Override] public function getAggregator() { return new PostalCodeAggregator($this->rollingDateConverter); } + #[\Override] public static function getFormData(): array { return [ @@ -45,6 +48,7 @@ class PostalCodeAggregatorTest extends AbstractAggregatorTest ]; } + #[\Override] public static function getQueryBuilders(): iterable { self::bootKernel(); diff --git a/src/Bundle/ChillPersonBundle/Tests/Export/Aggregator/SocialWorkAggregators/ActionTypeAggregatorTest.php b/src/Bundle/ChillPersonBundle/Tests/Export/Aggregator/SocialWorkAggregators/ActionTypeAggregatorTest.php index c3841fd1e..dd2b29ea9 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Export/Aggregator/SocialWorkAggregators/ActionTypeAggregatorTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Export/Aggregator/SocialWorkAggregators/ActionTypeAggregatorTest.php @@ -25,6 +25,7 @@ final class ActionTypeAggregatorTest extends AbstractAggregatorTest { private ActionTypeAggregator $aggregator; + #[\Override] protected function setUp(): void { self::bootKernel(); @@ -32,11 +33,13 @@ final class ActionTypeAggregatorTest extends AbstractAggregatorTest $this->aggregator = self::getContainer()->get('chill.person.export.aggregator_action_type'); } + #[\Override] public function getAggregator() { return $this->aggregator; } + #[\Override] public static function getFormData(): array { return [ @@ -44,6 +47,7 @@ final class ActionTypeAggregatorTest extends AbstractAggregatorTest ]; } + #[\Override] public static function getQueryBuilders(): iterable { self::bootKernel(); diff --git a/src/Bundle/ChillPersonBundle/Tests/Export/Aggregator/SocialWorkAggregators/CreatorAggregatorTest.php b/src/Bundle/ChillPersonBundle/Tests/Export/Aggregator/SocialWorkAggregators/CreatorAggregatorTest.php index 7238000df..3940281b4 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Export/Aggregator/SocialWorkAggregators/CreatorAggregatorTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Export/Aggregator/SocialWorkAggregators/CreatorAggregatorTest.php @@ -25,6 +25,7 @@ class CreatorAggregatorTest extends AbstractAggregatorTest { private CreatorAggregator $aggregator; + #[\Override] protected function setUp(): void { self::bootKernel(); @@ -32,11 +33,13 @@ class CreatorAggregatorTest extends AbstractAggregatorTest $this->aggregator = self::getContainer()->get(CreatorAggregator::class); } + #[\Override] public function getAggregator() { return $this->aggregator; } + #[\Override] public static function getFormData(): array { return [ @@ -44,6 +47,7 @@ class CreatorAggregatorTest extends AbstractAggregatorTest ]; } + #[\Override] public static function getQueryBuilders(): iterable { self::bootKernel(); diff --git a/src/Bundle/ChillPersonBundle/Tests/Export/Aggregator/SocialWorkAggregators/CreatorJobAggregatorTest.php b/src/Bundle/ChillPersonBundle/Tests/Export/Aggregator/SocialWorkAggregators/CreatorJobAggregatorTest.php index 3bff92a58..54186f0e4 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Export/Aggregator/SocialWorkAggregators/CreatorJobAggregatorTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Export/Aggregator/SocialWorkAggregators/CreatorJobAggregatorTest.php @@ -25,6 +25,7 @@ class CreatorJobAggregatorTest extends AbstractAggregatorTest { private CreatorJobAggregator $aggregator; + #[\Override] protected function setUp(): void { self::bootKernel(); @@ -32,11 +33,13 @@ class CreatorJobAggregatorTest extends AbstractAggregatorTest $this->aggregator = self::getContainer()->get(CreatorJobAggregator::class); } + #[\Override] public function getAggregator() { return $this->aggregator; } + #[\Override] public static function getFormData(): array { return [ @@ -44,6 +47,7 @@ class CreatorJobAggregatorTest extends AbstractAggregatorTest ]; } + #[\Override] public static function getQueryBuilders(): iterable { self::bootKernel(); diff --git a/src/Bundle/ChillPersonBundle/Tests/Export/Aggregator/SocialWorkAggregators/CreatorScopeAggregatorTest.php b/src/Bundle/ChillPersonBundle/Tests/Export/Aggregator/SocialWorkAggregators/CreatorScopeAggregatorTest.php index 26b1298c5..6b01eb1fc 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Export/Aggregator/SocialWorkAggregators/CreatorScopeAggregatorTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Export/Aggregator/SocialWorkAggregators/CreatorScopeAggregatorTest.php @@ -25,6 +25,7 @@ class CreatorScopeAggregatorTest extends AbstractAggregatorTest { private CreatorScopeAggregator $aggregator; + #[\Override] protected function setUp(): void { self::bootKernel(); @@ -32,11 +33,13 @@ class CreatorScopeAggregatorTest extends AbstractAggregatorTest $this->aggregator = self::getContainer()->get(CreatorScopeAggregator::class); } + #[\Override] public function getAggregator() { return $this->aggregator; } + #[\Override] public static function getFormData(): array { return [ @@ -44,6 +47,7 @@ class CreatorScopeAggregatorTest extends AbstractAggregatorTest ]; } + #[\Override] public static function getQueryBuilders(): iterable { self::bootKernel(); diff --git a/src/Bundle/ChillPersonBundle/Tests/Export/Aggregator/SocialWorkAggregators/GoalAggregatorTest.php b/src/Bundle/ChillPersonBundle/Tests/Export/Aggregator/SocialWorkAggregators/GoalAggregatorTest.php index df3307b86..8fc7b6a61 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Export/Aggregator/SocialWorkAggregators/GoalAggregatorTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Export/Aggregator/SocialWorkAggregators/GoalAggregatorTest.php @@ -25,6 +25,7 @@ final class GoalAggregatorTest extends AbstractAggregatorTest { private GoalAggregator $aggregator; + #[\Override] protected function setUp(): void { self::bootKernel(); @@ -32,11 +33,13 @@ final class GoalAggregatorTest extends AbstractAggregatorTest $this->aggregator = self::getContainer()->get('chill.person.export.aggregator_goal'); } + #[\Override] public function getAggregator() { return $this->aggregator; } + #[\Override] public static function getFormData(): array { return [ @@ -44,6 +47,7 @@ final class GoalAggregatorTest extends AbstractAggregatorTest ]; } + #[\Override] public static function getQueryBuilders(): iterable { self::bootKernel(); diff --git a/src/Bundle/ChillPersonBundle/Tests/Export/Aggregator/SocialWorkAggregators/GoalResultAggregatorTest.php b/src/Bundle/ChillPersonBundle/Tests/Export/Aggregator/SocialWorkAggregators/GoalResultAggregatorTest.php index 0098d9b9c..35ac0da20 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Export/Aggregator/SocialWorkAggregators/GoalResultAggregatorTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Export/Aggregator/SocialWorkAggregators/GoalResultAggregatorTest.php @@ -25,6 +25,7 @@ final class GoalResultAggregatorTest extends AbstractAggregatorTest { private GoalResultAggregator $aggregator; + #[\Override] protected function setUp(): void { self::bootKernel(); @@ -32,11 +33,13 @@ final class GoalResultAggregatorTest extends AbstractAggregatorTest $this->aggregator = self::getContainer()->get('chill.person.export.aggregator_goalresult'); } + #[\Override] public function getAggregator() { return $this->aggregator; } + #[\Override] public static function getFormData(): array { return [ @@ -44,6 +47,7 @@ final class GoalResultAggregatorTest extends AbstractAggregatorTest ]; } + #[\Override] public static function getQueryBuilders(): iterable { self::bootKernel(); diff --git a/src/Bundle/ChillPersonBundle/Tests/Export/Aggregator/SocialWorkAggregators/HandlingThirdPartyAggregatorTest.php b/src/Bundle/ChillPersonBundle/Tests/Export/Aggregator/SocialWorkAggregators/HandlingThirdPartyAggregatorTest.php index eef2f8840..179c5dfd2 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Export/Aggregator/SocialWorkAggregators/HandlingThirdPartyAggregatorTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Export/Aggregator/SocialWorkAggregators/HandlingThirdPartyAggregatorTest.php @@ -25,6 +25,7 @@ class HandlingThirdPartyAggregatorTest extends AbstractAggregatorTest { private static HandlingThirdPartyAggregator $handlingThirdPartyAggregator; + #[\Override] public static function setUpBeforeClass(): void { parent::setUpBeforeClass(); @@ -32,11 +33,13 @@ class HandlingThirdPartyAggregatorTest extends AbstractAggregatorTest self::$handlingThirdPartyAggregator = self::getContainer()->get(HandlingThirdPartyAggregator::class); } + #[\Override] public function getAggregator() { return self::$handlingThirdPartyAggregator; } + #[\Override] public static function getFormData(): array { return [ @@ -44,6 +47,7 @@ class HandlingThirdPartyAggregatorTest extends AbstractAggregatorTest ]; } + #[\Override] public static function getQueryBuilders(): iterable { self::bootKernel(); diff --git a/src/Bundle/ChillPersonBundle/Tests/Export/Aggregator/SocialWorkAggregators/JobAggregatorTest.php b/src/Bundle/ChillPersonBundle/Tests/Export/Aggregator/SocialWorkAggregators/JobAggregatorTest.php index 8b4ae0dc7..1d8ee2876 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Export/Aggregator/SocialWorkAggregators/JobAggregatorTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Export/Aggregator/SocialWorkAggregators/JobAggregatorTest.php @@ -25,6 +25,7 @@ final class JobAggregatorTest extends AbstractAggregatorTest { private JobAggregator $aggregator; + #[\Override] protected function setUp(): void { self::bootKernel(); @@ -32,11 +33,13 @@ final class JobAggregatorTest extends AbstractAggregatorTest $this->aggregator = self::getContainer()->get('chill.person.export.aggregator_treatingagent_job'); } + #[\Override] public function getAggregator() { return $this->aggregator; } + #[\Override] public static function getFormData(): array { return [ @@ -44,6 +47,7 @@ final class JobAggregatorTest extends AbstractAggregatorTest ]; } + #[\Override] public static function getQueryBuilders(): iterable { self::bootKernel(); diff --git a/src/Bundle/ChillPersonBundle/Tests/Export/Aggregator/SocialWorkAggregators/ReferrerAggregatorTest.php b/src/Bundle/ChillPersonBundle/Tests/Export/Aggregator/SocialWorkAggregators/ReferrerAggregatorTest.php index fd1f0ffc5..d7943a3b8 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Export/Aggregator/SocialWorkAggregators/ReferrerAggregatorTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Export/Aggregator/SocialWorkAggregators/ReferrerAggregatorTest.php @@ -26,6 +26,7 @@ final class ReferrerAggregatorTest extends AbstractAggregatorTest { private ReferrerAggregator $aggregator; + #[\Override] protected function setUp(): void { self::bootKernel(); @@ -33,11 +34,13 @@ final class ReferrerAggregatorTest extends AbstractAggregatorTest $this->aggregator = self::getContainer()->get(ReferrerAggregator::class); } + #[\Override] public function getAggregator() { return $this->aggregator; } + #[\Override] public static function getFormData(): array { return [ @@ -48,6 +51,7 @@ final class ReferrerAggregatorTest extends AbstractAggregatorTest ]; } + #[\Override] public static function getQueryBuilders(): iterable { self::bootKernel(); diff --git a/src/Bundle/ChillPersonBundle/Tests/Export/Aggregator/SocialWorkAggregators/ResultAggregatorTest.php b/src/Bundle/ChillPersonBundle/Tests/Export/Aggregator/SocialWorkAggregators/ResultAggregatorTest.php index 28f970dd0..a7fd67839 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Export/Aggregator/SocialWorkAggregators/ResultAggregatorTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Export/Aggregator/SocialWorkAggregators/ResultAggregatorTest.php @@ -25,6 +25,7 @@ final class ResultAggregatorTest extends AbstractAggregatorTest { private ResultAggregator $aggregator; + #[\Override] protected function setUp(): void { self::bootKernel(); @@ -32,11 +33,13 @@ final class ResultAggregatorTest extends AbstractAggregatorTest $this->aggregator = self::getContainer()->get('chill.person.export.aggregator_result'); } + #[\Override] public function getAggregator() { return $this->aggregator; } + #[\Override] public static function getFormData(): array { return [ @@ -44,6 +47,7 @@ final class ResultAggregatorTest extends AbstractAggregatorTest ]; } + #[\Override] public static function getQueryBuilders(): iterable { self::bootKernel(); diff --git a/src/Bundle/ChillPersonBundle/Tests/Export/Aggregator/SocialWorkAggregators/ScopeAggregatorTest.php b/src/Bundle/ChillPersonBundle/Tests/Export/Aggregator/SocialWorkAggregators/ScopeAggregatorTest.php index 26aeb6690..0b7fb205b 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Export/Aggregator/SocialWorkAggregators/ScopeAggregatorTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Export/Aggregator/SocialWorkAggregators/ScopeAggregatorTest.php @@ -25,6 +25,7 @@ final class ScopeAggregatorTest extends AbstractAggregatorTest { private ScopeAggregator $aggregator; + #[\Override] protected function setUp(): void { self::bootKernel(); @@ -32,11 +33,13 @@ final class ScopeAggregatorTest extends AbstractAggregatorTest $this->aggregator = self::getContainer()->get('chill.person.export.aggregator_treatingagent_scope'); } + #[\Override] public function getAggregator() { return $this->aggregator; } + #[\Override] public static function getFormData(): array { return [ @@ -44,6 +47,7 @@ final class ScopeAggregatorTest extends AbstractAggregatorTest ]; } + #[\Override] public static function getQueryBuilders(): iterable { self::bootKernel(); diff --git a/src/Bundle/ChillPersonBundle/Tests/Export/Export/AvgDurationAPWorkPersonAssociatedOnAccompanyingPeriodTest.php b/src/Bundle/ChillPersonBundle/Tests/Export/Export/AvgDurationAPWorkPersonAssociatedOnAccompanyingPeriodTest.php index d0b05aeaf..6746a5990 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Export/Export/AvgDurationAPWorkPersonAssociatedOnAccompanyingPeriodTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Export/Export/AvgDurationAPWorkPersonAssociatedOnAccompanyingPeriodTest.php @@ -23,11 +23,13 @@ use Chill\PersonBundle\Repository\AccompanyingPeriod\AccompanyingPeriodWorkRepos */ class AvgDurationAPWorkPersonAssociatedOnAccompanyingPeriodTest extends AbstractExportTest { + #[\Override] protected function setUp(): void { self::bootKernel(); } + #[\Override] public function getExport() { $repository = self::getContainer()->get(AccompanyingPeriodWorkRepository::class); @@ -36,6 +38,7 @@ class AvgDurationAPWorkPersonAssociatedOnAccompanyingPeriodTest extends Abstract yield new AvgDurationAPWorkPersonAssociatedOnAccompanyingPeriod($this->getParameters(false), $repository); } + #[\Override] public static function getFormData(): array { return [ @@ -43,6 +46,7 @@ class AvgDurationAPWorkPersonAssociatedOnAccompanyingPeriodTest extends Abstract ]; } + #[\Override] public static function getModifiersCombination(): array { return [ diff --git a/src/Bundle/ChillPersonBundle/Tests/Export/Export/AvgDurationAPWorkPersonAssociatedOnWorkTest.php b/src/Bundle/ChillPersonBundle/Tests/Export/Export/AvgDurationAPWorkPersonAssociatedOnWorkTest.php index 6aa2bb4df..20c478a7d 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Export/Export/AvgDurationAPWorkPersonAssociatedOnWorkTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Export/Export/AvgDurationAPWorkPersonAssociatedOnWorkTest.php @@ -23,11 +23,13 @@ use Chill\PersonBundle\Repository\AccompanyingPeriod\AccompanyingPeriodWorkRepos */ class AvgDurationAPWorkPersonAssociatedOnWorkTest extends AbstractExportTest { + #[\Override] protected function setUp(): void { self::bootKernel(); } + #[\Override] public function getExport() { $repository = self::getContainer()->get(AccompanyingPeriodWorkRepository::class); @@ -36,11 +38,13 @@ class AvgDurationAPWorkPersonAssociatedOnWorkTest extends AbstractExportTest yield new AvgDurationAPWorkPersonAssociatedOnAccompanyingPeriod($this->getParameters(false), $repository); } + #[\Override] public static function getFormData(): array { return [[]]; } + #[\Override] public static function getModifiersCombination(): array { return [ diff --git a/src/Bundle/ChillPersonBundle/Tests/Export/Export/CountAccompanyingCourseStepHistoryTest.php b/src/Bundle/ChillPersonBundle/Tests/Export/Export/CountAccompanyingCourseStepHistoryTest.php index 202562ed2..0c933b641 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Export/Export/CountAccompanyingCourseStepHistoryTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Export/Export/CountAccompanyingCourseStepHistoryTest.php @@ -23,11 +23,13 @@ use Doctrine\ORM\EntityManagerInterface; */ final class CountAccompanyingCourseStepHistoryTest extends AbstractExportTest { + #[\Override] protected function setUp(): void { self::bootKernel(); } + #[\Override] public function getExport() { $em = self::getContainer()->get(EntityManagerInterface::class); @@ -36,11 +38,13 @@ final class CountAccompanyingCourseStepHistoryTest extends AbstractExportTest yield new CountAccompanyingCourseStepHistory($em, $this->getParameters(false)); } + #[\Override] public static function getFormData(): array { return [[]]; } + #[\Override] public static function getModifiersCombination(): array { return [[Declarations::ACP_TYPE], [Declarations::ACP_TYPE, Declarations::ACP_STEP_HISTORY]]; diff --git a/src/Bundle/ChillPersonBundle/Tests/Export/Export/CountAccompanyingCourseTest.php b/src/Bundle/ChillPersonBundle/Tests/Export/Export/CountAccompanyingCourseTest.php index fa7c2cf60..8297a782a 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Export/Export/CountAccompanyingCourseTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Export/Export/CountAccompanyingCourseTest.php @@ -23,11 +23,13 @@ use Doctrine\ORM\EntityManagerInterface; */ final class CountAccompanyingCourseTest extends AbstractExportTest { + #[\Override] protected function setUp(): void { self::bootKernel(); } + #[\Override] public function getExport() { $em = self::getContainer()->get(EntityManagerInterface::class); @@ -36,11 +38,13 @@ final class CountAccompanyingCourseTest extends AbstractExportTest yield new CountAccompanyingCourse($em, $this->getParameters(false)); } + #[\Override] public static function getFormData(): array { return [[]]; } + #[\Override] public static function getModifiersCombination(): array { return [[Declarations::ACP_TYPE]]; diff --git a/src/Bundle/ChillPersonBundle/Tests/Export/Export/CountAccompanyingPeriodWorkAssociatePersonOnAccompanyingPeriodTest.php b/src/Bundle/ChillPersonBundle/Tests/Export/Export/CountAccompanyingPeriodWorkAssociatePersonOnAccompanyingPeriodTest.php index 4f20c5f75..7c0a76f3c 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Export/Export/CountAccompanyingPeriodWorkAssociatePersonOnAccompanyingPeriodTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Export/Export/CountAccompanyingPeriodWorkAssociatePersonOnAccompanyingPeriodTest.php @@ -23,11 +23,13 @@ use Doctrine\ORM\EntityManagerInterface; */ final class CountAccompanyingPeriodWorkAssociatePersonOnAccompanyingPeriodTest extends AbstractExportTest { + #[\Override] protected function setUp(): void { self::bootKernel(); } + #[\Override] public function getExport() { $em = self::getContainer()->get(EntityManagerInterface::class); @@ -36,11 +38,13 @@ final class CountAccompanyingPeriodWorkAssociatePersonOnAccompanyingPeriodTest e yield new CountAccompanyingPeriodWorkAssociatePersonOnAccompanyingPeriod($em, $this->getParameters(false)); } + #[\Override] public static function getFormData(): array { return [[]]; } + #[\Override] public static function getModifiersCombination(): array { return [[Declarations::SOCIAL_WORK_ACTION_TYPE]]; diff --git a/src/Bundle/ChillPersonBundle/Tests/Export/Export/CountAccompanyingPeriodWorkAssociatePersonOnWorkTest.php b/src/Bundle/ChillPersonBundle/Tests/Export/Export/CountAccompanyingPeriodWorkAssociatePersonOnWorkTest.php index 046bf2308..3a74c3455 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Export/Export/CountAccompanyingPeriodWorkAssociatePersonOnWorkTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Export/Export/CountAccompanyingPeriodWorkAssociatePersonOnWorkTest.php @@ -23,11 +23,13 @@ use Doctrine\ORM\EntityManagerInterface; */ final class CountAccompanyingPeriodWorkAssociatePersonOnWorkTest extends AbstractExportTest { + #[\Override] protected function setUp(): void { self::bootKernel(); } + #[\Override] public function getExport() { $em = self::getContainer()->get(EntityManagerInterface::class); @@ -36,11 +38,13 @@ final class CountAccompanyingPeriodWorkAssociatePersonOnWorkTest extends Abstrac yield new CountAccompanyingPeriodWorkAssociatePersonOnWork($em, $this->getParameters(false)); } + #[\Override] public static function getFormData(): array { return [[]]; } + #[\Override] public static function getModifiersCombination(): array { return [[Declarations::SOCIAL_WORK_ACTION_TYPE]]; diff --git a/src/Bundle/ChillPersonBundle/Tests/Export/Export/CountHouseholdInPeriodTest.php b/src/Bundle/ChillPersonBundle/Tests/Export/Export/CountHouseholdInPeriodTest.php index 989779dce..1fc466400 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Export/Export/CountHouseholdInPeriodTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Export/Export/CountHouseholdInPeriodTest.php @@ -25,11 +25,13 @@ use Doctrine\ORM\EntityManagerInterface; */ class CountHouseholdInPeriodTest extends AbstractExportTest { + #[\Override] protected function setUp(): void { self::bootKernel(); } + #[\Override] public function getExport() { $em = self::getContainer()->get(EntityManagerInterface::class); @@ -39,6 +41,7 @@ class CountHouseholdInPeriodTest extends AbstractExportTest yield new CountHouseholdInPeriod($em, $rollingDate, $this->getParameters(false)); } + #[\Override] public static function getFormData(): array { return [ @@ -46,6 +49,7 @@ class CountHouseholdInPeriodTest extends AbstractExportTest ]; } + #[\Override] public static function getModifiersCombination(): array { return [ diff --git a/src/Bundle/ChillPersonBundle/Tests/Export/Export/CountPersonOnAccompanyingPeriodWorkAssociatePersonOnWorkTest.php b/src/Bundle/ChillPersonBundle/Tests/Export/Export/CountPersonOnAccompanyingPeriodWorkAssociatePersonOnWorkTest.php index 2530458c1..40c99f610 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Export/Export/CountPersonOnAccompanyingPeriodWorkAssociatePersonOnWorkTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Export/Export/CountPersonOnAccompanyingPeriodWorkAssociatePersonOnWorkTest.php @@ -23,11 +23,13 @@ use Doctrine\ORM\EntityManagerInterface; */ class CountPersonOnAccompanyingPeriodWorkAssociatePersonOnWorkTest extends AbstractExportTest { + #[\Override] protected function setUp(): void { self::bootKernel(); } + #[\Override] public function getExport() { $em = self::getContainer()->get(EntityManagerInterface::class); @@ -36,11 +38,13 @@ class CountPersonOnAccompanyingPeriodWorkAssociatePersonOnWorkTest extends Abstr yield new CountAccompanyingPeriodWorkAssociatePersonOnWork($em, $this->getParameters(false)); } + #[\Override] public static function getFormData(): array { return [[]]; } + #[\Override] public static function getModifiersCombination(): array { return [ diff --git a/src/Bundle/ChillPersonBundle/Tests/Export/Export/CountPersonTest.php b/src/Bundle/ChillPersonBundle/Tests/Export/Export/CountPersonTest.php index ba171d545..ae805b570 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Export/Export/CountPersonTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Export/Export/CountPersonTest.php @@ -24,11 +24,13 @@ use Chill\PersonBundle\Repository\PersonRepository; */ final class CountPersonTest extends AbstractExportTest { + #[\Override] protected function setUp(): void { self::bootKernel(); } + #[\Override] public function getExport() { $personRepository = self::getContainer()->get(PersonRepository::class); @@ -37,6 +39,7 @@ final class CountPersonTest extends AbstractExportTest yield new CountPerson($personRepository, $this->getParameters(false)); } + #[\Override] public static function getFormData(): array { return [ @@ -44,6 +47,7 @@ final class CountPersonTest extends AbstractExportTest ]; } + #[\Override] public static function getModifiersCombination(): array { return [['person']]; diff --git a/src/Bundle/ChillPersonBundle/Tests/Export/Export/CountPersonWithAccompanyingCourseTest.php b/src/Bundle/ChillPersonBundle/Tests/Export/Export/CountPersonWithAccompanyingCourseTest.php index acdc475bc..2d3c45046 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Export/Export/CountPersonWithAccompanyingCourseTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Export/Export/CountPersonWithAccompanyingCourseTest.php @@ -23,11 +23,13 @@ use Doctrine\ORM\EntityManagerInterface; */ class CountPersonWithAccompanyingCourseTest extends AbstractExportTest { + #[\Override] protected function setUp(): void { self::bootKernel(); } + #[\Override] public function getExport() { $em = self::getContainer()->get(EntityManagerInterface::class); @@ -36,11 +38,13 @@ class CountPersonWithAccompanyingCourseTest extends AbstractExportTest yield new CountPersonWithAccompanyingCourse($em, $this->getParameters(false)); } + #[\Override] public static function getFormData(): array { return [[]]; } + #[\Override] public static function getModifiersCombination(): array { return [[Declarations::ACP_TYPE]]; diff --git a/src/Bundle/ChillPersonBundle/Tests/Export/Export/ListAccompanyingPeriodTest.php b/src/Bundle/ChillPersonBundle/Tests/Export/Export/ListAccompanyingPeriodTest.php index 220ba0ad7..1620cc5f2 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Export/Export/ListAccompanyingPeriodTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Export/Export/ListAccompanyingPeriodTest.php @@ -42,12 +42,14 @@ class ListAccompanyingPeriodTest extends AbstractExportTest private readonly CenterRepositoryInterface $centerRepository; + #[\Override] protected function setUp(): void { parent::setUp(); self::bootKernel(); } + #[\Override] public function getExport() { /** @var EntityManagerInterface::class $em */ @@ -100,6 +102,7 @@ class ListAccompanyingPeriodTest extends AbstractExportTest ); } + #[\Override] public static function getFormData(): array { return [ @@ -107,6 +110,7 @@ class ListAccompanyingPeriodTest extends AbstractExportTest ]; } + #[\Override] public static function getModifiersCombination(): array { return [[Declarations::ACP_TYPE]]; diff --git a/src/Bundle/ChillPersonBundle/Tests/Export/Export/ListAccompanyingPeriodWorkAssociatePersonOnAccompanyingPeriodTest.php b/src/Bundle/ChillPersonBundle/Tests/Export/Export/ListAccompanyingPeriodWorkAssociatePersonOnAccompanyingPeriodTest.php index bdad9ed4f..cc84451db 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Export/Export/ListAccompanyingPeriodWorkAssociatePersonOnAccompanyingPeriodTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Export/Export/ListAccompanyingPeriodWorkAssociatePersonOnAccompanyingPeriodTest.php @@ -39,12 +39,14 @@ class ListAccompanyingPeriodWorkAssociatePersonOnAccompanyingPeriodTest extends { use ProphecyTrait; + #[\Override] protected function setUp(): void { parent::setUp(); self::bootKernel(); } + #[\Override] public function getExport() { $entityManager = self::getContainer()->get(EntityManagerInterface::class); @@ -78,6 +80,7 @@ class ListAccompanyingPeriodWorkAssociatePersonOnAccompanyingPeriodTest extends ); } + #[\Override] public static function getFormData(): array { return [ @@ -85,6 +88,7 @@ class ListAccompanyingPeriodWorkAssociatePersonOnAccompanyingPeriodTest extends ]; } + #[\Override] public static function getModifiersCombination(): array { return [[Declarations::ACP_TYPE]]; diff --git a/src/Bundle/ChillPersonBundle/Tests/Export/Export/ListAccompanyingPeriodWorkAssociatePersonOnWorkTest.php b/src/Bundle/ChillPersonBundle/Tests/Export/Export/ListAccompanyingPeriodWorkAssociatePersonOnWorkTest.php index bb4ebb5a1..c229b0c87 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Export/Export/ListAccompanyingPeriodWorkAssociatePersonOnWorkTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Export/Export/ListAccompanyingPeriodWorkAssociatePersonOnWorkTest.php @@ -39,12 +39,14 @@ class ListAccompanyingPeriodWorkAssociatePersonOnWorkTest extends AbstractExport { use ProphecyTrait; + #[\Override] protected function setUp(): void { parent::setUp(); self::bootKernel(); } + #[\Override] public function getExport() { $entityManager = self::getContainer()->get(EntityManagerInterface::class); @@ -78,6 +80,7 @@ class ListAccompanyingPeriodWorkAssociatePersonOnWorkTest extends AbstractExport ); } + #[\Override] public static function getFormData(): array { return [ @@ -85,6 +88,7 @@ class ListAccompanyingPeriodWorkAssociatePersonOnWorkTest extends AbstractExport ]; } + #[\Override] public static function getModifiersCombination(): array { return [[Declarations::ACP_TYPE]]; diff --git a/src/Bundle/ChillPersonBundle/Tests/Export/Export/ListEvaluationTest.php b/src/Bundle/ChillPersonBundle/Tests/Export/Export/ListEvaluationTest.php index 74420c841..09b53c077 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Export/Export/ListEvaluationTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Export/Export/ListEvaluationTest.php @@ -41,6 +41,7 @@ class ListEvaluationTest extends AbstractExportTest private CenterRepositoryInterface $centerRepository; + #[\Override] protected function setUp(): void { parent::setUp(); @@ -49,6 +50,7 @@ class ListEvaluationTest extends AbstractExportTest $this->centerRepository = self::getContainer()->get(CenterRepositoryInterface::class); } + #[\Override] public function getExport() { $entityManager = self::getContainer()->get(EntityManagerInterface::class); @@ -80,11 +82,13 @@ class ListEvaluationTest extends AbstractExportTest ); } + #[\Override] public static function getFormData(): array { return [['calc_date' => new RollingDate(RollingDate::T_TODAY)]]; } + #[\Override] public static function getModifiersCombination(): array { return [[Declarations::ACP_TYPE]]; diff --git a/src/Bundle/ChillPersonBundle/Tests/Export/Export/ListHouseholdInPeriodTest.php b/src/Bundle/ChillPersonBundle/Tests/Export/Export/ListHouseholdInPeriodTest.php index ea0d9524d..16ad2fd26 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Export/Export/ListHouseholdInPeriodTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Export/Export/ListHouseholdInPeriodTest.php @@ -28,11 +28,13 @@ use Doctrine\ORM\EntityManagerInterface; */ class ListHouseholdInPeriodTest extends AbstractExportTest { + #[\Override] protected function setUp(): void { self::bootKernel(); } + #[\Override] public function getExport() { $addressHelper = self::getContainer()->get(ExportAddressHelper::class); @@ -60,11 +62,13 @@ class ListHouseholdInPeriodTest extends AbstractExportTest ); } + #[\Override] public static function getFormData(): array { return [['calc_date' => new RollingDate(RollingDate::T_TODAY)]]; } + #[\Override] public static function getModifiersCombination(): array { return [[Declarations::PERSON_TYPE]]; diff --git a/src/Bundle/ChillPersonBundle/Tests/Export/Export/ListPersonHavingAccompanyingPeriodTest.php b/src/Bundle/ChillPersonBundle/Tests/Export/Export/ListPersonHavingAccompanyingPeriodTest.php index 363439e38..e99e5e891 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Export/Export/ListPersonHavingAccompanyingPeriodTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Export/Export/ListPersonHavingAccompanyingPeriodTest.php @@ -26,12 +26,14 @@ use Doctrine\ORM\EntityManagerInterface; */ class ListPersonHavingAccompanyingPeriodTest extends AbstractExportTest { + #[\Override] protected function setUp(): void { parent::setUp(); self::bootKernel(); } + #[\Override] public function getExport() { $listPersonHelper = self::getContainer()->get(ListPersonHelper::class); @@ -53,11 +55,13 @@ class ListPersonHavingAccompanyingPeriodTest extends AbstractExportTest ); } + #[\Override] public static function getFormData(): array { return [['address_date_rolling' => new RollingDate(RollingDate::T_TODAY)]]; } + #[\Override] public static function getModifiersCombination(): array { return [[Declarations::PERSON_TYPE, Declarations::ACP_TYPE]]; diff --git a/src/Bundle/ChillPersonBundle/Tests/Export/Export/ListPersonTest.php b/src/Bundle/ChillPersonBundle/Tests/Export/Export/ListPersonTest.php index 9c0eb538c..935cf55d4 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Export/Export/ListPersonTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Export/Export/ListPersonTest.php @@ -32,6 +32,7 @@ final class ListPersonTest extends AbstractExportTest private ListPerson $export; + #[\Override] protected function setUp(): void { self::bootKernel(); @@ -47,6 +48,7 @@ final class ListPersonTest extends AbstractExportTest ->push($request->reveal()); } + #[\Override] public function getExport() { $customFieldProvider = self::getContainer()->get(CustomFieldProvider::class); @@ -71,11 +73,13 @@ final class ListPersonTest extends AbstractExportTest ); } + #[\Override] public static function getFormData(): array { return [['address_date' => new \DateTimeImmutable('today')]]; } + #[\Override] public static function getModifiersCombination(): array { return [ diff --git a/src/Bundle/ChillPersonBundle/Tests/Export/Export/ListPersonWithAccompanyingPeriodDetailsTest.php b/src/Bundle/ChillPersonBundle/Tests/Export/Export/ListPersonWithAccompanyingPeriodDetailsTest.php index dd30bcdd0..41ac4d3a2 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Export/Export/ListPersonWithAccompanyingPeriodDetailsTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Export/Export/ListPersonWithAccompanyingPeriodDetailsTest.php @@ -31,12 +31,14 @@ class ListPersonWithAccompanyingPeriodDetailsTest extends AbstractExportTest { use ProphecyTrait; + #[\Override] protected function setUp(): void { parent::setUp(); self::bootKernel(); } + #[\Override] public function getExport() { $listPersonHelper = self::getContainer()->get(ListPersonHelper::class); @@ -54,6 +56,7 @@ class ListPersonWithAccompanyingPeriodDetailsTest extends AbstractExportTest ); } + #[\Override] public static function getFormData(): array { return [ @@ -61,6 +64,7 @@ class ListPersonWithAccompanyingPeriodDetailsTest extends AbstractExportTest ]; } + #[\Override] public static function getModifiersCombination(): array { return [ diff --git a/src/Bundle/ChillPersonBundle/Tests/Export/Export/StatAccompanyingCourseDurationTest.php b/src/Bundle/ChillPersonBundle/Tests/Export/Export/StatAccompanyingCourseDurationTest.php index f62cd2be4..2c8af78df 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Export/Export/StatAccompanyingCourseDurationTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Export/Export/StatAccompanyingCourseDurationTest.php @@ -27,6 +27,7 @@ final class StatAccompanyingCourseDurationTest extends AbstractExportTest { private StatAccompanyingCourseDuration $export; + #[\Override] protected function setUp(): void { self::bootKernel(); @@ -34,6 +35,7 @@ final class StatAccompanyingCourseDurationTest extends AbstractExportTest $this->export = self::getContainer()->get('chill.person.export.avg_accompanyingcourse_duration'); } + #[\Override] public function getExport() { $em = self::getContainer()->get(EntityManagerInterface::class); @@ -43,6 +45,7 @@ final class StatAccompanyingCourseDurationTest extends AbstractExportTest yield new StatAccompanyingCourseDuration($em, $rollingDateconverter, $this->getParameters(false)); } + #[\Override] public static function getFormData(): array { return [ @@ -50,6 +53,7 @@ final class StatAccompanyingCourseDurationTest extends AbstractExportTest ]; } + #[\Override] public static function getModifiersCombination(): array { return [[Declarations::ACP_TYPE]]; diff --git a/src/Bundle/ChillPersonBundle/Tests/Export/Filter/AccompanyingCourseFilters/ActiveOnDateFilterTest.php b/src/Bundle/ChillPersonBundle/Tests/Export/Filter/AccompanyingCourseFilters/ActiveOnDateFilterTest.php index 09be30f1f..7c5901f94 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Export/Filter/AccompanyingCourseFilters/ActiveOnDateFilterTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Export/Filter/AccompanyingCourseFilters/ActiveOnDateFilterTest.php @@ -26,6 +26,7 @@ final class ActiveOnDateFilterTest extends AbstractFilterTest { private ActiveOnDateFilter $filter; + #[\Override] protected function setUp(): void { self::bootKernel(); @@ -33,11 +34,13 @@ final class ActiveOnDateFilterTest extends AbstractFilterTest $this->filter = self::getContainer()->get('chill.person.export.filter_activeondate'); } + #[\Override] public function getFilter() { return $this->filter; } + #[\Override] public static function getFormData(): array { return [ @@ -47,6 +50,7 @@ final class ActiveOnDateFilterTest extends AbstractFilterTest ]; } + #[\Override] public static function getQueryBuilders(): array { self::bootKernel(); diff --git a/src/Bundle/ChillPersonBundle/Tests/Export/Filter/AccompanyingCourseFilters/ActiveOneDayBetweenDatesFilterTest.php b/src/Bundle/ChillPersonBundle/Tests/Export/Filter/AccompanyingCourseFilters/ActiveOneDayBetweenDatesFilterTest.php index 8fd75acd6..e58bae0b9 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Export/Filter/AccompanyingCourseFilters/ActiveOneDayBetweenDatesFilterTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Export/Filter/AccompanyingCourseFilters/ActiveOneDayBetweenDatesFilterTest.php @@ -26,6 +26,7 @@ final class ActiveOneDayBetweenDatesFilterTest extends AbstractFilterTest { private ActiveOneDayBetweenDatesFilter $filter; + #[\Override] protected function setUp(): void { self::bootKernel(); @@ -33,11 +34,13 @@ final class ActiveOneDayBetweenDatesFilterTest extends AbstractFilterTest $this->filter = self::getContainer()->get('chill.person.export.filter_activeonedaybetweendates'); } + #[\Override] public function getFilter() { return $this->filter; } + #[\Override] public static function getFormData(): array { return [ @@ -48,6 +51,7 @@ final class ActiveOneDayBetweenDatesFilterTest extends AbstractFilterTest ]; } + #[\Override] public static function getQueryBuilders(): iterable { self::bootKernel(); diff --git a/src/Bundle/ChillPersonBundle/Tests/Export/Filter/AccompanyingCourseFilters/AdministrativeLocationFilterTest.php b/src/Bundle/ChillPersonBundle/Tests/Export/Filter/AccompanyingCourseFilters/AdministrativeLocationFilterTest.php index a9c5e6f50..13905d787 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Export/Filter/AccompanyingCourseFilters/AdministrativeLocationFilterTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Export/Filter/AccompanyingCourseFilters/AdministrativeLocationFilterTest.php @@ -25,6 +25,7 @@ final class AdministrativeLocationFilterTest extends AbstractFilterTest { private AdministrativeLocationFilter $filter; + #[\Override] protected function setUp(): void { self::bootKernel(); @@ -32,11 +33,13 @@ final class AdministrativeLocationFilterTest extends AbstractFilterTest $this->filter = self::getContainer()->get('chill.person.export.filter_administrative_location'); } + #[\Override] public function getFilter() { return $this->filter; } + #[\Override] public static function getFormData(): array { self::bootKernel(); @@ -55,6 +58,7 @@ final class AdministrativeLocationFilterTest extends AbstractFilterTest return $data; } + #[\Override] public static function getQueryBuilders(): iterable { self::bootKernel(); diff --git a/src/Bundle/ChillPersonBundle/Tests/Export/Filter/AccompanyingCourseFilters/ClosingMotiveFilterTest.php b/src/Bundle/ChillPersonBundle/Tests/Export/Filter/AccompanyingCourseFilters/ClosingMotiveFilterTest.php index 7b333df00..76d537edb 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Export/Filter/AccompanyingCourseFilters/ClosingMotiveFilterTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Export/Filter/AccompanyingCourseFilters/ClosingMotiveFilterTest.php @@ -26,6 +26,7 @@ final class ClosingMotiveFilterTest extends AbstractFilterTest { private ClosingMotiveFilter $filter; + #[\Override] protected function setUp(): void { self::bootKernel(); @@ -33,11 +34,13 @@ final class ClosingMotiveFilterTest extends AbstractFilterTest $this->filter = self::getContainer()->get('chill.person.export.filter_closingmotive'); } + #[\Override] public function getFilter() { return $this->filter; } + #[\Override] public static function getFormData(): array { self::bootKernel(); @@ -55,6 +58,7 @@ final class ClosingMotiveFilterTest extends AbstractFilterTest return $data; } + #[\Override] public static function getQueryBuilders(): iterable { self::bootKernel(); diff --git a/src/Bundle/ChillPersonBundle/Tests/Export/Filter/AccompanyingCourseFilters/ConfidentialFilterTest.php b/src/Bundle/ChillPersonBundle/Tests/Export/Filter/AccompanyingCourseFilters/ConfidentialFilterTest.php index e2f20df2c..c0b3d2307 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Export/Filter/AccompanyingCourseFilters/ConfidentialFilterTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Export/Filter/AccompanyingCourseFilters/ConfidentialFilterTest.php @@ -24,6 +24,7 @@ final class ConfidentialFilterTest extends AbstractFilterTest { private ConfidentialFilter $filter; + #[\Override] protected function setUp(): void { self::bootKernel(); @@ -31,11 +32,13 @@ final class ConfidentialFilterTest extends AbstractFilterTest $this->filter = self::getContainer()->get('chill.person.export.filter_confidential'); } + #[\Override] public function getFilter() { return $this->filter; } + #[\Override] public static function getFormData(): array { return [ @@ -44,6 +47,7 @@ final class ConfidentialFilterTest extends AbstractFilterTest ]; } + #[\Override] public static function getQueryBuilders(): iterable { self::bootKernel(); diff --git a/src/Bundle/ChillPersonBundle/Tests/Export/Filter/AccompanyingCourseFilters/EmergencyFilterTest.php b/src/Bundle/ChillPersonBundle/Tests/Export/Filter/AccompanyingCourseFilters/EmergencyFilterTest.php index ecc98d4fc..aa3045fcd 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Export/Filter/AccompanyingCourseFilters/EmergencyFilterTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Export/Filter/AccompanyingCourseFilters/EmergencyFilterTest.php @@ -24,6 +24,7 @@ final class EmergencyFilterTest extends AbstractFilterTest { private EmergencyFilter $filter; + #[\Override] protected function setUp(): void { self::bootKernel(); @@ -31,11 +32,13 @@ final class EmergencyFilterTest extends AbstractFilterTest $this->filter = self::getContainer()->get('chill.person.export.filter_emergency'); } + #[\Override] public function getFilter() { return $this->filter; } + #[\Override] public static function getFormData(): array { return [ @@ -44,6 +47,7 @@ final class EmergencyFilterTest extends AbstractFilterTest ]; } + #[\Override] public static function getQueryBuilders(): iterable { self::bootKernel(); diff --git a/src/Bundle/ChillPersonBundle/Tests/Export/Filter/AccompanyingCourseFilters/EvaluationFilterTest.php b/src/Bundle/ChillPersonBundle/Tests/Export/Filter/AccompanyingCourseFilters/EvaluationFilterTest.php index 8a9fb3c51..d5ac4e44b 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Export/Filter/AccompanyingCourseFilters/EvaluationFilterTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Export/Filter/AccompanyingCourseFilters/EvaluationFilterTest.php @@ -25,6 +25,7 @@ final class EvaluationFilterTest extends AbstractFilterTest { private EvaluationFilter $filter; + #[\Override] protected function setUp(): void { self::bootKernel(); @@ -32,11 +33,13 @@ final class EvaluationFilterTest extends AbstractFilterTest $this->filter = self::getContainer()->get('chill.person.export.filter_evaluation'); } + #[\Override] public function getFilter() { return $this->filter; } + #[\Override] public static function getFormData(): array { self::bootKernel(); @@ -55,6 +58,7 @@ final class EvaluationFilterTest extends AbstractFilterTest return $data; } + #[\Override] public static function getQueryBuilders(): iterable { self::bootKernel(); diff --git a/src/Bundle/ChillPersonBundle/Tests/Export/Filter/AccompanyingCourseFilters/GeographicalUnitStatFilterTest.php b/src/Bundle/ChillPersonBundle/Tests/Export/Filter/AccompanyingCourseFilters/GeographicalUnitStatFilterTest.php index 1f5323b82..ed3106ec3 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Export/Filter/AccompanyingCourseFilters/GeographicalUnitStatFilterTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Export/Filter/AccompanyingCourseFilters/GeographicalUnitStatFilterTest.php @@ -27,6 +27,7 @@ final class GeographicalUnitStatFilterTest extends AbstractFilterTest { private GeographicalUnitStatFilter $filter; + #[\Override] protected function setUp(): void { self::bootKernel(); @@ -34,11 +35,13 @@ final class GeographicalUnitStatFilterTest extends AbstractFilterTest $this->filter = self::getContainer()->get('chill.person.export.filter_geographicalunitstat'); } + #[\Override] public function getFilter() { return $this->filter; } + #[\Override] public static function getFormData(): array { self::bootKernel(); @@ -53,6 +56,7 @@ final class GeographicalUnitStatFilterTest extends AbstractFilterTest ]; } + #[\Override] public static function getQueryBuilders(): iterable { self::bootKernel(); diff --git a/src/Bundle/ChillPersonBundle/Tests/Export/Filter/AccompanyingCourseFilters/HasTemporaryLocationFilterTest.php b/src/Bundle/ChillPersonBundle/Tests/Export/Filter/AccompanyingCourseFilters/HasTemporaryLocationFilterTest.php index 0e5be0f64..7df9c8afb 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Export/Filter/AccompanyingCourseFilters/HasTemporaryLocationFilterTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Export/Filter/AccompanyingCourseFilters/HasTemporaryLocationFilterTest.php @@ -26,6 +26,7 @@ class HasTemporaryLocationFilterTest extends AbstractFilterTest { private RollingDateConverterInterface $rollingDateConverter; + #[\Override] protected function setUp(): void { self::bootKernel(); @@ -33,11 +34,13 @@ class HasTemporaryLocationFilterTest extends AbstractFilterTest $this->rollingDateConverter = self::getContainer()->get(RollingDateConverterInterface::class); } + #[\Override] public function getFilter() { return new HasTemporaryLocationFilter($this->rollingDateConverter); } + #[\Override] public static function getFormData(): array { return [ @@ -52,6 +55,7 @@ class HasTemporaryLocationFilterTest extends AbstractFilterTest ]; } + #[\Override] public static function getQueryBuilders(): iterable { self::bootKernel(); diff --git a/src/Bundle/ChillPersonBundle/Tests/Export/Filter/AccompanyingCourseFilters/IntensityFilterTest.php b/src/Bundle/ChillPersonBundle/Tests/Export/Filter/AccompanyingCourseFilters/IntensityFilterTest.php index 8759b6881..623345ddf 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Export/Filter/AccompanyingCourseFilters/IntensityFilterTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Export/Filter/AccompanyingCourseFilters/IntensityFilterTest.php @@ -25,6 +25,7 @@ final class IntensityFilterTest extends AbstractFilterTest { private IntensityFilter $filter; + #[\Override] protected function setUp(): void { self::bootKernel(); @@ -32,11 +33,13 @@ final class IntensityFilterTest extends AbstractFilterTest $this->filter = self::getContainer()->get('chill.person.export.filter_intensity'); } + #[\Override] public function getFilter() { return $this->filter; } + #[\Override] public static function getFormData(): array { return [ @@ -45,6 +48,7 @@ final class IntensityFilterTest extends AbstractFilterTest ]; } + #[\Override] public static function getQueryBuilders(): iterable { self::bootKernel(); diff --git a/src/Bundle/ChillPersonBundle/Tests/Export/Filter/AccompanyingCourseFilters/NotAssociatedWithAReferenceAddressFilterTest.php b/src/Bundle/ChillPersonBundle/Tests/Export/Filter/AccompanyingCourseFilters/NotAssociatedWithAReferenceAddressFilterTest.php index 4b4b17609..7a3edac77 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Export/Filter/AccompanyingCourseFilters/NotAssociatedWithAReferenceAddressFilterTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Export/Filter/AccompanyingCourseFilters/NotAssociatedWithAReferenceAddressFilterTest.php @@ -28,6 +28,7 @@ class NotAssociatedWithAReferenceAddressFilterTest extends AbstractFilterTest { use ProphecyTrait; + #[\Override] public function getFilter() { $dateConverter = new class () implements RollingDateConverterInterface { @@ -44,6 +45,7 @@ class NotAssociatedWithAReferenceAddressFilterTest extends AbstractFilterTest return new NotAssociatedWithAReferenceAddressFilter($dateConverter); } + #[\Override] public static function getFormData(): array { return [ @@ -51,6 +53,7 @@ class NotAssociatedWithAReferenceAddressFilterTest extends AbstractFilterTest ]; } + #[\Override] public static function getQueryBuilders(): iterable { self::bootKernel(); diff --git a/src/Bundle/ChillPersonBundle/Tests/Export/Filter/AccompanyingCourseFilters/OpenBetweenDatesFilterTest.php b/src/Bundle/ChillPersonBundle/Tests/Export/Filter/AccompanyingCourseFilters/OpenBetweenDatesFilterTest.php index 17515628a..0360a2905 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Export/Filter/AccompanyingCourseFilters/OpenBetweenDatesFilterTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Export/Filter/AccompanyingCourseFilters/OpenBetweenDatesFilterTest.php @@ -26,6 +26,7 @@ final class OpenBetweenDatesFilterTest extends AbstractFilterTest { private OpenBetweenDatesFilter $filter; + #[\Override] protected function setUp(): void { self::bootKernel(); @@ -33,11 +34,13 @@ final class OpenBetweenDatesFilterTest extends AbstractFilterTest $this->filter = self::getContainer()->get('chill.person.export.filter_openbetweendates'); } + #[\Override] public function getFilter() { return $this->filter; } + #[\Override] public static function getFormData(): array { return [ @@ -48,6 +51,7 @@ final class OpenBetweenDatesFilterTest extends AbstractFilterTest ]; } + #[\Override] public static function getQueryBuilders(): iterable { self::bootKernel(); diff --git a/src/Bundle/ChillPersonBundle/Tests/Export/Filter/AccompanyingCourseFilters/OriginFilterTest.php b/src/Bundle/ChillPersonBundle/Tests/Export/Filter/AccompanyingCourseFilters/OriginFilterTest.php index 1e22d0a57..bc6c2b358 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Export/Filter/AccompanyingCourseFilters/OriginFilterTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Export/Filter/AccompanyingCourseFilters/OriginFilterTest.php @@ -26,6 +26,7 @@ final class OriginFilterTest extends AbstractFilterTest { private OriginFilter $filter; + #[\Override] protected function setUp(): void { self::bootKernel(); @@ -33,11 +34,13 @@ final class OriginFilterTest extends AbstractFilterTest $this->filter = self::getContainer()->get('chill.person.export.filter_origin'); } + #[\Override] public function getFilter() { return $this->filter; } + #[\Override] public static function getFormData(): array { self::bootKernel(); @@ -56,6 +59,7 @@ final class OriginFilterTest extends AbstractFilterTest return $data; } + #[\Override] public static function getQueryBuilders(): iterable { self::bootKernel(); diff --git a/src/Bundle/ChillPersonBundle/Tests/Export/Filter/AccompanyingCourseFilters/ReferrerFilterBetweenDatesTest.php b/src/Bundle/ChillPersonBundle/Tests/Export/Filter/AccompanyingCourseFilters/ReferrerFilterBetweenDatesTest.php index 8415e2017..6ba4eff22 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Export/Filter/AccompanyingCourseFilters/ReferrerFilterBetweenDatesTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Export/Filter/AccompanyingCourseFilters/ReferrerFilterBetweenDatesTest.php @@ -30,6 +30,7 @@ class ReferrerFilterBetweenDatesTest extends AbstractFilterTest private RollingDateConverterInterface $rollingDateConverter; private UserRender $userRender; + #[\Override] protected function setUp(): void { parent::setUp(); @@ -38,11 +39,13 @@ class ReferrerFilterBetweenDatesTest extends AbstractFilterTest $this->userRender = self::getContainer()->get(UserRender::class); } + #[\Override] public function getFilter() { return new ReferrerFilterBetweenDates($this->rollingDateConverter, $this->userRender); } + #[\Override] public static function getFormData(): array { self: @@ -64,6 +67,7 @@ class ReferrerFilterBetweenDatesTest extends AbstractFilterTest ]; } + #[\Override] public static function getQueryBuilders(): iterable { self::bootKernel(); diff --git a/src/Bundle/ChillPersonBundle/Tests/Export/Filter/AccompanyingCourseFilters/ReferrerFilterTest.php b/src/Bundle/ChillPersonBundle/Tests/Export/Filter/AccompanyingCourseFilters/ReferrerFilterTest.php index 45bb6df46..5ff3364a2 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Export/Filter/AccompanyingCourseFilters/ReferrerFilterTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Export/Filter/AccompanyingCourseFilters/ReferrerFilterTest.php @@ -27,6 +27,7 @@ final class ReferrerFilterTest extends AbstractFilterTest { private ReferrerFilter $filter; + #[\Override] protected function setUp(): void { self::bootKernel(); @@ -34,11 +35,13 @@ final class ReferrerFilterTest extends AbstractFilterTest $this->filter = self::getContainer()->get(ReferrerFilter::class); } + #[\Override] public function getFilter() { return $this->filter; } + #[\Override] public static function getFormData(): array { self: @@ -58,6 +61,7 @@ final class ReferrerFilterTest extends AbstractFilterTest return $data; } + #[\Override] public static function getQueryBuilders(): iterable { self::bootKernel(); diff --git a/src/Bundle/ChillPersonBundle/Tests/Export/Filter/AccompanyingCourseFilters/RequestorFilterTest.php b/src/Bundle/ChillPersonBundle/Tests/Export/Filter/AccompanyingCourseFilters/RequestorFilterTest.php index 459ff303f..2b0916c98 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Export/Filter/AccompanyingCourseFilters/RequestorFilterTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Export/Filter/AccompanyingCourseFilters/RequestorFilterTest.php @@ -25,6 +25,7 @@ final class RequestorFilterTest extends AbstractFilterTest { private RequestorFilter $filter; + #[\Override] protected function setUp(): void { self::bootKernel(); @@ -32,11 +33,13 @@ final class RequestorFilterTest extends AbstractFilterTest $this->filter = self::getContainer()->get('chill.person.export.filter_requestor'); } + #[\Override] public function getFilter() { return $this->filter; } + #[\Override] public static function getFormData(): array { return [ @@ -47,6 +50,7 @@ final class RequestorFilterTest extends AbstractFilterTest ]; } + #[\Override] public static function getQueryBuilders(): iterable { self::bootKernel(); diff --git a/src/Bundle/ChillPersonBundle/Tests/Export/Filter/AccompanyingCourseFilters/SocialActionFilterTest.php b/src/Bundle/ChillPersonBundle/Tests/Export/Filter/AccompanyingCourseFilters/SocialActionFilterTest.php index c90369d2d..72ef8147d 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Export/Filter/AccompanyingCourseFilters/SocialActionFilterTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Export/Filter/AccompanyingCourseFilters/SocialActionFilterTest.php @@ -27,6 +27,7 @@ final class SocialActionFilterTest extends AbstractFilterTest { private SocialActionFilter $filter; + #[\Override] protected function setUp(): void { self::bootKernel(); @@ -34,11 +35,13 @@ final class SocialActionFilterTest extends AbstractFilterTest $this->filter = self::getContainer()->get('chill.person.export.filter_socialaction'); } + #[\Override] public function getFilter() { return $this->filter; } + #[\Override] public static function getFormData(): array { self::bootKernel(); @@ -82,6 +85,7 @@ final class SocialActionFilterTest extends AbstractFilterTest ]; } + #[\Override] public static function getQueryBuilders(): iterable { self::bootKernel(); diff --git a/src/Bundle/ChillPersonBundle/Tests/Export/Filter/AccompanyingCourseFilters/SocialIssueFilterTest.php b/src/Bundle/ChillPersonBundle/Tests/Export/Filter/AccompanyingCourseFilters/SocialIssueFilterTest.php index 8fba85161..b84e3ca34 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Export/Filter/AccompanyingCourseFilters/SocialIssueFilterTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Export/Filter/AccompanyingCourseFilters/SocialIssueFilterTest.php @@ -27,6 +27,7 @@ final class SocialIssueFilterTest extends AbstractFilterTest { private SocialIssueFilter $filter; + #[\Override] protected function setUp(): void { self::bootKernel(); @@ -34,11 +35,13 @@ final class SocialIssueFilterTest extends AbstractFilterTest $this->filter = self::getContainer()->get('chill.person.export.filter_socialissue'); } + #[\Override] public function getFilter() { return $this->filter; } + #[\Override] public static function getFormData(): array { self::bootKernel(); @@ -56,6 +59,7 @@ final class SocialIssueFilterTest extends AbstractFilterTest ]; } + #[\Override] public static function getQueryBuilders(): iterable { self::bootKernel(); diff --git a/src/Bundle/ChillPersonBundle/Tests/Export/Filter/AccompanyingCourseFilters/StepFilterTest.php b/src/Bundle/ChillPersonBundle/Tests/Export/Filter/AccompanyingCourseFilters/StepFilterTest.php index c0c2ec249..51269d836 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Export/Filter/AccompanyingCourseFilters/StepFilterTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Export/Filter/AccompanyingCourseFilters/StepFilterTest.php @@ -26,6 +26,7 @@ final class StepFilterTest extends AbstractFilterTest { private StepFilterOnDate $filter; + #[\Override] protected function setUp(): void { self::bootKernel(); @@ -33,11 +34,13 @@ final class StepFilterTest extends AbstractFilterTest $this->filter = self::getContainer()->get(StepFilterOnDate::class); } + #[\Override] public function getFilter() { return $this->filter; } + #[\Override] public static function getFormData(): array { $data = []; @@ -55,6 +58,7 @@ final class StepFilterTest extends AbstractFilterTest return $data; } + #[\Override] public static function getQueryBuilders(): iterable { self::bootKernel(); diff --git a/src/Bundle/ChillPersonBundle/Tests/Export/Filter/AccompanyingCourseFilters/UserJobFilterTest.php b/src/Bundle/ChillPersonBundle/Tests/Export/Filter/AccompanyingCourseFilters/UserJobFilterTest.php index b1010ffe0..4995f2bd8 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Export/Filter/AccompanyingCourseFilters/UserJobFilterTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Export/Filter/AccompanyingCourseFilters/UserJobFilterTest.php @@ -28,6 +28,7 @@ final class UserJobFilterTest extends AbstractFilterTest { private UserJobFilter $filter; + #[\Override] protected function setUp(): void { self::bootKernel(); @@ -35,11 +36,13 @@ final class UserJobFilterTest extends AbstractFilterTest $this->filter = self::getContainer()->get(UserJobFilter::class); } + #[\Override] public function getFilter() { return $this->filter; } + #[\Override] public static function getFormData(): array { self::bootKernel(); @@ -62,6 +65,7 @@ final class UserJobFilterTest extends AbstractFilterTest return $data; } + #[\Override] public static function getQueryBuilders(): iterable { self::bootKernel(); diff --git a/src/Bundle/ChillPersonBundle/Tests/Export/Filter/AccompanyingCourseFilters/UserScopeFilterTest.php b/src/Bundle/ChillPersonBundle/Tests/Export/Filter/AccompanyingCourseFilters/UserScopeFilterTest.php index ac0e5c843..6166884d0 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Export/Filter/AccompanyingCourseFilters/UserScopeFilterTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Export/Filter/AccompanyingCourseFilters/UserScopeFilterTest.php @@ -28,6 +28,7 @@ final class UserScopeFilterTest extends AbstractFilterTest { private UserScopeFilter $filter; + #[\Override] protected function setUp(): void { self::bootKernel(); @@ -35,11 +36,13 @@ final class UserScopeFilterTest extends AbstractFilterTest $this->filter = self::getContainer()->get(UserScopeFilter::class); } + #[\Override] public function getFilter() { return $this->filter; } + #[\Override] public static function getFormData(): array { self::bootKernel(); @@ -62,6 +65,7 @@ final class UserScopeFilterTest extends AbstractFilterTest ]; } + #[\Override] public static function getQueryBuilders(): iterable { self::bootKernel(); diff --git a/src/Bundle/ChillPersonBundle/Tests/Export/Filter/AccompanyingPeriodStepHistoryFilters/ByDateFilterTest.php b/src/Bundle/ChillPersonBundle/Tests/Export/Filter/AccompanyingPeriodStepHistoryFilters/ByDateFilterTest.php index a98d0c78e..6ef56cd6f 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Export/Filter/AccompanyingPeriodStepHistoryFilters/ByDateFilterTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Export/Filter/AccompanyingPeriodStepHistoryFilters/ByDateFilterTest.php @@ -27,6 +27,7 @@ class ByDateFilterTest extends AbstractFilterTest { private RollingDateConverterInterface $rollingDateConverter; + #[\Override] protected function setUp(): void { parent::setUp(); @@ -35,11 +36,13 @@ class ByDateFilterTest extends AbstractFilterTest $this->rollingDateConverter = self::getContainer()->get(RollingDateConverterInterface::class); } + #[\Override] public function getFilter() { return new ByDateFilter($this->rollingDateConverter); } + #[\Override] public static function getFormData(): array { return [ @@ -50,6 +53,7 @@ class ByDateFilterTest extends AbstractFilterTest ]; } + #[\Override] public static function getQueryBuilders(): iterable { self::bootKernel(); diff --git a/src/Bundle/ChillPersonBundle/Tests/Export/Filter/AccompanyingPeriodStepHistoryFilters/ByStepFilterTest.php b/src/Bundle/ChillPersonBundle/Tests/Export/Filter/AccompanyingPeriodStepHistoryFilters/ByStepFilterTest.php index 03bfa8435..a2e96efc9 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Export/Filter/AccompanyingPeriodStepHistoryFilters/ByStepFilterTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Export/Filter/AccompanyingPeriodStepHistoryFilters/ByStepFilterTest.php @@ -25,6 +25,7 @@ use Symfony\Contracts\Translation\TranslatorInterface; */ class ByStepFilterTest extends AbstractFilterTest { + #[\Override] public function getFilter() { $translator = new class () implements TranslatorInterface { @@ -37,6 +38,7 @@ class ByStepFilterTest extends AbstractFilterTest return new ByStepFilter($translator); } + #[\Override] public static function getFormData(): array { return [ @@ -49,6 +51,7 @@ class ByStepFilterTest extends AbstractFilterTest ]; } + #[\Override] public static function getQueryBuilders(): iterable { self::bootKernel(); diff --git a/src/Bundle/ChillPersonBundle/Tests/Export/Filter/EvaluationFilters/EvaluationTypeFilterTest.php b/src/Bundle/ChillPersonBundle/Tests/Export/Filter/EvaluationFilters/EvaluationTypeFilterTest.php index 415d2219e..487b13cd3 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Export/Filter/EvaluationFilters/EvaluationTypeFilterTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Export/Filter/EvaluationFilters/EvaluationTypeFilterTest.php @@ -26,6 +26,7 @@ final class EvaluationTypeFilterTest extends AbstractFilterTest { private EvaluationTypeFilter $filter; + #[\Override] protected function setUp(): void { self::bootKernel(); @@ -33,11 +34,13 @@ final class EvaluationTypeFilterTest extends AbstractFilterTest $this->filter = self::getContainer()->get('chill.person.export.filter_evaluationtype'); } + #[\Override] public function getFilter() { return $this->filter; } + #[\Override] public static function getFormData(): array { self::bootKernel(); @@ -58,6 +61,7 @@ final class EvaluationTypeFilterTest extends AbstractFilterTest return $data; } + #[\Override] public static function getQueryBuilders(): iterable { self::bootKernel(); diff --git a/src/Bundle/ChillPersonBundle/Tests/Export/Filter/EvaluationFilters/MaxDateFilterTest.php b/src/Bundle/ChillPersonBundle/Tests/Export/Filter/EvaluationFilters/MaxDateFilterTest.php index 42adf71c0..98a23abd3 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Export/Filter/EvaluationFilters/MaxDateFilterTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Export/Filter/EvaluationFilters/MaxDateFilterTest.php @@ -25,6 +25,7 @@ final class MaxDateFilterTest extends AbstractFilterTest { private MaxDateFilter $filter; + #[\Override] protected function setUp(): void { self::bootKernel(); @@ -32,11 +33,13 @@ final class MaxDateFilterTest extends AbstractFilterTest $this->filter = self::getContainer()->get('chill.person.export.filter_maxdate'); } + #[\Override] public function getFilter() { return $this->filter; } + #[\Override] public static function getFormData(): array { return [ @@ -45,6 +48,7 @@ final class MaxDateFilterTest extends AbstractFilterTest ]; } + #[\Override] public static function getQueryBuilders(): iterable { self::bootKernel(); diff --git a/src/Bundle/ChillPersonBundle/Tests/Export/Filter/HouseholdFilters/CompositionFilterTest.php b/src/Bundle/ChillPersonBundle/Tests/Export/Filter/HouseholdFilters/CompositionFilterTest.php index d3ab4e2de..68d6ab3cd 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Export/Filter/HouseholdFilters/CompositionFilterTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Export/Filter/HouseholdFilters/CompositionFilterTest.php @@ -27,6 +27,7 @@ final class CompositionFilterTest extends AbstractFilterTest { private CompositionFilter $filter; + #[\Override] protected function setUp(): void { self::bootKernel(); @@ -34,11 +35,13 @@ final class CompositionFilterTest extends AbstractFilterTest $this->filter = self::getContainer()->get('chill.person.export.filter_household_composition'); } + #[\Override] public function getFilter(): CompositionFilter { return $this->filter; } + #[\Override] public static function getFormData(): array { self::bootKernel(); @@ -60,6 +63,7 @@ final class CompositionFilterTest extends AbstractFilterTest return $data; } + #[\Override] public static function getQueryBuilders(): iterable { self::bootKernel(); diff --git a/src/Bundle/ChillPersonBundle/Tests/Export/Filter/PersonFilters/AgeFilterTest.php b/src/Bundle/ChillPersonBundle/Tests/Export/Filter/PersonFilters/AgeFilterTest.php index e7c12bd1b..9d4805020 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Export/Filter/PersonFilters/AgeFilterTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Export/Filter/PersonFilters/AgeFilterTest.php @@ -26,6 +26,7 @@ final class AgeFilterTest extends AbstractFilterTest { private AgeFilter $filter; + #[\Override] protected function setUp(): void { self::bootKernel(); @@ -33,11 +34,13 @@ final class AgeFilterTest extends AbstractFilterTest $this->filter = self::getContainer()->get('chill.person.export.filter_age'); } + #[\Override] public function getFilter() { return $this->filter; } + #[\Override] public static function getFormData(): array { return [ @@ -49,6 +52,7 @@ final class AgeFilterTest extends AbstractFilterTest ]; } + #[\Override] public static function getQueryBuilders(): iterable { self::bootKernel(); diff --git a/src/Bundle/ChillPersonBundle/Tests/Export/Filter/PersonFilters/BirthdateFilterTest.php b/src/Bundle/ChillPersonBundle/Tests/Export/Filter/PersonFilters/BirthdateFilterTest.php index 51d40c9c3..ff7b8e1f2 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Export/Filter/PersonFilters/BirthdateFilterTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Export/Filter/PersonFilters/BirthdateFilterTest.php @@ -26,6 +26,7 @@ final class BirthdateFilterTest extends AbstractFilterTest { private BirthdateFilter $filter; + #[\Override] protected function setUp(): void { self::bootKernel(); @@ -33,11 +34,13 @@ final class BirthdateFilterTest extends AbstractFilterTest $this->filter = self::getContainer()->get('chill.person.export.filter_birthdate'); } + #[\Override] public function getFilter() { return $this->filter; } + #[\Override] public static function getFormData(): array { return [ @@ -48,6 +51,7 @@ final class BirthdateFilterTest extends AbstractFilterTest ]; } + #[\Override] public static function getQueryBuilders(): iterable { self::bootKernel(); diff --git a/src/Bundle/ChillPersonBundle/Tests/Export/Filter/PersonFilters/DeadOrAliveFilterTest.php b/src/Bundle/ChillPersonBundle/Tests/Export/Filter/PersonFilters/DeadOrAliveFilterTest.php index 044524ff0..0fe873e21 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Export/Filter/PersonFilters/DeadOrAliveFilterTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Export/Filter/PersonFilters/DeadOrAliveFilterTest.php @@ -26,6 +26,7 @@ final class DeadOrAliveFilterTest extends AbstractFilterTest { private DeadOrAliveFilter $filter; + #[\Override] protected function setUp(): void { self::bootKernel(); @@ -33,11 +34,13 @@ final class DeadOrAliveFilterTest extends AbstractFilterTest $this->filter = self::getContainer()->get('chill.person.export.filter_dead_or_alive'); } + #[\Override] public function getFilter() { return $this->filter; } + #[\Override] public static function getFormData(): array { return [ @@ -52,6 +55,7 @@ final class DeadOrAliveFilterTest extends AbstractFilterTest ]; } + #[\Override] public static function getQueryBuilders(): iterable { self::bootKernel(); diff --git a/src/Bundle/ChillPersonBundle/Tests/Export/Filter/PersonFilters/DeathdateFilterTest.php b/src/Bundle/ChillPersonBundle/Tests/Export/Filter/PersonFilters/DeathdateFilterTest.php index 419f8d6bd..b1ac00853 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Export/Filter/PersonFilters/DeathdateFilterTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Export/Filter/PersonFilters/DeathdateFilterTest.php @@ -26,6 +26,7 @@ final class DeathdateFilterTest extends AbstractFilterTest { private DeathdateFilter $filter; + #[\Override] protected function setUp(): void { self::bootKernel(); @@ -33,11 +34,13 @@ final class DeathdateFilterTest extends AbstractFilterTest $this->filter = self::getContainer()->get('chill.person.export.filter_deathdate'); } + #[\Override] public function getFilter() { return $this->filter; } + #[\Override] public static function getFormData(): array { return [ @@ -48,6 +51,7 @@ final class DeathdateFilterTest extends AbstractFilterTest ]; } + #[\Override] public static function getQueryBuilders(): iterable { self::bootKernel(); diff --git a/src/Bundle/ChillPersonBundle/Tests/Export/Filter/PersonFilters/GenderFilterTest.php b/src/Bundle/ChillPersonBundle/Tests/Export/Filter/PersonFilters/GenderFilterTest.php index 2d67987d4..9845fe7ca 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Export/Filter/PersonFilters/GenderFilterTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Export/Filter/PersonFilters/GenderFilterTest.php @@ -25,6 +25,7 @@ final class GenderFilterTest extends AbstractFilterTest { private GenderFilter $filter; + #[\Override] protected function setUp(): void { self::bootKernel(); @@ -32,11 +33,13 @@ final class GenderFilterTest extends AbstractFilterTest $this->filter = self::getContainer()->get('chill.person.export.filter_gender'); } + #[\Override] public function getFilter() { return $this->filter; } + #[\Override] public static function getFormData(): array { return [ @@ -52,6 +55,7 @@ final class GenderFilterTest extends AbstractFilterTest ]; } + #[\Override] public static function getQueryBuilders(): iterable { self::bootKernel(); diff --git a/src/Bundle/ChillPersonBundle/Tests/Export/Filter/PersonFilters/MaritalStatusFilterTest.php b/src/Bundle/ChillPersonBundle/Tests/Export/Filter/PersonFilters/MaritalStatusFilterTest.php index 6c51b08d3..71b2680f8 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Export/Filter/PersonFilters/MaritalStatusFilterTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Export/Filter/PersonFilters/MaritalStatusFilterTest.php @@ -26,6 +26,7 @@ final class MaritalStatusFilterTest extends AbstractFilterTest { private MaritalStatusFilter $filter; + #[\Override] protected function setUp(): void { self::bootKernel(); @@ -33,11 +34,13 @@ final class MaritalStatusFilterTest extends AbstractFilterTest $this->filter = self::getContainer()->get('chill.person.export.filter_marital_status'); } + #[\Override] public function getFilter() { return $this->filter; } + #[\Override] public static function getFormData(): array { self::bootKernel(); @@ -58,6 +61,7 @@ final class MaritalStatusFilterTest extends AbstractFilterTest return $data; } + #[\Override] public static function getQueryBuilders(): iterable { self::bootKernel(); diff --git a/src/Bundle/ChillPersonBundle/Tests/Export/Filter/PersonFilters/NationalityFilterTest.php b/src/Bundle/ChillPersonBundle/Tests/Export/Filter/PersonFilters/NationalityFilterTest.php index b8d71a62d..a061bb6af 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Export/Filter/PersonFilters/NationalityFilterTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Export/Filter/PersonFilters/NationalityFilterTest.php @@ -26,6 +26,7 @@ final class NationalityFilterTest extends AbstractFilterTest { private NationalityFilter $filter; + #[\Override] protected function setUp(): void { self::bootKernel(); @@ -33,11 +34,13 @@ final class NationalityFilterTest extends AbstractFilterTest $this->filter = self::getContainer()->get('chill.person.export.filter_nationality'); } + #[\Override] public function getFilter() { return $this->filter; } + #[\Override] public static function getFormData(): array { self::bootKernel(); @@ -53,6 +56,7 @@ final class NationalityFilterTest extends AbstractFilterTest return $data; } + #[\Override] public static function getQueryBuilders(): iterable { self::bootKernel(); diff --git a/src/Bundle/ChillPersonBundle/Tests/Export/Filter/PersonFilters/ResidentialAddressAtThirdpartyFilterTest.php b/src/Bundle/ChillPersonBundle/Tests/Export/Filter/PersonFilters/ResidentialAddressAtThirdpartyFilterTest.php index ed5138511..d64a66b97 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Export/Filter/PersonFilters/ResidentialAddressAtThirdpartyFilterTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Export/Filter/PersonFilters/ResidentialAddressAtThirdpartyFilterTest.php @@ -29,6 +29,7 @@ final class ResidentialAddressAtThirdpartyFilterTest extends AbstractFilterTest { private ResidentialAddressAtThirdpartyFilter $filter; + #[\Override] protected function setUp(): void { self::bootKernel(); @@ -36,11 +37,13 @@ final class ResidentialAddressAtThirdpartyFilterTest extends AbstractFilterTest $this->filter = self::getContainer()->get('chill.person.export.filter_residential_address_at_thirdparty'); } + #[\Override] public function getFilter() { return $this->filter; } + #[\Override] public static function getFormData(): array { self::bootKernel(); @@ -62,6 +65,7 @@ final class ResidentialAddressAtThirdpartyFilterTest extends AbstractFilterTest return $data; } + #[\Override] public static function getQueryBuilders(): iterable { self::bootKernel(); diff --git a/src/Bundle/ChillPersonBundle/Tests/Export/Filter/PersonFilters/ResidentialAddressAtUserFilterTest.php b/src/Bundle/ChillPersonBundle/Tests/Export/Filter/PersonFilters/ResidentialAddressAtUserFilterTest.php index bbb31febe..15f68a996 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Export/Filter/PersonFilters/ResidentialAddressAtUserFilterTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Export/Filter/PersonFilters/ResidentialAddressAtUserFilterTest.php @@ -27,6 +27,7 @@ final class ResidentialAddressAtUserFilterTest extends AbstractFilterTest { private ResidentialAddressAtUserFilter $filter; + #[\Override] protected function setUp(): void { self::bootKernel(); @@ -34,11 +35,13 @@ final class ResidentialAddressAtUserFilterTest extends AbstractFilterTest $this->filter = self::getContainer()->get('chill.person.export.filter_residential_address_at_user'); } + #[\Override] public function getFilter() { return $this->filter; } + #[\Override] public static function getFormData(): array { return [ @@ -46,6 +49,7 @@ final class ResidentialAddressAtUserFilterTest extends AbstractFilterTest ]; } + #[\Override] public static function getQueryBuilders(): iterable { self::bootKernel(); diff --git a/src/Bundle/ChillPersonBundle/Tests/Export/Filter/PersonFilters/WithParticipationBetweenDatesFilterTest.php b/src/Bundle/ChillPersonBundle/Tests/Export/Filter/PersonFilters/WithParticipationBetweenDatesFilterTest.php index d9b86c81b..0ac6063c7 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Export/Filter/PersonFilters/WithParticipationBetweenDatesFilterTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Export/Filter/PersonFilters/WithParticipationBetweenDatesFilterTest.php @@ -26,6 +26,7 @@ final class WithParticipationBetweenDatesFilterTest extends AbstractFilterTest { private WithParticipationBetweenDatesFilter $filter; + #[\Override] protected function setUp(): void { self::bootKernel(); @@ -33,11 +34,13 @@ final class WithParticipationBetweenDatesFilterTest extends AbstractFilterTest $this->filter = self::getContainer()->get(WithParticipationBetweenDatesFilter::class); } + #[\Override] public function getFilter() { return $this->filter; } + #[\Override] public static function getFormData(): array { return [ @@ -48,6 +51,7 @@ final class WithParticipationBetweenDatesFilterTest extends AbstractFilterTest ]; } + #[\Override] public static function getQueryBuilders(): iterable { self::bootKernel(); diff --git a/src/Bundle/ChillPersonBundle/Tests/Export/Filter/SocialWorkFilters/CreatorFilterTest.php b/src/Bundle/ChillPersonBundle/Tests/Export/Filter/SocialWorkFilters/CreatorFilterTest.php index e7c4ee8e6..0eb6661b0 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Export/Filter/SocialWorkFilters/CreatorFilterTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Export/Filter/SocialWorkFilters/CreatorFilterTest.php @@ -26,6 +26,7 @@ class CreatorFilterTest extends AbstractFilterTest { private CreatorFilter $filter; + #[\Override] protected function setUp(): void { self::bootKernel(); @@ -33,11 +34,13 @@ class CreatorFilterTest extends AbstractFilterTest $this->filter = self::getContainer()->get(CreatorFilter::class); } + #[\Override] public function getFilter() { return $this->filter; } + #[\Override] public static function getFormData(): array { self::bootKernel(); @@ -53,6 +56,7 @@ class CreatorFilterTest extends AbstractFilterTest ]; } + #[\Override] public static function getQueryBuilders(): iterable { self::bootKernel(); diff --git a/src/Bundle/ChillPersonBundle/Tests/Export/Filter/SocialWorkFilters/CreatorJobFilterTest.php b/src/Bundle/ChillPersonBundle/Tests/Export/Filter/SocialWorkFilters/CreatorJobFilterTest.php index 19d6631e8..ba7b2143a 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Export/Filter/SocialWorkFilters/CreatorJobFilterTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Export/Filter/SocialWorkFilters/CreatorJobFilterTest.php @@ -27,6 +27,7 @@ class CreatorJobFilterTest extends AbstractFilterTest { private CreatorJobFilter $filter; + #[\Override] protected function setUp(): void { self::bootKernel(); @@ -34,11 +35,13 @@ class CreatorJobFilterTest extends AbstractFilterTest $this->filter = self::getContainer()->get(CreatorJobFilter::class); } + #[\Override] public function getFilter() { return $this->filter; } + #[\Override] public static function getFormData(): array { self::bootKernel(); @@ -54,6 +57,7 @@ class CreatorJobFilterTest extends AbstractFilterTest ]; } + #[\Override] public static function getQueryBuilders(): iterable { self::bootKernel(); diff --git a/src/Bundle/ChillPersonBundle/Tests/Export/Filter/SocialWorkFilters/CreatorScopeFilterTest.php b/src/Bundle/ChillPersonBundle/Tests/Export/Filter/SocialWorkFilters/CreatorScopeFilterTest.php index 3e1f98d3e..15cab8c28 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Export/Filter/SocialWorkFilters/CreatorScopeFilterTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Export/Filter/SocialWorkFilters/CreatorScopeFilterTest.php @@ -26,6 +26,7 @@ class CreatorScopeFilterTest extends AbstractFilterTest { private CreatorScopeFilter $filter; + #[\Override] protected function setUp(): void { self::bootKernel(); @@ -33,11 +34,13 @@ class CreatorScopeFilterTest extends AbstractFilterTest $this->filter = self::getContainer()->get(CreatorScopeFilter::class); } + #[\Override] public function getFilter() { return $this->filter; } + #[\Override] public static function getFormData(): array { self::bootKernel(); @@ -53,6 +56,7 @@ class CreatorScopeFilterTest extends AbstractFilterTest ]; } + #[\Override] public static function getQueryBuilders(): iterable { self::bootKernel(); diff --git a/src/Bundle/ChillPersonBundle/Tests/Export/Filter/SocialWorkFilters/HandlingThirdPartyFilterTest.php b/src/Bundle/ChillPersonBundle/Tests/Export/Filter/SocialWorkFilters/HandlingThirdPartyFilterTest.php index 46a1a95e1..bd53b160b 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Export/Filter/SocialWorkFilters/HandlingThirdPartyFilterTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Export/Filter/SocialWorkFilters/HandlingThirdPartyFilterTest.php @@ -27,6 +27,7 @@ class HandlingThirdPartyFilterTest extends AbstractFilterTest { private ThirdPartyRender $thirdPartyRender; + #[\Override] protected function setUp(): void { parent::setUp(); @@ -34,11 +35,13 @@ class HandlingThirdPartyFilterTest extends AbstractFilterTest $this->thirdPartyRender = self::getContainer()->get(ThirdPartyRender::class); } + #[\Override] public function getFilter() { return new HandlingThirdPartyFilter($this->thirdPartyRender); } + #[\Override] public static function getFormData(): array { self::bootKernel(); @@ -54,6 +57,7 @@ class HandlingThirdPartyFilterTest extends AbstractFilterTest ]; } + #[\Override] public static function getQueryBuilders(): iterable { self::bootKernel(); diff --git a/src/Bundle/ChillPersonBundle/Tests/Export/Filter/SocialWorkFilters/JobFilterTest.php b/src/Bundle/ChillPersonBundle/Tests/Export/Filter/SocialWorkFilters/JobFilterTest.php index fbe232941..1cd52d849 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Export/Filter/SocialWorkFilters/JobFilterTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Export/Filter/SocialWorkFilters/JobFilterTest.php @@ -27,6 +27,7 @@ final class JobFilterTest extends AbstractFilterTest { private JobFilter $filter; + #[\Override] protected function setUp(): void { self::bootKernel(); @@ -34,11 +35,13 @@ final class JobFilterTest extends AbstractFilterTest $this->filter = self::getContainer()->get('chill.person.export.filter_job'); } + #[\Override] public function getFilter() { return $this->filter; } + #[\Override] public static function getFormData(): array { self::bootKernel(); @@ -54,6 +57,7 @@ final class JobFilterTest extends AbstractFilterTest ]; } + #[\Override] public static function getQueryBuilders(): iterable { self::bootKernel(); diff --git a/src/Bundle/ChillPersonBundle/Tests/Export/Filter/SocialWorkFilters/ReferrerFilterTest.php b/src/Bundle/ChillPersonBundle/Tests/Export/Filter/SocialWorkFilters/ReferrerFilterTest.php index d185ac499..2083d06b0 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Export/Filter/SocialWorkFilters/ReferrerFilterTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Export/Filter/SocialWorkFilters/ReferrerFilterTest.php @@ -27,6 +27,7 @@ final class ReferrerFilterTest extends AbstractFilterTest { private ReferrerFilter $filter; + #[\Override] protected function setUp(): void { self::bootKernel(); @@ -34,11 +35,13 @@ final class ReferrerFilterTest extends AbstractFilterTest $this->filter = self::getContainer()->get('chill.person.export.filter_treatingagent'); } + #[\Override] public function getFilter() { return $this->filter; } + #[\Override] public static function getFormData(): array { self::bootKernel(); @@ -59,6 +62,7 @@ final class ReferrerFilterTest extends AbstractFilterTest return $data; } + #[\Override] public static function getQueryBuilders(): iterable { self::bootKernel(); diff --git a/src/Bundle/ChillPersonBundle/Tests/Export/Filter/SocialWorkFilters/ScopeFilterTest.php b/src/Bundle/ChillPersonBundle/Tests/Export/Filter/SocialWorkFilters/ScopeFilterTest.php index cc47a598f..9107a7e21 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Export/Filter/SocialWorkFilters/ScopeFilterTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Export/Filter/SocialWorkFilters/ScopeFilterTest.php @@ -26,6 +26,7 @@ final class ScopeFilterTest extends AbstractFilterTest { private ScopeFilter $filter; + #[\Override] protected function setUp(): void { self::bootKernel(); @@ -33,11 +34,13 @@ final class ScopeFilterTest extends AbstractFilterTest $this->filter = self::getContainer()->get('chill.person.export.filter_scope'); } + #[\Override] public function getFilter() { return $this->filter; } + #[\Override] public static function getFormData(): array { self::bootKernel(); @@ -53,6 +56,7 @@ final class ScopeFilterTest extends AbstractFilterTest ]; } + #[\Override] public static function getQueryBuilders(): iterable { self::bootKernel(); diff --git a/src/Bundle/ChillPersonBundle/Tests/Export/Filter/SocialWorkFilters/WithEvaluationBetweenDatesFilterTest.php b/src/Bundle/ChillPersonBundle/Tests/Export/Filter/SocialWorkFilters/WithEvaluationBetweenDatesFilterTest.php index b2dc7c217..b94cc74a4 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Export/Filter/SocialWorkFilters/WithEvaluationBetweenDatesFilterTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Export/Filter/SocialWorkFilters/WithEvaluationBetweenDatesFilterTest.php @@ -26,6 +26,7 @@ final class WithEvaluationBetweenDatesFilterTest extends AbstractFilterTest { private AccompanyingPeriodWorkWithEvaluationBetweenDatesFilter $filter; + #[\Override] protected function setUp(): void { self::bootKernel(); @@ -33,11 +34,13 @@ final class WithEvaluationBetweenDatesFilterTest extends AbstractFilterTest $this->filter = self::getContainer()->get(AccompanyingPeriodWorkWithEvaluationBetweenDatesFilter::class); } + #[\Override] public function getFilter() { return $this->filter; } + #[\Override] public static function getFormData(): array { return [ @@ -48,6 +51,7 @@ final class WithEvaluationBetweenDatesFilterTest extends AbstractFilterTest ]; } + #[\Override] public static function getQueryBuilders() { self::bootKernel(); diff --git a/src/Bundle/ChillPersonBundle/Tests/Export/Helper/FilterListAccompanyingPeriodHelperTest.php b/src/Bundle/ChillPersonBundle/Tests/Export/Helper/FilterListAccompanyingPeriodHelperTest.php index 0cdbea864..f4ae410e1 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Export/Helper/FilterListAccompanyingPeriodHelperTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Export/Helper/FilterListAccompanyingPeriodHelperTest.php @@ -42,6 +42,7 @@ final class FilterListAccompanyingPeriodHelperTest extends KernelTestCase private ScopeRepositoryInterface $scopeRepository; private EntityManagerInterface $entityManager; + #[\Override] protected function setUp(): void { parent::setUp(); diff --git a/src/Bundle/ChillPersonBundle/Tests/Form/Type/PickPersonTypeTest.php b/src/Bundle/ChillPersonBundle/Tests/Form/Type/PickPersonTypeTest.php index 4b879149c..ae1a582b0 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Form/Type/PickPersonTypeTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Form/Type/PickPersonTypeTest.php @@ -32,6 +32,7 @@ final class PickPersonTypeTest extends KernelTestCase */ protected $user; + #[\Override] protected function setUp(): void { self::bootKernel(); diff --git a/src/Bundle/ChillPersonBundle/Tests/Household/MembersEditorTest.php b/src/Bundle/ChillPersonBundle/Tests/Household/MembersEditorTest.php index 99515562c..983b991b3 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Household/MembersEditorTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Household/MembersEditorTest.php @@ -34,6 +34,7 @@ final class MembersEditorTest extends TestCase private MembersEditorFactory $factory; + #[\Override] protected function setUp(): void { $this->factory = $this->buildMembersEditorFactory(); diff --git a/src/Bundle/ChillPersonBundle/Tests/Repository/AccompanyingPeriodACLAwareRepositoryTest.php b/src/Bundle/ChillPersonBundle/Tests/Repository/AccompanyingPeriodACLAwareRepositoryTest.php index 9781a8e96..3c985ea5a 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Repository/AccompanyingPeriodACLAwareRepositoryTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Repository/AccompanyingPeriodACLAwareRepositoryTest.php @@ -58,6 +58,7 @@ class AccompanyingPeriodACLAwareRepositoryTest extends KernelTestCase */ private static array $entitiesToDelete = []; + #[\Override] protected function setUp(): void { self::bootKernel(); @@ -69,6 +70,7 @@ class AccompanyingPeriodACLAwareRepositoryTest extends KernelTestCase $this->registry = self::getContainer()->get(Registry::class); } + #[\Override] public static function tearDownAfterClass(): void { self::bootKernel(); diff --git a/src/Bundle/ChillPersonBundle/Tests/Repository/PersonACLAwareRepositoryTest.php b/src/Bundle/ChillPersonBundle/Tests/Repository/PersonACLAwareRepositoryTest.php index 94df35d88..fcf72a110 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Repository/PersonACLAwareRepositoryTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Repository/PersonACLAwareRepositoryTest.php @@ -39,6 +39,7 @@ final class PersonACLAwareRepositoryTest extends KernelTestCase private EntityManagerInterface $entityManager; + #[\Override] protected function setUp(): void { self::bootKernel(); diff --git a/src/Bundle/ChillPersonBundle/Tests/Repository/UserRepositoryTest.php b/src/Bundle/ChillPersonBundle/Tests/Repository/UserRepositoryTest.php index 4ff03749b..43df216f1 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Repository/UserRepositoryTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Repository/UserRepositoryTest.php @@ -23,6 +23,7 @@ class UserRepositoryTest extends KernelTestCase { private UserRepository $userRepository; + #[\Override] protected function setUp(): void { parent::setUp(); diff --git a/src/Bundle/ChillPersonBundle/Tests/Search/PersonSearchTest.php b/src/Bundle/ChillPersonBundle/Tests/Search/PersonSearchTest.php index 1577ef2fe..9398779da 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Search/PersonSearchTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Search/PersonSearchTest.php @@ -25,6 +25,7 @@ final class PersonSearchTest extends WebTestCase { use PrepareClientTrait; + #[\Override] protected function tearDown(): void { self::ensureKernelShutdown(); diff --git a/src/Bundle/ChillPersonBundle/Tests/Security/Authorization/PersonVoterTest.php b/src/Bundle/ChillPersonBundle/Tests/Security/Authorization/PersonVoterTest.php index da46b8eb7..967db330a 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Security/Authorization/PersonVoterTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Security/Authorization/PersonVoterTest.php @@ -45,6 +45,7 @@ final class PersonVoterTest extends KernelTestCase */ protected $voter; + #[\Override] protected function setUp(): void { self::bootKernel(); diff --git a/src/Bundle/ChillPersonBundle/Tests/Serializer/Normalizer/AccompanyingPeriodDocGenNormalizerTest.php b/src/Bundle/ChillPersonBundle/Tests/Serializer/Normalizer/AccompanyingPeriodDocGenNormalizerTest.php index 99cf07488..e35787fc8 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Serializer/Normalizer/AccompanyingPeriodDocGenNormalizerTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Serializer/Normalizer/AccompanyingPeriodDocGenNormalizerTest.php @@ -27,6 +27,7 @@ final class AccompanyingPeriodDocGenNormalizerTest extends KernelTestCase { private NormalizerInterface $normalizer; + #[\Override] protected function setUp(): void { self::bootKernel(); diff --git a/src/Bundle/ChillPersonBundle/Tests/Serializer/Normalizer/AccompanyingPeriodOriginNormalizerTest.php b/src/Bundle/ChillPersonBundle/Tests/Serializer/Normalizer/AccompanyingPeriodOriginNormalizerTest.php index 5e775a53f..de2ecbac4 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Serializer/Normalizer/AccompanyingPeriodOriginNormalizerTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Serializer/Normalizer/AccompanyingPeriodOriginNormalizerTest.php @@ -24,6 +24,7 @@ final class AccompanyingPeriodOriginNormalizerTest extends KernelTestCase { private NormalizerInterface $normalizer; + #[\Override] protected function setUp(): void { self::bootKernel(); diff --git a/src/Bundle/ChillPersonBundle/Tests/Serializer/Normalizer/AccompanyingPeriodResourceNormalizerTest.php b/src/Bundle/ChillPersonBundle/Tests/Serializer/Normalizer/AccompanyingPeriodResourceNormalizerTest.php index 35fbecbf2..9e5d4a5ad 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Serializer/Normalizer/AccompanyingPeriodResourceNormalizerTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Serializer/Normalizer/AccompanyingPeriodResourceNormalizerTest.php @@ -25,6 +25,7 @@ final class AccompanyingPeriodResourceNormalizerTest extends KernelTestCase { private NormalizerInterface $normalizer; + #[\Override] protected function setUp(): void { self::bootKernel(); diff --git a/src/Bundle/ChillPersonBundle/Tests/Serializer/Normalizer/AccompanyingPeriodWorkDocGenNormalizerTest.php b/src/Bundle/ChillPersonBundle/Tests/Serializer/Normalizer/AccompanyingPeriodWorkDocGenNormalizerTest.php index 961a016f8..45189e89f 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Serializer/Normalizer/AccompanyingPeriodWorkDocGenNormalizerTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Serializer/Normalizer/AccompanyingPeriodWorkDocGenNormalizerTest.php @@ -32,12 +32,14 @@ final class AccompanyingPeriodWorkDocGenNormalizerTest extends DocGenNormalizerT { private NormalizerInterface $normalizer; + #[\Override] protected function setUp(): void { parent::bootKernel(); $this->normalizer = self::getContainer()->get(NormalizerInterface::class); } + #[\Override] public function provideNotNullObject(): object { $work = new AccompanyingPeriodWork(); @@ -55,11 +57,13 @@ final class AccompanyingPeriodWorkDocGenNormalizerTest extends DocGenNormalizerT return $work; } + #[\Override] public function provideDocGenExpectClass(): string { return AccompanyingPeriodWork::class; } + #[\Override] public function getNormalizer(): NormalizerInterface { return $this->normalizer; diff --git a/src/Bundle/ChillPersonBundle/Tests/Serializer/Normalizer/AccompanyingPeriodWorkEvaluationDenormalizerTest.php b/src/Bundle/ChillPersonBundle/Tests/Serializer/Normalizer/AccompanyingPeriodWorkEvaluationDenormalizerTest.php index 4ab4b667e..6f0099b25 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Serializer/Normalizer/AccompanyingPeriodWorkEvaluationDenormalizerTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Serializer/Normalizer/AccompanyingPeriodWorkEvaluationDenormalizerTest.php @@ -25,7 +25,7 @@ use Symfony\Component\Serializer\Normalizer\AbstractNormalizer; */ final class AccompanyingPeriodWorkEvaluationDenormalizerTest extends TestCase { - private const ENCODED_DATA = ' { + private const string ENCODED_DATA = ' { "type": "accompanying_period_work_evaluation", "key": 0, "evaluation": { diff --git a/src/Bundle/ChillPersonBundle/Tests/Serializer/Normalizer/HouseholdNormalizerTest.php b/src/Bundle/ChillPersonBundle/Tests/Serializer/Normalizer/HouseholdNormalizerTest.php index 24ec19742..c65938099 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Serializer/Normalizer/HouseholdNormalizerTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Serializer/Normalizer/HouseholdNormalizerTest.php @@ -33,6 +33,7 @@ final class HouseholdNormalizerTest extends KernelTestCase private readonly array $toDelete; + #[\Override] protected function setUp(): void { self::bootKernel(); diff --git a/src/Bundle/ChillPersonBundle/Tests/Serializer/Normalizer/PersonDocGenNormalizerTest.php b/src/Bundle/ChillPersonBundle/Tests/Serializer/Normalizer/PersonDocGenNormalizerTest.php index 4c7ceee42..89721bd46 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Serializer/Normalizer/PersonDocGenNormalizerTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Serializer/Normalizer/PersonDocGenNormalizerTest.php @@ -38,7 +38,7 @@ final class PersonDocGenNormalizerTest extends KernelTestCase { use ProphecyTrait; - private const BLANK = [ + private const array BLANK = [ 'id' => '', 'center' => '', 'firstName' => '', @@ -70,6 +70,7 @@ final class PersonDocGenNormalizerTest extends KernelTestCase private NormalizerInterface $normalizer; + #[\Override] protected function setUp(): void { self::bootKernel(); diff --git a/src/Bundle/ChillPersonBundle/Tests/Serializer/Normalizer/PersonJsonNormalizerTest.php b/src/Bundle/ChillPersonBundle/Tests/Serializer/Normalizer/PersonJsonNormalizerTest.php index f60278d5f..667a6cb89 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Serializer/Normalizer/PersonJsonNormalizerTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Serializer/Normalizer/PersonJsonNormalizerTest.php @@ -35,6 +35,7 @@ final class PersonJsonNormalizerTest extends KernelTestCase private PersonJsonNormalizer $normalizer; + #[\Override] protected function setUp(): void { self::bootKernel(); diff --git a/src/Bundle/ChillPersonBundle/Tests/Serializer/Normalizer/ResourceJsonNormalizerTest.php b/src/Bundle/ChillPersonBundle/Tests/Serializer/Normalizer/ResourceJsonNormalizerTest.php index c2776b4dc..bb6f13e32 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Serializer/Normalizer/ResourceJsonNormalizerTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Serializer/Normalizer/ResourceJsonNormalizerTest.php @@ -25,6 +25,7 @@ final class ResourceJsonNormalizerTest extends KernelTestCase { private DenormalizerInterface $denormalizer; + #[\Override] protected function setUp(): void { self::bootKernel(); diff --git a/src/Bundle/ChillPersonBundle/Tests/Serializer/Normalizer/SocialActionNormalizerTest.php b/src/Bundle/ChillPersonBundle/Tests/Serializer/Normalizer/SocialActionNormalizerTest.php index 2d8bf9474..b234a4b41 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Serializer/Normalizer/SocialActionNormalizerTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Serializer/Normalizer/SocialActionNormalizerTest.php @@ -24,6 +24,7 @@ final class SocialActionNormalizerTest extends KernelTestCase { private NormalizerInterface $normalizer; + #[\Override] protected function setUp(): void { self::bootKernel(); diff --git a/src/Bundle/ChillPersonBundle/Tests/Serializer/Normalizer/SocialIssueNormalizerTest.php b/src/Bundle/ChillPersonBundle/Tests/Serializer/Normalizer/SocialIssueNormalizerTest.php index 6a7a63341..648456438 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Serializer/Normalizer/SocialIssueNormalizerTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Serializer/Normalizer/SocialIssueNormalizerTest.php @@ -24,6 +24,7 @@ final class SocialIssueNormalizerTest extends KernelTestCase { private NormalizerInterface $normalizer; + #[\Override] protected function setUp(): void { self::bootKernel(); diff --git a/src/Bundle/ChillPersonBundle/Tests/Service/DocGenerator/AccompanyingPeriodContextTest.php b/src/Bundle/ChillPersonBundle/Tests/Service/DocGenerator/AccompanyingPeriodContextTest.php index c73de9f78..213e35df2 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Service/DocGenerator/AccompanyingPeriodContextTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Service/DocGenerator/AccompanyingPeriodContextTest.php @@ -55,6 +55,7 @@ class AccompanyingPeriodContextTest extends KernelTestCase private ThirdPartyRepository $thirdPartyRepository; + #[\Override] protected function setUp(): void { self::bootKernel(); diff --git a/src/Bundle/ChillPersonBundle/Tests/Service/GenericDoc/Providers/AccompanyingPeriodCalendarGenericDocProviderTest.php b/src/Bundle/ChillPersonBundle/Tests/Service/GenericDoc/Providers/AccompanyingPeriodCalendarGenericDocProviderTest.php index cae53d9a5..6ca5b017c 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Service/GenericDoc/Providers/AccompanyingPeriodCalendarGenericDocProviderTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Service/GenericDoc/Providers/AccompanyingPeriodCalendarGenericDocProviderTest.php @@ -35,6 +35,7 @@ class AccompanyingPeriodCalendarGenericDocProviderTest extends KernelTestCase private EntityManagerInterface $entityManager; + #[\Override] protected function setUp(): void { self::bootKernel(); diff --git a/src/Bundle/ChillPersonBundle/Tests/Service/GenericDoc/Providers/AccompanyingPeriodWorkEvaluationGenericDocProviderTest.php b/src/Bundle/ChillPersonBundle/Tests/Service/GenericDoc/Providers/AccompanyingPeriodWorkEvaluationGenericDocProviderTest.php index 8d49a54e8..7b9e06089 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Service/GenericDoc/Providers/AccompanyingPeriodWorkEvaluationGenericDocProviderTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Service/GenericDoc/Providers/AccompanyingPeriodWorkEvaluationGenericDocProviderTest.php @@ -29,6 +29,7 @@ class AccompanyingPeriodWorkEvaluationGenericDocProviderTest extends KernelTestC use ProphecyTrait; private EntityManagerInterface $entityManager; + #[\Override] protected function setUp(): void { self::bootKernel(); diff --git a/src/Bundle/ChillPersonBundle/Tests/Service/GenericDoc/Providers/PersonCalendarGenericDocProviderTest.php b/src/Bundle/ChillPersonBundle/Tests/Service/GenericDoc/Providers/PersonCalendarGenericDocProviderTest.php index fe11c2374..6f79871f0 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Service/GenericDoc/Providers/PersonCalendarGenericDocProviderTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Service/GenericDoc/Providers/PersonCalendarGenericDocProviderTest.php @@ -29,6 +29,7 @@ class PersonCalendarGenericDocProviderTest extends KernelTestCase private EntityManagerInterface $entityManager; + #[\Override] protected function setUp(): void { self::bootKernel(); diff --git a/src/Bundle/ChillPersonBundle/Tests/Templating/Entity/ClosingMotiveRenderTest.php b/src/Bundle/ChillPersonBundle/Tests/Templating/Entity/ClosingMotiveRenderTest.php index e85267981..af3cb0eca 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Templating/Entity/ClosingMotiveRenderTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Templating/Entity/ClosingMotiveRenderTest.php @@ -24,6 +24,7 @@ class ClosingMotiveRenderTest extends KernelTestCase { private static ClosingMotiveRender $closingMotiveRender; + #[\Override] public static function setUpBeforeClass(): void { self::bootKernel(); diff --git a/src/Bundle/ChillPersonBundle/Tests/Validation/PersonValidationTest.php b/src/Bundle/ChillPersonBundle/Tests/Validation/PersonValidationTest.php index 97280fa1f..4cd9dc7e4 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Validation/PersonValidationTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Validation/PersonValidationTest.php @@ -25,6 +25,7 @@ class PersonValidationTest extends KernelTestCase { private static ValidatorInterface $validator; + #[\Override] public static function setUpBeforeClass(): void { self::bootKernel(); diff --git a/src/Bundle/ChillPersonBundle/Tests/Validator/AccompanyingPeriod/LocationValidityValidatorTest.php b/src/Bundle/ChillPersonBundle/Tests/Validator/AccompanyingPeriod/LocationValidityValidatorTest.php index 72747b478..c14a66666 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Validator/AccompanyingPeriod/LocationValidityValidatorTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Validator/AccompanyingPeriod/LocationValidityValidatorTest.php @@ -111,6 +111,7 @@ final class LocationValidityValidatorTest extends ConstraintValidatorTestCase $this->assertNoViolation(); } + #[\Override] protected function createValidator() { $render = $this->createMock(PersonRender::class); diff --git a/src/Bundle/ChillPersonBundle/Tests/Validator/AccompanyingPeriod/ParticipationOverlapValidatorTest.php b/src/Bundle/ChillPersonBundle/Tests/Validator/AccompanyingPeriod/ParticipationOverlapValidatorTest.php index 8adfcf634..dbb732e9e 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Validator/AccompanyingPeriod/ParticipationOverlapValidatorTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Validator/AccompanyingPeriod/ParticipationOverlapValidatorTest.php @@ -97,6 +97,7 @@ class ParticipationOverlapValidatorTest extends ConstraintValidatorTestCase $this->assertNoViolation(); } + #[\Override] protected function createValidator(): ParticipationOverlapValidator { $personRender = $this->prophesize(PersonRenderInterface::class); diff --git a/src/Bundle/ChillPersonBundle/Tests/Validator/Household/HouseholdMembershipSequentialValidatorTest.php b/src/Bundle/ChillPersonBundle/Tests/Validator/Household/HouseholdMembershipSequentialValidatorTest.php index da747a52c..6e2ccae2d 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Validator/Household/HouseholdMembershipSequentialValidatorTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Validator/Household/HouseholdMembershipSequentialValidatorTest.php @@ -88,6 +88,7 @@ final class HouseholdMembershipSequentialValidatorTest extends ConstraintValidat $this->assertNoViolation(); } + #[\Override] protected function createValidator() { $render = $this->createMock(PersonRender::class); diff --git a/src/Bundle/ChillPersonBundle/Tests/Validator/Household/MaxHolderValidatorTest.php b/src/Bundle/ChillPersonBundle/Tests/Validator/Household/MaxHolderValidatorTest.php index 2880afb35..415000146 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Validator/Household/MaxHolderValidatorTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Validator/Household/MaxHolderValidatorTest.php @@ -73,6 +73,7 @@ final class MaxHolderValidatorTest extends ConstraintValidatorTestCase ->assertRaised(); } + #[\Override] protected function createValidator() { return new MaxHolderValidator(); diff --git a/src/Bundle/ChillPersonBundle/Tests/Validator/Person/BirthdateValidatorTest.php b/src/Bundle/ChillPersonBundle/Tests/Validator/Person/BirthdateValidatorTest.php index 4be918d60..dd32fcce0 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Validator/Person/BirthdateValidatorTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Validator/Person/BirthdateValidatorTest.php @@ -64,6 +64,7 @@ final class BirthdateValidatorTest extends ConstraintValidatorTestCase $this->assertNoViolation(); } + #[\Override] protected function createValidator() { return new BirthdateValidator( diff --git a/src/Bundle/ChillPersonBundle/Tests/Validator/Person/PersonHasCenterValidatorTest.php b/src/Bundle/ChillPersonBundle/Tests/Validator/Person/PersonHasCenterValidatorTest.php index a14f77bda..87357dc8a 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Validator/Person/PersonHasCenterValidatorTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Validator/Person/PersonHasCenterValidatorTest.php @@ -45,6 +45,7 @@ final class PersonHasCenterValidatorTest extends ConstraintValidatorTestCase ->assertRaised(); } + #[\Override] protected function createValidator() { $parameterBag = $this->createMock(ParameterBagInterface::class); diff --git a/src/Bundle/ChillPersonBundle/Tests/Validator/Person/PersonValidationTest.php b/src/Bundle/ChillPersonBundle/Tests/Validator/Person/PersonValidationTest.php index 577c81c2c..edbddb833 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Validator/Person/PersonValidationTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Validator/Person/PersonValidationTest.php @@ -26,6 +26,7 @@ final class PersonValidationTest extends KernelTestCase { private ValidatorInterface $validator; + #[\Override] protected function setUp(): void { self::bootKernel(); diff --git a/src/Bundle/ChillPersonBundle/Tests/Workflows/AccompanyingPeriodLifecycle.php b/src/Bundle/ChillPersonBundle/Tests/Workflows/AccompanyingPeriodLifecycle.php index 0a95d5810..de1413b12 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Workflows/AccompanyingPeriodLifecycle.php +++ b/src/Bundle/ChillPersonBundle/Tests/Workflows/AccompanyingPeriodLifecycle.php @@ -22,6 +22,7 @@ use Symfony\Component\Workflow\Registry; */ final class AccompanyingPeriodLifecycle extends KernelTestCase { + #[\Override] protected function setUp(): void { self::bootKernel(); diff --git a/src/Bundle/ChillPersonBundle/Timeline/AbstractTimelineAccompanyingPeriod.php b/src/Bundle/ChillPersonBundle/Timeline/AbstractTimelineAccompanyingPeriod.php index 6973eba1d..e0835bb09 100644 --- a/src/Bundle/ChillPersonBundle/Timeline/AbstractTimelineAccompanyingPeriod.php +++ b/src/Bundle/ChillPersonBundle/Timeline/AbstractTimelineAccompanyingPeriod.php @@ -33,6 +33,7 @@ abstract class AbstractTimelineAccompanyingPeriod implements TimelineProviderInt public function __construct(protected EntityManager $em, private readonly Security $security, private readonly AuthorizationHelper $authorizationHelper) {} + #[\Override] public function getEntities(array $ids) { $periods = $this->em diff --git a/src/Bundle/ChillPersonBundle/Timeline/TimelineAccompanyingPeriodClosing.php b/src/Bundle/ChillPersonBundle/Timeline/TimelineAccompanyingPeriodClosing.php index 70afcd1c2..ccc1e999e 100644 --- a/src/Bundle/ChillPersonBundle/Timeline/TimelineAccompanyingPeriodClosing.php +++ b/src/Bundle/ChillPersonBundle/Timeline/TimelineAccompanyingPeriodClosing.php @@ -18,6 +18,7 @@ use Chill\PersonBundle\Entity\AccompanyingPeriod; */ class TimelineAccompanyingPeriodClosing extends AbstractTimelineAccompanyingPeriod { + #[\Override] public function fetchQuery($context, array $args) { $metadata = $this->em @@ -33,6 +34,7 @@ class TimelineAccompanyingPeriodClosing extends AbstractTimelineAccompanyingPeri return $query; } + #[\Override] public function getEntityTemplate($entity, $context, array $args) { return $this->getBasicEntityTemplate( @@ -43,11 +45,13 @@ class TimelineAccompanyingPeriodClosing extends AbstractTimelineAccompanyingPeri ); } + #[\Override] public function supportsType($type) { return 'accompanying_period_closing' === $type; } + #[\Override] protected function buildWhereClause($context, array $args): array { [$query, $params] = parent::buildWhereClause($context, $args); diff --git a/src/Bundle/ChillPersonBundle/Timeline/TimelineAccompanyingPeriodOpening.php b/src/Bundle/ChillPersonBundle/Timeline/TimelineAccompanyingPeriodOpening.php index 74162ddb0..27da28837 100644 --- a/src/Bundle/ChillPersonBundle/Timeline/TimelineAccompanyingPeriodOpening.php +++ b/src/Bundle/ChillPersonBundle/Timeline/TimelineAccompanyingPeriodOpening.php @@ -18,6 +18,7 @@ use Chill\PersonBundle\Entity\AccompanyingPeriod; */ class TimelineAccompanyingPeriodOpening extends AbstractTimelineAccompanyingPeriod { + #[\Override] public function fetchQuery($context, array $args) { $metadata = $this->em @@ -31,6 +32,7 @@ class TimelineAccompanyingPeriodOpening extends AbstractTimelineAccompanyingPeri return $query; } + #[\Override] public function getEntityTemplate($entity, $context, array $args) { return $this->getBasicEntityTemplate( @@ -41,6 +43,7 @@ class TimelineAccompanyingPeriodOpening extends AbstractTimelineAccompanyingPeri ); } + #[\Override] public function supportsType($type) { return 'accompanying_period_opening' === $type; diff --git a/src/Bundle/ChillPersonBundle/Validator/Constraints/AccompanyingPeriod/AccompanyingPeriodValidity.php b/src/Bundle/ChillPersonBundle/Validator/Constraints/AccompanyingPeriod/AccompanyingPeriodValidity.php index 82a2d1d40..a761492ff 100644 --- a/src/Bundle/ChillPersonBundle/Validator/Constraints/AccompanyingPeriod/AccompanyingPeriodValidity.php +++ b/src/Bundle/ChillPersonBundle/Validator/Constraints/AccompanyingPeriod/AccompanyingPeriodValidity.php @@ -18,6 +18,7 @@ class AccompanyingPeriodValidity extends Constraint { public $messageSocialIssueCannotBeDeleted = 'The social %name% issue cannot be deleted because it is associated with an activity or an action'; + #[\Override] public function getTargets() { return self::CLASS_CONSTRAINT; diff --git a/src/Bundle/ChillPersonBundle/Validator/Constraints/AccompanyingPeriod/AccompanyingPeriodValidityValidator.php b/src/Bundle/ChillPersonBundle/Validator/Constraints/AccompanyingPeriod/AccompanyingPeriodValidityValidator.php index 6198e4e47..1f776966a 100644 --- a/src/Bundle/ChillPersonBundle/Validator/Constraints/AccompanyingPeriod/AccompanyingPeriodValidityValidator.php +++ b/src/Bundle/ChillPersonBundle/Validator/Constraints/AccompanyingPeriod/AccompanyingPeriodValidityValidator.php @@ -25,6 +25,7 @@ class AccompanyingPeriodValidityValidator extends ConstraintValidator { public function __construct(private readonly ActivityRepository $activityRepository, private readonly SocialIssueRender $socialIssueRender, private readonly TokenStorageInterface $token) {} + #[\Override] public function validate($period, Constraint $constraint) { if (!$constraint instanceof AccompanyingPeriodValidity) { diff --git a/src/Bundle/ChillPersonBundle/Validator/Constraints/AccompanyingPeriod/ConfidentialCourseMustHaveReferrer.php b/src/Bundle/ChillPersonBundle/Validator/Constraints/AccompanyingPeriod/ConfidentialCourseMustHaveReferrer.php index 97e5be385..a263ada48 100644 --- a/src/Bundle/ChillPersonBundle/Validator/Constraints/AccompanyingPeriod/ConfidentialCourseMustHaveReferrer.php +++ b/src/Bundle/ChillPersonBundle/Validator/Constraints/AccompanyingPeriod/ConfidentialCourseMustHaveReferrer.php @@ -18,6 +18,7 @@ class ConfidentialCourseMustHaveReferrer extends Constraint { public string $message = 'A confidential parcours must have a referrer'; + #[\Override] public function getTargets() { return [self::CLASS_CONSTRAINT]; diff --git a/src/Bundle/ChillPersonBundle/Validator/Constraints/AccompanyingPeriod/ConfidentialCourseMustHaveReferrerValidator.php b/src/Bundle/ChillPersonBundle/Validator/Constraints/AccompanyingPeriod/ConfidentialCourseMustHaveReferrerValidator.php index b809c0fff..9182ea74d 100644 --- a/src/Bundle/ChillPersonBundle/Validator/Constraints/AccompanyingPeriod/ConfidentialCourseMustHaveReferrerValidator.php +++ b/src/Bundle/ChillPersonBundle/Validator/Constraints/AccompanyingPeriod/ConfidentialCourseMustHaveReferrerValidator.php @@ -18,6 +18,7 @@ use Symfony\Component\Validator\Exception\UnexpectedTypeException; class ConfidentialCourseMustHaveReferrerValidator extends ConstraintValidator { + #[\Override] public function validate($value, Constraint $constraint) { if (!$value instanceof AccompanyingPeriod) { diff --git a/src/Bundle/ChillPersonBundle/Validator/Constraints/AccompanyingPeriod/LocationValidity.php b/src/Bundle/ChillPersonBundle/Validator/Constraints/AccompanyingPeriod/LocationValidity.php index 8e832da6e..4367d8e5b 100644 --- a/src/Bundle/ChillPersonBundle/Validator/Constraints/AccompanyingPeriod/LocationValidity.php +++ b/src/Bundle/ChillPersonBundle/Validator/Constraints/AccompanyingPeriod/LocationValidity.php @@ -20,6 +20,7 @@ class LocationValidity extends Constraint public $messagePersonLocatedMustBeAssociated = "The person where the course is located must be associated to the course. Change course's location before removing the person."; + #[\Override] public function getTargets() { return self::CLASS_CONSTRAINT; diff --git a/src/Bundle/ChillPersonBundle/Validator/Constraints/AccompanyingPeriod/LocationValidityValidator.php b/src/Bundle/ChillPersonBundle/Validator/Constraints/AccompanyingPeriod/LocationValidityValidator.php index 4b4a13c18..23cd469e0 100644 --- a/src/Bundle/ChillPersonBundle/Validator/Constraints/AccompanyingPeriod/LocationValidityValidator.php +++ b/src/Bundle/ChillPersonBundle/Validator/Constraints/AccompanyingPeriod/LocationValidityValidator.php @@ -22,6 +22,7 @@ class LocationValidityValidator extends ConstraintValidator { public function __construct(private readonly PersonRenderInterface $render) {} + #[\Override] public function validate($period, Constraint $constraint) { if (!$constraint instanceof LocationValidity) { diff --git a/src/Bundle/ChillPersonBundle/Validator/Constraints/AccompanyingPeriod/ParticipationOverlapValidator.php b/src/Bundle/ChillPersonBundle/Validator/Constraints/AccompanyingPeriod/ParticipationOverlapValidator.php index d3c25199b..cfc95cdfa 100644 --- a/src/Bundle/ChillPersonBundle/Validator/Constraints/AccompanyingPeriod/ParticipationOverlapValidator.php +++ b/src/Bundle/ChillPersonBundle/Validator/Constraints/AccompanyingPeriod/ParticipationOverlapValidator.php @@ -22,10 +22,11 @@ use Symfony\Component\Validator\Exception\UnexpectedTypeException; class ParticipationOverlapValidator extends ConstraintValidator { - private const MAX_PARTICIPATION = 1; + private const int MAX_PARTICIPATION = 1; public function __construct(private readonly PersonRenderInterface $personRender, private readonly ThirdPartyRender $thirdpartyRender) {} + #[\Override] public function validate($participations, Constraint $constraint) { if (!$constraint instanceof ParticipationOverlap) { diff --git a/src/Bundle/ChillPersonBundle/Validator/Constraints/AccompanyingPeriod/ResourceDuplicateCheckValidator.php b/src/Bundle/ChillPersonBundle/Validator/Constraints/AccompanyingPeriod/ResourceDuplicateCheckValidator.php index d7573c400..d55635aac 100644 --- a/src/Bundle/ChillPersonBundle/Validator/Constraints/AccompanyingPeriod/ResourceDuplicateCheckValidator.php +++ b/src/Bundle/ChillPersonBundle/Validator/Constraints/AccompanyingPeriod/ResourceDuplicateCheckValidator.php @@ -23,6 +23,7 @@ class ResourceDuplicateCheckValidator extends ConstraintValidator { public function __construct(private readonly PersonRenderInterface $personRender, private readonly ThirdPartyRender $thirdpartyRender) {} + #[\Override] public function validate($resources, Constraint $constraint) { if (!$constraint instanceof ResourceDuplicateCheck) { diff --git a/src/Bundle/ChillPersonBundle/Validator/Constraints/Household/HouseholdMembershipSequential.php b/src/Bundle/ChillPersonBundle/Validator/Constraints/Household/HouseholdMembershipSequential.php index d5f3a9547..87e7a6f41 100644 --- a/src/Bundle/ChillPersonBundle/Validator/Constraints/Household/HouseholdMembershipSequential.php +++ b/src/Bundle/ChillPersonBundle/Validator/Constraints/Household/HouseholdMembershipSequential.php @@ -18,6 +18,7 @@ class HouseholdMembershipSequential extends Constraint { public $message = 'household_membership.Person with membership covering'; + #[\Override] public function getTargets() { return [self::CLASS_CONSTRAINT]; diff --git a/src/Bundle/ChillPersonBundle/Validator/Constraints/Household/HouseholdMembershipSequentialValidator.php b/src/Bundle/ChillPersonBundle/Validator/Constraints/Household/HouseholdMembershipSequentialValidator.php index 2ca0af42c..ec56065ef 100644 --- a/src/Bundle/ChillPersonBundle/Validator/Constraints/Household/HouseholdMembershipSequentialValidator.php +++ b/src/Bundle/ChillPersonBundle/Validator/Constraints/Household/HouseholdMembershipSequentialValidator.php @@ -26,6 +26,7 @@ class HouseholdMembershipSequentialValidator extends ConstraintValidator { public function __construct(private readonly PersonRenderInterface $render) {} + #[\Override] public function validate($person, Constraint $constraint) { if (!$person instanceof Person) { diff --git a/src/Bundle/ChillPersonBundle/Validator/Constraints/Household/MaxHolder.php b/src/Bundle/ChillPersonBundle/Validator/Constraints/Household/MaxHolder.php index 5f45f69ac..b98ed0755 100644 --- a/src/Bundle/ChillPersonBundle/Validator/Constraints/Household/MaxHolder.php +++ b/src/Bundle/ChillPersonBundle/Validator/Constraints/Household/MaxHolder.php @@ -20,6 +20,7 @@ class MaxHolder extends Constraint public $messageInfinity = 'household.max_holder_overflowed_infinity'; + #[\Override] public function getTargets() { return self::CLASS_CONSTRAINT; diff --git a/src/Bundle/ChillPersonBundle/Validator/Constraints/Household/MaxHolderValidator.php b/src/Bundle/ChillPersonBundle/Validator/Constraints/Household/MaxHolderValidator.php index 499b8dbcf..f8a46ec59 100644 --- a/src/Bundle/ChillPersonBundle/Validator/Constraints/Household/MaxHolderValidator.php +++ b/src/Bundle/ChillPersonBundle/Validator/Constraints/Household/MaxHolderValidator.php @@ -17,8 +17,9 @@ use Symfony\Component\Validator\ConstraintValidator; class MaxHolderValidator extends ConstraintValidator { - private const MAX_HOLDERS = 2; + private const int MAX_HOLDERS = 2; + #[\Override] public function validate($household, Constraint $constraint) { $holders = $household->getMembersHolder(); diff --git a/src/Bundle/ChillPersonBundle/Validator/Constraints/Person/Birthdate.php b/src/Bundle/ChillPersonBundle/Validator/Constraints/Person/Birthdate.php index d35bf947d..618cea0fc 100644 --- a/src/Bundle/ChillPersonBundle/Validator/Constraints/Person/Birthdate.php +++ b/src/Bundle/ChillPersonBundle/Validator/Constraints/Person/Birthdate.php @@ -24,7 +24,7 @@ use Symfony\Component\Validator\Constraint; #[\Attribute(\Attribute::TARGET_PROPERTY)] class Birthdate extends Constraint { - final public const BIRTHDATE_INVALID_CODE = '3f42fd96-0b2d-11ec-8cf3-0f3b1b1ca1c4'; + final public const string 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/BirthdateValidator.php b/src/Bundle/ChillPersonBundle/Validator/Constraints/Person/BirthdateValidator.php index 1a7634136..3036b9dc4 100644 --- a/src/Bundle/ChillPersonBundle/Validator/Constraints/Person/BirthdateValidator.php +++ b/src/Bundle/ChillPersonBundle/Validator/Constraints/Person/BirthdateValidator.php @@ -30,6 +30,7 @@ class BirthdateValidator extends ConstraintValidator $this->interval_spec = $this->parameterBag->get('chill_person')['validation']['birthdate_not_after']; } + #[\Override] public function validate($value, Constraint $constraint) { if (null === $value) { diff --git a/src/Bundle/ChillPersonBundle/Validator/Constraints/Person/PersonHasCenter.php b/src/Bundle/ChillPersonBundle/Validator/Constraints/Person/PersonHasCenter.php index 2e502f9f3..dbe76758a 100644 --- a/src/Bundle/ChillPersonBundle/Validator/Constraints/Person/PersonHasCenter.php +++ b/src/Bundle/ChillPersonBundle/Validator/Constraints/Person/PersonHasCenter.php @@ -16,6 +16,7 @@ class PersonHasCenter extends \Symfony\Component\Validator\Constraint { public string $message = 'A center is required'; + #[\Override] public function getTargets() { return [ diff --git a/src/Bundle/ChillPersonBundle/Validator/Constraints/Person/PersonHasCenterValidator.php b/src/Bundle/ChillPersonBundle/Validator/Constraints/Person/PersonHasCenterValidator.php index 0d7ba3b17..771cdcdd7 100644 --- a/src/Bundle/ChillPersonBundle/Validator/Constraints/Person/PersonHasCenterValidator.php +++ b/src/Bundle/ChillPersonBundle/Validator/Constraints/Person/PersonHasCenterValidator.php @@ -27,6 +27,7 @@ class PersonHasCenterValidator extends ConstraintValidator $this->centerRequired = $parameterBag->get('chill_person')['validation']['center_required']; } + #[\Override] public function validate($person, Constraint $constraint) { if (!$person instanceof Person) { diff --git a/src/Bundle/ChillPersonBundle/Validator/Constraints/Relationship/RelationshipNoDuplicate.php b/src/Bundle/ChillPersonBundle/Validator/Constraints/Relationship/RelationshipNoDuplicate.php index c21cca5b6..0159a5b11 100644 --- a/src/Bundle/ChillPersonBundle/Validator/Constraints/Relationship/RelationshipNoDuplicate.php +++ b/src/Bundle/ChillPersonBundle/Validator/Constraints/Relationship/RelationshipNoDuplicate.php @@ -18,6 +18,7 @@ class RelationshipNoDuplicate extends Constraint { public $message = 'relationship.duplicate'; + #[\Override] public function getTargets() { return self::CLASS_CONSTRAINT; diff --git a/src/Bundle/ChillPersonBundle/Validator/Constraints/Relationship/RelationshipNoDuplicateValidator.php b/src/Bundle/ChillPersonBundle/Validator/Constraints/Relationship/RelationshipNoDuplicateValidator.php index 8a54de53e..75f1ca1ea 100644 --- a/src/Bundle/ChillPersonBundle/Validator/Constraints/Relationship/RelationshipNoDuplicateValidator.php +++ b/src/Bundle/ChillPersonBundle/Validator/Constraints/Relationship/RelationshipNoDuplicateValidator.php @@ -22,6 +22,7 @@ class RelationshipNoDuplicateValidator extends ConstraintValidator { public function __construct(private readonly RelationshipRepository $relationshipRepository) {} + #[\Override] public function validate($value, Constraint $constraint) { if (!$constraint instanceof RelationshipNoDuplicate) { diff --git a/src/Bundle/ChillPersonBundle/Widget/AddAPersonWidget.php b/src/Bundle/ChillPersonBundle/Widget/AddAPersonWidget.php index ef150f91d..6655ae234 100644 --- a/src/Bundle/ChillPersonBundle/Widget/AddAPersonWidget.php +++ b/src/Bundle/ChillPersonBundle/Widget/AddAPersonWidget.php @@ -19,6 +19,7 @@ use Twig\Environment; */ class AddAPersonWidget implements WidgetInterface { + #[\Override] public function render( Environment $env, $place, diff --git a/src/Bundle/ChillPersonBundle/Widget/PersonListWidget.php b/src/Bundle/ChillPersonBundle/Widget/PersonListWidget.php index aab72f148..08eb92a48 100644 --- a/src/Bundle/ChillPersonBundle/Widget/PersonListWidget.php +++ b/src/Bundle/ChillPersonBundle/Widget/PersonListWidget.php @@ -36,6 +36,7 @@ class PersonListWidget implements WidgetInterface public function __construct(protected PersonRepository $personRepository, protected EntityManagerInterface $entityManager, protected AuthorizationHelperInterface $authorizationHelper, protected TokenStorageInterface $tokenStorage) {} + #[\Override] public function render(Environment $env, $place, array $context, array $config) { $numberOfItems = $config['number_of_items'] ?? 20; diff --git a/src/Bundle/ChillPersonBundle/Widget/PersonListWidgetFactory.php b/src/Bundle/ChillPersonBundle/Widget/PersonListWidgetFactory.php index 204b6c7c7..c48a22573 100644 --- a/src/Bundle/ChillPersonBundle/Widget/PersonListWidgetFactory.php +++ b/src/Bundle/ChillPersonBundle/Widget/PersonListWidgetFactory.php @@ -20,6 +20,7 @@ use Symfony\Component\DependencyInjection\ContainerBuilder; */ class PersonListWidgetFactory extends AbstractWidgetFactory { + #[\Override] public function configureOptions($place, NodeBuilder $node) { $node->booleanNode('only_active') @@ -45,11 +46,13 @@ class PersonListWidgetFactory extends AbstractWidgetFactory return ['homepage']; } + #[\Override] public function getServiceId(ContainerBuilder $containerBuilder, $place, $order, array $config) { return 'chill_person.widget.person_list'; } + #[\Override] public function getWidgetAlias() { return 'person_list'; diff --git a/src/Bundle/ChillPersonBundle/Workflow/AccompanyingPeriodWorkEvaluationDocumentWorkflowHandler.php b/src/Bundle/ChillPersonBundle/Workflow/AccompanyingPeriodWorkEvaluationDocumentWorkflowHandler.php index 0fc13224e..e22624f62 100644 --- a/src/Bundle/ChillPersonBundle/Workflow/AccompanyingPeriodWorkEvaluationDocumentWorkflowHandler.php +++ b/src/Bundle/ChillPersonBundle/Workflow/AccompanyingPeriodWorkEvaluationDocumentWorkflowHandler.php @@ -23,6 +23,7 @@ class AccompanyingPeriodWorkEvaluationDocumentWorkflowHandler implements EntityW { public function __construct(private readonly AccompanyingPeriodWorkEvaluationDocumentRepository $repository, private readonly TranslatableStringHelperInterface $translatableStringHelper, private readonly TranslatorInterface $translator) {} + #[\Override] public function getDeletionRoles(): array { return [ @@ -30,6 +31,7 @@ class AccompanyingPeriodWorkEvaluationDocumentWorkflowHandler implements EntityW ]; } + #[\Override] public function getEntityData(EntityWorkflow $entityWorkflow, array $options = []): array { $doc = $this->getRelatedEntity($entityWorkflow); @@ -46,6 +48,7 @@ class AccompanyingPeriodWorkEvaluationDocumentWorkflowHandler implements EntityW ]; } + #[\Override] public function getEntityTitle(EntityWorkflow $entityWorkflow, array $options = []): string { $doc = $this->getRelatedEntity($entityWorkflow); @@ -61,6 +64,7 @@ class AccompanyingPeriodWorkEvaluationDocumentWorkflowHandler implements EntityW ->getEvaluation()->getTitle()).') '.$doc->getTitle(); } + #[\Override] public function getRelatedEntity(EntityWorkflow $entityWorkflow): ?AccompanyingPeriodWorkEvaluationDocument { return $this->repository->find($entityWorkflow->getRelatedEntityId()); @@ -71,6 +75,7 @@ class AccompanyingPeriodWorkEvaluationDocumentWorkflowHandler implements EntityW * * @return array[] */ + #[\Override] public function getRelatedObjects(object $object): array { return [ @@ -78,11 +83,13 @@ class AccompanyingPeriodWorkEvaluationDocumentWorkflowHandler implements EntityW ]; } + #[\Override] public function getRoleShow(EntityWorkflow $entityWorkflow): ?string { return AccompanyingPeriodWorkEvaluationDocumentVoter::SEE; } + #[\Override] public function getSuggestedUsers(EntityWorkflow $entityWorkflow): array { $suggestedUsers = $entityWorkflow->getUsersInvolved(); @@ -98,11 +105,13 @@ class AccompanyingPeriodWorkEvaluationDocumentWorkflowHandler implements EntityW return $suggestedUsers; } + #[\Override] public function getTemplate(EntityWorkflow $entityWorkflow, array $options = []): string { return '@ChillPerson/Workflow/_evaluation_document.html.twig'; } + #[\Override] public function getTemplateData(EntityWorkflow $entityWorkflow, array $options = []): array { $doc = $this->getRelatedEntity($entityWorkflow); @@ -114,16 +123,19 @@ class AccompanyingPeriodWorkEvaluationDocumentWorkflowHandler implements EntityW ]; } + #[\Override] public function isObjectSupported(object $object): bool { return $object instanceof AccompanyingPeriodWorkEvaluationDocument; } + #[\Override] public function supports(EntityWorkflow $entityWorkflow, array $options = []): bool { return AccompanyingPeriodWorkEvaluationDocument::class === $entityWorkflow->getRelatedEntityClass(); } + #[\Override] public function supportsFreeze(EntityWorkflow $entityWorkflow, array $options = []): bool { return false; diff --git a/src/Bundle/ChillPersonBundle/Workflow/AccompanyingPeriodWorkEvaluationWorkflowHandler.php b/src/Bundle/ChillPersonBundle/Workflow/AccompanyingPeriodWorkEvaluationWorkflowHandler.php index 63b34d1dc..ffc7cad76 100644 --- a/src/Bundle/ChillPersonBundle/Workflow/AccompanyingPeriodWorkEvaluationWorkflowHandler.php +++ b/src/Bundle/ChillPersonBundle/Workflow/AccompanyingPeriodWorkEvaluationWorkflowHandler.php @@ -24,11 +24,13 @@ class AccompanyingPeriodWorkEvaluationWorkflowHandler implements EntityWorkflowH { public function __construct(private readonly AccompanyingPeriodWorkEvaluationRepository $repository, private readonly TranslatableStringHelperInterface $translatableStringHelper, private readonly TranslatorInterface $translator) {} + #[\Override] public function getDeletionRoles(): array { return ['_']; } + #[\Override] public function getEntityData(EntityWorkflow $entityWorkflow, array $options = []): array { $evaluation = $this->getRelatedEntity($entityWorkflow); @@ -38,6 +40,7 @@ class AccompanyingPeriodWorkEvaluationWorkflowHandler implements EntityWorkflowH ]; } + #[\Override] public function getEntityTitle(EntityWorkflow $entityWorkflow, array $options = []): string { $evaluation = $this->getRelatedEntity($entityWorkflow); @@ -48,6 +51,7 @@ class AccompanyingPeriodWorkEvaluationWorkflowHandler implements EntityWorkflowH ).' - '.$this->translatableStringHelper->localize($evaluation->getEvaluation()->getTitle()); } + #[\Override] public function getRelatedEntity(EntityWorkflow $entityWorkflow): ?AccompanyingPeriodWorkEvaluation { return $this->repository->find($entityWorkflow->getRelatedEntityId()); @@ -56,6 +60,7 @@ class AccompanyingPeriodWorkEvaluationWorkflowHandler implements EntityWorkflowH /** * @param AccompanyingPeriodWorkEvaluation $object */ + #[\Override] public function getRelatedObjects(object $object): array { $relateds = []; @@ -68,11 +73,13 @@ class AccompanyingPeriodWorkEvaluationWorkflowHandler implements EntityWorkflowH return $relateds; } + #[\Override] public function getRoleShow(EntityWorkflow $entityWorkflow): ?string { return AccompanyingPeriodWorkEvaluationVoter::SEE; } + #[\Override] public function getSuggestedUsers(EntityWorkflow $entityWorkflow): array { $suggestedUsers = $entityWorkflow->getUsersInvolved(); @@ -87,11 +94,13 @@ class AccompanyingPeriodWorkEvaluationWorkflowHandler implements EntityWorkflowH return $suggestedUsers; } + #[\Override] public function getTemplate(EntityWorkflow $entityWorkflow, array $options = []): string { return '@ChillPerson/Workflow/_evaluation.html.twig'; } + #[\Override] public function getTemplateData(EntityWorkflow $entityWorkflow, array $options = []): array { return [ @@ -100,16 +109,19 @@ class AccompanyingPeriodWorkEvaluationWorkflowHandler implements EntityWorkflowH ]; } + #[\Override] public function isObjectSupported(object $object): bool { return $object instanceof AccompanyingPeriodWorkEvaluation; } + #[\Override] public function supports(EntityWorkflow $entityWorkflow, array $options = []): bool { return AccompanyingPeriodWorkEvaluation::class === $entityWorkflow->getRelatedEntityClass(); } + #[\Override] public function supportsFreeze(EntityWorkflow $entityWorkflow, array $options = []): bool { return false; diff --git a/src/Bundle/ChillPersonBundle/Workflow/AccompanyingPeriodWorkWorkflowHandler.php b/src/Bundle/ChillPersonBundle/Workflow/AccompanyingPeriodWorkWorkflowHandler.php index 5c74e5b17..6cf779c2f 100644 --- a/src/Bundle/ChillPersonBundle/Workflow/AccompanyingPeriodWorkWorkflowHandler.php +++ b/src/Bundle/ChillPersonBundle/Workflow/AccompanyingPeriodWorkWorkflowHandler.php @@ -25,11 +25,13 @@ class AccompanyingPeriodWorkWorkflowHandler implements EntityWorkflowHandlerInte { public function __construct(private readonly AccompanyingPeriodWorkRepository $repository, private readonly TranslatableStringHelperInterface $translatableStringHelper, private readonly TranslatorInterface $translator) {} + #[\Override] public function getDeletionRoles(): array { return [AccompanyingPeriodWorkVoter::DELETE]; } + #[\Override] public function getEntityData(EntityWorkflow $entityWorkflow, array $options = []): array { return [ @@ -37,6 +39,7 @@ class AccompanyingPeriodWorkWorkflowHandler implements EntityWorkflowHandlerInte ]; } + #[\Override] public function getEntityTitle(EntityWorkflow $entityWorkflow, array $options = []): string { $work = $this->getRelatedEntity($entityWorkflow); @@ -50,6 +53,7 @@ class AccompanyingPeriodWorkWorkflowHandler implements EntityWorkflowHandlerInte .' - '.$this->translatableStringHelper->localize($work->getSocialAction()->getTitle()); } + #[\Override] public function getRelatedEntity(EntityWorkflow $entityWorkflow): ?AccompanyingPeriodWork { return $this->repository->find($entityWorkflow->getRelatedEntityId()); @@ -58,6 +62,7 @@ class AccompanyingPeriodWorkWorkflowHandler implements EntityWorkflowHandlerInte /** * @param AccompanyingPeriodWork $object */ + #[\Override] public function getRelatedObjects(object $object): array { $relateds = []; @@ -74,11 +79,13 @@ class AccompanyingPeriodWorkWorkflowHandler implements EntityWorkflowHandlerInte return $relateds; } + #[\Override] public function getRoleShow(EntityWorkflow $entityWorkflow): ?string { return null; } + #[\Override] public function getSuggestedUsers(EntityWorkflow $entityWorkflow): array { $suggestedUsers = $entityWorkflow->getUsersInvolved(); @@ -94,11 +101,13 @@ class AccompanyingPeriodWorkWorkflowHandler implements EntityWorkflowHandlerInte return $suggestedUsers; } + #[\Override] public function getTemplate(EntityWorkflow $entityWorkflow, array $options = []): string { return '@ChillPerson/Workflow/_accompanying_period_work.html.twig'; } + #[\Override] public function getTemplateData(EntityWorkflow $entityWorkflow, array $options = []): array { return [ @@ -107,16 +116,19 @@ class AccompanyingPeriodWorkWorkflowHandler implements EntityWorkflowHandlerInte ]; } + #[\Override] public function isObjectSupported(object $object): bool { return $object instanceof AccompanyingPeriodWork; } + #[\Override] public function supports(EntityWorkflow $entityWorkflow, array $options = []): bool { return AccompanyingPeriodWork::class === $entityWorkflow->getRelatedEntityClass(); } + #[\Override] public function supportsFreeze(EntityWorkflow $entityWorkflow, array $options = []): bool { return false; diff --git a/src/Bundle/ChillPersonBundle/migrations/Version20141129010948.php b/src/Bundle/ChillPersonBundle/migrations/Version20141129010948.php index de577141e..eb1778c01 100644 --- a/src/Bundle/ChillPersonBundle/migrations/Version20141129010948.php +++ b/src/Bundle/ChillPersonBundle/migrations/Version20141129010948.php @@ -19,11 +19,13 @@ use Doctrine\Migrations\AbstractMigration; */ class Version20141129010948 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { // this down() migration is auto-generated, please modify it to your needs } + #[\Override] public function up(Schema $schema): void { $this->addSql('CREATE SEQUENCE ClosingMotive_id_seq INCREMENT BY 1 MINVALUE 1 START 1;'); diff --git a/src/Bundle/ChillPersonBundle/migrations/Version20150212173934.php b/src/Bundle/ChillPersonBundle/migrations/Version20150212173934.php index 717f4ccae..ddbd315f1 100644 --- a/src/Bundle/ChillPersonBundle/migrations/Version20150212173934.php +++ b/src/Bundle/ChillPersonBundle/migrations/Version20150212173934.php @@ -19,6 +19,7 @@ use Doctrine\Migrations\AbstractMigration; */ class Version20150212173934 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { // this down() migration is auto-generated, please modify it to your needs @@ -27,6 +28,7 @@ class Version20150212173934 extends AbstractMigration $this->addSql('ALTER SEQUENCE accompanying_period_id_seq RENAME TO person_history_file_id_seq;'); } + #[\Override] public function up(Schema $schema): void { // this up() migration is auto-generated, please modify it to your needs diff --git a/src/Bundle/ChillPersonBundle/migrations/Version20150607231010.php b/src/Bundle/ChillPersonBundle/migrations/Version20150607231010.php index 96028c079..a7696a10b 100644 --- a/src/Bundle/ChillPersonBundle/migrations/Version20150607231010.php +++ b/src/Bundle/ChillPersonBundle/migrations/Version20150607231010.php @@ -20,6 +20,7 @@ use Doctrine\Migrations\AbstractMigration; */ class Version20150607231010 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->abortIf( @@ -32,12 +33,14 @@ class Version20150607231010 extends AbstractMigration $this->addSql('ALTER TABLE Person DROP center_id'); } + #[\Override] public function getDescription(): string { return 'Add a center on the person entity. The default center is the first ' .'recorded.'; } + #[\Override] public function up(Schema $schema): void { $this->abortIf( diff --git a/src/Bundle/ChillPersonBundle/migrations/Version20150811152608.php b/src/Bundle/ChillPersonBundle/migrations/Version20150811152608.php index a2432a498..ef78add79 100644 --- a/src/Bundle/ChillPersonBundle/migrations/Version20150811152608.php +++ b/src/Bundle/ChillPersonBundle/migrations/Version20150811152608.php @@ -22,6 +22,7 @@ use Doctrine\Migrations\AbstractMigration; */ class Version20150811152608 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->abortIf( @@ -33,6 +34,7 @@ class Version20150811152608 extends AbstractMigration $this->addSql('ALTER TABLE person RENAME COLUMN gender TO genre'); } + #[\Override] public function up(Schema $schema): void { $this->abortIf( diff --git a/src/Bundle/ChillPersonBundle/migrations/Version20150812110708.php b/src/Bundle/ChillPersonBundle/migrations/Version20150812110708.php index 80144eb54..eba7f2633 100644 --- a/src/Bundle/ChillPersonBundle/migrations/Version20150812110708.php +++ b/src/Bundle/ChillPersonBundle/migrations/Version20150812110708.php @@ -19,6 +19,7 @@ use Doctrine\Migrations\AbstractMigration; */ class Version20150812110708 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->abortIf( @@ -31,6 +32,7 @@ class Version20150812110708 extends AbstractMigration $this->addSql('DROP TABLE marital_status;'); } + #[\Override] public function up(Schema $schema): void { $this->abortIf( diff --git a/src/Bundle/ChillPersonBundle/migrations/Version20150820113409.php b/src/Bundle/ChillPersonBundle/migrations/Version20150820113409.php index ec45ab12a..79a6a84d3 100644 --- a/src/Bundle/ChillPersonBundle/migrations/Version20150820113409.php +++ b/src/Bundle/ChillPersonBundle/migrations/Version20150820113409.php @@ -20,6 +20,7 @@ use Doctrine\Migrations\AbstractMigration; */ class Version20150820113409 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->abortIf( @@ -32,6 +33,7 @@ class Version20150820113409 extends AbstractMigration $this->addSql('ALTER TABLE accompanying_period RENAME COLUMN remark TO memo;'); } + #[\Override] public function up(Schema $schema): void { $this->abortIf( diff --git a/src/Bundle/ChillPersonBundle/migrations/Version20160310161006.php b/src/Bundle/ChillPersonBundle/migrations/Version20160310161006.php index 4e6935bca..f364eb675 100644 --- a/src/Bundle/ChillPersonBundle/migrations/Version20160310161006.php +++ b/src/Bundle/ChillPersonBundle/migrations/Version20160310161006.php @@ -19,6 +19,7 @@ use Doctrine\Migrations\AbstractMigration; */ class Version20160310161006 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->abortIf('postgresql' !== $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'postgresql\'.'); @@ -26,6 +27,7 @@ class Version20160310161006 extends AbstractMigration $this->addSql('DROP TABLE chill_person_persons_to_addresses'); } + #[\Override] public function up(Schema $schema): void { // this up() migration is auto-generated, please modify it to your needs diff --git a/src/Bundle/ChillPersonBundle/migrations/Version20160422000000.php b/src/Bundle/ChillPersonBundle/migrations/Version20160422000000.php index 159e969a3..c615bb209 100644 --- a/src/Bundle/ChillPersonBundle/migrations/Version20160422000000.php +++ b/src/Bundle/ChillPersonBundle/migrations/Version20160422000000.php @@ -19,8 +19,10 @@ use Doctrine\Migrations\AbstractMigration; */ class Version20160422000000 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void {} + #[\Override] public function up(Schema $schema): void { $stmt = $this->connection->query('SELECT COUNT(*), pe.id, ad.validfrom FROM person AS pe diff --git a/src/Bundle/ChillPersonBundle/migrations/Version20160818113633.php b/src/Bundle/ChillPersonBundle/migrations/Version20160818113633.php index 6b11a1d63..b22280cb6 100644 --- a/src/Bundle/ChillPersonBundle/migrations/Version20160818113633.php +++ b/src/Bundle/ChillPersonBundle/migrations/Version20160818113633.php @@ -23,6 +23,7 @@ class Version20160818113633 extends AbstractMigration /** * Inverse of up. */ + #[\Override] public function down(Schema $schema): void { $this->addSQL('ALTER TABLE person DROP COLUMN cfdata'); @@ -34,6 +35,7 @@ class Version20160818113633 extends AbstractMigration * Make a copy of the column cfdata into the column cfdata_old. Then * remplace the sterialized data into a json data. */ + #[\Override] public function up(Schema $schema): void { $personIdAndCFData = $this->connection->executeQuery('SELECT id, cfdata FROM person'); diff --git a/src/Bundle/ChillPersonBundle/migrations/Version20160818151130.php b/src/Bundle/ChillPersonBundle/migrations/Version20160818151130.php index 18bfe9781..fd2731f15 100644 --- a/src/Bundle/ChillPersonBundle/migrations/Version20160818151130.php +++ b/src/Bundle/ChillPersonBundle/migrations/Version20160818151130.php @@ -19,6 +19,7 @@ use Doctrine\Migrations\AbstractMigration; */ class Version20160818151130 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->addSQL('ALTER TABLE chill_person_person RENAME TO person'); @@ -33,6 +34,7 @@ class Version20160818151130 extends AbstractMigration $this->addSql('ALTER TABLE chill_person_closingmotive_id_seq RENAME TO closingmotive_id_seq'); } + #[\Override] public function up(Schema $schema): void { $this->addSql('ALTER TABLE person RENAME TO chill_person_person'); diff --git a/src/Bundle/ChillPersonBundle/migrations/Version20170117131924.php b/src/Bundle/ChillPersonBundle/migrations/Version20170117131924.php index 187007b76..bb1dc8d60 100644 --- a/src/Bundle/ChillPersonBundle/migrations/Version20170117131924.php +++ b/src/Bundle/ChillPersonBundle/migrations/Version20170117131924.php @@ -32,6 +32,7 @@ class Version20170117131924 extends AbstractMigration 'country_id' => 'integer', ]; + #[\Override] public function down(Schema $schema): void { // drop function to get parts of address @@ -55,6 +56,7 @@ class Version20170117131924 extends AbstractMigration ); } + #[\Override] public function up(Schema $schema): void { $this->addSql( diff --git a/src/Bundle/ChillPersonBundle/migrations/Version20180518144221.php b/src/Bundle/ChillPersonBundle/migrations/Version20180518144221.php index d1d782b42..71e512dbb 100644 --- a/src/Bundle/ChillPersonBundle/migrations/Version20180518144221.php +++ b/src/Bundle/ChillPersonBundle/migrations/Version20180518144221.php @@ -19,6 +19,7 @@ use Doctrine\Migrations\AbstractMigration; */ final class Version20180518144221 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->abortIf('postgresql' !== $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'postgresql\'.'); @@ -28,6 +29,7 @@ final class Version20180518144221 extends AbstractMigration $this->addSql('ALTER TABLE chill_person_person ALTER email SET NOT NULL'); } + #[\Override] public function up(Schema $schema): void { $this->abortIf('postgresql' !== $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'postgresql\'.'); diff --git a/src/Bundle/ChillPersonBundle/migrations/Version20180820120000.php b/src/Bundle/ChillPersonBundle/migrations/Version20180820120000.php index 950754659..27d5b5dfd 100644 --- a/src/Bundle/ChillPersonBundle/migrations/Version20180820120000.php +++ b/src/Bundle/ChillPersonBundle/migrations/Version20180820120000.php @@ -21,6 +21,7 @@ use Doctrine\Migrations\AbstractMigration; */ final class Version20180820120000 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->abortIf('postgresql' !== $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'postgresql\'.'); @@ -29,6 +30,7 @@ final class Version20180820120000 extends AbstractMigration $this->addSql('UPDATE chill_person_person SET contactInfo=\'\''); } + #[\Override] public function up(Schema $schema): void { $this->abortIf('postgresql' !== $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'postgresql\'.'); diff --git a/src/Bundle/ChillPersonBundle/migrations/Version20181005140249.php b/src/Bundle/ChillPersonBundle/migrations/Version20181005140249.php index 3222aaade..7e013cd78 100644 --- a/src/Bundle/ChillPersonBundle/migrations/Version20181005140249.php +++ b/src/Bundle/ChillPersonBundle/migrations/Version20181005140249.php @@ -19,6 +19,7 @@ use Doctrine\Migrations\AbstractMigration; */ final class Version20181005140249 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->abortIf('postgresql' !== $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'postgresql\'.'); @@ -26,6 +27,7 @@ final class Version20181005140249 extends AbstractMigration $this->addSql('ALTER TABLE chill_person_person ALTER gender SET NOT NULL'); } + #[\Override] public function up(Schema $schema): void { $this->abortIf('postgresql' !== $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'postgresql\'.'); diff --git a/src/Bundle/ChillPersonBundle/migrations/Version20181023101621.php b/src/Bundle/ChillPersonBundle/migrations/Version20181023101621.php index b4bf23c7c..fe91407b5 100644 --- a/src/Bundle/ChillPersonBundle/migrations/Version20181023101621.php +++ b/src/Bundle/ChillPersonBundle/migrations/Version20181023101621.php @@ -19,6 +19,7 @@ use Doctrine\Migrations\AbstractMigration; */ final class Version20181023101621 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->abortIf('postgresql' !== $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'postgresql\'.'); @@ -31,6 +32,7 @@ final class Version20181023101621 extends AbstractMigration $this->addSql('DROP FUNCTION canonicalize_fullname_on_insert()'); } + #[\Override] public function up(Schema $schema): void { $this->abortIf('postgresql' !== $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'postgresql\'.'); diff --git a/src/Bundle/ChillPersonBundle/migrations/Version20190701124238.php b/src/Bundle/ChillPersonBundle/migrations/Version20190701124238.php index 91c12c7bd..b731c51ef 100644 --- a/src/Bundle/ChillPersonBundle/migrations/Version20190701124238.php +++ b/src/Bundle/ChillPersonBundle/migrations/Version20190701124238.php @@ -19,11 +19,13 @@ use Doctrine\Migrations\AbstractMigration; */ final class Version20190701124238 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->addSql('ALTER TABLE chill_person_accompanying_period DROP user_id'); } + #[\Override] public function up(Schema $schema): void { $this->addSql('ALTER TABLE chill_person_accompanying_period ADD user_id INT DEFAULT NULL;'); diff --git a/src/Bundle/ChillPersonBundle/migrations/Version20191106103452.php b/src/Bundle/ChillPersonBundle/migrations/Version20191106103452.php index d3d3ca402..6def42979 100644 --- a/src/Bundle/ChillPersonBundle/migrations/Version20191106103452.php +++ b/src/Bundle/ChillPersonBundle/migrations/Version20191106103452.php @@ -19,12 +19,14 @@ use Doctrine\Migrations\AbstractMigration; */ final class Version20191106103452 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->addSql('DROP INDEX phonenumber_trgm_idx'); $this->addSql('DROP INDEX mobilenumber_trgm_idx'); } + #[\Override] public function up(Schema $schema): void { $this->addSql('CREATE INDEX phonenumber_trgm_idx diff --git a/src/Bundle/ChillPersonBundle/migrations/Version20200128084445.php b/src/Bundle/ChillPersonBundle/migrations/Version20200128084445.php index 5f869d138..9d95a6dce 100644 --- a/src/Bundle/ChillPersonBundle/migrations/Version20200128084445.php +++ b/src/Bundle/ChillPersonBundle/migrations/Version20200128084445.php @@ -19,6 +19,7 @@ use Doctrine\Migrations\AbstractMigration; */ final class Version20200128084445 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->abortIf('postgresql' !== $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'postgresql\'.'); @@ -28,6 +29,7 @@ final class Version20200128084445 extends AbstractMigration $this->addSql('DROP SEQUENCE chill_person_alt_name_id_seq'); } + #[\Override] public function up(Schema $schema): void { $this->abortIf('postgresql' !== $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'postgresql\'.'); diff --git a/src/Bundle/ChillPersonBundle/migrations/Version20200130213446.php b/src/Bundle/ChillPersonBundle/migrations/Version20200130213446.php index 7d48b5f53..4435cba01 100644 --- a/src/Bundle/ChillPersonBundle/migrations/Version20200130213446.php +++ b/src/Bundle/ChillPersonBundle/migrations/Version20200130213446.php @@ -19,7 +19,7 @@ use Doctrine\Migrations\AbstractMigration; */ final class Version20200130213446 extends AbstractMigration { - public const CANONICALIZE_FULLNAME_ON_ALT_NAME_ALTER = <<<'SQL' + public const string CANONICALIZE_FULLNAME_ON_ALT_NAME_ALTER = <<<'SQL' CREATE OR REPLACE FUNCTION public.canonicalize_fullname_on_alt_name_alter() RETURNS trigger LANGUAGE 'plpgsql' @@ -64,7 +64,7 @@ final class Version20200130213446 extends AbstractMigration $BODY$; SQL; - public const CANONICALIZE_FULLNAME_ON_ALT_NAME_DELETE = <<<'SQL' + public const string CANONICALIZE_FULLNAME_ON_ALT_NAME_DELETE = <<<'SQL' CREATE TRIGGER canonicalize_fullname_on_alt_name_delete AFTER DELETE ON chill_person_alt_name @@ -72,7 +72,7 @@ final class Version20200130213446 extends AbstractMigration EXECUTE PROCEDURE canonicalize_fullname_on_alt_name_alter(); SQL; - public const CANONICALIZE_FULLNAME_ON_ALT_NAME_INSERT = <<<'SQL' + public const string CANONICALIZE_FULLNAME_ON_ALT_NAME_INSERT = <<<'SQL' CREATE TRIGGER canonicalize_fullname_on_alt_name_insert AFTER INSERT ON chill_person_alt_name @@ -80,7 +80,7 @@ final class Version20200130213446 extends AbstractMigration EXECUTE PROCEDURE canonicalize_fullname_on_alt_name_alter(); SQL; - public const CANONICALIZE_FULLNAME_ON_ALT_NAME_UPDATE = <<<'SQL' + public const string CANONICALIZE_FULLNAME_ON_ALT_NAME_UPDATE = <<<'SQL' CREATE TRIGGER canonicalize_fullname_on_alt_name_update AFTER UPDATE ON chill_person_alt_name @@ -88,7 +88,7 @@ final class Version20200130213446 extends AbstractMigration EXECUTE PROCEDURE canonicalize_fullname_on_alt_name_alter(); SQL; - public const CANONICALIZE_FULLNAME_ON_UPDATE = <<<'SQL' + public const string CANONICALIZE_FULLNAME_ON_UPDATE = <<<'SQL' CREATE OR REPLACE FUNCTION public.canonicalize_fullname_on_update() RETURNS trigger LANGUAGE 'plpgsql' @@ -123,6 +123,7 @@ final class Version20200130213446 extends AbstractMigration $BODY$; SQL; + #[\Override] public function down(Schema $schema): void { $this->addSql('DROP TRIGGER canonicalize_fullname_on_alt_name_update ON chill_person_alt_name;'); @@ -147,6 +148,7 @@ SQL_WRAP ); } + #[\Override] public function up(Schema $schema): void { // update fullname diff --git a/src/Bundle/ChillPersonBundle/migrations/Version20200310090632.php b/src/Bundle/ChillPersonBundle/migrations/Version20200310090632.php index bb3aa9304..985824e6e 100644 --- a/src/Bundle/ChillPersonBundle/migrations/Version20200310090632.php +++ b/src/Bundle/ChillPersonBundle/migrations/Version20200310090632.php @@ -19,6 +19,7 @@ use Doctrine\Migrations\AbstractMigration; */ final class Version20200310090632 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->abortIf('postgresql' !== $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'postgresql\'.'); @@ -27,6 +28,7 @@ final class Version20200310090632 extends AbstractMigration $this->addSql('ALTER TABLE chill_person_closingmotive DROP ordering'); } + #[\Override] public function up(Schema $schema): void { $this->abortIf('postgresql' !== $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'postgresql\'.'); diff --git a/src/Bundle/ChillPersonBundle/migrations/Version20200422125935.php b/src/Bundle/ChillPersonBundle/migrations/Version20200422125935.php index 13adf252b..3e032e581 100644 --- a/src/Bundle/ChillPersonBundle/migrations/Version20200422125935.php +++ b/src/Bundle/ChillPersonBundle/migrations/Version20200422125935.php @@ -19,6 +19,7 @@ use Doctrine\Migrations\AbstractMigration; */ final class Version20200422125935 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->addSql('DROP FUNCTION public.get_last_address_isnoaddress(integer, date);'); @@ -75,6 +76,7 @@ final class Version20200422125935 extends AbstractMigration ); } + #[\Override] public function up(Schema $schema): void { $this->addSql('DROP FUNCTION get_last_address(integer, date)'); diff --git a/src/Bundle/ChillPersonBundle/migrations/Version20210128152747.php b/src/Bundle/ChillPersonBundle/migrations/Version20210128152747.php index 4108d6e6a..6f301f322 100644 --- a/src/Bundle/ChillPersonBundle/migrations/Version20210128152747.php +++ b/src/Bundle/ChillPersonBundle/migrations/Version20210128152747.php @@ -19,6 +19,7 @@ use Doctrine\Migrations\AbstractMigration; */ final class Version20210128152747 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { // this down() migration is auto-generated, please modify it to your needs @@ -26,11 +27,13 @@ final class Version20210128152747 extends AbstractMigration $this->addSql('DROP TABLE chill_person_not_duplicate'); } + #[\Override] public function getDescription(): string { return ''; } + #[\Override] public function up(Schema $schema): void { // this up() migration is auto-generated, please modify it to your needs diff --git a/src/Bundle/ChillPersonBundle/migrations/Version20210318095831.php b/src/Bundle/ChillPersonBundle/migrations/Version20210318095831.php index 6b9b9e2e1..0000edf78 100644 --- a/src/Bundle/ChillPersonBundle/migrations/Version20210318095831.php +++ b/src/Bundle/ChillPersonBundle/migrations/Version20210318095831.php @@ -19,6 +19,7 @@ use Doctrine\Migrations\AbstractMigration; */ final class Version20210318095831 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { // this down() migration is auto-generated, please modify it to your needs @@ -26,11 +27,13 @@ final class Version20210318095831 extends AbstractMigration $this->addSql('DROP TABLE chill_person_phone'); } + #[\Override] public function getDescription(): string { return ''; } + #[\Override] public function up(Schema $schema): void { // this up() migration is auto-generated, please modify it to your needs diff --git a/src/Bundle/ChillPersonBundle/migrations/Version20210325141540.php b/src/Bundle/ChillPersonBundle/migrations/Version20210325141540.php index bbab286af..a1c7a700a 100644 --- a/src/Bundle/ChillPersonBundle/migrations/Version20210325141540.php +++ b/src/Bundle/ChillPersonBundle/migrations/Version20210325141540.php @@ -19,17 +19,20 @@ use Doctrine\Migrations\AbstractMigration; */ final class Version20210325141540 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { // this down() migration is auto-generated, please modify it to your need $this->addSql('ALTER TABLE chill_person_phone DROP type'); } + #[\Override] public function getDescription(): string { return ''; } + #[\Override] public function up(Schema $schema): void { // this up() migration is auto-generated, please modify it to your needs diff --git a/src/Bundle/ChillPersonBundle/migrations/Version20210326113045.php b/src/Bundle/ChillPersonBundle/migrations/Version20210326113045.php index 4ff268051..bf34bb71a 100644 --- a/src/Bundle/ChillPersonBundle/migrations/Version20210326113045.php +++ b/src/Bundle/ChillPersonBundle/migrations/Version20210326113045.php @@ -26,6 +26,7 @@ final class Version20210326113045 extends AbstractMigration * The distinct clause makes that for each group of duplicates, it keeps only the first row in the returned result set. * Then we have only few lost datas. Lost datas: when many persons for one AccompanyingPeriod (keep only first person). */ + #[\Override] public function down(Schema $schema): void { // add column @@ -46,6 +47,7 @@ final class Version20210326113045 extends AbstractMigration $this->addSql('DROP TABLE persons_accompanying_periods'); } + #[\Override] public function getDescription(): string { return 'Change model relation between Person and AccompagnyingPeriod, without losing datas when going up'; @@ -54,6 +56,7 @@ final class Version20210326113045 extends AbstractMigration /** * In these direction, there is no loss. */ + #[\Override] public function up(Schema $schema): void { // create join table diff --git a/src/Bundle/ChillPersonBundle/migrations/Version20210329090904.php b/src/Bundle/ChillPersonBundle/migrations/Version20210329090904.php index 002109b20..5f3bc8b7d 100644 --- a/src/Bundle/ChillPersonBundle/migrations/Version20210329090904.php +++ b/src/Bundle/ChillPersonBundle/migrations/Version20210329090904.php @@ -19,6 +19,7 @@ use Doctrine\Migrations\AbstractMigration; */ final class Version20210329090904 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->addSql('ALTER TABLE chill_person_accompanying_period DROP CONSTRAINT FK_E260A86856A273CC'); @@ -30,11 +31,13 @@ final class Version20210329090904 extends AbstractMigration $this->addSql('ALTER TABLE chill_person_accompanying_period DROP origin_id'); } + #[\Override] public function getDescription(): string { return 'Add AccompanyingPeriod Origin table'; } + #[\Override] public function up(Schema $schema): void { $this->addSql('CREATE SEQUENCE chill_person_accompanying_period_origin_id_seq INCREMENT BY 1 MINVALUE 1 START 1'); diff --git a/src/Bundle/ChillPersonBundle/migrations/Version20210329113152.php b/src/Bundle/ChillPersonBundle/migrations/Version20210329113152.php index 66b4805f8..607627516 100644 --- a/src/Bundle/ChillPersonBundle/migrations/Version20210329113152.php +++ b/src/Bundle/ChillPersonBundle/migrations/Version20210329113152.php @@ -19,6 +19,7 @@ use Doctrine\Migrations\AbstractMigration; */ final class Version20210329113152 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->addSql('DROP SEQUENCE chill_person_accompanying_period_resource_id_seq CASCADE'); @@ -28,11 +29,13 @@ final class Version20210329113152 extends AbstractMigration $this->addSql('DROP TABLE chill_person_accompanying_period_comment'); } + #[\Override] public function getDescription(): string { return 'Add AccompanyingPeriod Comment and Resource tables'; } + #[\Override] public function up(Schema $schema): void { $this->addSql('CREATE SEQUENCE chill_person_accompanying_period_comment_id_seq INCREMENT BY 1 MINVALUE 1 START 1'); diff --git a/src/Bundle/ChillPersonBundle/migrations/Version20210329144338.php b/src/Bundle/ChillPersonBundle/migrations/Version20210329144338.php index 242832c52..a78b77d42 100644 --- a/src/Bundle/ChillPersonBundle/migrations/Version20210329144338.php +++ b/src/Bundle/ChillPersonBundle/migrations/Version20210329144338.php @@ -19,6 +19,7 @@ use Doctrine\Migrations\AbstractMigration; */ final class Version20210329144338 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->addSql('DROP TABLE accompanying_periods_scopes'); @@ -41,11 +42,13 @@ final class Version20210329144338 extends AbstractMigration $this->addSql('ALTER TABLE chill_person_accompanying_period DROP confidential'); } + #[\Override] public function getDescription(): string { return 'Complete AccompanyingPeriod table'; } + #[\Override] public function up(Schema $schema): void { $this->addSql('CREATE TABLE accompanying_periods_scopes (accompanying_period_id INT NOT NULL, scope_id INT NOT NULL, PRIMARY KEY(accompanying_period_id, scope_id))'); diff --git a/src/Bundle/ChillPersonBundle/migrations/Version20210330164922.php b/src/Bundle/ChillPersonBundle/migrations/Version20210330164922.php index 60e195457..45ff4b0b0 100644 --- a/src/Bundle/ChillPersonBundle/migrations/Version20210330164922.php +++ b/src/Bundle/ChillPersonBundle/migrations/Version20210330164922.php @@ -19,6 +19,7 @@ use Doctrine\Migrations\AbstractMigration; */ final class Version20210330164922 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->addSql('ALTER TABLE chill_person_accompanying_period_closingmotive RENAME TO chill_person_closingmotive'); @@ -26,11 +27,13 @@ final class Version20210330164922 extends AbstractMigration $this->addSql('ALTER TABLE chill_person_accompanying_period RENAME CONSTRAINT FK_E260A868504CB38D TO fk_64a4a621504cb38d'); } + #[\Override] public function getDescription(): string { return 'Rename table closinmotive'; } + #[\Override] public function up(Schema $schema): void { $this->addSql('ALTER TABLE chill_person_closingmotive RENAME TO chill_person_accompanying_period_closingmotive'); diff --git a/src/Bundle/ChillPersonBundle/migrations/Version20210331084527.php b/src/Bundle/ChillPersonBundle/migrations/Version20210331084527.php index bf54a94d0..5f87b2910 100644 --- a/src/Bundle/ChillPersonBundle/migrations/Version20210331084527.php +++ b/src/Bundle/ChillPersonBundle/migrations/Version20210331084527.php @@ -19,6 +19,7 @@ use Doctrine\Migrations\AbstractMigration; */ final class Version20210331084527 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { // 4 @@ -42,11 +43,13 @@ final class Version20210331084527 extends AbstractMigration $this->addSql('ALTER TABLE persons_accompanying_periods ADD CONSTRAINT persons_accompanying_periods_pkey PRIMARY KEY (person_id, accompanyingperiod_id)'); } + #[\Override] public function getDescription(): string { return 'Transform join table between Person and AccompanyingPeriod in Doctrine entity'; } + #[\Override] public function up(Schema $schema): void { // 1 diff --git a/src/Bundle/ChillPersonBundle/migrations/Version20210419105054.php b/src/Bundle/ChillPersonBundle/migrations/Version20210419105054.php index 7e8cd1b45..a716bf426 100644 --- a/src/Bundle/ChillPersonBundle/migrations/Version20210419105054.php +++ b/src/Bundle/ChillPersonBundle/migrations/Version20210419105054.php @@ -19,17 +19,20 @@ use Doctrine\Migrations\AbstractMigration; */ final class Version20210419105054 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->addSql('ALTER TABLE chill_person_accompanying_period_closingmotive_id_seq ' .'RENAME TO chill_person_closingmotive_id_seq'); } + #[\Override] public function getDescription(): string { return 'rename sequence "closing motive"'; } + #[\Override] public function up(Schema $schema): void { $this->addSql('ALTER TABLE chill_person_closingmotive_id_seq RENAME TO ' diff --git a/src/Bundle/ChillPersonBundle/migrations/Version20210419105940.php b/src/Bundle/ChillPersonBundle/migrations/Version20210419105940.php index 175d9e4a3..c32eeee91 100644 --- a/src/Bundle/ChillPersonBundle/migrations/Version20210419105940.php +++ b/src/Bundle/ChillPersonBundle/migrations/Version20210419105940.php @@ -19,6 +19,7 @@ use Doctrine\Migrations\AbstractMigration; */ final class Version20210419105940 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { // this will keep the '"' at first and last character, but is acceptable @@ -28,11 +29,13 @@ final class Version20210419105940 extends AbstractMigration .'ALTER label DROP DEFAULT'); } + #[\Override] public function getDescription(): string { return 'set label for origin as json'; } + #[\Override] public function up(Schema $schema): void { $this->addSql('ALTER TABLE chill_person_accompanying_period_origin ' diff --git a/src/Bundle/ChillPersonBundle/migrations/Version20210419112619.php b/src/Bundle/ChillPersonBundle/migrations/Version20210419112619.php index e713486d0..546cba373 100644 --- a/src/Bundle/ChillPersonBundle/migrations/Version20210419112619.php +++ b/src/Bundle/ChillPersonBundle/migrations/Version20210419112619.php @@ -19,13 +19,16 @@ use Doctrine\Migrations\AbstractMigration; */ final class Version20210419112619 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void {} + #[\Override] public function getDescription(): string { return 'fix deprecated json_array'; } + #[\Override] public function up(Schema $schema): void { $this->addSql('COMMENT ON COLUMN chill_person_accompanying_period_closingmotive.name IS NULL'); diff --git a/src/Bundle/ChillPersonBundle/migrations/Version20210426145930.php b/src/Bundle/ChillPersonBundle/migrations/Version20210426145930.php index 7002b01f8..f54c1b3aa 100644 --- a/src/Bundle/ChillPersonBundle/migrations/Version20210426145930.php +++ b/src/Bundle/ChillPersonBundle/migrations/Version20210426145930.php @@ -19,6 +19,7 @@ use Doctrine\Migrations\AbstractMigration; */ final class Version20210426145930 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->addSql('ALTER TABLE chill_person_social_action DROP CONSTRAINT FK_B7ABFAB8727ACA70'); @@ -43,11 +44,13 @@ final class Version20210426145930 extends AbstractMigration $this->addSql('DROP TABLE chill_person_social_work_result'); } + #[\Override] public function getDescription(): string { return 'Create Social action, Social Issue, Work Goal and Work Result'; } + #[\Override] public function up(Schema $schema): void { $this->addSql('CREATE SEQUENCE chill_person_social_action_id_seq INCREMENT BY 1 MINVALUE 1 START 1'); diff --git a/src/Bundle/ChillPersonBundle/migrations/Version20210427125700.php b/src/Bundle/ChillPersonBundle/migrations/Version20210427125700.php index 4ed4e826d..00358a667 100644 --- a/src/Bundle/ChillPersonBundle/migrations/Version20210427125700.php +++ b/src/Bundle/ChillPersonBundle/migrations/Version20210427125700.php @@ -19,6 +19,7 @@ use Doctrine\Migrations\AbstractMigration; */ final class Version20210427125700 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->addSql('ALTER TABLE chill_person_accompanying_period_work_result DROP CONSTRAINT FK_46E95929B99F6060'); @@ -36,11 +37,13 @@ final class Version20210427125700 extends AbstractMigration $this->addSql('DROP TABLE chill_person_social_work_evaluation'); } + #[\Override] public function getDescription(): string { return 'Create tables for the entites AccomanyingPeriodWork, AccomanyingPeriodWorkGoal & Social/WorkEvaluation'; } + #[\Override] public function up(Schema $schema): void { $this->addSql('CREATE SEQUENCE chill_person_accompanying_period_work_id_seq INCREMENT BY 1 MINVALUE 1 START 1'); diff --git a/src/Bundle/ChillPersonBundle/migrations/Version20210505093408.php b/src/Bundle/ChillPersonBundle/migrations/Version20210505093408.php index 96ef12447..5f4d9a35c 100644 --- a/src/Bundle/ChillPersonBundle/migrations/Version20210505093408.php +++ b/src/Bundle/ChillPersonBundle/migrations/Version20210505093408.php @@ -19,6 +19,7 @@ use Doctrine\Migrations\AbstractMigration; */ final class Version20210505093408 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->addSql('ALTER TABLE HouseholdMembers DROP CONSTRAINT FK_4D1FB288E79FF843'); @@ -29,11 +30,13 @@ final class Version20210505093408 extends AbstractMigration $this->addSql('DROP TABLE HouseholdMembers'); } + #[\Override] public function getDescription(): string { return 'Create Household and HouseholdMembers tables'; } + #[\Override] public function up(Schema $schema): void { $this->addSql('CREATE SEQUENCE Household_id_seq INCREMENT BY 1 MINVALUE 1 START 1'); diff --git a/src/Bundle/ChillPersonBundle/migrations/Version20210505154316.php b/src/Bundle/ChillPersonBundle/migrations/Version20210505154316.php index 7d6ca97ff..8d5eb1b64 100644 --- a/src/Bundle/ChillPersonBundle/migrations/Version20210505154316.php +++ b/src/Bundle/ChillPersonBundle/migrations/Version20210505154316.php @@ -19,16 +19,19 @@ use Doctrine\Migrations\AbstractMigration; */ final class Version20210505154316 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->addSql('DROP TABLE chill_person_household_to_addresses'); } + #[\Override] public function getDescription(): string { return 'Add a household_to_addresses table'; } + #[\Override] public function up(Schema $schema): void { $this->addSql('CREATE TABLE chill_person_household_to_addresses (household_id INT NOT NULL, address_id INT NOT NULL, PRIMARY KEY(household_id, address_id))'); diff --git a/src/Bundle/ChillPersonBundle/migrations/Version20210518075908.php b/src/Bundle/ChillPersonBundle/migrations/Version20210518075908.php index 49a9062fe..317934990 100644 --- a/src/Bundle/ChillPersonBundle/migrations/Version20210518075908.php +++ b/src/Bundle/ChillPersonBundle/migrations/Version20210518075908.php @@ -19,16 +19,19 @@ use Doctrine\Migrations\AbstractMigration; */ final class Version20210518075908 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->addSql('DROP TABLE chill_person_accompanying_period_social_issues'); } + #[\Override] public function getDescription(): string { return 'Add a link between social issue and accompanying period'; } + #[\Override] public function up(Schema $schema): void { $this->addSql('CREATE TABLE chill_person_accompanying_period_social_issues (accompanyingperiod_id INT NOT NULL, socialissue_id INT NOT NULL, PRIMARY KEY(accompanyingperiod_id, socialissue_id))'); diff --git a/src/Bundle/ChillPersonBundle/migrations/Version20210518162439.php b/src/Bundle/ChillPersonBundle/migrations/Version20210518162439.php index 79b6bcb42..ddab335ed 100644 --- a/src/Bundle/ChillPersonBundle/migrations/Version20210518162439.php +++ b/src/Bundle/ChillPersonBundle/migrations/Version20210518162439.php @@ -19,16 +19,19 @@ use Doctrine\Migrations\AbstractMigration; */ final class Version20210518162439 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->addSql('ALTER TABLE chill_person_accompanying_period DROP initialComment_id'); } + #[\Override] public function getDescription(): string { return 'Add a column "initial comment" in accompanying period'; } + #[\Override] public function up(Schema $schema): void { $this->addSql('ALTER TABLE chill_person_accompanying_period ADD initialComment_id INT DEFAULT NULL'); diff --git a/src/Bundle/ChillPersonBundle/migrations/Version20210519204938.php b/src/Bundle/ChillPersonBundle/migrations/Version20210519204938.php index 20fe97ddd..a69ab6ca9 100644 --- a/src/Bundle/ChillPersonBundle/migrations/Version20210519204938.php +++ b/src/Bundle/ChillPersonBundle/migrations/Version20210519204938.php @@ -19,6 +19,7 @@ use Doctrine\Migrations\AbstractMigration; */ final class Version20210519204938 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->addSql('ALTER TABLE chill_person_accompanying_period DROP createdAt'); @@ -26,11 +27,13 @@ final class Version20210519204938 extends AbstractMigration $this->addSql('ALTER TABLE chill_person_accompanying_period DROP updatedBy_id'); } + #[\Override] public function getDescription(): string { return 'Add updatedAt, updatedBy, createdAt on accompanying period'; } + #[\Override] public function up(Schema $schema): void { $this->addSql('ALTER TABLE chill_person_accompanying_period ADD createdAt TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL'); diff --git a/src/Bundle/ChillPersonBundle/migrations/Version20210525211214.php b/src/Bundle/ChillPersonBundle/migrations/Version20210525211214.php index 69391405e..e34683b0e 100644 --- a/src/Bundle/ChillPersonBundle/migrations/Version20210525211214.php +++ b/src/Bundle/ChillPersonBundle/migrations/Version20210525211214.php @@ -19,17 +19,20 @@ use Doctrine\Migrations\AbstractMigration; */ final class Version20210525211214 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->addSql('ALTER TABLE chill_person_accompanying_period_comment DROP CONSTRAINT fk_cd960ef3d7fa8ef0'); $this->addSql('ALTER TABLE chill_person_accompanying_period_comment ADD CONSTRAINT fk_cd960ef3d7fa8ef0 FOREIGN KEY (accompanyingperiod_id) REFERENCES chill_person_accompanying_period (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); } + #[\Override] public function getDescription(): string { return 'Specify ON DELETE behaviour to handle deletion of parents in associated tables'; } + #[\Override] public function up(Schema $schema): void { $this->addSql('ALTER TABLE chill_person_accompanying_period_comment DROP CONSTRAINT FK_CD960EF3D7FA8EF0'); diff --git a/src/Bundle/ChillPersonBundle/migrations/Version20210528092625.php b/src/Bundle/ChillPersonBundle/migrations/Version20210528092625.php index 92bcc3aa8..739e2f7d6 100644 --- a/src/Bundle/ChillPersonBundle/migrations/Version20210528092625.php +++ b/src/Bundle/ChillPersonBundle/migrations/Version20210528092625.php @@ -19,16 +19,19 @@ use Doctrine\Migrations\AbstractMigration; */ final class Version20210528092625 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->throwIrreversibleMigrationException('the down method is not implemented'); } + #[\Override] public function getDescription(): string { return 'prefix table concerning household with \'chill_person\' and add constraints'; } + #[\Override] public function up(Schema $schema): void { // we need to rename constraint, drop them first, recreate them after diff --git a/src/Bundle/ChillPersonBundle/migrations/Version20210528111624.php b/src/Bundle/ChillPersonBundle/migrations/Version20210528111624.php index 1845b962f..60a272468 100644 --- a/src/Bundle/ChillPersonBundle/migrations/Version20210528111624.php +++ b/src/Bundle/ChillPersonBundle/migrations/Version20210528111624.php @@ -19,6 +19,7 @@ use Doctrine\Migrations\AbstractMigration; */ final class Version20210528111624 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->addSql('ALTER TABLE chill_person_household_members DROP CONSTRAINT FK_EEF5DED7DD842E46'); @@ -28,11 +29,13 @@ final class Version20210528111624 extends AbstractMigration $this->addSql('ALTER TABLE chill_person_household_members DROP position_id'); } + #[\Override] public function getDescription(): string { return 'Add position to househould_member'; } + #[\Override] public function up(Schema $schema): void { $this->addSql('CREATE SEQUENCE chill_person_household_position_id_seq INCREMENT BY 1 MINVALUE 1 START 1'); diff --git a/src/Bundle/ChillPersonBundle/migrations/Version20210528132405.php b/src/Bundle/ChillPersonBundle/migrations/Version20210528132405.php index 083dc0723..624798751 100644 --- a/src/Bundle/ChillPersonBundle/migrations/Version20210528132405.php +++ b/src/Bundle/ChillPersonBundle/migrations/Version20210528132405.php @@ -19,17 +19,20 @@ use Doctrine\Migrations\AbstractMigration; */ final class Version20210528132405 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->addSql('ALTER TABLE chill_person_household_members ALTER startDate SET NOT NULL'); $this->addSql('ALTER TABLE chill_person_household_members ALTER endDate SET NOT NULL'); } + #[\Override] public function getDescription(): string { return 'Household members: allow startdate and enddate to be null'; } + #[\Override] public function up(Schema $schema): void { $this->addSql('ALTER TABLE chill_person_household_members ALTER startdate DROP NOT NULL'); diff --git a/src/Bundle/ChillPersonBundle/migrations/Version20210528142121.php b/src/Bundle/ChillPersonBundle/migrations/Version20210528142121.php index 09fa062aa..a9c94ae2e 100644 --- a/src/Bundle/ChillPersonBundle/migrations/Version20210528142121.php +++ b/src/Bundle/ChillPersonBundle/migrations/Version20210528142121.php @@ -19,16 +19,19 @@ use Doctrine\Migrations\AbstractMigration; */ final class Version20210528142121 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->addSql('ALTER TABLE chill_person_household_members DROP COLUMN holder'); } + #[\Override] public function getDescription(): string { return 'Add house holder on membership'; } + #[\Override] public function up(Schema $schema): void { $this->addSql('ALTER TABLE chill_person_household_members ADD holder BOOLEAN DEFAULT FALSE NOT NULL'); diff --git a/src/Bundle/ChillPersonBundle/migrations/Version20210614191600.php b/src/Bundle/ChillPersonBundle/migrations/Version20210614191600.php index 170e5cba6..a24305df1 100644 --- a/src/Bundle/ChillPersonBundle/migrations/Version20210614191600.php +++ b/src/Bundle/ChillPersonBundle/migrations/Version20210614191600.php @@ -19,6 +19,7 @@ use Doctrine\Migrations\AbstractMigration; */ final class Version20210614191600 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->addSql('ALTER TABLE chill_person_household DROP comment_members'); @@ -26,11 +27,13 @@ final class Version20210614191600 extends AbstractMigration $this->addSql('ALTER TABLE chill_person_household DROP waiting_for_birth_date'); } + #[\Override] public function getDescription(): string { return 'Add comments and expecting birth to household'; } + #[\Override] public function up(Schema $schema): void { $this->addSql('ALTER TABLE chill_person_household ADD comment_members TEXT DEFAULT \'\' NOT NULL'); diff --git a/src/Bundle/ChillPersonBundle/migrations/Version20210615074857.php b/src/Bundle/ChillPersonBundle/migrations/Version20210615074857.php index f9a6b6010..68127bd5b 100644 --- a/src/Bundle/ChillPersonBundle/migrations/Version20210615074857.php +++ b/src/Bundle/ChillPersonBundle/migrations/Version20210615074857.php @@ -19,6 +19,7 @@ use Doctrine\Migrations\AbstractMigration; */ final class Version20210615074857 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->addSql('ALTER TABLE chill_person_household RENAME comment_members_comment TO comment_members'); @@ -29,11 +30,13 @@ final class Version20210615074857 extends AbstractMigration $this->addSql('ALTER TABLE chill_person_household DROP comment_members_date'); } + #[\Override] public function getDescription(): string { return 'replace comment in household as embedded comment'; } + #[\Override] public function up(Schema $schema): void { $this->addSql('ALTER TABLE chill_person_household RENAME comment_members TO comment_members_comment'); diff --git a/src/Bundle/ChillPersonBundle/migrations/Version20210616102900.php b/src/Bundle/ChillPersonBundle/migrations/Version20210616102900.php index 268c3f391..a7e55f833 100644 --- a/src/Bundle/ChillPersonBundle/migrations/Version20210616102900.php +++ b/src/Bundle/ChillPersonBundle/migrations/Version20210616102900.php @@ -19,16 +19,19 @@ use Doctrine\Migrations\AbstractMigration; */ final class Version20210616102900 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->addSql('DROP VIEW view_chill_person_household_address'); } + #[\Override] public function getDescription(): string { return 'Create a view for assembling household, person and addresses'; } + #[\Override] public function up(Schema $schema): void { $this->addSql( diff --git a/src/Bundle/ChillPersonBundle/migrations/Version20210617073504.php b/src/Bundle/ChillPersonBundle/migrations/Version20210617073504.php index adcc5455a..dae9cacf2 100644 --- a/src/Bundle/ChillPersonBundle/migrations/Version20210617073504.php +++ b/src/Bundle/ChillPersonBundle/migrations/Version20210617073504.php @@ -19,6 +19,7 @@ use Doctrine\Migrations\AbstractMigration; */ final class Version20210617073504 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->addSql('ALTER TABLE chill_person_person DROP deathdate'); @@ -34,11 +35,13 @@ final class Version20210617073504 extends AbstractMigration $this->addSql('ALTER TABLE chill_person_person DROP maritalStatusComment_date'); } + #[\Override] public function getDescription(): string { return 'Add new fields to Person entity'; } + #[\Override] public function up(Schema $schema): void { $this->addSql('ALTER TABLE chill_person_person ADD deathdate DATE DEFAULT NULL'); diff --git a/src/Bundle/ChillPersonBundle/migrations/Version20210618080702.php b/src/Bundle/ChillPersonBundle/migrations/Version20210618080702.php index 5d3a667c4..303ea589d 100644 --- a/src/Bundle/ChillPersonBundle/migrations/Version20210618080702.php +++ b/src/Bundle/ChillPersonBundle/migrations/Version20210618080702.php @@ -19,6 +19,7 @@ use Doctrine\Migrations\AbstractMigration; */ final class Version20210618080702 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->addSql('ALTER TABLE chill_person_person DROP CONSTRAINT FK_BF210A143174800F'); @@ -32,11 +33,13 @@ final class Version20210618080702 extends AbstractMigration $this->addSql('COMMENT ON COLUMN chill_person_person.deathdate IS NULL'); } + #[\Override] public function getDescription(): string { return 'Add createdAt, createdBy, updatedAt, updatedBy fields on Person'; } + #[\Override] public function up(Schema $schema): void { $this->addSql('ALTER TABLE chill_person_person ADD createdAt TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL'); diff --git a/src/Bundle/ChillPersonBundle/migrations/Version20210620143757.php b/src/Bundle/ChillPersonBundle/migrations/Version20210620143757.php index a0c2cbb16..02937ef14 100644 --- a/src/Bundle/ChillPersonBundle/migrations/Version20210620143757.php +++ b/src/Bundle/ChillPersonBundle/migrations/Version20210620143757.php @@ -19,6 +19,7 @@ use Doctrine\Migrations\AbstractMigration; */ final class Version20210620143757 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->addSql('ALTER TABLE chill_person_accompanying_period_work DROP updatedAt'); @@ -34,11 +35,13 @@ final class Version20210620143757 extends AbstractMigration $this->addSql('COMMENT ON COLUMN chill_person_accompanying_period_work.enddate IS NULL'); } + #[\Override] public function getDescription(): string { return 'add updated information to accompanying period work'; } + #[\Override] public function up(Schema $schema): void { $this->addSql('ALTER TABLE chill_person_accompanying_period_work ADD updatedAt TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL'); diff --git a/src/Bundle/ChillPersonBundle/migrations/Version20210623135043.php b/src/Bundle/ChillPersonBundle/migrations/Version20210623135043.php index b167b0a4b..1baf0ede3 100644 --- a/src/Bundle/ChillPersonBundle/migrations/Version20210623135043.php +++ b/src/Bundle/ChillPersonBundle/migrations/Version20210623135043.php @@ -19,16 +19,19 @@ use Doctrine\Migrations\AbstractMigration; */ final class Version20210623135043 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->addSql('DROP TABLE chill_person_accompanying_period_work_person'); } + #[\Override] public function getDescription(): string { return 'Add link to accompanying period work and persons'; } + #[\Override] public function up(Schema $schema): void { $this->addSql('CREATE TABLE chill_person_accompanying_period_work_person (accompanyingperiodwork_id INT NOT NULL, person_id INT NOT NULL, PRIMARY KEY(accompanyingperiodwork_id, person_id))'); diff --git a/src/Bundle/ChillPersonBundle/migrations/Version20210623142046.php b/src/Bundle/ChillPersonBundle/migrations/Version20210623142046.php index 39924ba09..052dcc53e 100644 --- a/src/Bundle/ChillPersonBundle/migrations/Version20210623142046.php +++ b/src/Bundle/ChillPersonBundle/migrations/Version20210623142046.php @@ -19,16 +19,19 @@ use Doctrine\Migrations\AbstractMigration; */ final class Version20210623142046 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->addSql('ALTER TABLE chill_person_social_action ALTER defaultNotificationDelay SET NOT NULL'); } + #[\Override] public function getDescription(): string { return ''; } + #[\Override] public function up(Schema $schema): void { $this->addSql('ALTER TABLE chill_person_social_action ALTER defaultnotificationdelay DROP NOT NULL'); diff --git a/src/Bundle/ChillPersonBundle/migrations/Version20210624131722.php b/src/Bundle/ChillPersonBundle/migrations/Version20210624131722.php index 1eded9f41..ae203bda1 100644 --- a/src/Bundle/ChillPersonBundle/migrations/Version20210624131722.php +++ b/src/Bundle/ChillPersonBundle/migrations/Version20210624131722.php @@ -19,16 +19,19 @@ use Doctrine\Migrations\AbstractMigration; */ final class Version20210624131722 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->addSql('ALTER TABLE chill_person_social_work_evaluation ALTER delay SET NOT NULL'); } + #[\Override] public function getDescription(): string { return ''; } + #[\Override] public function up(Schema $schema): void { $this->addSql('ALTER TABLE chill_person_social_work_evaluation ALTER delay DROP NOT NULL'); diff --git a/src/Bundle/ChillPersonBundle/migrations/Version20210624131723.php b/src/Bundle/ChillPersonBundle/migrations/Version20210624131723.php index 5c738b280..f5c121970 100644 --- a/src/Bundle/ChillPersonBundle/migrations/Version20210624131723.php +++ b/src/Bundle/ChillPersonBundle/migrations/Version20210624131723.php @@ -19,16 +19,19 @@ use Doctrine\Migrations\AbstractMigration; */ final class Version20210624131723 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->addSql('ALTER TABLE chill_person_social_work_evaluation ALTER notificationdelay SET NOT NULL'); } + #[\Override] public function getDescription(): string { return ''; } + #[\Override] public function up(Schema $schema): void { $this->addSql('ALTER TABLE chill_person_social_work_evaluation ALTER notificationdelay DROP NOT NULL'); diff --git a/src/Bundle/ChillPersonBundle/migrations/Version20210727152826.php b/src/Bundle/ChillPersonBundle/migrations/Version20210727152826.php index 47d04fc6e..06ed29113 100644 --- a/src/Bundle/ChillPersonBundle/migrations/Version20210727152826.php +++ b/src/Bundle/ChillPersonBundle/migrations/Version20210727152826.php @@ -19,6 +19,7 @@ use Doctrine\Migrations\AbstractMigration; */ final class Version20210727152826 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->addSql('ALTER TABLE chill_person_accompanying_period DROP CONSTRAINT FK_E260A868D5213D34'); @@ -29,11 +30,13 @@ final class Version20210727152826 extends AbstractMigration $this->addSql('ALTER TABLE chill_person_accompanying_period DROP addressLocation_id'); } + #[\Override] public function getDescription(): string { return 'Add location to accompanying period'; } + #[\Override] public function up(Schema $schema): void { $this->addSql('ALTER TABLE chill_person_accompanying_period ADD personLocation_id INT DEFAULT NULL'); diff --git a/src/Bundle/ChillPersonBundle/migrations/Version20210729163023.php b/src/Bundle/ChillPersonBundle/migrations/Version20210729163023.php index 56598409d..3edb1eef7 100644 --- a/src/Bundle/ChillPersonBundle/migrations/Version20210729163023.php +++ b/src/Bundle/ChillPersonBundle/migrations/Version20210729163023.php @@ -19,17 +19,20 @@ use Doctrine\Migrations\AbstractMigration; */ final class Version20210729163023 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->addSql('DROP SEQUENCE chill_person_accompanying_period_work_evaluation_id_seq CASCADE'); $this->addSql('DROP TABLE chill_person_accompanying_period_work_evaluation'); } + #[\Override] public function getDescription(): string { return 'create class and tables for AccompanyingPeriodWorkEvaluation'; } + #[\Override] public function up(Schema $schema): void { $this->addSql('CREATE SEQUENCE chill_person_accompanying_period_work_evaluation_id_seq INCREMENT BY 1 MINVALUE 1 START 1'); diff --git a/src/Bundle/ChillPersonBundle/migrations/Version20210730094514.php b/src/Bundle/ChillPersonBundle/migrations/Version20210730094514.php index 8c116e675..f8102f241 100644 --- a/src/Bundle/ChillPersonBundle/migrations/Version20210730094514.php +++ b/src/Bundle/ChillPersonBundle/migrations/Version20210730094514.php @@ -19,6 +19,7 @@ use Doctrine\Migrations\AbstractMigration; */ final class Version20210730094514 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->addSql('COMMENT ON COLUMN chill_calendar.calendar_range.startdate IS \'(DC2Type:datetimetz_immutable)\''); @@ -29,11 +30,13 @@ final class Version20210730094514 extends AbstractMigration $this->addSql('DROP INDEX IDX_B694FB365FF1AEC'); } + #[\Override] public function getDescription(): string { return 'add documents to AccompanyingPeriodWorkEvaluation'; } + #[\Override] public function up(Schema $schema): void { $this->addSql('CREATE SEQUENCE chill_person_accompanying_period_work_eval_doc_id_seq INCREMENT BY 1 MINVALUE 1 START 1000'); diff --git a/src/Bundle/ChillPersonBundle/migrations/Version20210730205407.php b/src/Bundle/ChillPersonBundle/migrations/Version20210730205407.php index fd5474fdb..a1b62e998 100644 --- a/src/Bundle/ChillPersonBundle/migrations/Version20210730205407.php +++ b/src/Bundle/ChillPersonBundle/migrations/Version20210730205407.php @@ -19,17 +19,20 @@ use Doctrine\Migrations\AbstractMigration; */ final class Version20210730205407 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->addSql('ALTER TABLE chill_person_social_work_evaluation ALTER delay SET NOT NULL'); $this->addSql('ALTER TABLE chill_person_social_work_evaluation ALTER notificationDelay SET NOT NULL'); } + #[\Override] public function getDescription(): string { return 'add nullable fields to social work evaluation'; } + #[\Override] public function up(Schema $schema): void { $this->addSql('ALTER TABLE chill_person_social_work_evaluation ALTER delay DROP NOT NULL'); diff --git a/src/Bundle/ChillPersonBundle/migrations/Version20210802202838.php b/src/Bundle/ChillPersonBundle/migrations/Version20210802202838.php index e38782456..510c08259 100644 --- a/src/Bundle/ChillPersonBundle/migrations/Version20210802202838.php +++ b/src/Bundle/ChillPersonBundle/migrations/Version20210802202838.php @@ -19,16 +19,19 @@ use Doctrine\Migrations\AbstractMigration; */ final class Version20210802202838 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->addSql('ALTER TABLE chill_person_accompanying_period_work_evaluation DROP comment'); } + #[\Override] public function getDescription(): string { return 'Add comment to accompanying period work evaluation'; } + #[\Override] public function up(Schema $schema): void { $this->addSql('ALTER TABLE chill_person_accompanying_period_work_evaluation ADD comment TEXT DEFAULT \'\' NOT NULL'); diff --git a/src/Bundle/ChillPersonBundle/migrations/Version20210820093927.php b/src/Bundle/ChillPersonBundle/migrations/Version20210820093927.php index 53479d34e..b4237cefd 100644 --- a/src/Bundle/ChillPersonBundle/migrations/Version20210820093927.php +++ b/src/Bundle/ChillPersonBundle/migrations/Version20210820093927.php @@ -19,6 +19,7 @@ use Doctrine\Migrations\AbstractMigration; */ final class Version20210820093927 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->addSql('ALTER TABLE chill_person_accompanying_period_work_evaluation_document DROP CONSTRAINT FK_33EC92296C99C13A'); @@ -29,11 +30,13 @@ final class Version20210820093927 extends AbstractMigration $this->addSql('ALTER TABLE chill_person_accompanying_period_work_evaluation_document DROP storedObject_id'); } + #[\Override] public function getDescription(): string { return 'Add a link between evaluation document, stored object, and document template'; } + #[\Override] public function up(Schema $schema): void { $this->addSql('ALTER TABLE chill_person_accompanying_period_work_evaluation_document ADD template_id INT DEFAULT NULL'); diff --git a/src/Bundle/ChillPersonBundle/migrations/Version20210820100407.php b/src/Bundle/ChillPersonBundle/migrations/Version20210820100407.php index cb9ac94cf..4eb2df86e 100644 --- a/src/Bundle/ChillPersonBundle/migrations/Version20210820100407.php +++ b/src/Bundle/ChillPersonBundle/migrations/Version20210820100407.php @@ -19,16 +19,19 @@ use Doctrine\Migrations\AbstractMigration; */ final class Version20210820100407 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->addSql('DROP SEQUENCE chill_person_social_work_eval_doc_id_seq'); } + #[\Override] public function getDescription(): string { return 'Add missing sequence for evaluation documents'; } + #[\Override] public function up(Schema $schema): void { $this->addSql('CREATE SEQUENCE chill_person_social_work_eval_doc_id_seq INCREMENT BY 1 MINVALUE 1000 START 1000'); diff --git a/src/Bundle/ChillPersonBundle/migrations/Version20210831140339.php b/src/Bundle/ChillPersonBundle/migrations/Version20210831140339.php index 99b47abd9..87a34235a 100644 --- a/src/Bundle/ChillPersonBundle/migrations/Version20210831140339.php +++ b/src/Bundle/ChillPersonBundle/migrations/Version20210831140339.php @@ -19,16 +19,19 @@ use Doctrine\Migrations\AbstractMigration; */ final class Version20210831140339 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->addSql('ALTER TABLE chill_person_person ALTER center_id SET NOT NULL'); } + #[\Override] public function getDescription(): string { return 'Allow to create persons without center'; } + #[\Override] public function up(Schema $schema): void { $this->addSql('ALTER TABLE chill_person_person ALTER center_id DROP NOT NULL'); diff --git a/src/Bundle/ChillPersonBundle/migrations/Version20210910161858.php b/src/Bundle/ChillPersonBundle/migrations/Version20210910161858.php index 343518177..0acde73d9 100644 --- a/src/Bundle/ChillPersonBundle/migrations/Version20210910161858.php +++ b/src/Bundle/ChillPersonBundle/migrations/Version20210910161858.php @@ -19,17 +19,20 @@ use Doctrine\Migrations\AbstractMigration; */ final class Version20210910161858 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->addSql('DROP INDEX fullnamecanonical_trgm_idx'); $this->addSql('CREATE INDEX fullnameCanonical_trgm_idx ON chill_person_person USING GIST (fullnameCanonical gist_trgm_ops)'); } + #[\Override] public function getDescription(): string { return 'Optimize trigram index on person fullname: create index for both center_id and fullname'; } + #[\Override] public function up(Schema $schema): void { $this->addSql('DROP INDEX fullnamecanonical_trgm_idx'); diff --git a/src/Bundle/ChillPersonBundle/migrations/Version20210915093624.php b/src/Bundle/ChillPersonBundle/migrations/Version20210915093624.php index e0deaa121..8d0816384 100644 --- a/src/Bundle/ChillPersonBundle/migrations/Version20210915093624.php +++ b/src/Bundle/ChillPersonBundle/migrations/Version20210915093624.php @@ -19,6 +19,7 @@ use Doctrine\Migrations\AbstractMigration; */ final class Version20210915093624 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->addSql('DROP VIEW view_chill_person_current_address'); @@ -26,11 +27,13 @@ final class Version20210915093624 extends AbstractMigration $this->addSql('DROP INDEX chill_custom_person_household_members_sharing_idx'); } + #[\Override] public function getDescription(): string { return 'Create view for PersonCurrentAddress and related indexes'; } + #[\Override] public function up(Schema $schema): void { $this->addSql("CREATE VIEW view_chill_person_current_address AS diff --git a/src/Bundle/ChillPersonBundle/migrations/Version20211020131133.php b/src/Bundle/ChillPersonBundle/migrations/Version20211020131133.php index a04e00725..08232a6e7 100644 --- a/src/Bundle/ChillPersonBundle/migrations/Version20211020131133.php +++ b/src/Bundle/ChillPersonBundle/migrations/Version20211020131133.php @@ -19,17 +19,20 @@ use Doctrine\Migrations\AbstractMigration; */ final class Version20211020131133 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->addSql('DROP INDEX person_unique'); $this->addSql('DROP INDEX thirdparty_unique'); } + #[\Override] public function getDescription(): string { return 'Validation added to accompanying period resources and accompanying period.'; } + #[\Override] public function up(Schema $schema): void { $this->addSql('CREATE UNIQUE INDEX person_unique ON chill_person_accompanying_period_resource (person_id, accompanyingperiod_id) WHERE person_id IS NOT NULL'); diff --git a/src/Bundle/ChillPersonBundle/migrations/Version20211021125359.php b/src/Bundle/ChillPersonBundle/migrations/Version20211021125359.php index bc067c44d..bfc7bcfa4 100644 --- a/src/Bundle/ChillPersonBundle/migrations/Version20211021125359.php +++ b/src/Bundle/ChillPersonBundle/migrations/Version20211021125359.php @@ -19,16 +19,19 @@ use Doctrine\Migrations\AbstractMigration; */ final class Version20211021125359 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->addSql('CREATE UNIQUE INDEX participation_unique ON chill_person_accompanying_period_participation (accompanyingperiod_id, person_id)'); } + #[\Override] public function getDescription(): string { return 'Custom constraint added to database to prevent identical participations.'; } + #[\Override] public function up(Schema $schema): void { // creates a constraint 'participations may not overlap' diff --git a/src/Bundle/ChillPersonBundle/migrations/Version20211025141226.php b/src/Bundle/ChillPersonBundle/migrations/Version20211025141226.php index 6717e2dc7..3f4bf7a92 100644 --- a/src/Bundle/ChillPersonBundle/migrations/Version20211025141226.php +++ b/src/Bundle/ChillPersonBundle/migrations/Version20211025141226.php @@ -19,6 +19,7 @@ use Doctrine\Migrations\AbstractMigration; */ final class Version20211025141226 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->addSql('ALTER TABLE chill_person_relationships DROP CONSTRAINT FK_23D47C513256915B'); @@ -28,11 +29,13 @@ final class Version20211025141226 extends AbstractMigration $this->addSql('DROP TABLE chill_person_relationships'); } + #[\Override] public function getDescription(): string { return 'Create the relationship and relation entity'; } + #[\Override] public function up(Schema $schema): void { $this->addSql('CREATE SEQUENCE chill_person_relations_id_seq INCREMENT BY 1 MINVALUE 1 START 1'); diff --git a/src/Bundle/ChillPersonBundle/migrations/Version20211029075117.php b/src/Bundle/ChillPersonBundle/migrations/Version20211029075117.php index 607380f39..a7cc227a6 100644 --- a/src/Bundle/ChillPersonBundle/migrations/Version20211029075117.php +++ b/src/Bundle/ChillPersonBundle/migrations/Version20211029075117.php @@ -19,16 +19,19 @@ use Doctrine\Migrations\AbstractMigration; */ final class Version20211029075117 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->addSql('ALTER TABLE chill_person_relations DROP isActive'); } + #[\Override] public function getDescription(): string { return 'isActive property added to Relation entity.'; } + #[\Override] public function up(Schema $schema): void { $this->addSql('ALTER TABLE chill_person_relations ADD isActive BOOLEAN DEFAULT true NOT NULL'); diff --git a/src/Bundle/ChillPersonBundle/migrations/Version20211108100849.php b/src/Bundle/ChillPersonBundle/migrations/Version20211108100849.php index 76c48f47e..8c56cfe3a 100644 --- a/src/Bundle/ChillPersonBundle/migrations/Version20211108100849.php +++ b/src/Bundle/ChillPersonBundle/migrations/Version20211108100849.php @@ -19,6 +19,7 @@ use Doctrine\Migrations\AbstractMigration; */ final class Version20211108100849 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->addSql('ALTER TABLE chill_person_person DROP CONSTRAINT FK_BF210A1423D6A298'); @@ -26,11 +27,13 @@ final class Version20211108100849 extends AbstractMigration $this->addSql('ALTER TABLE chill_person_person DROP civility_id'); } + #[\Override] public function getDescription(): string { return 'Add Civility to Person'; } + #[\Override] public function up(Schema $schema): void { $this->addSql('ALTER TABLE chill_person_person ADD civility_id INT DEFAULT NULL'); diff --git a/src/Bundle/ChillPersonBundle/migrations/Version20211112170027.php b/src/Bundle/ChillPersonBundle/migrations/Version20211112170027.php index fc03fbc68..be04bc3a3 100644 --- a/src/Bundle/ChillPersonBundle/migrations/Version20211112170027.php +++ b/src/Bundle/ChillPersonBundle/migrations/Version20211112170027.php @@ -19,6 +19,7 @@ use Doctrine\Migrations\AbstractMigration; */ final class Version20211112170027 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->addSql('ALTER TABLE chill_person_person ALTER mobilenumber DROP NOT NULL'); @@ -27,11 +28,13 @@ final class Version20211112170027 extends AbstractMigration $this->addSql('ALTER TABLE chill_person_person ALTER phonenumber SET DEFAULT NULL'); } + #[\Override] public function getDescription(): string { return 'Drop not null in person table: set default empty value'; } + #[\Override] public function up(Schema $schema): void { $this->addSql('UPDATE chill_person_person SET mobilenumber = \'\' WHERE mobilenumber IS NULL'); diff --git a/src/Bundle/ChillPersonBundle/migrations/Version20211119211101.php b/src/Bundle/ChillPersonBundle/migrations/Version20211119211101.php index b98deb9b2..fba3ac3c5 100644 --- a/src/Bundle/ChillPersonBundle/migrations/Version20211119211101.php +++ b/src/Bundle/ChillPersonBundle/migrations/Version20211119211101.php @@ -16,17 +16,20 @@ use Doctrine\Migrations\AbstractMigration; final class Version20211119211101 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->addSql('DROP INDEX person_birthdate'); $this->addSql('DROP INDEX phonenumber'); } + #[\Override] public function getDescription(): string { return 'add indexes for searching by birthdate'; } + #[\Override] public function up(Schema $schema): void { $this->addSql('CREATE INDEX person_birthdate ON chill_person_person (birthdate)'); diff --git a/src/Bundle/ChillPersonBundle/migrations/Version20211119215630.php b/src/Bundle/ChillPersonBundle/migrations/Version20211119215630.php index eeec68ea6..7ff921c9e 100644 --- a/src/Bundle/ChillPersonBundle/migrations/Version20211119215630.php +++ b/src/Bundle/ChillPersonBundle/migrations/Version20211119215630.php @@ -16,6 +16,7 @@ use Doctrine\Migrations\AbstractMigration; final class Version20211119215630 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->addSql("CREATE OR REPLACE VIEW view_chill_person_current_address AS @@ -36,11 +37,13 @@ final class Version20211119215630 extends AbstractMigration "); } + #[\Override] public function getDescription(): string { return 'update computation of view_chill_person_current_address: do not take enddate into account'; } + #[\Override] public function up(Schema $schema): void { $this->addSql("CREATE OR REPLACE VIEW view_chill_person_current_address AS diff --git a/src/Bundle/ChillPersonBundle/migrations/Version20211213150253.php b/src/Bundle/ChillPersonBundle/migrations/Version20211213150253.php index 4282a16c3..a11611449 100644 --- a/src/Bundle/ChillPersonBundle/migrations/Version20211213150253.php +++ b/src/Bundle/ChillPersonBundle/migrations/Version20211213150253.php @@ -19,6 +19,7 @@ use Doctrine\Migrations\AbstractMigration; */ final class Version20211213150253 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->addSql('ALTER TABLE chill_person_accompanying_period DROP CONSTRAINT FK_E260A868B0804E90'); @@ -28,11 +29,13 @@ final class Version20211213150253 extends AbstractMigration $this->addSql('CREATE INDEX idx_e260a8683111d50b ON chill_person_accompanying_period (initialcomment_id)'); } + #[\Override] public function getDescription(): string { return 'rename initialComment attribute to pinnedComment'; } + #[\Override] public function up(Schema $schema): void { $this->addSql('ALTER TABLE chill_person_accompanying_period DROP CONSTRAINT fk_e260a8683111d50b'); diff --git a/src/Bundle/ChillPersonBundle/migrations/Version20211213203147.php b/src/Bundle/ChillPersonBundle/migrations/Version20211213203147.php index 99c04364d..cb5ff7591 100644 --- a/src/Bundle/ChillPersonBundle/migrations/Version20211213203147.php +++ b/src/Bundle/ChillPersonBundle/migrations/Version20211213203147.php @@ -19,6 +19,7 @@ use Doctrine\Migrations\AbstractMigration; */ final class Version20211213203147 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->addSql('DROP TABLE chill_person_social_work_evaluation_action'); @@ -27,11 +28,13 @@ final class Version20211213203147 extends AbstractMigration $this->addSql('CREATE INDEX idx_2e23f3febf32a3da ON chill_person_social_work_evaluation (socialaction_id)'); } + #[\Override] public function getDescription(): string { return 'an evaluation may be linked with multiple social actions'; } + #[\Override] public function up(Schema $schema): void { $this->addSql('CREATE TABLE chill_person_social_work_evaluation_action (evaluation_id INT NOT NULL, socialaction_id INT NOT NULL, PRIMARY KEY(evaluation_id, socialaction_id))'); diff --git a/src/Bundle/ChillPersonBundle/migrations/Version20211213213755.php b/src/Bundle/ChillPersonBundle/migrations/Version20211213213755.php index fe9fe48ee..82eeb0b55 100644 --- a/src/Bundle/ChillPersonBundle/migrations/Version20211213213755.php +++ b/src/Bundle/ChillPersonBundle/migrations/Version20211213213755.php @@ -16,17 +16,20 @@ use Doctrine\Migrations\AbstractMigration; final class Version20211213213755 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->addSql('ALTER TABLE chill_person_social_action DROP ordering'); $this->addSql('ALTER TABLE chill_person_social_issue DROP ordering'); } + #[\Override] public function getDescription(): string { return 'Add ordering to social issue and social actions'; } + #[\Override] public function up(Schema $schema): void { $this->addSql('ALTER TABLE chill_person_social_action ADD ordering DOUBLE PRECISION DEFAULT \'0\' NOT NULL'); diff --git a/src/Bundle/ChillPersonBundle/migrations/Version20211216154008.php b/src/Bundle/ChillPersonBundle/migrations/Version20211216154008.php index 802645b74..bf6a2e542 100644 --- a/src/Bundle/ChillPersonBundle/migrations/Version20211216154008.php +++ b/src/Bundle/ChillPersonBundle/migrations/Version20211216154008.php @@ -16,17 +16,20 @@ use Doctrine\Migrations\AbstractMigration; final class Version20211216154008 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->addSql('ALTER TABLE chill_person_household_members DROP CONSTRAINT chill_person_household_members_check'); $this->addSql('ALTER TABLE chill_person_household_members ADD CONSTRAINT chill_person_household_members_check CHECK (startdate < enddate)'); } + #[\Override] public function getDescription(): string { return 'Allow a person to be moved into different household on same day'; } + #[\Override] public function up(Schema $schema): void { $this->addSql('ALTER TABLE chill_person_household_members DROP CONSTRAINT chill_person_household_members_check'); diff --git a/src/Bundle/ChillPersonBundle/migrations/Version20211223150721.php b/src/Bundle/ChillPersonBundle/migrations/Version20211223150721.php index 5e43f79e4..ed503a271 100644 --- a/src/Bundle/ChillPersonBundle/migrations/Version20211223150721.php +++ b/src/Bundle/ChillPersonBundle/migrations/Version20211223150721.php @@ -19,6 +19,7 @@ use Doctrine\Migrations\AbstractMigration; */ final class Version20211223150721 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->addSql('ALTER TABLE chill_person_accompanying_period DROP CONSTRAINT FK_E260A86830F20868'); @@ -26,11 +27,13 @@ final class Version20211223150721 extends AbstractMigration $this->addSql('ALTER TABLE chill_person_accompanying_period DROP administrativeLocation_id'); } + #[\Override] public function getDescription(): string { return 'Add location to AccompanyingPeriod'; } + #[\Override] public function up(Schema $schema): void { $this->addSql('ALTER TABLE chill_person_accompanying_period ADD administrativeLocation_id INT DEFAULT NULL'); diff --git a/src/Bundle/ChillPersonBundle/migrations/Version20220104133334.php b/src/Bundle/ChillPersonBundle/migrations/Version20220104133334.php index 18b0c88ad..69018cbea 100644 --- a/src/Bundle/ChillPersonBundle/migrations/Version20220104133334.php +++ b/src/Bundle/ChillPersonBundle/migrations/Version20220104133334.php @@ -19,6 +19,7 @@ use Doctrine\Migrations\AbstractMigration; */ final class Version20220104133334 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->addSql('ALTER TABLE chill_person_accompanying_period_resource ADD comment_id INT DEFAULT NULL'); @@ -27,11 +28,13 @@ final class Version20220104133334 extends AbstractMigration $this->addSql('CREATE INDEX idx_dc78989ff8697d13 ON chill_person_accompanying_period_resource (comment_id)'); } + #[\Override] public function getDescription(): string { return 'Replace accompanyingCourse Resources comment by a string'; } + #[\Override] public function up(Schema $schema): void { $this->addSql('ALTER TABLE chill_person_accompanying_period_resource DROP CONSTRAINT fk_dc78989ff8697d13'); diff --git a/src/Bundle/ChillPersonBundle/migrations/Version20220119091025.php b/src/Bundle/ChillPersonBundle/migrations/Version20220119091025.php index fca52eb09..adc9d1557 100644 --- a/src/Bundle/ChillPersonBundle/migrations/Version20220119091025.php +++ b/src/Bundle/ChillPersonBundle/migrations/Version20220119091025.php @@ -19,6 +19,7 @@ use Doctrine\Migrations\AbstractMigration; */ final class Version20220119091025 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->addSql('ALTER TABLE chill_person_accompanying_period DROP CONSTRAINT FK_E260A868BE04EA9'); @@ -26,11 +27,13 @@ final class Version20220119091025 extends AbstractMigration $this->addSql('ALTER TABLE chill_person_accompanying_period DROP job_id'); } + #[\Override] public function getDescription(): string { return 'Add userJob to AccompanyingPeriod'; } + #[\Override] public function up(Schema $schema): void { $this->addSql('ALTER TABLE chill_person_accompanying_period ADD job_id INT DEFAULT NULL'); diff --git a/src/Bundle/ChillPersonBundle/migrations/Version20220119155944.php b/src/Bundle/ChillPersonBundle/migrations/Version20220119155944.php index 3bab22f27..ed78f2e5e 100644 --- a/src/Bundle/ChillPersonBundle/migrations/Version20220119155944.php +++ b/src/Bundle/ChillPersonBundle/migrations/Version20220119155944.php @@ -19,6 +19,7 @@ use Doctrine\Migrations\AbstractMigration; */ final class Version20220119155944 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->addSql('DROP SEQUENCE chill_person_resource_id_seq CASCADE'); @@ -27,11 +28,13 @@ final class Version20220119155944 extends AbstractMigration $this->addSql('DROP TABLE chill_person_resource_kind'); } + #[\Override] public function getDescription(): string { return 'Creation of person resource and person resource kind'; } + #[\Override] public function up(Schema $schema): void { $this->addSql('CREATE SEQUENCE chill_person_resource_id_seq INCREMENT BY 1 MINVALUE 1 START 1'); diff --git a/src/Bundle/ChillPersonBundle/migrations/Version20220121121310.php b/src/Bundle/ChillPersonBundle/migrations/Version20220121121310.php index b7bf0a9e4..cc69df0c6 100644 --- a/src/Bundle/ChillPersonBundle/migrations/Version20220121121310.php +++ b/src/Bundle/ChillPersonBundle/migrations/Version20220121121310.php @@ -16,6 +16,7 @@ use Doctrine\Migrations\AbstractMigration; final class Version20220121121310 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->addSql('DROP SEQUENCE chill_person_household_composition_id_seq CASCADE'); @@ -24,11 +25,13 @@ final class Version20220121121310 extends AbstractMigration $this->addSql('DROP TABLE chill_person_household_composition_type'); } + #[\Override] public function getDescription(): string { return 'Create table for household composition'; } + #[\Override] public function up(Schema $schema): void { $this->addSql('CREATE SEQUENCE chill_person_household_composition_id_seq INCREMENT BY 1 MINVALUE 1 START 1'); diff --git a/src/Bundle/ChillPersonBundle/migrations/Version20220128133039.php b/src/Bundle/ChillPersonBundle/migrations/Version20220128133039.php index e87bb6f0a..ebb8104a1 100644 --- a/src/Bundle/ChillPersonBundle/migrations/Version20220128133039.php +++ b/src/Bundle/ChillPersonBundle/migrations/Version20220128133039.php @@ -16,17 +16,20 @@ use Doctrine\Migrations\AbstractMigration; final class Version20220128133039 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->addSql('DROP SEQUENCE chill_person_accompanying_period_user_history_id_seq CASCADE'); $this->addSql('DROP TABLE chill_person_accompanying_period_user_history'); } + #[\Override] public function getDescription(): string { return 'Add table for tracking user history on accompanying period'; } + #[\Override] public function up(Schema $schema): void { $this->addSql('CREATE SEQUENCE chill_person_accompanying_period_user_history_id_seq INCREMENT BY 1 MINVALUE 1 START 1'); diff --git a/src/Bundle/ChillPersonBundle/migrations/Version20220214200327.php b/src/Bundle/ChillPersonBundle/migrations/Version20220214200327.php index 77a38b14b..1fae9517c 100644 --- a/src/Bundle/ChillPersonBundle/migrations/Version20220214200327.php +++ b/src/Bundle/ChillPersonBundle/migrations/Version20220214200327.php @@ -16,17 +16,20 @@ use Doctrine\Migrations\AbstractMigration; final class Version20220214200327 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->addSql('DROP SEQUENCE chill_person_accompanying_period_location_history_id_seq CASCADE'); $this->addSql('DROP TABLE chill_person_accompanying_period_location_history'); } + #[\Override] public function getDescription(): string { return 'Add location history to period'; } + #[\Override] public function up(Schema $schema): void { $this->addSql('CREATE SEQUENCE chill_person_accompanying_period_location_history_id_seq INCREMENT BY 1 MINVALUE 1 START 1'); diff --git a/src/Bundle/ChillPersonBundle/migrations/Version20220215135509.php b/src/Bundle/ChillPersonBundle/migrations/Version20220215135509.php index 5c7106e77..9ffe6d11d 100644 --- a/src/Bundle/ChillPersonBundle/migrations/Version20220215135509.php +++ b/src/Bundle/ChillPersonBundle/migrations/Version20220215135509.php @@ -21,16 +21,19 @@ final class Version20220215135509 extends AbstractMigration implements Container { use ContainerAwareTrait; + #[\Override] public function down(Schema $schema): void { throw new \Exception('You should not do that.'); } + #[\Override] public function getDescription(): string { return 'Update phone numbers for person'; } + #[\Override] public function up(Schema $schema): void { $carrier_code = $this->container diff --git a/src/Bundle/ChillPersonBundle/migrations/Version20220224145951.php b/src/Bundle/ChillPersonBundle/migrations/Version20220224145951.php index c26dd50a1..e83b57799 100644 --- a/src/Bundle/ChillPersonBundle/migrations/Version20220224145951.php +++ b/src/Bundle/ChillPersonBundle/migrations/Version20220224145951.php @@ -19,16 +19,19 @@ use Doctrine\Migrations\AbstractMigration; */ final class Version20220224145951 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->addSql('ALTER TABLE chill_person_accompanying_period_work_evaluation_document DROP title'); } + #[\Override] public function getDescription(): string { return 'Add title to AccompanyingPeriodWorkEvaluationDocument'; } + #[\Override] public function up(Schema $schema): void { $this->addSql('ALTER TABLE chill_person_accompanying_period_work_evaluation_document ADD title TEXT NOT NULL DEFAULT \'\''); diff --git a/src/Bundle/ChillPersonBundle/migrations/Version20220303113855.php b/src/Bundle/ChillPersonBundle/migrations/Version20220303113855.php index 41d35dd81..145f7359e 100644 --- a/src/Bundle/ChillPersonBundle/migrations/Version20220303113855.php +++ b/src/Bundle/ChillPersonBundle/migrations/Version20220303113855.php @@ -19,16 +19,19 @@ use Doctrine\Migrations\AbstractMigration; */ final class Version20220303113855 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->addSql('ALTER TABLE chill_person_social_work_evaluation DROP url'); } + #[\Override] public function getDescription(): string { return 'Add url to SocialWork Evaluation'; } + #[\Override] public function up(Schema $schema): void { $this->addSql('ALTER TABLE chill_person_social_work_evaluation ADD url TEXT DEFAULT NULL'); diff --git a/src/Bundle/ChillPersonBundle/migrations/Version20220310063629.php b/src/Bundle/ChillPersonBundle/migrations/Version20220310063629.php index fc7566fc7..5e847260e 100644 --- a/src/Bundle/ChillPersonBundle/migrations/Version20220310063629.php +++ b/src/Bundle/ChillPersonBundle/migrations/Version20220310063629.php @@ -19,16 +19,19 @@ use Doctrine\Migrations\AbstractMigration; */ final class Version20220310063629 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->addSql('DROP TABLE chill_person_accompanying_period_work_referrer'); } + #[\Override] public function getDescription(): string { return 'Add referrers to AccompanyingPeriodWork'; } + #[\Override] public function up(Schema $schema): void { $this->addSql('CREATE TABLE chill_person_accompanying_period_work_referrer (accompanyingperiodwork_id INT NOT NULL, user_id INT NOT NULL, PRIMARY KEY(accompanyingperiodwork_id, user_id))'); diff --git a/src/Bundle/ChillPersonBundle/migrations/Version20220310124318.php b/src/Bundle/ChillPersonBundle/migrations/Version20220310124318.php index 7f423126f..92867ffde 100644 --- a/src/Bundle/ChillPersonBundle/migrations/Version20220310124318.php +++ b/src/Bundle/ChillPersonBundle/migrations/Version20220310124318.php @@ -19,17 +19,20 @@ use Doctrine\Migrations\AbstractMigration; */ final class Version20220310124318 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->addSql('ALTER TABLE chill_person_accompanying_period DROP CONSTRAINT fk_e260a868b0804e90'); $this->addSql('ALTER TABLE chill_person_accompanying_period ADD CONSTRAINT fk_e260a868b0804e90 FOREIGN KEY (pinnedcomment_id) REFERENCES chill_person_accompanying_period_comment (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); } + #[\Override] public function getDescription(): string { return 'Change constraint on pinnedComment in Accompanying period'; } + #[\Override] public function up(Schema $schema): void { $this->addSql('ALTER TABLE chill_person_accompanying_period DROP CONSTRAINT FK_E260A868B0804E90'); diff --git a/src/Bundle/ChillPersonBundle/migrations/Version20220425000000.php b/src/Bundle/ChillPersonBundle/migrations/Version20220425000000.php index be37c07d6..9b856e589 100644 --- a/src/Bundle/ChillPersonBundle/migrations/Version20220425000000.php +++ b/src/Bundle/ChillPersonBundle/migrations/Version20220425000000.php @@ -19,16 +19,19 @@ use Doctrine\Migrations\AbstractMigration; */ final class Version20220425000000 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->addSql('DROP INDEX IDX_RELATIONSHIPS000'); } + #[\Override] public function getDescription(): string { return 'Add constraint with a index on chill_person_relationships.'; } + #[\Override] public function up(Schema $schema): void { $this->addSql('CREATE UNIQUE INDEX IDX_RELATIONSHIPS000 ON chill_person_relationships (least(fromperson_id, toperson_id), greatest(fromperson_id, toperson_id))'); diff --git a/src/Bundle/ChillPersonBundle/migrations/Version20220427150431.php b/src/Bundle/ChillPersonBundle/migrations/Version20220427150431.php index d6a69a1f0..58eaf834a 100644 --- a/src/Bundle/ChillPersonBundle/migrations/Version20220427150431.php +++ b/src/Bundle/ChillPersonBundle/migrations/Version20220427150431.php @@ -19,6 +19,7 @@ use Doctrine\Migrations\AbstractMigration; */ final class Version20220427150431 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { // this down() migration is auto-generated, please modify it to your needs @@ -30,11 +31,13 @@ final class Version20220427150431 extends AbstractMigration $this->addSql('COMMENT ON COLUMN chill_person_accompanying_period_work_evaluation_document.updatedat IS \'(DC2Type:date_immutable)\''); } + #[\Override] public function getDescription(): string { return 'change date to datetime for evaluation documents'; } + #[\Override] public function up(Schema $schema): void { // this up() migration is auto-generated, please modify it to your needs diff --git a/src/Bundle/ChillPersonBundle/migrations/Version20220429133023.php b/src/Bundle/ChillPersonBundle/migrations/Version20220429133023.php index ac4fae350..b07a55f50 100644 --- a/src/Bundle/ChillPersonBundle/migrations/Version20220429133023.php +++ b/src/Bundle/ChillPersonBundle/migrations/Version20220429133023.php @@ -16,6 +16,7 @@ use Doctrine\Migrations\AbstractMigration; final class Version20220429133023 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->addSql('ALTER TABLE "accompanying_periods_scopes" @@ -24,11 +25,13 @@ final class Version20220429133023 extends AbstractMigration '); } + #[\Override] public function getDescription(): string { return 'apply CASCADE DELETE on entity related to accompanying periods'; } + #[\Override] public function up(Schema $schema): void { $this->addSql('ALTER TABLE "accompanying_periods_scopes" diff --git a/src/Bundle/ChillPersonBundle/migrations/Version20220527124737.php b/src/Bundle/ChillPersonBundle/migrations/Version20220527124737.php index 876d8ad58..be5985285 100644 --- a/src/Bundle/ChillPersonBundle/migrations/Version20220527124737.php +++ b/src/Bundle/ChillPersonBundle/migrations/Version20220527124737.php @@ -16,16 +16,19 @@ use Doctrine\Migrations\AbstractMigration; final class Version20220527124737 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->addSql('ALTER TABLE activity DROP privateComment_comments'); } + #[\Override] public function getDescription(): string { return 'add private comment on accompanying period work'; } + #[\Override] public function up(Schema $schema): void { $this->addSql('ALTER TABLE chill_person_accompanying_period_work ADD privateComment_comments JSON DEFAULT \'{}\''); diff --git a/src/Bundle/ChillPersonBundle/migrations/Version20220926154347.php b/src/Bundle/ChillPersonBundle/migrations/Version20220926154347.php index a55d35fbe..f72f75f60 100644 --- a/src/Bundle/ChillPersonBundle/migrations/Version20220926154347.php +++ b/src/Bundle/ChillPersonBundle/migrations/Version20220926154347.php @@ -16,6 +16,7 @@ use Doctrine\Migrations\AbstractMigration; final class Version20220926154347 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->addSql('DROP VIEW view_chill_person_person_center_history_current'); @@ -23,11 +24,13 @@ final class Version20220926154347 extends AbstractMigration $this->addSql('DROP TABLE chill_person_person_center_history'); } + #[\Override] public function getDescription(): string { return 'Add a center history on person'; } + #[\Override] public function up(Schema $schema): void { $this->addSql('CREATE SEQUENCE chill_person_person_center_history_id_seq INCREMENT BY 1 MINVALUE 1 START 1'); diff --git a/src/Bundle/ChillPersonBundle/migrations/Version20221013131221.php b/src/Bundle/ChillPersonBundle/migrations/Version20221013131221.php index e8cb0d392..db957d35f 100644 --- a/src/Bundle/ChillPersonBundle/migrations/Version20221013131221.php +++ b/src/Bundle/ChillPersonBundle/migrations/Version20221013131221.php @@ -16,16 +16,19 @@ use Doctrine\Migrations\AbstractMigration; final class Version20221013131221 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->addSql('ALTER TABLE chill_person_social_work_evaluation DROP active'); } + #[\Override] public function getDescription(): string { return 'Add an active column on evaluation'; } + #[\Override] public function up(Schema $schema): void { $this->addSql('ALTER TABLE chill_person_social_work_evaluation ADD active BOOLEAN DEFAULT true NOT NULL'); diff --git a/src/Bundle/ChillPersonBundle/migrations/Version20221014115500.php b/src/Bundle/ChillPersonBundle/migrations/Version20221014115500.php index ec14dd8f0..8664ff447 100644 --- a/src/Bundle/ChillPersonBundle/migrations/Version20221014115500.php +++ b/src/Bundle/ChillPersonBundle/migrations/Version20221014115500.php @@ -16,17 +16,20 @@ use Doctrine\Migrations\AbstractMigration; final class Version20221014115500 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->addSql('DROP SEQUENCE chill_person_accompanying_period_step_history_id_seq CASCADE'); $this->addSql('DROP TABLE chill_person_accompanying_period_step_history'); } + #[\Override] public function getDescription(): string { return 'Add step history on accompanying periods'; } + #[\Override] public function up(Schema $schema): void { $this->addSql('CREATE SEQUENCE chill_person_accompanying_period_step_history_id_seq INCREMENT BY 1 MINVALUE 1 START 1'); diff --git a/src/Bundle/ChillPersonBundle/migrations/Version20230117152610.php b/src/Bundle/ChillPersonBundle/migrations/Version20230117152610.php index 81b61d2b5..aaf5156d5 100644 --- a/src/Bundle/ChillPersonBundle/migrations/Version20230117152610.php +++ b/src/Bundle/ChillPersonBundle/migrations/Version20230117152610.php @@ -19,6 +19,7 @@ use Doctrine\Migrations\AbstractMigration; */ final class Version20230117152610 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->addSql('ALTER TABLE country ALTER name TYPE JSON'); @@ -32,11 +33,13 @@ final class Version20230117152610 extends AbstractMigration $this->addSql('COMMENT ON COLUMN chill_person_household_composition_type.label IS \'(DC2Type:simple_array)\''); } + #[\Override] public function getDescription(): string { return 'convert json fields to jsonb'; } + #[\Override] public function up(Schema $schema): void { $this->addSql('ALTER TABLE chill_person_household_composition_type ALTER label TYPE JSONB'); diff --git a/src/Bundle/ChillPersonBundle/migrations/Version20230210104424.php b/src/Bundle/ChillPersonBundle/migrations/Version20230210104424.php index 0e2369db4..57cbbad45 100644 --- a/src/Bundle/ChillPersonBundle/migrations/Version20230210104424.php +++ b/src/Bundle/ChillPersonBundle/migrations/Version20230210104424.php @@ -16,16 +16,19 @@ use Doctrine\Migrations\AbstractMigration; final class Version20230210104424 extends AbstractMigration { + #[\Override] public function getDescription(): string { return 'Add a duration field to accompanyingPeriodWorkEvaluation'; } + #[\Override] public function up(Schema $schema): void { $this->addSql('ALTER TABLE chill_person_accompanying_period_work_evaluation ADD timeSpent INT DEFAULT NULL'); } + #[\Override] public function down(Schema $schema): void { $this->addSql('ALTER TABLE chill_person_accompanying_period_work_evaluation DROP timeSpent'); diff --git a/src/Bundle/ChillPersonBundle/migrations/Version20230427102309.php b/src/Bundle/ChillPersonBundle/migrations/Version20230427102309.php index 662c11d9a..8d2c50afc 100644 --- a/src/Bundle/ChillPersonBundle/migrations/Version20230427102309.php +++ b/src/Bundle/ChillPersonBundle/migrations/Version20230427102309.php @@ -16,11 +16,13 @@ use Doctrine\Migrations\AbstractMigration; final class Version20230427102309 extends AbstractMigration { + #[\Override] public function getDescription(): string { return 'Apply steps on confirmed and inactive accompanying periods'; } + #[\Override] public function up(Schema $schema): void { // create a table to store "infos" temporarily (will be store in the view) @@ -184,6 +186,7 @@ final class Version20230427102309 extends AbstractMigration SQL); } + #[\Override] public function down(Schema $schema): void { $this->throwIrreversibleMigrationException(); diff --git a/src/Bundle/ChillPersonBundle/migrations/Version20230627130331.php b/src/Bundle/ChillPersonBundle/migrations/Version20230627130331.php index 63f160997..88684f568 100644 --- a/src/Bundle/ChillPersonBundle/migrations/Version20230627130331.php +++ b/src/Bundle/ChillPersonBundle/migrations/Version20230627130331.php @@ -16,11 +16,13 @@ use Doctrine\Migrations\AbstractMigration; final class Version20230627130331 extends AbstractMigration { + #[\Override] public function getDescription(): string { return 'Add constraint to force unicity on chill_person_accompanying_period_user_history'; } + #[\Override] public function up(Schema $schema): void { $this->addSql('ALTER TABLE chill_person_accompanying_period_user_history @@ -29,6 +31,7 @@ final class Version20230627130331 extends AbstractMigration DEFERRABLE INITIALLY DEFERRED'); } + #[\Override] public function down(Schema $schema): void { $this->addSql('ALTER TABLE chill_person_accompanying_period_user_history DROP CONSTRAINT acc_period_user_history_not_overlaps'); diff --git a/src/Bundle/ChillPersonBundle/migrations/Version20230628152138.php b/src/Bundle/ChillPersonBundle/migrations/Version20230628152138.php index 240b99dbf..da78e2993 100644 --- a/src/Bundle/ChillPersonBundle/migrations/Version20230628152138.php +++ b/src/Bundle/ChillPersonBundle/migrations/Version20230628152138.php @@ -16,11 +16,13 @@ use Doctrine\Migrations\AbstractMigration; final class Version20230628152138 extends AbstractMigration { + #[\Override] public function getDescription(): string { return 'An accompanying period cannot have both a locaiton on a period and on an address'; } + #[\Override] public function up(Schema $schema): void { $this->addSql('UPDATE chill_person_accompanying_period SET addresslocation_id = NULL @@ -37,6 +39,7 @@ final class Version20230628152138 extends AbstractMigration $this->addSql('ALTER TABLE chill_person_accompanying_period_location_history ADD CONSTRAINT location_check CHECK (personlocation_id IS NULL OR addresslocation_id IS NULL)'); } + #[\Override] public function down(Schema $schema): void { $this->addSql('ALTER TABLE chill_person_accompanying_period DROP CONSTRAINT location_check'); diff --git a/src/Bundle/ChillPersonBundle/migrations/Version20230918115305.php b/src/Bundle/ChillPersonBundle/migrations/Version20230918115305.php index b127c146d..0d4a27aca 100644 --- a/src/Bundle/ChillPersonBundle/migrations/Version20230918115305.php +++ b/src/Bundle/ChillPersonBundle/migrations/Version20230918115305.php @@ -19,16 +19,19 @@ use Doctrine\Migrations\AbstractMigration; */ final class Version20230918115305 extends AbstractMigration { + #[\Override] public function getDescription(): string { return 'Add isCanceledAccompanyingPeriod property to ClosingMotive'; } + #[\Override] public function up(Schema $schema): void { $this->addSql('ALTER TABLE chill_person_accompanying_period_closingmotive ADD isCanceledAccompanyingPeriod BOOLEAN DEFAULT FALSE NOT NULL'); } + #[\Override] public function down(Schema $schema): void { $this->addSql('ALTER TABLE chill_person_accompanying_period_closingmotive DROP isCanceledAccompanyingPeriod'); diff --git a/src/Bundle/ChillPersonBundle/migrations/Version20231002094521.php b/src/Bundle/ChillPersonBundle/migrations/Version20231002094521.php index c960ab8f8..60e23701a 100644 --- a/src/Bundle/ChillPersonBundle/migrations/Version20231002094521.php +++ b/src/Bundle/ChillPersonBundle/migrations/Version20231002094521.php @@ -16,11 +16,13 @@ use Doctrine\Migrations\AbstractMigration; final class Version20231002094521 extends AbstractMigration { + #[\Override] public function getDescription(): string { return 'Remove doublons in chill_person_accompanying_period_location_history and add a constraint on startdate / endDate by period'; } + #[\Override] public function up(Schema $schema): void { $this->addSql( @@ -49,6 +51,7 @@ final class Version20231002094521 extends AbstractMigration ); } + #[\Override] public function down(Schema $schema): void { $this->addSql( diff --git a/src/Bundle/ChillPersonBundle/migrations/Version20231004142738.php b/src/Bundle/ChillPersonBundle/migrations/Version20231004142738.php index 0c9840fff..aae8aeecf 100644 --- a/src/Bundle/ChillPersonBundle/migrations/Version20231004142738.php +++ b/src/Bundle/ChillPersonBundle/migrations/Version20231004142738.php @@ -16,11 +16,13 @@ use Doctrine\Migrations\AbstractMigration; final class Version20231004142738 extends AbstractMigration { + #[\Override] public function getDescription(): string { return 'keep an history of accompanying period work referrer'; } + #[\Override] public function up(Schema $schema): void { $this->addSql('CREATE SEQUENCE chill_person_accompanying_period_work_referrer_id_seq INCREMENT BY 1 MINVALUE 1 START 1'); @@ -64,6 +66,7 @@ final class Version20231004142738 extends AbstractMigration DEFERRABLE INITIALLY DEFERRED'); } + #[\Override] public function down(Schema $schema): void { $this->addSql('DROP SEQUENCE chill_person_accompanying_period_work_referrer_id_seq CASCADE'); diff --git a/src/Bundle/ChillPersonBundle/migrations/Version20231121070151.php b/src/Bundle/ChillPersonBundle/migrations/Version20231121070151.php index 1123ef1c3..c1df43705 100644 --- a/src/Bundle/ChillPersonBundle/migrations/Version20231121070151.php +++ b/src/Bundle/ChillPersonBundle/migrations/Version20231121070151.php @@ -19,15 +19,18 @@ use Doctrine\Migrations\AbstractMigration; */ final class Version20231121070151 extends AbstractMigration { + #[\Override] public function getDescription(): string { return 'Change gender instances of "neuter" to "both"'; } + #[\Override] public function up(Schema $schema): void { $this->addSql("UPDATE chill_person_person SET gender = 'both' WHERE chill_person_person.gender = 'neuter'"); } + #[\Override] public function down(Schema $schema): void {} } diff --git a/src/Bundle/ChillPersonBundle/migrations/Version20231128143534.php b/src/Bundle/ChillPersonBundle/migrations/Version20231128143534.php index 5ec19392a..005c8f574 100644 --- a/src/Bundle/ChillPersonBundle/migrations/Version20231128143534.php +++ b/src/Bundle/ChillPersonBundle/migrations/Version20231128143534.php @@ -16,11 +16,13 @@ use Doctrine\Migrations\AbstractMigration; final class Version20231128143534 extends AbstractMigration { + #[\Override] public function getDescription(): string { return 'Set a default for the content column of accompanying_period_comment'; } + #[\Override] public function up(Schema $schema): void { $this->addSql("UPDATE chill_person_accompanying_period_comment SET content='' WHERE content IS NULL"); @@ -28,6 +30,7 @@ final class Version20231128143534 extends AbstractMigration $this->addSql('ALTER TABLE chill_person_accompanying_period_comment ALTER COLUMN content SET DEFAULT \'\''); } + #[\Override] public function down(Schema $schema): void { $this->addSql('ALTER TABLE chill_person_accompanying_period_comment ALTER COLUMN content DROP DEFAULT'); diff --git a/src/Bundle/ChillPersonBundle/migrations/Version20231129113816.php b/src/Bundle/ChillPersonBundle/migrations/Version20231129113816.php index 20bc3b446..61ce9d030 100644 --- a/src/Bundle/ChillPersonBundle/migrations/Version20231129113816.php +++ b/src/Bundle/ChillPersonBundle/migrations/Version20231129113816.php @@ -16,16 +16,19 @@ use Doctrine\Migrations\AbstractMigration; final class Version20231129113816 extends AbstractMigration { + #[\Override] public function getDescription(): string { return 'Add versioning to accompanying period work'; } + #[\Override] public function up(Schema $schema): void { $this->addSql('ALTER TABLE chill_person_accompanying_period_work ADD version INT DEFAULT 1 NOT NULL'); } + #[\Override] public function down(Schema $schema): void { $this->addSql('ALTER TABLE chill_person_accompanying_period_work DROP version'); diff --git a/src/Bundle/ChillPersonBundle/migrations/Version20231207221700.php b/src/Bundle/ChillPersonBundle/migrations/Version20231207221700.php index 80435ccf1..fc805aa6d 100644 --- a/src/Bundle/ChillPersonBundle/migrations/Version20231207221700.php +++ b/src/Bundle/ChillPersonBundle/migrations/Version20231207221700.php @@ -24,11 +24,13 @@ use Doctrine\Migrations\AbstractMigration; */ final class Version20231207221700 extends AbstractMigration { + #[\Override] public function getDescription(): string { return 'Fix lines in chill_person_person_center_history for people created before the introduction of the createdAt column'; } + #[\Override] public function up(Schema $schema): void { $this->addSql('WITH first_history_line AS (SELECT * @@ -51,6 +53,7 @@ WHERE AND first_activity.date < first_history_line.startDate'); } + #[\Override] public function down(Schema $schema): void { $this->throwIrreversibleMigrationException(); diff --git a/src/Bundle/ChillPersonBundle/migrations/Version20240123161457.php b/src/Bundle/ChillPersonBundle/migrations/Version20240123161457.php index 4c19e6c8f..24dca5fb2 100644 --- a/src/Bundle/ChillPersonBundle/migrations/Version20240123161457.php +++ b/src/Bundle/ChillPersonBundle/migrations/Version20240123161457.php @@ -16,11 +16,13 @@ use Doctrine\Migrations\AbstractMigration; final class Version20240123161457 extends AbstractMigration { + #[\Override] public function getDescription(): string { return 'Store closing motive when closing a course'; } + #[\Override] public function up(Schema $schema): void { $this->addSql('ALTER TABLE chill_person_accompanying_period_step_history ADD closingMotive_id INT DEFAULT NULL'); @@ -42,6 +44,7 @@ final class Version20240123161457 extends AbstractMigration $this->addSql('CREATE INDEX IDX_84D514AC504CB38D ON chill_person_accompanying_period_step_history (closingMotive_id)'); } + #[\Override] public function down(Schema $schema): void { $this->addSql('ALTER TABLE chill_person_accompanying_period_step_history DROP CONSTRAINT FK_84D514AC504CB38D'); diff --git a/src/Bundle/ChillReportBundle/DataFixtures/ORM/LoadCustomField.php b/src/Bundle/ChillReportBundle/DataFixtures/ORM/LoadCustomField.php index e32b73544..69c25b004 100644 --- a/src/Bundle/ChillReportBundle/DataFixtures/ORM/LoadCustomField.php +++ b/src/Bundle/ChillReportBundle/DataFixtures/ORM/LoadCustomField.php @@ -21,11 +21,13 @@ use Doctrine\Persistence\ObjectManager; */ class LoadCustomField extends AbstractFixture implements OrderedFixtureInterface { + #[\Override] public function getOrder() { return 15001; } + #[\Override] public function load(ObjectManager $manager) { $cFTypes = [ diff --git a/src/Bundle/ChillReportBundle/DataFixtures/ORM/LoadCustomFieldsGroup.php b/src/Bundle/ChillReportBundle/DataFixtures/ORM/LoadCustomFieldsGroup.php index af2f06e69..58b81e305 100644 --- a/src/Bundle/ChillReportBundle/DataFixtures/ORM/LoadCustomFieldsGroup.php +++ b/src/Bundle/ChillReportBundle/DataFixtures/ORM/LoadCustomFieldsGroup.php @@ -21,11 +21,13 @@ use Doctrine\Persistence\ObjectManager; */ class LoadCustomFieldsGroup extends AbstractFixture implements OrderedFixtureInterface { + #[\Override] public function getOrder() { return 15000; } + #[\Override] public function load(ObjectManager $manager) { echo "loading customFieldsGroup...\n"; diff --git a/src/Bundle/ChillReportBundle/DataFixtures/ORM/LoadReportACL.php b/src/Bundle/ChillReportBundle/DataFixtures/ORM/LoadReportACL.php index 2aa175b80..4521bb264 100644 --- a/src/Bundle/ChillReportBundle/DataFixtures/ORM/LoadReportACL.php +++ b/src/Bundle/ChillReportBundle/DataFixtures/ORM/LoadReportACL.php @@ -24,11 +24,13 @@ use Doctrine\Persistence\ObjectManager; */ class LoadReportACL extends AbstractFixture implements OrderedFixtureInterface { + #[\Override] public function getOrder() { return 14999; } + #[\Override] public function load(ObjectManager $manager) { foreach (LoadPermissionsGroup::$refs as $permissionsGroupRef) { diff --git a/src/Bundle/ChillReportBundle/DataFixtures/ORM/LoadReports.php b/src/Bundle/ChillReportBundle/DataFixtures/ORM/LoadReports.php index 6c61b1914..c86dc10a4 100644 --- a/src/Bundle/ChillReportBundle/DataFixtures/ORM/LoadReports.php +++ b/src/Bundle/ChillReportBundle/DataFixtures/ORM/LoadReports.php @@ -35,11 +35,13 @@ final class LoadReports extends AbstractFixture implements OrderedFixtureInterfa $this->faker = FakerFactory::create('fr_FR'); } + #[\Override] public function getOrder() { return 15002; } + #[\Override] public function load(ObjectManager $manager) { $this->createExpected($manager); diff --git a/src/Bundle/ChillReportBundle/DependencyInjection/ChillReportExtension.php b/src/Bundle/ChillReportBundle/DependencyInjection/ChillReportExtension.php index a4d2a58d5..45cef492e 100644 --- a/src/Bundle/ChillReportBundle/DependencyInjection/ChillReportExtension.php +++ b/src/Bundle/ChillReportBundle/DependencyInjection/ChillReportExtension.php @@ -57,6 +57,7 @@ class ChillReportExtension extends Extension implements PrependExtensionInterfac ); } + #[\Override] public function load(array $configs, ContainerBuilder $container) { $configuration = new Configuration(); @@ -69,6 +70,7 @@ class ChillReportExtension extends Extension implements PrependExtensionInterfac $loader->load('services/controller.yaml'); } + #[\Override] public function prepend(ContainerBuilder $container) { $this->declareReportAsCustomizable($container); diff --git a/src/Bundle/ChillReportBundle/DependencyInjection/Configuration.php b/src/Bundle/ChillReportBundle/DependencyInjection/Configuration.php index 70c9f532b..8a3848559 100644 --- a/src/Bundle/ChillReportBundle/DependencyInjection/Configuration.php +++ b/src/Bundle/ChillReportBundle/DependencyInjection/Configuration.php @@ -21,6 +21,7 @@ use Symfony\Component\Config\Definition\ConfigurationInterface; */ class Configuration implements ConfigurationInterface { + #[\Override] public function getConfigTreeBuilder() { $treeBuilder = new TreeBuilder('chill_report'); diff --git a/src/Bundle/ChillReportBundle/Entity/Report.php b/src/Bundle/ChillReportBundle/Entity/Report.php index 8d6c1888f..0862b672c 100644 --- a/src/Bundle/ChillReportBundle/Entity/Report.php +++ b/src/Bundle/ChillReportBundle/Entity/Report.php @@ -54,6 +54,7 @@ class Report implements HasCenterInterface, HasScopeInterface /** * @return Center */ + #[\Override] public function getCenter() { return $this->person->getCenter(); @@ -112,6 +113,7 @@ class Report implements HasCenterInterface, HasScopeInterface * * @return Scope */ + #[\Override] public function getScope() { return $this->scope; diff --git a/src/Bundle/ChillReportBundle/Export/Export/ReportList.php b/src/Bundle/ChillReportBundle/Export/Export/ReportList.php index 1761e3522..e7d387f0e 100644 --- a/src/Bundle/ChillReportBundle/Export/Export/ReportList.php +++ b/src/Bundle/ChillReportBundle/Export/Export/ReportList.php @@ -48,6 +48,7 @@ class ReportList implements ExportElementValidatedInterface, ListInterface public function __construct(protected CustomFieldsGroup $customfieldsGroup, protected TranslatableStringHelper $translatableStringHelper, protected TranslatorInterface $translator, protected CustomFieldProvider $customFieldProvider, protected EntityManagerInterface $em) {} + #[\Override] public function buildForm(FormBuilderInterface $builder) { $choices = array_combine($this->fields, $this->fields); @@ -97,16 +98,19 @@ class ReportList implements ExportElementValidatedInterface, ListInterface ]); } + #[\Override] public function getFormDefaultData(): array { return ['address_date' => new \DateTime()]; } + #[\Override] public function getAllowedFormattersTypes() { return [FormatterInterface::TYPE_LIST]; } + #[\Override] public function getDescription() { return $this->translator->trans( @@ -117,6 +121,7 @@ class ReportList implements ExportElementValidatedInterface, ListInterface ); } + #[\Override] public function getLabels($key, array $values, $data) { switch ($key) { @@ -253,6 +258,7 @@ class ReportList implements ExportElementValidatedInterface, ListInterface } } + #[\Override] public function getQueryKeys($data) { $fields = []; @@ -267,11 +273,13 @@ class ReportList implements ExportElementValidatedInterface, ListInterface return [...$fields, ...\array_keys($this->slugs)]; } + #[\Override] public function getResult($query, $data) { return $query->getQuery()->getResult(Query::HYDRATE_SCALAR); } + #[\Override] public function getTitle() { return $this->translator->trans( @@ -282,11 +290,13 @@ class ReportList implements ExportElementValidatedInterface, ListInterface ); } + #[\Override] public function getType() { return 'report'; } + #[\Override] public function initiateQuery(array $requiredModifiers, array $acl, array $data = []) { $centers = array_map(static fn ($el) => $el['center'], $acl); @@ -403,16 +413,19 @@ class ReportList implements ExportElementValidatedInterface, ListInterface ->setParameter('authorized_centers', $centers); } + #[\Override] public function requiredRole(): string { return ReportVoter::LISTS; } + #[\Override] public function supportsModifiers() { return [Declarations::PERSON_TYPE, 'report']; } + #[\Override] public function validateForm($data, ExecutionContextInterface $context) { // get the field starting with address_ diff --git a/src/Bundle/ChillReportBundle/Export/Export/ReportListProvider.php b/src/Bundle/ChillReportBundle/Export/Export/ReportListProvider.php index 082c1ef4a..2527f9c79 100644 --- a/src/Bundle/ChillReportBundle/Export/Export/ReportListProvider.php +++ b/src/Bundle/ChillReportBundle/Export/Export/ReportListProvider.php @@ -53,6 +53,7 @@ class ReportListProvider implements ExportElementsProviderInterface $this->customFieldProvider = $customFieldProvider; } + #[\Override] public function getExportElements() { $groups = $this->em->getRepository(CustomFieldsGroup::class) diff --git a/src/Bundle/ChillReportBundle/Export/Filter/ReportDateFilter.php b/src/Bundle/ChillReportBundle/Export/Filter/ReportDateFilter.php index 0346f2ab3..ca02e9e43 100644 --- a/src/Bundle/ChillReportBundle/Export/Filter/ReportDateFilter.php +++ b/src/Bundle/ChillReportBundle/Export/Filter/ReportDateFilter.php @@ -21,11 +21,13 @@ class ReportDateFilter implements FilterInterface { public function __construct(private readonly RollingDateConverterInterface $rollingDateConverter) {} + #[\Override] public function addRole(): ?string { return null; } + #[\Override] public function alterQuery(\Doctrine\ORM\QueryBuilder $qb, $data) { $where = $qb->getDQLPart('where'); @@ -52,11 +54,13 @@ class ReportDateFilter implements FilterInterface ); } + #[\Override] public function applyOn() { return 'report'; } + #[\Override] public function buildForm(\Symfony\Component\Form\FormBuilderInterface $builder) { $builder->add('date_from', PickRollingDateType::class, [ @@ -68,11 +72,13 @@ class ReportDateFilter implements FilterInterface ]); } + #[\Override] public function getFormDefaultData(): array { return ['date_from' => new RollingDate(RollingDate::T_YEAR_PREVIOUS_START), 'date_to' => new RollingDate(RollingDate::T_TODAY)]; } + #[\Override] public function describeAction($data, $format = 'string') { return ['Filtered by report\'s date: ' @@ -82,6 +88,7 @@ class ReportDateFilter implements FilterInterface ], ]; } + #[\Override] public function getTitle() { return 'Filter by report\'s date'; diff --git a/src/Bundle/ChillReportBundle/Form/ReportType.php b/src/Bundle/ChillReportBundle/Form/ReportType.php index 9d979458a..c7feb0c79 100644 --- a/src/Bundle/ChillReportBundle/Form/ReportType.php +++ b/src/Bundle/ChillReportBundle/Form/ReportType.php @@ -34,6 +34,7 @@ final class ReportType extends AbstractType private readonly ObjectManager $om ) {} + #[\Override] public function buildForm(FormBuilderInterface $builder, array $options) { $builder @@ -67,6 +68,7 @@ final class ReportType extends AbstractType ); } + #[\Override] public function configureOptions(OptionsResolver $resolver) { $resolver->setDefaults([ @@ -85,6 +87,7 @@ final class ReportType extends AbstractType /** * @return string */ + #[\Override] public function getBlockPrefix() { return 'chill_reportbundle_report'; diff --git a/src/Bundle/ChillReportBundle/Security/Authorization/ReportVoter.php b/src/Bundle/ChillReportBundle/Security/Authorization/ReportVoter.php index f93d140ee..78d0dd0b0 100644 --- a/src/Bundle/ChillReportBundle/Security/Authorization/ReportVoter.php +++ b/src/Bundle/ChillReportBundle/Security/Authorization/ReportVoter.php @@ -21,13 +21,13 @@ use Symfony\Component\Security\Core\Authentication\Token\TokenInterface; class ReportVoter extends AbstractChillVoter implements ProvideRoleHierarchyInterface { - final public const CREATE = 'CHILL_REPORT_CREATE'; + final public const string CREATE = 'CHILL_REPORT_CREATE'; - final public const LISTS = 'CHILL_REPORT_LISTS'; + final public const string LISTS = 'CHILL_REPORT_LISTS'; - final public const SEE = 'CHILL_REPORT_SEE'; + final public const string SEE = 'CHILL_REPORT_SEE'; - final public const UPDATE = 'CHILL_REPORT_UPDATE'; + final public const string UPDATE = 'CHILL_REPORT_UPDATE'; /** * @var AuthorizationHelper @@ -39,21 +39,25 @@ class ReportVoter extends AbstractChillVoter implements ProvideRoleHierarchyInte $this->helper = $helper; } + #[\Override] public function getRoles(): array { return [self::CREATE, self::UPDATE, self::SEE, self::LISTS]; } + #[\Override] public function getRolesWithHierarchy(): array { return ['Report' => $this->getRoles()]; } + #[\Override] public function getRolesWithoutScope(): array { return [self::LISTS]; } + #[\Override] protected function supports($attribute, $subject) { if ($subject instanceof Report) { @@ -67,6 +71,7 @@ class ReportVoter extends AbstractChillVoter implements ProvideRoleHierarchyInte } } + #[\Override] protected function voteOnAttribute($attribute, $subject, TokenInterface $token) { if (!$token->getUser() instanceof User) { diff --git a/src/Bundle/ChillReportBundle/Tests/Controller/ReportControllerNextTest.php b/src/Bundle/ChillReportBundle/Tests/Controller/ReportControllerNextTest.php index d91583dc0..7b9734d55 100644 --- a/src/Bundle/ChillReportBundle/Tests/Controller/ReportControllerNextTest.php +++ b/src/Bundle/ChillReportBundle/Tests/Controller/ReportControllerNextTest.php @@ -35,6 +35,7 @@ final class ReportControllerNextTest extends WebTestCase */ protected $person; + #[\Override] protected function setUp(): void { self::bootKernel(); diff --git a/src/Bundle/ChillReportBundle/Tests/Controller/ReportControllerTest.php b/src/Bundle/ChillReportBundle/Tests/Controller/ReportControllerTest.php index e5270c038..c1bcf991e 100644 --- a/src/Bundle/ChillReportBundle/Tests/Controller/ReportControllerTest.php +++ b/src/Bundle/ChillReportBundle/Tests/Controller/ReportControllerTest.php @@ -28,7 +28,7 @@ use Symfony\Component\DomCrawler\Link; */ final class ReportControllerTest extends WebTestCase { - public const REPORT_NAME_FIELD = 'cFGroup'; + public const string REPORT_NAME_FIELD = 'cFGroup'; /** * @var \SClientymfony\Component\BrowserKit\ @@ -49,6 +49,7 @@ final class ReportControllerTest extends WebTestCase private static $user; + #[\Override] public static function setUpBeforeClass(): void { self::bootKernel(); @@ -88,6 +89,7 @@ final class ReportControllerTest extends WebTestCase ->findOneBy(['username' => 'center a_social']); } + #[\Override] protected function setUp(): void { self::$client = self::createClient([], [ diff --git a/src/Bundle/ChillReportBundle/Tests/Export/Filter/ReportDateFilterTest.php b/src/Bundle/ChillReportBundle/Tests/Export/Filter/ReportDateFilterTest.php index 9b1040fb8..96cac1604 100644 --- a/src/Bundle/ChillReportBundle/Tests/Export/Filter/ReportDateFilterTest.php +++ b/src/Bundle/ChillReportBundle/Tests/Export/Filter/ReportDateFilterTest.php @@ -26,6 +26,7 @@ final class ReportDateFilterTest extends AbstractFilterTest { private ReportDateFilter $filter; + #[\Override] protected function setUp(): void { self::bootKernel(); @@ -33,11 +34,13 @@ final class ReportDateFilterTest extends AbstractFilterTest $this->filter = self::getContainer()->get(ReportDateFilter::class); } + #[\Override] public function getFilter() { return $this->filter; } + #[\Override] public static function getFormData(): array { return [ @@ -48,6 +51,7 @@ final class ReportDateFilterTest extends AbstractFilterTest ]; } + #[\Override] public static function getQueryBuilders(): iterable { self::bootKernel(); diff --git a/src/Bundle/ChillReportBundle/Tests/Security/Authorization/ReportVoterTest.php b/src/Bundle/ChillReportBundle/Tests/Security/Authorization/ReportVoterTest.php index 6c0769e56..319fca03e 100644 --- a/src/Bundle/ChillReportBundle/Tests/Security/Authorization/ReportVoterTest.php +++ b/src/Bundle/ChillReportBundle/Tests/Security/Authorization/ReportVoterTest.php @@ -44,8 +44,10 @@ final class ReportVoterTest extends KernelTestCase */ protected $voter; + #[\Override] public static function setUpBeforeClass(): void {} + #[\Override] protected function setUp(): void { self::bootKernel(); diff --git a/src/Bundle/ChillReportBundle/Tests/Timeline/TimelineProviderTest.php b/src/Bundle/ChillReportBundle/Tests/Timeline/TimelineProviderTest.php index d7a4054f7..bbd924e6c 100644 --- a/src/Bundle/ChillReportBundle/Tests/Timeline/TimelineProviderTest.php +++ b/src/Bundle/ChillReportBundle/Tests/Timeline/TimelineProviderTest.php @@ -38,6 +38,7 @@ final class TimelineProviderTest extends WebTestCase /** * Create a person with a report associated with the person. */ + #[\Override] protected function setUp(): void { self::bootKernel(); @@ -79,6 +80,7 @@ final class TimelineProviderTest extends WebTestCase self::$em->flush(); } + #[\Override] protected function tearDown(): void { // static::$em->refresh($this->person); diff --git a/src/Bundle/ChillReportBundle/Timeline/TimelineReportProvider.php b/src/Bundle/ChillReportBundle/Timeline/TimelineReportProvider.php index 17b600149..e803387ed 100644 --- a/src/Bundle/ChillReportBundle/Timeline/TimelineReportProvider.php +++ b/src/Bundle/ChillReportBundle/Timeline/TimelineReportProvider.php @@ -27,6 +27,7 @@ class TimelineReportProvider implements TimelineProviderInterface { public function __construct(protected EntityManager $em, protected AuthorizationHelper $helper, private readonly Security $security, protected CustomFieldsHelper $customFieldsHelper, protected $showEmptyValues) {} + #[\Override] public function fetchQuery($context, array $args) { $this->checkContext($context); @@ -46,6 +47,7 @@ class TimelineReportProvider implements TimelineProviderInterface ]); } + #[\Override] public function getEntities(array $ids) { $reports = $this->em->getRepository('ChillReportBundle:Report') @@ -60,6 +62,7 @@ class TimelineReportProvider implements TimelineProviderInterface return $result; } + #[\Override] public function getEntityTemplate($entity, $context, array $args) { $this->checkContext($context); @@ -74,6 +77,7 @@ class TimelineReportProvider implements TimelineProviderInterface ]; } + #[\Override] public function supportsType($type) { return 'report' === $type; diff --git a/src/Bundle/ChillReportBundle/migrations/Version20141129012050.php b/src/Bundle/ChillReportBundle/migrations/Version20141129012050.php index c45d1ef0b..acb6d6ea5 100644 --- a/src/Bundle/ChillReportBundle/migrations/Version20141129012050.php +++ b/src/Bundle/ChillReportBundle/migrations/Version20141129012050.php @@ -19,11 +19,13 @@ use Doctrine\Migrations\AbstractMigration; */ class Version20141129012050 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { // this down() migration is auto-generated, please modify it to your needs } + #[\Override] public function up(Schema $schema): void { $this->addSql('CREATE SEQUENCE Report_id_seq INCREMENT BY 1 MINVALUE 1 START 1;'); diff --git a/src/Bundle/ChillReportBundle/migrations/Version20150622233319.php b/src/Bundle/ChillReportBundle/migrations/Version20150622233319.php index c4c261cd3..6f4f6b8d3 100644 --- a/src/Bundle/ChillReportBundle/migrations/Version20150622233319.php +++ b/src/Bundle/ChillReportBundle/migrations/Version20150622233319.php @@ -24,6 +24,7 @@ class Version20150622233319 extends AbstractMigration implements ContainerAwareI { private ?ContainerInterface $container = null; + #[\Override] public function down(Schema $schema): void { $this->abortIf( @@ -37,6 +38,7 @@ class Version20150622233319 extends AbstractMigration implements ContainerAwareI $this->addSql('ALTER TABLE Report DROP scope_id'); } + #[\Override] public function setContainer(?ContainerInterface $container = null) { if (null === $container) { @@ -46,6 +48,7 @@ class Version20150622233319 extends AbstractMigration implements ContainerAwareI $this->container = $container; } + #[\Override] public function up(Schema $schema): void { $this->abortIf( diff --git a/src/Bundle/ChillTaskBundle/ChillTaskBundle.php b/src/Bundle/ChillTaskBundle/ChillTaskBundle.php index 05f92ea93..06166ed6d 100644 --- a/src/Bundle/ChillTaskBundle/ChillTaskBundle.php +++ b/src/Bundle/ChillTaskBundle/ChillTaskBundle.php @@ -17,6 +17,7 @@ use Symfony\Component\HttpKernel\Bundle\Bundle; class ChillTaskBundle extends Bundle { + #[\Override] public function build(ContainerBuilder $container) { parent::build($container); diff --git a/src/Bundle/ChillTaskBundle/DataFixtures/ORM/LoadTaskACL.php b/src/Bundle/ChillTaskBundle/DataFixtures/ORM/LoadTaskACL.php index cb38df91c..ca3a89c57 100644 --- a/src/Bundle/ChillTaskBundle/DataFixtures/ORM/LoadTaskACL.php +++ b/src/Bundle/ChillTaskBundle/DataFixtures/ORM/LoadTaskACL.php @@ -25,11 +25,13 @@ use Doctrine\Persistence\ObjectManager; */ class LoadTaskACL extends AbstractFixture implements OrderedFixtureInterface { + #[\Override] public function getOrder() { return 16000; } + #[\Override] public function load(ObjectManager $manager) { foreach (LoadPermissionsGroup::$refs as $permissionsGroupRef) { diff --git a/src/Bundle/ChillTaskBundle/DependencyInjection/ChillTaskExtension.php b/src/Bundle/ChillTaskBundle/DependencyInjection/ChillTaskExtension.php index 0122861d6..d805bdc86 100644 --- a/src/Bundle/ChillTaskBundle/DependencyInjection/ChillTaskExtension.php +++ b/src/Bundle/ChillTaskBundle/DependencyInjection/ChillTaskExtension.php @@ -26,6 +26,7 @@ use Symfony\Component\HttpKernel\DependencyInjection\Extension; */ class ChillTaskExtension extends Extension implements PrependExtensionInterface { + #[\Override] public function load(array $configs, ContainerBuilder $container) { $configuration = new Configuration(); @@ -44,6 +45,7 @@ class ChillTaskExtension extends Extension implements PrependExtensionInterface $loader->load('services/form.yaml'); } + #[\Override] public function prepend(ContainerBuilder $container) { $this->prependAuthorization($container); diff --git a/src/Bundle/ChillTaskBundle/DependencyInjection/Compiler/TaskWorkflowDefinitionCompilerPass.php b/src/Bundle/ChillTaskBundle/DependencyInjection/Compiler/TaskWorkflowDefinitionCompilerPass.php index 4447778ec..16faf3ae7 100644 --- a/src/Bundle/ChillTaskBundle/DependencyInjection/Compiler/TaskWorkflowDefinitionCompilerPass.php +++ b/src/Bundle/ChillTaskBundle/DependencyInjection/Compiler/TaskWorkflowDefinitionCompilerPass.php @@ -20,6 +20,7 @@ use Symfony\Component\DependencyInjection\Reference; class TaskWorkflowDefinitionCompilerPass implements CompilerPassInterface { + #[\Override] public function process(ContainerBuilder $container) { if (!$container->hasDefinition(TaskWorkflowManager::class)) { diff --git a/src/Bundle/ChillTaskBundle/DependencyInjection/Configuration.php b/src/Bundle/ChillTaskBundle/DependencyInjection/Configuration.php index f01050684..e9bd6b39f 100644 --- a/src/Bundle/ChillTaskBundle/DependencyInjection/Configuration.php +++ b/src/Bundle/ChillTaskBundle/DependencyInjection/Configuration.php @@ -21,6 +21,7 @@ use Symfony\Component\Config\Definition\ConfigurationInterface; */ class Configuration implements ConfigurationInterface { + #[\Override] public function getConfigTreeBuilder() { $treeBuilder = new TreeBuilder('chill_task'); diff --git a/src/Bundle/ChillTaskBundle/Entity/AbstractTask.php b/src/Bundle/ChillTaskBundle/Entity/AbstractTask.php index 08405218d..f19fb4b8e 100644 --- a/src/Bundle/ChillTaskBundle/Entity/AbstractTask.php +++ b/src/Bundle/ChillTaskBundle/Entity/AbstractTask.php @@ -69,6 +69,7 @@ abstract class AbstractTask implements HasCenterInterface, HasScopeInterface return $this->assignee; } + #[\Override] public function getCenter(): ?\Chill\MainBundle\Entity\Center { if ($this->getPerson() instanceof Person) { @@ -120,6 +121,7 @@ abstract class AbstractTask implements HasCenterInterface, HasScopeInterface return $this->person; } + #[\Override] public function getScope(): ?Scope { return $this->getCircle(); diff --git a/src/Bundle/ChillTaskBundle/Event/Lifecycle/TaskLifecycleEvent.php b/src/Bundle/ChillTaskBundle/Event/Lifecycle/TaskLifecycleEvent.php index e6966f16e..8345a2ec4 100644 --- a/src/Bundle/ChillTaskBundle/Event/Lifecycle/TaskLifecycleEvent.php +++ b/src/Bundle/ChillTaskBundle/Event/Lifecycle/TaskLifecycleEvent.php @@ -38,6 +38,7 @@ class TaskLifecycleEvent implements EventSubscriberInterface $this->em = $em; } + #[\Override] public static function getSubscribedEvents(): array { return [ diff --git a/src/Bundle/ChillTaskBundle/Event/TaskEvent.php b/src/Bundle/ChillTaskBundle/Event/TaskEvent.php index 4e38f96ca..da6cb724e 100644 --- a/src/Bundle/ChillTaskBundle/Event/TaskEvent.php +++ b/src/Bundle/ChillTaskBundle/Event/TaskEvent.php @@ -15,7 +15,7 @@ use Chill\TaskBundle\Entity\AbstractTask; class TaskEvent extends \Symfony\Contracts\EventDispatcher\Event { - final public const PERSIST = 'chill_task.task_persist'; + final public const string 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 ba7d85eb0..262dabc5c 100644 --- a/src/Bundle/ChillTaskBundle/Event/UI/UIEvent.php +++ b/src/Bundle/ChillTaskBundle/Event/UI/UIEvent.php @@ -18,11 +18,11 @@ use Symfony\Component\Workflow\Transition; class UIEvent extends \Symfony\Contracts\EventDispatcher\Event { - final public const EDIT_FORM = 'chill_task.edit_form'; + final public const string EDIT_FORM = 'chill_task.edit_form'; - final public const EDIT_PAGE = 'chill_task.edit_page'; + final public const string EDIT_PAGE = 'chill_task.edit_page'; - final public const SHOW_TRANSITION_PAGE = 'chill_task.show_transition_page'; + final public const string SHOW_TRANSITION_PAGE = 'chill_task.show_transition_page'; /** * @var FormInterface|null diff --git a/src/Bundle/ChillTaskBundle/Form/SingleTaskListType.php b/src/Bundle/ChillTaskBundle/Form/SingleTaskListType.php index e0221545b..3cf142410 100644 --- a/src/Bundle/ChillTaskBundle/Form/SingleTaskListType.php +++ b/src/Bundle/ChillTaskBundle/Form/SingleTaskListType.php @@ -63,6 +63,7 @@ class SingleTaskListType extends AbstractType $this->taskWorkflowManager = $taskWorkflowManager; } + #[\Override] public function buildForm(FormBuilderInterface $builder, array $options) { $statuses = [ @@ -137,6 +138,7 @@ class SingleTaskListType extends AbstractType } } + #[\Override] public function configureOptions(OptionsResolver $resolver) { $resolver diff --git a/src/Bundle/ChillTaskBundle/Form/SingleTaskType.php b/src/Bundle/ChillTaskBundle/Form/SingleTaskType.php index 7e572e078..be84d2cae 100644 --- a/src/Bundle/ChillTaskBundle/Form/SingleTaskType.php +++ b/src/Bundle/ChillTaskBundle/Form/SingleTaskType.php @@ -29,6 +29,7 @@ class SingleTaskType extends AbstractType { public function __construct(private readonly ParameterBagInterface $parameterBag, private readonly CenterResolverDispatcherInterface $centerResolverDispatcher, private readonly ScopeResolverDispatcher $scopeResolverDispatcher) {} + #[\Override] public function buildForm(FormBuilderInterface $builder, array $options) { $center = null; @@ -71,6 +72,7 @@ class SingleTaskType extends AbstractType } } + #[\Override] public function configureOptions(OptionsResolver $resolver) { $resolver diff --git a/src/Bundle/ChillTaskBundle/Menu/MenuBuilder.php b/src/Bundle/ChillTaskBundle/Menu/MenuBuilder.php index 6b710744d..4f028c5ba 100644 --- a/src/Bundle/ChillTaskBundle/Menu/MenuBuilder.php +++ b/src/Bundle/ChillTaskBundle/Menu/MenuBuilder.php @@ -56,6 +56,7 @@ class MenuBuilder implements LocalMenuBuilderInterface } } + #[\Override] public function buildMenu($menuId, MenuItem $menu, array $parameters) { match ($menuId) { @@ -83,6 +84,7 @@ class MenuBuilder implements LocalMenuBuilderInterface } } + #[\Override] public static function getMenuIds(): array { return ['person', 'accompanyingCourse']; diff --git a/src/Bundle/ChillTaskBundle/Menu/SectionMenuBuilder.php b/src/Bundle/ChillTaskBundle/Menu/SectionMenuBuilder.php index 9b5ace64e..eed80e974 100644 --- a/src/Bundle/ChillTaskBundle/Menu/SectionMenuBuilder.php +++ b/src/Bundle/ChillTaskBundle/Menu/SectionMenuBuilder.php @@ -37,6 +37,7 @@ class SectionMenuBuilder implements LocalMenuBuilderInterface $this->translator = $translator; } + #[\Override] public function buildMenu($menuId, MenuItem $menu, array $parameters) { if (false === $this->authorizationChecker->isGranted(TaskVoter::SHOW)) { @@ -59,6 +60,7 @@ class SectionMenuBuilder implements LocalMenuBuilderInterface ]); } + #[\Override] public static function getMenuIds(): array { return ['section']; diff --git a/src/Bundle/ChillTaskBundle/Menu/UserMenuBuilder.php b/src/Bundle/ChillTaskBundle/Menu/UserMenuBuilder.php index 7f1f8fde8..6a11ee259 100644 --- a/src/Bundle/ChillTaskBundle/Menu/UserMenuBuilder.php +++ b/src/Bundle/ChillTaskBundle/Menu/UserMenuBuilder.php @@ -28,6 +28,7 @@ final readonly class UserMenuBuilder implements LocalMenuBuilderInterface private AuthorizationCheckerInterface $authorizationChecker ) {} + #[\Override] public function buildMenu($menuId, MenuItem $menu, array $parameters) { if (false === $this->authorizationChecker->isGranted(TaskVoter::SHOW)) { @@ -69,6 +70,7 @@ final readonly class UserMenuBuilder implements LocalMenuBuilderInterface ]); } + #[\Override] public static function getMenuIds(): array { return ['user']; diff --git a/src/Bundle/ChillTaskBundle/Repository/SingleTaskAclAwareRepository.php b/src/Bundle/ChillTaskBundle/Repository/SingleTaskAclAwareRepository.php index 3f0966a45..2949a9064 100644 --- a/src/Bundle/ChillTaskBundle/Repository/SingleTaskAclAwareRepository.php +++ b/src/Bundle/ChillTaskBundle/Repository/SingleTaskAclAwareRepository.php @@ -181,6 +181,7 @@ final readonly class SingleTaskAclAwareRepository implements SingleTaskAclAwareR ->setParameter('user', $this->security->getUser()); } + #[\Override] public function countByAllViewable( ?string $pattern = null, ?array $flags = [], @@ -195,6 +196,7 @@ final readonly class SingleTaskAclAwareRepository implements SingleTaskAclAwareR ->getQuery()->getSingleScalarResult(); } + #[\Override] public function countByCourse( AccompanyingPeriod $course, ?string $pattern = null, @@ -208,6 +210,7 @@ final readonly class SingleTaskAclAwareRepository implements SingleTaskAclAwareR ->getQuery()->getSingleScalarResult(); } + #[\Override] public function countByCurrentUsersTasks( ?string $pattern = null, ?array $flags = [] @@ -217,6 +220,7 @@ final readonly class SingleTaskAclAwareRepository implements SingleTaskAclAwareR ->getQuery()->getSingleScalarResult(); } + #[\Override] public function countByPerson( Person $person, ?string $pattern = null, @@ -230,6 +234,7 @@ final readonly class SingleTaskAclAwareRepository implements SingleTaskAclAwareR ->getQuery()->getSingleScalarResult(); } + #[\Override] public function findByAllViewable( ?string $pattern = null, ?array $flags = [], @@ -245,6 +250,7 @@ final readonly class SingleTaskAclAwareRepository implements SingleTaskAclAwareR return $this->getResult($qb, $start, $limit, $orderBy); } + #[\Override] public function findByCourse( AccompanyingPeriod $course, ?string $pattern = null, @@ -259,6 +265,7 @@ final readonly class SingleTaskAclAwareRepository implements SingleTaskAclAwareR return $this->getResult($qb, $start, $limit, $orderBy); } + #[\Override] public function findByCurrentUsersTasks( ?string $pattern = null, ?array $flags = [], @@ -271,6 +278,7 @@ final readonly class SingleTaskAclAwareRepository implements SingleTaskAclAwareR return $this->getResult($qb, $start, $limit, $orderBy); } + #[\Override] public function findByPerson( Person $person, ?string $pattern = null, diff --git a/src/Bundle/ChillTaskBundle/Repository/SingleTaskRepository.php b/src/Bundle/ChillTaskBundle/Repository/SingleTaskRepository.php index c8a84cbf8..8740ab98f 100644 --- a/src/Bundle/ChillTaskBundle/Repository/SingleTaskRepository.php +++ b/src/Bundle/ChillTaskBundle/Repository/SingleTaskRepository.php @@ -25,15 +25,15 @@ use function count; */ class SingleTaskRepository extends EntityRepository { - final public const DATE_STATUS_CURRENT = 'current'; + final public const string DATE_STATUS_CURRENT = 'current'; - final public const DATE_STATUS_ENDED = 'ended'; + final public const string DATE_STATUS_ENDED = 'ended'; - final public const DATE_STATUS_NOT_STARTED = 'not_started'; + final public const string DATE_STATUS_NOT_STARTED = 'not_started'; - final public const DATE_STATUS_WARNING = 'warning'; + final public const string DATE_STATUS_WARNING = 'warning'; - final public const DATE_STATUSES = [ + final public const array DATE_STATUSES = [ self::DATE_STATUS_ENDED, self::DATE_STATUS_WARNING, self::DATE_STATUS_CURRENT, diff --git a/src/Bundle/ChillTaskBundle/Repository/SingleTaskStateRepository.php b/src/Bundle/ChillTaskBundle/Repository/SingleTaskStateRepository.php index 614870264..8db1b63a1 100644 --- a/src/Bundle/ChillTaskBundle/Repository/SingleTaskStateRepository.php +++ b/src/Bundle/ChillTaskBundle/Repository/SingleTaskStateRepository.php @@ -16,7 +16,7 @@ use Doctrine\DBAL\Exception; class SingleTaskStateRepository { - private const FIND_ALL_STATES = <<<'SQL' + private const string FIND_ALL_STATES = <<<'SQL' SELECT DISTINCT jsonb_array_elements_text(current_states) FROM chill_task.single_task SQL; diff --git a/src/Bundle/ChillTaskBundle/Security/Authorization/AuthorizationEvent.php b/src/Bundle/ChillTaskBundle/Security/Authorization/AuthorizationEvent.php index 2b39ead51..c025a144b 100644 --- a/src/Bundle/ChillTaskBundle/Security/Authorization/AuthorizationEvent.php +++ b/src/Bundle/ChillTaskBundle/Security/Authorization/AuthorizationEvent.php @@ -18,7 +18,7 @@ use Symfony\Component\Security\Core\Authentication\Token\TokenInterface; class AuthorizationEvent extends \Symfony\Contracts\EventDispatcher\Event { - final public const VOTE = 'chill_task.vote'; + final public const string VOTE = 'chill_task.vote'; /** * @var bool diff --git a/src/Bundle/ChillTaskBundle/Security/Authorization/TaskVoter.php b/src/Bundle/ChillTaskBundle/Security/Authorization/TaskVoter.php index cc3992329..2c9d5b683 100644 --- a/src/Bundle/ChillTaskBundle/Security/Authorization/TaskVoter.php +++ b/src/Bundle/ChillTaskBundle/Security/Authorization/TaskVoter.php @@ -28,13 +28,13 @@ use Symfony\Component\Security\Core\Authorization\AccessDecisionManagerInterface final class TaskVoter extends AbstractChillVoter implements ProvideRoleHierarchyInterface { - public const CREATE_COURSE = 'CHILL_TASK_TASK_CREATE_FOR_COURSE'; + public const string CREATE_COURSE = 'CHILL_TASK_TASK_CREATE_FOR_COURSE'; - public const CREATE_PERSON = 'CHILL_TASK_TASK_CREATE_FOR_PERSON'; + public const string CREATE_PERSON = 'CHILL_TASK_TASK_CREATE_FOR_PERSON'; - public const DELETE = 'CHILL_TASK_TASK_DELETE'; + public const string DELETE = 'CHILL_TASK_TASK_DELETE'; - public const ROLES = [ + public const array ROLES = [ self::CREATE_COURSE, self::CREATE_PERSON, self::DELETE, @@ -42,9 +42,9 @@ final class TaskVoter extends AbstractChillVoter implements ProvideRoleHierarchy self::UPDATE, ]; - public const SHOW = 'CHILL_TASK_TASK_SHOW'; + public const string SHOW = 'CHILL_TASK_TASK_SHOW'; - public const UPDATE = 'CHILL_TASK_TASK_UPDATE'; + public const string UPDATE = 'CHILL_TASK_TASK_UPDATE'; private readonly VoterHelperInterface $voter; @@ -63,11 +63,13 @@ final class TaskVoter extends AbstractChillVoter implements ProvideRoleHierarchy ->build(); } + #[\Override] public function getRoles(): array { return self::ROLES; } + #[\Override] public function getRolesWithHierarchy(): array { return [ @@ -75,16 +77,19 @@ final class TaskVoter extends AbstractChillVoter implements ProvideRoleHierarchy ]; } + #[\Override] public function getRolesWithoutScope(): array { return []; } + #[\Override] public function supports($attribute, $subject) { return $this->voter->supports($attribute, $subject); } + #[\Override] protected function voteOnAttribute($attribute, $subject, TokenInterface $token) { if (!$token->getUser() instanceof User) { diff --git a/src/Bundle/ChillTaskBundle/Templating/TaskTwigExtension.php b/src/Bundle/ChillTaskBundle/Templating/TaskTwigExtension.php index affaab8c7..bbfea3edc 100644 --- a/src/Bundle/ChillTaskBundle/Templating/TaskTwigExtension.php +++ b/src/Bundle/ChillTaskBundle/Templating/TaskTwigExtension.php @@ -28,6 +28,7 @@ class TaskTwigExtension extends AbstractExtension $this->taskWorkflowManager = $taskWorkflowManager; } + #[\Override] public function getFunctions() { return [ diff --git a/src/Bundle/ChillTaskBundle/Templating/UI/CountNotificationTask.php b/src/Bundle/ChillTaskBundle/Templating/UI/CountNotificationTask.php index c442dda8f..859e05088 100644 --- a/src/Bundle/ChillTaskBundle/Templating/UI/CountNotificationTask.php +++ b/src/Bundle/ChillTaskBundle/Templating/UI/CountNotificationTask.php @@ -20,7 +20,7 @@ use Symfony\Component\Workflow\Event\Event; class CountNotificationTask implements NotificationCounterInterface { - final public const CACHE_KEY = 'chill_task.count_notifications.user.%d.%s'; + final public const string CACHE_KEY = 'chill_task.count_notifications.user.%d.%s'; /** * @var CacheItempPoolInterface @@ -40,6 +40,7 @@ class CountNotificationTask implements NotificationCounterInterface $this->cachePool = $cachePool; } + #[\Override] public function addNotification(UserInterface $u): int { return $this->countNotification($u); diff --git a/src/Bundle/ChillTaskBundle/Tests/Controller/SingleTaskControllerTest.php b/src/Bundle/ChillTaskBundle/Tests/Controller/SingleTaskControllerTest.php index 1453df4d0..59d9eba4e 100644 --- a/src/Bundle/ChillTaskBundle/Tests/Controller/SingleTaskControllerTest.php +++ b/src/Bundle/ChillTaskBundle/Tests/Controller/SingleTaskControllerTest.php @@ -28,6 +28,7 @@ final class SingleTaskControllerTest extends WebTestCase */ protected $faker; + #[\Override] protected function setUp(): void { self::bootKernel(); diff --git a/src/Bundle/ChillTaskBundle/Tests/Repository/SingleTaskACLAwareRepositoryTest.php b/src/Bundle/ChillTaskBundle/Tests/Repository/SingleTaskACLAwareRepositoryTest.php index 6b796d1ba..fa8440dde 100644 --- a/src/Bundle/ChillTaskBundle/Tests/Repository/SingleTaskACLAwareRepositoryTest.php +++ b/src/Bundle/ChillTaskBundle/Tests/Repository/SingleTaskACLAwareRepositoryTest.php @@ -52,6 +52,7 @@ final class SingleTaskACLAwareRepositoryTest extends KernelTestCase private UserRepository $userRepository; + #[\Override] protected function setUp(): void { self::bootKernel(); diff --git a/src/Bundle/ChillTaskBundle/Timeline/SingleTaskTaskLifeCycleEventTimelineProvider.php b/src/Bundle/ChillTaskBundle/Timeline/SingleTaskTaskLifeCycleEventTimelineProvider.php index fbd02f289..c8b5bf7a6 100644 --- a/src/Bundle/ChillTaskBundle/Timeline/SingleTaskTaskLifeCycleEventTimelineProvider.php +++ b/src/Bundle/ChillTaskBundle/Timeline/SingleTaskTaskLifeCycleEventTimelineProvider.php @@ -24,7 +24,7 @@ use Symfony\Component\Workflow\Workflow; */ class SingleTaskTaskLifeCycleEventTimelineProvider implements TimelineProviderInterface { - final public const TYPE = 'chill_task.transition'; + final public const string TYPE = 'chill_task.transition'; /** * @var EntityManagerInterface @@ -42,6 +42,7 @@ class SingleTaskTaskLifeCycleEventTimelineProvider implements TimelineProviderIn $this->registry = $registry; } + #[\Override] public function fetchQuery($context, $args) { if ('task' !== $context) { @@ -74,6 +75,7 @@ class SingleTaskTaskLifeCycleEventTimelineProvider implements TimelineProviderIn ]); } + #[\Override] public function getEntities(array $ids) { $events = $this->em @@ -86,6 +88,7 @@ class SingleTaskTaskLifeCycleEventTimelineProvider implements TimelineProviderIn ); } + #[\Override] public function getEntityTemplate($entity, $context, array $args) { if (isset($entity->getData()['workflow'])) { @@ -103,6 +106,7 @@ class SingleTaskTaskLifeCycleEventTimelineProvider implements TimelineProviderIn ]; } + #[\Override] public function supportsType($type): bool { return self::TYPE === $type; diff --git a/src/Bundle/ChillTaskBundle/Timeline/TaskLifeCycleEventTimelineProvider.php b/src/Bundle/ChillTaskBundle/Timeline/TaskLifeCycleEventTimelineProvider.php index 98b38a989..7946734e7 100644 --- a/src/Bundle/ChillTaskBundle/Timeline/TaskLifeCycleEventTimelineProvider.php +++ b/src/Bundle/ChillTaskBundle/Timeline/TaskLifeCycleEventTimelineProvider.php @@ -28,10 +28,11 @@ use Symfony\Component\Workflow\Workflow; */ class TaskLifeCycleEventTimelineProvider implements TimelineProviderInterface { - final public const TYPE = 'chill_task.transition'; + final public const string TYPE = 'chill_task.transition'; public function __construct(protected EntityManagerInterface $em, protected Registry $registry, protected AuthorizationHelper $authorizationHelper, protected Security $security) {} + #[\Override] public function fetchQuery($context, $args) { $metadata = $this->em @@ -53,6 +54,7 @@ class TaskLifeCycleEventTimelineProvider implements TimelineProviderInterface ]); } + #[\Override] public function getEntities(array $ids) { $events = $this->em @@ -65,6 +67,7 @@ class TaskLifeCycleEventTimelineProvider implements TimelineProviderInterface ); } + #[\Override] public function getEntityTemplate($entity, $context, array $args) { $workflow = $this->registry->get( @@ -89,6 +92,7 @@ class TaskLifeCycleEventTimelineProvider implements TimelineProviderInterface ]; } + #[\Override] public function supportsType($type): bool { return self::TYPE === $type; diff --git a/src/Bundle/ChillTaskBundle/Workflow/Definition/DefaultTaskDefinition.php b/src/Bundle/ChillTaskBundle/Workflow/Definition/DefaultTaskDefinition.php index 0f38252d8..a6fe38d4d 100644 --- a/src/Bundle/ChillTaskBundle/Workflow/Definition/DefaultTaskDefinition.php +++ b/src/Bundle/ChillTaskBundle/Workflow/Definition/DefaultTaskDefinition.php @@ -17,11 +17,11 @@ use Symfony\Component\Workflow\Transition; class DefaultTaskDefinition implements \Chill\TaskBundle\Workflow\TaskWorkflowDefinition { - final public const DEFINITION_METADATA = [ + final public const array DEFINITION_METADATA = [ 'name' => 'Default task', ]; - final public const TRANSITION_METADATA = [ + final public const array TRANSITION_METADATA = [ 'close' => [ 'verb' => 'close', 'class' => 'btn btn-task-label btn-task-close', diff --git a/src/Bundle/ChillTaskBundle/Workflow/Event/DefaultTaskGuardEvent.php b/src/Bundle/ChillTaskBundle/Workflow/Event/DefaultTaskGuardEvent.php index 188cfa2d1..af6415159 100644 --- a/src/Bundle/ChillTaskBundle/Workflow/Event/DefaultTaskGuardEvent.php +++ b/src/Bundle/ChillTaskBundle/Workflow/Event/DefaultTaskGuardEvent.php @@ -40,6 +40,7 @@ class DefaultTaskGuardEvent implements EventSubscriberInterface } } + #[\Override] public static function getSubscribedEvents(): array { return [ diff --git a/src/Bundle/ChillTaskBundle/Workflow/TaskWorkflowManager.php b/src/Bundle/ChillTaskBundle/Workflow/TaskWorkflowManager.php index c0ce60dbe..97c5d16ee 100644 --- a/src/Bundle/ChillTaskBundle/Workflow/TaskWorkflowManager.php +++ b/src/Bundle/ChillTaskBundle/Workflow/TaskWorkflowManager.php @@ -71,6 +71,7 @@ class TaskWorkflowManager implements WorkflowSupportStrategyInterface $task->setClosed($definition->isClosed($task)); } + #[\Override] public function supports(WorkflowInterface $workflow, $subject): bool { if (!$subject instanceof AbstractTask) { diff --git a/src/Bundle/ChillTaskBundle/migrations/Version20180413135614.php b/src/Bundle/ChillTaskBundle/migrations/Version20180413135614.php index 1aea04a96..a0754b103 100644 --- a/src/Bundle/ChillTaskBundle/migrations/Version20180413135614.php +++ b/src/Bundle/ChillTaskBundle/migrations/Version20180413135614.php @@ -19,6 +19,7 @@ use Doctrine\Migrations\AbstractMigration; */ class Version20180413135614 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->abortIf('postgresql' !== $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'postgresql\'.'); @@ -26,6 +27,7 @@ class Version20180413135614 extends AbstractMigration $this->addSql('DROP SCHEMA chill_task CASCADE'); } + #[\Override] public function up(Schema $schema): void { $this->abortIf('postgresql' !== $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'postgresql\'.'); diff --git a/src/Bundle/ChillTaskBundle/migrations/Version20180413201023.php b/src/Bundle/ChillTaskBundle/migrations/Version20180413201023.php index 80a17dc53..f24545ab3 100644 --- a/src/Bundle/ChillTaskBundle/migrations/Version20180413201023.php +++ b/src/Bundle/ChillTaskBundle/migrations/Version20180413201023.php @@ -19,6 +19,7 @@ use Doctrine\Migrations\AbstractMigration; */ class Version20180413201023 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->abortIf('postgresql' !== $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'postgresql\'.'); @@ -30,6 +31,7 @@ class Version20180413201023 extends AbstractMigration $this->addSql('ALTER TABLE chill_task.single_task DROP recurringTask_id'); } + #[\Override] public function up(Schema $schema): void { $this->abortIf('postgresql' !== $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'postgresql\'.'); diff --git a/src/Bundle/ChillTaskBundle/migrations/Version20180426093011.php b/src/Bundle/ChillTaskBundle/migrations/Version20180426093011.php index 82d494f01..9e570708d 100644 --- a/src/Bundle/ChillTaskBundle/migrations/Version20180426093011.php +++ b/src/Bundle/ChillTaskBundle/migrations/Version20180426093011.php @@ -19,6 +19,7 @@ use Doctrine\Migrations\AbstractMigration; */ class Version20180426093011 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->abortIf('postgresql' !== $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'postgresql\'.'); @@ -27,6 +28,7 @@ class Version20180426093011 extends AbstractMigration $this->addSql('ALTER TABLE chill_task.single_task DROP closed'); } + #[\Override] public function up(Schema $schema): void { $this->abortIf('postgresql' !== $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'postgresql\'.'); diff --git a/src/Bundle/ChillTaskBundle/migrations/Version20180502194119.php b/src/Bundle/ChillTaskBundle/migrations/Version20180502194119.php index 17cc2f54d..e3c7e6039 100644 --- a/src/Bundle/ChillTaskBundle/migrations/Version20180502194119.php +++ b/src/Bundle/ChillTaskBundle/migrations/Version20180502194119.php @@ -19,6 +19,7 @@ use Doctrine\Migrations\AbstractMigration; */ class Version20180502194119 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->abortIf('postgresql' !== $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'postgresql\'.'); @@ -27,6 +28,7 @@ class Version20180502194119 extends AbstractMigration $this->addSql('DROP TABLE chill_task.single_task_place_event'); } + #[\Override] public function up(Schema $schema): void { $this->abortIf('postgresql' !== $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'postgresql\'.'); diff --git a/src/Bundle/ChillTaskBundle/migrations/Version20181113161925.php b/src/Bundle/ChillTaskBundle/migrations/Version20181113161925.php index 5bf8f6c51..1f1afa6f0 100644 --- a/src/Bundle/ChillTaskBundle/migrations/Version20181113161925.php +++ b/src/Bundle/ChillTaskBundle/migrations/Version20181113161925.php @@ -19,6 +19,7 @@ use Doctrine\Migrations\AbstractMigration; */ final class Version20181113161925 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->abortIf('postgresql' !== $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'postgresql\'.'); @@ -27,6 +28,7 @@ final class Version20181113161925 extends AbstractMigration $this->addSql('DROP INDEX transition_task'); } + #[\Override] public function up(Schema $schema): void { $this->abortIf('postgresql' !== $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'postgresql\'.'); diff --git a/src/Bundle/ChillTaskBundle/migrations/Version20181113164108.php b/src/Bundle/ChillTaskBundle/migrations/Version20181113164108.php index 926b83778..236e329ab 100644 --- a/src/Bundle/ChillTaskBundle/migrations/Version20181113164108.php +++ b/src/Bundle/ChillTaskBundle/migrations/Version20181113164108.php @@ -19,6 +19,7 @@ use Doctrine\Migrations\AbstractMigration; */ final class Version20181113164108 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->abortIf('postgresql' !== $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'postgresql\'.'); @@ -27,6 +28,7 @@ final class Version20181113164108 extends AbstractMigration $this->addSql('DROP INDEX by_current_state'); } + #[\Override] public function up(Schema $schema): void { $this->abortIf('postgresql' !== $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'postgresql\'.'); diff --git a/src/Bundle/ChillTaskBundle/migrations/Version20210909153533.php b/src/Bundle/ChillTaskBundle/migrations/Version20210909153533.php index 5d8c400e4..21539767a 100644 --- a/src/Bundle/ChillTaskBundle/migrations/Version20210909153533.php +++ b/src/Bundle/ChillTaskBundle/migrations/Version20210909153533.php @@ -19,6 +19,7 @@ use Doctrine\Migrations\AbstractMigration; */ final class Version20210909153533 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->addSql('ALTER TABLE chill_task.recurring_task DROP CONSTRAINT FK_9F663B90591CC992'); @@ -27,11 +28,13 @@ final class Version20210909153533 extends AbstractMigration $this->addSql('ALTER TABLE chill_task.single_task DROP course_id'); } + #[\Override] public function getDescription(): string { return ''; } + #[\Override] public function up(Schema $schema): void { $this->addSql('ALTER TABLE chill_task.recurring_task ADD course_id INT DEFAULT NULL'); diff --git a/src/Bundle/ChillTaskBundle/migrations/Version20211029213909.php b/src/Bundle/ChillTaskBundle/migrations/Version20211029213909.php index 174c8f1fd..248d0c90e 100644 --- a/src/Bundle/ChillTaskBundle/migrations/Version20211029213909.php +++ b/src/Bundle/ChillTaskBundle/migrations/Version20211029213909.php @@ -16,16 +16,19 @@ use Doctrine\Migrations\AbstractMigration; final class Version20211029213909 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->addSql('DROP INDEX chill_task.by_end_date'); } + #[\Override] public function getDescription(): string { return 'Add index for task state and end date'; } + #[\Override] public function up(Schema $schema): void { $this->addSql('CREATE INDEX by_end_date ON chill_task.single_task (end_date DESC NULLS FIRST)'); diff --git a/src/Bundle/ChillThirdPartyBundle/ChillThirdPartyBundle.php b/src/Bundle/ChillThirdPartyBundle/ChillThirdPartyBundle.php index f11473dd7..1ff1b3a7c 100644 --- a/src/Bundle/ChillThirdPartyBundle/ChillThirdPartyBundle.php +++ b/src/Bundle/ChillThirdPartyBundle/ChillThirdPartyBundle.php @@ -17,6 +17,7 @@ use Symfony\Component\HttpKernel\Bundle\Bundle; class ChillThirdPartyBundle extends Bundle { + #[\Override] public function build(\Symfony\Component\DependencyInjection\ContainerBuilder $container) { parent::build($container); diff --git a/src/Bundle/ChillThirdPartyBundle/Controller/ThirdPartyCategoryController.php b/src/Bundle/ChillThirdPartyBundle/Controller/ThirdPartyCategoryController.php index b69658547..0181655d5 100644 --- a/src/Bundle/ChillThirdPartyBundle/Controller/ThirdPartyCategoryController.php +++ b/src/Bundle/ChillThirdPartyBundle/Controller/ThirdPartyCategoryController.php @@ -17,6 +17,7 @@ use Symfony\Component\HttpFoundation\Request; class ThirdPartyCategoryController extends CRUDController { + #[\Override] protected function orderQuery(string $action, $query, Request $request, PaginatorInterface $paginator) { $query->addOrderBy('e.id', 'ASC'); diff --git a/src/Bundle/ChillThirdPartyBundle/Controller/ThirdPartyController.php b/src/Bundle/ChillThirdPartyBundle/Controller/ThirdPartyController.php index 30082d90b..c13382c2d 100644 --- a/src/Bundle/ChillThirdPartyBundle/Controller/ThirdPartyController.php +++ b/src/Bundle/ChillThirdPartyBundle/Controller/ThirdPartyController.php @@ -42,6 +42,7 @@ final class ThirdPartyController extends CRUDController $this->askCenter = $parameterBag->get('chill_main')['acl']['form_show_centers']; } + #[\Override] public function generateTemplateParameter(string $action, $entity, Request $request, array $defaultTemplateParameters = []) { $defaultTemplateParameters['askCenter'] = $this->askCenter; @@ -49,6 +50,7 @@ final class ThirdPartyController extends CRUDController return $defaultTemplateParameters; } + #[\Override] protected function buildFilterOrderHelper(string $action, Request $request): ?FilterOrderHelper { return $this->getFilterOrderHelperFactory() @@ -59,6 +61,7 @@ final class ThirdPartyController extends CRUDController ->build(); } + #[\Override] protected function countEntities(string $action, Request $request, ?FilterOrderHelper $filterOrder = null): int { if (null === $filterOrder) { @@ -71,6 +74,7 @@ final class ThirdPartyController extends CRUDController ); } + #[\Override] protected function createFormFor(string $action, $entity, ?string $formClass = null, array $formOptions = []): FormInterface { if ('new' === $action) { @@ -90,6 +94,7 @@ final class ThirdPartyController extends CRUDController return parent::createFormFor($action, $entity, $formClass, $formOptions); } + #[\Override] protected function getQueryResult(string $action, Request $request, int $totalItems, PaginatorInterface $paginator, ?FilterOrderHelper $filterOrder = null) { return $this->thirdPartyACLAwareRepository @@ -102,6 +107,7 @@ final class ThirdPartyController extends CRUDController ); } + #[\Override] protected function onPostCheckACL($action, Request $request, $entity): ?Response { if ('edit' === $action || 'view' === $action) { @@ -129,6 +135,7 @@ final class ThirdPartyController extends CRUDController /** * @param ThirdParty $entity */ + #[\Override] protected function onPostFetchEntity($action, Request $request, $entity): ?Response { if ('view' === $action && $entity->getParent() instanceof ThirdParty) { diff --git a/src/Bundle/ChillThirdPartyBundle/DataFixtures/ORM/LoadThirdParty.php b/src/Bundle/ChillThirdPartyBundle/DataFixtures/ORM/LoadThirdParty.php index 7261deba4..e0f77305b 100644 --- a/src/Bundle/ChillThirdPartyBundle/DataFixtures/ORM/LoadThirdParty.php +++ b/src/Bundle/ChillThirdPartyBundle/DataFixtures/ORM/LoadThirdParty.php @@ -32,6 +32,7 @@ class LoadThirdParty extends Fixture implements DependentFixtureInterface $this->phoneNumberUtil = PhoneNumberUtil::getInstance(); } + #[\Override] public function getDependencies() { return [ @@ -40,6 +41,7 @@ class LoadThirdParty extends Fixture implements DependentFixtureInterface ]; } + #[\Override] public function load(ObjectManager $manager) { $thirdParties = $this->getThirdParties()->getObjects(); diff --git a/src/Bundle/ChillThirdPartyBundle/DataFixtures/ORM/LoadThirdPartyCategory.php b/src/Bundle/ChillThirdPartyBundle/DataFixtures/ORM/LoadThirdPartyCategory.php index 061c85a4a..3e320ad1e 100644 --- a/src/Bundle/ChillThirdPartyBundle/DataFixtures/ORM/LoadThirdPartyCategory.php +++ b/src/Bundle/ChillThirdPartyBundle/DataFixtures/ORM/LoadThirdPartyCategory.php @@ -21,11 +21,13 @@ use Doctrine\Persistence\ObjectManager; */ class LoadThirdPartyCategory extends Fixture implements FixtureGroupInterface { + #[\Override] public static function getGroups(): array { return ['thirdparty_categories']; } + #[\Override] public function load(ObjectManager $manager) { $categories = [ diff --git a/src/Bundle/ChillThirdPartyBundle/DataFixtures/ORM/LoadThirdPartyProfession.php b/src/Bundle/ChillThirdPartyBundle/DataFixtures/ORM/LoadThirdPartyProfession.php index 265a773cb..3fc970582 100644 --- a/src/Bundle/ChillThirdPartyBundle/DataFixtures/ORM/LoadThirdPartyProfession.php +++ b/src/Bundle/ChillThirdPartyBundle/DataFixtures/ORM/LoadThirdPartyProfession.php @@ -21,11 +21,13 @@ use Doctrine\Persistence\ObjectManager; */ class LoadThirdPartyProfession extends Fixture implements FixtureGroupInterface { + #[\Override] public static function getGroups(): array { return ['thirdparty_professions']; } + #[\Override] public function load(ObjectManager $manager) { $professions = [ diff --git a/src/Bundle/ChillThirdPartyBundle/DependencyInjection/ChillThirdPartyExtension.php b/src/Bundle/ChillThirdPartyBundle/DependencyInjection/ChillThirdPartyExtension.php index 475d22049..55c0daa33 100644 --- a/src/Bundle/ChillThirdPartyBundle/DependencyInjection/ChillThirdPartyExtension.php +++ b/src/Bundle/ChillThirdPartyBundle/DependencyInjection/ChillThirdPartyExtension.php @@ -33,6 +33,7 @@ use Symfony\Component\HttpKernel\DependencyInjection\Extension; */ class ChillThirdPartyExtension extends Extension implements PrependExtensionInterface { + #[\Override] public function load(array $configs, ContainerBuilder $container) { $configuration = new Configuration(); @@ -53,6 +54,7 @@ class ChillThirdPartyExtension extends Extension implements PrependExtensionInte $loader->load('services/doctrineEventListener.yaml'); } + #[\Override] public function prepend(ContainerBuilder $container) { $this->preprendRoutes($container); diff --git a/src/Bundle/ChillThirdPartyBundle/DependencyInjection/CompilerPass/ThirdPartyTypeCompilerPass.php b/src/Bundle/ChillThirdPartyBundle/DependencyInjection/CompilerPass/ThirdPartyTypeCompilerPass.php index 8586451b2..495765f28 100644 --- a/src/Bundle/ChillThirdPartyBundle/DependencyInjection/CompilerPass/ThirdPartyTypeCompilerPass.php +++ b/src/Bundle/ChillThirdPartyBundle/DependencyInjection/CompilerPass/ThirdPartyTypeCompilerPass.php @@ -22,8 +22,9 @@ use Symfony\Component\DependencyInjection\Reference; */ class ThirdPartyTypeCompilerPass implements CompilerPassInterface { - final public const TAG = 'chill_3party.provider'; + final public const string TAG = 'chill_3party.provider'; + #[\Override] public function process(ContainerBuilder $container) { $definition = $container->getDefinition(ThirdPartyTypeManager::class); diff --git a/src/Bundle/ChillThirdPartyBundle/DependencyInjection/Configuration.php b/src/Bundle/ChillThirdPartyBundle/DependencyInjection/Configuration.php index d4c2cd598..07338faf0 100644 --- a/src/Bundle/ChillThirdPartyBundle/DependencyInjection/Configuration.php +++ b/src/Bundle/ChillThirdPartyBundle/DependencyInjection/Configuration.php @@ -21,6 +21,7 @@ use Symfony\Component\Config\Definition\ConfigurationInterface; */ class Configuration implements ConfigurationInterface { + #[\Override] public function getConfigTreeBuilder() { $treeBuilder = new TreeBuilder('chill_third_party'); diff --git a/src/Bundle/ChillThirdPartyBundle/Entity/ThirdParty.php b/src/Bundle/ChillThirdPartyBundle/Entity/ThirdParty.php index 6bc0b2a0e..8e3867f4e 100644 --- a/src/Bundle/ChillThirdPartyBundle/Entity/ThirdParty.php +++ b/src/Bundle/ChillThirdPartyBundle/Entity/ThirdParty.php @@ -76,11 +76,11 @@ use Symfony\Component\Validator\Constraints as Assert; #[DiscriminatorMap(typeProperty: 'type', mapping: ['thirdparty' => ThirdParty::class])] class ThirdParty implements TrackCreationInterface, TrackUpdateInterface, \Stringable { - final public const KIND_CHILD = 'child'; + final public const string KIND_CHILD = 'child'; - final public const KIND_COMPANY = 'company'; + final public const string KIND_COMPANY = 'company'; - final public const KIND_CONTACT = 'contact'; + final public const string KIND_CONTACT = 'contact'; /** * [fr] Sigle. @@ -229,6 +229,7 @@ class ThirdParty implements TrackCreationInterface, TrackUpdateInterface, \Strin $this->children = new ArrayCollection(); } + #[\Override] public function __toString(): string { return $this->getName(); @@ -634,6 +635,7 @@ class ThirdParty implements TrackCreationInterface, TrackUpdateInterface, \Strin * * @return $this */ + #[\Override] public function setCreatedAt(\DateTimeInterface $createdAt): ThirdParty { $this->createdAt = $createdAt; @@ -641,6 +643,7 @@ class ThirdParty implements TrackCreationInterface, TrackUpdateInterface, \Strin return $this; } + #[\Override] public function setCreatedBy(User $user): TrackCreationInterface { $this->createdBy = $user; @@ -760,6 +763,7 @@ class ThirdParty implements TrackCreationInterface, TrackUpdateInterface, \Strin * * @return $this */ + #[\Override] public function setUpdatedAt(\DateTimeInterface $updatedAt): ThirdParty { $this->updatedAt = $updatedAt; @@ -770,6 +774,7 @@ class ThirdParty implements TrackCreationInterface, TrackUpdateInterface, \Strin /** * @return $this */ + #[\Override] public function setUpdatedBy(User $updatedBy): ThirdParty { $this->updatedBy = $updatedBy; diff --git a/src/Bundle/ChillThirdPartyBundle/Form/ChoiceLoader/ThirdPartyChoiceLoader.php b/src/Bundle/ChillThirdPartyBundle/Form/ChoiceLoader/ThirdPartyChoiceLoader.php index 1beb72a1d..3828a0ebf 100644 --- a/src/Bundle/ChillThirdPartyBundle/Form/ChoiceLoader/ThirdPartyChoiceLoader.php +++ b/src/Bundle/ChillThirdPartyBundle/Form/ChoiceLoader/ThirdPartyChoiceLoader.php @@ -45,11 +45,13 @@ class ThirdPartyChoiceLoader implements ChoiceLoaderInterface $this->partyRepository = $partyRepository; } + #[\Override] public function loadChoiceList($value = null): ChoiceListInterface { return new ArrayChoiceList($this->lazyLoadedParties, $value); } + #[\Override] public function loadChoicesForValues($values, $value = null) { $choices = []; @@ -67,6 +69,7 @@ class ThirdPartyChoiceLoader implements ChoiceLoaderInterface return $choices; } + #[\Override] public function loadValuesForChoices(array $choices, $value = null) { $values = []; diff --git a/src/Bundle/ChillThirdPartyBundle/Form/ThirdPartyCategoryType.php b/src/Bundle/ChillThirdPartyBundle/Form/ThirdPartyCategoryType.php index dcbd629c0..1ace107a9 100644 --- a/src/Bundle/ChillThirdPartyBundle/Form/ThirdPartyCategoryType.php +++ b/src/Bundle/ChillThirdPartyBundle/Form/ThirdPartyCategoryType.php @@ -20,6 +20,7 @@ use Symfony\Component\OptionsResolver\OptionsResolver; class ThirdPartyCategoryType extends AbstractType { + #[\Override] public function buildForm(FormBuilderInterface $builder, array $options) { $builder @@ -29,6 +30,7 @@ class ThirdPartyCategoryType extends AbstractType ]); } + #[\Override] public function configureOptions(OptionsResolver $resolver) { $resolver diff --git a/src/Bundle/ChillThirdPartyBundle/Form/ThirdPartyType.php b/src/Bundle/ChillThirdPartyBundle/Form/ThirdPartyType.php index 046d553e9..d963f3d91 100644 --- a/src/Bundle/ChillThirdPartyBundle/Form/ThirdPartyType.php +++ b/src/Bundle/ChillThirdPartyBundle/Form/ThirdPartyType.php @@ -49,6 +49,7 @@ class ThirdPartyType extends AbstractType $this->askCenter = $parameterBag->get('chill_main')['acl']['form_show_centers']; } + #[\Override] public function buildForm(FormBuilderInterface $builder, array $options) { $builder @@ -148,6 +149,7 @@ class ThirdPartyType extends AbstractType } } + #[\Override] public function configureOptions(OptionsResolver $resolver) { $resolver->setDefaults([ diff --git a/src/Bundle/ChillThirdPartyBundle/Form/Type/PickThirdPartyType.php b/src/Bundle/ChillThirdPartyBundle/Form/Type/PickThirdPartyType.php index 85fe9fe7a..aea3d8905 100644 --- a/src/Bundle/ChillThirdPartyBundle/Form/Type/PickThirdPartyType.php +++ b/src/Bundle/ChillThirdPartyBundle/Form/Type/PickThirdPartyType.php @@ -63,6 +63,7 @@ class PickThirdPartyType extends AbstractType $this->typesManager = $typesManager; } + #[\Override] public function buildView(\Symfony\Component\Form\FormView $view, \Symfony\Component\Form\FormInterface $form, array $options) { $view->vars['attr']['class'] = \array_merge(['select2 '], $view->vars['attr']['class'] ?? []); @@ -82,6 +83,7 @@ class PickThirdPartyType extends AbstractType $view->vars['attr']['data-searching-label'] = $this->translator->trans('select2.searching'); } + #[\Override] public function configureOptions(OptionsResolver $resolver) { $resolver @@ -107,6 +109,7 @@ class PickThirdPartyType extends AbstractType )); } + #[\Override] public function getParent(): string { return EntityType::class; diff --git a/src/Bundle/ChillThirdPartyBundle/Form/Type/PickThirdPartyTypeCategoryType.php b/src/Bundle/ChillThirdPartyBundle/Form/Type/PickThirdPartyTypeCategoryType.php index 77720331d..7f8fe3bd5 100644 --- a/src/Bundle/ChillThirdPartyBundle/Form/Type/PickThirdPartyTypeCategoryType.php +++ b/src/Bundle/ChillThirdPartyBundle/Form/Type/PickThirdPartyTypeCategoryType.php @@ -22,10 +22,11 @@ use Symfony\Contracts\Translation\TranslatorInterface; class PickThirdPartyTypeCategoryType extends \Symfony\Component\Form\AbstractType { - private const PREFIX_TYPE = 'chill_3party.key_label.'; + private const string PREFIX_TYPE = 'chill_3party.key_label.'; public function __construct(private readonly ThirdPartyCategoryRepository $thirdPartyCategoryRepository, private readonly ThirdPartyTypeManager $thirdPartyTypeManager, private readonly TranslatableStringHelper $translatableStringHelper, private readonly TranslatorInterface $translator) {} + #[\Override] public function configureOptions(OptionsResolver $resolver) { $choices = \array_merge( @@ -57,6 +58,7 @@ class PickThirdPartyTypeCategoryType extends \Symfony\Component\Form\AbstractTyp ]); } + #[\Override] public function getParent() { return ChoiceType::class; diff --git a/src/Bundle/ChillThirdPartyBundle/Form/Type/PickThirdpartyDynamicType.php b/src/Bundle/ChillThirdPartyBundle/Form/Type/PickThirdpartyDynamicType.php index 5e704fdcb..9f9d62856 100644 --- a/src/Bundle/ChillThirdPartyBundle/Form/Type/PickThirdpartyDynamicType.php +++ b/src/Bundle/ChillThirdPartyBundle/Form/Type/PickThirdpartyDynamicType.php @@ -28,11 +28,13 @@ class PickThirdpartyDynamicType extends AbstractType { public function __construct(private readonly DenormalizerInterface $denormalizer, private readonly SerializerInterface $serializer, private readonly NormalizerInterface $normalizer) {} + #[\Override] public function buildForm(FormBuilderInterface $builder, array $options) { $builder->addViewTransformer(new EntityToJsonTransformer($this->denormalizer, $this->serializer, $options['multiple'], 'thirdparty')); } + #[\Override] public function buildView(FormView $view, FormInterface $form, array $options) { $view->vars['multiple'] = $options['multiple']; @@ -47,6 +49,7 @@ class PickThirdpartyDynamicType extends AbstractType } } + #[\Override] public function configureOptions(OptionsResolver $resolver) { $resolver @@ -60,6 +63,7 @@ class PickThirdpartyDynamicType extends AbstractType ->setAllowedTypes('submit_on_adding_new_entity', ['bool']); } + #[\Override] public function getBlockPrefix() { return 'pick_entity_dynamic'; diff --git a/src/Bundle/ChillThirdPartyBundle/Menu/AdminMenuBuilder.php b/src/Bundle/ChillThirdPartyBundle/Menu/AdminMenuBuilder.php index 75b6a0c64..7e5769fdc 100644 --- a/src/Bundle/ChillThirdPartyBundle/Menu/AdminMenuBuilder.php +++ b/src/Bundle/ChillThirdPartyBundle/Menu/AdminMenuBuilder.php @@ -27,6 +27,7 @@ class AdminMenuBuilder implements LocalMenuBuilderInterface $this->authorizationChecker = $authorizationChecker; } + #[\Override] public function buildMenu($menuId, MenuItem $menu, array $parameters) { if (!$this->authorizationChecker->isGranted('ROLE_ADMIN')) { @@ -46,6 +47,7 @@ class AdminMenuBuilder implements LocalMenuBuilderInterface ])->setExtras(['order' => 3010]); } + #[\Override] public static function getMenuIds(): array { return ['admin_section', 'admin_thirdparty']; diff --git a/src/Bundle/ChillThirdPartyBundle/Menu/MenuBuilder.php b/src/Bundle/ChillThirdPartyBundle/Menu/MenuBuilder.php index b66a3a552..49104ee9f 100644 --- a/src/Bundle/ChillThirdPartyBundle/Menu/MenuBuilder.php +++ b/src/Bundle/ChillThirdPartyBundle/Menu/MenuBuilder.php @@ -40,6 +40,7 @@ class MenuBuilder implements LocalMenuBuilderInterface $this->translator = $translator; } + #[\Override] public function buildMenu($menuId, MenuItem $menu, array $parameters) { if ($this->authorizationChecker->isGranted(ThirdPartyVoter::SHOW)) { @@ -56,6 +57,7 @@ class MenuBuilder implements LocalMenuBuilderInterface } } + #[\Override] public static function getMenuIds(): array { return ['section']; diff --git a/src/Bundle/ChillThirdPartyBundle/Repository/ThirdPartyACLAwareRepository.php b/src/Bundle/ChillThirdPartyBundle/Repository/ThirdPartyACLAwareRepository.php index 04246d8c8..a7960a3a3 100644 --- a/src/Bundle/ChillThirdPartyBundle/Repository/ThirdPartyACLAwareRepository.php +++ b/src/Bundle/ChillThirdPartyBundle/Repository/ThirdPartyACLAwareRepository.php @@ -37,6 +37,7 @@ final readonly class ThirdPartyACLAwareRepository implements ThirdPartyACLAwareR return $qb; } + #[\Override] public function countThirdParties( string $role, ?string $filterString @@ -47,6 +48,7 @@ final readonly class ThirdPartyACLAwareRepository implements ThirdPartyACLAwareR return $qb->getQuery()->getSingleScalarResult(); } + #[\Override] public function listThirdParties( string $role, ?string $filterString, diff --git a/src/Bundle/ChillThirdPartyBundle/Repository/ThirdPartyRepository.php b/src/Bundle/ChillThirdPartyBundle/Repository/ThirdPartyRepository.php index 7390808c8..da9a19c12 100644 --- a/src/Bundle/ChillThirdPartyBundle/Repository/ThirdPartyRepository.php +++ b/src/Bundle/ChillThirdPartyBundle/Repository/ThirdPartyRepository.php @@ -43,6 +43,7 @@ class ThirdPartyRepository implements ObjectRepository return $this->repository->createQueryBuilder($alias, $indexBy); } + #[\Override] public function find($id): ?ThirdParty { return $this->repository->find($id); @@ -51,6 +52,7 @@ class ThirdPartyRepository implements ObjectRepository /** * @return array|ThirdParty[] */ + #[\Override] public function findAll(): array { return $this->repository->findAll(); @@ -62,6 +64,7 @@ class ThirdPartyRepository implements ObjectRepository * * @return array|ThirdParty[] */ + #[\Override] public function findBy(array $criteria, ?array $orderBy = null, $limit = null, $offset = null): array { return $this->repository->findBy($criteria, $orderBy, $limit, $offset); @@ -121,11 +124,13 @@ class ThirdPartyRepository implements ObjectRepository return $qb->getQuery()->getResult(); } + #[\Override] public function findOneBy(array $criteria): ?ThirdParty { return $this->repository->findOneBy($criteria); } + #[\Override] public function getClassName(): string { return ThirdParty::class; diff --git a/src/Bundle/ChillThirdPartyBundle/Search/ThirdPartyApiSearch.php b/src/Bundle/ChillThirdPartyBundle/Search/ThirdPartyApiSearch.php index 8970fec1c..d152d73ef 100644 --- a/src/Bundle/ChillThirdPartyBundle/Search/ThirdPartyApiSearch.php +++ b/src/Bundle/ChillThirdPartyBundle/Search/ThirdPartyApiSearch.php @@ -46,13 +46,16 @@ class ThirdPartyApiSearch implements SearchApiInterface { public function __construct(private readonly ThirdPartyRepository $thirdPartyRepository) {} + #[\Override] public function getResult(string $key, array $metadata, float $pertinence) { return $this->thirdPartyRepository->find($metadata['id']); } + #[\Override] public function prepare(array $metadatas): void {} + #[\Override] public function provideQuery(string $pattern, array $parameters): SearchApiQuery { $query = (new SearchApiQuery()) @@ -106,11 +109,13 @@ class ThirdPartyApiSearch implements SearchApiInterface return $query; } + #[\Override] public function supportsResult(string $key, array $metadatas): bool { return 'tparty' === $key; } + #[\Override] public function supportsTypes(string $pattern, array $types, array $parameters): bool { return \in_array('thirdparty', $types, true); diff --git a/src/Bundle/ChillThirdPartyBundle/Search/ThirdPartySearch.php b/src/Bundle/ChillThirdPartyBundle/Search/ThirdPartySearch.php index 8b8f724d0..3a21dd0fe 100644 --- a/src/Bundle/ChillThirdPartyBundle/Search/ThirdPartySearch.php +++ b/src/Bundle/ChillThirdPartyBundle/Search/ThirdPartySearch.php @@ -24,7 +24,7 @@ use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInt */ class ThirdPartySearch implements SearchInterface { - final public const NAME = '3party'; + final public const string NAME = '3party'; /** * @var AuthorizationHelper @@ -59,16 +59,19 @@ class ThirdPartySearch implements SearchInterface $this->paginatorFactory = $paginatorFactory; } + #[\Override] public function getOrder(): int { return 59866; } + #[\Override] public function isActiveByDefault(): bool { return false; } + #[\Override] public function renderResult(array $terms, $start = 0, $limit = 50, $options = [], $format = 'html') { $centers = $this->authorizationHelper @@ -99,6 +102,7 @@ class ThirdPartySearch implements SearchInterface throw new \UnexpectedValueException('format html not supported'); } + #[\Override] public function supports($domain, $format): bool { return self::NAME === $domain && 'json' === $format; diff --git a/src/Bundle/ChillThirdPartyBundle/Security/Voter/ThirdPartyVoter.php b/src/Bundle/ChillThirdPartyBundle/Security/Voter/ThirdPartyVoter.php index 09f7feb3b..c9a346700 100644 --- a/src/Bundle/ChillThirdPartyBundle/Security/Voter/ThirdPartyVoter.php +++ b/src/Bundle/ChillThirdPartyBundle/Security/Voter/ThirdPartyVoter.php @@ -23,11 +23,11 @@ use Symfony\Component\Security\Core\Authentication\Token\TokenInterface; */ class ThirdPartyVoter extends AbstractChillVoter implements ProvideRoleHierarchyInterface { - final public const CREATE = 'CHILL_3PARTY_3PARTY_CREATE'; + final public const string CREATE = 'CHILL_3PARTY_3PARTY_CREATE'; - final public const SHOW = 'CHILL_3PARTY_3PARTY_SHOW'; + final public const string SHOW = 'CHILL_3PARTY_3PARTY_SHOW'; - final public const UPDATE = 'CHILL_3PARTY_3PARTY_UPDATE'; + final public const string UPDATE = 'CHILL_3PARTY_3PARTY_UPDATE'; /** * @var AuthorizationHelper @@ -39,6 +39,7 @@ class ThirdPartyVoter extends AbstractChillVoter implements ProvideRoleHierarchy $this->authorizationHelper = $authorizationHelper; } + #[\Override] public function getRoles(): array { return [ @@ -46,6 +47,7 @@ class ThirdPartyVoter extends AbstractChillVoter implements ProvideRoleHierarchy ]; } + #[\Override] public function getRolesWithHierarchy(): array { return [ @@ -53,11 +55,13 @@ class ThirdPartyVoter extends AbstractChillVoter implements ProvideRoleHierarchy ]; } + #[\Override] public function getRolesWithoutScope(): array { return $this->getRoles(); } + #[\Override] protected function supports($attribute, $subject) { if ($subject instanceof ThirdParty) { @@ -75,6 +79,7 @@ class ThirdPartyVoter extends AbstractChillVoter implements ProvideRoleHierarchy * @param string $attribute * @param ThirdParty|null $subject */ + #[\Override] protected function voteOnAttribute($attribute, $subject, TokenInterface $token): bool { return true; diff --git a/src/Bundle/ChillThirdPartyBundle/Serializer/Normalizer/ThirdPartyNormalizer.php b/src/Bundle/ChillThirdPartyBundle/Serializer/Normalizer/ThirdPartyNormalizer.php index 26f175705..f60974b83 100644 --- a/src/Bundle/ChillThirdPartyBundle/Serializer/Normalizer/ThirdPartyNormalizer.php +++ b/src/Bundle/ChillThirdPartyBundle/Serializer/Normalizer/ThirdPartyNormalizer.php @@ -26,6 +26,7 @@ class ThirdPartyNormalizer implements NormalizerAwareInterface, NormalizerInterf public function __construct(private readonly ThirdPartyRender $thirdPartyRender, private readonly TranslatableStringHelperInterface $translatableStringHelper) {} + #[\Override] public function normalize($thirdParty, $format = null, array $context = []) { if (!$thirdParty instanceof ThirdParty) { @@ -63,6 +64,7 @@ class ThirdPartyNormalizer implements NormalizerAwareInterface, NormalizerInterf ]; } + #[\Override] public function supportsNormalization($data, $format = null) { return $data instanceof ThirdParty && 'json' === $format; diff --git a/src/Bundle/ChillThirdPartyBundle/Templating/Entity/ThirdPartyRender.php b/src/Bundle/ChillThirdPartyBundle/Templating/Entity/ThirdPartyRender.php index a36ceda4e..e10b58fa7 100644 --- a/src/Bundle/ChillThirdPartyBundle/Templating/Entity/ThirdPartyRender.php +++ b/src/Bundle/ChillThirdPartyBundle/Templating/Entity/ThirdPartyRender.php @@ -25,6 +25,7 @@ class ThirdPartyRender implements ChillEntityRenderInterface public function __construct(protected \Twig\Environment $engine, protected TranslatableStringHelper $translatableStringHelper) {} + #[\Override] public function renderBox($entity, array $options): string { $params = [ @@ -51,6 +52,7 @@ class ThirdPartyRender implements ChillEntityRenderInterface $this->getDefaultClosingBox(); } + #[\Override] public function renderString($entity, array $options): string { if (null !== $entity->getCivility()) { @@ -71,6 +73,7 @@ class ThirdPartyRender implements ChillEntityRenderInterface return $civility.$firstname.' '.$entity->getName().$acronym; } + #[\Override] public function supports($entity, array $options): bool { return $entity instanceof ThirdParty; diff --git a/src/Bundle/ChillThirdPartyBundle/Tests/Serializer/Normalizer/ThirdPartyDocGenNormalizerTest.php b/src/Bundle/ChillThirdPartyBundle/Tests/Serializer/Normalizer/ThirdPartyDocGenNormalizerTest.php index 0c0010cae..bf8e483bc 100644 --- a/src/Bundle/ChillThirdPartyBundle/Tests/Serializer/Normalizer/ThirdPartyDocGenNormalizerTest.php +++ b/src/Bundle/ChillThirdPartyBundle/Tests/Serializer/Normalizer/ThirdPartyDocGenNormalizerTest.php @@ -29,6 +29,7 @@ final class ThirdPartyDocGenNormalizerTest extends KernelTestCase private PhoneNumberUtil $phoneNumberUtil; + #[\Override] protected function setUp(): void { self::bootKernel(); diff --git a/src/Bundle/ChillThirdPartyBundle/Tests/Serializer/Normalizer/ThirdPartyJsonDenormalizerTest.php b/src/Bundle/ChillThirdPartyBundle/Tests/Serializer/Normalizer/ThirdPartyJsonDenormalizerTest.php index e9032dd90..722bac5e4 100644 --- a/src/Bundle/ChillThirdPartyBundle/Tests/Serializer/Normalizer/ThirdPartyJsonDenormalizerTest.php +++ b/src/Bundle/ChillThirdPartyBundle/Tests/Serializer/Normalizer/ThirdPartyJsonDenormalizerTest.php @@ -24,6 +24,7 @@ final class ThirdPartyJsonDenormalizerTest extends KernelTestCase { private DenormalizerInterface $normalizer; + #[\Override] protected function setUp(): void { self::bootKernel(); diff --git a/src/Bundle/ChillThirdPartyBundle/ThirdPartyType/ThirdPartyTypeManager.php b/src/Bundle/ChillThirdPartyBundle/ThirdPartyType/ThirdPartyTypeManager.php index 46367124b..240997f4a 100644 --- a/src/Bundle/ChillThirdPartyBundle/ThirdPartyType/ThirdPartyTypeManager.php +++ b/src/Bundle/ChillThirdPartyBundle/ThirdPartyType/ThirdPartyTypeManager.php @@ -19,7 +19,7 @@ class ThirdPartyTypeManager /** * The prefix used to translate the key of provider. */ - final public const THIRD_PARTY_TRANSLATOR_KEY = 'chill_3party.key_label.'; + final public const string THIRD_PARTY_TRANSLATOR_KEY = 'chill_3party.key_label.'; /** * @var ThirdPartyTypeProviderInterface[] diff --git a/src/Bundle/ChillThirdPartyBundle/migrations/Version20190307111314.php b/src/Bundle/ChillThirdPartyBundle/migrations/Version20190307111314.php index 18b740285..6ce1f64cd 100644 --- a/src/Bundle/ChillThirdPartyBundle/migrations/Version20190307111314.php +++ b/src/Bundle/ChillThirdPartyBundle/migrations/Version20190307111314.php @@ -21,6 +21,7 @@ use Doctrine\Migrations\AbstractMigration; */ final class Version20190307111314 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { // this down() migration is auto-generated, please modify it to your needs @@ -30,6 +31,7 @@ final class Version20190307111314 extends AbstractMigration $this->addSql('DROP TABLE chill_third_party'); } + #[\Override] public function up(Schema $schema): void { // this up() migration is auto-generated, please modify it to your needs diff --git a/src/Bundle/ChillThirdPartyBundle/migrations/Version20190307131650.php b/src/Bundle/ChillThirdPartyBundle/migrations/Version20190307131650.php index b81eadf12..8fd629e13 100644 --- a/src/Bundle/ChillThirdPartyBundle/migrations/Version20190307131650.php +++ b/src/Bundle/ChillThirdPartyBundle/migrations/Version20190307131650.php @@ -19,6 +19,7 @@ use Doctrine\Migrations\AbstractMigration; */ final class Version20190307131650 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { // this down() migration is auto-generated, please modify it to your needs @@ -26,6 +27,7 @@ final class Version20190307131650 extends AbstractMigration .'not written'); } + #[\Override] public function up(Schema $schema): void { // this up() migration is auto-generated, please modify it to your needs diff --git a/src/Bundle/ChillThirdPartyBundle/migrations/Version20190418090842.php b/src/Bundle/ChillThirdPartyBundle/migrations/Version20190418090842.php index f34cbff81..99688be89 100644 --- a/src/Bundle/ChillThirdPartyBundle/migrations/Version20190418090842.php +++ b/src/Bundle/ChillThirdPartyBundle/migrations/Version20190418090842.php @@ -19,6 +19,7 @@ use Doctrine\Migrations\AbstractMigration; */ final class Version20190418090842 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->abortIf('postgresql' !== $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'postgresql\'.'); @@ -27,6 +28,7 @@ final class Version20190418090842 extends AbstractMigration $this->addSql('ALTER TABLE chill_3party.third_party DROP active'); } + #[\Override] public function up(Schema $schema): void { $this->abortIf('postgresql' !== $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'postgresql\'.'); diff --git a/src/Bundle/ChillThirdPartyBundle/migrations/Version20190429171109.php b/src/Bundle/ChillThirdPartyBundle/migrations/Version20190429171109.php index 9a942bed8..e4ea51538 100644 --- a/src/Bundle/ChillThirdPartyBundle/migrations/Version20190429171109.php +++ b/src/Bundle/ChillThirdPartyBundle/migrations/Version20190429171109.php @@ -19,11 +19,13 @@ use Doctrine\Migrations\AbstractMigration; */ final class Version20190429171109 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->throwIrreversibleMigrationException('not implemented'); } + #[\Override] public function up(Schema $schema): void { $this->addSql('ALTER TABLE chill_3party.third_party RENAME COLUMN type ' diff --git a/src/Bundle/ChillThirdPartyBundle/migrations/Version20190502144206.php b/src/Bundle/ChillThirdPartyBundle/migrations/Version20190502144206.php index 7a12f6214..30d6c0fb2 100644 --- a/src/Bundle/ChillThirdPartyBundle/migrations/Version20190502144206.php +++ b/src/Bundle/ChillThirdPartyBundle/migrations/Version20190502144206.php @@ -19,6 +19,7 @@ use Doctrine\Migrations\AbstractMigration; */ final class Version20190502144206 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->abortIf('postgresql' !== $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'postgresql\'.'); @@ -27,6 +28,7 @@ final class Version20190502144206 extends AbstractMigration $this->addSql('ALTER TABLE chill_3party.third_party DROP address_id'); } + #[\Override] public function up(Schema $schema): void { $this->abortIf('postgresql' !== $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'postgresql\'.'); diff --git a/src/Bundle/ChillThirdPartyBundle/migrations/Version20210525211216.php b/src/Bundle/ChillThirdPartyBundle/migrations/Version20210525211216.php index 5e5001043..d5efd7383 100644 --- a/src/Bundle/ChillThirdPartyBundle/migrations/Version20210525211216.php +++ b/src/Bundle/ChillThirdPartyBundle/migrations/Version20210525211216.php @@ -19,17 +19,20 @@ use Doctrine\Migrations\AbstractMigration; */ final class Version20210525211216 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->addSql('ALTER TABLE chill_3party.third_party DROP CONSTRAINT fk_d952467bf5b7af75'); $this->addSql('ALTER TABLE chill_3party.third_party ADD CONSTRAINT fk_d952467bf5b7af75 FOREIGN KEY (address_id) REFERENCES chill_main_address (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); } + #[\Override] public function getDescription(): string { return 'Specify ON DELETE behaviour to handle deletion of parents in associated tables'; } + #[\Override] public function up(Schema $schema): void { $this->addSql('ALTER TABLE chill_3party.third_party DROP CONSTRAINT FK_D952467BF5B7AF75'); diff --git a/src/Bundle/ChillThirdPartyBundle/migrations/Version20210719105918.php b/src/Bundle/ChillThirdPartyBundle/migrations/Version20210719105918.php index 5f7147f26..3ae3a850e 100644 --- a/src/Bundle/ChillThirdPartyBundle/migrations/Version20210719105918.php +++ b/src/Bundle/ChillThirdPartyBundle/migrations/Version20210719105918.php @@ -19,6 +19,7 @@ use Doctrine\Migrations\AbstractMigration; */ final class Version20210719105918 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->addSql('ALTER TABLE chill_3party.thirdparty_category DROP CONSTRAINT FK_7049563712469DE2'); @@ -45,11 +46,13 @@ final class Version20210719105918 extends AbstractMigration $this->addSql('ALTER TABLE chill_3party.third_party DROP updated_at'); } + #[\Override] public function getDescription(): string { return 'Add new fields to ThirdParty Entity + new join tables'; } + #[\Override] public function up(Schema $schema): void { $this->addSql('CREATE SEQUENCE chill_3party.party_category_id_seq INCREMENT BY 1 MINVALUE 1 START 1'); diff --git a/src/Bundle/ChillThirdPartyBundle/migrations/Version20211006200924.php b/src/Bundle/ChillThirdPartyBundle/migrations/Version20211006200924.php index d0bfa08da..d7f2f4886 100644 --- a/src/Bundle/ChillThirdPartyBundle/migrations/Version20211006200924.php +++ b/src/Bundle/ChillThirdPartyBundle/migrations/Version20211006200924.php @@ -19,16 +19,19 @@ use Doctrine\Migrations\AbstractMigration; */ final class Version20211006200924 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->addSql('ALTER TABLE chill_3party.third_party DROP created_by'); } + #[\Override] public function getDescription(): string { return 'Add link to creator (created_by) to thirdParty'; } + #[\Override] public function up(Schema $schema): void { $this->addSql('ALTER TABLE chill_3party.third_party ADD created_by INT DEFAULT NULL'); diff --git a/src/Bundle/ChillThirdPartyBundle/migrations/Version20211007150459.php b/src/Bundle/ChillThirdPartyBundle/migrations/Version20211007150459.php index fef69e443..1e490c327 100644 --- a/src/Bundle/ChillThirdPartyBundle/migrations/Version20211007150459.php +++ b/src/Bundle/ChillThirdPartyBundle/migrations/Version20211007150459.php @@ -19,6 +19,7 @@ use Doctrine\Migrations\AbstractMigration; */ final class Version20211007150459 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->throwIrreversibleMigrationException('Reversible migration not implemented'); @@ -40,11 +41,13 @@ final class Version20211007150459 extends AbstractMigration $this->addSql('CREATE UNIQUE INDEX uniq_d952467bba930d69 ON chill_3party.third_party (profession)'); } + #[\Override] public function getDescription(): string { return 'migrate data from 3party.civility to chill_main_civility table'; } + #[\Override] public function up(Schema $schema): void { $this->addSql('DROP INDEX chill_3party.uniq_d952467b384d4799'); diff --git a/src/Bundle/ChillThirdPartyBundle/migrations/Version20211007165001.php b/src/Bundle/ChillThirdPartyBundle/migrations/Version20211007165001.php index 22ebee5ad..a17d05206 100644 --- a/src/Bundle/ChillThirdPartyBundle/migrations/Version20211007165001.php +++ b/src/Bundle/ChillThirdPartyBundle/migrations/Version20211007165001.php @@ -19,6 +19,7 @@ use Doctrine\Migrations\AbstractMigration; */ final class Version20211007165001 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->addSql('DROP TRIGGER canonicalize_fullname_on_update ON chill_3party.third_party'); @@ -29,11 +30,13 @@ final class Version20211007165001 extends AbstractMigration '); } + #[\Override] public function getDescription(): string { return 'Create trigger for canonicalisation on 3party + indexes'; } + #[\Override] public function up(Schema $schema): void { $this->addSql(" diff --git a/src/Bundle/ChillThirdPartyBundle/migrations/Version20211007194942.php b/src/Bundle/ChillThirdPartyBundle/migrations/Version20211007194942.php index b807845ee..420dbb722 100644 --- a/src/Bundle/ChillThirdPartyBundle/migrations/Version20211007194942.php +++ b/src/Bundle/ChillThirdPartyBundle/migrations/Version20211007194942.php @@ -19,16 +19,19 @@ use Doctrine\Migrations\AbstractMigration; */ final class Version20211007194942 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->addSql('ALTER TABLE chill_3party.third_party DROP contact_data_anonymous'); } + #[\Override] public function getDescription(): string { return 'Add anonymous flag for contacts'; } + #[\Override] public function up(Schema $schema): void { $this->addSql('ALTER TABLE chill_3party.third_party ADD contact_data_anonymous BOOLEAN DEFAULT \'false\' NOT NULL;'); diff --git a/src/Bundle/ChillThirdPartyBundle/migrations/Version20220302143821.php b/src/Bundle/ChillThirdPartyBundle/migrations/Version20220302143821.php index 9c4267235..3c9391099 100644 --- a/src/Bundle/ChillThirdPartyBundle/migrations/Version20220302143821.php +++ b/src/Bundle/ChillThirdPartyBundle/migrations/Version20220302143821.php @@ -21,6 +21,7 @@ final class Version20220302143821 extends AbstractMigration implements Container { use ContainerAwareTrait; + #[\Override] public function down(Schema $schema): void { $this->addSql('ALTER TABLE chill_3party.third_party ALTER telephone TYPE VARCHAR(64)'); @@ -28,11 +29,13 @@ final class Version20220302143821 extends AbstractMigration implements Container $this->addSql('COMMENT ON COLUMN chill_3party.third_party.telephone IS NULL'); } + #[\Override] public function getDescription(): string { return 'Upgrade phonenumber on third parties'; } + #[\Override] public function up(Schema $schema): void { $carrier_code = $this->container diff --git a/src/Bundle/ChillThirdPartyBundle/migrations/Version20220322095659.php b/src/Bundle/ChillThirdPartyBundle/migrations/Version20220322095659.php index 801ce32df..f84a747ad 100644 --- a/src/Bundle/ChillThirdPartyBundle/migrations/Version20220322095659.php +++ b/src/Bundle/ChillThirdPartyBundle/migrations/Version20220322095659.php @@ -19,17 +19,20 @@ use Doctrine\Migrations\AbstractMigration; */ final class Version20220322095659 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { // this down() migration is auto-generated, please modify it to your needs $this->addSql('ALTER TABLE chill_3party.third_party DROP firstname'); } + #[\Override] public function getDescription(): string { return 'Add firstname to thirdparty'; } + #[\Override] public function up(Schema $schema): void { // this up() migration is auto-generated, please modify it to your needs diff --git a/src/Bundle/ChillThirdPartyBundle/migrations/Version20220324175549.php b/src/Bundle/ChillThirdPartyBundle/migrations/Version20220324175549.php index 9dd4a3bf5..f3b8d103b 100644 --- a/src/Bundle/ChillThirdPartyBundle/migrations/Version20220324175549.php +++ b/src/Bundle/ChillThirdPartyBundle/migrations/Version20220324175549.php @@ -16,6 +16,7 @@ use Doctrine\Migrations\AbstractMigration; final class Version20220324175549 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->addSql(" @@ -55,11 +56,13 @@ final class Version20220324175549 extends AbstractMigration "); } + #[\Override] public function getDescription(): string { return 'indexing of firstname on third parties'; } + #[\Override] public function up(Schema $schema): void { $this->addSql(" diff --git a/src/Bundle/ChillThirdPartyBundle/migrations/Version20230215175150.php b/src/Bundle/ChillThirdPartyBundle/migrations/Version20230215175150.php index 756ca41cd..77fbd58ea 100644 --- a/src/Bundle/ChillThirdPartyBundle/migrations/Version20230215175150.php +++ b/src/Bundle/ChillThirdPartyBundle/migrations/Version20230215175150.php @@ -16,16 +16,19 @@ use Doctrine\Migrations\AbstractMigration; final class Version20230215175150 extends AbstractMigration { + #[\Override] public function down(Schema $schema): void { $this->addSql('ALTER TABLE chill_3party.third_party DROP profession'); } + #[\Override] public function getDescription(): string { return 'Change profession to a string field and transfer values'; } + #[\Override] public function up(Schema $schema): void { $this->addSql('ALTER TABLE chill_3party.third_party ADD profession TEXT DEFAULT \'\' NOT NULL'); diff --git a/src/Bundle/ChillWopiBundle/src/Controller/Convert.php b/src/Bundle/ChillWopiBundle/src/Controller/Convert.php index 3b2744b28..826ea298f 100644 --- a/src/Bundle/ChillWopiBundle/src/Controller/Convert.php +++ b/src/Bundle/ChillWopiBundle/src/Controller/Convert.php @@ -33,7 +33,7 @@ use Symfony\Contracts\HttpClient\ResponseInterface; class Convert { - private const LOG_PREFIX = '[convert] '; + private const string LOG_PREFIX = '[convert] '; private readonly string $collaboraDomain; diff --git a/src/Bundle/ChillWopiBundle/src/DependencyInjection/ChillWopiExtension.php b/src/Bundle/ChillWopiBundle/src/DependencyInjection/ChillWopiExtension.php index 1c0ef6490..e8ece3471 100644 --- a/src/Bundle/ChillWopiBundle/src/DependencyInjection/ChillWopiExtension.php +++ b/src/Bundle/ChillWopiBundle/src/DependencyInjection/ChillWopiExtension.php @@ -18,6 +18,7 @@ use Symfony\Component\HttpKernel\DependencyInjection\Extension; final class ChillWopiExtension extends Extension { + #[\Override] public function load(array $configs, ContainerBuilder $container) { $config = $this->processConfiguration(new Configuration(), $configs); diff --git a/src/Bundle/ChillWopiBundle/src/DependencyInjection/Configuration.php b/src/Bundle/ChillWopiBundle/src/DependencyInjection/Configuration.php index 50397ee62..0e56d5e15 100644 --- a/src/Bundle/ChillWopiBundle/src/DependencyInjection/Configuration.php +++ b/src/Bundle/ChillWopiBundle/src/DependencyInjection/Configuration.php @@ -16,6 +16,7 @@ use Symfony\Component\Config\Definition\ConfigurationInterface; final class Configuration implements ConfigurationInterface { + #[\Override] public function getConfigTreeBuilder() { $treeBuilder = new TreeBuilder('chill_wopi'); diff --git a/src/Bundle/ChillWopiBundle/src/Service/Controller/Responder.php b/src/Bundle/ChillWopiBundle/src/Service/Controller/Responder.php index 89eec1685..170b7e5b5 100644 --- a/src/Bundle/ChillWopiBundle/src/Service/Controller/Responder.php +++ b/src/Bundle/ChillWopiBundle/src/Service/Controller/Responder.php @@ -24,6 +24,7 @@ final readonly class Responder implements ResponderInterface { public function __construct(private Environment $twig, private UrlGeneratorInterface $urlGenerator, private SerializerInterface $serializer) {} + #[\Override] public function file( $file, ?string $filename = null, @@ -37,6 +38,7 @@ final readonly class Responder implements ResponderInterface return $response; } + #[\Override] public function json( $data, int $status = 200, @@ -57,11 +59,13 @@ final readonly class Responder implements ResponderInterface ); } + #[\Override] public function redirect(string $url, int $status = 302, array $headers = []): RedirectResponse { return new RedirectResponse($url, $status, $headers); } + #[\Override] public function redirectToRoute( string $route, array $parameters = [], @@ -71,6 +75,7 @@ final readonly class Responder implements ResponderInterface return $this->redirect($this->urlGenerator->generate($route, $parameters), $status, $headers); } + #[\Override] public function render(string $template, array $context = [], int $status = 200, array $headers = []): Response { $response = new Response($this->twig->render($template, $context), $status, $headers); diff --git a/src/Bundle/ChillWopiBundle/src/Service/Wopi/AuthorizationManager.php b/src/Bundle/ChillWopiBundle/src/Service/Wopi/AuthorizationManager.php index c54f187ca..50547808a 100644 --- a/src/Bundle/ChillWopiBundle/src/Service/Wopi/AuthorizationManager.php +++ b/src/Bundle/ChillWopiBundle/src/Service/Wopi/AuthorizationManager.php @@ -21,11 +21,13 @@ class AuthorizationManager implements \ChampsLibres\WopiBundle\Contracts\Authori { public function __construct(private readonly JWTTokenManagerInterface $tokenManager, private readonly Security $security) {} + #[\Override] public function isRestrictedWebViewOnly(string $accessToken, Document $document, RequestInterface $request): bool { return false; } + #[\Override] public function isTokenValid(string $accessToken, Document $document, RequestInterface $request): bool { $metadata = $this->tokenManager->parse($accessToken); @@ -43,36 +45,43 @@ class AuthorizationManager implements \ChampsLibres\WopiBundle\Contracts\Authori return $document->getWopiDocId() === $metadata['fileId']; } + #[\Override] public function userCanAttend(string $accessToken, Document $document, RequestInterface $request): bool { return $this->isTokenValid($accessToken, $document, $request); } + #[\Override] public function userCanDelete(string $accessToken, Document $document, RequestInterface $request): bool { return false; } + #[\Override] public function userCannotWriteRelative(string $accessToken, Document $document, RequestInterface $request): bool { return true; } + #[\Override] public function userCanPresent(string $accessToken, Document $document, RequestInterface $request): bool { return $this->isTokenValid($accessToken, $document, $request); } + #[\Override] public function userCanRead(string $accessToken, Document $document, RequestInterface $request): bool { return $this->isTokenValid($accessToken, $document, $request); } + #[\Override] public function userCanRename(string $accessToken, Document $document, RequestInterface $request): bool { return false; } + #[\Override] public function userCanWrite(string $accessToken, Document $document, RequestInterface $request): bool { return $this->isTokenValid($accessToken, $document, $request); diff --git a/src/Bundle/ChillWopiBundle/src/Service/Wopi/ChillDocumentLockManager.php b/src/Bundle/ChillWopiBundle/src/Service/Wopi/ChillDocumentLockManager.php index e6889778c..ac943cf00 100644 --- a/src/Bundle/ChillWopiBundle/src/Service/Wopi/ChillDocumentLockManager.php +++ b/src/Bundle/ChillWopiBundle/src/Service/Wopi/ChillDocumentLockManager.php @@ -23,13 +23,14 @@ class ChillDocumentLockManager implements DocumentLockManagerInterface /** * Number of seconds to keep the lock after the delete lock operation. */ - private const LOCK_GRACEFUL_DURATION_TIME = 3; + private const int LOCK_GRACEFUL_DURATION_TIME = 3; public function __construct( private readonly ChillRedis $redis, private readonly int $ttlAfterDeleteSeconds = self::LOCK_GRACEFUL_DURATION_TIME ) {} + #[\Override] public function deleteLock(Document $document, RequestInterface $request): bool { if (0 === $this->redis->exists($this->getCacheId($document))) { @@ -41,6 +42,7 @@ class ChillDocumentLockManager implements DocumentLockManagerInterface return $this->redis->expire($this->getCacheId($document), $this->ttlAfterDeleteSeconds); } + #[\Override] public function getLock(Document $document, RequestInterface $request): string { if (false !== $value = $this->redis->get($this->getCacheId($document))) { @@ -50,6 +52,7 @@ class ChillDocumentLockManager implements DocumentLockManagerInterface throw new \RuntimeException('wopi key does not exists'); } + #[\Override] public function hasLock(Document $document, RequestInterface $request): bool { $r = $this->redis->exists($this->getCacheId($document)); @@ -64,6 +67,7 @@ class ChillDocumentLockManager implements DocumentLockManagerInterface throw new \RuntimeException('data type not supported'); } + #[\Override] public function setLock(Document $document, string $lockId, RequestInterface $request): bool { $key = $this->getCacheId($document); diff --git a/src/Bundle/ChillWopiBundle/src/Service/Wopi/ChillDocumentManager.php b/src/Bundle/ChillWopiBundle/src/Service/Wopi/ChillDocumentManager.php index 2b569014d..d12dbde43 100644 --- a/src/Bundle/ChillWopiBundle/src/Service/Wopi/ChillDocumentManager.php +++ b/src/Bundle/ChillWopiBundle/src/Service/Wopi/ChillDocumentManager.php @@ -43,6 +43,7 @@ final readonly class ChillDocumentManager implements DocumentManagerInterface $this->request = $httpMessageFactory->createRequest($requestStack->getCurrentRequest()); } + #[\Override] public function create(array $data): Document { /** @var StoredObject $document */ @@ -65,6 +66,7 @@ final readonly class ChillDocumentManager implements DocumentManagerInterface return $document; } + #[\Override] public function deleteLock(Document $document): void { if (false === $this->documentLockManager->deleteLock($document, $this->request)) { @@ -75,6 +77,7 @@ final readonly class ChillDocumentManager implements DocumentManagerInterface /** * @param string $documentFilename without extension ! */ + #[\Override] public function findByDocumentFilename(string $documentFilename): ?Document { return $this->storedObjectRepository->findOneBy( @@ -84,6 +87,7 @@ final readonly class ChillDocumentManager implements DocumentManagerInterface ); } + #[\Override] public function findByDocumentId(string $documentId): ?Document { return $this->storedObjectRepository->findOneBy( @@ -98,6 +102,7 @@ final readonly class ChillDocumentManager implements DocumentManagerInterface * * @return string the document filename with its extension */ + #[\Override] public function getBasename(Document $document): string { $exts = (new MimeTypes())->getExtensions($document->getType()); @@ -112,6 +117,7 @@ final readonly class ChillDocumentManager implements DocumentManagerInterface /** * @param StoredObject $document */ + #[\Override] public function getCreationDate(Document $document): \DateTimeInterface { return $document->getCreatedAt() ?? new \DateTimeImmutable('now'); @@ -120,6 +126,7 @@ final readonly class ChillDocumentManager implements DocumentManagerInterface /** * @param StoredObject $document */ + #[\Override] public function getDocumentId(Document $document): string { return (string) $document->getUuid(); @@ -128,42 +135,50 @@ final readonly class ChillDocumentManager implements DocumentManagerInterface /** * @param StoredObject $document */ + #[\Override] public function getLastModifiedDate(Document $document): \DateTimeInterface { return $this->storedObjectManager->getLastModified($document); } + #[\Override] public function getLock(Document $document): string { return $this->documentLockManager->getLock($document, $this->request); } + #[\Override] public function getSha256(Document $document): string { return base64_encode(hash('sha256', $this->getContent($document))); } + #[\Override] public function getSize(Document $document): int { return \strlen($this->getContent($document)); } + #[\Override] public function getVersion(Document $document): string { // TODO ? return '0'; } + #[\Override] public function hasLock(Document $document): bool { return $this->documentLockManager->hasLock($document, $this->request); } + #[\Override] public function lock(Document $document, string $lock): void { $this->documentLockManager->setLock($document, $lock, $this->request); } + #[\Override] public function read(Document $document): StreamInterface { return $this @@ -171,16 +186,19 @@ final readonly class ChillDocumentManager implements DocumentManagerInterface ->createStream($this->getContent($document)); } + #[\Override] public function remove(Document $document): void { throw new \RuntimeException('this is not implemented and should not happens'); } + #[\Override] public function rename(Document $document, string $requestedName): void { throw new \RuntimeException('this is not implemented and should not happens'); } + #[\Override] public function write(Document $document, array $properties = []): void { $this->setContent($document, $properties['content']); diff --git a/src/Bundle/ChillWopiBundle/src/Service/Wopi/ChillWopi.php b/src/Bundle/ChillWopiBundle/src/Service/Wopi/ChillWopi.php index 9f2dac4f0..5607ada87 100644 --- a/src/Bundle/ChillWopiBundle/src/Service/Wopi/ChillWopi.php +++ b/src/Bundle/ChillWopiBundle/src/Service/Wopi/ChillWopi.php @@ -19,6 +19,7 @@ final readonly class ChillWopi implements WopiInterface { public function __construct(private WopiInterface $wopi) {} + #[\Override] public function checkFileInfo( string $fileId, ?string $accessToken, @@ -29,11 +30,13 @@ final readonly class ChillWopi implements WopiInterface ]); } + #[\Override] public function deleteFile(string $fileId, ?string $accessToken, RequestInterface $request): ResponseInterface { return $this->wopi->deleteFile($fileId, $accessToken, $request); } + #[\Override] public function enumerateAncestors( string $fileId, ?string $accessToken, @@ -42,16 +45,19 @@ final readonly class ChillWopi implements WopiInterface return $this->wopi->enumerateAncestors($fileId, $accessToken, $request); } + #[\Override] public function getFile(string $fileId, ?string $accessToken, RequestInterface $request): ResponseInterface { return $this->wopi->getFile($fileId, $accessToken, $request); } + #[\Override] public function getLock(string $fileId, ?string $accessToken, RequestInterface $request): ResponseInterface { return $this->wopi->getLock($fileId, $accessToken, $request); } + #[\Override] public function getShareUrl( string $fileId, ?string $accessToken, @@ -60,6 +66,7 @@ final readonly class ChillWopi implements WopiInterface return $this->wopi->getShareUrl($fileId, $accessToken, $request); } + #[\Override] public function lock( string $fileId, ?string $accessToken, @@ -69,6 +76,7 @@ final readonly class ChillWopi implements WopiInterface return $this->wopi->lock($fileId, $accessToken, $xWopiLock, $request); } + #[\Override] public function putFile( string $fileId, ?string $accessToken, @@ -79,16 +87,19 @@ final readonly class ChillWopi implements WopiInterface return $this->wopi->putFile($fileId, $accessToken, $xWopiLock, $xWopiEditors, $request); } + #[\Override] public function putRelativeFile(string $fileId, string $accessToken, ?string $suggestedTarget, ?string $relativeTarget, bool $overwriteRelativeTarget, int $size, RequestInterface $request): ResponseInterface { return $this->wopi->putRelativeFile($fileId, $accessToken, $suggestedTarget, $relativeTarget, $overwriteRelativeTarget, $size, $request); } + #[\Override] public function putUserInfo(string $fileId, ?string $accessToken, RequestInterface $request): ResponseInterface { return $this->wopi->putUserInfo($fileId, $accessToken, $request); } + #[\Override] public function refreshLock( string $fileId, ?string $accessToken, @@ -98,6 +109,7 @@ final readonly class ChillWopi implements WopiInterface return $this->wopi->refreshLock($fileId, $accessToken, $xWopiLock, $request); } + #[\Override] public function renameFile( string $fileId, ?string $accessToken, @@ -108,6 +120,7 @@ final readonly class ChillWopi implements WopiInterface return $this->wopi->renameFile($fileId, $accessToken, $xWopiLock, $xWopiRequestedName, $request); } + #[\Override] public function unlock( string $fileId, ?string $accessToken, @@ -117,6 +130,7 @@ final readonly class ChillWopi implements WopiInterface return $this->wopi->unlock($fileId, $accessToken, $xWopiLock, $request); } + #[\Override] public function unlockAndRelock( string $fileId, ?string $accessToken, diff --git a/src/Bundle/ChillWopiBundle/src/Service/Wopi/UserManager.php b/src/Bundle/ChillWopiBundle/src/Service/Wopi/UserManager.php index 8c85982d7..0188a544f 100644 --- a/src/Bundle/ChillWopiBundle/src/Service/Wopi/UserManager.php +++ b/src/Bundle/ChillWopiBundle/src/Service/Wopi/UserManager.php @@ -19,6 +19,7 @@ class UserManager implements \ChampsLibres\WopiBundle\Contracts\UserManagerInter { public function __construct(private readonly Security $security) {} + #[\Override] public function getUserFriendlyName(string $accessToken, string $fileId, RequestInterface $request): ?string { $user = $this->security->getUser(); @@ -34,6 +35,7 @@ class UserManager implements \ChampsLibres\WopiBundle\Contracts\UserManagerInter return $user->getLabel(); } + #[\Override] public function getUserId(string $accessToken, string $fileId, RequestInterface $request): ?string { $user = $this->security->getUser(); @@ -49,6 +51,7 @@ class UserManager implements \ChampsLibres\WopiBundle\Contracts\UserManagerInter return (string) $user->getId(); } + #[\Override] public function isAnonymousUser(string $accessToken, string $fileId, RequestInterface $request): bool { return false; diff --git a/src/Bundle/ChillWopiBundle/tests/Service/Wopi/ChillDocumentLockManagerTest.php b/src/Bundle/ChillWopiBundle/tests/Service/Wopi/ChillDocumentLockManagerTest.php index 5c22189d1..5c39783d4 100644 --- a/src/Bundle/ChillWopiBundle/tests/Service/Wopi/ChillDocumentLockManagerTest.php +++ b/src/Bundle/ChillWopiBundle/tests/Service/Wopi/ChillDocumentLockManagerTest.php @@ -27,6 +27,7 @@ final class ChillDocumentLockManagerTest extends KernelTestCase { use ProphecyTrait; + #[\Override] protected function setUp(): void { self::bootKernel();