Renaming PhpAttribute to Attribute
| From: | Benas IML | Date: | Tue, 28 Apr 2020 15:37:39 +0000 |
| Subject: | Renaming PhpAttribute to Attribute | ||
| Groups: | php.internals | ||
| Request: | Send a blank email to internals+get-109880@lists.php.net to get a copy of this message | ||
Hey internals,
Since it's safe to say that the Attributes v2 RFC has passed, I wanted to
make a separate thread based on the comment by Rowan Tommins in the PHP
namespace policy thread. This is a quote from his comment:
> One prefix doesn't make a trend. "PhpToken" is a different case - it's a
> token of PHP source code, so the prefix isn't anything to do with
> avoiding name collisions, it's a natural clarification.
>
> To be honest, I'd be perfectly happy with the attributes RFC using the
> class name "Attribute", just as we use "Iterator", "Closure",
> "Exception", etc, etc. At which point the whole thing's a non-issue.
I do strongly agree with him and I believe we should rename
\PhpAttribute
to simply \Attribute before the PHP 8 release in order to improve
consistency with other classes and interfaces e. g. Iterator, ArrayAccess,
Countable. It would also make the attribute class definition look more
aesthetically pleasing:
```
<?php
<<Attribute>>
class Test {}
```
I am ready to make an RFC for this if the replies are mostly positive, so
please, express your opinions!
Best regards,
Benas Seliuginas
P.S: this is my second email account so hopefully it won't get marked as
spam.