Static Method Return Values - Auto Completion |
Guru master
|
I'm unsure as to exactly what you want but ...
get_called_class() from within a static function would return Test so @return self looks correct and code completion appears to be working correctly; it is only showing getSmth() as an available method on getSmth() and should not be showing any methods for Ext. If you want getSmth() to return a new instance of Ext then getSmth() should not be static.
I know I might have mistunderdood what you need; I'm just trying to help |
||||||||||||||
|
|
Hi
No, get_called_class always return the class from that you do the method call. __CLASS__ always return the class your method is actually in.
Generate
Ant with "self" i tried to emulate that it always take the class from which you call instead of the class from which the method is in. Ohterwise i would write the fixed "@return Test" if i always expect the "Test" instance as a result. In other Editors they replace "@return CLASS_NAME" (very bad handling i guess) with the get_called_class() but nusphere also don't understand this way. And thanks, i alreay know the "trick" with the @method but it's not nice coding when you need to add this documentation to every new subclass. |
||||||||||||||||
|
|
phpDoc already differentiates "@return $this" and "@return self", as well as some other IDEs.
phpDoc manual doesn't reflect it yet, but will be updated soon (issue #800 in phpDocumentor repository). So could you please make sure PhpEd understands the following phpDoc correctly? It's really very clear and logical feature for classes definition. class ParentClass { /** @return self */ public static function getSelf() {} /** @return static */ public static function getStatic() {} /** @return $this */ public static function getThis() {} } class ChildClass extends ParentClass {} ChildClass::getSelf(); //ParentClass ChildClass::getStatic(); //ChildClass ChildClass::getThis(); //ChildClass Thank you in advance! |
||||||||||||
|
Static Method Return Values - Auto Completion |
|
||
Content © NuSphere Corp., PHP IDE team
Powered by phpBB © phpBB Group, Design by phpBBStyles.com | Styles Database.
Powered by
Powered by phpBB © phpBB Group, Design by phpBBStyles.com | Styles Database.
Powered by