Skip to content

IValidatorContainer

IValidatorContainer is an interface for classes which contains several child validators

interface IValidatorContainer

Implemented byOperatorValidator, ValidationManager
Since1.0.0
SourceValidator/IValidatorContainer.php
MethodDescription
addArgumentResult(ValidationArgument $argument, int $result, ?Validator $validator = null): voidAdds a intermediate result of an validator for the given argument
addChild(Validator $validator): voidAdds a new validator to the list of children.
addIncident(ValidationIncident $incident): voidAdds an incident to the validation result.
getBase(): VirtualArrayPathReturn the current base path used for relative argument resolution.
getChild(string $name): ValidatorReturns a named child validator.
getChilds(): array<string, Validator>Returns all child validators.
getDependencyManager(): DependencyManagerFetches the dependency manager

abstract public function addArgumentResult(ValidationArgument $argument, int $result, ?Validator $validator = null): void

Adds a intermediate result of an validator for the given argument

The validator (if the error was caused inside a validator).

ParameterTypeDescription
$argumentValidationArgumentThe argument
$resultintThe arguments result.
$validator?ValidatorThe validator (if the error was caused inside a validator).

abstract public function addChild(Validator $validator): void

Adds a new validator to the list of children.

The new child.

ParameterTypeDescription
$validatorValidatorThe new child.

abstract public function addIncident(ValidationIncident $incident): void

Adds an incident to the validation result.

The incident.

ParameterTypeDescription
$incidentValidationIncidentThe incident.

abstract public function getBase(): VirtualArrayPath

Return the current base path used for relative argument resolution.

Implementations like ValidationManager provide this; validators rely on it.

Returns VirtualArrayPath

abstract public function getChild(string $name): Validator

Returns a named child validator.

The name of the child validator.

ParameterTypeDescription
$namestringThe name of the child validator.

Returns Validator — The named child validator.

abstract public function getChilds(): array<string, Validator>

Returns all child validators.

Returns array``<``string``, Validator> — An array of Validator instances.

abstract public function getDependencyManager(): DependencyManager

Fetches the dependency manager

Returns DependencyManager — The dependency manager to be used by child validators.