On 04.11.2014 17:34, Andrea Faulds wrote:
> In Python, a decorator is a function (or callable object), and you use one 
> like this:
> 
>     @some_decorator(foo, bar)
>     def myfunc():
>         # function source code here

I wonder how feasible it would be to add something like this and allow
everything that's allowed in a php function/method call as parameters
inside the annotation call - kind of like python does it, which seems to
be one of the simplest (in usage, not implementation) forms possible.

/**
 * @ORM\Entity
 * @Table(name="message")
 */
class User {}

becomes something like

@ORM\Entity
@Table(['name' => 'message'])
class User {}

with Entity and Table being callables, obviously. Maybe classes, with
User being the first argument, but I haven't thought that through.

~Florian

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to