Listener for the Core Plugin.

author Mike van Riel

 Methods

Translates the ID or message in the given language.

_(string $message, array $variables) : string
Inherited

Translation messages may contain any formatting as used by the php vsprintf function.

inherited_from \phpDocumentor\Plugin\PluginAbstract::_()
inherited_from \phpDocumentor\Plugin\ListenerAbstract::_()

Parameters

$message

string

ID or message to translate.

$variables

array

Variables to use for substitution.

Returns

string

Registers the event dispatcher and configuration, calls the configure method and connects the hooks of this listener to the event dispatcher.

__construct(\phpDocumentor\Plugin\PluginAbstract $plugin) 
Inherited
inherited_from \phpDocumentor\Plugin\ListenerAbstract::__construct()

Parameters

$plugin

\phpDocumentor\Plugin\PluginAbstract

Plugin object to register this listener on.

Applies all behaviours prior to transformation.

applyBehaviours(\phpDocumentor\Transformer\Event\PreTransformationEvent $data) : void
phpdoc-event transformer.transform.pre

Parameters

$data

\phpDocumentor\Transformer\Event\PreTransformationEvent

Event object containing the parameters.

Exceptions

\phpDocumentor\Plugin\Core\Exception if the event does not originate from the Transformer

Dispatches a logging request to log a debug message.

debug(string $message) : void
Inherited
inherited_from \phpDocumentor\Plugin\PluginAbstract::debug()
inherited_from \phpDocumentor\Plugin\ListenerAbstract::debug()

Parameters

$message

string

The message to log.

Dispatches an event to the Event Dispatcher.

dispatch(string $name, \phpDocumentor\Event\EventAbstract $event) : void
Inherited

This method tries to dispatch an event; if no Event Dispatcher has been set than this method will explicitly not fail and return null.

By not failing we make the Event Dispatcher optional and is it easier for people to re-use this component in their own application.

inherited_from \phpDocumentor\Plugin\PluginAbstract::dispatch()
inherited_from \phpDocumentor\Plugin\ListenerAbstract::dispatch()

Parameters

$name

string

Name of the event to dispatch.

$event

\phpDocumentor\Event\EventAbstract

Arguments for this event.

Exceptions

\phpDocumentor\Plugin\Exception if there is a dispatcher but it is not of type EventDispatcher

Prepare the tag to be injected into the XML file.

exportTag(\phpDocumentor\Reflection\Event\ExportDocBlockTagEvent $data) : void
phpdoc-event reflection.docblock.tag.export

Parameters

$data

\phpDocumentor\Reflection\Event\ExportDocBlockTagEvent

Event object containing the parameters.

Returns the configuration for this object.

getConfiguration() : \Zend\Config\Config
Inherited
inherited_from \phpDocumentor\Plugin\PluginAbstract::getConfiguration()
inherited_from \phpDocumentor\Plugin\ListenerAbstract::getConfiguration()

Returns

\Zend\Config\Config

Returns the event dispatcher.

getEventDispatcher() : \phpDocumentor\Event\Dispatcher
Inherited
inherited_from \phpDocumentor\Plugin\PluginAbstract::getEventDispatcher()
inherited_from \phpDocumentor\Plugin\ListenerAbstract::getEventDispatcher()

Returns

Returns the translation component.

getTranslator() : \Zend\I18n\Translator\Translator | null
Inherited
inherited_from \phpDocumentor\Plugin\PluginAbstract::getTranslator()
inherited_from \phpDocumentor\Plugin\ListenerAbstract::getTranslator()

Returns

\Zend\I18n\Translator\Translatornull

Dispatches a logging request.

log(string $message, int $priority) : void
Inherited
inherited_from \phpDocumentor\Plugin\PluginAbstract::log()
inherited_from \phpDocumentor\Plugin\ListenerAbstract::log()

Parameters

$message

string

The message to log.

$priority

int

The logging priority, the lower, the more important. Ranges from 1 to 7

Dispatches a parser error to be logged.

logParserError(string $type, $code, string $line, string[] $variables) : void
Inherited
inherited_from \phpDocumentor\Plugin\PluginAbstract::logParserError()
inherited_from \phpDocumentor\Plugin\ListenerAbstract::logParserError()

Parameters

$type

string

The logging priority as string

$code

$line

string

The line number where the error occurred..

$variables

string[]

an array with message substitution variables.

Checks all phpDocumentor whether they match the given rules.

validateDocBlocks(\phpDocumentor\Reflection\Event\PostDocBlockExtractionEvent $data) : void
phpdoc-event reflection.docblock-extraction.post

Parameters

$data

\phpDocumentor\Reflection\Event\PostDocBlockExtractionEvent

Event object containing the parameters.

Hook method to allow some additional processing before the hooks are connected to the dispatcher.

configure() : void
Inherited

This method can be used to manually hook events to the dispatcher based instead of using the @phpdoc-event tag.

see for an example of use.
inherited_from \phpDocumentor\Plugin\ListenerAbstract::configure()

Scans this class for any method containing the @phpdoc-event tag and connects it to the event dispatcher.

connectHooksToDispatcher() : void
Inherited

The @phpdoc-event tag has as description the name of the event to connect to. When encountered will that event be linked to the associated method.

It is thus important that such a method has a single argument $event of type sfEvent. This contains the arguments that were dispatched.

inherited_from \phpDocumentor\Plugin\ListenerAbstract::connectHooksToDispatcher()

Load the configuration from the plugin.xml file

loadConfiguration() : array

Returns

array

Load the configuration for given element (deprecated/required)

loadConfigurationByElement(array $configOptions, string $configType) : array

Parameters

$configOptions

array

The configuration from the plugin.xml file

$configType

string

Required/Deprecated for the time being

Returns

array

 Properties

 

Configuration object for plugins

$configuration : \Zend\Config\Config
Inherited
inherited_from \phpDocumentor\Plugin\PluginAbstract::$$configuration
inherited_from \phpDocumentor\Plugin\ListenerAbstract::$$configuration
 

Dispatcher used to send events back and forth

$event_dispatcher : \phpDocumentor\Event\Dispatcher
Inherited
inherited_from \phpDocumentor\Plugin\PluginAbstract::$$event_dispatcher
inherited_from \phpDocumentor\Plugin\ListenerAbstract::$$event_dispatcher
 

$plugin : \phpDocumentor\Plugin\PluginAbstract
Inherited
inherited_from \phpDocumentor\Plugin\ListenerAbstract::$$plugin
 

Translation object

$translate : \Zend\I18n\Translator\Translator
Inherited
inherited_from \phpDocumentor\Plugin\PluginAbstract::$$translate
inherited_from \phpDocumentor\Plugin\ListenerAbstract::$$translate