I tried to use new generic type hints feature in the following way:
1. I created a repository class with getAllForPage method.
* @param Page $page
* @return Collection<Reaction>
public function getAllForPage(Page $page): Collection
return new ArrayCollection($this->findBy(['page' => $page]));
2. Then I tried to DI that repository into my class and get advantage of type hints. As you can see the reactions variable is typed as Doctrine Collection and reaction variable inside foreach is typed as mixed.
Am I doing something wrong?