开发者

How to tell IDE to type hint a class/instance property correctly?

When declaring a class/instance property, I am accustomed to doing something like this:

class MyClass
{
  protected
    /** @var SplDoublyLinkedList */
    $_nodes;
}

In the example above, I would expect my IDE (PhpStorm in my case) to show me code completion for the SplDoublyLinkedList clas开发者_StackOverflows any time I typed $this->_nodes-> anywhere inside the class declaration.

This doesn't appear to be occurring, though. Is this a a problem with PhpStorm, or am I just not doing it right?

EDIT: I've submitted a feature request on YouTrack.


try

 class MyClass
{
   /** @var SplDoublyLinkedList */
   protected
   $_nodes;
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