Class GenericAnnotationParser

Summary

Fully Qualified Name: Laminas\Code\Annotation\Parser\GenericAnnotationParser
Implements: ParserInterface

Description

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.

Methods

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

Method Details

hasAnnotation()

Checks if the manager has annotations for a class

Parameter Name Type Description
$class string

Returns: bool

onCreateAnnotation()

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

registerAnnotation()

Register annotations

Parameter Name Type Description
$annotation string|\AnnotationInterface String

Returns: void

registerAnnotations()

Register many annotations at once

Parameter Name Type Description
$annotations array|\Traversable

Returns: \GenericAnnotationParser

setAlias()

Alias an annotation name

Parameter Name Type Description
$alias string
$class string May

Returns: \GenericAnnotationParser

Top