DX: rector rules upt to PHP 74

This commit is contained in:
2023-04-15 00:20:19 +02:00
parent a68190f0c6
commit 858ade467c
213 changed files with 433 additions and 1052 deletions

View File

@@ -200,13 +200,11 @@ class Household
*/
public function getCurrentAddress(?DateTime $at = null): ?Address
{
$at = $at ?? new DateTime('today');
$at ??= new DateTime('today');
$addrs = $this->getAddresses()->filter(static function (Address $a) use ($at) {
return $a->getValidFrom() <= $at && (
null === $a->getValidTo() || $a->getValidTo() > $at
);
});
$addrs = $this->getAddresses()->filter(static fn(Address $a) => $a->getValidFrom() <= $at && (
null === $a->getValidTo() || $a->getValidTo() > $at
));
if ($addrs->count() > 0) {
return $addrs->first();
@@ -338,9 +336,7 @@ class Household
public function getCurrentPersons(?DateTimeImmutable $now = null): ReadableCollection
{
return $this->getCurrentMembers($now)
->map(static function (HouseholdMember $m) {
return $m->getPerson();
});
->map(static fn(HouseholdMember $m) => $m->getPerson());
}
public function getId(): ?int
@@ -367,9 +363,7 @@ class Household
$membership->getStartDate(),
$membership->getEndDate()
)->filter(
static function (HouseholdMember $m) use ($membership) {
return $m->getPerson() !== $membership->getPerson();
}
static fn(HouseholdMember $m) => $m->getPerson() !== $membership->getPerson()
);
}
@@ -508,9 +502,7 @@ class Household
usort(
$compositionOrdered,
static function (HouseholdComposition $a, HouseholdComposition $b) {
return $a->getStartDate() <=> $b->getStartDate();
}
static fn(HouseholdComposition $a, HouseholdComposition $b) => $a->getStartDate() <=> $b->getStartDate()
);
$iterator = new ArrayIterator($compositionOrdered);