Fwd: [PHP-DEV] Annotation PHP 7

From: Date: Tue, 04 Nov 2014 13:18:54 +0000
Subject: Fwd: [PHP-DEV] Annotation PHP 7
References: 1 2 3 4 5 6 7 8 9 10 11  Groups: php.internals 
Request: Send a blank email to internals+get-78635@lists.php.net to get a copy of this message
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 <lisachenko.it@gmail.com>: 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. >

« previous php.internals (#78635) next »