title: How do I make my PHP IDE understand Dependency Injection Containers?
body: <p>Current situation: I have dependencies in my project that I solve by using dependency injection. I want to take the next logic step by using a dependency injection container (DIC) to ease the management of my dependencies and to lazy-load classes.</p>
  
  <p>I looked at <a href="https://github.com/troelskn/bucket" rel="noreferrer">Bucket</a>, <a href="http://pimple.sensiolabs.org/" rel="noreferrer">Pimple</a>, and <a href="http://components.symfony-project.org/dependency-injection/" rel="noreferrer">sfServiceContainer</a>, ran some test and really appreciate how DIC’s work. I’d probably go for Pimple because of its simplicity and raw power. If I didn’t have this problem:</p>
  
  <p>Due to the abstraction that DIC’s offer, the IDE I’m using (PHPStorm) no longer understands what’s going on in my code. It doesn’t understand that $container['mailer'] or $sc->mailer is holding a class object. I also tried Netbeans IDE: same problem.</p>
  
  <p>This is really a problem for me because my IDE becomes useless. I don’t want to program without code hints, autocompletion and refactoring tools when dealing with classes. And I don’t want my IDE to find all kinds of false positives when validating code.</p>
  
  <p>So my question is: Has anyone dealt with this problem and found a solution?</p>