I may give my opinion, but it's going to be only mine. May be it's better to write all these question in RFC and make everyone to expose their opinion. It shouldn't be a final voting, just a survey that would help us make a decisions, where to go.
don't dive into implementation details, use cases, syntax and behavior are more important. Thanks. Dmitry. On Fri, Feb 6, 2015 at 9:21 PM, guilhermebla...@gmail.com < guilhermebla...@gmail.com> wrote: > Hi Dmitry, > > So, can we start drafting out some things? > Simple questions would help everybody to get this moving forward. > I'll compile a simple list of questions to answer that would drive the > direction on how it would be implemented. > Please ignore the formatting on HOW they are defined. Tokens can change. > Here it is: > > 1- Doc comments vs. outside? > > 2- Keep object instance creation the same? IE: @Foo vs new Foo() > > 3- Is constructor the only way to inject parameters? > > 4- What if we have optional arguments, like: @Foo("bar", null, null, > "woo")? > Suppose that you wanna fix the optional arguments by declaring names (like > this: @Foo("bar", test="woo")), doesn't it collide with PHP interests of > not supporting parametrized arguments? How would parameter skipping > proposal address this in a nicer way? > > 5- How would you deal with inheritance? Should a method inherit the same > annotations from parent or not? > Should we add ability to flag to inherit or not? What about overrides? > Would they be allowed? Is there a vague idea on how this concept could be > achieved? > > 6- Would you be possible to change annotations value at runtime? > > 7- Would we validate annotation arguments at all? Consider as array? > Properties of objects? > > 8- In case we take the approach of properties of objects... how would we > flag that a given class can/cannot be used as annotation: another > annotation, interface, any other idea? > > 9- Would we and/or wow would we flag that a given class could be used only > in a class and not in a method? > > 10- How would it be the syntax to declare a new annotation? > > > I think we have a good start now... =) > > []s, > > > On Fri, Feb 6, 2015 at 12:53 PM, Dennis Birkholz <den...@birkholz.biz> > wrote: > > > > On the other hand you have a working solution. > > > You won't be able to use annotations for PHP5 projects anyway. > > > Except, if we put them into comments or doc-comments. > > > > > > /**[Attribute(Value)]*/ > > > > Why not /**@ Attribute Value */ or /**@ Attribute(Value) */? No [] > > required and @ looks more familiar with docblock annotations in use. > > > > -- > > PHP Internals - PHP Runtime Development Mailing List > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > > > -- > Guilherme Blanco > MSN: guilhermebla...@hotmail.com > GTalk: guilhermeblanco > Toronto - ON/Canada >