Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:49739 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 81992 invoked from network); 16 Sep 2010 22:34:38 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 16 Sep 2010 22:34:38 -0000 Authentication-Results: pb1.pair.com header.from=glopes@nebm.ist.utl.pt; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=glopes@nebm.ist.utl.pt; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain nebm.ist.utl.pt from 193.136.128.22 cause and error) X-PHP-List-Original-Sender: glopes@nebm.ist.utl.pt X-Host-Fingerprint: 193.136.128.22 smtp2.ist.utl.pt Linux 2.6 Received: from [193.136.128.22] ([193.136.128.22:58072] helo=smtp2.ist.utl.pt) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id DF/03-15036-B7B929C4 for ; Thu, 16 Sep 2010 18:34:36 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp2.ist.utl.pt (Postfix) with ESMTP id 89C117000484 for ; Thu, 16 Sep 2010 23:34:32 +0100 (WEST) X-Virus-Scanned: by amavisd-new-2.6.4 (20090625) (Debian) at ist.utl.pt Received: from smtp2.ist.utl.pt ([127.0.0.1]) by localhost (smtp2.ist.utl.pt [127.0.0.1]) (amavisd-new, port 10025) with LMTP id Nig8YNbr+XmF for ; Thu, 16 Sep 2010 23:34:32 +0100 (WEST) Received: from mail2.ist.utl.pt (mail2.ist.utl.pt [IPv6:2001:690:2100:1::c]) by smtp2.ist.utl.pt (Postfix) with ESMTP id 4A13B70003F8 for ; Thu, 16 Sep 2010 23:34:32 +0100 (WEST) Received: from cataphract-old.dulce.lo.geleia.net (52.152.108.93.rev.vodafone.pt [93.108.152.52]) (Authenticated sender: ist155741) by mail2.ist.utl.pt (Postfix) with ESMTPSA id 1199520073A3 for ; Thu, 16 Sep 2010 23:34:32 +0100 (WEST) Content-Type: text/plain; charset=iso-8859-15; format=flowed; delsp=yes To: internals@lists.php.net References: Date: Thu, 16 Sep 2010 23:34:40 +0100 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Organization: =?iso-8859-15?Q?N=FAcleo_de_Eng=2E_Biom=E9dica_?= =?iso-8859-15?Q?do_IST?= Message-ID: In-Reply-To: User-Agent: Opera Mail/10.61 (Win32) Subject: Re: [PHP-DEV] docBlock Parser RFC From: glopes@nebm.ist.utl.pt ("Gustavo Lopes") On Thu, 16 Sep 2010 21:56:04 +0100, Chad Fulton wrote: > Based on comments from the annotations thread, I have created a > docBlock parser RFC at http://wiki.php.net/rfc/docblockparser > > This RFC does not deal with annotations per se, but only with the idea > of adding a function to the Reflection extension which would parse > docBlocks according to a set docBlock syntax into a simple associative > array containing three elements: short description, long description, > and an array of tags. > > This is only meant to aid meta-data retrieval for classes and does not > automatically instantiate anything objects. > Pointless. Well, this will maybe speedup and standardize the usage of doc comments, but it's very far from what we could do with real annotations. By real annotations, I mean something the engine would recognize and that we could use in the future to implement AOP functionality with annotations or to implement other new features in the future, e.g.: class A { @ReadOnly public $var; @PropertyGetter("virtualPropertyName") public function baz() { } @ClassInvariant public static function bar() { } @InstanceInvariant public function foo() { } /** * A closure that could be called as if it were a non-static method * and which would be automatically rebound. * @var Closure */ @MethodClosure("staticMethod" => false, "rebind" => true) public static $clos; @Before("self::whatever", instance=true) /* Or @After, or @Around */ @Log("entering foobar") /* user-defined specialization of Before */ @Precondition(...) public function foobar() {} } The current implementation would not allow any of this, but at least it opened way. A doc comment parser... -- Gustavo Lopes