mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-30 11:33:49 +00:00
DX: rector rules upt to PHP 74
This commit is contained in:
@@ -211,13 +211,9 @@ class ActivityType extends AbstractType
|
||||
'required' => $activityType->isRequired('attendee'),
|
||||
'expanded' => true,
|
||||
'class' => ActivityPresence::class,
|
||||
'choice_label' => function (ActivityPresence $activityPresence) {
|
||||
return $this->translatableStringHelper->localize($activityPresence->getName());
|
||||
},
|
||||
'query_builder' => static function (EntityRepository $er) {
|
||||
return $er->createQueryBuilder('a')
|
||||
->where('a.active = true');
|
||||
},
|
||||
'choice_label' => fn(ActivityPresence $activityPresence) => $this->translatableStringHelper->localize($activityPresence->getName()),
|
||||
'query_builder' => static fn(EntityRepository $er) => $er->createQueryBuilder('a')
|
||||
->where('a.active = true'),
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -357,9 +353,7 @@ class ActivityType extends AbstractType
|
||||
|
||||
return (string) $location->getId();
|
||||
},
|
||||
function (?string $id): ?Location {
|
||||
return $this->om->getRepository(Location::class)->findOneBy(['id' => (int) $id]);
|
||||
}
|
||||
fn(?string $id): ?Location => $this->om->getRepository(Location::class)->findOneBy(['id' => (int) $id])
|
||||
));
|
||||
}
|
||||
|
||||
|
@@ -45,9 +45,7 @@ class ActivityTypeType extends AbstractType
|
||||
])
|
||||
->add('category', EntityType::class, [
|
||||
'class' => ActivityTypeCategory::class,
|
||||
'choice_label' => function (ActivityTypeCategory $activityTypeCategory) {
|
||||
return $this->translatableStringHelper->localize($activityTypeCategory->getName());
|
||||
},
|
||||
'choice_label' => fn(ActivityTypeCategory $activityTypeCategory) => $this->translatableStringHelper->localize($activityTypeCategory->getName()),
|
||||
])
|
||||
->add('ordering', NumberType::class, [
|
||||
'required' => true,
|
||||
|
@@ -45,9 +45,7 @@ class PickActivityReasonType extends AbstractType
|
||||
$resolver->setDefaults(
|
||||
[
|
||||
'class' => ActivityReason::class,
|
||||
'choice_label' => function (ActivityReason $choice) {
|
||||
return $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());
|
||||
|
@@ -38,10 +38,8 @@ class TranslatableActivityReasonCategoryType extends AbstractType
|
||||
$resolver->setDefaults(
|
||||
[
|
||||
'class' => ActivityReasonCategory::class,
|
||||
'choice_label' => function (ActivityReasonCategory $category) {
|
||||
return $this->translatableStringHelper->localize($category->getName())
|
||||
. (!$category->getActive() ? ' (' . $this->translator->trans('inactive') . ')' : '');
|
||||
},
|
||||
'choice_label' => fn(ActivityReasonCategory $category) => $this->translatableStringHelper->localize($category->getName())
|
||||
. (!$category->getActive() ? ' (' . $this->translator->trans('inactive') . ')' : ''),
|
||||
]
|
||||
);
|
||||
}
|
||||
|
@@ -39,9 +39,7 @@ class TranslatableActivityType extends AbstractType
|
||||
'class' => ActivityType::class,
|
||||
'active_only' => true,
|
||||
'choices' => $this->activityTypeRepository->findAllActive(),
|
||||
'choice_label' => function (ActivityType $type) {
|
||||
return $this->translatableStringHelper->localize($type->getName());
|
||||
},
|
||||
'choice_label' => fn(ActivityType $type) => $this->translatableStringHelper->localize($type->getName()),
|
||||
]
|
||||
);
|
||||
}
|
||||
|
Reference in New Issue
Block a user