Fully Qualified Name: | Laminas\Code\Annotation\Parser\GenericAnnotationParser |
Implements: | ParserInterface |
Generic annotation parser
Expects registration of AnnotationInterface instances. Such instances will be passed annotation content to their initialize() method, which they are then responsible for parsing.
Name | Description | Defined By |
---|---|---|
hasAnnotation() | Checks if the manager has annotations for a class | GenericAnnotationParser |
onCreateAnnotation() | Listen to onCreateAnnotation, and attempt to return an annotation object instance. | GenericAnnotationParser |
registerAnnotation() | Register annotations | GenericAnnotationParser |
registerAnnotations() | Register many annotations at once | GenericAnnotationParser |
setAlias() | Alias an annotation name | GenericAnnotationParser |
Checks if the manager has annotations for a class
Parameter Name | Type | Description |
---|---|---|
$class | string |
Returns: bool
Listen to onCreateAnnotation, and attempt to return an annotation object instance.
If the annotation class or alias is not registered, immediately returns false. Otherwise, resolves the class, clones it, and, if any content is present, calls {@link AnnotationInterface::initialize()} with the content.
Parameter Name | Type | Description |
---|---|---|
$e | \EventInterface |
Returns: bool|\AnnotationInterface
Register annotations
Parameter Name | Type | Description |
---|---|---|
$annotation | string|\AnnotationInterface | String |
Returns: void
Register many annotations at once
Parameter Name | Type | Description |
---|---|---|
$annotations | array|\Traversable |
Returns: \GenericAnnotationParser
Alias an annotation name
Parameter Name | Type | Description |
---|---|---|
$alias | string | |
$class | string | May |
Returns: \GenericAnnotationParser