Reputation: 87
I am learning to code with Symfony in symfonycasts.com and am using PhpStorm.
Doctrine\ORM\EntityManagerInterface
service doesn't load getRepository()->
suggestions.
This is what I should see typing getRepository():
Other autocomplete libraries seems to be working well.
Upvotes: 1
Views: 208
Reputation: 66
Phpstorm seems to have issue with the EntityManagerInterface
, when I use the specific type EntityManager
instead of interface, the suggestions start working again.
Upvotes: 0
Reputation: 87
Found one way to fix it : it's possible to hint IDE which class is that object can by using @var
annotation above the variable, e.g.:
/** @var \App\Repository\QuestionRepository $repository */
$repository = $entityManager->getRepository(Question::class);
$repository-> // now you should have autocomplete here :)
Upvotes: 1