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.
Hello again, I'm still playing with "Implement all abstract methods" feature and I noticed that "self" special type is incorrectly handled, resulting in a PHP code that ends up with a fatal error. Example interface: ~~~ namespace Aaa; interface FooInterface { public function xyz(): self; } ~~~ According to PHP manual for 'self': "The parameter must be an instanceof the same class as the one the method is defined on". In case of implementing an interface or overwriting a method in a child class, `self` must be replaced with a concrete *parent* type name. Otherwise, PHP shows an error that the declaration of the overwriting method does not match to the prototype. Expected result of "Implement all abstract methods" from the interface above: ~~~ namespace Aaa; class Bar implements FooInterface { public function xyz(): FooInterface { } } ~~~ Actual result: ~~~ namespace Aaa; class Bar implements FooInterface { public function xyz(): \self { } } ~~~ The same may also apply to the method arguments. Tested on the nightly build 2016081220002.
Thanks for catching that and for perfect report. Should be fixed now, please verify if possible. Thanks. http://hg.netbeans.org/web-main/rev/0c5a425b55b2
Integrated into 'main-silver', will be available in build *201608160002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-silver/rev/0c5a425b55b2 User: Tomas Mysik <tmysik@netbeans.org> Log: #267563 - "Implement all abstract methods" incorrectly handles "self" special return type