\phpDocumentor\Plugin\Core\Descriptor\ValidatorValidatorAbstract

Base class for DocBlock Validations.

Summary

Methods
Properties
Constants
__construct()
setOptions()
isValid()
dispatch()
log()
logParserError()
debug()
__()
getConfiguration()
getEventDispatcher()
getTranslator()
No public properties found
No constants found
No protected methods found
$translate
$entityName
$lineNumber
$docblock
$source
$options
N/A
No private methods found
No private properties found
N/A

Properties

$entityName

$entityName : string

Name of the "entity" being validated.

Type

string

$lineNumber

$lineNumber : integer

Line number of the docblock

Type

integer

$docblock

$docblock : \phpDocumentor\Reflection\DocBlock

Docblock for the file.

Type

\phpDocumentor\Reflection\DocBlock

$source

$source : \phpDocumentor\Reflection\BaseReflector

Source element of the DocBlock.

Type

\phpDocumentor\Reflection\BaseReflector

$options

$options : array

Array of options that may or may not be used whilst validating

Type

array

Methods

__construct()

__construct(string  $name, \phpDocumentor\Reflection\DocBlock|null  $docblock = null, \phpDocumentor\Reflection\BaseReflector|null  $source = null) 

Constructor

Parameters

string $name

Name of the "entity"

\phpDocumentor\Reflection\DocBlock|null $docblock

Docblock

\phpDocumentor\Reflection\BaseReflector|null $source

Source Element.

setOptions()

setOptions(array  $options) : void

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

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

Parameters

array $options

Options that may be used during validation

isValid()

isValid(\phpDocumentor\Reflection\BaseReflector  $element) 

Parameters

\phpDocumentor\Reflection\BaseReflector $element

dispatch()

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

Dispatches an event to the Event Dispatcher.

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.

Parameters

string $name

Name of the event to dispatch.

\phpDocumentor\Event\EventAbstract $event

Arguments for this event.

Throws

\Exception

if there is a dispatcher but it is not of type EventDispatcher

log()

log(string  $message, string  $priority = \Psr\Log\LogLevel::INFO) : void

Dispatches a logging request.

Parameters

string $message

The message to log.

string $priority

The logging priority.

logParserError()

logParserError(string  $type, string  $code, string  $line, array<mixed,string>  $variables = array()) : void

Dispatches a parser error to be logged.

Parameters

string $type

The logging priority as string

string $code

The message to log.

string $line

The line number where the error occurred..

array<mixed,string> $variables

an array with message substitution variables.

debug()

debug(string  $message) : void

Dispatches a logging request to log a debug message.

Parameters

string $message

The message to log.

__()

__(string  $message, array  $variables = array()) : string

Translates the ID or message in the given language.

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

Parameters

string $message

ID or message to translate.

array $variables

Variables to use for substitution.

Returns

string

getConfiguration()

getConfiguration() : \Zend\Config\Config

Returns the configuration for this object.

Returns

\Zend\Config\Config