On 05/10/2016 11:48 PM, Benjamin Eberlei wrote:
On Tue, May 10, 2016 at 8:29 PM, Dmitry Stogov <dmi...@zend.com
<mailto:dmi...@zend.com>> wrote:
Hi internals,
I've started voting on "PHP Attributes" RFC.
https://wiki.php.net/rfc/attributes
In my opinion, "PHP Attributes" might be a smart tool for PHP
extension, but it's not going to be the end of the world, if we
decided to live with doc-comments only.
one question, Rasmus Schultz post goes into the similar direction.
Any reason why the annotations are only a numeric list and not key
value pairs? Key-Value would be much more powerful and address a ton
of objections for us (Doctrine).
Attributes their selves are key-values, only nested values are numeric,
but instead of simple values it's possible to use expression AST, that
is more powerful than key-values.
In the current state it is pretty limited for more complex use-cases.
I don't want to fully embrace the complexities that Larry showed for
Drupal (in my opinion, too much annotations), but without key value
pairs we could only use this when we nested JSON into the attribute
value strings for example, not something I want to mix.
The Drupal example implementation on top of attributes is included in RFC.
Thanks. Dmitry.