mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +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
|
||||
{
|
||||
$collection = $this->getParticipationsContainsPerson($person)->filter(
|
||||
function(AccompanyingPeriodParticipation $participation) use ($person) {
|
||||
if (NULL === $participation->getEndDate()) {
|
||||
return $participation;
|
||||
$collection = $this
|
||||
->getParticipationsContainsPerson($person)
|
||||
->filter(
|
||||
static function(AccompanyingPeriodParticipation $participation): bool {
|
||||
return null === $participation->getEndDate();
|
||||
}
|
||||
});
|
||||
);
|
||||
|
||||
return $collection->count() > 0 ? $collection->first() : NULL;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user