Re: Re: PHP Annotations RFC + Patch
| From: | Pierrick Charron | Date: | Fri, 10 Sep 2010 23:05:10 +0000 |
| Subject: | Re: Re: PHP Annotations RFC + Patch | ||
| References: | 1 2 3 4 5 6 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-49595@lists.php.net to get a copy of this message | ||
>
> [Validation(Email(checkMX=>true))] looks better.
>
> Thanks. Dmitry.
>
Hi Dmitry
The initial syntax proposed in the RFC/Patch is inspired by C#. If you
modify this syntax to remove brackets in nested annotations you will
have some conflicts like this one :
[Validation(Email)]
In this case the parser can't determine if Email is a constant or a
nested annotation. I did a second patch with an other syntax (proposed
by Etienne in the initial thread) which look like this :
%Validation(%Email)
I personally prefer the first one because I like the fact that you
have a start and an end delimiter for each annotations but I can live
with an other one if the majority is more comfortable with it.
Regards,
Pierrick