title: Correct phpDoc to tell IDE of dynamic class return type
body: <p>Consider this code:</p>
  
  <pre><code>class ParentClass {
  
      /** @return ParentClass  */
      public function getNew(){
          return call_user_func(array($this,'generator'));
      }
  
      protected function generator(){
          return new static(); // will actually return whatever class calls this code
      }
  }
  
  class ChildClass extends ParentClass {}
  
  $child = new ChildClass();
  var_dump($child-&gt;getnew()); // object(ChildClass)
  </code></pre>
  
  <p>Because <code>ParentClass::generator()</code> returns a <code>static()</code>, when the child instance calls <code>getNew()</code>, a <code>ChildClass()</code> is returned. The IDE (PhpStorm in my case) has no way to resolve this since the generator is dynamically called with <code>call_user_func()</code>. As a result, the IDE thinks that a <code>ParentClass</code> instance will be returned:</p>
  
  <p><a href="https://i.stack.imgur.com/DzwRB.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/DzwRB.jpg" alt="enter image description here"></a></p>
  
  <p>Is there a way to improve the parent's phpDoc block to better reflect the return type?</p>