mirror of
				https://gitlab.com/Chill-Projet/chill-bundles.git
				synced 2025-11-03 18:58:24 +00:00 
			
		
		
		
	Fix ::getOpenParticipationContainsPerson
				
					
				
			1. The filter predicate must return a boolean 2. The $person variable is not needed
This commit is contained in:
		@@ -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;
 | 
			
		||||
    }
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user