开发者

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

开发者 https://www.devze.com 2023-04-05 21:59 出处:网络
When declaring a class/instance property, I am accustomed to doing something like this: class MyClass {

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

精彩评论

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

关注公众号