Correct. But even when there's an explicit phpdoc, it's still ignored:
/**
* @var Collection|Participant[]
*/
#[ORM\OneToMany(targetEntity: Participant::class]
public Collection $participants;
...
/**
* @return Collection|Participant[]
*/
public function getParticipants(): Collection
{
foreach ($this->participants as $participant); // $participant is mixed, not Participant
return $this->participants;
}
Likewise with methods, the explicit phpdoc (or variable declaration) is ignored and only Collection is reported by IntelliSense.
Honestly, it's beyond me that php doesn't have built in generic support yet, feels like a lot more important than union or intersection types...