Document default values in annotations
Hi,
I have found nothing in the documentation (and no test, but didn't search for too long).
Are there some docs about annotations that I can use without explicitly naming the parameters?
I guess it just injects an array with the key "value" but I am not to sure.
For reference, I mean code like this:
/**
* @SomeAnnot("ohai")
*/
How is this unnamed parameter injected? It would be great if we could add a note about that on https://www.doctrine-project.org/projects/doctrine-annotations/en/latest/custom.html
I think it is called value and passed to the constructor of your annotation as such, but not sure about it either: would indeed need test and documentation additions.
There is a test here: https://github.com/doctrine/annotations/blob/f173cdc80791e747cfad36a27df262acc2ef77bb/tests/Doctrine/Tests/Annotations/DocParserTest.php#L103-L123
But I agree it's a bit magic, maybe something to re-think in 2.0 (i.e. explciitly marking specific property as @Default).