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

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

View File

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

View File

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