ValidatorAbstract

Base class for DocBlock Validations.

package

Default

Methods

Translates the ID or message in the given language.

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

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

codingStandardsIgnoreStart

Arguments

$message

string

ID or message to translate.

$variables

array

Variables to use for substitution.

Response

string

Constructor

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

Arguments

$name

string

Name of the "entity"

$docblock

\phpDocumentor\Reflection\DocBlock|null

Docblock

$source

\phpDocumentor\Reflection\BaseReflector|null

Source Element.

Dispatches a logging request to log a debug message.

debug(string $message) : void

Arguments

$message

string

The message to log.

Dispatches an event to the Event Dispatcher.

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

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.

Throws
\Exception

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

Arguments

$name

string

Name of the event to dispatch.

$event

\phpDocumentor\Event\EventAbstract

Arguments for this event.

Returns the configuration for this object.

getConfiguration() : \Zend\Config\Config

Response

\Zend\Config\Config

Returns the event dispatcher.

getEventDispatcher() : \phpDocumentor\Event\Dispatcher

Returns the translation component.

getTranslator() : \phpDocumentor\Translator\Translator|null

isValid

isValid(\phpDocumentor\Reflection\BaseReflector $element) 
abstract

Arguments

$element

\phpDocumentor\Reflection\BaseReflector

Dispatches a logging request.

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

Arguments

$message

string

The message to log.

$priority

string

The logging priority.

Dispatches a parser error to be logged.

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

Arguments

$type

string

The logging priority as string

$code

string

The message to log.

$line

string

The line number where the error occurred..

$variables

array<mixed,string>

an array with message substitution variables.

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

setOptions(array $options) : void

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

Arguments

$options

array

Options that may be used during validation

Properties

translate

translate : \phpDocumentor\Translator\Translator

Name of the "entity" being validated.

entityName : string
var

Type(s)

string

Line number of the docblock

lineNumber : integer
var

Type(s)

integer

Docblock for the file.

docblock : \phpDocumentor\Reflection\DocBlock
var

Type(s)

\phpDocumentor\Reflection\DocBlock

Source element of the DocBlock.

source : \phpDocumentor\Reflection\BaseReflector
var

Type(s)

\phpDocumentor\Reflection\BaseReflector

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

options : array
var

Type(s)

array