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

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

View File

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

View File

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

View File

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