PHPStorm intellisense/auto complete on shared DI

Hi guys.

I am using some composer packages in my project and would love to have intellisense/auto complete on shared DI. it's registerd in the bootstrap with $di->setShared().

and then used in the controller with $this->"The shared name".

I have added IDE STUBS from the dev-tools to my IDE but that isn't enough. composer is also added to my IDE.



6.1k

Hi,

Service locator is bad practice anyway. Also it will not support code completion, you have pass dependency manually in your class either using constructor or setter.

I recommend you read this article http://martinfowler.com/articles/injection.html