Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:78666 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 93562 invoked from network); 4 Nov 2014 18:33:26 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 4 Nov 2014 18:33:26 -0000 Authentication-Results: pb1.pair.com header.from=ml@anderiasch.de; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=ml@anderiasch.de; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain anderiasch.de designates 81.169.138.148 as permitted sender) X-PHP-List-Original-Sender: ml@anderiasch.de X-Host-Fingerprint: 81.169.138.148 ares.art-core.org Received: from [81.169.138.148] ([81.169.138.148:42086] helo=ares.art-core.org) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 54/9F-06676-2FB19545 for ; Tue, 04 Nov 2014 13:33:23 -0500 Received: from [192.168.178.20] (p508943E9.dip0.t-ipconnect.de [80.137.67.233]) by ares.art-core.org (mail.art-core.org) with ESMTPSA id 6511A2EE002; Tue, 4 Nov 2014 19:33:18 +0100 (CET) Message-ID: <54591BEB.80904@anderiasch.de> Date: Tue, 04 Nov 2014 19:33:15 +0100 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-Version: 1.0 To: Benjamin Eberlei , PHP internals CC: Andrea Faulds , Pierre Joye , Stas Malyshev , Levi Morrison , Larry Garfield References: <5457AF2F.90808@php.net> <5457BDB7.8070701@garfieldtech.com> <54589A8D.3020607@sugarcrm.com> <1C3F4FA3-ABD5-4F6F-A898-F63AC1C723D5@ajf.me> In-Reply-To: <1C3F4FA3-ABD5-4F6F-A898-F63AC1C723D5@ajf.me> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Annotation PHP 7 From: ml@anderiasch.de (Florian Anderiasch) 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