This class is responsible for validating the method doc block

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_Abstract::_()
inherited_from \phpDocumentor_Plugin_Core_Parser_DocBlock_Validator_Abstract::_()
inherited_from \phpDocumentor_Plugin_Core_Parser_DocBlock_Validator_Function::_()

Parameters

$message

string

ID or message to translate.

$variables

array

Variables to use for substitution.

Returns

string

Constructor

__construct(\phpDocumentor_Plugin $plugin, string $name, \phpDocumentor\Reflection\DocBlock | null $docblock, \phpDocumentor_Reflection_Abstract | null $source) 
Inherited

inherited_from \phpDocumentor_Plugin_Core_Parser_DocBlock_Validator_Abstract::__construct()
inherited_from \phpDocumentor_Plugin_Core_Parser_DocBlock_Validator_Function::__construct()

Parameters

$plugin

\phpDocumentor_Plugin

Plugin to which this validator belongs.

$name

string

Name of the "entity"

$docblock

\phpDocumentor\Reflection\DocBlocknull

Docblock

$source

\phpDocumentor_Reflection_Abstractnull

Source Element.

Dispatches a logging request to log a debug message.

debug(string $message) : void
Inherited

inherited_from \phpDocumentor_Plugin_Abstract::debug()
inherited_from \phpDocumentor_Plugin_Core_Parser_DocBlock_Validator_Abstract::debug()
inherited_from \phpDocumentor_Plugin_Core_Parser_DocBlock_Validator_Function::debug()

Parameters

$message

string

The message to log.

Dispatches an event to the Event Dispatcher.

dispatch(string $name, \string[] $arguments) : mixed | null
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_Abstract::dispatch()
inherited_from \phpDocumentor_Plugin_Core_Parser_DocBlock_Validator_Abstract::dispatch()
inherited_from \phpDocumentor_Plugin_Core_Parser_DocBlock_Validator_Function::dispatch()

Parameters

$name

string

Name of the event to dispatch.

$arguments

\string[]

Arguments for this event.

Exceptions

\phpDocumentor_Parser_Exception if there is a dispatcher but it is not of type sfEventDispatcher

Returns

mixednull

Returns the configuration for this object.

getConfiguration() : \Zend_Config_Xml
Inherited

inherited_from \phpDocumentor_Plugin_Abstract::getConfiguration()
inherited_from \phpDocumentor_Plugin_Core_Parser_DocBlock_Validator_Abstract::getConfiguration()
inherited_from \phpDocumentor_Plugin_Core_Parser_DocBlock_Validator_Function::getConfiguration()

Returns

Returns the event dispatcher.

getEventDispatcher() : \sfEventDispatcher
Inherited

inherited_from \phpDocumentor_Plugin_Abstract::getEventDispatcher()
inherited_from \phpDocumentor_Plugin_Core_Parser_DocBlock_Validator_Abstract::getEventDispatcher()
inherited_from \phpDocumentor_Plugin_Core_Parser_DocBlock_Validator_Function::getEventDispatcher()

Returns

Returns the translation component.

getTranslator() : \Zend_Translate_Adapter_Array | null
Inherited

inherited_from \phpDocumentor_Plugin_Abstract::getTranslator()
inherited_from \phpDocumentor_Plugin_Core_Parser_DocBlock_Validator_Abstract::getTranslator()
inherited_from \phpDocumentor_Plugin_Core_Parser_DocBlock_Validator_Function::getTranslator()

Returns

Validates whether this function has a short description.

hasShortDescription() : bool
Inherited

inherited_from \phpDocumentor_Plugin_Core_Parser_DocBlock_Validator_Function::hasShortDescription()

Returns

bool

Is the docblock valid?

isValid() : boolean
Inherited

see \phpDocumentor_Parser_DocBlock_Validator::isValid()
inherited_from \phpDocumentor_Plugin_Core_Parser_DocBlock_Validator_Function::isValid()

Returns

boolean

Dispatches a logging request.

log(string $message, int $priority) : void
Inherited

inherited_from \phpDocumentor_Plugin_Abstract::log()
inherited_from \phpDocumentor_Plugin_Core_Parser_DocBlock_Validator_Abstract::log()
inherited_from \phpDocumentor_Plugin_Core_Parser_DocBlock_Validator_Function::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_Abstract::logParserError()
inherited_from \phpDocumentor_Plugin_Core_Parser_DocBlock_Validator_Abstract::logParserError()
inherited_from \phpDocumentor_Plugin_Core_Parser_DocBlock_Validator_Function::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_Abstract::setOptions()
inherited_from \phpDocumentor_Plugin_Core_Parser_DocBlock_Validator_Function::setOptions()

Parameters

$options

array

Options that may be used during validation

Validates whether the name of the argument is the same as that of the

doesArgumentNameMatchParam(\phpDocumentor\Reflection\DocBlock\Tag\ParamTag $param, phpDocumentor_Reflection_Argument $argument) : bool
Inherited

inherited_from \phpDocumentor_Plugin_Core_Parser_DocBlock_Validator_Function::doesArgumentNameMatchParam()

