Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:78635 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 30850 invoked from network); 4 Nov 2014 13:18:59 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 4 Nov 2014 13:18:59 -0000 Authentication-Results: pb1.pair.com smtp.mail=marcio.web2@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=marcio.web2@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.215.44 as permitted sender) X-PHP-List-Original-Sender: marcio.web2@gmail.com X-Host-Fingerprint: 209.85.215.44 mail-la0-f44.google.com Received: from [209.85.215.44] ([209.85.215.44:54155] helo=mail-la0-f44.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id E9/84-06676-242D8545 for ; Tue, 04 Nov 2014 08:18:59 -0500 Received: by mail-la0-f44.google.com with SMTP id gf13so864924lab.3 for ; Tue, 04 Nov 2014 05:18:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:reply-to:in-reply-to:references:date:message-id :subject:from:to:content-type; bh=AXwsIdkUGobnQkF5ApwuL//IRTZj6sYCtbmOlxwU7xA=; b=nI5w1bgmluV2gjBlcJ+GnGTPfauo0ePlR3M0W6IhCKsuTJujMzM6jau0nlWXHpfe3U WgMZfB7CqbLMK/SfApfmZEe9Z9s4RgTCDnWquI9W6p3j3zDmGB6/sMZov5qMh++AaxrT LJQGgOtQGKLBmkTFOO7qJoROLFimq2DxnieniAYtMyexTlb5ZEPyUhz74BhsZs2ZvEVa EKZBwaO7QEO9mWdM7rfUVmQAEl8Qhxrujny5ZiI7JZPZ/60mgc1xClze9eFpjcAnhp3v pKwxp0Wi3UJ33hlXz1IytpyWr3qsep/5va+hYXUWvefV0Fs0/Dg8B+WPa3U7ThpiY0Wh bq5Q== MIME-Version: 1.0 X-Received: by 10.152.43.77 with SMTP id u13mr11902109lal.98.1415107135078; Tue, 04 Nov 2014 05:18:55 -0800 (PST) Received: by 10.152.46.172 with HTTP; Tue, 4 Nov 2014 05:18:54 -0800 (PST) Reply-To: marcio3w@gmail.com In-Reply-To: References: <5457AF2F.90808@php.net> <5457BDB7.8070701@garfieldtech.com> <54589A8D.3020607@sugarcrm.com> Date: Tue, 4 Nov 2014 10:18:54 -0300 Message-ID: To: Pierre Joye , Levi Morrison , PHP internals , Larry Garfield Content-Type: multipart/alternative; boundary=001a11c364741b06980507084e51 Subject: Fwd: [PHP-DEV] Annotation PHP 7 From: marcio.web2@gmail.com (Marcio Almada) --001a11c364741b06980507084e51 Content-Type: text/plain; charset=UTF-8 Hi! > PHP7 has a wonderful parser, maybe it's possible to provide a general > syntax for annotations with userland hooks for arbitrary data. This > approach can give a tool for framework developers to define a node visitor > for annotations. Alternative way is to define simple key-value storage and > access it via Reflector->getAnnotations(). I've been maintaining this annotations library https://github.com/marcioAlmada/annotations, it uses json parser as the interpreter for it's DSL to declare annotations. One of the key features is to allow this key-value storage Alexander pointed out. The main focus is to allow annotations to be declared without the need for a concrete class for each annotation though it doesn't impedes that. I'm wondering if it would be a good idea to unite maintainers of userland annotations libraries and grab the good parts of each project so we can have a merged RFC on this subject? Huge +1 for this discussion too. PHPNG seems like a good milestone to have this core annotations. 2014-11-04 9:27 GMT-03:00 Alexander Lisachenko : Hi! > > It would be nice to take "paving the walkways" approach, but last time > > we tried, IIRC we've got into something very over-engineered. Maybe if > > we try again with more restricted scope (i.e. not trying to put a DSL > > for describing arbitrarily complex data structures into it :) it would > > be more successful this time. > > > > PHP7 has a wonderful parser, maybe it's possible to provide a general > syntax for annotations with userland hooks for arbitrary data. This > approach can give a tool for framework developers to define a node visitor > for annotations. Alternative way is to define simple key-value storage and > access it via Reflector->getAnnotations(). > > I want to put my huge +1 vote on annotations support in the core, because > Go! AOP uses annotations a lot for defining metadata and markers in the > code and provides an engine for advanced programming patterns and method > interception. Doctrine is good library, but this can be better on core > level. > --001a11c364741b06980507084e51--