DX: fix phpstan issues

This commit is contained in:
2023-03-28 22:32:08 +02:00
parent 331443ae12
commit 48772efd54
27 changed files with 76 additions and 1309 deletions

View File

@@ -42,6 +42,7 @@ use DateTimeInterface;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\Common\Collections\Criteria;
use Doctrine\Common\Collections\ReadableCollection;
use Doctrine\ORM\Mapping as ORM;
use Iterator;
use LogicException;
@@ -615,9 +616,9 @@ class AccompanyingPeriod implements
/**
* Get a list of person which have an adresse available for a valid location.
*
* @return Collection|Person[]
* @return ReadableCollection<(int|string), Person>
*/
public function getAvailablePersonLocation(): Collection
public function getAvailablePersonLocation(): ReadableCollection
{
return $this->getOpenParticipations()
->filter(
@@ -675,8 +676,9 @@ class AccompanyingPeriod implements
/**
* @Groups({"read"})
* @return ReadableCollection<(int|string), Comment>
*/
public function getComments(): Collection
public function getComments(): ReadableCollection
{
$pinnedComment = $this->pinnedComment;
@@ -700,7 +702,7 @@ class AccompanyingPeriod implements
/**
* @Groups({"docgen:read"})
*/
public function getCurrentParticipations(): Collection
public function getCurrentParticipations(): ReadableCollection
{
return $this->getOpenParticipations();
}
@@ -834,7 +836,10 @@ class AccompanyingPeriod implements
return $collection->count() > 0 ? $collection->first() : null;
}
public function getOpenParticipations(): Collection
/**
* @return ReadableCollection<(int|string), AccompanyingPeriodParticipation>
*/
public function getOpenParticipations(): ReadableCollection
{
return $this
->getParticipations()
@@ -860,8 +865,9 @@ class AccompanyingPeriod implements
/**
* Get the participation containing a person.
* @return ReadableCollection<(int|string), AccompanyingPeriodParticipation>
*/
public function getParticipationsContainsPerson(Person $person): Collection
public function getParticipationsContainsPerson(Person $person): ReadableCollection
{
return $this
->getParticipations()