Greetings. I began to learn the framework, I write a little code. I use phpstorm 9, installed additional plugins, and there is excellent auto-completion. In the documentation, this type of code is often found $em = $this->getDoctrine()->getManager(); The question is, is it possible to register some kind of annotation or to connect which file so that auto-completion works after this?
|
1 answer
The easiest option is to write phpDoc directly to a variable.
/* @var MyService $service */ $service = $this->get('myservice'); Further, all methods and fields will be available to the $service variable as autocompletion.
- in my case there will be something like / * @var Doctrine $ em * /, did I understand you correctly? - VK
- Write the class name or type of data. Further, the storm will already adequately respond. - dlarchikov
|