Re: [RFC] Shorter Attribute Syntax Change RFC 0.2
| From: | Peter Bowyer | Date: | Mon, 17 Aug 2020 08:10:48 +0000 |
| Subject: | Re: [RFC] Shorter Attribute Syntax Change RFC 0.2 | ||
| References: | 1 2 3 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-111569@lists.php.net to get a copy of this message | ||
On Mon, 17 Aug 2020 at 02:06, Theodore Brown <theodorejb@outlook.com> wrote:
> ## Forcing @@ attributes to end with parenthesis?
>
> I don't really see the point of this section in the RFC.
The blame for that is on me, not Benjamin and Derek, as I repeatedly asked
why a compulsory ) could not be considered a closing delimiter.
> ## Attribute nesting
>
> The RFC points out that all the syntaxes can allow attribute nesting,
> which is true. However, it would be nice to include an example of
> potential future nesting for each syntax, as was included in the
> original Shorter Attribute Syntax RFC. The reason is that some of the
> syntaxes are less readable than others when nested (particularly ðÉs�„.úô
> e©Ø*<<>>,
> though arguably
#[] and @[] as
> well since the attribute end
> delimiter can be confused with the end bracket of an array argument.
>
> @@JoinTable(
> "User_Group",
> @@JoinColumn("User_id", "id"),
> @@JoinColumn("Group_id", "id"),
> )
> private $groups;
>
> #[JoinTable(
> "User_Group",
> #[JoinColumn("User_id", "id")],
> #[JoinColumn("Group_id", "id")],
> )]
> private $groups;
>
> @[JoinTable(
> "User_Group",
> @[JoinColumn("User_id", "id")],
> @[JoinColumn("Group_id", "id")],
> )]
> private $groups;
>
> <<JoinTable(
> "User_Group",
> <<JoinColumn("User_id", "id")>>,
> <<JoinColumn("Group_id", "id")>>,
> )>>
> private $groups;
>
> @:JoinTable(
> "User_Group",
> @:JoinColumn("User_id", "id"),
> @:JoinColumn("Group_id", "id"),
> )
> private $groups;
>
Good catch.
Peter