This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
As a shorthand to specifying the name of the class in the @return PHPDoc attribute for a standard factory method, I'd like to be able to use "@return self". This wouldn't really add much benefit beyond supporting lazy fingers. :) class SomeClass { /** * @return self */ public static function create() { return new self(); } } $c = SomeClass::create(); $c-> // CC shows methods from SomeClass However, for static factory methods that use "new static(...)", it would be of great benefit to support "@return static". class Parent { /** * @return static */ public static function create() { return new static(); } } class Child extends Parent { ... } $c = Child::create(); $c-> // CC shows methods from both Child and Parent I know this isn't part of the PHPDoc standard, but I think it would still be beneficial to those that would like to use it.
Batch reassigning.
Editor area.
*** Bug 200773 has been marked as a duplicate of this bug. ***
*** Bug 196564 has been marked as a duplicate of this bug. ***
It would be really usefull as Factory is being more and more used.
Fixed in web-main #f2368dd7777f
Integrated into 'main-golden', will be available in build *201301300001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-golden/rev/f2368dd7777f User: Ondrej Brejla <obrejla@netbeans.org> Log: #196564 and #196565 - Allow "self", "static" and "this" in a @return annotation (improved type inference)
*** Bug 225889 has been marked as a duplicate of this bug. ***
Hi, static work great on Dev build, but it will be nice to allow self[], $this[] and static[] too... class classParent { public function funcParent(){} /** @return static */ static public function create($array){ //some Code } /** @return static[] */ static public function createList($array){ $return = array(); foreach($array as $createArray){ $return[] = static::create($createArray); } return $return; } } class classChild extends classParent { public function funcChild(){} } $childs = classChild::createList(array()); foreach($childs as $child){ $child-> //CC shows methods from both classChild and classParent | but "No Suggestion" classChild::create($array)-> //CC shows methods from both classChild and classParent | That's good } Thank's taht will be really usefull.
This still does not work for Netbeans PHP 8.0.1 if parent and child class are in different namespaces.