[DCOM-260] Allow positional and named parameters for annotations Created: 10/Dec/14  Updated: 14/Dec/14  Resolved: 14/Dec/14

Status: Resolved
Project: Doctrine Common
Component/s: Annotations
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Minor
Reporter: Javier Eguiluz Assignee: Benjamin Eberlei
Resolution: Can't Fix Votes: 0
Labels: None


 Description   

When using annotations, is very common to repeatedly use the same set of parameters. For instance, when using the @Route annotation is common to define just the path and its name.

With the current Doctrine annotations, you can only have one unnamed argument (in this case, the path) and the rest of parameters (in this case, the route name) must define their names:

// this is how it works
@Route("/", name="homepage")

// this doesn't work, but it'd be great if it did
@Route("/", "homepage")

This issue just asks Doctrine managers if they are willing to enhance annotations to allow for named, positional and mixed parameters:

 /**
  * // named parameters
  * @Assert(expression = "value > 18", message="You must be 18 years old or older.")
  *
  * // mixed parameters
  * @Assert("value > 18", message="You must be 18 years old or older.")
  *
  * // positional parameters
  * @Assert("value > 18", "You must be 18 years old or older.")
  */
private $age;


 Comments   
Comment by Marco Pivetta [ 10/Dec/14 ]

This issue just asks Doctrine managers if they are willing to enhance annotations to allow for named, positional and mixed parameters

I suggest you to directly open a pull request, since we don't have anyone who would work on it (resource-wise) in first place

Comment by Javier Eguiluz [ 14/Dec/14 ]

I'm closing this issue because I can't fix it and Doctrine project doesn't have the resources to do it.





Generated at Sun Dec 21 08:42:31 UTC 2014 using JIRA 6.2.3#6260-sha1:63ef1d6dac3f4f4d7db4c1effd405ba38ccdc558.