AbstractCompositeValidator implements ObjectValidatorInterface, Countable

AbstractYes

An abstract composite validator consisting of other validators

Table of Contents

Interfaces

ObjectValidatorInterface
Contract for a validator
Countable

Properties

$options  : array<string|int, mixed>
$supportedOptions  : array<string|int, mixed>
This contains the supported options, their default values and descriptions.
$validatedInstancesContainer  : SplObjectStorage
$validators  : SplObjectStorage

Methods

__construct()  : mixed
Constructs the composite validator and sets validation options
addValidator()  : mixed
Adds a new validator to the conjunction.
count()  : int
Returns the number of validators contained in this conjunction.
getOptions()  : array<string|int, mixed>
Returns the options for this validator
getValidators()  : SplObjectStorage
Returns the child validators of this Composite Validator
removeValidator()  : mixed
Removes the specified validator.
setValidatedInstancesContainer()  : mixed
Allows to set a container to keep track of validated instances.
initializeDefaultOptions()  : void
Initialize default options.

Properties

$options

protected array<string|int, mixed> $options = []

$supportedOptions

This contains the supported options, their default values and descriptions.

protected array<string|int, mixed> $supportedOptions = []

$validatedInstancesContainer

protected SplObjectStorage $validatedInstancesContainer

$validators

protected SplObjectStorage $validators

Methods

__construct()

Constructs the composite validator and sets validation options

public __construct([array<string|int, mixed> $options = [] ]) : mixed
Parameters
$options : array<string|int, mixed> = []

Options for the validator

Tags
throws
InvalidValidationOptionsException
todo:

__construct() will vanish in v12, this abstract will implement setOptions() to set and initialize default options.

count()

Returns the number of validators contained in this conjunction.

public count() : int
Tags
todo

Set to return type int as breaking change in v12.

Attributes
#[ReturnTypeWillChange]
Return values
int

The number of validators

getOptions()

Returns the options for this validator

public getOptions() : array<string|int, mixed>
Return values
array<string|int, mixed>

getValidators()

Returns the child validators of this Composite Validator

public getValidators() : SplObjectStorage
Return values
SplObjectStorage

setValidatedInstancesContainer()

Allows to set a container to keep track of validated instances.

public setValidatedInstancesContainer(SplObjectStorage $validatedInstancesContainer) : mixed
Parameters
$validatedInstancesContainer : SplObjectStorage

A container to keep track of validated instances

initializeDefaultOptions()

Initialize default options.

protected initializeDefaultOptions(array<string|int, mixed> $options) : void
Parameters
$options : array<string|int, mixed>
Tags
throws
InvalidValidationOptionsException

        
On this page

Search results