mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-12 13:24:25 +00:00
Fix ::getOpenParticipationContainsPerson
1. The filter predicate must return a boolean 2. The $person variable is not needed
This commit is contained in:
parent
9d34968b88
commit
a6e0b16032
@ -364,12 +364,13 @@ class AccompanyingPeriod
|
|||||||
*/
|
*/
|
||||||
public function getOpenParticipationContainsPerson(Person $person): ?AccompanyingPeriodParticipation
|
public function getOpenParticipationContainsPerson(Person $person): ?AccompanyingPeriodParticipation
|
||||||
{
|
{
|
||||||
$collection = $this->getParticipationsContainsPerson($person)->filter(
|
$collection = $this
|
||||||
function(AccompanyingPeriodParticipation $participation) use ($person) {
|
->getParticipationsContainsPerson($person)
|
||||||
if (NULL === $participation->getEndDate()) {
|
->filter(
|
||||||
return $participation;
|
static function(AccompanyingPeriodParticipation $participation): bool {
|
||||||
|
return null === $participation->getEndDate();
|
||||||
}
|
}
|
||||||
});
|
);
|
||||||
|
|
||||||
return $collection->count() > 0 ? $collection->first() : NULL;
|
return $collection->count() > 0 ? $collection->first() : NULL;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user