DX: fix phpstan issues

This commit is contained in:
Julien Fastré 2023-07-05 22:37:51 +02:00
parent 0361743ae0
commit c19232de35
Signed by: julienfastre
GPG Key ID: BDE2190974723FCB
2 changed files with 6 additions and 3 deletions

View File

@ -16,6 +16,8 @@ use Chill\EventBundle\Entity\Event;
use Chill\EventBundle\Entity\Participation;
use Chill\EventBundle\Form\ParticipationType;
use Chill\EventBundle\Security\Authorization\ParticipationVoter;
use Doctrine\Common\Collections\Collection;
use Doctrine\Common\Collections\ReadableCollection;
use LogicException;
use Psr\Log\LoggerInterface;
use RuntimeException;
@ -509,7 +511,7 @@ class ParticipationController extends AbstractController
/**
* @return \Symfony\Component\Form\FormInterface
*/
protected function createEditFormMultiple(ArrayIterator $participations, Event $event)
protected function createEditFormMultiple(Collection $participations, Event $event)
{
$form = $this->createForm(
\Symfony\Component\Form\Extension\Core\Type\FormType::class,
@ -638,6 +640,7 @@ class ParticipationController extends AbstractController
$ignoredParticipations = $newParticipations = [];
foreach ($participations as $participation) {
/** @var Participation $participation */
// check for authorization
$this->denyAccessUnlessGranted(
ParticipationVoter::CREATE,

View File

@ -160,11 +160,11 @@ class Event implements HasCenterInterface, HasScopeInterface
}
/**
* @return ArrayIterator|Collection|Traversable
* @return Collection<Participation>
*/
public function getParticipations()
{
return $this->getParticipationsOrdered();
return new ArrayCollection(iterator_to_array($this->getParticipationsOrdered()));
}
/**