Re: [PHP-DEV] Interface for reflection entities who implements getAttributes method

2022-03-03 Thread Andreas Hennings
Hello list. Another potential benefit of such interfaces can be polyfills. PHP 8.x: class ReflectionClass implements Reflector, AttributesHaving {..} PHP 7.x. class UserlandReflectionClass extends ReflectionClass implements AttributesHaving {..} function f(AttributesHaving $reflector) {

Re: [PHP-DEV] Interface for reflection entities who implements getAttributes method

2022-03-03 Thread Andreas Hennings
On Tue, 1 Mar 2022 at 21:03, DANIEL VARGAS MUCCILLO 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

Re: [PHP-DEV] Interface for reflection entities who implements getAttributes method

2022-03-03 Thread DANIEL VARGAS MUCCILLO
> > I have been considering a "clean up reflection's class hierarchy" RFC > myself; things like getName() are also ubiquitous, but AFAICT is not > actually in a common type definition anywhere. > I think a single RFC to clean up all the bits is probably the place to > start. If any particular

Re: [PHP-DEV] Interface for reflection entities who implements getAttributes method

2022-03-01 Thread Larry Garfield
On Tue, Mar 1, 2022, at 2:02 PM, DANIEL VARGAS MUCCILLO 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

Re: [PHP-DEV] Interface for reflection entities who implements getAttributes method

2022-03-01 Thread DANIEL VARGAS MUCCILLO
> > 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

Re: [PHP-DEV] Interface for reflection entities who implements getAttributes method

2022-02-27 Thread Larry Garfield
On Fri, Feb 25, 2022, at 4:57 PM, DANIEL VARGAS MUCCILLO wrote: > 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: > >

[PHP-DEV] Interface for reflection entities who implements getAttributes method

2022-02-25 Thread DANIEL VARGAS MUCCILLO
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: