DoctrineAnnotationParser
in package
implements
ParserInterface
A parser for docblock annotations that utilizes the annotation parser from Doctrine\Common.
Consumes Doctrine\Common\Annotations\DocParser, and responds to events from AnnotationManager. If the annotation examined is in the list of classes we are interested in, the raw annotation is passed to the DocParser in order to retrieve the annotation object instance. Otherwise, it is skipped.
Interfaces, Classes, Traits and Enums
Table of Contents
- $allowedAnnotations : array<string|int, mixed>
- $docParser : DocParser
- __construct() : mixed
- getDocParser() : DocParser
- Retrieve the DocParser instance
- onCreateAnnotation() : false|stdClass
- Handle annotation creation
- registerAnnotation() : DoctrineAnnotationParser
- Specify an allowed annotation class
- registerAnnotations() : DoctrineAnnotationParser
- Set many allowed annotations at once
- setDocParser() : DoctrineAnnotationParser
- Set the DocParser instance
Properties
$allowedAnnotations
protected
array<string|int, mixed>
$allowedAnnotations
= []
Annotation classes we support on this iteration
$docParser
protected
DocParser
$docParser
Methods
__construct()
public
__construct() : mixed
Return values
mixed —getDocParser()
Retrieve the DocParser instance
public
getDocParser() : DocParser
If none is registered, lazy-loads a new instance.
Return values
DocParser —onCreateAnnotation()
Handle annotation creation
public
onCreateAnnotation(EventInterface $e) : false|stdClass
Parameters
- $e : EventInterface
Return values
false|stdClass —registerAnnotation()
Specify an allowed annotation class
public
registerAnnotation(string $annotation) : DoctrineAnnotationParser
Parameters
- $annotation : string
Return values
DoctrineAnnotationParser —registerAnnotations()
Set many allowed annotations at once
public
registerAnnotations(array<string|int, mixed>|Traversable $annotations) : DoctrineAnnotationParser
Parameters
- $annotations : array<string|int, mixed>|Traversable
-
Array or traversable object of annotation class names
Tags
Return values
DoctrineAnnotationParser —setDocParser()
Set the DocParser instance
public
setDocParser(DocParser $docParser) : DoctrineAnnotationParser
Parameters
- $docParser : DocParser