Doc #76060 [Opn->Csd]: ReflectionProperty::getDocComment() can return false

From: Date: Sat, 22 May 2021 13:15:02 +0000
Subject: Doc #76060 [Opn->Csd]: ReflectionProperty::getDocComment() can return false
References: 1  Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-18785@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=76060&edit=1

 ID:                 76060
 Updated by:         krakjoe@php.net
 Reported by:        benjamin dot morel at gmail dot com
 Summary:            ReflectionProperty::getDocComment() can return false
-Status:             Open
+Status:             Closed
 Type:               Documentation Problem
 Package:            Reflection related
 Operating System:   N/A
 PHP Version:        Irrelevant
-Assigned To:        
+Assigned To:        krakjoe
 Block user comment: N
 Private report:     N

 New Comment:

The documentation has been fixed.


Previous Comments:
------------------------------------------------------------------------
[2018-03-07 05:00:21] philip@php.net

I think the meaning is it can return other values too, like NULL, or return no value at all. In that
case string|bool is not fully accurate.

This is why this idea runs into a brick wall and dies every few years or so.

Now, is string|bool more useful than string? Probably. Or should it be explicit and include all
possible return types like let's say string|bool|null|void or somesuch. Maybe. Or simply be
"mixed" like some are today? Probably not.

Good times :)

------------------------------------------------------------------------
[2018-03-06 17:40:01] benjamin dot morel at gmail dot com

Did you send the correct link? I'm not sure what you mean here.

------------------------------------------------------------------------
[2018-03-06 17:05:42] cmb@php.net

>> int|false (as true and false are now types), is very
>> explicit, understandable, parseable and can be used by other
>> systems in a concise way.

And it is usually wrong as well, see <https://3v4l.org/D2Tm3>,
for instance.

------------------------------------------------------------------------
[2018-03-06 15:54:44] benjamin dot morel at gmail dot com

Thanks for the pointer! There was no consensus as far as I can tell. But I personally fully agree
with Richard Quadling:

> The inability of the function/method signature correctly express itself is
a pain. You read the signature. It says "I return stuff". I then have to
read the rest of the documentation to find that it returns something useful
or false.

> int|false (as true and false are now types), is
very explicit, understandable, parseable and can be used by other systems
in a concise way.

------------------------------------------------------------------------
[2018-03-06 15:31:47] cmb@php.net

This issue already came up on the docs mailing list:
<https://marc.info/?t=151246911600002&r=1&w=2>.

------------------------------------------------------------------------


The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at

    https://bugs.php.net/bug.php?id=76060


--
Edit this bug report at https://bugs.php.net/bug.php?id=76060&edit=1


Thread (10 messages)

« previous php.doc.bugs (#18785) next »