DX: fix cs

This commit is contained in:
2023-04-15 00:43:55 +02:00
parent 80647147ee
commit 746ed4f5e5
188 changed files with 309 additions and 308 deletions

View File

@@ -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])
));
}

View File

@@ -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,

View File

@@ -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());

View File

@@ -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') . ')' : ''),
]
);

View File

@@ -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()),
]
);
}