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

@@ -169,7 +169,7 @@ final class AccompanyingCourseApiController extends ApiController
$accompanyingPeriods = $person->getCurrentAccompanyingPeriods();
$accompanyingPeriodsChecked = array_filter(
$accompanyingPeriods,
fn(AccompanyingPeriod $period) => $this->isGranted(AccompanyingPeriodVoter::SEE, $period)
fn (AccompanyingPeriod $period) => $this->isGranted(AccompanyingPeriodVoter::SEE, $period)
);
return $this->json(array_values($accompanyingPeriodsChecked), Response::HTTP_OK, [], ['groups' => ['read']]);

View File

@@ -222,10 +222,10 @@ class AccompanyingPeriodController extends AbstractController
$accompanyingPeriodsRaw = $this->accompanyingPeriodACLAwareRepository
->findByPerson($person, AccompanyingPeriodVoter::SEE);
usort($accompanyingPeriodsRaw, static fn($a, $b) => $b->getOpeningDate() > $a->getOpeningDate());
usort($accompanyingPeriodsRaw, static fn ($a, $b) => $b->getOpeningDate() > $a->getOpeningDate());
// filter visible or not visible
$accompanyingPeriods = array_filter($accompanyingPeriodsRaw, fn(AccompanyingPeriod $ap) => $this->isGranted(AccompanyingPeriodVoter::SEE, $ap));
$accompanyingPeriods = array_filter($accompanyingPeriodsRaw, fn (AccompanyingPeriod $ap) => $this->isGranted(AccompanyingPeriodVoter::SEE, $ap));
return $this->render('@ChillPerson/AccompanyingPeriod/list.html.twig', [
'accompanying_periods' => $accompanyingPeriods,
@@ -327,7 +327,7 @@ class AccompanyingPeriodController extends AbstractController
/** @var AccompanyingPeriod $period */
$period = array_filter(
$person->getAccompanyingPeriods(),
static fn(AccompanyingPeriod $p) => $p->getId() === ($period_id)
static fn (AccompanyingPeriod $p) => $p->getId() === ($period_id)
)[0] ?? null;
if (null === $period) {

View File

@@ -105,8 +105,8 @@ class AccompanyingPeriodRegulationListController
$builder
->add('services', EntityType::class, [
'class' => Scope::class,
'query_builder' => static fn(EntityRepository $er) => $er->createQueryBuilder('s'),
'choice_label' => fn(Scope $s) => $this->translatableStringHelper->localize($s->getName()),
'query_builder' => static fn (EntityRepository $er) => $er->createQueryBuilder('s'),
'choice_label' => fn (Scope $s) => $this->translatableStringHelper->localize($s->getName()),
'multiple' => true,
'label' => 'Service',
'required' => false,
@@ -119,7 +119,7 @@ class AccompanyingPeriodRegulationListController
return $qb;
},
'choice_label' => fn(UserJob $j) => $this->translatableStringHelper->localize($j->getLabel()),
'choice_label' => fn (UserJob $j) => $this->translatableStringHelper->localize($j->getLabel()),
'multiple' => true,
'label' => 'Métier',
'required' => false,
@@ -141,7 +141,7 @@ class AccompanyingPeriodRegulationListController
return $qb;
},
'choice_label' => static fn(Location $l) => $l->getName(),
'choice_label' => static fn (Location $l) => $l->getName(),
'multiple' => true,
'group_by' => function (Location $l) {
if (null === $type = $l->getLocationType()) {

View File

@@ -164,7 +164,7 @@ class HouseholdCompositionController extends AbstractController
$isEdit = $request->query->has('edit');
if ($isEdit) {
$householdCompositions = $household->getCompositions()->filter(static fn(HouseholdComposition $composition) => $composition->getId() === $request->query->getInt('edit'));
$householdCompositions = $household->getCompositions()->filter(static fn (HouseholdComposition $composition) => $composition->getId() === $request->query->getInt('edit'));
if ($householdCompositions->count() !== 1) {
throw new BadRequestHttpException('could not find the composition with this id associated to the household');

View File

@@ -81,7 +81,7 @@ class HouseholdController extends AbstractController
}
}
usort($accompanyingPeriods, static fn($a, $b) => $b->getOpeningDate() <=> $a->getOpeningDate());
usort($accompanyingPeriods, static fn ($a, $b) => $b->getOpeningDate() <=> $a->getOpeningDate());
$oldMembers = $household->getNonCurrentMembers();
$accompanyingPeriodsOld = [];

View File

@@ -108,10 +108,10 @@ class PersonApiController extends ApiController
$addresses = $person
->getAccompanyingPeriodParticipations()
->filter(
static fn(AccompanyingPeriodParticipation $accompanyingPeriodParticipation): bool => null !== $accompanyingPeriodParticipation->getAccompanyingPeriod()->getAddressLocation()
static fn (AccompanyingPeriodParticipation $accompanyingPeriodParticipation): bool => null !== $accompanyingPeriodParticipation->getAccompanyingPeriod()->getAddressLocation()
)
->map(
static fn(AccompanyingPeriodParticipation $accompanyingPeriodParticipation): ?Address => $accompanyingPeriodParticipation->getAccompanyingPeriod()->getAddressLocation()
static fn (AccompanyingPeriodParticipation $accompanyingPeriodParticipation): ?Address => $accompanyingPeriodParticipation->getAccompanyingPeriod()->getAddressLocation()
)
->filter(
// We remove potential null addresses.

View File

@@ -44,7 +44,7 @@ class SocialWorkSocialActionApiController extends ApiController
$socialActions = $socialIssue->getRecursiveSocialActions()->toArray();
usort($socialActions, static fn(SocialAction $sa, SocialAction $sb) => $sa->getOrdering() <=> $sb->getOrdering());
usort($socialActions, static fn (SocialAction $sa, SocialAction $sb) => $sa->getOrdering() <=> $sb->getOrdering());
$pagination = $this->paginator->create(count($socialActions));
// max one page