This class is responsible for validating the file docbloc

category phpDocumentor
package Parser
subpackage DocBlock_Validators
author Ben Selby
author Mike van Riel
copyright 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com)
license MIT
link http://phpdoc.org

 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\Core\Parser\DocBlock\Validator\ValidatorAbstract::_()
inherited_from \phpDocumentor\Plugin\Core\Parser\DocBlock\Validator\ClassValidator::_()

Parameters

$message

string

ID or message to translate.

$variables

array

Variables to use for substitution.

Returns

string

Constructor

__construct(\phpDocumentor\Plugin\Plugin $plugin, string $name, \phpDocumentor\Reflection\DocBlock | null $docblock, \phpDocumentor\Reflection\BaseReflector | null $source) 
Inherited
inherited_from \phpDocumentor\Plugin\Core\Parser\DocBlock\Validator\ValidatorAbstract::__construct()
inherited_from \phpDocumentor\Plugin\Core\Parser\DocBlock\Validator\ClassValidator::__construct()

Parameters

$plugin

\phpDocumentor\Plugin\Plugin

Plugin to which this validator belongs.

$name

string

Name of the "entity"

$docblock

\phpDocumentor\Reflection\DocBlocknull

Docblock

$source

\phpDocumentor\Reflection\BaseReflectornull

Source Element.

Dispatches a logging request to log a debug message.

debug(string $message) : void
Inherited
inherited_from \phpDocumentor\Plugin\PluginAbstract::debug()
inherited_from \phpDocumentor\Plugin\Core\Parser\DocBlock\Validator\ValidatorAbstract::debug()
inherited_from \phpDocumentor\Plugin\Core\Parser\DocBlock\Validator\ClassValidator::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\Core\Parser\DocBlock\Validator\ValidatorAbstract::dispatch()
inherited_from \phpDocumentor\Plugin\Core\Parser\DocBlock\Validator\ClassValidator::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

Returns the configuration for this object.

getConfiguration() : \Zend\Config\Config
Inherited
inherited_from \phpDocumentor\Plugin\PluginAbstract::getConfiguration()
inherited_from \phpDocumentor\Plugin\Core\Parser\DocBlock\Validator\ValidatorAbstract::getConfiguration()
inherited_from \phpDocumentor\Plugin\Core\Parser\DocBlock\Validator\ClassValidator::getConfiguration()

Returns

\Zend\Config\Config

Returns the event dispatcher.

getEventDispatcher() : \phpDocumentor\Event\Dispatcher
Inherited
inherited_from \phpDocumentor\Plugin\PluginAbstract::getEventDispatcher()
inherited_from \phpDocumentor\Plugin\Core\Parser\DocBlock\Validator\ValidatorAbstract::getEventDispatcher()
inherited_from \phpDocumentor\Plugin\Core\Parser\DocBlock\Validator\ClassValidator::getEventDispatcher()

Returns

Returns the translation component.

getTranslator() : \Zend\I18n\Translator\Translator | null
Inherited
inherited_from \phpDocumentor\Plugin\PluginAbstract::getTranslator()
inherited_from \phpDocumentor\Plugin\Core\Parser\DocBlock\Validator\ValidatorAbstract::getTranslator()
inherited_from \phpDocumentor\Plugin\Core\Parser\DocBlock\Validator\ClassValidator::getTranslator()

Returns

\Zend\I18n\Translator\Translatornull

Is the docblock valid?

isValid() : boolean

Dispatches a logging request.

log(string $message, int $priority) : void
Inherited
inherited_from \phpDocumentor\Plugin\PluginAbstract::log()
inherited_from \phpDocumentor\Plugin\Core\Parser\DocBlock\Validator\ValidatorAbstract::log()
inherited_from \phpDocumentor\Plugin\Core\Parser\DocBlock\Validator\ClassValidator::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\Core\Parser\DocBlock\Validator\ValidatorAbstract::logParserError()
inherited_from \phpDocumentor\Plugin\Core\Parser\DocBlock\Validator\ClassValidator::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.

Set the options that may be used whilst validating the docblocks.

setOptions(array $options) : void
Inherited

Can contain configuration as long as each validator knows how to interrogate it

inherited_from \phpDocumentor\Plugin\Core\Parser\DocBlock\Validator\ValidatorAbstract::setOptions()
inherited_from \phpDocumentor\Plugin\Core\Parser\DocBlock\Validator\ClassValidator::setOptions()

Parameters

$options

array

Options that may be used during validation

 Properties

 

Configuration object for plugins

$configuration : \Zend\Config\Config
Inherited
inherited_from \phpDocumentor\Plugin\PluginAbstract::$$configuration
inherited_from \phpDocumentor\Plugin\Core\Parser\DocBlock\Validator\ValidatorAbstract::$$configuration
inherited_from \phpDocumentor\Plugin\Core\Parser\DocBlock\Validator\ClassValidator::$$configuration
 

$docblock : \phpDocumentor\Reflection\DocBlock
Inherited
inherited_from \phpDocumentor\Plugin\Core\Parser\DocBlock\Validator\ValidatorAbstract::$$docblock
inherited_from \phpDocumentor\Plugin\Core\Parser\DocBlock\Validator\ClassValidator::$$docblock
 

$entityName : string
Inherited
inherited_from \phpDocumentor\Plugin\Core\Parser\DocBlock\Validator\ValidatorAbstract::$$entityName
inherited_from \phpDocumentor\Plugin\Core\Parser\DocBlock\Validator\ClassValidator::$$entityName
 

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\Core\Parser\DocBlock\Validator\ValidatorAbstract::$$event_dispatcher
inherited_from \phpDocumentor\Plugin\Core\Parser\DocBlock\Validator\ClassValidator::$$event_dispatcher
 

$lineNumber : int
Inherited
inherited_from \phpDocumentor\Plugin\Core\Parser\DocBlock\Validator\ValidatorAbstract::$$lineNumber
inherited_from \phpDocumentor\Plugin\Core\Parser\DocBlock\Validator\ClassValidator::$$lineNumber
 

$options : array
Inherited
inherited_from \phpDocumentor\Plugin\Core\Parser\DocBlock\Validator\ValidatorAbstract::$$options
inherited_from \phpDocumentor\Plugin\Core\Parser\DocBlock\Validator\ClassValidator::$$options
 

$source : \phpDocumentor\Reflection\BaseReflector
Inherited
inherited_from \phpDocumentor\Plugin\Core\Parser\DocBlock\Validator\ValidatorAbstract::$$source
inherited_from \phpDocumentor\Plugin\Core\Parser\DocBlock\Validator\ClassValidator::$$source
 

Translation object

$translate : \Zend\I18n\Translator\Translator
Inherited
inherited_from \phpDocumentor\Plugin\PluginAbstract::$$translate
inherited_from \phpDocumentor\Plugin\Core\Parser\DocBlock\Validator\ValidatorAbstract::$$translate
inherited_from \phpDocumentor\Plugin\Core\Parser\DocBlock\Validator\ClassValidator::$$translate