Re: [RFC] Reflection annotations reader
| From: | Marco Pivetta | Date: | Mon, 07 Jan 2013 06:54:32 +0000 |
| Subject: | Re: [RFC] Reflection annotations reader | ||
| References: | 1 2 3 4 5 6 7 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-64628@lists.php.net to get a copy of this message | ||
> So
> @var String
> @param2/param2("bar")
> Will be array('var' => 'String', 'param2/param2' =>
> '("bar")' );
>
>
Let's make this clear immediately: an associative array as output is not
useful.
That would make it impossible to nest annotations. For example, something
like following wouldn't work if the output is just arrays:
@MyApp\Acl({
"allow"=@MyApp\Acl\Allow({"john"="read",
"joe"="write"}),
"deny"=@OtherApp\Acl\Deny(default="*", log=true)
})
Maybe a silly example, but nested annotations are not that rare :)
Marco Pivetta
http://twitter.com/Ocramius
http://ocramius.github.com/