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.

package Default

 Methods

Attach a parser to listen to the createAnnotation event

attach(\Zend\Code\Annotation\Parser\ParserInterface $parser) : \Zend\Code\Annotation\AnnotationManager

Parameters

$parser

\Zend\Code\Annotation\Parser\ParserInterface

Returns

\Zend\Code\Annotation\AnnotationManager

Create Annotation

createAnnotation(array<mixed,string> $annotationData) : false | \stdClass

Parameters

$annotationData

array<mixed,string>

Returns

false\stdClass

Retrieve event manager

getEventManager() : \Zend\EventManager\EventManagerInterface

Lazy loads an instance if none registered.

Returns

\Zend\EventManager\EventManagerInterface

Set the event manager instance

setEventManager(\Zend\EventManager\EventManagerInterface $events) : \Zend\Code\Annotation\AnnotationManager
inherited_from \Zend\EventManager\EventManagerAwareInterface::setEventManager()

Parameters

$events

\Zend\EventManager\EventManagerInterface

Returns

\Zend\Code\Annotation\AnnotationManager

 Properties

 

$events

$events : \Zend\EventManager\EventManagerInterface

Default

 Constants

 

EVENT_CREATE_ANNOTATION

EVENT_CREATE_ANNOTATION = 'createAnnotation'