Re: Interface for reflection entities who implements getAttributes method
| From: | Andreas Hennings | Date: | Thu, 03 Mar 2022 18:31:16 +0000 |
| Subject: | Re: Interface for reflection entities who implements getAttributes method | ||
| References: | 1 2 3 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-117250@lists.php.net to get a copy of this message | ||
On Tue, 1 Mar 2022 at 21:03, DANIEL VARGAS MUCCILLO
<daniel.muccillo@ufsm.br> wrote:
>
> >
> > 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.
There is also ReflectionAttribute itself which does not have getAttributes().
>
>
> > 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