AnnotationManager
in package
implements
EventManagerAwareInterface
Pluggable annotation manager
Simply composes an EventManager. When createAnnotation() is called, it fires off an event of the same name, passing it the resolved annotation class, the annotation content, and the raw annotation string; the first listener to return an object will halt execution of the event, and that object will be returned as the annotation.
Interfaces, Classes, Traits and Enums
- EventManagerAwareInterface
- Interface to automate setter injection for an EventManager instance
Table of Contents
- EVENT_CREATE_ANNOTATION = 'createAnnotation'
- $events : EventManagerInterface
- attach() : AnnotationManager
- Attach a parser to listen to the createAnnotation event
- createAnnotation() : false|stdClass
- Create Annotation
- getEventManager() : EventManagerInterface
- Retrieve event manager
- setEventManager() : AnnotationManager
- Set the event manager instance
Constants
EVENT_CREATE_ANNOTATION
public
mixed
EVENT_CREATE_ANNOTATION
= 'createAnnotation'
Properties
$events
protected
EventManagerInterface
$events
Methods
attach()
Attach a parser to listen to the createAnnotation event
public
attach(ParserInterface $parser) : AnnotationManager
Parameters
- $parser : ParserInterface
Return values
AnnotationManager —createAnnotation()
Create Annotation
public
createAnnotation(array<string|int, string> $annotationData) : false|stdClass
Parameters
- $annotationData : array<string|int, string>
Return values
false|stdClass —getEventManager()
Retrieve event manager
public
getEventManager() : EventManagerInterface
Lazy loads an instance if none registered.
Return values
EventManagerInterface —setEventManager()
Set the event manager instance
public
setEventManager(EventManagerInterface $events) : AnnotationManager
Parameters
- $events : EventManagerInterface