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

@@ -828,7 +828,7 @@ class AccompanyingPeriod implements
$collection = $this
->getParticipationsContainsPerson($person)
->filter(
static fn(AccompanyingPeriodParticipation $participation): bool => null === $participation->getEndDate()
static fn (AccompanyingPeriodParticipation $participation): bool => null === $participation->getEndDate()
);
return $collection->count() > 0 ? $collection->first() : null;
@@ -842,7 +842,7 @@ class AccompanyingPeriod implements
return $this
->getParticipations()
->filter(
static fn(AccompanyingPeriodParticipation $participation): bool => null === $participation->getEndDate()
static fn (AccompanyingPeriodParticipation $participation): bool => null === $participation->getEndDate()
);
}

View File

@@ -202,7 +202,7 @@ class Household
{
$at ??= new DateTime('today');
$addrs = $this->getAddresses()->filter(static fn(Address $a) => $a->getValidFrom() <= $at && (
$addrs = $this->getAddresses()->filter(static fn (Address $a) => $a->getValidFrom() <= $at && (
null === $a->getValidTo() || $a->getValidTo() > $at
));
@@ -336,7 +336,7 @@ class Household
public function getCurrentPersons(?DateTimeImmutable $now = null): ReadableCollection
{
return $this->getCurrentMembers($now)
->map(static fn(HouseholdMember $m) => $m->getPerson());
->map(static fn (HouseholdMember $m) => $m->getPerson());
}
public function getId(): ?int
@@ -363,7 +363,7 @@ class Household
$membership->getStartDate(),
$membership->getEndDate()
)->filter(
static fn(HouseholdMember $m) => $m->getPerson() !== $membership->getPerson()
static fn (HouseholdMember $m) => $m->getPerson() !== $membership->getPerson()
);
}
@@ -502,7 +502,7 @@ class Household
usort(
$compositionOrdered,
static fn(HouseholdComposition $a, HouseholdComposition $b) => $a->getStartDate() <=> $b->getStartDate()
static fn (HouseholdComposition $a, HouseholdComposition $b) => $a->getStartDate() <=> $b->getStartDate()
);
$iterator = new ArrayIterator($compositionOrdered);

View File

@@ -775,7 +775,7 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
): int {
// TODO should be optimized to avoid loading accompanying period ?
return $this->getAccompanyingPeriodInvolved($asParticipantOpen, $asRequestor)
->filter(fn(AccompanyingPeriod $p) => $p->getStep() !== AccompanyingPeriod::STEP_DRAFT)
->filter(fn (AccompanyingPeriod $p) => $p->getStep() !== AccompanyingPeriod::STEP_DRAFT)
->count();
}
@@ -1339,7 +1339,7 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
return $this->getAccompanyingPeriodParticipations()
->matching($criteria)
->filter(static fn(AccompanyingPeriodParticipation $app) => AccompanyingPeriod::STEP_CLOSED !== $app->getAccompanyingPeriod()->getStep());
->filter(static fn (AccompanyingPeriodParticipation $app) => AccompanyingPeriod::STEP_CLOSED !== $app->getAccompanyingPeriod()->getStep());
}
public function getOtherPhoneNumbers(): Collection