1363. Class

1363.1. Zend\Code\Annotation\Parser\GenericAnnotationParser

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.

1363.1.1. Methods

1363.1.1.1. onCreateAnnotation

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.

Parameters:EventInterface
Return type:false|AnnotationInterface

1363.1.1.2. registerAnnotation

registerAnnotation()

Register annotations

Parameters:string|AnnotationInterface – String class name of an AnnotationInterface implementation, or actual instance
Return type:GenericAnnotationParser
Throws :ExceptionInvalidArgumentException

1363.1.1.3. registerAnnotations

registerAnnotations()

Register many annotations at once

Parameters:array|Traversable
Throws ExceptionInvalidArgumentException:
 
Return type:GenericAnnotationParser

1363.1.1.4. hasAnnotation

hasAnnotation()

Checks if the manager has annotations for a class

Parameters:string
Return type:bool

1363.1.1.5. setAlias

setAlias()

Alias an annotation name

Parameters:
  • string
  • string – May be either a registered annotation name or another alias
Throws ExceptionInvalidArgumentException:
 
Return type:

GenericAnnotationParser

1363.1.1.6. normalizeAlias

normalizeAlias()

Normalize an alias name

Parameters:string
Return type:string

1363.1.1.7. hasAlias

hasAlias()

Do we have an alias by the provided name?

Parameters:string
Return type:bool

1363.1.1.8. resolveAlias

resolveAlias()

Resolve an alias to a class name

Parameters:string
Return type:string