AreAllArgumentsValid

todo

break this validator up in subvalidators for each Error

package

Default

Methods

Validates whether the name of the argument is the same as that of the param tag.

doesArgumentNameMatchParam(\phpDocumentor\Reflection\DocBlock\Tag\ParamTag $param, \phpDocumentor\Reflection\FunctionReflector\ArgumentReflector $argument, \phpDocumentor\Reflection\BaseReflector $element) : \phpDocumentor\Descriptor\Validator\Error|null

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

Arguments

$param

\phpDocumentor\Reflection\DocBlock\Tag\ParamTag

param to validate with.

$argument

\phpDocumentor\Reflection\FunctionReflector\ArgumentReflector

Argument to validate against.

$element

\phpDocumentor\Reflection\BaseReflector

Response

\phpDocumentor\Descriptor\Validator\Error|null

whether an issue occurred

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

doesArgumentTypehintMatchParam(\phpDocumentor\Reflection\DocBlock\Tag\ParamTag $param, \phpDocumentor\Reflection\FunctionReflector\ArgumentReflector $argument, \phpDocumentor\Reflection\BaseReflector $element) : \phpDocumentor\Descriptor\Validator\Error|null

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.

Arguments

$param

\phpDocumentor\Reflection\DocBlock\Tag\ParamTag

$argument

\phpDocumentor\Reflection\FunctionReflector\ArgumentReflector

$element

\phpDocumentor\Reflection\BaseReflector

Response

\phpDocumentor\Descriptor\Validator\Error|null

Validates whether an argument is mentioned in the docblock.

isArgumentInDocBlock(integer $index, \phpDocumentor\Reflection\FunctionReflector\ArgumentReflector $argument, \phpDocumentor\Reflection\BaseReflector $element, array<mixed,\phpDocumentor\Reflection\DocBlock\Tag> $params) : boolean

Arguments

$index

integer

The position in the argument listing.

$argument

\phpDocumentor\Reflection\FunctionReflector\ArgumentReflector

The argument itself.

$element

\phpDocumentor\Reflection\BaseReflector

$params

array<mixed,\phpDocumentor\Reflection\DocBlock\Tag>

The list of param tags to validate against.

Response

boolean

whether an issue occurred.

Validates whether the given Reflector's arguments match the business rules of phpDocumentor.

validate(\phpDocumentor\Reflection\BaseReflector $element) : \phpDocumentor\Descriptor\Validator\Error|null
Throws
\UnexpectedValueException

if no DocBlock is associated with the given Reflector.

Arguments

$element

\phpDocumentor\Reflection\BaseReflector

Response

\phpDocumentor\Descriptor\Validator\Error|null

Returns an error if the given Reflector's arguments do not match expectations.

validateArguments(\phpDocumentor\Reflection\FunctionReflector $element) : \phpDocumentor\Descriptor\Validator\Error|null

Arguments

$element

\phpDocumentor\Reflection\FunctionReflector

Response

\phpDocumentor\Descriptor\Validator\Error|null