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

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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