Reputation: 10084
I have some class named myClass, and following structure in there:
class myClass
{
static $foo;
public static function init()
{
self::$foo = new bar();
}
}
How can I make phpstorm define myClass::$foo as bar's object in the rest of my code?
Upvotes: 1
Views: 864
Reputation: 174937
Use a PHPDoc.
class myClass
{
/**
* @var bar $foo - Holds a bar object.
*/
static $foo;
}
Upvotes: 2