Re: Interface for reflection entities who implements getAttributes method
| From: | DANIEL VARGAS MUCCILLO | Date: | Tue, 01 Mar 2022 20:02:37 +0000 |
| Subject: | Re: Interface for reflection entities who implements getAttributes method | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-117185@lists.php.net to get a copy of this message | ||
>
> I *think* all Reflector children support attributes, so it may not need a
> separate interface.
ReflectionZendExtension and ReflectionExtension are currently the only ones
who implement Reflector but don't support attributes.
> However, the entire Reflection class hierarchy is a mess and needs a
> number of additional interfaces added to it generally. It makes sense to
> overhaul it holistically to make sure it all fits together.
>
Was not aware of other cases, but a quick look led to:
- getExecutingFile() : string and getExecutingLine() : int in
ReflectionFiber and ReflectionGenerator;
- getDocComment() : string|false in ReflectionClass,
ReflectionClassConstant, ReflectionFunctionAbastract and ReflectionProperty;
- getName(), getNameSpaceName() and getModifiers() in some cases (not
always together).
Should it be the case to expand the scope to handle these in the same
proposal or maybe create a Meta RFC and discuss each on their own?
> I have zero availability until mid-March, but I'm open to helping at that
> point.
Thanks for your return on that, I'll try to run at least a little on my own
foot until there, so I can be less of a burden!
--
Daniel Vargas Muccillo