[PHP-DEV] Re: Declaration-aware attributes

2025-04-19 Thread Andreas Hennings
To follow up on this idea. A less problematic solution would be to have a global function or static method similar to func_get_args(), that can only be called from within the constructor of an attribute. A function would be the most natural. But if we are afraid of name clashes with userland funct

[PHP-DEV] Re: Declaration-aware attributes

2023-05-29 Thread Andreas Hennings
I just notice a flaw in my thinking. On Tue, 30 May 2023 at 02:48, Andreas Hennings wrote: > > Note that for methods, we typically need to know the method reflector > _and_ the class reflector, because the method could be defined in a > base class. This is true when doing a discovery using attri

[PHP-DEV] Re: Declaration-aware attributes

2023-05-29 Thread Andreas Hennings
A big TBD would be the new attribute classes we need to mark these parameters. Perhaps we could use just one attribute class, e.g. "AttributeDeclaration", and use the parameter type to determine which part of the declaration is expected. Also, if an attribute is allowed on different symbol types,