title: PHPStorm and Slim 3.X DIC
body: <p>I recently moved from Slim 2.X to Slim 3.X and I've found a problem that may be a little stupid but annoys me in some ways.<br>
  The newly Slim 3.X, as a difference between the older 2.X version, it implements a new container system using Dependency Injection Containers (DIC) build on <a href="http://pimple.sensiolabs.org/" rel="nofollow noreferrer">Pimple</a>.</p>
  
  <p>As I've been reading, I find this a very great enhancement because it lets you manage your PHP app in a lot of different ways.<br>
  When I started playing around with the new things it has, I found something confusing that maybe is something I'm missing.  </p>
  
  <p>I use PHPStorm; one of the things that I like about this IDE is its code-completion and the facility for writing code and understanding classes (I'm actually a student, so this helps me a lot).<br>
  When I write a Slim route, if I want to access, for example, to my view object stored inside the container, I have to refer to it with the <code>$this-&gt;view</code> variable. The thing is that, normally, PHPStorm lists me the methods and properties inside an object when I mention it, but that didn't happen with the <code>$this</code> object. </p>
  
  <p>I suppose that, inside a route, Slim stores all route functionalities and all the container objects into the <code>$this</code> assigner.</p>
  
  <pre><code>$container = $app-&gt;getContainer();
  $container['view'] = new \Slim\Views\PhpRenderer('protected/views/');
  
  $app-&gt;get('/products', function(Request $request, Response $response) {
      $response = $this-&gt;view-&gt;render($response, 'products.php');
      return $response;
  })-&gt;setName('products');
  </code></pre>
  
  <p>When I access my <code>/products</code> route, it successfully renders my products template and shows what it's expected to show, so no problems with that.<br>
  The matter with it is that I want PHPStorm to know that <code>$this</code> variable inside a route it stores all the containers that are set previously before the route is called.</p>
  
  <p>I thought about <code>/* @var */</code> and <code>/* @global */</code> or something like this but after searching for a while and trying different things, I haven't found anything that could work. </p>
  
  <p>In conclusion, what I'm trying to say is if it's possible that PHPStorm could list me the properties and methods of the container objects like this:
  <a href="https://i.stack.imgur.com/zVwLo.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/zVwLo.png" alt="PHPStorm auto-completion feature for objects"></a></p>
  
  <p>but with the <code>$this</code> object inside a route:
  <a href="https://i.stack.imgur.com/8asPL.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/8asPL.png" alt="Missing auto-completion feature in this object"></a></p>
  
  <p>Thanks!</p>