问题描述
我正在symfonycasts.com上学习使用Symfony进行编码,并正在使用PHPStorm。
Doctrine\ORM\EntityManagerInterface
服务不会加载getRepository()->
个建议。
这是我应该看到的键入getRepository()的内容:
其他自动完成库似乎运行良好。
解决方法
找到一种解决方法:可以通过使用变量上方的@var
注释来提示IDE该对象可以属于哪个类,例如:
/** @var \App\Repository\QuestionRepository $repository */
$repository = $entityManager->getRepository(Question::class);
$repository-> // now you should have autocomplete here :)