On Mon, 17 Aug 2020 at 02:06, Theodore Brown <theodor...@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 `<<>>`,
> 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

Reply via email to