diff --git a/src/Bundle/ChillActivityBundle/DependencyInjection/Configuration.php b/src/Bundle/ChillActivityBundle/DependencyInjection/Configuration.php index 35388464b..57a1ec578 100644 --- a/src/Bundle/ChillActivityBundle/DependencyInjection/Configuration.php +++ b/src/Bundle/ChillActivityBundle/DependencyInjection/Configuration.php @@ -59,7 +59,7 @@ class Configuration implements ConfigurationInterface ->info('The number of seconds of this duration. Must be an integer.') ->cannotBeEmpty() ->validate() - ->ifTrue(static fn($data) => !is_int($data))->thenInvalid('The value %s is not a valid integer') + ->ifTrue(static fn ($data) => !is_int($data))->thenInvalid('The value %s is not a valid integer') ->end() ->end() ->scalarNode('label') diff --git a/src/Bundle/ChillActivityBundle/Export/Export/LinkedToACP/AvgActivityDuration.php b/src/Bundle/ChillActivityBundle/Export/Export/LinkedToACP/AvgActivityDuration.php index 0de7f420c..34771d077 100644 --- a/src/Bundle/ChillActivityBundle/Export/Export/LinkedToACP/AvgActivityDuration.php +++ b/src/Bundle/ChillActivityBundle/Export/Export/LinkedToACP/AvgActivityDuration.php @@ -86,7 +86,7 @@ class AvgActivityDuration implements ExportInterface, GroupedExportInterface public function initiateQuery(array $requiredModifiers, array $acl, array $data = []) { - $centers = array_map(static fn($el) => $el['center'], $acl); + $centers = array_map(static fn ($el) => $el['center'], $acl); $qb = $this->repository->createQueryBuilder('activity'); diff --git a/src/Bundle/ChillActivityBundle/Export/Export/LinkedToACP/AvgActivityVisitDuration.php b/src/Bundle/ChillActivityBundle/Export/Export/LinkedToACP/AvgActivityVisitDuration.php index d9382d857..df21362cd 100644 --- a/src/Bundle/ChillActivityBundle/Export/Export/LinkedToACP/AvgActivityVisitDuration.php +++ b/src/Bundle/ChillActivityBundle/Export/Export/LinkedToACP/AvgActivityVisitDuration.php @@ -87,7 +87,7 @@ class AvgActivityVisitDuration implements ExportInterface, GroupedExportInterfac public function initiateQuery(array $requiredModifiers, array $acl, array $data = []) { - $centers = array_map(static fn($el) => $el['center'], $acl); + $centers = array_map(static fn ($el) => $el['center'], $acl); $qb = $this->repository->createQueryBuilder('activity'); diff --git a/src/Bundle/ChillActivityBundle/Export/Export/LinkedToACP/CountActivity.php b/src/Bundle/ChillActivityBundle/Export/Export/LinkedToACP/CountActivity.php index fe6de3e24..6b7b1562d 100644 --- a/src/Bundle/ChillActivityBundle/Export/Export/LinkedToACP/CountActivity.php +++ b/src/Bundle/ChillActivityBundle/Export/Export/LinkedToACP/CountActivity.php @@ -86,7 +86,7 @@ class CountActivity implements ExportInterface, GroupedExportInterface public function initiateQuery(array $requiredModifiers, array $acl, array $data = []) { - $centers = array_map(static fn($el) => $el['center'], $acl); + $centers = array_map(static fn ($el) => $el['center'], $acl); $qb = $this->repository ->createQueryBuilder('activity') diff --git a/src/Bundle/ChillActivityBundle/Export/Export/LinkedToACP/ListActivity.php b/src/Bundle/ChillActivityBundle/Export/Export/LinkedToACP/ListActivity.php index 616f4d848..026e16f90 100644 --- a/src/Bundle/ChillActivityBundle/Export/Export/LinkedToACP/ListActivity.php +++ b/src/Bundle/ChillActivityBundle/Export/Export/LinkedToACP/ListActivity.php @@ -109,7 +109,7 @@ class ListActivity implements ListInterface, GroupedExportInterface public function initiateQuery(array $requiredModifiers, array $acl, array $data = []) { - $centers = array_map(static fn($el) => $el['center'], $acl); + $centers = array_map(static fn ($el) => $el['center'], $acl); $qb = $this->entityManager->createQueryBuilder(); diff --git a/src/Bundle/ChillActivityBundle/Export/Export/LinkedToACP/SumActivityDuration.php b/src/Bundle/ChillActivityBundle/Export/Export/LinkedToACP/SumActivityDuration.php index d4aa65f22..e916cab54 100644 --- a/src/Bundle/ChillActivityBundle/Export/Export/LinkedToACP/SumActivityDuration.php +++ b/src/Bundle/ChillActivityBundle/Export/Export/LinkedToACP/SumActivityDuration.php @@ -87,7 +87,7 @@ class SumActivityDuration implements ExportInterface, GroupedExportInterface public function initiateQuery(array $requiredModifiers, array $acl, array $data = []) { - $centers = array_map(static fn($el) => $el['center'], $acl); + $centers = array_map(static fn ($el) => $el['center'], $acl); $qb = $this->repository ->createQueryBuilder('activity') diff --git a/src/Bundle/ChillActivityBundle/Export/Export/LinkedToACP/SumActivityVisitDuration.php b/src/Bundle/ChillActivityBundle/Export/Export/LinkedToACP/SumActivityVisitDuration.php index 859c3e6b5..18a47289c 100644 --- a/src/Bundle/ChillActivityBundle/Export/Export/LinkedToACP/SumActivityVisitDuration.php +++ b/src/Bundle/ChillActivityBundle/Export/Export/LinkedToACP/SumActivityVisitDuration.php @@ -87,7 +87,7 @@ class SumActivityVisitDuration implements ExportInterface, GroupedExportInterfac public function initiateQuery(array $requiredModifiers, array $acl, array $data = []) { - $centers = array_map(static fn($el) => $el['center'], $acl); + $centers = array_map(static fn ($el) => $el['center'], $acl); $qb = $this->repository ->createQueryBuilder('activity') diff --git a/src/Bundle/ChillActivityBundle/Export/Export/LinkedToPerson/ListActivity.php b/src/Bundle/ChillActivityBundle/Export/Export/LinkedToPerson/ListActivity.php index d9b1eb212..60110c9a8 100644 --- a/src/Bundle/ChillActivityBundle/Export/Export/LinkedToPerson/ListActivity.php +++ b/src/Bundle/ChillActivityBundle/Export/Export/LinkedToPerson/ListActivity.php @@ -137,7 +137,7 @@ class ListActivity implements ListInterface, GroupedExportInterface $activity = $activityRepository->find($value); - return implode(', ', array_map(fn(ActivityReason $r) => '"' . + return implode(', ', array_map(fn (ActivityReason $r) => '"' . $this->translatableStringHelper->localize($r->getCategory()->getName()) . ' > ' . $this->translatableStringHelper->localize($r->getName()) @@ -195,7 +195,7 @@ class ListActivity implements ListInterface, GroupedExportInterface public function initiateQuery(array $requiredModifiers, array $acl, array $data = []) { - $centers = array_map(static fn($el) => $el['center'], $acl); + $centers = array_map(static fn ($el) => $el['center'], $acl); // throw an error if any fields are present if (!array_key_exists('fields', $data)) { diff --git a/src/Bundle/ChillActivityBundle/Export/Filter/ACPFilters/ActivityTypeFilter.php b/src/Bundle/ChillActivityBundle/Export/Filter/ACPFilters/ActivityTypeFilter.php index 346eab316..c6616a4c6 100644 --- a/src/Bundle/ChillActivityBundle/Export/Filter/ACPFilters/ActivityTypeFilter.php +++ b/src/Bundle/ChillActivityBundle/Export/Filter/ACPFilters/ActivityTypeFilter.php @@ -61,7 +61,7 @@ class ActivityTypeFilter implements FilterInterface $builder->add('accepted_activitytypes', EntityType::class, [ 'class' => ActivityType::class, 'choices' => $this->activityTypeRepository->findAllActive(), - 'choice_label' => fn(ActivityType $aty) => ($aty->hasCategory() ? $this->translatableStringHelper->localize($aty->getCategory()->getName()) . ' > ' : '') + 'choice_label' => fn (ActivityType $aty) => ($aty->hasCategory() ? $this->translatableStringHelper->localize($aty->getCategory()->getName()) . ' > ' : '') . $this->translatableStringHelper->localize($aty->getName()), 'multiple' => true, diff --git a/src/Bundle/ChillActivityBundle/Export/Filter/ACPFilters/UserScopeFilter.php b/src/Bundle/ChillActivityBundle/Export/Filter/ACPFilters/UserScopeFilter.php index 4254137ba..4319c100a 100644 --- a/src/Bundle/ChillActivityBundle/Export/Filter/ACPFilters/UserScopeFilter.php +++ b/src/Bundle/ChillActivityBundle/Export/Filter/ACPFilters/UserScopeFilter.php @@ -64,7 +64,7 @@ class UserScopeFilter implements FilterInterface { $builder->add('accepted_userscope', EntityType::class, [ 'class' => Scope::class, - 'choice_label' => fn(Scope $s) => $this->translatableStringHelper->localize( + 'choice_label' => fn (Scope $s) => $this->translatableStringHelper->localize( $s->getName() ), 'multiple' => true, diff --git a/src/Bundle/ChillActivityBundle/Export/Filter/ActivityTypeFilter.php b/src/Bundle/ChillActivityBundle/Export/Filter/ActivityTypeFilter.php index 725223fdd..b9d39c3ce 100644 --- a/src/Bundle/ChillActivityBundle/Export/Filter/ActivityTypeFilter.php +++ b/src/Bundle/ChillActivityBundle/Export/Filter/ActivityTypeFilter.php @@ -61,7 +61,7 @@ class ActivityTypeFilter implements ExportElementValidatedInterface, FilterInter $builder->add('types', EntityType::class, [ 'choices' => $this->activityTypeRepository->findAllActive(), 'class' => ActivityType::class, - 'choice_label' => fn(ActivityType $aty) => ($aty->hasCategory() ? $this->translatableStringHelper->localize($aty->getCategory()->getName()) . ' > ' : '') + 'choice_label' => fn (ActivityType $aty) => ($aty->hasCategory() ? $this->translatableStringHelper->localize($aty->getCategory()->getName()) . ' > ' : '') . $this->translatableStringHelper->localize($aty->getName()), 'group_by' => function (ActivityType $type) { diff --git a/src/Bundle/ChillActivityBundle/Form/ActivityType.php b/src/Bundle/ChillActivityBundle/Form/ActivityType.php index dad4c3137..a74178afd 100644 --- a/src/Bundle/ChillActivityBundle/Form/ActivityType.php +++ b/src/Bundle/ChillActivityBundle/Form/ActivityType.php @@ -211,8 +211,8 @@ class ActivityType extends AbstractType 'required' => $activityType->isRequired('attendee'), 'expanded' => true, 'class' => ActivityPresence::class, - 'choice_label' => fn(ActivityPresence $activityPresence) => $this->translatableStringHelper->localize($activityPresence->getName()), - 'query_builder' => static fn(EntityRepository $er) => $er->createQueryBuilder('a') + 'choice_label' => fn (ActivityPresence $activityPresence) => $this->translatableStringHelper->localize($activityPresence->getName()), + 'query_builder' => static fn (EntityRepository $er) => $er->createQueryBuilder('a') ->where('a.active = true'), ]); } @@ -353,7 +353,7 @@ class ActivityType extends AbstractType return (string) $location->getId(); }, - fn(?string $id): ?Location => $this->om->getRepository(Location::class)->findOneBy(['id' => (int) $id]) + fn (?string $id): ?Location => $this->om->getRepository(Location::class)->findOneBy(['id' => (int) $id]) )); } diff --git a/src/Bundle/ChillActivityBundle/Form/ActivityTypeType.php b/src/Bundle/ChillActivityBundle/Form/ActivityTypeType.php index 42353cda7..073b8099f 100644 --- a/src/Bundle/ChillActivityBundle/Form/ActivityTypeType.php +++ b/src/Bundle/ChillActivityBundle/Form/ActivityTypeType.php @@ -45,7 +45,7 @@ class ActivityTypeType extends AbstractType ]) ->add('category', EntityType::class, [ 'class' => ActivityTypeCategory::class, - 'choice_label' => fn(ActivityTypeCategory $activityTypeCategory) => $this->translatableStringHelper->localize($activityTypeCategory->getName()), + 'choice_label' => fn (ActivityTypeCategory $activityTypeCategory) => $this->translatableStringHelper->localize($activityTypeCategory->getName()), ]) ->add('ordering', NumberType::class, [ 'required' => true, diff --git a/src/Bundle/ChillActivityBundle/Form/Type/PickActivityReasonType.php b/src/Bundle/ChillActivityBundle/Form/Type/PickActivityReasonType.php index 0b63de112..35da7e02f 100644 --- a/src/Bundle/ChillActivityBundle/Form/Type/PickActivityReasonType.php +++ b/src/Bundle/ChillActivityBundle/Form/Type/PickActivityReasonType.php @@ -45,7 +45,7 @@ class PickActivityReasonType extends AbstractType $resolver->setDefaults( [ 'class' => ActivityReason::class, - 'choice_label' => fn(ActivityReason $choice) => $this->reasonRender->renderString($choice, []), + 'choice_label' => fn (ActivityReason $choice) => $this->reasonRender->renderString($choice, []), 'group_by' => function (ActivityReason $choice): ?string { if (null !== $category = $choice->getCategory()) { return $this->translatableStringHelper->localize($category->getName()); diff --git a/src/Bundle/ChillActivityBundle/Form/Type/TranslatableActivityReasonCategoryType.php b/src/Bundle/ChillActivityBundle/Form/Type/TranslatableActivityReasonCategoryType.php index 83dcb43f0..4aa259097 100644 --- a/src/Bundle/ChillActivityBundle/Form/Type/TranslatableActivityReasonCategoryType.php +++ b/src/Bundle/ChillActivityBundle/Form/Type/TranslatableActivityReasonCategoryType.php @@ -38,7 +38,7 @@ class TranslatableActivityReasonCategoryType extends AbstractType $resolver->setDefaults( [ 'class' => ActivityReasonCategory::class, - 'choice_label' => fn(ActivityReasonCategory $category) => $this->translatableStringHelper->localize($category->getName()) + 'choice_label' => fn (ActivityReasonCategory $category) => $this->translatableStringHelper->localize($category->getName()) . (!$category->getActive() ? ' (' . $this->translator->trans('inactive') . ')' : ''), ] ); diff --git a/src/Bundle/ChillActivityBundle/Form/Type/TranslatableActivityType.php b/src/Bundle/ChillActivityBundle/Form/Type/TranslatableActivityType.php index 065f80c9b..d4807b82d 100644 --- a/src/Bundle/ChillActivityBundle/Form/Type/TranslatableActivityType.php +++ b/src/Bundle/ChillActivityBundle/Form/Type/TranslatableActivityType.php @@ -39,7 +39,7 @@ class TranslatableActivityType extends AbstractType 'class' => ActivityType::class, 'active_only' => true, 'choices' => $this->activityTypeRepository->findAllActive(), - 'choice_label' => fn(ActivityType $type) => $this->translatableStringHelper->localize($type->getName()), + 'choice_label' => fn (ActivityType $type) => $this->translatableStringHelper->localize($type->getName()), ] ); } diff --git a/src/Bundle/ChillActivityBundle/Repository/ActivityACLAwareRepository.php b/src/Bundle/ChillActivityBundle/Repository/ActivityACLAwareRepository.php index 3e5ff813b..1f2039a2c 100644 --- a/src/Bundle/ChillActivityBundle/Repository/ActivityACLAwareRepository.php +++ b/src/Bundle/ChillActivityBundle/Repository/ActivityACLAwareRepository.php @@ -254,7 +254,7 @@ final class ActivityACLAwareRepository implements ActivityACLAwareRepositoryInte $reachableScopes = $this->authorizationHelper->getReachableScopes($this->tokenStorage->getToken()->getUser(), ActivityVoter::SEE, $center); // we get the ids for those scopes $reachablesScopesId = array_map( - static fn(Scope $scope) => $scope->getId(), + static fn (Scope $scope) => $scope->getId(), $reachableScopes ); diff --git a/src/Bundle/ChillActivityBundle/Service/DocGenerator/ActivityContext.php b/src/Bundle/ChillActivityBundle/Service/DocGenerator/ActivityContext.php index 241526b03..624859eda 100644 --- a/src/Bundle/ChillActivityBundle/Service/DocGenerator/ActivityContext.php +++ b/src/Bundle/ChillActivityBundle/Service/DocGenerator/ActivityContext.php @@ -134,7 +134,7 @@ class ActivityContext implements $builder->add($key, EntityType::class, [ 'class' => Person::class, 'choices' => $persons, - 'choice_label' => fn(Person $p) => $this->personRender->renderString($p, []), + 'choice_label' => fn (Person $p) => $this->personRender->renderString($p, []), 'multiple' => false, 'required' => false, 'expanded' => true, diff --git a/src/Bundle/ChillActivityBundle/Service/DocGenerator/ListActivitiesByAccompanyingPeriodContext.php b/src/Bundle/ChillActivityBundle/Service/DocGenerator/ListActivitiesByAccompanyingPeriodContext.php index 9f9e03669..557bbcb84 100644 --- a/src/Bundle/ChillActivityBundle/Service/DocGenerator/ListActivitiesByAccompanyingPeriodContext.php +++ b/src/Bundle/ChillActivityBundle/Service/DocGenerator/ListActivitiesByAccompanyingPeriodContext.php @@ -146,7 +146,7 @@ class ListActivitiesByAccompanyingPeriodContext implements return array_filter( $activities, function ($activity) use ($user) { - $activityUsernames = array_map(static fn($user) => $user['username'], $activity['users'] ?? []); + $activityUsernames = array_map(static fn ($user) => $user['username'], $activity['users'] ?? []); return in_array($user->getUsername(), $activityUsernames, true); } ); @@ -157,7 +157,7 @@ class ListActivitiesByAccompanyingPeriodContext implements return array_filter( $works, function ($work) use ($user) { - $workUsernames = array_map(static fn($user) => $user['username'], $work['referrers'] ?? []); + $workUsernames = array_map(static fn ($user) => $user['username'], $work['referrers'] ?? []); return in_array($user->getUsername(), $workUsernames, true); } diff --git a/src/Bundle/ChillActivityBundle/Tests/Controller/ActivityControllerTest.php b/src/Bundle/ChillActivityBundle/Tests/Controller/ActivityControllerTest.php index d01821e6e..04301afae 100644 --- a/src/Bundle/ChillActivityBundle/Tests/Controller/ActivityControllerTest.php +++ b/src/Bundle/ChillActivityBundle/Tests/Controller/ActivityControllerTest.php @@ -369,8 +369,8 @@ final class ActivityControllerTest extends WebTestCase $center ); $reachableScopesId = array_intersect( - array_map(static fn($s) => $s->getId(), $reachableScopesDelete), - array_map(static fn($s) => $s->getId(), $reachableScopesUpdate) + array_map(static fn ($s) => $s->getId(), $reachableScopesDelete), + array_map(static fn ($s) => $s->getId(), $reachableScopesUpdate) ); if (count($reachableScopesId) === 0) { diff --git a/src/Bundle/ChillActivityBundle/Tests/Form/ActivityTypeTest.php b/src/Bundle/ChillActivityBundle/Tests/Form/ActivityTypeTest.php index cd73b259a..3ed6b4409 100644 --- a/src/Bundle/ChillActivityBundle/Tests/Form/ActivityTypeTest.php +++ b/src/Bundle/ChillActivityBundle/Tests/Form/ActivityTypeTest.php @@ -188,7 +188,7 @@ final class ActivityTypeTest extends KernelTestCase // map all the values in an array $values = array_map( - static fn($choice) => $choice->value, + static fn ($choice) => $choice->value, $view['activity']['durationTime']->vars['choices'] ); diff --git a/src/Bundle/ChillActivityBundle/Tests/Form/Type/TranslatableActivityReasonTest.php b/src/Bundle/ChillActivityBundle/Tests/Form/Type/TranslatableActivityReasonTest.php index aefa0d115..a8d85daa6 100644 --- a/src/Bundle/ChillActivityBundle/Tests/Form/Type/TranslatableActivityReasonTest.php +++ b/src/Bundle/ChillActivityBundle/Tests/Form/Type/TranslatableActivityReasonTest.php @@ -83,7 +83,7 @@ final class TranslatableActivityReasonTest extends TypeTestCase $request->getLocale()->willReturn($fallbackLocale); $requestStack->willExtend(\Symfony\Component\HttpFoundation\RequestStack::class); - $requestStack->getCurrentRequest()->will(static fn() => $request); + $requestStack->getCurrentRequest()->will(static fn () => $request); $translator->willExtend(\Symfony\Component\Translation\Translator::class); $translator->getFallbackLocales()->willReturn($locale); diff --git a/src/Bundle/ChillAsideActivityBundle/src/DependencyInjection/Configuration.php b/src/Bundle/ChillAsideActivityBundle/src/DependencyInjection/Configuration.php index 85d76227d..2e2398c3e 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/DependencyInjection/Configuration.php +++ b/src/Bundle/ChillAsideActivityBundle/src/DependencyInjection/Configuration.php @@ -132,7 +132,7 @@ class Configuration implements ConfigurationInterface ->info('The number of seconds of this duration. Must be an integer.') ->cannotBeEmpty() ->validate() - ->ifTrue(static fn($data) => !is_int($data))->thenInvalid('The value %s is not a valid integer') + ->ifTrue(static fn ($data) => !is_int($data))->thenInvalid('The value %s is not a valid integer') ->end() ->end() ->scalarNode('label') diff --git a/src/Bundle/ChillAsideActivityBundle/src/Export/Export/CountAsideActivity.php b/src/Bundle/ChillAsideActivityBundle/src/Export/Export/CountAsideActivity.php index 8eb8d1b64..9204fad4b 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/Export/Export/CountAsideActivity.php +++ b/src/Bundle/ChillAsideActivityBundle/src/Export/Export/CountAsideActivity.php @@ -59,7 +59,7 @@ class CountAsideActivity implements ExportInterface, GroupedExportInterface $labels = array_combine($values, $values); $labels['_header'] = $this->getTitle(); - return static fn($value) => $labels[$value]; + return static fn ($value) => $labels[$value]; } public function getQueryKeys($data): array diff --git a/src/Bundle/ChillBudgetBundle/Form/ChargeType.php b/src/Bundle/ChillBudgetBundle/Form/ChargeType.php index de8317ab3..72863163f 100644 --- a/src/Bundle/ChillBudgetBundle/Form/ChargeType.php +++ b/src/Bundle/ChillBudgetBundle/Form/ChargeType.php @@ -52,7 +52,7 @@ class ChargeType extends AbstractType 'label' => 'Charge type', 'required' => true, 'placeholder' => $this->translator->trans('admin.form.Choose the type of charge'), - 'choice_label' => fn(ChargeKind $resource) => $this->translatableStringHelper->localize($resource->getName()), + 'choice_label' => fn (ChargeKind $resource) => $this->translatableStringHelper->localize($resource->getName()), 'attr' => ['class' => 'select2'], ]) ->add('amount', MoneyType::class) diff --git a/src/Bundle/ChillBudgetBundle/Form/ResourceType.php b/src/Bundle/ChillBudgetBundle/Form/ResourceType.php index 3b14e9a05..09dfd16f3 100644 --- a/src/Bundle/ChillBudgetBundle/Form/ResourceType.php +++ b/src/Bundle/ChillBudgetBundle/Form/ResourceType.php @@ -51,7 +51,7 @@ class ResourceType extends AbstractType 'label' => 'Resource type', 'required' => true, 'placeholder' => $this->translator->trans('admin.form.Choose the type of resource'), - 'choice_label' => fn(ResourceKind $resource) => $this->translatableStringHelper->localize($resource->getName()), + 'choice_label' => fn (ResourceKind $resource) => $this->translatableStringHelper->localize($resource->getName()), 'attr' => ['class' => 'select2'], ]) ->add('amount', MoneyType::class) diff --git a/src/Bundle/ChillBudgetBundle/Service/Summary/SummaryBudget.php b/src/Bundle/ChillBudgetBundle/Service/Summary/SummaryBudget.php index 3e0ee2cec..1c66d4c1c 100644 --- a/src/Bundle/ChillBudgetBundle/Service/Summary/SummaryBudget.php +++ b/src/Bundle/ChillBudgetBundle/Service/Summary/SummaryBudget.php @@ -66,7 +66,7 @@ final class SummaryBudget implements SummaryBudgetInterface ]; } - $personIds = $household->getCurrentPersons()->map(static fn(Person $p) => $p->getId()); + $personIds = $household->getCurrentPersons()->map(static fn (Person $p) => $p->getId()); $ids = implode(', ', array_fill(0, count($personIds), '?')); $parameters = [...$personIds, $household->getId()]; @@ -125,14 +125,14 @@ final class SummaryBudget implements SummaryBudgetInterface { $keys = array_map(static fn (ChargeKind $kind) => $kind->getKind(), $this->chargeKindRepository->findAll()); - return array_combine($keys, array_map(fn($kind) => ['sum' => 0.0, 'label' => $this->translatableStringHelper->localize($this->chargeKindRepository->findOneByKind($kind)->getName()), 'comment' => ''], $keys)); + return array_combine($keys, array_map(fn ($kind) => ['sum' => 0.0, 'label' => $this->translatableStringHelper->localize($this->chargeKindRepository->findOneByKind($kind)->getName()), 'comment' => ''], $keys)); } private function getEmptyResourceArray(): array { $keys = array_map(static fn (ResourceKind $kind) => $kind->getKind(), $this->resourceKindRepository->findAll()); - return array_combine($keys, array_map(fn($kind) => ['sum' => 0.0, 'label' => $this->translatableStringHelper->localize($this->resourceKindRepository->findOneByKind($kind)->getName()), 'comment' => ''], $keys)); + return array_combine($keys, array_map(fn ($kind) => ['sum' => 0.0, 'label' => $this->translatableStringHelper->localize($this->resourceKindRepository->findOneByKind($kind)->getName()), 'comment' => ''], $keys)); } private function rowToArray(array $rows, string $kind): array diff --git a/src/Bundle/ChillBudgetBundle/Tests/Service/Summary/SummaryBudgetTest.php b/src/Bundle/ChillBudgetBundle/Tests/Service/Summary/SummaryBudgetTest.php index 194c23672..77017abc5 100644 --- a/src/Bundle/ChillBudgetBundle/Tests/Service/Summary/SummaryBudgetTest.php +++ b/src/Bundle/ChillBudgetBundle/Tests/Service/Summary/SummaryBudgetTest.php @@ -50,7 +50,7 @@ final class SummaryBudgetTest extends TestCase ], ]); $queryCharges->setParameters(Argument::type('array')) - ->will(static fn($args, $query) => $query); + ->will(static fn ($args, $query) => $query); $queryResources = $this->prophesize(AbstractQuery::class); $queryResources->getResult()->willReturn([ @@ -61,7 +61,7 @@ final class SummaryBudgetTest extends TestCase ], ]); $queryResources->setParameters(Argument::type('array')) - ->will(static fn($args, $query) => $query); + ->will(static fn ($args, $query) => $query); $em = $this->prophesize(EntityManagerInterface::class); $em->createNativeQuery(Argument::type('string'), Argument::type(Query\ResultSetMapping::class)) @@ -96,7 +96,7 @@ final class SummaryBudgetTest extends TestCase $resourceRepository->findOneByKind('misc')->willReturn($misc); $translatableStringHelper = $this->prophesize(TranslatableStringHelperInterface::class); - $translatableStringHelper->localize(Argument::type('array'))->will(static fn($arg) => $arg[0]['fr']); + $translatableStringHelper->localize(Argument::type('array'))->will(static fn ($arg) => $arg[0]['fr']); $person = new Person(); $personReflection = new ReflectionClass($person); diff --git a/src/Bundle/ChillCalendarBundle/Entity/Calendar.php b/src/Bundle/ChillCalendarBundle/Entity/Calendar.php index 418bfcea2..79219a6e0 100644 --- a/src/Bundle/ChillCalendarBundle/Entity/Calendar.php +++ b/src/Bundle/ChillCalendarBundle/Entity/Calendar.php @@ -514,7 +514,7 @@ class Calendar implements TrackCreationInterface, TrackUpdateInterface, HasCente */ public function getUsers(): ReadableCollection { - return $this->getInvites()->map(static fn(Invite $i) => $i->getUser()); + return $this->getInvites()->map(static fn (Invite $i) => $i->getUser()); } public function hasCalendarRange(): bool @@ -599,7 +599,7 @@ class Calendar implements TrackCreationInterface, TrackUpdateInterface, HasCente } $invite = $this->invites - ->filter(static fn(Invite $invite) => $invite->getUser() === $user) + ->filter(static fn (Invite $invite) => $invite->getUser() === $user) ->first(); $this->removeInvite($invite); diff --git a/src/Bundle/ChillCalendarBundle/Export/Export/CountCalendars.php b/src/Bundle/ChillCalendarBundle/Export/Export/CountCalendars.php index c21b4a4d6..9d3f00f99 100644 --- a/src/Bundle/ChillCalendarBundle/Export/Export/CountCalendars.php +++ b/src/Bundle/ChillCalendarBundle/Export/Export/CountCalendars.php @@ -61,7 +61,7 @@ class CountCalendars implements ExportInterface, GroupedExportInterface $labels = array_combine($values, $values); $labels['_header'] = $this->getTitle(); - return static fn($value) => $labels[$value]; + return static fn ($value) => $labels[$value]; } public function getQueryKeys($data): array @@ -89,7 +89,7 @@ class CountCalendars implements ExportInterface, GroupedExportInterface */ public function initiateQuery(array $requiredModifiers, array $acl, array $data = []): QueryBuilder { - $centers = array_map(static fn($el) => $el['center'], $acl); + $centers = array_map(static fn ($el) => $el['center'], $acl); $qb = $this->calendarRepository->createQueryBuilder('cal'); diff --git a/src/Bundle/ChillCalendarBundle/Export/Export/StatCalendarAvgDuration.php b/src/Bundle/ChillCalendarBundle/Export/Export/StatCalendarAvgDuration.php index 78be10834..14dd42d6b 100644 --- a/src/Bundle/ChillCalendarBundle/Export/Export/StatCalendarAvgDuration.php +++ b/src/Bundle/ChillCalendarBundle/Export/Export/StatCalendarAvgDuration.php @@ -61,7 +61,7 @@ class StatCalendarAvgDuration implements ExportInterface, GroupedExportInterface $labels = array_combine($values, $values); $labels['_header'] = $this->getTitle(); - return static fn($value) => $labels[$value]; + return static fn ($value) => $labels[$value]; } public function getQueryKeys($data): array diff --git a/src/Bundle/ChillCalendarBundle/Export/Export/StatCalendarSumDuration.php b/src/Bundle/ChillCalendarBundle/Export/Export/StatCalendarSumDuration.php index 5dd9dca44..1d31bfa26 100644 --- a/src/Bundle/ChillCalendarBundle/Export/Export/StatCalendarSumDuration.php +++ b/src/Bundle/ChillCalendarBundle/Export/Export/StatCalendarSumDuration.php @@ -61,7 +61,7 @@ class StatCalendarSumDuration implements ExportInterface, GroupedExportInterface $labels = array_combine($values, $values); $labels['_header'] = $this->getTitle(); - return static fn($value) => $labels[$value]; + return static fn ($value) => $labels[$value]; } public function getQueryKeys($data): array diff --git a/src/Bundle/ChillCalendarBundle/Export/Filter/AgentFilter.php b/src/Bundle/ChillCalendarBundle/Export/Filter/AgentFilter.php index 058251004..b58cee594 100644 --- a/src/Bundle/ChillCalendarBundle/Export/Filter/AgentFilter.php +++ b/src/Bundle/ChillCalendarBundle/Export/Filter/AgentFilter.php @@ -58,7 +58,7 @@ class AgentFilter implements FilterInterface { $builder->add('accepted_agents', EntityType::class, [ 'class' => User::class, - 'choice_label' => fn(User $u) => $this->userRender->renderString($u, []), + 'choice_label' => fn (User $u) => $this->userRender->renderString($u, []), 'multiple' => true, 'expanded' => true, ]); diff --git a/src/Bundle/ChillCalendarBundle/Export/Filter/JobFilter.php b/src/Bundle/ChillCalendarBundle/Export/Filter/JobFilter.php index 04f6ba02b..69fb24447 100644 --- a/src/Bundle/ChillCalendarBundle/Export/Filter/JobFilter.php +++ b/src/Bundle/ChillCalendarBundle/Export/Filter/JobFilter.php @@ -69,7 +69,7 @@ class JobFilter implements FilterInterface { $builder->add('job', EntityType::class, [ 'class' => UserJob::class, - 'choice_label' => fn(UserJob $j) => $this->translatableStringHelper->localize( + 'choice_label' => fn (UserJob $j) => $this->translatableStringHelper->localize( $j->getLabel() ), 'multiple' => true, diff --git a/src/Bundle/ChillCalendarBundle/Export/Filter/ScopeFilter.php b/src/Bundle/ChillCalendarBundle/Export/Filter/ScopeFilter.php index ce6c90de2..08d9ae023 100644 --- a/src/Bundle/ChillCalendarBundle/Export/Filter/ScopeFilter.php +++ b/src/Bundle/ChillCalendarBundle/Export/Filter/ScopeFilter.php @@ -69,7 +69,7 @@ class ScopeFilter implements FilterInterface { $builder->add('scope', EntityType::class, [ 'class' => Scope::class, - 'choice_label' => fn(Scope $s) => $this->translatableStringHelper->localize( + 'choice_label' => fn (Scope $s) => $this->translatableStringHelper->localize( $s->getName() ), 'multiple' => true, diff --git a/src/Bundle/ChillCalendarBundle/Messenger/Handler/CalendarToRemoteHandler.php b/src/Bundle/ChillCalendarBundle/Messenger/Handler/CalendarToRemoteHandler.php index 1ec257cad..eabdf9063 100644 --- a/src/Bundle/ChillCalendarBundle/Messenger/Handler/CalendarToRemoteHandler.php +++ b/src/Bundle/ChillCalendarBundle/Messenger/Handler/CalendarToRemoteHandler.php @@ -89,10 +89,10 @@ class CalendarToRemoteHandler implements MessageHandlerInterface $newInvites = array_filter( array_map( - fn($id) => $this->inviteRepository->find($id), + fn ($id) => $this->inviteRepository->find($id), $calendarMessage->getNewInvitesIds(), ), - static fn(?Invite $invite) => null !== $invite + static fn (?Invite $invite) => null !== $invite ); $this->calendarConnector->syncCalendar( diff --git a/src/Bundle/ChillCalendarBundle/Messenger/Message/CalendarMessage.php b/src/Bundle/ChillCalendarBundle/Messenger/Message/CalendarMessage.php index 6232ca06c..c8a8f8aeb 100644 --- a/src/Bundle/ChillCalendarBundle/Messenger/Message/CalendarMessage.php +++ b/src/Bundle/ChillCalendarBundle/Messenger/Message/CalendarMessage.php @@ -58,7 +58,7 @@ class CalendarMessage $this->previousMainUserId = null !== $calendar->previousMainUser ? $calendar->previousMainUser->getId() : null; $this->newInvitesIds = array_map(static fn (Invite $i) => $i->getId(), $calendar->newInvites); - $this->oldInvites = array_map(static fn(Invite $i) => [ + $this->oldInvites = array_map(static fn (Invite $i) => [ 'inviteId' => $i->getId(), 'userId' => $i->getUser()->getId(), 'userEmail' => $i->getUser()->getEmail(), diff --git a/src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/MSGraph/RemoteEventConverter.php b/src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/MSGraph/RemoteEventConverter.php index b7a1c2df6..176dbe0b0 100644 --- a/src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/MSGraph/RemoteEventConverter.php +++ b/src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/MSGraph/RemoteEventConverter.php @@ -121,7 +121,7 @@ class RemoteEventConverter 'subject' => '[Chill] ' . implode( ', ', - $calendar->getPersons()->map(fn(Person $p) => $this->personRender->renderString($p, []))->toArray() + $calendar->getPersons()->map(fn (Person $p) => $this->personRender->renderString($p, []))->toArray() ), 'start' => [ 'dateTime' => $calendar->getStartDate()->setTimezone($this->remoteDateTimeZone) @@ -159,7 +159,7 @@ class RemoteEventConverter { return [ 'attendees' => $calendar->getInvites()->map( - fn(Invite $i) => $this->buildInviteToAttendee($i) + fn (Invite $i) => $this->buildInviteToAttendee($i) )->toArray(), ]; } diff --git a/src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/MSGraphRemoteCalendarConnector.php b/src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/MSGraphRemoteCalendarConnector.php index 75995948e..e3690042c 100644 --- a/src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/MSGraphRemoteCalendarConnector.php +++ b/src/Bundle/ChillCalendarBundle/RemoteCalendar/Connector/MSGraphRemoteCalendarConnector.php @@ -190,17 +190,17 @@ class MSGraphRemoteCalendarConnector implements RemoteCalendarConnectorInterface ] )->toArray(); - $ids = array_map(static fn($item) => $item['id'], $bareEvents['value']); + $ids = array_map(static fn ($item) => $item['id'], $bareEvents['value']); $existingIdsInRange = $this->calendarRangeRepository->findRemoteIdsPresent($ids); $existingIdsInCalendar = $this->calendarRepository->findRemoteIdsPresent($ids); return array_values( array_map( - fn($item) => $this->remoteEventConverter->convertToRemote($item), + fn ($item) => $this->remoteEventConverter->convertToRemote($item), // filter all event to keep only the one not in range array_filter( $bareEvents['value'], - static fn($item) => ((!$existingIdsInRange[$item['id']]) ?? true) && ((!$existingIdsInCalendar[$item['id']]) ?? true) + static fn ($item) => ((!$existingIdsInRange[$item['id']]) ?? true) && ((!$existingIdsInCalendar[$item['id']]) ?? true) ) ) ); @@ -595,7 +595,7 @@ class MSGraphRemoteCalendarConnector implements RemoteCalendarConnectorInterface } $this->cacheScheduleTimeForUser[$userId] = array_map( - fn($item) => $this->remoteEventConverter->convertAvailabilityToRemoteEvent($item), + fn ($item) => $this->remoteEventConverter->convertAvailabilityToRemoteEvent($item), $response['value'][0]['scheduleItems'] ); diff --git a/src/Bundle/ChillCalendarBundle/Tests/Form/CalendarTypeTest.php b/src/Bundle/ChillCalendarBundle/Tests/Form/CalendarTypeTest.php index f7a3509f4..9195d5eac 100644 --- a/src/Bundle/ChillCalendarBundle/Tests/Form/CalendarTypeTest.php +++ b/src/Bundle/ChillCalendarBundle/Tests/Form/CalendarTypeTest.php @@ -114,8 +114,8 @@ final class CalendarTypeTest extends TypeTestCase $this->assertEquals(8, $calendar->getCalendarRange()->getId()); $this->assertEquals(9, $calendar->getLocation()->getId()); $this->assertEquals(true, $calendar->getSendSMS()); - $this->assertContains(2, $calendar->getUsers()->map(static fn(User $u) => $u->getId())); - $this->assertContains(3, $calendar->getUsers()->map(static fn(User $u) => $u->getId())); + $this->assertContains(2, $calendar->getUsers()->map(static fn (User $u) => $u->getId())); + $this->assertContains(3, $calendar->getUsers()->map(static fn (User $u) => $u->getId())); } protected function getExtensions() @@ -144,16 +144,16 @@ final class CalendarTypeTest extends TypeTestCase ) { $transformer = $this->prophesize($classTransformer); $transformer->transform(Argument::type('array')) - ->will(static fn($args) => implode( + ->will(static fn ($args) => implode( ',', - array_map(static fn($p) => $p->getId(), $args[0]) + array_map(static fn ($p) => $p->getId(), $args[0]) )); $transformer->transform(Argument::exact(null)) ->willReturn([]); $transformer->transform(Argument::type(Collection::class)) - ->will(static fn($args) => implode( + ->will(static fn ($args) => implode( ',', - array_map(static fn($p) => $p->getId(), $args[0]->toArray()) + array_map(static fn ($p) => $p->getId(), $args[0]->toArray()) )); $transformer->reverseTransform(Argument::type('string')) ->will(static function ($args) use ($objClass) { @@ -183,7 +183,7 @@ final class CalendarTypeTest extends TypeTestCase ) { $transformer = $this->prophesize($classTransformer); $transformer->transform(Argument::type('object')) - ->will(static fn($args) => (string) $args[0]->getId()); + ->will(static fn ($args) => (string) $args[0]->getId()); $transformer->transform(Argument::exact(null)) ->willReturn(''); $transformer->reverseTransform(Argument::type('string')) diff --git a/src/Bundle/ChillCalendarBundle/Tests/RemoteCalendar/Connector/MSGraph/AddressConverterTest.php b/src/Bundle/ChillCalendarBundle/Tests/RemoteCalendar/Connector/MSGraph/AddressConverterTest.php index 35c067eb7..827e22381 100644 --- a/src/Bundle/ChillCalendarBundle/Tests/RemoteCalendar/Connector/MSGraph/AddressConverterTest.php +++ b/src/Bundle/ChillCalendarBundle/Tests/RemoteCalendar/Connector/MSGraph/AddressConverterTest.php @@ -63,7 +63,7 @@ final class AddressConverterTest extends TestCase { $engine = $this->prophesize(EngineInterface::class); $translatableStringHelper = $this->prophesize(TranslatableStringHelperInterface::class); - $translatableStringHelper->localize(Argument::type('array'))->will(static fn($args): string => ($args[0] ?? ['fr' => 'not provided'])['fr'] ?? 'not provided'); + $translatableStringHelper->localize(Argument::type('array'))->will(static fn ($args): string => ($args[0] ?? ['fr' => 'not provided'])['fr'] ?? 'not provided'); $addressRender = new AddressRender($engine->reveal(), $translatableStringHelper->reveal()); diff --git a/src/Bundle/ChillCalendarBundle/Tests/Service/ShortMessageNotification/CalendarForShortMessageProviderTest.php b/src/Bundle/ChillCalendarBundle/Tests/Service/ShortMessageNotification/CalendarForShortMessageProviderTest.php index 9ee2ac82b..34867d8bd 100644 --- a/src/Bundle/ChillCalendarBundle/Tests/Service/ShortMessageNotification/CalendarForShortMessageProviderTest.php +++ b/src/Bundle/ChillCalendarBundle/Tests/Service/ShortMessageNotification/CalendarForShortMessageProviderTest.php @@ -72,13 +72,13 @@ final class CalendarForShortMessageProviderTest extends TestCase Argument::type(DateTimeImmutable::class), Argument::type('int'), Argument::exact(0) - )->will(static fn($args) => array_fill(0, $args[2], new Calendar()))->shouldBeCalledTimes(1); + )->will(static fn ($args) => array_fill(0, $args[2], new Calendar()))->shouldBeCalledTimes(1); $calendarRepository->findByNotificationAvailable( Argument::type(DateTimeImmutable::class), Argument::type(DateTimeImmutable::class), Argument::type('int'), Argument::not(0) - )->will(static fn($args) => array_fill(0, $args[2] - 1, new Calendar()))->shouldBeCalledTimes(1); + )->will(static fn ($args) => array_fill(0, $args[2] - 1, new Calendar()))->shouldBeCalledTimes(1); $em = $this->prophesize(EntityManagerInterface::class); $em->clear()->shouldBeCalled(); @@ -104,13 +104,13 @@ final class CalendarForShortMessageProviderTest extends TestCase Argument::type(DateTimeImmutable::class), Argument::type('int'), Argument::exact(0) - )->will(static fn($args) => array_fill(0, 1, new Calendar()))->shouldBeCalledTimes(1); + )->will(static fn ($args) => array_fill(0, 1, new Calendar()))->shouldBeCalledTimes(1); $calendarRepository->findByNotificationAvailable( Argument::type(DateTimeImmutable::class), Argument::type(DateTimeImmutable::class), Argument::type('int'), Argument::not(0) - )->will(static fn($args) => [])->shouldBeCalledTimes(1); + )->will(static fn ($args) => [])->shouldBeCalledTimes(1); $em = $this->prophesize(EntityManagerInterface::class); $em->clear()->shouldBeCalled(); diff --git a/src/Bundle/ChillCustomFieldsBundle/CustomFields/CustomFieldLongChoice.php b/src/Bundle/ChillCustomFieldsBundle/CustomFields/CustomFieldLongChoice.php index c60d947dd..75dc7792f 100644 --- a/src/Bundle/ChillCustomFieldsBundle/CustomFields/CustomFieldLongChoice.php +++ b/src/Bundle/ChillCustomFieldsBundle/CustomFields/CustomFieldLongChoice.php @@ -58,7 +58,7 @@ class CustomFieldLongChoice extends AbstractCustomField $translatableStringHelper = $this->translatableStringHelper; $builder->add($customField->getSlug(), Select2ChoiceType::class, [ 'choices' => $entries, - 'choice_label' => static fn(Option $option) => $translatableStringHelper->localize($option->getText()), + 'choice_label' => static fn (Option $option) => $translatableStringHelper->localize($option->getText()), 'choice_value' => static fn (Option $key): ?int => null === $key ? null : $key->getId(), 'multiple' => false, 'expanded' => false, diff --git a/src/Bundle/ChillCustomFieldsBundle/EntityRepository/CustomFieldLongChoice/OptionRepository.php b/src/Bundle/ChillCustomFieldsBundle/EntityRepository/CustomFieldLongChoice/OptionRepository.php index e1ed1d363..4ef6e046d 100644 --- a/src/Bundle/ChillCustomFieldsBundle/EntityRepository/CustomFieldLongChoice/OptionRepository.php +++ b/src/Bundle/ChillCustomFieldsBundle/EntityRepository/CustomFieldLongChoice/OptionRepository.php @@ -57,6 +57,6 @@ class OptionRepository extends EntityRepository ->getQuery() ->getScalarResult(); - return array_map(static fn($r) => $r['key'], $keys); + return array_map(static fn ($r) => $r['key'], $keys); } } diff --git a/src/Bundle/ChillCustomFieldsBundle/Form/CustomFieldType.php b/src/Bundle/ChillCustomFieldsBundle/Form/CustomFieldType.php index f9a9f2509..0630bccf5 100644 --- a/src/Bundle/ChillCustomFieldsBundle/Form/CustomFieldType.php +++ b/src/Bundle/ChillCustomFieldsBundle/Form/CustomFieldType.php @@ -70,7 +70,7 @@ class CustomFieldType extends AbstractType if ('entity' === $options['group_widget']) { $builder->add('customFieldsGroup', EntityType::class, [ 'class' => 'ChillCustomFieldsBundle:CustomFieldsGroup', - 'choice_label' => fn($g) => $this->translatableStringHelper->localize($g->getName()), + 'choice_label' => fn ($g) => $this->translatableStringHelper->localize($g->getName()), ]); } elseif ('hidden' === $options['group_widget']) { $builder->add('customFieldsGroup', HiddenType::class); diff --git a/src/Bundle/ChillCustomFieldsBundle/Form/DataTransformer/JsonCustomFieldToArrayTransformer.php b/src/Bundle/ChillCustomFieldsBundle/Form/DataTransformer/JsonCustomFieldToArrayTransformer.php index ab67ca581..2b34b498a 100644 --- a/src/Bundle/ChillCustomFieldsBundle/Form/DataTransformer/JsonCustomFieldToArrayTransformer.php +++ b/src/Bundle/ChillCustomFieldsBundle/Form/DataTransformer/JsonCustomFieldToArrayTransformer.php @@ -38,7 +38,7 @@ class JsonCustomFieldToArrayTransformer implements DataTransformerInterface // @TODO: in the array_map callback, CustomField::getLabel() does not exist. What do we do here? $customFieldsLablels = array_map( - static fn($e) => $e->getLabel(), + static fn ($e) => $e->getLabel(), $customFields ); diff --git a/src/Bundle/ChillDocGeneratorBundle/Form/DocGeneratorTemplateType.php b/src/Bundle/ChillDocGeneratorBundle/Form/DocGeneratorTemplateType.php index 0b1fbec9d..5b4a8be30 100644 --- a/src/Bundle/ChillDocGeneratorBundle/Form/DocGeneratorTemplateType.php +++ b/src/Bundle/ChillDocGeneratorBundle/Form/DocGeneratorTemplateType.php @@ -61,8 +61,8 @@ class DocGeneratorTemplateType extends AbstractType $sub = $builder ->create('options', null, ['compound' => true]) ->addModelTransformer(new CallbackTransformer( - static fn(array $data) => $context->adminFormTransform($data), - static fn(array $data) => $context->adminFormReverseTransform($data) + static fn (array $data) => $context->adminFormTransform($data), + static fn (array $data) => $context->adminFormReverseTransform($data) )); $context->buildAdminForm($sub); $builder->add($sub); diff --git a/src/Bundle/ChillDocStoreBundle/Form/AccompanyingCourseDocumentType.php b/src/Bundle/ChillDocStoreBundle/Form/AccompanyingCourseDocumentType.php index 255ca5dc5..5ed5b5981 100644 --- a/src/Bundle/ChillDocStoreBundle/Form/AccompanyingCourseDocumentType.php +++ b/src/Bundle/ChillDocStoreBundle/Form/AccompanyingCourseDocumentType.php @@ -72,10 +72,10 @@ class AccompanyingCourseDocumentType extends AbstractType ->add('category', EntityType::class, [ 'placeholder' => 'Choose a document category', 'class' => DocumentCategory::class, - 'query_builder' => static fn(EntityRepository $er) => $er->createQueryBuilder('c') + 'query_builder' => static fn (EntityRepository $er) => $er->createQueryBuilder('c') ->where('c.documentClass = :docClass') ->setParameter('docClass', AccompanyingCourseDocument::class), - 'choice_label' => fn($entity = null) => $entity ? $this->translatableStringHelper->localize($entity->getName()) : '', + 'choice_label' => fn ($entity = null) => $entity ? $this->translatableStringHelper->localize($entity->getName()) : '', ]); } diff --git a/src/Bundle/ChillDocStoreBundle/Form/PersonDocumentType.php b/src/Bundle/ChillDocStoreBundle/Form/PersonDocumentType.php index c7cf31534..11f73e862 100644 --- a/src/Bundle/ChillDocStoreBundle/Form/PersonDocumentType.php +++ b/src/Bundle/ChillDocStoreBundle/Form/PersonDocumentType.php @@ -67,10 +67,10 @@ class PersonDocumentType extends AbstractType ->add('category', EntityType::class, [ 'placeholder' => 'Choose a document category', 'class' => DocumentCategory::class, - 'query_builder' => static fn(EntityRepository $er) => $er->createQueryBuilder('c') + 'query_builder' => static fn (EntityRepository $er) => $er->createQueryBuilder('c') ->where('c.documentClass = :docClass') ->setParameter('docClass', PersonDocument::class), - 'choice_label' => fn($entity = null) => $entity ? $this->translatableStringHelper->localize($entity->getName()) : '', + 'choice_label' => fn ($entity = null) => $entity ? $this->translatableStringHelper->localize($entity->getName()) : '', ]); if ($isScopeConcerned && $this->parameterBag->get('chill_main')['acl']['form_show_scopes']) { diff --git a/src/Bundle/ChillDocStoreBundle/Workflow/AccompanyingCourseDocumentWorkflowHandler.php b/src/Bundle/ChillDocStoreBundle/Workflow/AccompanyingCourseDocumentWorkflowHandler.php index b819ae8c3..c3285507e 100644 --- a/src/Bundle/ChillDocStoreBundle/Workflow/AccompanyingCourseDocumentWorkflowHandler.php +++ b/src/Bundle/ChillDocStoreBundle/Workflow/AccompanyingCourseDocumentWorkflowHandler.php @@ -51,7 +51,7 @@ class AccompanyingCourseDocumentWorkflowHandler implements EntityWorkflowHandler $persons = []; if (null !== $course) { - $persons = $course->getCurrentParticipations()->map(static fn(AccompanyingPeriodParticipation $participation) => $participation->getPerson())->toArray(); + $persons = $course->getCurrentParticipations()->map(static fn (AccompanyingPeriodParticipation $participation) => $participation->getPerson())->toArray(); } return [ diff --git a/src/Bundle/ChillEventBundle/Controller/ParticipationController.php b/src/Bundle/ChillEventBundle/Controller/ParticipationController.php index 51ba3634d..1929beac1 100644 --- a/src/Bundle/ChillEventBundle/Controller/ParticipationController.php +++ b/src/Bundle/ChillEventBundle/Controller/ParticipationController.php @@ -113,7 +113,7 @@ class ParticipationController extends AbstractController [ 'event_id' => current($participations)->getEvent()->getId(), 'persons_ids' => implode(',', array_map( - static fn(Participation $p) => $p->getPerson()->getId(), + static fn (Participation $p) => $p->getPerson()->getId(), $participations )), ] @@ -648,13 +648,13 @@ class ParticipationController extends AbstractController // create a collection of person's id participating to the event /** @var \Doctrine\Common\Collections\ArrayCollection $peopleParticipating */ $peopleParticipating ??= $participation->getEvent()->getParticipations()->map( - static fn(Participation $p) => $p->getPerson()->getId() + static fn (Participation $p) => $p->getPerson()->getId() ); // check that the user is not already in the event if ($peopleParticipating->contains($participation->getPerson()->getId())) { $ignoredParticipations[] = $participation ->getEvent()->getParticipations()->filter( - static fn(Participation $p) => $p->getPerson()->getId() === $participation->getPerson()->getId() + static fn (Participation $p) => $p->getPerson()->getId() === $participation->getPerson()->getId() )->first(); } else { $newParticipations[] = $participation; diff --git a/src/Bundle/ChillEventBundle/Entity/Event.php b/src/Bundle/ChillEventBundle/Entity/Event.php index 669cb02db..d55a7b8a8 100644 --- a/src/Bundle/ChillEventBundle/Entity/Event.php +++ b/src/Bundle/ChillEventBundle/Entity/Event.php @@ -176,7 +176,7 @@ class Event implements HasCenterInterface, HasScopeInterface { $iterator = $this->participations->getIterator(); - $iterator->uasort(static fn($first, $second) => strnatcasecmp($first->getPerson()->getFirstName(), $second->getPerson()->getFirstName())); + $iterator->uasort(static fn ($first, $second) => strnatcasecmp($first->getPerson()->getFirstName(), $second->getPerson()->getFirstName())); return $iterator; } diff --git a/src/Bundle/ChillEventBundle/Form/ChoiceLoader/EventChoiceLoader.php b/src/Bundle/ChillEventBundle/Form/ChoiceLoader/EventChoiceLoader.php index de1c42cf8..962799dbc 100644 --- a/src/Bundle/ChillEventBundle/Form/ChoiceLoader/EventChoiceLoader.php +++ b/src/Bundle/ChillEventBundle/Form/ChoiceLoader/EventChoiceLoader.php @@ -62,7 +62,7 @@ class EventChoiceLoader implements ChoiceLoaderInterface { return new \Symfony\Component\Form\ChoiceList\ArrayChoiceList( $this->lazyLoadedEvents, - static fn(Event $p) => call_user_func($value, $p) + static fn (Event $p) => call_user_func($value, $p) ); } diff --git a/src/Bundle/ChillEventBundle/Form/RoleType.php b/src/Bundle/ChillEventBundle/Form/RoleType.php index 2a0b6765a..519e814cf 100644 --- a/src/Bundle/ChillEventBundle/Form/RoleType.php +++ b/src/Bundle/ChillEventBundle/Form/RoleType.php @@ -38,7 +38,7 @@ class RoleType extends AbstractType ->add('active') ->add('type', EntityType::class, [ 'class' => EventType::class, - 'choice_label' => fn(EventType $e) => $this->translatableStringHelper->localize($e->getName()), + 'choice_label' => fn (EventType $e) => $this->translatableStringHelper->localize($e->getName()), ]); } diff --git a/src/Bundle/ChillEventBundle/Form/Type/PickEventType.php b/src/Bundle/ChillEventBundle/Form/Type/PickEventType.php index 1ec088ba6..05436b3e8 100644 --- a/src/Bundle/ChillEventBundle/Form/Type/PickEventType.php +++ b/src/Bundle/ChillEventBundle/Form/Type/PickEventType.php @@ -109,12 +109,12 @@ class PickEventType extends AbstractType // add the default options $resolver->setDefaults([ 'class' => Event::class, - 'choice_label' => static fn(Event $e) => $e->getDate()->format('d/m/Y, H:i') . ' → ' . + 'choice_label' => static fn (Event $e) => $e->getDate()->format('d/m/Y, H:i') . ' → ' . // $e->getType()->getName()['fr'] . ': ' . // display the type of event $e->getName(), 'placeholder' => 'Pick an event', 'attr' => ['class' => 'select2 '], - 'choice_attr' => static fn(Event $e) => ['data-center' => $e->getCenter()->getId()], + 'choice_attr' => static fn (Event $e) => ['data-center' => $e->getCenter()->getId()], 'choiceloader' => function (Options $options) { $centers = $this->filterCenters($options); @@ -139,7 +139,7 @@ class PickEventType extends AbstractType // option role if (null === $options['role']) { $centers = array_map( - static fn(GroupCenter $g) => $g->getCenter(), + static fn (GroupCenter $g) => $g->getCenter(), $this->user->getGroupCenters()->toArray() ); } else { @@ -167,7 +167,7 @@ class PickEventType extends AbstractType if ( !in_array($c->getId(), array_map( - static fn(Center $c) => $c->getId(), + static fn (Center $c) => $c->getId(), $centers ), true) ) { diff --git a/src/Bundle/ChillEventBundle/Form/Type/PickEventTypeType.php b/src/Bundle/ChillEventBundle/Form/Type/PickEventTypeType.php index 2ecdb27d7..d027c05cf 100644 --- a/src/Bundle/ChillEventBundle/Form/Type/PickEventTypeType.php +++ b/src/Bundle/ChillEventBundle/Form/Type/PickEventTypeType.php @@ -39,10 +39,10 @@ class PickEventTypeType extends AbstractType $resolver->setDefaults( [ 'class' => EventType::class, - 'query_builder' => static fn(EntityRepository $er) => $er->createQueryBuilder('et') + 'query_builder' => static fn (EntityRepository $er) => $er->createQueryBuilder('et') ->where('et.active = true'), - 'choice_label' => static fn(EventType $t) => $helper->localize($t->getName()), - 'choice_attrs' => static fn(EventType $t) => ['data-link-category' => $t->getId()], + 'choice_label' => static fn (EventType $t) => $helper->localize($t->getName()), + 'choice_attrs' => static fn (EventType $t) => ['data-link-category' => $t->getId()], ] ); } diff --git a/src/Bundle/ChillEventBundle/Form/Type/PickRoleType.php b/src/Bundle/ChillEventBundle/Form/Type/PickRoleType.php index ca6425dc8..8fd8ff7d7 100644 --- a/src/Bundle/ChillEventBundle/Form/Type/PickRoleType.php +++ b/src/Bundle/ChillEventBundle/Form/Type/PickRoleType.php @@ -80,7 +80,7 @@ class PickRoleType extends AbstractType $options = $config->getOptions(); $form->getParent()->add($name, $type, array_replace($options, [ - 'group_by' => fn(Role $r) => $this->translatableStringHelper->localize($r->getType()->getName()), + 'group_by' => fn (Role $r) => $this->translatableStringHelper->localize($r->getType()->getName()), ])); } } @@ -109,11 +109,11 @@ class PickRoleType extends AbstractType 'class' => Role::class, 'query_builder' => $qb, 'group_by' => null, - 'choice_attr' => static fn(Role $r) => [ + 'choice_attr' => static fn (Role $r) => [ 'data-event-type' => $r->getType()->getId(), 'data-link-category' => $r->getType()->getId(), ], - 'choice_label' => static fn(Role $r) => $translatableStringHelper->localize($r->getName()) . + 'choice_label' => static fn (Role $r) => $translatableStringHelper->localize($r->getName()) . ($r->getActive() === true ? '' : ' (' . $translator->trans('unactive') . ')'), ]); diff --git a/src/Bundle/ChillEventBundle/Form/Type/PickStatusType.php b/src/Bundle/ChillEventBundle/Form/Type/PickStatusType.php index b1078ab61..dcc3ba205 100644 --- a/src/Bundle/ChillEventBundle/Form/Type/PickStatusType.php +++ b/src/Bundle/ChillEventBundle/Form/Type/PickStatusType.php @@ -82,7 +82,7 @@ class PickStatusType extends AbstractType $type = $config->getType()->getName(); $options = $config->getOptions(); $form->getParent()->add($name, $type, array_replace($options, [ - 'group_by' => fn(Status $s) => $this->translatableStringHelper->localize($s->getType()->getName()), + 'group_by' => fn (Status $s) => $this->translatableStringHelper->localize($s->getType()->getName()), ])); } ); @@ -110,11 +110,11 @@ class PickStatusType extends AbstractType 'class' => Status::class, 'query_builder' => $qb, 'group_by' => null, - 'choice_attr' => static fn(Status $s) => [ + 'choice_attr' => static fn (Status $s) => [ 'data-event-type' => $s->getType()->getId(), 'data-link-category' => $s->getType()->getId(), ], - 'choice_label' => static fn(Status $s) => $translatableStringHelper->localize($s->getName()) . + 'choice_label' => static fn (Status $s) => $translatableStringHelper->localize($s->getName()) . ($s->getActive() === true ? '' : ' (' . $translator->trans('unactive') . ')'), ]); diff --git a/src/Bundle/ChillEventBundle/Tests/Controller/ParticipationControllerTest.php b/src/Bundle/ChillEventBundle/Tests/Controller/ParticipationControllerTest.php index 7c79e52e3..d61c1f385 100644 --- a/src/Bundle/ChillEventBundle/Tests/Controller/ParticipationControllerTest.php +++ b/src/Bundle/ChillEventBundle/Tests/Controller/ParticipationControllerTest.php @@ -239,7 +239,7 @@ final class ParticipationControllerTest extends WebTestCase $this->personsIdsCache = array_merge( $this->personsIdsCache, $event->getParticipations()->map( - static fn($p) => $p->getPerson()->getId() + static fn ($p) => $p->getPerson()->getId() ) ->toArray() ); @@ -303,7 +303,7 @@ final class ParticipationControllerTest extends WebTestCase $event = $this->getRandomEventWithMultipleParticipations(); $persons_id = implode(',', $event->getParticipations()->map( - static fn($p) => $p->getPerson()->getId() + static fn ($p) => $p->getPerson()->getId() )->toArray()); $crawler = $this->client->request( @@ -329,7 +329,7 @@ final class ParticipationControllerTest extends WebTestCase $nbParticipations = $event->getParticipations()->count(); // get the persons_id participating on this event $persons_id = $event->getParticipations()->map( - static fn($p) => $p->getPerson()->getId() + static fn ($p) => $p->getPerson()->getId() )->toArray(); // exclude the existing persons_ids from the new person $this->personsIdsCache = array_merge($this->personsIdsCache, $persons_id); @@ -458,7 +458,7 @@ final class ParticipationControllerTest extends WebTestCase $circles = $this->em->getRepository(\Chill\MainBundle\Entity\Scope::class) ->findAll(); - array_filter($circles, static fn($circle) => in_array($circleName, $circle->getName(), true)); + array_filter($circles, static fn ($circle) => in_array($circleName, $circle->getName(), true)); $circle = $circles[0]; $events = $this->em->getRepository(\Chill\EventBundle\Entity\Event::class) diff --git a/src/Bundle/ChillEventBundle/Timeline/TimelineEventProvider.php b/src/Bundle/ChillEventBundle/Timeline/TimelineEventProvider.php index a7bf08741..9fac6c88e 100644 --- a/src/Bundle/ChillEventBundle/Timeline/TimelineEventProvider.php +++ b/src/Bundle/ChillEventBundle/Timeline/TimelineEventProvider.php @@ -208,7 +208,7 @@ class TimelineEventProvider implements TimelineProviderInterface foreach ($reachableCenters as $center) { $reachableCircleId = array_map( - static fn(Scope $scope) => $scope->getId(), + static fn (Scope $scope) => $scope->getId(), $this->helper->getReachableCircles($this->user, $role, $person->getCenter()) ); $centerAndScopeLines[] = sprintf( diff --git a/src/Bundle/ChillMainBundle/CRUD/Routing/CRUDRoutesLoader.php b/src/Bundle/ChillMainBundle/CRUD/Routing/CRUDRoutesLoader.php index 01f80d1b8..4fbf5961d 100644 --- a/src/Bundle/ChillMainBundle/CRUD/Routing/CRUDRoutesLoader.php +++ b/src/Bundle/ChillMainBundle/CRUD/Routing/CRUDRoutesLoader.php @@ -141,7 +141,7 @@ class CRUDRoutesLoader extends Loader $methods = array_keys(array_filter( $action['methods'], - static fn($value, $key) => $value, + static fn ($value, $key) => $value, ARRAY_FILTER_USE_BOTH )); diff --git a/src/Bundle/ChillMainBundle/Controller/NotificationController.php b/src/Bundle/ChillMainBundle/Controller/NotificationController.php index 29ec6e7f0..327a06df6 100644 --- a/src/Bundle/ChillMainBundle/Controller/NotificationController.php +++ b/src/Bundle/ChillMainBundle/Controller/NotificationController.php @@ -282,7 +282,7 @@ class NotificationController extends AbstractController if ($request->query->has('edit')) { $commentId = $request->query->getInt('edit'); - $editedComment = $notification->getComments()->filter(static fn(NotificationComment $c) => $c->getId() === $commentId)->first(); + $editedComment = $notification->getComments()->filter(static fn (NotificationComment $c) => $c->getId() === $commentId)->first(); if (false === $editedComment) { throw $this->createNotFoundException("Comment with id {$commentId} does not exists nor belong to this notification"); diff --git a/src/Bundle/ChillMainBundle/Controller/PermissionsGroupController.php b/src/Bundle/ChillMainBundle/Controller/PermissionsGroupController.php index 3292b3540..5d32a8dbb 100644 --- a/src/Bundle/ChillMainBundle/Controller/PermissionsGroupController.php +++ b/src/Bundle/ChillMainBundle/Controller/PermissionsGroupController.php @@ -158,7 +158,7 @@ class PermissionsGroupController extends AbstractController 'edit_form' => $editForm->createView(), 'role_scopes_sorted' => $roleScopesSorted, 'expanded_roles' => $this->getExpandedRoles($permissionsGroup->getRoleScopes()->toArray()), - 'delete_role_scopes_form' => array_map(static fn($form) => $form->createView(), $deleteRoleScopesForm), + 'delete_role_scopes_form' => array_map(static fn ($form) => $form->createView(), $deleteRoleScopesForm), 'add_role_scopes_form' => $addRoleScopesForm->createView(), ]); } @@ -303,7 +303,7 @@ class PermissionsGroupController extends AbstractController 'role_scopes_sorted' => $roleScopesSorted, 'edit_form' => $editForm->createView(), 'expanded_roles' => $this->getExpandedRoles($permissionsGroup->getRoleScopes()->toArray()), - 'delete_role_scopes_form' => array_map(static fn($form) => $form->createView(), $deleteRoleScopesForm), + 'delete_role_scopes_form' => array_map(static fn ($form) => $form->createView(), $deleteRoleScopesForm), 'add_role_scopes_form' => $addRoleScopesForm->createView(), ]); } @@ -445,7 +445,7 @@ class PermissionsGroupController extends AbstractController 'role_scopes_sorted' => $roleScopesSorted, 'edit_form' => $editForm->createView(), 'expanded_roles' => $this->getExpandedRoles($permissionsGroup->getRoleScopes()->toArray()), - 'delete_role_scopes_form' => array_map(static fn($form) => $form->createView(), $deleteRoleScopesForm), + 'delete_role_scopes_form' => array_map(static fn ($form) => $form->createView(), $deleteRoleScopesForm), 'add_role_scopes_form' => $addRoleScopesForm->createView(), ]); } @@ -567,7 +567,7 @@ class PermissionsGroupController extends AbstractController if (!array_key_exists($roleScope->getRole(), $expandedRoles)) { $expandedRoles[$roleScope->getRole()] = array_map( - static fn(Role $role) => $role->getRole(), + static fn (Role $role) => $role->getRole(), $this->roleHierarchy ->getReachableRoles( [new Role($roleScope->getRole())] diff --git a/src/Bundle/ChillMainBundle/Controller/UserController.php b/src/Bundle/ChillMainBundle/Controller/UserController.php index 64cef168d..ecf8a3c9c 100644 --- a/src/Bundle/ChillMainBundle/Controller/UserController.php +++ b/src/Bundle/ChillMainBundle/Controller/UserController.php @@ -337,12 +337,13 @@ class UserController extends CRUDController [ 'add_groupcenter_form' => $this->createAddLinkGroupCenterForm($entity, $request)->createView(), 'delete_groupcenter_form' => array_map( - static fn(Form $form) => $form->createView(), + static fn (Form $form) => $form->createView(), iterator_to_array($this->getDeleteLinkGroupCenterByUser($entity, $request), true) ), ] ); - } elseif ('index' === $action) { + } + if ('index' === $action) { return array_merge( ['allow_change_password' => $this->parameterBag->get('chill_main.access_user_change_password')], $defaultTemplateParameters diff --git a/src/Bundle/ChillMainBundle/Controller/WorkflowController.php b/src/Bundle/ChillMainBundle/Controller/WorkflowController.php index af4974bbe..36647612b 100644 --- a/src/Bundle/ChillMainBundle/Controller/WorkflowController.php +++ b/src/Bundle/ChillMainBundle/Controller/WorkflowController.php @@ -345,7 +345,7 @@ class WorkflowController extends AbstractController if ($transitionForm->isSubmitted() && $transitionForm->isValid()) { if (!$workflow->can($entityWorkflow, $transition = $transitionForm['transition']->getData()->getName())) { $blockers = $workflow->buildTransitionBlockerList($entityWorkflow, $transition); - $msgs = array_map(fn(TransitionBlocker $tb) => $this->translator->trans( + $msgs = array_map(fn (TransitionBlocker $tb) => $this->translator->trans( $tb->getMessage(), $tb->getParameters() ), iterator_to_array($blockers)); diff --git a/src/Bundle/ChillMainBundle/DependencyInjection/CompilerPass/MenuCompilerPass.php b/src/Bundle/ChillMainBundle/DependencyInjection/CompilerPass/MenuCompilerPass.php index da2cbff1f..d6a27c943 100644 --- a/src/Bundle/ChillMainBundle/DependencyInjection/CompilerPass/MenuCompilerPass.php +++ b/src/Bundle/ChillMainBundle/DependencyInjection/CompilerPass/MenuCompilerPass.php @@ -37,7 +37,7 @@ class MenuCompilerPass implements CompilerPassInterface ]; } - usort($services, static fn($a, $b) => $a['priority'] <=> $b['priority']); + usort($services, static fn ($a, $b) => $a['priority'] <=> $b['priority']); foreach ($services as $service) { $class = $container->getDefinition($service['id'])->getClass(); diff --git a/src/Bundle/ChillMainBundle/Doctrine/DQL/Greatest.php b/src/Bundle/ChillMainBundle/Doctrine/DQL/Greatest.php index a56bcb50c..c76bd22cf 100644 --- a/src/Bundle/ChillMainBundle/Doctrine/DQL/Greatest.php +++ b/src/Bundle/ChillMainBundle/Doctrine/DQL/Greatest.php @@ -33,7 +33,7 @@ class Greatest extends FunctionNode public function getSql(SqlWalker $sqlWalker) { - return 'GREATEST(' . implode(', ', array_map(static fn(Node $expr) => $expr->dispatch($sqlWalker), $this->exprs)) . ')'; + return 'GREATEST(' . implode(', ', array_map(static fn (Node $expr) => $expr->dispatch($sqlWalker), $this->exprs)) . ')'; } public function parse(Parser $parser) diff --git a/src/Bundle/ChillMainBundle/Doctrine/DQL/Least.php b/src/Bundle/ChillMainBundle/Doctrine/DQL/Least.php index e31d31456..9befa5f40 100644 --- a/src/Bundle/ChillMainBundle/Doctrine/DQL/Least.php +++ b/src/Bundle/ChillMainBundle/Doctrine/DQL/Least.php @@ -33,7 +33,7 @@ class Least extends FunctionNode public function getSql(SqlWalker $sqlWalker) { - return 'LEAST(' . implode(', ', array_map(static fn(Node $expr) => $expr->dispatch($sqlWalker), $this->exprs)) . ')'; + return 'LEAST(' . implode(', ', array_map(static fn (Node $expr) => $expr->dispatch($sqlWalker), $this->exprs)) . ')'; } public function parse(Parser $parser) diff --git a/src/Bundle/ChillMainBundle/Entity/PermissionsGroup.php b/src/Bundle/ChillMainBundle/Entity/PermissionsGroup.php index 34e22d3e1..6c0d0be5b 100644 --- a/src/Bundle/ChillMainBundle/Entity/PermissionsGroup.php +++ b/src/Bundle/ChillMainBundle/Entity/PermissionsGroup.php @@ -121,7 +121,7 @@ class PermissionsGroup public function isRoleScopePresentOnce(ExecutionContextInterface $context) { $roleScopesId = array_map( - static fn(RoleScope $roleScope) => $roleScope->getId(), + static fn (RoleScope $roleScope) => $roleScope->getId(), $this->getRoleScopes()->toArray() ); $countedIds = array_count_values($roleScopesId); diff --git a/src/Bundle/ChillMainBundle/Entity/Workflow/EntityWorkflowStep.php b/src/Bundle/ChillMainBundle/Entity/Workflow/EntityWorkflowStep.php index f94a154db..1f3070eb2 100644 --- a/src/Bundle/ChillMainBundle/Entity/Workflow/EntityWorkflowStep.php +++ b/src/Bundle/ChillMainBundle/Entity/Workflow/EntityWorkflowStep.php @@ -291,7 +291,7 @@ class EntityWorkflowStep public function removeDestEmail(string $email): self { - $this->destEmail = array_filter($this->destEmail, static fn(string $existing) => $email !== $existing); + $this->destEmail = array_filter($this->destEmail, static fn (string $existing) => $email !== $existing); return $this; } diff --git a/src/Bundle/ChillMainBundle/Export/Formatter/CSVListFormatter.php b/src/Bundle/ChillMainBundle/Export/Formatter/CSVListFormatter.php index a6b7094e4..b84c80118 100644 --- a/src/Bundle/ChillMainBundle/Export/Formatter/CSVListFormatter.php +++ b/src/Bundle/ChillMainBundle/Export/Formatter/CSVListFormatter.php @@ -199,7 +199,7 @@ class CSVListFormatter implements FormatterInterface foreach ($keys as $key) { // get an array with all values for this key if possible - $values = array_map(static fn($v) => $v[$key], $this->result); + $values = array_map(static fn ($v) => $v[$key], $this->result); // store the label in the labelsCache property $this->labelsCache[$key] = $export->getLabels($key, $values, $this->exportData); } diff --git a/src/Bundle/ChillMainBundle/Export/Formatter/CSVPivotedListFormatter.php b/src/Bundle/ChillMainBundle/Export/Formatter/CSVPivotedListFormatter.php index 87814eb47..63d691443 100644 --- a/src/Bundle/ChillMainBundle/Export/Formatter/CSVPivotedListFormatter.php +++ b/src/Bundle/ChillMainBundle/Export/Formatter/CSVPivotedListFormatter.php @@ -187,7 +187,7 @@ class CSVPivotedListFormatter implements FormatterInterface foreach ($keys as $key) { // get an array with all values for this key if possible - $values = array_map(static fn($v) => $v[$key], $this->result); + $values = array_map(static fn ($v) => $v[$key], $this->result); // store the label in the labelsCache property $this->labelsCache[$key] = $export->getLabels($key, $values, $this->exportData); } diff --git a/src/Bundle/ChillMainBundle/Export/Helper/ExportAddressHelper.php b/src/Bundle/ChillMainBundle/Export/Helper/ExportAddressHelper.php index 99f78fe80..fca338a6f 100644 --- a/src/Bundle/ChillMainBundle/Export/Helper/ExportAddressHelper.php +++ b/src/Bundle/ChillMainBundle/Export/Helper/ExportAddressHelper.php @@ -257,7 +257,7 @@ class ExportAddressHelper $prefixes = array_merge( $prefixes, array_map( - static fn($item) => $prefix . $item, + static fn ($item) => $prefix . $item, self::COLUMN_MAPPING[$key] ) ); diff --git a/src/Bundle/ChillMainBundle/Form/ChoiceLoader/PostalCodeChoiceLoader.php b/src/Bundle/ChillMainBundle/Form/ChoiceLoader/PostalCodeChoiceLoader.php index 99fb54514..174fb3304 100644 --- a/src/Bundle/ChillMainBundle/Form/ChoiceLoader/PostalCodeChoiceLoader.php +++ b/src/Bundle/ChillMainBundle/Form/ChoiceLoader/PostalCodeChoiceLoader.php @@ -48,7 +48,7 @@ class PostalCodeChoiceLoader implements ChoiceLoaderInterface { return new \Symfony\Component\Form\ChoiceList\ArrayChoiceList( $this->lazyLoadedPostalCodes, - static fn(?PostalCode $pc = null) => call_user_func($value, $pc) + static fn (?PostalCode $pc = null) => call_user_func($value, $pc) ); } diff --git a/src/Bundle/ChillMainBundle/Form/DataMapper/ExportPickCenterDataMapper.php b/src/Bundle/ChillMainBundle/Form/DataMapper/ExportPickCenterDataMapper.php index 90c919f1d..01303bfbb 100644 --- a/src/Bundle/ChillMainBundle/Form/DataMapper/ExportPickCenterDataMapper.php +++ b/src/Bundle/ChillMainBundle/Form/DataMapper/ExportPickCenterDataMapper.php @@ -37,7 +37,7 @@ class ExportPickCenterDataMapper implements DataMapperInterface foreach ($this->regroupmentRepository->findAll() as $regroupment) { /** @phpstan-ignore-next-line */ - [$contained, $notContained] = $regroupment->getCenters()->partition(static fn(Center $center): bool => false); + [$contained, $notContained] = $regroupment->getCenters()->partition(static fn (Center $center): bool => false); if (0 === count($notContained)) { $pickedRegroupment[] = $regroupment; diff --git a/src/Bundle/ChillMainBundle/Form/DataTransformer/IdToEntityDataTransformer.php b/src/Bundle/ChillMainBundle/Form/DataTransformer/IdToEntityDataTransformer.php index 4d89f7851..6aa5eee40 100644 --- a/src/Bundle/ChillMainBundle/Form/DataTransformer/IdToEntityDataTransformer.php +++ b/src/Bundle/ChillMainBundle/Form/DataTransformer/IdToEntityDataTransformer.php @@ -42,7 +42,7 @@ class IdToEntityDataTransformer implements DataTransformerInterface { $this->repository = $repository; $this->multiple = $multiple; - $this->getId = $getId ?? static fn(object $o) => $o->getId(); + $this->getId = $getId ?? static fn (object $o) => $o->getId(); } /** diff --git a/src/Bundle/ChillMainBundle/Form/LocationFormType.php b/src/Bundle/ChillMainBundle/Form/LocationFormType.php index 3cf599a52..ff2c563d3 100644 --- a/src/Bundle/ChillMainBundle/Form/LocationFormType.php +++ b/src/Bundle/ChillMainBundle/Form/LocationFormType.php @@ -36,11 +36,11 @@ final class LocationFormType extends AbstractType $builder ->add('locationType', EntityType::class, [ 'class' => EntityLocationType::class, - 'choice_attr' => static fn(EntityLocationType $entity) => [ + 'choice_attr' => static fn (EntityLocationType $entity) => [ 'data-address' => $entity->getAddressRequired(), 'data-contact' => $entity->getContactData(), ], - 'choice_label' => fn(EntityLocationType $entity) => $this->translatableStringHelper->localize($entity->getTitle()), + 'choice_label' => fn (EntityLocationType $entity) => $this->translatableStringHelper->localize($entity->getTitle()), ]) ->add('name', TextType::class) ->add('phonenumber1', ChillPhoneNumberType::class, ['required' => false]) diff --git a/src/Bundle/ChillMainBundle/Form/Type/ComposedGroupCenterType.php b/src/Bundle/ChillMainBundle/Form/Type/ComposedGroupCenterType.php index fdd24eb3f..48bd37dcc 100644 --- a/src/Bundle/ChillMainBundle/Form/Type/ComposedGroupCenterType.php +++ b/src/Bundle/ChillMainBundle/Form/Type/ComposedGroupCenterType.php @@ -24,10 +24,10 @@ class ComposedGroupCenterType extends AbstractType { $builder->add('permissionsgroup', EntityType::class, [ 'class' => \Chill\MainBundle\Entity\PermissionsGroup::class, - 'choice_label' => static fn(PermissionsGroup $group) => $group->getName(), + 'choice_label' => static fn (PermissionsGroup $group) => $group->getName(), ])->add('center', EntityType::class, [ 'class' => \Chill\MainBundle\Entity\Center::class, - 'choice_label' => static fn(Center $center) => $center->getName(), + 'choice_label' => static fn (Center $center) => $center->getName(), ]); } diff --git a/src/Bundle/ChillMainBundle/Form/Type/ComposedRoleScopeType.php b/src/Bundle/ChillMainBundle/Form/Type/ComposedRoleScopeType.php index 4424cccf3..970787cd1 100644 --- a/src/Bundle/ChillMainBundle/Form/Type/ComposedRoleScopeType.php +++ b/src/Bundle/ChillMainBundle/Form/Type/ComposedRoleScopeType.php @@ -82,11 +82,11 @@ class ComposedRoleScopeType extends AbstractType return ['data-has-scope' => '1']; }, - 'group_by' => fn($role, $key, $index) => $this->roleProvider->getRoleTitle($role), + 'group_by' => fn ($role, $key, $index) => $this->roleProvider->getRoleTitle($role), ]) ->add('scope', EntityType::class, [ 'class' => Scope::class, - 'choice_label' => static fn(Scope $scope) => $translatableStringHelper->localize($scope->getName()), + 'choice_label' => static fn (Scope $scope) => $translatableStringHelper->localize($scope->getName()), 'required' => false, 'data' => null, ]); diff --git a/src/Bundle/ChillMainBundle/Form/Type/DataTransformer/EntityToJsonTransformer.php b/src/Bundle/ChillMainBundle/Form/Type/DataTransformer/EntityToJsonTransformer.php index 24e3ffc5b..529bd9789 100644 --- a/src/Bundle/ChillMainBundle/Form/Type/DataTransformer/EntityToJsonTransformer.php +++ b/src/Bundle/ChillMainBundle/Form/Type/DataTransformer/EntityToJsonTransformer.php @@ -51,7 +51,7 @@ class EntityToJsonTransformer implements DataTransformerInterface } return array_map( - fn($item) => $this->denormalizeOne($item), + fn ($item) => $this->denormalizeOne($item), $denormalized ); } diff --git a/src/Bundle/ChillMainBundle/Form/Type/Export/PickCenterType.php b/src/Bundle/ChillMainBundle/Form/Type/Export/PickCenterType.php index 7a1ebcaf5..c89907cf3 100644 --- a/src/Bundle/ChillMainBundle/Form/Type/Export/PickCenterType.php +++ b/src/Bundle/ChillMainBundle/Form/Type/Export/PickCenterType.php @@ -67,7 +67,7 @@ final class PickCenterType extends AbstractType 'choices' => $centers, 'multiple' => true, 'expanded' => true, - 'choice_label' => static fn(Center $c) => $c->getName(), + 'choice_label' => static fn (Center $c) => $c->getName(), 'data' => $centers, ]); @@ -78,7 +78,7 @@ final class PickCenterType extends AbstractType 'multiple' => true, 'expanded' => true, 'choices' => $this->regroupmentRepository->findAllActive(), - 'choice_label' => static fn(Regroupment $r) => $r->getName(), + 'choice_label' => static fn (Regroupment $r) => $r->getName(), ]); } diff --git a/src/Bundle/ChillMainBundle/Form/Type/PickCenterType.php b/src/Bundle/ChillMainBundle/Form/Type/PickCenterType.php index b977dd102..83e957623 100644 --- a/src/Bundle/ChillMainBundle/Form/Type/PickCenterType.php +++ b/src/Bundle/ChillMainBundle/Form/Type/PickCenterType.php @@ -90,7 +90,7 @@ class PickCenterType extends AbstractType return ['center' => $data]; }, - static fn($data) => $data['center'] + static fn ($data) => $data['center'] )); } diff --git a/src/Bundle/ChillMainBundle/Form/Type/PickCivilityType.php b/src/Bundle/ChillMainBundle/Form/Type/PickCivilityType.php index c5e0f7d80..adb0f2a67 100644 --- a/src/Bundle/ChillMainBundle/Form/Type/PickCivilityType.php +++ b/src/Bundle/ChillMainBundle/Form/Type/PickCivilityType.php @@ -34,11 +34,11 @@ class PickCivilityType extends AbstractType ->setDefault('label', 'Civility') ->setDefault( 'choice_label', - fn(Civility $civility): string => $this->translatableStringHelper->localize($civility->getName()) + fn (Civility $civility): string => $this->translatableStringHelper->localize($civility->getName()) ) ->setDefault( 'query_builder', - static fn(EntityRepository $er): QueryBuilder => $er->createQueryBuilder('c') + static fn (EntityRepository $er): QueryBuilder => $er->createQueryBuilder('c') ->where('c.active = true') ->orderBy('c.order'), ) diff --git a/src/Bundle/ChillMainBundle/Form/Type/PickLocationTypeType.php b/src/Bundle/ChillMainBundle/Form/Type/PickLocationTypeType.php index 0763e485e..3d993c9f1 100644 --- a/src/Bundle/ChillMainBundle/Form/Type/PickLocationTypeType.php +++ b/src/Bundle/ChillMainBundle/Form/Type/PickLocationTypeType.php @@ -31,7 +31,7 @@ class PickLocationTypeType extends AbstractType $resolver ->setDefaults([ 'class' => LocationType::class, - 'choice_label' => fn(LocationType $type) => $this->translatableStringHelper->localize($type->getTitle()), + 'choice_label' => fn (LocationType $type) => $this->translatableStringHelper->localize($type->getTitle()), 'placeholder' => 'Pick a location type', 'required' => false, 'attr' => ['class' => 'select2'], diff --git a/src/Bundle/ChillMainBundle/Form/Type/PickUserLocationType.php b/src/Bundle/ChillMainBundle/Form/Type/PickUserLocationType.php index bd19e5f29..d78957f29 100644 --- a/src/Bundle/ChillMainBundle/Form/Type/PickUserLocationType.php +++ b/src/Bundle/ChillMainBundle/Form/Type/PickUserLocationType.php @@ -36,7 +36,7 @@ class PickUserLocationType extends AbstractType ->setDefaults([ 'class' => Location::class, 'choices' => $this->locationRepository->findByPublicLocations(), - 'choice_label' => fn(Location $entity) => $entity->getName() ? + 'choice_label' => fn (Location $entity) => $entity->getName() ? $entity->getName() . ' (' . $this->translatableStringHelper->localize($entity->getLocationType()->getTitle()) . ')' : $this->translatableStringHelper->localize($entity->getLocationType()->getTitle()), 'placeholder' => 'Pick a location', diff --git a/src/Bundle/ChillMainBundle/Form/Type/PostalCodeType.php b/src/Bundle/ChillMainBundle/Form/Type/PostalCodeType.php index a611f3da9..51a321be6 100644 --- a/src/Bundle/ChillMainBundle/Form/Type/PostalCodeType.php +++ b/src/Bundle/ChillMainBundle/Form/Type/PostalCodeType.php @@ -77,7 +77,7 @@ class PostalCodeType extends AbstractType $helper = $this->translatableStringHelper; $resolver ->setDefault('class', PostalCode::class) - ->setDefault('choice_label', static fn(PostalCode $code) => $code->getCode() . ' ' . $code->getName() . ' [' . + ->setDefault('choice_label', static fn (PostalCode $code) => $code->getCode() . ' ' . $code->getName() . ' [' . $helper->localize($code->getCountry()->getName()) . ']') ->setDefault('choice_loader', $this->choiceLoader) ->setDefault('placeholder', 'Select a postal code'); diff --git a/src/Bundle/ChillMainBundle/Form/Type/ScopePickerType.php b/src/Bundle/ChillMainBundle/Form/Type/ScopePickerType.php index 77bf84cca..4d04b9f03 100644 --- a/src/Bundle/ChillMainBundle/Form/Type/ScopePickerType.php +++ b/src/Bundle/ChillMainBundle/Form/Type/ScopePickerType.php @@ -66,7 +66,7 @@ class ScopePickerType extends AbstractType $options['role'] instanceof Role ? $options['role']->getRole() : $options['role'], $options['center'] ), - static fn(Scope $s) => $s->isActive() + static fn (Scope $s) => $s->isActive() ); if (0 === count($items)) { @@ -77,7 +77,7 @@ class ScopePickerType extends AbstractType $builder->add('scope', EntityType::class, [ 'class' => Scope::class, 'placeholder' => 'Choose the circle', - 'choice_label' => fn(Scope $c) => $this->translatableStringHelper->localize($c->getName()), + 'choice_label' => fn (Scope $c) => $this->translatableStringHelper->localize($c->getName()), 'choices' => $items, ]); $builder->setDataMapper(new ScopePickerDataMapper()); diff --git a/src/Bundle/ChillMainBundle/Form/Type/UserPickerType.php b/src/Bundle/ChillMainBundle/Form/Type/UserPickerType.php index 974ef4566..c430a1053 100644 --- a/src/Bundle/ChillMainBundle/Form/Type/UserPickerType.php +++ b/src/Bundle/ChillMainBundle/Form/Type/UserPickerType.php @@ -79,7 +79,7 @@ class UserPickerType extends AbstractType ->setAllowedTypes('having_permissions_group_flag', ['string', 'null']) ->setDefault('class', User::class) ->setDefault('placeholder', 'Choose an user') - ->setDefault('choice_label', fn(User $u) => $this->userRender->renderString($u, [])) + ->setDefault('choice_label', fn (User $u) => $this->userRender->renderString($u, [])) ->setDefault('scope', null) ->setAllowedTypes('scope', [Scope::class, 'array', 'null']) ->setNormalizer('choices', function (Options $options) { diff --git a/src/Bundle/ChillMainBundle/Form/UserType.php b/src/Bundle/ChillMainBundle/Form/UserType.php index e343b0fc4..f8485aa99 100644 --- a/src/Bundle/ChillMainBundle/Form/UserType.php +++ b/src/Bundle/ChillMainBundle/Form/UserType.php @@ -77,14 +77,14 @@ class UserType extends AbstractType 'required' => false, 'placeholder' => 'Choose a main scope', 'class' => Scope::class, - 'choice_label' => fn(Scope $c) => $this->translatableStringHelper->localize($c->getName()), + 'choice_label' => fn (Scope $c) => $this->translatableStringHelper->localize($c->getName()), ]) ->add('userJob', EntityType::class, [ 'label' => 'user job', 'required' => false, 'placeholder' => 'choose a job', 'class' => UserJob::class, - 'choice_label' => fn(UserJob $c) => $this->translatableStringHelper->localize($c->getLabel()), + 'choice_label' => fn (UserJob $c) => $this->translatableStringHelper->localize($c->getLabel()), 'query_builder' => static function (EntityRepository $er) { $qb = $er->createQueryBuilder('uj'); $qb->where('uj.active = TRUE'); @@ -97,7 +97,7 @@ class UserType extends AbstractType 'required' => false, 'placeholder' => 'choose a location', 'class' => Location::class, - 'choice_label' => fn(Location $l) => $this->translatableStringHelper->localize($l->getLocationType()->getTitle()) . ' - ' . $l->getName(), + 'choice_label' => fn (Location $l) => $this->translatableStringHelper->localize($l->getLocationType()->getTitle()) . ' - ' . $l->getName(), 'query_builder' => static function (EntityRepository $er) { $qb = $er->createQueryBuilder('l'); $qb->orderBy('l.locationType'); diff --git a/src/Bundle/ChillMainBundle/Form/WorkflowStepType.php b/src/Bundle/ChillMainBundle/Form/WorkflowStepType.php index 0e6e12b3e..b3d498610 100644 --- a/src/Bundle/ChillMainBundle/Form/WorkflowStepType.php +++ b/src/Bundle/ChillMainBundle/Form/WorkflowStepType.php @@ -69,7 +69,7 @@ class WorkflowStepType extends AbstractType $choices = array_combine( array_map( - static fn(Transition $transition) => $transition->getName(), + static fn (Transition $transition) => $transition->getName(), $transitions ), $transitions @@ -86,8 +86,8 @@ class WorkflowStepType extends AbstractType 'backward' => 'backward', 'neutral' => 'neutral', ], - 'choice_label' => fn(string $key) => $this->translatableStringHelper->localize($inputLabels[$key]), - 'choice_attr' => static fn(string $key) => [ + 'choice_label' => fn (string $key) => $this->translatableStringHelper->localize($inputLabels[$key]), + 'choice_attr' => static fn (string $key) => [ $key => $key, ], 'mapped' => false, diff --git a/src/Bundle/ChillMainBundle/Search/SearchProvider.php b/src/Bundle/ChillMainBundle/Search/SearchProvider.php index e96f531e2..7ebb5ed87 100644 --- a/src/Bundle/ChillMainBundle/Search/SearchProvider.php +++ b/src/Bundle/ChillMainBundle/Search/SearchProvider.php @@ -90,7 +90,7 @@ class SearchProvider public function getByOrder() { //sort the array - uasort($this->searchServices, static fn(SearchInterface $a, SearchInterface $b) => $a->getOrder() <=> $b->getOrder()); + uasort($this->searchServices, static fn (SearchInterface $a, SearchInterface $b) => $a->getOrder() <=> $b->getOrder()); return $this->searchServices; } diff --git a/src/Bundle/ChillMainBundle/Service/Import/AddressReferenceBEFromBestAddress.php b/src/Bundle/ChillMainBundle/Service/Import/AddressReferenceBEFromBestAddress.php index a52379faa..c06ded0a8 100644 --- a/src/Bundle/ChillMainBundle/Service/Import/AddressReferenceBEFromBestAddress.php +++ b/src/Bundle/ChillMainBundle/Service/Import/AddressReferenceBEFromBestAddress.php @@ -54,7 +54,7 @@ class AddressReferenceBEFromBestAddress throw new RuntimeException('could not get the release definition', 0, $e); } - $asset = array_filter($release['assets'], static fn(array $item) => 'addresses-' . $list . '.' . $lang . '.csv.gz' === $item['name']); + $asset = array_filter($release['assets'], static fn (array $item) => 'addresses-' . $list . '.' . $lang . '.csv.gz' === $item['name']); return array_values($asset)[0]['browser_download_url']; } diff --git a/src/Bundle/ChillMainBundle/Service/Import/PostalCodeBEFromBestAddress.php b/src/Bundle/ChillMainBundle/Service/Import/PostalCodeBEFromBestAddress.php index 4bca126a6..aa04c9ac3 100644 --- a/src/Bundle/ChillMainBundle/Service/Import/PostalCodeBEFromBestAddress.php +++ b/src/Bundle/ChillMainBundle/Service/Import/PostalCodeBEFromBestAddress.php @@ -82,7 +82,7 @@ class PostalCodeBEFromBestAddress throw new RuntimeException('could not get the release definition', 0, $e); } - $postals = array_filter($release['assets'], static fn(array $item) => 'postals.' . $lang . '.csv.gz' === $item['name']); + $postals = array_filter($release['assets'], static fn (array $item) => 'postals.' . $lang . '.csv.gz' === $item['name']); return array_values($postals)[0]['browser_download_url']; } diff --git a/src/Bundle/ChillMainBundle/Service/Mailer/ChillMailer.php b/src/Bundle/ChillMainBundle/Service/Mailer/ChillMailer.php index c6246213f..36374c6af 100644 --- a/src/Bundle/ChillMainBundle/Service/Mailer/ChillMailer.php +++ b/src/Bundle/ChillMainBundle/Service/Mailer/ChillMailer.php @@ -39,7 +39,7 @@ class ChillMailer implements MailerInterface } $this->chillLogger->info('chill email sent', [ - 'to' => array_map(static fn(Address $address) => $address->getAddress(), $message->getTo()), + 'to' => array_map(static fn (Address $address) => $address->getAddress(), $message->getTo()), 'subject' => $message->getSubject(), ]); diff --git a/src/Bundle/ChillMainBundle/Tests/Entity/NotificationTest.php b/src/Bundle/ChillMainBundle/Tests/Entity/NotificationTest.php index 051d04591..d641b94a8 100644 --- a/src/Bundle/ChillMainBundle/Tests/Entity/NotificationTest.php +++ b/src/Bundle/ChillMainBundle/Tests/Entity/NotificationTest.php @@ -134,7 +134,7 @@ final class NotificationTest extends KernelTestCase $this->assertEquals($senderId, $notification->getSender()->getId()); $this->assertCount(count($addressesIds), $notification->getUnreadBy()); - $unreadIds = $notification->getUnreadBy()->map(static fn(User $u) => $u->getId()); + $unreadIds = $notification->getUnreadBy()->map(static fn (User $u) => $u->getId()); foreach ($addressesIds as $addresseeId) { $this->assertContains($addresseeId, $unreadIds); diff --git a/src/Bundle/ChillMainBundle/Tests/Form/Type/ScopePickerTypeTest.php b/src/Bundle/ChillMainBundle/Tests/Form/Type/ScopePickerTypeTest.php index 42f6d71d8..0e37f0fde 100644 --- a/src/Bundle/ChillMainBundle/Tests/Form/Type/ScopePickerTypeTest.php +++ b/src/Bundle/ChillMainBundle/Tests/Form/Type/ScopePickerTypeTest.php @@ -96,7 +96,7 @@ final class ScopePickerTypeTest extends TypeTestCase $translatableStringHelper = $this->prophesize(TranslatableStringHelperInterface::class); $translatableStringHelper->localize(Argument::type('array'))->will( - static fn($args) => $args[0]['fr'] + static fn ($args) => $args[0]['fr'] ); $type = new ScopePickerType( diff --git a/src/Bundle/ChillMainBundle/Tests/Search/Utils/ExtractDateFromPatternTest.php b/src/Bundle/ChillMainBundle/Tests/Search/Utils/ExtractDateFromPatternTest.php index 5f79494a3..49419f261 100644 --- a/src/Bundle/ChillMainBundle/Tests/Search/Utils/ExtractDateFromPatternTest.php +++ b/src/Bundle/ChillMainBundle/Tests/Search/Utils/ExtractDateFromPatternTest.php @@ -52,7 +52,7 @@ final class ExtractDateFromPatternTest extends TestCase $this->assertContainsOnlyInstancesOf(DateTimeImmutable::class, $result->getFound()); $dates = array_map( - static fn(DateTimeImmutable $d) => $d->format('Y-m-d'), + static fn (DateTimeImmutable $d) => $d->format('Y-m-d'), $result->getFound() ); diff --git a/src/Bundle/ChillMainBundle/Tests/Security/Authorization/AuthorizationHelperTest.php b/src/Bundle/ChillMainBundle/Tests/Security/Authorization/AuthorizationHelperTest.php index 657e37e36..8c681bfb0 100644 --- a/src/Bundle/ChillMainBundle/Tests/Security/Authorization/AuthorizationHelperTest.php +++ b/src/Bundle/ChillMainBundle/Tests/Security/Authorization/AuthorizationHelperTest.php @@ -211,7 +211,7 @@ final class AuthorizationHelperTest extends KernelTestCase $centerA ); - $usernames = array_map(static fn(User $u) => $u->getUsername(), $users); + $usernames = array_map(static fn (User $u) => $u->getUsername(), $users); $this->assertContains('center a_social', $usernames); } diff --git a/src/Bundle/ChillMainBundle/Workflow/EventSubscriber/EntityWorkflowTransitionEventSubscriber.php b/src/Bundle/ChillMainBundle/Workflow/EventSubscriber/EntityWorkflowTransitionEventSubscriber.php index dfe47ecc8..f3e04eeca 100644 --- a/src/Bundle/ChillMainBundle/Workflow/EventSubscriber/EntityWorkflowTransitionEventSubscriber.php +++ b/src/Bundle/ChillMainBundle/Workflow/EventSubscriber/EntityWorkflowTransitionEventSubscriber.php @@ -105,7 +105,7 @@ class EntityWorkflowTransitionEventSubscriber implements EventSubscriberInterfac [ '%users%' => implode( ', ', - $entityWorkflow->getCurrentStep()->getAllDestUser()->map(fn(User $u) => $this->userRender->renderString($u, []))->toArray() + $entityWorkflow->getCurrentStep()->getAllDestUser()->map(fn (User $u) => $this->userRender->renderString($u, []))->toArray() ), ] )); diff --git a/src/Bundle/ChillMainBundle/Workflow/EventSubscriber/NotificationOnTransition.php b/src/Bundle/ChillMainBundle/Workflow/EventSubscriber/NotificationOnTransition.php index dc9657e3c..76ad4a4b0 100644 --- a/src/Bundle/ChillMainBundle/Workflow/EventSubscriber/NotificationOnTransition.php +++ b/src/Bundle/ChillMainBundle/Workflow/EventSubscriber/NotificationOnTransition.php @@ -109,7 +109,7 @@ class NotificationOnTransition implements EventSubscriberInterface 'dest' => $subscriber, 'place' => $place, 'workflow' => $workflow, - 'is_dest' => in_array($subscriber->getId(), array_map(static fn(User $u) => $u->getId(), $entityWorkflow->futureDestUsers), true), + 'is_dest' => in_array($subscriber->getId(), array_map(static fn (User $u) => $u->getId(), $entityWorkflow->futureDestUsers), true), ]; $notification = new Notification(); diff --git a/src/Bundle/ChillMainBundle/Workflow/Validator/EntityWorkflowCreationValidator.php b/src/Bundle/ChillMainBundle/Workflow/Validator/EntityWorkflowCreationValidator.php index 6ab44f625..bb3586251 100644 --- a/src/Bundle/ChillMainBundle/Workflow/Validator/EntityWorkflowCreationValidator.php +++ b/src/Bundle/ChillMainBundle/Workflow/Validator/EntityWorkflowCreationValidator.php @@ -59,7 +59,7 @@ class EntityWorkflowCreationValidator extends \Symfony\Component\Validator\Const $workflows = $this->entityWorkflowManager->getSupportedWorkflows($value); - $matched = array_filter($workflows, static fn(WorkflowInterface $workflow) => $workflow->getName() === $value->getWorkflowName()); + $matched = array_filter($workflows, static fn (WorkflowInterface $workflow) => $workflow->getName() === $value->getWorkflowName()); if (0 === count($matched)) { $this->context->buildViolation($constraint->messageWorkflowNotAvailable) diff --git a/src/Bundle/ChillPersonBundle/Controller/AccompanyingCourseApiController.php b/src/Bundle/ChillPersonBundle/Controller/AccompanyingCourseApiController.php index d7289c68a..181f60a02 100644 --- a/src/Bundle/ChillPersonBundle/Controller/AccompanyingCourseApiController.php +++ b/src/Bundle/ChillPersonBundle/Controller/AccompanyingCourseApiController.php @@ -169,7 +169,7 @@ final class AccompanyingCourseApiController extends ApiController $accompanyingPeriods = $person->getCurrentAccompanyingPeriods(); $accompanyingPeriodsChecked = array_filter( $accompanyingPeriods, - fn(AccompanyingPeriod $period) => $this->isGranted(AccompanyingPeriodVoter::SEE, $period) + fn (AccompanyingPeriod $period) => $this->isGranted(AccompanyingPeriodVoter::SEE, $period) ); return $this->json(array_values($accompanyingPeriodsChecked), Response::HTTP_OK, [], ['groups' => ['read']]); diff --git a/src/Bundle/ChillPersonBundle/Controller/AccompanyingPeriodController.php b/src/Bundle/ChillPersonBundle/Controller/AccompanyingPeriodController.php index 18098a129..b32454387 100644 --- a/src/Bundle/ChillPersonBundle/Controller/AccompanyingPeriodController.php +++ b/src/Bundle/ChillPersonBundle/Controller/AccompanyingPeriodController.php @@ -222,10 +222,10 @@ class AccompanyingPeriodController extends AbstractController $accompanyingPeriodsRaw = $this->accompanyingPeriodACLAwareRepository ->findByPerson($person, AccompanyingPeriodVoter::SEE); - usort($accompanyingPeriodsRaw, static fn($a, $b) => $b->getOpeningDate() > $a->getOpeningDate()); + usort($accompanyingPeriodsRaw, static fn ($a, $b) => $b->getOpeningDate() > $a->getOpeningDate()); // filter visible or not visible - $accompanyingPeriods = array_filter($accompanyingPeriodsRaw, fn(AccompanyingPeriod $ap) => $this->isGranted(AccompanyingPeriodVoter::SEE, $ap)); + $accompanyingPeriods = array_filter($accompanyingPeriodsRaw, fn (AccompanyingPeriod $ap) => $this->isGranted(AccompanyingPeriodVoter::SEE, $ap)); return $this->render('@ChillPerson/AccompanyingPeriod/list.html.twig', [ 'accompanying_periods' => $accompanyingPeriods, @@ -327,7 +327,7 @@ class AccompanyingPeriodController extends AbstractController /** @var AccompanyingPeriod $period */ $period = array_filter( $person->getAccompanyingPeriods(), - static fn(AccompanyingPeriod $p) => $p->getId() === ($period_id) + static fn (AccompanyingPeriod $p) => $p->getId() === ($period_id) )[0] ?? null; if (null === $period) { diff --git a/src/Bundle/ChillPersonBundle/Controller/AccompanyingPeriodRegulationListController.php b/src/Bundle/ChillPersonBundle/Controller/AccompanyingPeriodRegulationListController.php index ced5ccd9d..6bbb6c368 100644 --- a/src/Bundle/ChillPersonBundle/Controller/AccompanyingPeriodRegulationListController.php +++ b/src/Bundle/ChillPersonBundle/Controller/AccompanyingPeriodRegulationListController.php @@ -105,8 +105,8 @@ class AccompanyingPeriodRegulationListController $builder ->add('services', EntityType::class, [ 'class' => Scope::class, - 'query_builder' => static fn(EntityRepository $er) => $er->createQueryBuilder('s'), - 'choice_label' => fn(Scope $s) => $this->translatableStringHelper->localize($s->getName()), + 'query_builder' => static fn (EntityRepository $er) => $er->createQueryBuilder('s'), + 'choice_label' => fn (Scope $s) => $this->translatableStringHelper->localize($s->getName()), 'multiple' => true, 'label' => 'Service', 'required' => false, @@ -119,7 +119,7 @@ class AccompanyingPeriodRegulationListController return $qb; }, - 'choice_label' => fn(UserJob $j) => $this->translatableStringHelper->localize($j->getLabel()), + 'choice_label' => fn (UserJob $j) => $this->translatableStringHelper->localize($j->getLabel()), 'multiple' => true, 'label' => 'Métier', 'required' => false, @@ -141,7 +141,7 @@ class AccompanyingPeriodRegulationListController return $qb; }, - 'choice_label' => static fn(Location $l) => $l->getName(), + 'choice_label' => static fn (Location $l) => $l->getName(), 'multiple' => true, 'group_by' => function (Location $l) { if (null === $type = $l->getLocationType()) { diff --git a/src/Bundle/ChillPersonBundle/Controller/HouseholdCompositionController.php b/src/Bundle/ChillPersonBundle/Controller/HouseholdCompositionController.php index 98fa0ebfe..61e030322 100644 --- a/src/Bundle/ChillPersonBundle/Controller/HouseholdCompositionController.php +++ b/src/Bundle/ChillPersonBundle/Controller/HouseholdCompositionController.php @@ -164,7 +164,7 @@ class HouseholdCompositionController extends AbstractController $isEdit = $request->query->has('edit'); if ($isEdit) { - $householdCompositions = $household->getCompositions()->filter(static fn(HouseholdComposition $composition) => $composition->getId() === $request->query->getInt('edit')); + $householdCompositions = $household->getCompositions()->filter(static fn (HouseholdComposition $composition) => $composition->getId() === $request->query->getInt('edit')); if ($householdCompositions->count() !== 1) { throw new BadRequestHttpException('could not find the composition with this id associated to the household'); diff --git a/src/Bundle/ChillPersonBundle/Controller/HouseholdController.php b/src/Bundle/ChillPersonBundle/Controller/HouseholdController.php index 68f32c886..42092249b 100644 --- a/src/Bundle/ChillPersonBundle/Controller/HouseholdController.php +++ b/src/Bundle/ChillPersonBundle/Controller/HouseholdController.php @@ -81,7 +81,7 @@ class HouseholdController extends AbstractController } } - usort($accompanyingPeriods, static fn($a, $b) => $b->getOpeningDate() <=> $a->getOpeningDate()); + usort($accompanyingPeriods, static fn ($a, $b) => $b->getOpeningDate() <=> $a->getOpeningDate()); $oldMembers = $household->getNonCurrentMembers(); $accompanyingPeriodsOld = []; diff --git a/src/Bundle/ChillPersonBundle/Controller/PersonApiController.php b/src/Bundle/ChillPersonBundle/Controller/PersonApiController.php index 35256ce56..505f307e6 100644 --- a/src/Bundle/ChillPersonBundle/Controller/PersonApiController.php +++ b/src/Bundle/ChillPersonBundle/Controller/PersonApiController.php @@ -108,10 +108,10 @@ class PersonApiController extends ApiController $addresses = $person ->getAccompanyingPeriodParticipations() ->filter( - static fn(AccompanyingPeriodParticipation $accompanyingPeriodParticipation): bool => null !== $accompanyingPeriodParticipation->getAccompanyingPeriod()->getAddressLocation() + static fn (AccompanyingPeriodParticipation $accompanyingPeriodParticipation): bool => null !== $accompanyingPeriodParticipation->getAccompanyingPeriod()->getAddressLocation() ) ->map( - static fn(AccompanyingPeriodParticipation $accompanyingPeriodParticipation): ?Address => $accompanyingPeriodParticipation->getAccompanyingPeriod()->getAddressLocation() + static fn (AccompanyingPeriodParticipation $accompanyingPeriodParticipation): ?Address => $accompanyingPeriodParticipation->getAccompanyingPeriod()->getAddressLocation() ) ->filter( // We remove potential null addresses. diff --git a/src/Bundle/ChillPersonBundle/Controller/SocialWorkSocialActionApiController.php b/src/Bundle/ChillPersonBundle/Controller/SocialWorkSocialActionApiController.php index 75293fd7b..4fe877a72 100644 --- a/src/Bundle/ChillPersonBundle/Controller/SocialWorkSocialActionApiController.php +++ b/src/Bundle/ChillPersonBundle/Controller/SocialWorkSocialActionApiController.php @@ -44,7 +44,7 @@ class SocialWorkSocialActionApiController extends ApiController $socialActions = $socialIssue->getRecursiveSocialActions()->toArray(); - usort($socialActions, static fn(SocialAction $sa, SocialAction $sb) => $sa->getOrdering() <=> $sb->getOrdering()); + usort($socialActions, static fn (SocialAction $sa, SocialAction $sb) => $sa->getOrdering() <=> $sb->getOrdering()); $pagination = $this->paginator->create(count($socialActions)); // max one page diff --git a/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadCustomFields.php b/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadCustomFields.php index fb5ae6e4e..78180adff 100644 --- a/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadCustomFields.php +++ b/src/Bundle/ChillPersonBundle/DataFixtures/ORM/LoadCustomFields.php @@ -115,7 +115,7 @@ class LoadCustomFields extends AbstractFixture implements // get possible values for cfGroup $choices = array_map( - static fn($a) => $a['slug'], + static fn ($a) => $a['slug'], $this->customFieldChoice->getOptions()['choices'] ); // create faker diff --git a/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod.php b/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod.php index 364cb41d5..a0f6e7d7e 100644 --- a/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod.php +++ b/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod.php @@ -828,7 +828,7 @@ class AccompanyingPeriod implements $collection = $this ->getParticipationsContainsPerson($person) ->filter( - static fn(AccompanyingPeriodParticipation $participation): bool => null === $participation->getEndDate() + static fn (AccompanyingPeriodParticipation $participation): bool => null === $participation->getEndDate() ); return $collection->count() > 0 ? $collection->first() : null; @@ -842,7 +842,7 @@ class AccompanyingPeriod implements return $this ->getParticipations() ->filter( - static fn(AccompanyingPeriodParticipation $participation): bool => null === $participation->getEndDate() + static fn (AccompanyingPeriodParticipation $participation): bool => null === $participation->getEndDate() ); } diff --git a/src/Bundle/ChillPersonBundle/Entity/Household/Household.php b/src/Bundle/ChillPersonBundle/Entity/Household/Household.php index 2fa1df203..8a99c7eb4 100644 --- a/src/Bundle/ChillPersonBundle/Entity/Household/Household.php +++ b/src/Bundle/ChillPersonBundle/Entity/Household/Household.php @@ -202,7 +202,7 @@ class Household { $at ??= new DateTime('today'); - $addrs = $this->getAddresses()->filter(static fn(Address $a) => $a->getValidFrom() <= $at && ( + $addrs = $this->getAddresses()->filter(static fn (Address $a) => $a->getValidFrom() <= $at && ( null === $a->getValidTo() || $a->getValidTo() > $at )); @@ -336,7 +336,7 @@ class Household public function getCurrentPersons(?DateTimeImmutable $now = null): ReadableCollection { return $this->getCurrentMembers($now) - ->map(static fn(HouseholdMember $m) => $m->getPerson()); + ->map(static fn (HouseholdMember $m) => $m->getPerson()); } public function getId(): ?int @@ -363,7 +363,7 @@ class Household $membership->getStartDate(), $membership->getEndDate() )->filter( - static fn(HouseholdMember $m) => $m->getPerson() !== $membership->getPerson() + static fn (HouseholdMember $m) => $m->getPerson() !== $membership->getPerson() ); } @@ -502,7 +502,7 @@ class Household usort( $compositionOrdered, - static fn(HouseholdComposition $a, HouseholdComposition $b) => $a->getStartDate() <=> $b->getStartDate() + static fn (HouseholdComposition $a, HouseholdComposition $b) => $a->getStartDate() <=> $b->getStartDate() ); $iterator = new ArrayIterator($compositionOrdered); diff --git a/src/Bundle/ChillPersonBundle/Entity/Person.php b/src/Bundle/ChillPersonBundle/Entity/Person.php index 1507bafd7..af8e7f92b 100644 --- a/src/Bundle/ChillPersonBundle/Entity/Person.php +++ b/src/Bundle/ChillPersonBundle/Entity/Person.php @@ -775,7 +775,7 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI ): int { // TODO should be optimized to avoid loading accompanying period ? return $this->getAccompanyingPeriodInvolved($asParticipantOpen, $asRequestor) - ->filter(fn(AccompanyingPeriod $p) => $p->getStep() !== AccompanyingPeriod::STEP_DRAFT) + ->filter(fn (AccompanyingPeriod $p) => $p->getStep() !== AccompanyingPeriod::STEP_DRAFT) ->count(); } @@ -1339,7 +1339,7 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI return $this->getAccompanyingPeriodParticipations() ->matching($criteria) - ->filter(static fn(AccompanyingPeriodParticipation $app) => AccompanyingPeriod::STEP_CLOSED !== $app->getAccompanyingPeriod()->getStep()); + ->filter(static fn (AccompanyingPeriodParticipation $app) => AccompanyingPeriod::STEP_CLOSED !== $app->getAccompanyingPeriod()->getStep()); } public function getOtherPhoneNumbers(): Collection diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/GeographicalUnitStatAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/GeographicalUnitStatAggregator.php index c018eb95f..4ac96aac1 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/GeographicalUnitStatAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/GeographicalUnitStatAggregator.php @@ -128,7 +128,7 @@ final class GeographicalUnitStatAggregator implements AggregatorInterface 'placeholder' => 'Select a geographical layer', 'class' => GeographicalUnitLayer::class, 'choices' => $this->geographicalUnitLayerRepository->findAllHavingUnits(), - 'choice_label' => fn(GeographicalUnitLayer $item) => $this->translatableStringHelper->localize($item->getName()), + 'choice_label' => fn (GeographicalUnitLayer $item) => $this->translatableStringHelper->localize($item->getName()), ]); } diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/CountryOfBirthAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/CountryOfBirthAggregator.php index c2923c9e9..3d785b586 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/CountryOfBirthAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/CountryOfBirthAggregator.php @@ -147,7 +147,7 @@ final class CountryOfBirthAggregator implements AggregatorInterface, ExportEleme ]; } - return static fn(string $value): string => $labels[$value]; + return static fn (string $value): string => $labels[$value]; } public function getQueryKeys($data) diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/GeographicalUnitAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/GeographicalUnitAggregator.php index 1ab9f1b78..ff72994ba 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/GeographicalUnitAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/GeographicalUnitAggregator.php @@ -100,7 +100,7 @@ class GeographicalUnitAggregator implements AggregatorInterface 'placeholder' => 'Select a geographical layer', 'class' => GeographicalUnitLayer::class, 'choices' => $this->geographicalUnitLayerRepository->findAllHavingUnits(), - 'choice_label' => fn(GeographicalUnitLayer $item) => $this->translatableStringHelper->localize($item->getName()), + 'choice_label' => fn (GeographicalUnitLayer $item) => $this->translatableStringHelper->localize($item->getName()), ]); } diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/NationalityAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/NationalityAggregator.php index b91a90000..d7c4097af 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/NationalityAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/NationalityAggregator.php @@ -141,7 +141,7 @@ final class NationalityAggregator implements AggregatorInterface, ExportElementV ]; } - return static fn($value): string => $labels[$value]; + return static fn ($value): string => $labels[$value]; } public function getQueryKeys($data) diff --git a/src/Bundle/ChillPersonBundle/Export/Export/CountAccompanyingCourse.php b/src/Bundle/ChillPersonBundle/Export/Export/CountAccompanyingCourse.php index 7cb2e623f..978f88a10 100644 --- a/src/Bundle/ChillPersonBundle/Export/Export/CountAccompanyingCourse.php +++ b/src/Bundle/ChillPersonBundle/Export/Export/CountAccompanyingCourse.php @@ -64,7 +64,7 @@ class CountAccompanyingCourse implements ExportInterface, GroupedExportInterface $labels = array_combine($values, $values); $labels['_header'] = $this->getTitle(); - return static fn($value) => $labels[$value]; + return static fn ($value) => $labels[$value]; } public function getQueryKeys($data): array @@ -89,7 +89,7 @@ class CountAccompanyingCourse implements ExportInterface, GroupedExportInterface public function initiateQuery(array $requiredModifiers, array $acl, array $data = []): QueryBuilder { - $centers = array_map(static fn($el) => $el['center'], $acl); + $centers = array_map(static fn ($el) => $el['center'], $acl); $qb = $this->repository->createQueryBuilder('acp'); diff --git a/src/Bundle/ChillPersonBundle/Export/Export/CountAccompanyingPeriodWork.php b/src/Bundle/ChillPersonBundle/Export/Export/CountAccompanyingPeriodWork.php index 412890241..122ee14d9 100644 --- a/src/Bundle/ChillPersonBundle/Export/Export/CountAccompanyingPeriodWork.php +++ b/src/Bundle/ChillPersonBundle/Export/Export/CountAccompanyingPeriodWork.php @@ -63,7 +63,7 @@ class CountAccompanyingPeriodWork implements ExportInterface, GroupedExportInter $labels = array_combine($values, $values); $labels['_header'] = $this->getTitle(); - return static fn($value) => $labels[$value]; + return static fn ($value) => $labels[$value]; } public function getQueryKeys($data): array @@ -88,7 +88,7 @@ class CountAccompanyingPeriodWork implements ExportInterface, GroupedExportInter public function initiateQuery(array $requiredModifiers, array $acl, array $data = []): QueryBuilder { - $centers = array_map(static fn($el) => $el['center'], $acl); + $centers = array_map(static fn ($el) => $el['center'], $acl); $qb = $this->em->createQueryBuilder(); diff --git a/src/Bundle/ChillPersonBundle/Export/Export/CountEvaluation.php b/src/Bundle/ChillPersonBundle/Export/Export/CountEvaluation.php index 4efd7e246..1613b63d3 100644 --- a/src/Bundle/ChillPersonBundle/Export/Export/CountEvaluation.php +++ b/src/Bundle/ChillPersonBundle/Export/Export/CountEvaluation.php @@ -62,7 +62,7 @@ class CountEvaluation implements ExportInterface, GroupedExportInterface $labels = array_combine($values, $values); $labels['_header'] = $this->getTitle(); - return static fn($value) => $labels[$value]; + return static fn ($value) => $labels[$value]; } public function getQueryKeys($data): array @@ -87,7 +87,7 @@ class CountEvaluation implements ExportInterface, GroupedExportInterface public function initiateQuery(array $requiredModifiers, array $acl, array $data = []) { - $centers = array_map(static fn($el) => $el['center'], $acl); + $centers = array_map(static fn ($el) => $el['center'], $acl); $qb = $this->entityManager->createQueryBuilder(); diff --git a/src/Bundle/ChillPersonBundle/Export/Export/CountHousehold.php b/src/Bundle/ChillPersonBundle/Export/Export/CountHousehold.php index 2b782d1ed..0b693b9d8 100644 --- a/src/Bundle/ChillPersonBundle/Export/Export/CountHousehold.php +++ b/src/Bundle/ChillPersonBundle/Export/Export/CountHousehold.php @@ -113,7 +113,7 @@ class CountHousehold implements ExportInterface, GroupedExportInterface public function initiateQuery(array $requiredModifiers, array $acl, array $data = []) { - $centers = array_map(static fn($el) => $el['center'], $acl); + $centers = array_map(static fn ($el) => $el['center'], $acl); $qb = $this->entityManager->createQueryBuilder(); diff --git a/src/Bundle/ChillPersonBundle/Export/Export/CountPerson.php b/src/Bundle/ChillPersonBundle/Export/Export/CountPerson.php index 528be42c8..60429ae55 100644 --- a/src/Bundle/ChillPersonBundle/Export/Export/CountPerson.php +++ b/src/Bundle/ChillPersonBundle/Export/Export/CountPerson.php @@ -62,7 +62,7 @@ class CountPerson implements ExportInterface, GroupedExportInterface $labels = array_combine($values, $values); $labels['_header'] = $this->getTitle(); - return static fn($value) => $labels[$value]; + return static fn ($value) => $labels[$value]; } public function getQueryKeys($data) @@ -92,7 +92,7 @@ class CountPerson implements ExportInterface, GroupedExportInterface */ public function initiateQuery(array $requiredModifiers, array $acl, array $data = []) { - $centers = array_map(static fn($el) => $el['center'], $acl); + $centers = array_map(static fn ($el) => $el['center'], $acl); $qb = $this->personRepository->createQueryBuilder('person'); diff --git a/src/Bundle/ChillPersonBundle/Export/Export/CountPersonWithAccompanyingCourse.php b/src/Bundle/ChillPersonBundle/Export/Export/CountPersonWithAccompanyingCourse.php index e58439112..e52cc83b1 100644 --- a/src/Bundle/ChillPersonBundle/Export/Export/CountPersonWithAccompanyingCourse.php +++ b/src/Bundle/ChillPersonBundle/Export/Export/CountPersonWithAccompanyingCourse.php @@ -64,7 +64,7 @@ class CountPersonWithAccompanyingCourse implements ExportInterface, GroupedExpor $labels = array_combine($values, $values); $labels['_header'] = $this->getTitle(); - return static fn($value) => $labels[$value]; + return static fn ($value) => $labels[$value]; } public function getQueryKeys($data): array @@ -89,7 +89,7 @@ class CountPersonWithAccompanyingCourse implements ExportInterface, GroupedExpor public function initiateQuery(array $requiredModifiers, array $acl, array $data = []) { - $centers = array_map(static fn($el) => $el['center'], $acl); + $centers = array_map(static fn ($el) => $el['center'], $acl); $qb = $this->repository->createQueryBuilder('acp'); diff --git a/src/Bundle/ChillPersonBundle/Export/Export/ListAccompanyingPeriod.php b/src/Bundle/ChillPersonBundle/Export/Export/ListAccompanyingPeriod.php index 1bfd1870f..045039930 100644 --- a/src/Bundle/ChillPersonBundle/Export/Export/ListAccompanyingPeriod.php +++ b/src/Bundle/ChillPersonBundle/Export/Export/ListAccompanyingPeriod.php @@ -290,7 +290,7 @@ class ListAccompanyingPeriod implements ListInterface, GroupedExportInterface public function initiateQuery(array $requiredModifiers, array $acl, array $data = []) { - $centers = array_map(static fn($el) => $el['center'], $acl); + $centers = array_map(static fn ($el) => $el['center'], $acl); $qb = $this->entityManager->createQueryBuilder(); diff --git a/src/Bundle/ChillPersonBundle/Export/Export/ListAccompanyingPeriodWork.php b/src/Bundle/ChillPersonBundle/Export/Export/ListAccompanyingPeriodWork.php index 17c2c4f99..00fa8adb1 100644 --- a/src/Bundle/ChillPersonBundle/Export/Export/ListAccompanyingPeriodWork.php +++ b/src/Bundle/ChillPersonBundle/Export/Export/ListAccompanyingPeriodWork.php @@ -263,7 +263,7 @@ class ListAccompanyingPeriodWork implements ListInterface, GroupedExportInterfac public function initiateQuery(array $requiredModifiers, array $acl, array $data = []) { - $centers = array_map(static fn($el) => $el['center'], $acl); + $centers = array_map(static fn ($el) => $el['center'], $acl); $qb = $this->entityManager->createQueryBuilder(); diff --git a/src/Bundle/ChillPersonBundle/Export/Export/ListEvaluation.php b/src/Bundle/ChillPersonBundle/Export/Export/ListEvaluation.php index 0f63d41ca..f0985436b 100644 --- a/src/Bundle/ChillPersonBundle/Export/Export/ListEvaluation.php +++ b/src/Bundle/ChillPersonBundle/Export/Export/ListEvaluation.php @@ -241,7 +241,7 @@ class ListEvaluation implements ListInterface, GroupedExportInterface public function initiateQuery(array $requiredModifiers, array $acl, array $data = []) { - $centers = array_map(static fn($el) => $el['center'], $acl); + $centers = array_map(static fn ($el) => $el['center'], $acl); $qb = $this->entityManager->createQueryBuilder(); diff --git a/src/Bundle/ChillPersonBundle/Export/Export/ListHouseholdInPeriod.php b/src/Bundle/ChillPersonBundle/Export/Export/ListHouseholdInPeriod.php index d176f7bb8..24d929c00 100644 --- a/src/Bundle/ChillPersonBundle/Export/Export/ListHouseholdInPeriod.php +++ b/src/Bundle/ChillPersonBundle/Export/Export/ListHouseholdInPeriod.php @@ -146,7 +146,7 @@ class ListHouseholdInPeriod implements ListInterface, GroupedExportInterface public function initiateQuery(array $requiredModifiers, array $acl, array $data = []) { - $centers = array_map(static fn($el) => $el['center'], $acl); + $centers = array_map(static fn ($el) => $el['center'], $acl); $qb = $this->entityManager->createQueryBuilder(); diff --git a/src/Bundle/ChillPersonBundle/Export/Export/ListPerson.php b/src/Bundle/ChillPersonBundle/Export/Export/ListPerson.php index 322917b02..8145fd658 100644 --- a/src/Bundle/ChillPersonBundle/Export/Export/ListPerson.php +++ b/src/Bundle/ChillPersonBundle/Export/Export/ListPerson.php @@ -191,7 +191,7 @@ class ListPerson implements ExportElementValidatedInterface, ListInterface, Grou */ public function initiateQuery(array $requiredModifiers, array $acl, array $data = []) { - $centers = array_map(static fn($el) => $el['center'], $acl); + $centers = array_map(static fn ($el) => $el['center'], $acl); // throw an error if any fields are present if (!array_key_exists('fields', $data)) { diff --git a/src/Bundle/ChillPersonBundle/Export/Export/ListPersonWithAccompanyingPeriod.php b/src/Bundle/ChillPersonBundle/Export/Export/ListPersonWithAccompanyingPeriod.php index 35bb8a6c1..7cb066e87 100644 --- a/src/Bundle/ChillPersonBundle/Export/Export/ListPersonWithAccompanyingPeriod.php +++ b/src/Bundle/ChillPersonBundle/Export/Export/ListPersonWithAccompanyingPeriod.php @@ -159,7 +159,7 @@ class ListPersonWithAccompanyingPeriod implements ExportElementValidatedInterfac */ public function initiateQuery(array $requiredModifiers, array $acl, array $data = []) { - $centers = array_map(static fn($el) => $el['center'], $acl); + $centers = array_map(static fn ($el) => $el['center'], $acl); // throw an error if any fields are present if (!array_key_exists('fields', $data)) { diff --git a/src/Bundle/ChillPersonBundle/Export/Export/StatAccompanyingCourseDuration.php b/src/Bundle/ChillPersonBundle/Export/Export/StatAccompanyingCourseDuration.php index 0c2fb63f5..31ca41cbb 100644 --- a/src/Bundle/ChillPersonBundle/Export/Export/StatAccompanyingCourseDuration.php +++ b/src/Bundle/ChillPersonBundle/Export/Export/StatAccompanyingCourseDuration.php @@ -112,7 +112,7 @@ class StatAccompanyingCourseDuration implements ExportInterface, GroupedExportIn public function initiateQuery(array $requiredModifiers, array $acl, array $data = []): QueryBuilder { - $centers = array_map(static fn($el) => $el['center'], $acl); + $centers = array_map(static fn ($el) => $el['center'], $acl); $qb = $this->repository->createQueryBuilder('acp'); diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/ClosingMotiveFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/ClosingMotiveFilter.php index 05c883309..e57370f30 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/ClosingMotiveFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/ClosingMotiveFilter.php @@ -59,7 +59,7 @@ class ClosingMotiveFilter implements FilterInterface { $builder->add('accepted_closingmotives', EntityType::class, [ 'class' => ClosingMotive::class, - 'choice_label' => fn(ClosingMotive $cm) => $this->translatableStringHelper->localize($cm->getName()), + 'choice_label' => fn (ClosingMotive $cm) => $this->translatableStringHelper->localize($cm->getName()), 'multiple' => true, 'expanded' => true, ]); diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/CreatorJobFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/CreatorJobFilter.php index 497068c39..f585cfafb 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/CreatorJobFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/CreatorJobFilter.php @@ -61,7 +61,7 @@ class CreatorJobFilter implements FilterInterface $builder->add('creator_job', EntityType::class, [ 'class' => UserJob::class, 'choices' => $this->userJobRepository->findAllActive(), - 'choice_label' => fn(UserJob $j) => $this->translatableStringHelper->localize( + 'choice_label' => fn (UserJob $j) => $this->translatableStringHelper->localize( $j->getLabel() ), 'multiple' => true, diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/EvaluationFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/EvaluationFilter.php index 7f409c022..ab7f4257e 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/EvaluationFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/EvaluationFilter.php @@ -69,7 +69,7 @@ class EvaluationFilter implements FilterInterface $builder->add('accepted_evaluations', EntityType::class, [ 'class' => Evaluation::class, 'choices' => $this->evaluationRepository->findAllActive(), - 'choice_label' => fn(Evaluation $ev) => $this->translatableStringHelper->localize($ev->getTitle()), + 'choice_label' => fn (Evaluation $ev) => $this->translatableStringHelper->localize($ev->getTitle()), 'multiple' => true, 'expanded' => false, 'attr' => ['class' => 'select2'], diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/GeographicalUnitStatFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/GeographicalUnitStatFilter.php index 719029d38..d35565c80 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/GeographicalUnitStatFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/GeographicalUnitStatFilter.php @@ -107,7 +107,7 @@ class GeographicalUnitStatFilter implements FilterInterface 'placeholder' => 'Select a geographical unit', 'choices' => $this->geographicalUnitRepository->findAll(), 'choice_value' => static fn (SimpleGeographicalUnitDTO $item) => $item->id, - 'choice_label' => fn(SimpleGeographicalUnitDTO $item) => $this->translatableStringHelper->localize($this->geographicalUnitLayerRepository->find($item->layerId)->getName()) . ' > ' . $item->unitName, + 'choice_label' => fn (SimpleGeographicalUnitDTO $item) => $this->translatableStringHelper->localize($this->geographicalUnitLayerRepository->find($item->layerId)->getName()) . ' > ' . $item->unitName, 'attr' => [ 'class' => 'select2', ], @@ -122,7 +122,7 @@ class GeographicalUnitStatFilter implements FilterInterface '%units' => implode( ', ', array_map( - fn(SimpleGeographicalUnitDTO $item) => $this->translatableStringHelper->localize($this->geographicalUnitLayerRepository->find($item->layerId)->getName()) . ' > ' . $item->unitName, + fn (SimpleGeographicalUnitDTO $item) => $this->translatableStringHelper->localize($this->geographicalUnitLayerRepository->find($item->layerId)->getName()) . ' > ' . $item->unitName, $data['units'] ) ), diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/OriginFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/OriginFilter.php index bde641b2d..00febc640 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/OriginFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/OriginFilter.php @@ -59,7 +59,7 @@ class OriginFilter implements FilterInterface { $builder->add('accepted_origins', EntityType::class, [ 'class' => Origin::class, - 'choice_label' => fn(Origin $o) => $this->translatableStringHelper->localize($o->getLabel()), + 'choice_label' => fn (Origin $o) => $this->translatableStringHelper->localize($o->getLabel()), 'multiple' => true, 'expanded' => true, ]); diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/EvaluationFilters/EvaluationTypeFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/EvaluationFilters/EvaluationTypeFilter.php index 15be1a52b..6a0c71d55 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/EvaluationFilters/EvaluationTypeFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/EvaluationFilters/EvaluationTypeFilter.php @@ -59,7 +59,7 @@ final class EvaluationTypeFilter implements FilterInterface { $builder->add('accepted_evaluationtype', EntityType::class, [ 'class' => Evaluation::class, - 'choice_label' => fn(Evaluation $ev): string => $this->translatableStringHelper->localize($ev->getTitle()), + 'choice_label' => fn (Evaluation $ev): string => $this->translatableStringHelper->localize($ev->getTitle()), 'multiple' => true, 'expanded' => true, ]); diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/HouseholdFilters/CompositionFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/HouseholdFilters/CompositionFilter.php index 7eb00fc2b..22761c158 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/HouseholdFilters/CompositionFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/HouseholdFilters/CompositionFilter.php @@ -78,7 +78,7 @@ class CompositionFilter implements FilterInterface $builder ->add('accepted_composition', EntityType::class, [ 'class' => HouseholdCompositionType::class, - 'choice_label' => fn(HouseholdCompositionType $type) => $this->translatableStringHelper->localize( + 'choice_label' => fn (HouseholdCompositionType $type) => $this->translatableStringHelper->localize( $type->getLabel() ), 'multiple' => true, diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/AddressRefStatusFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/AddressRefStatusFilter.php index 5ecdc1fda..7580a37a3 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/AddressRefStatusFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/AddressRefStatusFilter.php @@ -81,7 +81,7 @@ class AddressRefStatusFilter implements \Chill\MainBundle\Export\FilterInterface ->add('ref_statuses', ChoiceType::class, [ 'label' => 'export.filter.person.by_address_ref_status.Status', 'choices' => [Address::ADDR_REFERENCE_STATUS_TO_REVIEW, Address::ADDR_REFERENCE_STATUS_REVIEWED, Address::ADDR_REFERENCE_STATUS_MATCH], - 'choice_label' => fn(string $item) => 'export.filter.person.by_address_ref_status.'.$item, + 'choice_label' => fn (string $item) => 'export.filter.person.by_address_ref_status.'.$item, 'multiple' => true, 'expanded' => true, 'data' => [Address::ADDR_REFERENCE_STATUS_TO_REVIEW] @@ -97,7 +97,7 @@ class AddressRefStatusFilter implements \Chill\MainBundle\Export\FilterInterface '%statuses%' => implode( ', ', array_map( - fn(string $item) => 'export.filter.person.by_address_ref_status.'.$item, + fn (string $item) => 'export.filter.person.by_address_ref_status.'.$item, $data['ref_statuses'] ?? RollingDate::T_TODAY ) ), diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/GenderFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/GenderFilter.php index 92b8ad08b..739945b98 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/GenderFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/GenderFilter.php @@ -67,7 +67,7 @@ class GenderFilter implements $qb->add('where', $where); $qb->setParameter('person_gender', array_filter( $data['accepted_genders'], - static fn($el) => 'null' !== $el + static fn ($el) => 'null' !== $el )); } diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/GeographicalUnitFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/GeographicalUnitFilter.php index 15882b705..79f5cb2d4 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/GeographicalUnitFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/GeographicalUnitFilter.php @@ -98,7 +98,7 @@ class GeographicalUnitFilter implements \Chill\MainBundle\Export\FilterInterface 'placeholder' => 'Select a geographical unit', 'choices' => $this->geographicalUnitRepository->findAll(), 'choice_value' => static fn (SimpleGeographicalUnitDTO $item) => $item->id, - 'choice_label' => fn(SimpleGeographicalUnitDTO $item) => $this->translatableStringHelper->localize($this->geographicalUnitLayerRepository->find($item->layerId)->getName()) . ' > ' . $item->unitName, + 'choice_label' => fn (SimpleGeographicalUnitDTO $item) => $this->translatableStringHelper->localize($this->geographicalUnitLayerRepository->find($item->layerId)->getName()) . ' > ' . $item->unitName, 'attr' => [ 'class' => 'select2', ], @@ -115,7 +115,7 @@ class GeographicalUnitFilter implements \Chill\MainBundle\Export\FilterInterface '%units%' => implode( ', ', array_map( - fn(SimpleGeographicalUnitDTO $item) => $this->translatableStringHelper->localize($this->geographicalUnitLayerRepository->find($item->layerId)->getName()) . ' > ' . $item->unitName, + fn (SimpleGeographicalUnitDTO $item) => $this->translatableStringHelper->localize($this->geographicalUnitLayerRepository->find($item->layerId)->getName()) . ' > ' . $item->unitName, $data['units'] ) ), diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/MaritalStatusFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/MaritalStatusFilter.php index 62b6a34d7..47a75871c 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/MaritalStatusFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/MaritalStatusFilter.php @@ -49,7 +49,7 @@ class MaritalStatusFilter implements FilterInterface { $builder->add('maritalStatus', EntityType::class, [ 'class' => MaritalStatus::class, - 'choice_label' => fn(MaritalStatus $ms) => $this->translatableStringHelper->localize( + 'choice_label' => fn (MaritalStatus $ms) => $this->translatableStringHelper->localize( $ms->getName() ), 'multiple' => true, diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/NationalityFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/NationalityFilter.php index 19e5f999c..b1d77d60e 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/NationalityFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/NationalityFilter.php @@ -72,7 +72,7 @@ class NationalityFilter implements { $countries = $data['nationalities']; - $names = array_map(fn(Country $c) => $this->translatableStringHelper->localize($c->getName()), [$countries]); + $names = array_map(fn (Country $c) => $this->translatableStringHelper->localize($c->getName()), [$countries]); return [ 'Filtered by nationality : %nationalities%', diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/ResidentialAddressAtThirdpartyFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/ResidentialAddressAtThirdpartyFilter.php index 32dc2a2fb..21bb40947 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/ResidentialAddressAtThirdpartyFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/PersonFilters/ResidentialAddressAtThirdpartyFilter.php @@ -100,7 +100,7 @@ class ResidentialAddressAtThirdpartyFilter implements FilterInterface $builder->add('thirdparty_cat', EntityType::class, [ 'class' => ThirdPartyCategory::class, 'label' => 'Category', - 'choice_label' => fn(ThirdPartyCategory $tpc) => $this->translatableStringHelper->localize($tpc->getName()), + 'choice_label' => fn (ThirdPartyCategory $tpc) => $this->translatableStringHelper->localize($tpc->getName()), 'multiple' => true, 'expanded' => true, ]); diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/SocialWorkFilters/JobFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/SocialWorkFilters/JobFilter.php index 1c38a030e..144bf3260 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/SocialWorkFilters/JobFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/SocialWorkFilters/JobFilter.php @@ -69,7 +69,7 @@ class JobFilter implements FilterInterface { $builder->add('job', EntityType::class, [ 'class' => UserJob::class, - 'choice_label' => fn(UserJob $j) => $this->translatableStringHelper->localize( + 'choice_label' => fn (UserJob $j) => $this->translatableStringHelper->localize( $j->getLabel() ), 'multiple' => true, diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/SocialWorkFilters/ScopeFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/SocialWorkFilters/ScopeFilter.php index 5d8e20832..315025722 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/SocialWorkFilters/ScopeFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/SocialWorkFilters/ScopeFilter.php @@ -69,7 +69,7 @@ class ScopeFilter implements FilterInterface { $builder->add('scope', EntityType::class, [ 'class' => Scope::class, - 'choice_label' => fn(Scope $s) => $this->translatableStringHelper->localize( + 'choice_label' => fn (Scope $s) => $this->translatableStringHelper->localize( $s->getName() ), 'multiple' => true, diff --git a/src/Bundle/ChillPersonBundle/Form/ChoiceLoader/PersonChoiceLoader.php b/src/Bundle/ChillPersonBundle/Form/ChoiceLoader/PersonChoiceLoader.php index fe9a3490f..03db7c156 100644 --- a/src/Bundle/ChillPersonBundle/Form/ChoiceLoader/PersonChoiceLoader.php +++ b/src/Bundle/ChillPersonBundle/Form/ChoiceLoader/PersonChoiceLoader.php @@ -55,7 +55,7 @@ class PersonChoiceLoader implements ChoiceLoaderInterface { return new \Symfony\Component\Form\ChoiceList\ArrayChoiceList( $this->lazyLoadedPersons, - static fn(Person $p) => call_user_func($value, $p) + static fn (Person $p) => call_user_func($value, $p) ); } diff --git a/src/Bundle/ChillPersonBundle/Form/HouseholdCompositionType.php b/src/Bundle/ChillPersonBundle/Form/HouseholdCompositionType.php index 6e4877b63..a63b008c6 100644 --- a/src/Bundle/ChillPersonBundle/Form/HouseholdCompositionType.php +++ b/src/Bundle/ChillPersonBundle/Form/HouseholdCompositionType.php @@ -40,7 +40,7 @@ class HouseholdCompositionType extends AbstractType ->add('householdCompositionType', EntityType::class, [ 'class' => \Chill\PersonBundle\Entity\Household\HouseholdCompositionType::class, 'choices' => $types, - 'choice_label' => fn(\Chill\PersonBundle\Entity\Household\HouseholdCompositionType $type) => $this->translatableStringHelper->localize($type->getLabel()), + 'choice_label' => fn (\Chill\PersonBundle\Entity\Household\HouseholdCompositionType $type) => $this->translatableStringHelper->localize($type->getLabel()), 'label' => 'household_composition.Household composition', ]) ->add('startDate', ChillDateType::class, [ diff --git a/src/Bundle/ChillPersonBundle/Form/PersonType.php b/src/Bundle/ChillPersonBundle/Form/PersonType.php index 4752fb628..927812929 100644 --- a/src/Bundle/ChillPersonBundle/Form/PersonType.php +++ b/src/Bundle/ChillPersonBundle/Form/PersonType.php @@ -118,8 +118,8 @@ class PersonType extends AbstractType ]); $builder->get('placeOfBirth')->addModelTransformer(new CallbackTransformer( - static fn($string) => strtoupper((string) $string), - static fn($string) => strtoupper((string) $string) + static fn ($string) => strtoupper((string) $string), + static fn ($string) => strtoupper((string) $string) )); } @@ -163,7 +163,7 @@ class PersonType extends AbstractType 'allow_delete' => true, 'by_reference' => false, 'label' => false, - 'delete_empty' => static fn(?PersonPhone $pp = null) => null === $pp || $pp->isEmpty(), + 'delete_empty' => static fn (?PersonPhone $pp = null) => null === $pp || $pp->isEmpty(), 'error_bubbling' => false, 'empty_collection_explain' => 'No additional phone numbers', ]); diff --git a/src/Bundle/ChillPersonBundle/Form/SocialWork/GoalType.php b/src/Bundle/ChillPersonBundle/Form/SocialWork/GoalType.php index 7a6a7484d..a6f55e917 100644 --- a/src/Bundle/ChillPersonBundle/Form/SocialWork/GoalType.php +++ b/src/Bundle/ChillPersonBundle/Form/SocialWork/GoalType.php @@ -46,7 +46,7 @@ class GoalType extends AbstractType 'class' => Result::class, 'required' => false, 'multiple' => true, - 'choice_label' => fn(Result $r) => $this->translatableStringHelper->localize($r->getTitle()), + 'choice_label' => fn (Result $r) => $this->translatableStringHelper->localize($r->getTitle()), 'attr' => ['class' => 'select2 '], ]) ->add('desactivationDate', ChillDateType::class, [ diff --git a/src/Bundle/ChillPersonBundle/Form/SocialWork/SocialActionType.php b/src/Bundle/ChillPersonBundle/Form/SocialWork/SocialActionType.php index 7f5b434dd..0b6cbe73d 100644 --- a/src/Bundle/ChillPersonBundle/Form/SocialWork/SocialActionType.php +++ b/src/Bundle/ChillPersonBundle/Form/SocialWork/SocialActionType.php @@ -50,12 +50,12 @@ class SocialActionType extends AbstractType ->add('issue', EntityType::class, [ 'class' => SocialIssue::class, 'label' => 'socialAction.socialIssue', - 'choice_label' => fn(SocialIssue $issue) => $this->translatableStringHelper->localize($issue->getTitle()), + 'choice_label' => fn (SocialIssue $issue) => $this->translatableStringHelper->localize($issue->getTitle()), ]) ->add('parent', EntityType::class, [ 'class' => SocialAction::class, 'required' => false, - 'choice_label' => fn(SocialAction $issue) => $this->translatableStringHelper->localize($issue->getTitle()), + 'choice_label' => fn (SocialAction $issue) => $this->translatableStringHelper->localize($issue->getTitle()), ]) ->add('ordering', NumberType::class, [ 'required' => true, @@ -66,7 +66,7 @@ class SocialActionType extends AbstractType 'required' => false, 'multiple' => true, 'attr' => ['class' => 'select2'], - 'choice_label' => fn(Result $r) => $this->translatableStringHelper->localize($r->getTitle()), + 'choice_label' => fn (Result $r) => $this->translatableStringHelper->localize($r->getTitle()), ]) ->add('goals', EntityType::class, [ @@ -74,7 +74,7 @@ class SocialActionType extends AbstractType 'required' => false, 'multiple' => true, 'attr' => ['class' => 'select2'], - 'choice_label' => fn(Goal $g) => $this->translatableStringHelper->localize($g->getTitle()), + 'choice_label' => fn (Goal $g) => $this->translatableStringHelper->localize($g->getTitle()), ]) ->add('evaluations', EntityType::class, [ @@ -82,7 +82,7 @@ class SocialActionType extends AbstractType 'required' => false, 'multiple' => true, 'attr' => ['class' => 'select2'], - 'choice_label' => fn(Evaluation $e) => $this->translatableStringHelper->localize($e->getTitle()), + 'choice_label' => fn (Evaluation $e) => $this->translatableStringHelper->localize($e->getTitle()), ]) ->add('defaultNotificationDelay', DateIntervalType::class, [ diff --git a/src/Bundle/ChillPersonBundle/Form/Type/ClosingMotivePickerType.php b/src/Bundle/ChillPersonBundle/Form/Type/ClosingMotivePickerType.php index 2b4613376..240bcfbb4 100644 --- a/src/Bundle/ChillPersonBundle/Form/Type/ClosingMotivePickerType.php +++ b/src/Bundle/ChillPersonBundle/Form/Type/ClosingMotivePickerType.php @@ -60,13 +60,13 @@ class ClosingMotivePickerType extends AbstractType 'class' => ClosingMotive::class, 'empty_data' => null, 'placeholder' => 'Choose a motive', - 'choice_label' => fn(ClosingMotive $cm) => $this->entityRenderExtension->renderString($cm), + 'choice_label' => fn (ClosingMotive $cm) => $this->entityRenderExtension->renderString($cm), 'only_leaf' => true, ]); $resolver ->setAllowedTypes('only_leaf', 'bool') - ->setNormalizer('choices', fn(Options $options) => $this->repository + ->setNormalizer('choices', fn (Options $options) => $this->repository ->getActiveClosingMotive($options['only_leaf'])); } diff --git a/src/Bundle/ChillPersonBundle/Form/Type/PickPersonType.php b/src/Bundle/ChillPersonBundle/Form/Type/PickPersonType.php index 3c0a1d5af..026a24bb6 100644 --- a/src/Bundle/ChillPersonBundle/Form/Type/PickPersonType.php +++ b/src/Bundle/ChillPersonBundle/Form/Type/PickPersonType.php @@ -113,9 +113,9 @@ class PickPersonType extends AbstractType // add the default options $resolver->setDefaults([ 'class' => Person::class, - 'choice_label' => static fn(Person $p) => $p->getFirstname() . ' ' . $p->getLastname(), + 'choice_label' => static fn (Person $p) => $p->getFirstname() . ' ' . $p->getLastname(), 'placeholder' => 'Pick a person', - 'choice_attr' => static fn(Person $p) => [ + 'choice_attr' => static fn (Person $p) => [ 'data-center' => $p->getCenter()->getId(), ], 'attr' => ['class' => 'select2 '], @@ -135,7 +135,7 @@ class PickPersonType extends AbstractType protected function filterCentersfom(Options $options) { if (null === $options['role']) { - $centers = array_map(static fn(GroupCenter $g) => $g->getCenter(), $this->user->getGroupCenters()->toArray()); + $centers = array_map(static fn (GroupCenter $g) => $g->getCenter(), $this->user->getGroupCenters()->toArray()); } else { $centers = $this->authorizationHelper ->getReachableCenters($this->user, $options['role']->getRole()); @@ -158,7 +158,7 @@ class PickPersonType extends AbstractType if ( !in_array($c->getId(), array_map( - static fn(Center $c) => $c->getId(), + static fn (Center $c) => $c->getId(), $centers ), true) ) { diff --git a/src/Bundle/ChillPersonBundle/Form/Type/PickSocialActionType.php b/src/Bundle/ChillPersonBundle/Form/Type/PickSocialActionType.php index 695d3aa12..fd947e9cd 100644 --- a/src/Bundle/ChillPersonBundle/Form/Type/PickSocialActionType.php +++ b/src/Bundle/ChillPersonBundle/Form/Type/PickSocialActionType.php @@ -38,7 +38,7 @@ class PickSocialActionType extends AbstractType ->setDefaults([ 'class' => SocialAction::class, 'choices' => $this->actionRepository->findAllActive(), - 'choice_label' => fn(SocialAction $sa) => $this->actionRender->renderString($sa, []), + 'choice_label' => fn (SocialAction $sa) => $this->actionRender->renderString($sa, []), 'placeholder' => 'Pick a social action', 'required' => false, 'attr' => ['class' => 'select2'], diff --git a/src/Bundle/ChillPersonBundle/Form/Type/PickSocialIssueType.php b/src/Bundle/ChillPersonBundle/Form/Type/PickSocialIssueType.php index 9c02a7905..b560337ac 100644 --- a/src/Bundle/ChillPersonBundle/Form/Type/PickSocialIssueType.php +++ b/src/Bundle/ChillPersonBundle/Form/Type/PickSocialIssueType.php @@ -38,7 +38,7 @@ class PickSocialIssueType extends AbstractType ->setDefaults([ 'class' => SocialIssue::class, 'choices' => $this->issueRepository->findAllActive(), - 'choice_label' => fn(SocialIssue $si) => $this->issueRender->renderString($si, []), + 'choice_label' => fn (SocialIssue $si) => $this->issueRender->renderString($si, []), 'placeholder' => 'Pick a social issue', 'required' => false, 'attr' => ['class' => 'select2'], diff --git a/src/Bundle/ChillPersonBundle/Privacy/PrivacyEventSubscriber.php b/src/Bundle/ChillPersonBundle/Privacy/PrivacyEventSubscriber.php index f83d6faf4..33d01de1b 100644 --- a/src/Bundle/ChillPersonBundle/Privacy/PrivacyEventSubscriber.php +++ b/src/Bundle/ChillPersonBundle/Privacy/PrivacyEventSubscriber.php @@ -76,7 +76,7 @@ class PrivacyEventSubscriber implements EventSubscriberInterface $involved = $this->getInvolved(); $involved['period_id'] = $event->getPeriod()->getId(); $involved['persons'] = $event->getPeriod()->getPersons() - ->map(static fn(Person $p) => $p->getId()) + ->map(static fn (Person $p) => $p->getId()) ->toArray(); $this->logger->notice( @@ -100,7 +100,7 @@ class PrivacyEventSubscriber implements EventSubscriberInterface if ($event->hasPersons()) { $involved['persons'] = array_map( - static fn(Person $p) => $p->getId(), + static fn (Person $p) => $p->getId(), $event->getPersons() ); } diff --git a/src/Bundle/ChillPersonBundle/Repository/PersonACLAwareRepository.php b/src/Bundle/ChillPersonBundle/Repository/PersonACLAwareRepository.php index bbe6eed32..30c79147c 100644 --- a/src/Bundle/ChillPersonBundle/Repository/PersonACLAwareRepository.php +++ b/src/Bundle/ChillPersonBundle/Repository/PersonACLAwareRepository.php @@ -322,7 +322,7 @@ final class PersonACLAwareRepository implements PersonACLAwareRepositoryInterfac ), ] ), - array_map(static fn(Center $c) => $c->getId(), $authorizedCenters) + array_map(static fn (Center $c) => $c->getId(), $authorizedCenters) ); } } diff --git a/src/Bundle/ChillPersonBundle/Security/Authorization/HouseholdVoter.php b/src/Bundle/ChillPersonBundle/Security/Authorization/HouseholdVoter.php index 3e2308089..6ba1ac1a9 100644 --- a/src/Bundle/ChillPersonBundle/Security/Authorization/HouseholdVoter.php +++ b/src/Bundle/ChillPersonBundle/Security/Authorization/HouseholdVoter.php @@ -97,7 +97,7 @@ class HouseholdVoter extends Voter implements ProvideRoleHierarchyInterface, Chi private function checkAssociatedMembersRole(Household $household, string $attribute): bool { - foreach ($household->getCurrentMembers()->map(static fn(HouseholdMember $member) => $member->getPerson()) as $person) { + foreach ($household->getCurrentMembers()->map(static fn (HouseholdMember $member) => $member->getPerson()) as $person) { if ($this->security->isGranted($attribute, $person)) { return true; } diff --git a/src/Bundle/ChillPersonBundle/Serializer/Normalizer/AccompanyingPeriodDocGenNormalizer.php b/src/Bundle/ChillPersonBundle/Serializer/Normalizer/AccompanyingPeriodDocGenNormalizer.php index bbd068fc9..bc13dec66 100644 --- a/src/Bundle/ChillPersonBundle/Serializer/Normalizer/AccompanyingPeriodDocGenNormalizer.php +++ b/src/Bundle/ChillPersonBundle/Serializer/Normalizer/AccompanyingPeriodDocGenNormalizer.php @@ -150,8 +150,8 @@ class AccompanyingPeriodDocGenNormalizer implements ContextAwareNormalizerInterf $this->closingMotiveRender->renderString($period->getClosingMotive(), []) : '', 'ref' => $this->normalizer->normalize($period->getUser(), $format, $userContext), 'hasRef' => $period->getUser() !== null, - 'socialIssuesText' => implode(', ', array_map(fn(SocialIssue $s) => $this->socialIssueRender->renderString($s, []), $period->getSocialIssues()->toArray())), - 'scopesText' => implode(', ', array_map(fn(Scope $s) => $this->translatableStringHelper->localize($s->getName()), $scopes)), + 'socialIssuesText' => implode(', ', array_map(fn (SocialIssue $s) => $this->socialIssueRender->renderString($s, []), $period->getSocialIssues()->toArray())), + 'scopesText' => implode(', ', array_map(fn (Scope $s) => $this->translatableStringHelper->localize($s->getName()), $scopes)), 'hasRequestor' => $period->getRequestor() !== null, 'requestorKind' => $period->getRequestorKind(), 'hasLocation' => $period->getLocation() !== null, diff --git a/src/Bundle/ChillPersonBundle/Serializer/Normalizer/AccompanyingPeriodWorkEvaluationNormalizer.php b/src/Bundle/ChillPersonBundle/Serializer/Normalizer/AccompanyingPeriodWorkEvaluationNormalizer.php index a6b13af4e..a0268ae31 100644 --- a/src/Bundle/ChillPersonBundle/Serializer/Normalizer/AccompanyingPeriodWorkEvaluationNormalizer.php +++ b/src/Bundle/ChillPersonBundle/Serializer/Normalizer/AccompanyingPeriodWorkEvaluationNormalizer.php @@ -48,7 +48,7 @@ class AccompanyingPeriodWorkEvaluationNormalizer implements ContextAwareNormaliz $initial = $this->normalizer->normalize($object, $format, array_merge( $context, [self::IGNORE_EVALUATION => spl_object_hash($object)], - [AbstractNormalizer::CIRCULAR_REFERENCE_HANDLER => static fn($object, $format, $context) => $object->getId()] + [AbstractNormalizer::CIRCULAR_REFERENCE_HANDLER => static fn ($object, $format, $context) => $object->getId()] )); // due to bug: https://api-platform.com/docs/core/serialization/#collection-relation diff --git a/src/Bundle/ChillPersonBundle/Serializer/Normalizer/PersonDocGenNormalizer.php b/src/Bundle/ChillPersonBundle/Serializer/Normalizer/PersonDocGenNormalizer.php index 308fe3ba1..7b500e6bb 100644 --- a/src/Bundle/ChillPersonBundle/Serializer/Normalizer/PersonDocGenNormalizer.php +++ b/src/Bundle/ChillPersonBundle/Serializer/Normalizer/PersonDocGenNormalizer.php @@ -94,7 +94,7 @@ class PersonDocGenNormalizer implements // we simplify the list of attributes for the embedded persons AbstractNormalizer::GROUPS => ['docgen:read'], // when a person reference the same person... take care of circular references - AbstractNormalizer::CIRCULAR_REFERENCE_HANDLER => fn($object, $format, $context) => $this->normalizer->normalize(null, $format, $context), + AbstractNormalizer::CIRCULAR_REFERENCE_HANDLER => fn ($object, $format, $context) => $this->normalizer->normalize(null, $format, $context), ]); if (null === $person) { @@ -115,7 +115,7 @@ class PersonDocGenNormalizer implements 'altNames' => implode( ', ', array_map( - static fn(PersonAltName $altName) => $altName->getLabel(), + static fn (PersonAltName $altName) => $altName->getLabel(), $person->getAltNames()->toArray() ) ), diff --git a/src/Bundle/ChillPersonBundle/Serializer/Normalizer/PersonJsonNormalizer.php b/src/Bundle/ChillPersonBundle/Serializer/Normalizer/PersonJsonNormalizer.php index 29570e532..2cadd0c75 100644 --- a/src/Bundle/ChillPersonBundle/Serializer/Normalizer/PersonJsonNormalizer.php +++ b/src/Bundle/ChillPersonBundle/Serializer/Normalizer/PersonJsonNormalizer.php @@ -257,7 +257,7 @@ class PersonJsonNormalizer implements DenormalizerAwareInterface, NormalizerAwar { return $altNames ->map( - static fn(PersonAltName $personAltName): array => [ + static fn (PersonAltName $personAltName): array => [ 'key' => $personAltName->getKey(), 'label' => $personAltName->getLabel(), ] diff --git a/src/Bundle/ChillPersonBundle/Serializer/Normalizer/SocialIssueNormalizer.php b/src/Bundle/ChillPersonBundle/Serializer/Normalizer/SocialIssueNormalizer.php index 1f8994644..32b1635c4 100644 --- a/src/Bundle/ChillPersonBundle/Serializer/Normalizer/SocialIssueNormalizer.php +++ b/src/Bundle/ChillPersonBundle/Serializer/Normalizer/SocialIssueNormalizer.php @@ -37,7 +37,7 @@ class SocialIssueNormalizer implements ContextAwareNormalizerInterface, Normaliz 'type' => 'social_issue', 'id' => $socialIssue->getId(), 'parent_id' => $socialIssue->hasParent() ? $socialIssue->getParent()->getId() : null, - 'children_ids' => $socialIssue->getChildren()->map(static fn(SocialIssue $si) => $si->getId()), + 'children_ids' => $socialIssue->getChildren()->map(static fn (SocialIssue $si) => $si->getId()), 'title' => $socialIssue->getTitle(), 'text' => $this->render->renderString($socialIssue, []), ]; diff --git a/src/Bundle/ChillPersonBundle/Service/DocGenerator/AccompanyingPeriodContext.php b/src/Bundle/ChillPersonBundle/Service/DocGenerator/AccompanyingPeriodContext.php index ed66593c4..a42765c12 100644 --- a/src/Bundle/ChillPersonBundle/Service/DocGenerator/AccompanyingPeriodContext.php +++ b/src/Bundle/ChillPersonBundle/Service/DocGenerator/AccompanyingPeriodContext.php @@ -143,10 +143,10 @@ class AccompanyingPeriodContext implements ->add('category', EntityType::class, [ 'placeholder' => 'Choose a document category', 'class' => DocumentCategory::class, - 'query_builder' => static fn(EntityRepository $er) => $er->createQueryBuilder('c') + 'query_builder' => static fn (EntityRepository $er) => $er->createQueryBuilder('c') ->where('c.documentClass = :docClass') ->setParameter('docClass', AccompanyingCourseDocument::class), - 'choice_label' => fn($entity = null) => $entity ? $this->translatableStringHelper->localize($entity->getName()) : '', + 'choice_label' => fn ($entity = null) => $entity ? $this->translatableStringHelper->localize($entity->getName()) : '', ]); } @@ -156,7 +156,7 @@ class AccompanyingPeriodContext implements public function buildPublicForm(FormBuilderInterface $builder, DocGeneratorTemplate $template, mixed $entity): void { $options = $template->getOptions(); - $persons = new ArrayCollection($entity->getCurrentParticipations()->map(static fn(AccompanyingPeriodParticipation $p) => $p->getPerson())->toArray()); + $persons = new ArrayCollection($entity->getCurrentParticipations()->map(static fn (AccompanyingPeriodParticipation $p) => $p->getPerson())->toArray()); foreach ($entity->getCurrentParticipations() as $p) { foreach ($p->getPerson()->getResources() as $r) { @@ -181,7 +181,7 @@ class AccompanyingPeriodContext implements $builder->add($key, EntityType::class, [ 'class' => Person::class, 'choices' => $persons, - 'choice_label' => fn(Person $p) => $this->personRender->renderString($p, ['addAge' => true]), + 'choice_label' => fn (Person $p) => $this->personRender->renderString($p, ['addAge' => true]), 'multiple' => false, 'expanded' => true, 'required' => false, diff --git a/src/Bundle/ChillPersonBundle/Service/DocGenerator/AccompanyingPeriodWorkEvaluationContext.php b/src/Bundle/ChillPersonBundle/Service/DocGenerator/AccompanyingPeriodWorkEvaluationContext.php index 325e666b9..34b339822 100644 --- a/src/Bundle/ChillPersonBundle/Service/DocGenerator/AccompanyingPeriodWorkEvaluationContext.php +++ b/src/Bundle/ChillPersonBundle/Service/DocGenerator/AccompanyingPeriodWorkEvaluationContext.php @@ -63,7 +63,7 @@ class AccompanyingPeriodWorkEvaluationContext implements $this->accompanyingPeriodWorkContext->adminFormReverseTransform($data), [ 'evaluations' => array_map( - static fn(Evaluation $e) => $e->getId(), + static fn (Evaluation $e) => $e->getId(), $data['evaluations'] ), ] @@ -76,7 +76,7 @@ class AccompanyingPeriodWorkEvaluationContext implements $this->accompanyingPeriodWorkContext->adminFormTransform($data), [ 'evaluations' => array_map( - fn($id) => $this->evaluationRepository->find($id), + fn ($id) => $this->evaluationRepository->find($id), $data['evaluations'] ?? [] ), ] @@ -93,7 +93,7 @@ class AccompanyingPeriodWorkEvaluationContext implements 'class' => Evaluation::class, 'label' => 'Linked evaluations', 'choices' => $this->evaluationRepository->findAll(), - 'choice_label' => fn(Evaluation $e) => $this->translatableStringHelper->localize($e->getTitle()), + 'choice_label' => fn (Evaluation $e) => $this->translatableStringHelper->localize($e->getTitle()), 'multiple' => true, 'attr' => ['class' => 'select2'], ]); diff --git a/src/Bundle/ChillPersonBundle/Service/DocGenerator/PersonContext.php b/src/Bundle/ChillPersonBundle/Service/DocGenerator/PersonContext.php index 8a7b7e2ba..1fdfd23d9 100644 --- a/src/Bundle/ChillPersonBundle/Service/DocGenerator/PersonContext.php +++ b/src/Bundle/ChillPersonBundle/Service/DocGenerator/PersonContext.php @@ -126,10 +126,10 @@ final class PersonContext implements PersonContextInterface ->add('category', EntityType::class, [ 'placeholder' => 'Choose a document category', 'class' => DocumentCategory::class, - 'query_builder' => static fn(EntityRepository $er) => $er->createQueryBuilder('c') + 'query_builder' => static fn (EntityRepository $er) => $er->createQueryBuilder('c') ->where('c.documentClass = :docClass') ->setParameter('docClass', PersonDocument::class), - 'choice_label' => fn($entity = null) => $entity ? $this->translatableStringHelper->localize($entity->getName()) : '', + 'choice_label' => fn ($entity = null) => $entity ? $this->translatableStringHelper->localize($entity->getName()) : '', 'required' => true, ]); } diff --git a/src/Bundle/ChillPersonBundle/Tests/Controller/AccompanyingCourseApiControllerTest.php b/src/Bundle/ChillPersonBundle/Tests/Controller/AccompanyingCourseApiControllerTest.php index 53d6a0a93..ac722f2f6 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Controller/AccompanyingCourseApiControllerTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Controller/AccompanyingCourseApiControllerTest.php @@ -342,7 +342,7 @@ final class AccompanyingCourseApiControllerTest extends WebTestCase // check that the person id is contained $participationsPersonsIds = array_map( - static fn($participation) => $participation->person->id, + static fn ($participation) => $participation->person->id, $data->participations ); diff --git a/src/Bundle/ChillPersonBundle/Tests/Controller/HouseholdApiControllerTest.php b/src/Bundle/ChillPersonBundle/Tests/Controller/HouseholdApiControllerTest.php index cb0587b5e..f01eeeaa9 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Controller/HouseholdApiControllerTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Controller/HouseholdApiControllerTest.php @@ -161,7 +161,7 @@ final class HouseholdApiControllerTest extends WebTestCase $this->assertArrayHasKey('count', $data); $this->assertArrayHasKey('results', $data); - $householdIds = array_map(static fn($r) => $r['id'], $data['results']); + $householdIds = array_map(static fn ($r) => $r['id'], $data['results']); $this->assertContains($expectedHouseholdId, $householdIds); } diff --git a/src/Bundle/ChillPersonBundle/Tests/Controller/PersonControllerUpdateTest.php b/src/Bundle/ChillPersonBundle/Tests/Controller/PersonControllerUpdateTest.php index cf8c134ad..94b618e41 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Controller/PersonControllerUpdateTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Controller/PersonControllerUpdateTest.php @@ -294,23 +294,23 @@ final class PersonControllerUpdateTest extends WebTestCase public function validTextFieldsProvider() { return [ - ['firstName', 'random Value', static fn(Person $person) => $person->getFirstName()], - ['lastName', 'random Value', static fn(Person $person) => $person->getLastName()], + ['firstName', 'random Value', static fn (Person $person) => $person->getFirstName()], + ['lastName', 'random Value', static fn (Person $person) => $person->getLastName()], // reminder: this value is capitalized - ['placeOfBirth', 'A PLACE', static fn(Person $person) => $person->getPlaceOfBirth()], - ['birthdate', '1980-12-15', static fn(Person $person) => $person->getBirthdate()->format('Y-m-d')], + ['placeOfBirth', 'A PLACE', static fn (Person $person) => $person->getPlaceOfBirth()], + ['birthdate', '1980-12-15', static fn (Person $person) => $person->getBirthdate()->format('Y-m-d')], // TODO test on phonenumber update // ['phonenumber', '+32123456789', static function (Person $person) { return $person->getPhonenumber(); }], - ['memo', 'jfkdlmq jkfldmsq jkmfdsq', static fn(Person $person) => $person->getMemo()], - ['countryOfBirth', 'BE', static fn(Person $person) => $person->getCountryOfBirth()->getCountryCode()], - ['nationality', 'FR', static fn(Person $person) => $person->getNationality()->getCountryCode()], - ['placeOfBirth', '', static fn(Person $person) => $person->getPlaceOfBirth()], - ['birthdate', '', static fn(Person $person) => $person->getBirthdate()], + ['memo', 'jfkdlmq jkfldmsq jkmfdsq', static fn (Person $person) => $person->getMemo()], + ['countryOfBirth', 'BE', static fn (Person $person) => $person->getCountryOfBirth()->getCountryCode()], + ['nationality', 'FR', static fn (Person $person) => $person->getNationality()->getCountryCode()], + ['placeOfBirth', '', static fn (Person $person) => $person->getPlaceOfBirth()], + ['birthdate', '', static fn (Person $person) => $person->getBirthdate()], //['phonenumber', '', static function (Person $person) { return $person->getPhonenumber(); }], - ['memo', '', static fn(Person $person) => $person->getMemo()], - ['countryOfBirth', null, static fn(Person $person) => $person->getCountryOfBirth()], - ['nationality', null, static fn(Person $person) => $person->getNationality()], - ['gender', Person::FEMALE_GENDER, static fn(Person $person) => $person->getGender()], + ['memo', '', static fn (Person $person) => $person->getMemo()], + ['countryOfBirth', null, static fn (Person $person) => $person->getCountryOfBirth()], + ['nationality', null, static fn (Person $person) => $person->getNationality()], + ['gender', Person::FEMALE_GENDER, static fn (Person $person) => $person->getGender()], ]; } diff --git a/src/Bundle/ChillPersonBundle/Tests/Controller/PersonControllerUpdateWithHiddenFieldsTest.php b/src/Bundle/ChillPersonBundle/Tests/Controller/PersonControllerUpdateWithHiddenFieldsTest.php index d9cf2241a..441358c02 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Controller/PersonControllerUpdateWithHiddenFieldsTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Controller/PersonControllerUpdateWithHiddenFieldsTest.php @@ -197,12 +197,12 @@ final class PersonControllerUpdateWithHiddenFieldsTest extends WebTestCase public function validTextFieldsProvider() { return [ - ['firstName', 'random Value', static fn(Person $person) => $person->getFirstName()], - ['lastName', 'random Value', static fn(Person $person) => $person->getLastName()], - ['birthdate', '15-12-1980', static fn(Person $person) => $person->getBirthdate()->format('d-m-Y')], - ['memo', 'jfkdlmq jkfldmsq jkmfdsq', static fn(Person $person) => $person->getMemo()], - ['birthdate', '', static fn(Person $person) => $person->getBirthdate()], - ['gender', Person::FEMALE_GENDER, static fn(Person $person) => $person->getGender()], + ['firstName', 'random Value', static fn (Person $person) => $person->getFirstName()], + ['lastName', 'random Value', static fn (Person $person) => $person->getLastName()], + ['birthdate', '15-12-1980', static fn (Person $person) => $person->getBirthdate()->format('d-m-Y')], + ['memo', 'jfkdlmq jkfldmsq jkmfdsq', static fn (Person $person) => $person->getMemo()], + ['birthdate', '', static fn (Person $person) => $person->getBirthdate()], + ['gender', Person::FEMALE_GENDER, static fn (Person $person) => $person->getGender()], ]; } diff --git a/src/Bundle/ChillPersonBundle/Tests/Entity/AccompanyingPeriodTest.php b/src/Bundle/ChillPersonBundle/Tests/Entity/AccompanyingPeriodTest.php index 5ce35317e..0a9c22df1 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Entity/AccompanyingPeriodTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Entity/AccompanyingPeriodTest.php @@ -152,7 +152,7 @@ final class AccompanyingPeriodTest extends \PHPUnit\Framework\TestCase $locations = $period->getLocationHistories()->toArray(); - usort($locations, static fn(AccompanyingPeriod\AccompanyingPeriodLocationHistory $a, AccompanyingPeriod\AccompanyingPeriodLocationHistory $b) => $a->getStartDate() <=> $b->getStartDate()); + usort($locations, static fn (AccompanyingPeriod\AccompanyingPeriodLocationHistory $a, AccompanyingPeriod\AccompanyingPeriodLocationHistory $b) => $a->getStartDate() <=> $b->getStartDate()); $iterator = new ArrayIterator($locations); $iterator->rewind(); diff --git a/src/Bundle/ChillPersonBundle/Tests/Household/MembersEditorTest.php b/src/Bundle/ChillPersonBundle/Tests/Household/MembersEditorTest.php index 55169757f..8ec7ee573 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Household/MembersEditorTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Household/MembersEditorTest.php @@ -101,13 +101,13 @@ final class MembersEditorTest extends TestCase $editor = $factory->createEditor($household2 = new Household()); $editor->addMovement(new DateTimeImmutable('yesterday'), $person, $positionNotSharing); - $sharings = $household->getCurrentMembers()->filter(static fn(HouseholdMember $m) => $m->getShareHousehold()); - $notSharing = $household2->getCurrentMembers()->filter(static fn(HouseholdMember $m) => !$m->getShareHousehold()); + $sharings = $household->getCurrentMembers()->filter(static fn (HouseholdMember $m) => $m->getShareHousehold()); + $notSharing = $household2->getCurrentMembers()->filter(static fn (HouseholdMember $m) => !$m->getShareHousehold()); $this->assertCount(1, $notSharing); $this->assertCount(1, $sharings); - $getPerson = static fn(HouseholdMember $m) => $m->getPerson(); + $getPerson = static fn (HouseholdMember $m) => $m->getPerson(); $this->assertContains($person, $notSharing->map($getPerson)); } @@ -137,13 +137,13 @@ final class MembersEditorTest extends TestCase $editor = $factory->createEditor($household); $editor->addMovement(new DateTimeImmutable('yesterday'), $person, $positionNotSharing); - $sharings = $household->getCurrentMembers()->filter(static fn(HouseholdMember $m) => $m->getShareHousehold()); - $notSharing = $household->getCurrentMembers()->filter(static fn(HouseholdMember $m) => !$m->getShareHousehold()); + $sharings = $household->getCurrentMembers()->filter(static fn (HouseholdMember $m) => $m->getShareHousehold()); + $notSharing = $household->getCurrentMembers()->filter(static fn (HouseholdMember $m) => !$m->getShareHousehold()); $this->assertCount(1, $notSharing); $this->assertCount(0, $sharings); - $getPerson = static fn(HouseholdMember $m) => $m->getPerson(); + $getPerson = static fn (HouseholdMember $m) => $m->getPerson(); $this->assertContains($person, $notSharing->map($getPerson)); } diff --git a/src/Bundle/ChillPersonBundle/Tests/Serializer/Normalizer/PersonDocGenNormalizerTest.php b/src/Bundle/ChillPersonBundle/Tests/Serializer/Normalizer/PersonDocGenNormalizerTest.php index 6057a29c9..f7a05f7ce 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Serializer/Normalizer/PersonDocGenNormalizerTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Serializer/Normalizer/PersonDocGenNormalizerTest.php @@ -318,7 +318,7 @@ final class PersonDocGenNormalizerTest extends KernelTestCase $normalizerManager = $this->prophesize(NormalizerInterface::class); $normalizerManager->supportsNormalization(Argument::any(), 'docgen', Argument::any())->willReturn(true); $normalizerManager->normalize(Argument::type(Person::class), 'docgen', Argument::any()) - ->will(static fn($args) => $normalizer->normalize($args[0], $args[1], $args[2])); + ->will(static fn ($args) => $normalizer->normalize($args[0], $args[1], $args[2])); $normalizerManager->normalize(Argument::any(), 'docgen', Argument::any())->will( static function ($args) { if (is_iterable($args[0])) { diff --git a/src/Bundle/ChillPersonBundle/Tests/Serializer/Normalizer/RelationshipDocGenNormalizerTest.php b/src/Bundle/ChillPersonBundle/Tests/Serializer/Normalizer/RelationshipDocGenNormalizerTest.php index 6d841436e..6b3f49fde 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Serializer/Normalizer/RelationshipDocGenNormalizerTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Serializer/Normalizer/RelationshipDocGenNormalizerTest.php @@ -118,7 +118,7 @@ final class RelationshipDocGenNormalizerTest extends TestCase { $translatableStringHelper = $this->prophesize(TranslatableStringHelperInterface::class); $translatableStringHelper->localize(Argument::type('array'))->will( - static fn($args) => $args[0][array_keys($args[0])[0]] + static fn ($args) => $args[0][array_keys($args[0])[0]] ); $normalizer = new RelationshipDocGenNormalizer( @@ -128,7 +128,7 @@ final class RelationshipDocGenNormalizerTest extends TestCase $normalizerManager = $this->prophesize(NormalizerInterface::class); $normalizerManager->supportsNormalization(Argument::any(), 'docgen', Argument::any())->willReturn(true); $normalizerManager->normalize(Argument::type(Relationship::class), 'docgen', Argument::any()) - ->will(static fn($args) => $normalizer->normalize($args[0], $args[1], $args[2])); + ->will(static fn ($args) => $normalizer->normalize($args[0], $args[1], $args[2])); $normalizerManager->normalize(Argument::any(), 'docgen', Argument::any())->will( static function ($args) { if (null === $args[0]) { diff --git a/src/Bundle/ChillPersonBundle/Tests/Service/DocGenerator/PersonContextTest.php b/src/Bundle/ChillPersonBundle/Tests/Service/DocGenerator/PersonContextTest.php index e84b27813..d0138dc30 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Service/DocGenerator/PersonContextTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Service/DocGenerator/PersonContextTest.php @@ -263,7 +263,7 @@ final class PersonContextTest extends TestCase if (null === $translatableStringHelper) { $translatableStringHelper = $this->prophesize(TranslatableStringHelperInterface::class); // return only the 'fr' key - $translatableStringHelper->localize(Argument::type('array'))->will(static fn($args) => $args[0]['fr']); + $translatableStringHelper->localize(Argument::type('array'))->will(static fn ($args) => $args[0]['fr']); $translatableStringHelper = $translatableStringHelper->reveal(); } diff --git a/src/Bundle/ChillPersonBundle/Tests/Service/DocGenerator/PersonContextWithThirdPartyTest.php b/src/Bundle/ChillPersonBundle/Tests/Service/DocGenerator/PersonContextWithThirdPartyTest.php index 753a9f855..70bccfda4 100644 --- a/src/Bundle/ChillPersonBundle/Tests/Service/DocGenerator/PersonContextWithThirdPartyTest.php +++ b/src/Bundle/ChillPersonBundle/Tests/Service/DocGenerator/PersonContextWithThirdPartyTest.php @@ -70,7 +70,7 @@ final class PersonContextWithThirdPartyTest extends KernelTestCase { $normalizer = $this->prophesize(NormalizerInterface::class); $normalizer->normalize(Argument::type(ThirdParty::class), 'docgen', Argument::type('array')) - ->will(static fn($args): array => ['class' => '3party', 'hash' => spl_object_hash($args[0])]); + ->will(static fn ($args): array => ['class' => '3party', 'hash' => spl_object_hash($args[0])]); $personContext = $this->prophesize(PersonContextInterface::class); diff --git a/src/Bundle/ChillPersonBundle/Validator/Constraints/AccompanyingPeriod/AccompanyingPeriodValidityValidator.php b/src/Bundle/ChillPersonBundle/Validator/Constraints/AccompanyingPeriod/AccompanyingPeriodValidityValidator.php index cae4829f7..ed0337f1f 100644 --- a/src/Bundle/ChillPersonBundle/Validator/Constraints/AccompanyingPeriod/AccompanyingPeriodValidityValidator.php +++ b/src/Bundle/ChillPersonBundle/Validator/Constraints/AccompanyingPeriod/AccompanyingPeriodValidityValidator.php @@ -74,7 +74,7 @@ class AccompanyingPeriodValidityValidator extends ConstraintValidator $periodIssuesWithAncestors = array_merge( $periodIssuesWithAncestors, array_map( - static fn(SocialIssue $si) => spl_object_hash($si), + static fn (SocialIssue $si) => spl_object_hash($si), $si->getAncestors(true) ) ); diff --git a/src/Bundle/ChillReportBundle/Export/Export/ReportList.php b/src/Bundle/ChillReportBundle/Export/Export/ReportList.php index d957f37e3..9adae0097 100644 --- a/src/Bundle/ChillReportBundle/Export/Export/ReportList.php +++ b/src/Bundle/ChillReportBundle/Export/Export/ReportList.php @@ -331,7 +331,7 @@ class ReportList implements ExportElementValidatedInterface, ListInterface public function initiateQuery(array $requiredModifiers, array $acl, array $data = []) { - $centers = array_map(static fn($el) => $el['center'], $acl); + $centers = array_map(static fn ($el) => $el['center'], $acl); // throw an error if any fields are present if (!array_key_exists('fields', $data)) { @@ -503,7 +503,7 @@ class ReportList implements ExportElementValidatedInterface, ListInterface private function getCustomFields() { return array_filter($this->customfieldsGroup - ->getCustomFields()->toArray(), static fn(CustomField $cf) => $cf->getType() !== 'title'); + ->getCustomFields()->toArray(), static fn (CustomField $cf) => $cf->getType() !== 'title'); } private function getLabelForCustomField($key, array $values, $data) diff --git a/src/Bundle/ChillReportBundle/Search/ReportSearch.php b/src/Bundle/ChillReportBundle/Search/ReportSearch.php index e0aaa89e1..b08e01ee5 100644 --- a/src/Bundle/ChillReportBundle/Search/ReportSearch.php +++ b/src/Bundle/ChillReportBundle/Search/ReportSearch.php @@ -97,7 +97,7 @@ class ReportSearch extends AbstractSearch implements ContainerAwareInterface foreach ($reachableCenters as $center) { $reachableScopesId = array_map( - static fn(Scope $scope) => $scope->getId(), + static fn (Scope $scope) => $scope->getId(), $this->helper->getReachableScopes($this->user, $role, $center) ); $whereElement->add( diff --git a/src/Bundle/ChillReportBundle/Tests/Controller/ReportControllerNextTest.php b/src/Bundle/ChillReportBundle/Tests/Controller/ReportControllerNextTest.php index 803ecf38f..5c25861b1 100644 --- a/src/Bundle/ChillReportBundle/Tests/Controller/ReportControllerNextTest.php +++ b/src/Bundle/ChillReportBundle/Tests/Controller/ReportControllerNextTest.php @@ -68,7 +68,7 @@ final class ReportControllerNextTest extends WebTestCase //filter customFieldsGroup to get only "situation de logement" $filteredCustomFieldsGroupHouse = array_filter( $customFieldsGroups, - static fn(CustomFieldsGroup $group) => in_array('Situation de logement', $group->getName(), true) + static fn (CustomFieldsGroup $group) => in_array('Situation de logement', $group->getName(), true) ); $this->group = $filteredCustomFieldsGroupHouse[0]; } diff --git a/src/Bundle/ChillReportBundle/Tests/Controller/ReportControllerTest.php b/src/Bundle/ChillReportBundle/Tests/Controller/ReportControllerTest.php index cd3b0f185..69ccd3d54 100644 --- a/src/Bundle/ChillReportBundle/Tests/Controller/ReportControllerTest.php +++ b/src/Bundle/ChillReportBundle/Tests/Controller/ReportControllerTest.php @@ -86,7 +86,7 @@ final class ReportControllerTest extends WebTestCase //filter customFieldsGroup to get only "situation de logement" $filteredCustomFieldsGroupHouse = array_filter( $customFieldsGroups, - static fn(CustomFieldsGroup $group) => in_array('Situation de logement', $group->getName(), true) + static fn (CustomFieldsGroup $group) => in_array('Situation de logement', $group->getName(), true) ); self::$group = $filteredCustomFieldsGroupHouse[0]; diff --git a/src/Bundle/ChillReportBundle/Tests/Timeline/TimelineProviderTest.php b/src/Bundle/ChillReportBundle/Tests/Timeline/TimelineProviderTest.php index 253616a84..95f85ed1f 100644 --- a/src/Bundle/ChillReportBundle/Tests/Timeline/TimelineProviderTest.php +++ b/src/Bundle/ChillReportBundle/Tests/Timeline/TimelineProviderTest.php @@ -67,7 +67,7 @@ final class TimelineProviderTest extends WebTestCase self::$em ->getRepository(\Chill\MainBundle\Entity\Scope::class) ->findAll(), - static fn(Scope $scope) => $scope->getName()['en'] === 'social' + static fn (Scope $scope) => $scope->getName()['en'] === 'social' ); $report = (new Report()) diff --git a/src/Bundle/ChillTaskBundle/Controller/TaskController.php b/src/Bundle/ChillTaskBundle/Controller/TaskController.php index 2c052619b..435c9eaa2 100644 --- a/src/Bundle/ChillTaskBundle/Controller/TaskController.php +++ b/src/Bundle/ChillTaskBundle/Controller/TaskController.php @@ -94,7 +94,7 @@ class TaskController extends AbstractController $transitionInstance = array_values( // array_values needed to reset keys (array_filter preserves keys) array_filter( $workflow->getEnabledTransitions($task), - static fn(Transition $t) => $t->getName() === $transition + static fn (Transition $t) => $t->getName() === $transition ) )[0]; diff --git a/src/Bundle/ChillTaskBundle/Form/SingleTaskListType.php b/src/Bundle/ChillTaskBundle/Form/SingleTaskListType.php index ec336856e..2af71810d 100644 --- a/src/Bundle/ChillTaskBundle/Form/SingleTaskListType.php +++ b/src/Bundle/ChillTaskBundle/Form/SingleTaskListType.php @@ -218,9 +218,9 @@ class SingleTaskListType extends AbstractType $users = $this->getUsersAssigneedToTask($options); $choices = array_combine( // get usernames - array_map(static fn(User $user) => $user->getUsername(), $users), + array_map(static fn (User $user) => $user->getUsername(), $users), // get ids - array_map(static fn(User $user) => $user->getId(), $users) + array_map(static fn (User $user) => $user->getId(), $users) ); $choices['Unassigned'] = '_unassigned'; diff --git a/src/Bundle/ChillTaskBundle/Tests/Controller/SingleTaskControllerTest.php b/src/Bundle/ChillTaskBundle/Tests/Controller/SingleTaskControllerTest.php index 50c360610..2ff7092f0 100644 --- a/src/Bundle/ChillTaskBundle/Tests/Controller/SingleTaskControllerTest.php +++ b/src/Bundle/ChillTaskBundle/Tests/Controller/SingleTaskControllerTest.php @@ -92,7 +92,7 @@ final class SingleTaskControllerTest extends WebTestCase $center = array_filter( $centers, - static fn(Center $c) => $c->getName() === $centerName + static fn (Center $c) => $c->getName() === $centerName )[0]; $ids = $em diff --git a/src/Bundle/ChillTaskBundle/Timeline/SingleTaskTaskLifeCycleEventTimelineProvider.php b/src/Bundle/ChillTaskBundle/Timeline/SingleTaskTaskLifeCycleEventTimelineProvider.php index c07fd707e..9a8fcf6bd 100644 --- a/src/Bundle/ChillTaskBundle/Timeline/SingleTaskTaskLifeCycleEventTimelineProvider.php +++ b/src/Bundle/ChillTaskBundle/Timeline/SingleTaskTaskLifeCycleEventTimelineProvider.php @@ -86,7 +86,7 @@ class SingleTaskTaskLifeCycleEventTimelineProvider implements TimelineProviderIn ->findBy(['id' => $ids]); return array_combine( - array_map(static fn($e) => $e->getId(), $events), + array_map(static fn ($e) => $e->getId(), $events), $events ); } diff --git a/src/Bundle/ChillTaskBundle/Timeline/TaskLifeCycleEventTimelineProvider.php b/src/Bundle/ChillTaskBundle/Timeline/TaskLifeCycleEventTimelineProvider.php index e6f98cef9..aa8776aa2 100644 --- a/src/Bundle/ChillTaskBundle/Timeline/TaskLifeCycleEventTimelineProvider.php +++ b/src/Bundle/ChillTaskBundle/Timeline/TaskLifeCycleEventTimelineProvider.php @@ -97,7 +97,7 @@ class TaskLifeCycleEventTimelineProvider implements TimelineProviderInterface ->findBy(['id' => $ids]); return array_combine( - array_map(static fn($e) => $e->getId(), $events), + array_map(static fn ($e) => $e->getId(), $events), $events ); } diff --git a/src/Bundle/ChillThirdPartyBundle/DataFixtures/ORM/LoadThirdParty.php b/src/Bundle/ChillThirdPartyBundle/DataFixtures/ORM/LoadThirdParty.php index 8250f7bf0..e813cbd7f 100644 --- a/src/Bundle/ChillThirdPartyBundle/DataFixtures/ORM/LoadThirdParty.php +++ b/src/Bundle/ChillThirdPartyBundle/DataFixtures/ORM/LoadThirdParty.php @@ -69,7 +69,7 @@ class LoadThirdParty extends Fixture implements DependentFixtureInterface private function getCenters(): Iterator { $references = array_map( - static fn($a) => $a['ref'], + static fn ($a) => $a['ref'], LoadCenters::$centers ); $number = random_int(1, count($references)); diff --git a/src/Bundle/ChillThirdPartyBundle/Form/Type/PickThirdPartyType.php b/src/Bundle/ChillThirdPartyBundle/Form/Type/PickThirdPartyType.php index 01309a37e..0dd4f16e6 100644 --- a/src/Bundle/ChillThirdPartyBundle/Form/Type/PickThirdPartyType.php +++ b/src/Bundle/ChillThirdPartyBundle/Form/Type/PickThirdPartyType.php @@ -103,8 +103,8 @@ class PickThirdPartyType extends AbstractType $resolver ->setDefault('class', ThirdParty::class) - ->setDefault('choice_label', static fn(ThirdParty $tp) => $tp->getName()) - ->setDefault('choice_loader', fn(Options $options) => new ThirdPartyChoiceLoader( + ->setDefault('choice_label', static fn (ThirdParty $tp) => $tp->getName()) + ->setDefault('choice_loader', fn (Options $options) => new ThirdPartyChoiceLoader( $options['center'], $this->em->getRepository(ThirdParty::class) )); diff --git a/src/Bundle/ChillThirdPartyBundle/Form/Type/PickThirdPartyTypeCategoryType.php b/src/Bundle/ChillThirdPartyBundle/Form/Type/PickThirdPartyTypeCategoryType.php index 6bc83f0f2..26cb0ae2e 100644 --- a/src/Bundle/ChillThirdPartyBundle/Form/Type/PickThirdPartyTypeCategoryType.php +++ b/src/Bundle/ChillThirdPartyBundle/Form/Type/PickThirdPartyTypeCategoryType.php @@ -77,7 +77,7 @@ class PickThirdPartyTypeCategoryType extends \Symfony\Component\Form\AbstractTyp return self::PREFIX_TYPE . $item; }, - 'choice_value' => fn($item) => $this->reverseTransform($item), + 'choice_value' => fn ($item) => $this->reverseTransform($item), ]); }