Re: Annotation PHP 7

From: Date: Tue, 04 Nov 2014 11:20:16 +0000
Subject: Re: 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-78627@lists.php.net to get a copy of this message
On Nov 4, 2014 8:54 PM, "Benjamin Eberlei" <kontakt@beberlei.de> wrote: > > On Tue, Nov 4, 2014 at 11:28 AM, Pierre Joye <pierre.php@gmail.com> wrote: >> >> On Tue, Nov 4, 2014 at 4:21 PM, Stas Malyshev <smalyshev@sugarcrm.com> wrote: >> > Hi! >> > >> >> As I do consider personal tastes important, there are times where we should >> >> listen to our users. >> > >> > 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. >> >> All projects mentioned in this thread use: >> >> http://doctrine-common.readthedocs.org/en/latest/reference/annotations.html >> >> That makes a pretty good base spec. > > > Being the author I can say, the doctrine annotations project is way too over-engineered/special-purpose to land in core. > > I agree with Stas that a much simpler approach is probably realistic. > > beginning pure speculation here, i see a short array like syntax like: > > [foo="bar", bar="baz", baz=["key": "value"]] > function annotated_fn() {} > > Maybe even exactly short array syntax: > > ["foo"="bar", "bar"="baz", > "baz"=["key": "value"]] > function annotated_fn() {} > > Then $reflectionFunction->getAnnotations() returns an array. Various PHP/Userland libraries and frameworks can then stick whatever symantic on top that they want. Yes, that was what discussed last time too and makes perfectly sense. I only not sure about the syntax. I do not like that one f.e. not really in phase with what exists (doctrine or other languages). Cheers, Pierre

« previous php.internals (#78627) next »