Skip to content
JonathanO edited this page Jun 2, 2012 · 1 revision

Annotation

Marks a class as being an annotation. A class with this annotation can itself be used as an annotation, and will be instantiated when the annotation is found.

Parameters

  1. on (string[]) Where the annotation can appear. The magic values "method", "property" or "class" do the obvious. You can also provide fully namespaced annotation names, in which case this annotation can appear as an argument to the named annotation.
  2. max (int) The maximum number of times the annotation can appear in one docblock (default null for infinite)

Examples

An annotation which can be used on classes, and as an argument to the \Foo\Bar annotation

<?
/**
 * @Annotation(on={"class", "\Foo\Bar"})
 */
class Wibble {
}

Back to Annotations list

Clone this wiki locally