Re: [RFC] ReflectionParameter::hasTypehint() / getTypehintText()
| From: | Levi Morrison | Date: | Fri, 30 May 2014 01:08:41 +0000 |
| Subject: | Re: [RFC] ReflectionParameter::hasTypehint() / getTypehintText() | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-74650@lists.php.net to get a copy of this message | ||
On Thu, May 29, 2014 at 4:54 PM, Derick Rethans <derick@php.net> wrote:
> On Thu, 29 May 2014, Sara Golemon wrote:
>
>> Pretty straight-forward. Makes it easier to recreate a function
>> signature from PHP (Mocking)
>> https://wiki.php.net/rfc/reflectionparameter.typehint
>
> I don't think it should return an empty string when hasTypehint has
> failed (the 4th "test") in your test case (for $d). IMO, it should
> return NULL.
If it doesn't have type information I think an empty string should be
returned. Since you can't have an empty type hint there really isn't a
conflict there. This means the function can always return a string.
That's my $0.02.