Parameters

$param

\tag.\phpDocumentor\Reflection\DocBlock\Tag\ParamTag

If the @param tag does not contain a name then this method will set it based on the argument.

$argument

\phpDocumentor_Reflection_Argument

Argument to validate against.

Returns

boolwhether an issue occurred

Checks the typehint of the argument versus the @param tag.

doesArgumentTypehintMatchParam(\phpDocumentor\Reflection\DocBlock\Tag\ParamTag $param, phpDocumentor_Reflection_Argument $argument) : bool
Inherited

If the argument has no typehint we do not check anything. When multiple type are given then the typehint needs to be one of them.

inherited_from \phpDocumentor_Plugin_Core_Parser_DocBlock_Validator_Function::doesArgumentTypehintMatchParam()

Parameters

Returns

boolwhether an issue occurred

Validates whether this element has a docblock.

hasDocBlock() : bool
Inherited

inherited_from \phpDocumentor_Plugin_Core_Parser_DocBlock_Validator_Function::hasDocBlock()

Returns

bool

Validates whether an argument is mentioned in the docblock.

isArgumentInDocBlock(integer $index, phpDocumentor_Reflection_Argument $argument, array $params) : bool
Inherited

inherited_from \phpDocumentor_Plugin_Core_Parser_DocBlock_Validator_Function::isArgumentInDocBlock()

Parameters

$index

integer

The position in the argument listing.

$argument

\phpDocumentor_Reflection_Argument

The argument itself.

$params

\phpDocumentor\Reflection\DocBlock\Tag[]

The list of @param tags to validate against.

Returns

boolwhether an issue occurred.

Checks whether the type of the given tag is not 'type'; which would indicate a non-changed IDE value.

isDefaultIdeType(\phpDocumentor\Reflection\DocBlock\Tag\ParamTag | \phpDocumentor\Reflection\DocBlock\Tag\ReturnTag $param) : bool
Inherited

inherited_from \phpDocumentor_Plugin_Core_Parser_DocBlock_Validator_Function::isDefaultIdeType()

Parameters

Returns

boolwhether an issue occurred

Validates all arguments whether they align nicely with the docblocks.

validateArguments() : void
Inherited

inherited_from \phpDocumentor_Plugin_Core_Parser_DocBlock_Validator_Function::validateArguments()

 Properties

 

<p>Configuration object for plugins</p>

$configuration : \Zend_Config_Xml
Inherited

inherited_from \phpDocumentor_Plugin_Abstract::$$configuration
inherited_from \phpDocumentor_Plugin_Core_Parser_DocBlock_Validator_Abstract::$$configuration
inherited_from \phpDocumentor_Plugin_Core_Parser_DocBlock_Validator_Function::$$configuration
 

Docblock for the file.

$docblock : \phpDocumentor\Reflection\DocBlock
Inherited

inherited_from \phpDocumentor_Plugin_Core_Parser_DocBlock_Validator_Abstract::$$docblock
inherited_from \phpDocumentor_Plugin_Core_Parser_DocBlock_Validator_Function::$$docblock
 

Name of the "entity" being validated.

$entityName : string
Inherited

inherited_from \phpDocumentor_Plugin_Core_Parser_DocBlock_Validator_Abstract::$$entityName
inherited_from \phpDocumentor_Plugin_Core_Parser_DocBlock_Validator_Function::$$entityName
 

<p>Dispatcher used to send events back and forth</p>

$event_dispatcher : \sfEventDispatcher
Inherited

inherited_from \phpDocumentor_Plugin_Abstract::$$event_dispatcher
inherited_from \phpDocumentor_Plugin_Core_Parser_DocBlock_Validator_Abstract::$$event_dispatcher
inherited_from \phpDocumentor_Plugin_Core_Parser_DocBlock_Validator_Function::$$event_dispatcher
 

Line number of the docblock

$lineNumber : int
Inherited

inherited_from \phpDocumentor_Plugin_Core_Parser_DocBlock_Validator_Abstract::$$lineNumber
inherited_from \phpDocumentor_Plugin_Core_Parser_DocBlock_Validator_Function::$$lineNumber
 

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

$options : array
Inherited

inherited_from \phpDocumentor_Plugin_Core_Parser_DocBlock_Validator_Abstract::$$options
inherited_from \phpDocumentor_Plugin_Core_Parser_DocBlock_Validator_Function::$$options
 

Source element of the DocBlock.

$source : \phpDocumentor_Reflection_Abstract
Inherited

inherited_from \phpDocumentor_Plugin_Core_Parser_DocBlock_Validator_Abstract::$$source
inherited_from \phpDocumentor_Plugin_Core_Parser_DocBlock_Validator_Function::$$source
 

<p>Translation object</p>

$translate : \Zend_Translate_Adapter_Array
Inherited

inherited_from \phpDocumentor_Plugin_Abstract::$$translate
inherited_from \phpDocumentor_Plugin_Core_Parser_DocBlock_Validator_Abstract::$$translate
inherited_from \phpDocumentor_Plugin_Core_Parser_DocBlock_Validator_Function::$$translate