mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-20 14:43:49 +00:00
DX: rector rules upt to PHP 74
This commit is contained in:
@@ -128,9 +128,7 @@ final class GeographicalUnitStatAggregator implements AggregatorInterface
|
||||
'placeholder' => 'Select a geographical layer',
|
||||
'class' => GeographicalUnitLayer::class,
|
||||
'choices' => $this->geographicalUnitLayerRepository->findAllHavingUnits(),
|
||||
'choice_label' => function (GeographicalUnitLayer $item) {
|
||||
return $this->translatableStringHelper->localize($item->getName());
|
||||
},
|
||||
'choice_label' => fn(GeographicalUnitLayer $item) => $this->translatableStringHelper->localize($item->getName()),
|
||||
]);
|
||||
}
|
||||
|
||||
|
@@ -147,9 +147,7 @@ final class CountryOfBirthAggregator implements AggregatorInterface, ExportEleme
|
||||
];
|
||||
}
|
||||
|
||||
return static function (string $value) use ($labels): string {
|
||||
return $labels[$value];
|
||||
};
|
||||
return static fn(string $value): string => $labels[$value];
|
||||
}
|
||||
|
||||
public function getQueryKeys($data)
|
||||
|
@@ -100,9 +100,7 @@ class GeographicalUnitAggregator implements AggregatorInterface
|
||||
'placeholder' => 'Select a geographical layer',
|
||||
'class' => GeographicalUnitLayer::class,
|
||||
'choices' => $this->geographicalUnitLayerRepository->findAllHavingUnits(),
|
||||
'choice_label' => function (GeographicalUnitLayer $item) {
|
||||
return $this->translatableStringHelper->localize($item->getName());
|
||||
},
|
||||
'choice_label' => fn(GeographicalUnitLayer $item) => $this->translatableStringHelper->localize($item->getName()),
|
||||
]);
|
||||
}
|
||||
|
||||
|
@@ -141,9 +141,7 @@ final class NationalityAggregator implements AggregatorInterface, ExportElementV
|
||||
];
|
||||
}
|
||||
|
||||
return static function ($value) use ($labels): string {
|
||||
return $labels[$value];
|
||||
};
|
||||
return static fn($value): string => $labels[$value];
|
||||
}
|
||||
|
||||
public function getQueryKeys($data)
|
||||
|
@@ -64,9 +64,7 @@ class CountAccompanyingCourse implements ExportInterface, GroupedExportInterface
|
||||
$labels = array_combine($values, $values);
|
||||
$labels['_header'] = $this->getTitle();
|
||||
|
||||
return static function ($value) use ($labels) {
|
||||
return $labels[$value];
|
||||
};
|
||||
return static fn($value) => $labels[$value];
|
||||
}
|
||||
|
||||
public function getQueryKeys($data): array
|
||||
@@ -91,9 +89,7 @@ class CountAccompanyingCourse implements ExportInterface, GroupedExportInterface
|
||||
|
||||
public function initiateQuery(array $requiredModifiers, array $acl, array $data = []): QueryBuilder
|
||||
{
|
||||
$centers = array_map(static function ($el) {
|
||||
return $el['center'];
|
||||
}, $acl);
|
||||
$centers = array_map(static fn($el) => $el['center'], $acl);
|
||||
|
||||
$qb = $this->repository->createQueryBuilder('acp');
|
||||
|
||||
|
@@ -63,9 +63,7 @@ class CountAccompanyingPeriodWork implements ExportInterface, GroupedExportInter
|
||||
$labels = array_combine($values, $values);
|
||||
$labels['_header'] = $this->getTitle();
|
||||
|
||||
return static function ($value) use ($labels) {
|
||||
return $labels[$value];
|
||||
};
|
||||
return static fn($value) => $labels[$value];
|
||||
}
|
||||
|
||||
public function getQueryKeys($data): array
|
||||
@@ -90,9 +88,7 @@ class CountAccompanyingPeriodWork implements ExportInterface, GroupedExportInter
|
||||
|
||||
public function initiateQuery(array $requiredModifiers, array $acl, array $data = []): QueryBuilder
|
||||
{
|
||||
$centers = array_map(static function ($el) {
|
||||
return $el['center'];
|
||||
}, $acl);
|
||||
$centers = array_map(static fn($el) => $el['center'], $acl);
|
||||
|
||||
$qb = $this->em->createQueryBuilder();
|
||||
|
||||
|
@@ -62,9 +62,7 @@ class CountEvaluation implements ExportInterface, GroupedExportInterface
|
||||
$labels = array_combine($values, $values);
|
||||
$labels['_header'] = $this->getTitle();
|
||||
|
||||
return static function ($value) use ($labels) {
|
||||
return $labels[$value];
|
||||
};
|
||||
return static fn($value) => $labels[$value];
|
||||
}
|
||||
|
||||
public function getQueryKeys($data): array
|
||||
@@ -89,9 +87,7 @@ class CountEvaluation implements ExportInterface, GroupedExportInterface
|
||||
|
||||
public function initiateQuery(array $requiredModifiers, array $acl, array $data = [])
|
||||
{
|
||||
$centers = array_map(static function ($el) {
|
||||
return $el['center'];
|
||||
}, $acl);
|
||||
$centers = array_map(static fn($el) => $el['center'], $acl);
|
||||
|
||||
$qb = $this->entityManager->createQueryBuilder();
|
||||
|
||||
|
@@ -113,9 +113,7 @@ class CountHousehold implements ExportInterface, GroupedExportInterface
|
||||
|
||||
public function initiateQuery(array $requiredModifiers, array $acl, array $data = [])
|
||||
{
|
||||
$centers = array_map(static function ($el) {
|
||||
return $el['center'];
|
||||
}, $acl);
|
||||
$centers = array_map(static fn($el) => $el['center'], $acl);
|
||||
|
||||
$qb = $this->entityManager->createQueryBuilder();
|
||||
|
||||
|
@@ -62,9 +62,7 @@ class CountPerson implements ExportInterface, GroupedExportInterface
|
||||
$labels = array_combine($values, $values);
|
||||
$labels['_header'] = $this->getTitle();
|
||||
|
||||
return static function ($value) use ($labels) {
|
||||
return $labels[$value];
|
||||
};
|
||||
return static fn($value) => $labels[$value];
|
||||
}
|
||||
|
||||
public function getQueryKeys($data)
|
||||
@@ -94,9 +92,7 @@ class CountPerson implements ExportInterface, GroupedExportInterface
|
||||
*/
|
||||
public function initiateQuery(array $requiredModifiers, array $acl, array $data = [])
|
||||
{
|
||||
$centers = array_map(static function ($el) {
|
||||
return $el['center'];
|
||||
}, $acl);
|
||||
$centers = array_map(static fn($el) => $el['center'], $acl);
|
||||
|
||||
$qb = $this->personRepository->createQueryBuilder('person');
|
||||
|
||||
|
@@ -64,9 +64,7 @@ class CountPersonWithAccompanyingCourse implements ExportInterface, GroupedExpor
|
||||
$labels = array_combine($values, $values);
|
||||
$labels['_header'] = $this->getTitle();
|
||||
|
||||
return static function ($value) use ($labels) {
|
||||
return $labels[$value];
|
||||
};
|
||||
return static fn($value) => $labels[$value];
|
||||
}
|
||||
|
||||
public function getQueryKeys($data): array
|
||||
@@ -91,9 +89,7 @@ class CountPersonWithAccompanyingCourse implements ExportInterface, GroupedExpor
|
||||
|
||||
public function initiateQuery(array $requiredModifiers, array $acl, array $data = [])
|
||||
{
|
||||
$centers = array_map(static function ($el) {
|
||||
return $el['center'];
|
||||
}, $acl);
|
||||
$centers = array_map(static fn($el) => $el['center'], $acl);
|
||||
|
||||
$qb = $this->repository->createQueryBuilder('acp');
|
||||
|
||||
|
@@ -290,9 +290,7 @@ class ListAccompanyingPeriod implements ListInterface, GroupedExportInterface
|
||||
|
||||
public function initiateQuery(array $requiredModifiers, array $acl, array $data = [])
|
||||
{
|
||||
$centers = array_map(static function ($el) {
|
||||
return $el['center'];
|
||||
}, $acl);
|
||||
$centers = array_map(static fn($el) => $el['center'], $acl);
|
||||
|
||||
$qb = $this->entityManager->createQueryBuilder();
|
||||
|
||||
|
@@ -263,9 +263,7 @@ class ListAccompanyingPeriodWork implements ListInterface, GroupedExportInterfac
|
||||
|
||||
public function initiateQuery(array $requiredModifiers, array $acl, array $data = [])
|
||||
{
|
||||
$centers = array_map(static function ($el) {
|
||||
return $el['center'];
|
||||
}, $acl);
|
||||
$centers = array_map(static fn($el) => $el['center'], $acl);
|
||||
|
||||
$qb = $this->entityManager->createQueryBuilder();
|
||||
|
||||
|
@@ -241,9 +241,7 @@ class ListEvaluation implements ListInterface, GroupedExportInterface
|
||||
|
||||
public function initiateQuery(array $requiredModifiers, array $acl, array $data = [])
|
||||
{
|
||||
$centers = array_map(static function ($el) {
|
||||
return $el['center'];
|
||||
}, $acl);
|
||||
$centers = array_map(static fn($el) => $el['center'], $acl);
|
||||
|
||||
$qb = $this->entityManager->createQueryBuilder();
|
||||
|
||||
|
@@ -146,9 +146,7 @@ class ListHouseholdInPeriod implements ListInterface, GroupedExportInterface
|
||||
|
||||
public function initiateQuery(array $requiredModifiers, array $acl, array $data = [])
|
||||
{
|
||||
$centers = array_map(static function ($el) {
|
||||
return $el['center'];
|
||||
}, $acl);
|
||||
$centers = array_map(static fn($el) => $el['center'], $acl);
|
||||
|
||||
$qb = $this->entityManager->createQueryBuilder();
|
||||
|
||||
|
@@ -191,9 +191,7 @@ class ListPerson implements ExportElementValidatedInterface, ListInterface, Grou
|
||||
*/
|
||||
public function initiateQuery(array $requiredModifiers, array $acl, array $data = [])
|
||||
{
|
||||
$centers = array_map(static function ($el) {
|
||||
return $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)) {
|
||||
|
@@ -159,9 +159,7 @@ class ListPersonWithAccompanyingPeriod implements ExportElementValidatedInterfac
|
||||
*/
|
||||
public function initiateQuery(array $requiredModifiers, array $acl, array $data = [])
|
||||
{
|
||||
$centers = array_map(static function ($el) {
|
||||
return $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)) {
|
||||
|
@@ -112,9 +112,7 @@ class StatAccompanyingCourseDuration implements ExportInterface, GroupedExportIn
|
||||
|
||||
public function initiateQuery(array $requiredModifiers, array $acl, array $data = []): QueryBuilder
|
||||
{
|
||||
$centers = array_map(static function ($el) {
|
||||
return $el['center'];
|
||||
}, $acl);
|
||||
$centers = array_map(static fn($el) => $el['center'], $acl);
|
||||
|
||||
$qb = $this->repository->createQueryBuilder('acp');
|
||||
|
||||
|
@@ -59,9 +59,7 @@ class ClosingMotiveFilter implements FilterInterface
|
||||
{
|
||||
$builder->add('accepted_closingmotives', EntityType::class, [
|
||||
'class' => ClosingMotive::class,
|
||||
'choice_label' => function (ClosingMotive $cm) {
|
||||
return $this->translatableStringHelper->localize($cm->getName());
|
||||
},
|
||||
'choice_label' => fn(ClosingMotive $cm) => $this->translatableStringHelper->localize($cm->getName()),
|
||||
'multiple' => true,
|
||||
'expanded' => true,
|
||||
]);
|
||||
|
@@ -61,11 +61,9 @@ class CreatorJobFilter implements FilterInterface
|
||||
$builder->add('creator_job', EntityType::class, [
|
||||
'class' => UserJob::class,
|
||||
'choices' => $this->userJobRepository->findAllActive(),
|
||||
'choice_label' => function (UserJob $j) {
|
||||
return $this->translatableStringHelper->localize(
|
||||
$j->getLabel()
|
||||
);
|
||||
},
|
||||
'choice_label' => fn(UserJob $j) => $this->translatableStringHelper->localize(
|
||||
$j->getLabel()
|
||||
),
|
||||
'multiple' => true,
|
||||
'expanded' => true,
|
||||
'label' => 'Job',
|
||||
|
@@ -69,9 +69,7 @@ class EvaluationFilter implements FilterInterface
|
||||
$builder->add('accepted_evaluations', EntityType::class, [
|
||||
'class' => Evaluation::class,
|
||||
'choices' => $this->evaluationRepository->findAllActive(),
|
||||
'choice_label' => function (Evaluation $ev) {
|
||||
return $this->translatableStringHelper->localize($ev->getTitle());
|
||||
},
|
||||
'choice_label' => fn(Evaluation $ev) => $this->translatableStringHelper->localize($ev->getTitle()),
|
||||
'multiple' => true,
|
||||
'expanded' => false,
|
||||
'attr' => ['class' => 'select2'],
|
||||
|
@@ -107,9 +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' => function (SimpleGeographicalUnitDTO $item) {
|
||||
return $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',
|
||||
],
|
||||
@@ -124,9 +122,7 @@ class GeographicalUnitStatFilter implements FilterInterface
|
||||
'%units' => implode(
|
||||
', ',
|
||||
array_map(
|
||||
function (SimpleGeographicalUnitDTO $item) {
|
||||
return $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']
|
||||
)
|
||||
),
|
||||
|
@@ -59,9 +59,7 @@ class OriginFilter implements FilterInterface
|
||||
{
|
||||
$builder->add('accepted_origins', EntityType::class, [
|
||||
'class' => Origin::class,
|
||||
'choice_label' => function (Origin $o) {
|
||||
return $this->translatableStringHelper->localize($o->getLabel());
|
||||
},
|
||||
'choice_label' => fn(Origin $o) => $this->translatableStringHelper->localize($o->getLabel()),
|
||||
'multiple' => true,
|
||||
'expanded' => true,
|
||||
]);
|
||||
|
@@ -59,9 +59,7 @@ final class EvaluationTypeFilter implements FilterInterface
|
||||
{
|
||||
$builder->add('accepted_evaluationtype', EntityType::class, [
|
||||
'class' => Evaluation::class,
|
||||
'choice_label' => function (Evaluation $ev): string {
|
||||
return $this->translatableStringHelper->localize($ev->getTitle());
|
||||
},
|
||||
'choice_label' => fn(Evaluation $ev): string => $this->translatableStringHelper->localize($ev->getTitle()),
|
||||
'multiple' => true,
|
||||
'expanded' => true,
|
||||
]);
|
||||
|
@@ -78,11 +78,9 @@ class CompositionFilter implements FilterInterface
|
||||
$builder
|
||||
->add('accepted_composition', EntityType::class, [
|
||||
'class' => HouseholdCompositionType::class,
|
||||
'choice_label' => function (HouseholdCompositionType $type) {
|
||||
return $this->translatableStringHelper->localize(
|
||||
$type->getLabel()
|
||||
);
|
||||
},
|
||||
'choice_label' => fn(HouseholdCompositionType $type) => $this->translatableStringHelper->localize(
|
||||
$type->getLabel()
|
||||
),
|
||||
'multiple' => true,
|
||||
'expanded' => true,
|
||||
])
|
||||
|
@@ -81,9 +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' => function (string $item) {
|
||||
return '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]
|
||||
@@ -99,9 +97,7 @@ class AddressRefStatusFilter implements \Chill\MainBundle\Export\FilterInterface
|
||||
'%statuses%' => implode(
|
||||
', ',
|
||||
array_map(
|
||||
function (string $item) {
|
||||
return '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
|
||||
)
|
||||
),
|
||||
|
@@ -67,9 +67,7 @@ class GenderFilter implements
|
||||
$qb->add('where', $where);
|
||||
$qb->setParameter('person_gender', array_filter(
|
||||
$data['accepted_genders'],
|
||||
static function ($el) {
|
||||
return 'null' !== $el;
|
||||
}
|
||||
static fn($el) => 'null' !== $el
|
||||
));
|
||||
}
|
||||
|
||||
|
@@ -98,9 +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' => function (SimpleGeographicalUnitDTO $item) {
|
||||
return $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',
|
||||
],
|
||||
@@ -117,9 +115,7 @@ class GeographicalUnitFilter implements \Chill\MainBundle\Export\FilterInterface
|
||||
'%units%' => implode(
|
||||
', ',
|
||||
array_map(
|
||||
function (SimpleGeographicalUnitDTO $item) {
|
||||
return $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']
|
||||
)
|
||||
),
|
||||
|
@@ -49,11 +49,9 @@ class MaritalStatusFilter implements FilterInterface
|
||||
{
|
||||
$builder->add('maritalStatus', EntityType::class, [
|
||||
'class' => MaritalStatus::class,
|
||||
'choice_label' => function (MaritalStatus $ms) {
|
||||
return $this->translatableStringHelper->localize(
|
||||
$ms->getName()
|
||||
);
|
||||
},
|
||||
'choice_label' => fn(MaritalStatus $ms) => $this->translatableStringHelper->localize(
|
||||
$ms->getName()
|
||||
),
|
||||
'multiple' => true,
|
||||
'expanded' => true,
|
||||
]);
|
||||
|
@@ -72,9 +72,7 @@ class NationalityFilter implements
|
||||
{
|
||||
$countries = $data['nationalities'];
|
||||
|
||||
$names = array_map(function (Country $c) {
|
||||
return $this->translatableStringHelper->localize($c->getName());
|
||||
}, [$countries]);
|
||||
$names = array_map(fn(Country $c) => $this->translatableStringHelper->localize($c->getName()), [$countries]);
|
||||
|
||||
return [
|
||||
'Filtered by nationality : %nationalities%',
|
||||
|
@@ -100,9 +100,7 @@ class ResidentialAddressAtThirdpartyFilter implements FilterInterface
|
||||
$builder->add('thirdparty_cat', EntityType::class, [
|
||||
'class' => ThirdPartyCategory::class,
|
||||
'label' => 'Category',
|
||||
'choice_label' => function (ThirdPartyCategory $tpc) {
|
||||
return $this->translatableStringHelper->localize($tpc->getName());
|
||||
},
|
||||
'choice_label' => fn(ThirdPartyCategory $tpc) => $this->translatableStringHelper->localize($tpc->getName()),
|
||||
'multiple' => true,
|
||||
'expanded' => true,
|
||||
]);
|
||||
|
@@ -69,11 +69,9 @@ class JobFilter implements FilterInterface
|
||||
{
|
||||
$builder->add('job', EntityType::class, [
|
||||
'class' => UserJob::class,
|
||||
'choice_label' => function (UserJob $j) {
|
||||
return $this->translatableStringHelper->localize(
|
||||
$j->getLabel()
|
||||
);
|
||||
},
|
||||
'choice_label' => fn(UserJob $j) => $this->translatableStringHelper->localize(
|
||||
$j->getLabel()
|
||||
),
|
||||
'multiple' => true,
|
||||
'expanded' => true,
|
||||
]);
|
||||
|
@@ -69,11 +69,9 @@ class ScopeFilter implements FilterInterface
|
||||
{
|
||||
$builder->add('scope', EntityType::class, [
|
||||
'class' => Scope::class,
|
||||
'choice_label' => function (Scope $s) {
|
||||
return $this->translatableStringHelper->localize(
|
||||
$s->getName()
|
||||
);
|
||||
},
|
||||
'choice_label' => fn(Scope $s) => $this->translatableStringHelper->localize(
|
||||
$s->getName()
|
||||
),
|
||||
'multiple' => true,
|
||||
'expanded' => true,
|
||||
]);
|
||||
|
@@ -136,7 +136,7 @@ class SocialWorkTypeFilter implements FilterInterface
|
||||
}
|
||||
|
||||
return ['Filtered actions by type, goals and results: %selected%', [
|
||||
'%selected%' => implode(', ', array_merge($actionTypes, $goals, $results)),
|
||||
'%selected%' => implode(', ', [...$actionTypes, ...$goals, ...$results]),
|
||||
]];
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user