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.
PhpDocumentGenerator does not add null. /**[Enter] function test(?int $int): ?string { return "something"; } Current result: /** * * @param int $int * @return ?string */ function test(?int $int): ?string { return "something"; } Proposed result1: /** * * @param ?int $int * @return ?string */ function test(?int $int): ?string { return "something"; } Proposed result2: /** * * @param int|null $int * @return string|null */ function test(?int $int): ?string { return "something"; } Which is proper?
I guess "Proposed result2" (<type>|null); see [1] but keep an eye also on [2]. Thanks! [1] https://phpdoc.org/docs/latest/guides/types.html#multiple-types-combined [2] https://github.com/phpDocumentor/phpDocumentor2/issues/1833
(In reply to Tomas Mysik from comment #1) > I guess "Proposed result2" (<type>|null); see [1] but keep an eye also on > [2]. I also think so. I'm going to fix it as <type>|null. Thank you for your comment and information!
Nothing to thank for, of course. Thanks for looking at this issue!
Fixed. The problem of interface return types also is fixed(i.e. in a case of no return statements but there is a return type declaration): e.g. class Foo {} interface TestInterface { /** public function test(?int $int): ?Foo; } http://hg.netbeans.org/web-main/rev/1ac8128b1b40 Thanks.
Thank you, Junichi!
You are welcome :)
Integrated into 'main-silver', will be available in build *201704070002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-silver/rev/1ac8128b1b40 User: Junichi Yamamoto <junichi11@netbeans.org> Log: #270235 - [PHP7.1] Null is missing in types of phpdoc if nullable types are used