Reputation: 44969
I have got the following class:
/**
* @method MyObject a()
*/
class MyClass {
/**
* @return MyObject
*/
public static function __callStatic($name, $arguments = NULL)
{
return new MyObject($name);
}
}
On Netbeans when I write MyClass::a()
I will get code completion on MyObject
. However, this only works thanks to the @method MyObject a()
comment on the class. But my __callStatic()
method handles every possible method name. I would like to be able to write MyClass::something()
and then get code completion on the MyObject
. Is there any way to get that code completion without listing every possible method name in the PHPDoc? Is there some kind of place holder like *()
?
Side question: How does Eclipse handle this situation?
Upvotes: 2
Views: 523
Reputation: 2583
No, there is not. You have to add a @method
tag for every name. Same thing goes with __get()
and the @property
tag. This is true as of Netbeans 7.0.1. Eclipse 3.7 (Indigo) with PDT works the same way and requires @method
tags in this situation as well.
Upvotes: 5