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;
}
精彩评论