cs: Enable risky rule static_lambda.

This commit is contained in:
Pol Dellaiera
2021-11-30 11:43:34 +01:00
parent a9188355c5
commit 91d12c4a96
111 changed files with 212 additions and 212 deletions

View File

@@ -139,7 +139,7 @@ class Household
{
$at = null === $at ? new DateTime('today') : $at;
$addrs = $this->getAddresses()->filter(function (Address $a) use ($at) {
$addrs = $this->getAddresses()->filter(static function (Address $a) use ($at) {
return $a->getValidFrom() <= $at && (
null === $a->getValidTo() || $a->getValidTo() > $at
);
@@ -178,7 +178,7 @@ class Household
public function getCurrentMembersIds(?DateTimeImmutable $now = null): Collection
{
return $this->getCurrentMembers($now)->map(
fn (HouseholdMember $m) => $m->getId()
static fn (HouseholdMember $m) => $m->getId()
);
}
@@ -191,7 +191,7 @@ class Household
$members->getIterator()
->uasort(
function (HouseholdMember $a, HouseholdMember $b) {
static function (HouseholdMember $a, HouseholdMember $b) {
if ($a->getPosition() === null) {
if ($b->getPosition() === null) {
return 0;
@@ -247,7 +247,7 @@ class Household
public function getCurrentPersons(?DateTimeImmutable $now = null): Collection
{
return $this->getCurrentMembers($now)
->map(function (HouseholdMember $m) { return $m->getPerson(); });
->map(static function (HouseholdMember $m) { return $m->getPerson(); });
}
public function getId(): ?int
@@ -269,7 +269,7 @@ class Household
$membership->getStartDate(),
$membership->getEndDate()
)->filter(
function (HouseholdMember $m) use ($membership) {
static function (HouseholdMember $m) use ($membership) {
return $m !== $membership;
}
);