Ticket #110 (closed documentation issue: fixed)

Opened 6 months ago

Last modified 6 months ago

Allow annotations for method/function parameters

Reported by: mikey Assigned to: mikey
Priority: minor Milestone: 0.4.0
Component: ReflectionApi Version: SVN-trunk
Keywords: Cc: schst

Description (Last modified by mikey)

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

11/26/07 17:57:29 changed by mikey

  • description changed.

11/27/07 00:56:50 changed by mikey

  • status changed from new to assigned.

11/27/07 09:22:13 changed by mikey

  • priority changed from major to minor.
  • type changed from enhancement to documentation issue.
  • milestone set to 0.4.0.

Implemented with changeset 1072. Documentation needs to be updated.

11/28/07 15:03:06 changed by mikey

  • status changed from assigned to closed.
  • resolution set to fixed.

Documentation updated.