mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-24 08:33:49 +00:00
DX: rector rules upt to PHP 74
This commit is contained in:
@@ -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);
|
||||
|
Reference in New Issue
Block a user