mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-20 14:43:49 +00:00
cs: Enable risky rule static_lambda
.
This commit is contained in:
@@ -520,10 +520,10 @@ class AccompanyingPeriod implements
|
||||
public function getAvailablePersonLocation(): Collection
|
||||
{
|
||||
return $this->getOpenParticipations()
|
||||
->filter(function (AccompanyingPeriodParticipation $p) {
|
||||
->filter(static function (AccompanyingPeriodParticipation $p) {
|
||||
return $p->getPerson()->hasCurrentHouseholdAddress();
|
||||
})
|
||||
->map(function (AccompanyingPeriodParticipation $p) {
|
||||
->map(static function (AccompanyingPeriodParticipation $p) {
|
||||
return $p->getPerson();
|
||||
});
|
||||
}
|
||||
|
@@ -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;
|
||||
}
|
||||
);
|
||||
|
@@ -774,7 +774,7 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
|
||||
$periods = $this->getAccompanyingPeriods();
|
||||
|
||||
//order by date :
|
||||
usort($periods, function ($a, $b) {
|
||||
usort($periods, static function ($a, $b) {
|
||||
$dateA = $a->getOpeningDate();
|
||||
$dateB = $b->getOpeningDate();
|
||||
|
||||
@@ -1296,7 +1296,7 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
|
||||
|
||||
return $this->getAccompanyingPeriodParticipations()
|
||||
->matching($criteria)
|
||||
->filter(function (AccompanyingPeriodParticipation $app) {
|
||||
->filter(static function (AccompanyingPeriodParticipation $app) {
|
||||
return AccompanyingPeriod::STEP_CLOSED !== $app->getAccompanyingPeriod()->getStep();
|
||||
});
|
||||
}
|
||||
|
Reference in New Issue
Block a user