Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:64729 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 90538 invoked from network); 9 Jan 2013 12:09:10 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 9 Jan 2013 12:09:10 -0000 Authentication-Results: pb1.pair.com smtp.mail=christian.kaps@mohiva.com; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=christian.kaps@mohiva.com; sender-id=unknown Received-SPF: error (pb1.pair.com: domain mohiva.com from 80.67.29.8 cause and error) X-PHP-List-Original-Sender: christian.kaps@mohiva.com X-Host-Fingerprint: 80.67.29.8 smtprelay04.ispgateway.de Linux 2.6 Received: from [80.67.29.8] ([80.67.29.8:45301] helo=smtprelay04.ispgateway.de) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id EC/34-02684-4ED5DE05 for ; Wed, 09 Jan 2013 07:09:09 -0500 Received: from [80.67.16.116] (helo=webmail.df.eu) by smtprelay04.ispgateway.de with esmtpa (Exim 4.68) (envelope-from ) id 1TsuSv-0000pQ-Ty for internals@lists.php.net; Wed, 09 Jan 2013 13:09:05 +0100 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Date: Wed, 09 Jan 2013 13:09:05 +0100 To: In-Reply-To: References: <50ED4C18.3090806@zerocue.com> <9f792e7e11c481c5f4c62ce69ae216b6@mohiva.com> Message-ID: X-Sender: christian.kaps@mohiva.com User-Agent: Roundcube Webmail/0.8.1 X-Df-Sender: Y2hyaXN0aWFuLmthcHNAbW9oaXZhLmNvbQ== Subject: Re: [PHP-DEV] - True Annotations From: christian.kaps@mohiva.com (Christian Kaps) Am 09.01.2013 13:03, schrieb Yahav Gindi Bar: > On Wed, Jan 9, 2013 at 1:57 PM, Christian Kaps > wrote: > >> Hi, >> >> >> I agree here, I think the above, if possible would be best. In my >>> mind annotations should proabably be limited in scope to class >>> declarations and thus only before a class keyword, before a >>> property >>> or method declaration. >>> >>> In none of those scopes would [ ] be a parsing issue I believe... >>> >>> The one case would be at the beginning of a class, but if simply >>> added something such as: >>> [:SomeAttribute(xyz,abc),**SomeAttribute2] >>> >>> It could never be confused with short array syntax and is still >>> brief. >>> >> >> I think when implementing real annotations, then it should be >> possible to >> declare arrays in it. So I think the square brackets don't work. >> [Foo([1,2,3])] >> >> Cheers, >> Christian >> >> -- >> PHP Internals - PHP Runtime Development Mailing List >> To unsubscribe, visit: http://www.php.net/unsub.php >> >> But the colon prefix won't cover this case? > > You can, as I've mentioned in my post at the doc-block parser > discussion, > use a keyword inside the brackets to symbolize annotation, for > example > > [metadata: Key] > [metadata: MaxLength(10)] > [metadata: Relations(["foo", "bar", "baz"])] > public $id; Then rather [@Foo([1,2,3])] if it's possible!