Ticket #110 (closed documentation issue: fixed)
Allow annotations for method/function parameters
| Reported by: | mikey | Owned by: | mikey |
|---|---|---|---|
| Priority: | minor | Milestone: | 0.4.0 |
| Component: | ReflectionApi | Version: | SVN-trunk |
| Keywords: | Cc: | schst |
Description (last modified by mikey) (diff)
An idea how to implement annotations for method and function parameters:
/**
* a foo function
*
* @param string $bar
* @Annotation{bar}(attribute='value')
*/
function foo($bar) { ... }
The curly braces will mark the annotation as belonging to the parameter declared within the braces. With other words, the annotation in the example above is annotated to the param $bar, not to the function foo().
This would require to extend the annotation parser with a new state that is able to detect such an annotation. Of course, this declarations should be allowed, too:
/**
* a foo function
*
* @param string $bar
* @Annotation[CastedAnnotation]{bar}(attribute='value')
* @Annotation{bar}[CastedAnnotation](attribute='value')
*/
function foo($bar) { ... }
(Only one of them, this example just shows that the sequence should not be fixed.)
Change History
Note: See
TracTickets for help on using
tickets.
