From 7595d70ada4bafd4463d01bb4abc9fc91151b172 Mon Sep 17 00:00:00 2001 From: Pol Dellaiera Date: Fri, 14 May 2021 10:52:31 +0200 Subject: [PATCH] Fix `::getPersons`. 1. Add more typing informations. --- .../Entity/AccompanyingPeriod.php | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod.php b/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod.php index 567e678e1..0f78ee2bb 100644 --- a/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod.php +++ b/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod.php @@ -653,13 +653,17 @@ class AccompanyingPeriod /** * Get a list of all persons which are participating to this course + * + * @psalm-return Collection */ public function getPersons(): Collection { - return $this->participations->map( - function(AccompanyingPeriodParticipation $participation) { - return $participation->getPerson(); - } - ); + return $this + ->participations + ->map( + static function(AccompanyingPeriodParticipation $participation): Person { + return $participation->getPerson(); + } + ); } }