Re: [PHP-DEV] [RFC] Amendments to Attributes

This is only part of a thread. view whole thread
May 20, 2020 17:40 ("Larry Garfield")
On Wed, May 20, 2020, at 12:07 PM, Benjamin Eberlei wrote:
> Hi everyone, > > the Attributes RFC was rather large already, so a few things were left open > or discussions during the vote have made us rethink a things. > > > > These points are handled by the Amendments RFC to Attributes: > > 1. Proposing to add a grouped syntax <
I'm torn here. I can absolutely see the use cases for it, but it also is a can of worms in terms of many different coding styles. In short, this is going to make more work for FIG to sort out.
> 2. Rename PhpAttribute to Attribute in global namespace (independent of the > namespace RFC)
I don't feel strongly enough in any direction to bother wading into this... :-)
> 3. Add validation of attribute class targets, which internal attributes can > do, but userland can't > 4. Specification if an attribute is repeatable or not on the same > declaration and fail otherwise.
It's not clear from the RFC what the failure mode is. If I put an attribute in the wrong place, or repeat it when I shouldn't... at what point does the code blow up and how? Does it get silently skipped somewhere? Is there an exception? Is it purely informational for the user processing it? The RFC needs to be clearer on what happens when validation fails. Even if that's repeating something from the original RFC, it needs to be clarified here so that we know what we're talking about. --Larry Garfield