Re: [RFC] ReflectionParameter::hasTypehint() / getTypehintText()
| From: | Sara Golemon | Date: | Fri, 30 May 2014 00:44:09 +0000 |
| Subject: | Re: [RFC] ReflectionParameter::hasTypehint() / getTypehintText() | ||
| References: | 1 2 3 4 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-74649@lists.php.net to get a copy of this message | ||
On Thu, May 29, 2014 at 3:22 PM, Levi Morrison <levim@php.net> wrote:
> On Thu, May 29, 2014 at 4:01 PM, Sara Golemon <pollita@php.net> wrote:
>> $rf = new ReflectionFunction('foo');
>> list($rp) = $rf->getParameters();
>> $hint = $rp->getType(); // returns ReflectionTypeHint
>> if ($hint->isArray()) { ... }
>>
>> I thought about that (and would like to see it), which is why I
>> specifically went for the name getTypehintText(), which leaves the
>> "get me an object version" (i.e. getTypehint()) left available. See
>> also:
>> https://wiki.php.net/rfc/reflectionparameter.typehint#on_the_naming
>> If you think it's a bit too busy to have getTypehint(): object, and
>> getTypehintText(): string, I can hold off on this RFC for awhile.
>> There's certainly no rush.
>
> Yeah, I mean something like that. Maybe we could collaborate in IRC
> somewhere to work out details? We can move much faster that way. I'm
> regularly in #hhvm on freenode and #php.doc and #php.pecl on efnet as
> LeviM or LeviM_t.
>
Per our conversation in IRC, I've updated the RFC and implementation