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.
The pipe (|) in @return works to specify multiple return types from a normal method, but only the first type is seen by NetBeans in the equivalent @method. Since the hover help for @method and @property-read doesn't show, you can test that these work by using auto-complete on the returned value. /** * @method Foo|Bar foo() */ class Foo { /** * @return Foo|Bar */ public function foobar() {} } $f = new Foo; $f->foobar()->[CTRL+SPACE] auto-complete shows members for both [CORRECT] $f->foo()->[CTRL+SPACE] auto-complete shows members for Foo only [WRONG]
Please evaluate, thanks.
Note that while the PHPDoc documentation for @method [1] doesn't say that multiple types are allowed, this is specifically mentioned in the documentation for @return [2]. It seems like an oversight by the documentation writer. [1] http://manual.phpdoc.org/HTMLframesConverter/default/phpDocumentor/tutorial_tags.method.pkg.html [2] http://manual.phpdoc.org/HTMLframesConverter/default/phpDocumentor/tutorial_tags.return.pkg.html
I know about this. Unfortunately the implementation of parsing @method doesn't follow the rest of php docs. I need to rewrite it.
*** This bug has been marked as a duplicate of bug 211230 ***