title: How to document static class properties in PHP
body: <p>Given the following scenario, where you have a static property on <code>Foo</code> documented as an instance of <code>FooApp</code>, an extended class <code>Bar</code>, and at runtime it turns out that the static property is actually set to an instance of <code>BarApp</code> rather than <code>FooApp</code>:</p>
  
  
  
  <pre class="lang-php prettyprint-override"><code>class Foo
  {
      /** 
       * @var FooApp
       */
      public static $app;
  }
  
  class Bar extends Foo
  {
  }
  
  Bar::$app = BarApp();
  </code></pre>
  
  <p>…what is the proper way to document <code>Bar</code> so that it’s clear that its static <code>$app</code> is going to be set to a <code>BarApp</code> instance rather than <code>FooApp</code>?</p>
  
  <p>I’ve tried the following but PhpStorm doesn’t respect it, probably because <code>@property</code> isn’t meant for static properties:</p>
  
  <pre class="lang-php prettyprint-override"><code>/**
   * @property BarApp $app
   */
  class Bar extends Foo
  {
  }
  </code></pre>
  
  <p>So far the only thing I’ve come up with is actually overriding <code>$bar</code> in the code:</p>
  
  <pre class="lang-php prettyprint-override"><code>class Bar
  {
      /** 
       * @var BarApp
       */
      public static $app;
  }
  </code></pre>
  
  <p>This is a bit annoying since it results in extra code when theoretically extra documentation would have sufficed (as in the case of overriding instance-level properties and methods’ documentation using <code>@property</code> and <code>@method</code>).</p>
  
  <p>(The use case here is a Yii application - <code>Foo</code> represents <code>BaseYii</code> and <code>Bar</code> represents a custom class that extends it; <code>FooApp</code> represents <code>yii\base\Application</code> and <code>BarApp</code> represents a custom class that extends it.)</p>