Hi Internals, hope you are all well.

I've been playing around with Attributes and found that the only
way for safely type hint for reflection entities who implement the
getAttributes method is the following union:

ReflectionClass|ReflectionClassConstant|ReflectionFunctionAbstract|ReflectionParameter|ReflectionProperty
> $reflectionEntity


For a single use case this was ok, but i would like to survey if
people here would be interested in the introduction of a interface
against which we could correctly ensure, with less effort, that
getAttribute is available.

I believe that it would be something along the lines of:

> interface AttributeReflector {

    public function getAttributes(?string $name = null, int $flags = 0):
> array;

}


I have no experience with the PHP's source code, but if you think
that it's a good idea I would like to propose an RFC along with a PoC
patch to make this adition.

Thanks for your time until now and all the good work I've seen here.

-- 
Daniel Vargas Muccillo

Reply via email to