On 29/04/2020 15:41, Chase Peeler wrote:
I don't think PhpAttribute is a bad name [...] nor is it logically inconsistent with other Php* named classes.
One of the things I dislike about "PhpAttribute" is that it's still really generic - I know I'm writing PHP, so it feels like broken Hungarian notation ("class FooClass extends BarInterface") rather than an actual name.
As for "other Php* named classes", as far as I know, we have exactly one, PhpToken, and that's not even in any released version yet. Possibly that name is also poor, and it should be renamed "ParserToken" or "PhpSourceToken", but at least it can be read as "a token of PHP".
As I was writing my last message, I looked for examples of other very generic classes that we've added to core, and came upon "Error". Like "Attribute", that's an extremely common term, with meanings in various contexts. If "PhpAttribute" means "an attribute applied to PHP code", then "an error thrown by the PHP engine" ought to be "PhpError", but I don't remember that name even being suggested.
So, if we do think "Attribute" is too generic a name, perhaps someone can suggest a better one, rather than just sticking the letters "PHP" in front.
Regards, -- Rowan Tommins (né Collins) [IMSoP] -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php