Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:109887 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 90678 invoked from network); 28 Apr 2020 17:47:46 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 28 Apr 2020 17:47:46 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id DFF74180548 for ; Tue, 28 Apr 2020 09:20:59 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS21554 199.38.80.0/21 X-Spam-Virus: No X-Envelope-From: Received: from mercury.negativeion.net (mercury.negativeion.net [199.38.81.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Tue, 28 Apr 2020 09:20:58 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by mercury.negativeion.net (Postfix) with ESMTP id 97E9420969E63A; Tue, 28 Apr 2020 12:20:57 -0400 (EDT) X-Virus-Scanned: amavisd-new at negativeion.net Received: from mercury.negativeion.net ([127.0.0.1]) by localhost (mercury.negativeion.net [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 2NROimrGeNVr; Tue, 28 Apr 2020 12:20:57 -0400 (EDT) Received: from [10.0.1.2] (unknown [173.225.159.140]) by mercury.negativeion.net (Postfix) with ESMTPSA id 069A120969E628; Tue, 28 Apr 2020 12:20:56 -0400 (EDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 13.0 \(3608.60.0.2.5\)) In-Reply-To: Date: Tue, 28 Apr 2020 11:20:46 -0500 Cc: internals@lists.php.net Content-Transfer-Encoding: quoted-printable Message-ID: References: To: Benas IML X-Mailer: Apple Mail (2.3608.60.0.2.5) Subject: Re: [PHP-DEV] Renaming PhpAttribute to Attribute From: aaron@trowski.com (Aaron Piotrowski) > On Apr 28, 2020, at 10:37 AM, Benas IML = wrote: >=20 > Hey internals, >=20 > 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: >=20 >> 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. >>=20 >> 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. >=20 > 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: >=20 > ``` > <> > class Test {} > ``` >=20 > I am ready to make an RFC for this if the replies are mostly positive, = so > please, express your opinions! >=20 > Best regards, > Benas Seliuginas > P.S: this is my second email account so hopefully it won't get marked = as > spam. >=20 > --=20 > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php >=20 I too strongly agree that attributes should use `Attribute` over = `PhpAttribute` or even `PHP\Attribute`. Namespaces for bundled classes probably should be used in the future, = but for logically grouped classes (such as DOM), extensions, etc. Attributes are a basic language feature, and therefore should live in = the global namespace the same way as Throwable, Iterator, Countable, = etc. I did not want naming to be a blocker on the attributes RFC, but it = certainly bothered me that it was not `<>`. Please put together an RFC for this name change, I would definitely vote = yes. Regards, Aaron Piotrowski