title: PHPDoc and __callStatic
body: <h2>tl;dr</h2>
  
  <p>What is the correct way to annotate (in PHPDoc) functions implemented via <code>__callStatic</code>? More important: is there a way that will make NetBeans <em>and</em> PHPStorm understand that these are static methods?</p>
  
  <h2>Motivation</h2>
  
  <p>If you want the bigger picture, here's how I got to this question.</p>
  
  <p><strong>Problem</strong>: In my current project we have a ton of classes that should really be singletons (DB proxies and the like). Needless to say, we have at least a few hundred <code>require_once</code> and <code>$foo = new FooProxy();</code> lines.</p>
  
  <p><em>Solution</em>: I created a <code>Loader</code> class to solve this, using the <code>__callStatic</code> magic method so we can just say <code>$foo = Loader::FooProxy();</code>. It's perfect for our purposes, but:</p>
  
  <p><strong>Problem</strong>: This way there's obviously no type hinting in either IDE used in the team. </p>
  
  <p><em>Solution</em>: Every module defines a subclass of <code>Loader</code>, adding methods that just route to <code>__callStatic</code>.</p>
  
  <p><strong>Problem</strong>: Adding actually interpreted code just for auto-completion's sake is not acceptable (this could be argued, but let's accept it for the time being).</p>
  
  <p><em>Solution</em>: Let's not add any real methods, only declare the methods in PHPDoc like this:</p>
  
  <pre><code>&lt;?php
  /**
   * @method FooProxy FooProxy()
   */
   class BarLoader extends Loader {}
  ?&gt;
  </code></pre>
  
  <p><strong>Problem</strong>: <code>FooProxy</code> is not a static method. None of the following make it static either:</p>
  
  <pre><code>&lt;?php
  /**
   * @static
   * @method FooProxy FooProxy()
   */
  
  ///////////////
  
  /**
   * @static @method A A()
   * @method static A A()
   * @method A static A()
   * @method A A() static
   */
  </code></pre>
  
  <p>Making the class abstract makes no difference. About an hour of Google'ing turned up no solutions. The primary goal is to make the IDEs aware of these functions; having correct PHPDoc is not really a necessity.</p>