interface ValidatesAny (View source)

internal  This interface should always be used by extension and is not intended to be implemented directly.
 

Constraint interface.

Child interfaces of the ValidatesAny interface should define a more specific return type hint for the self::validate() method.

Methods

void
check(mixed $value = null)

Checks if the given value is valid and throws an exception if not.

bool
isValid(mixed $value = null)

Checks if the given value is valid.

Result
validate(mixed $value = null)

Validates the given value and returns the validation result.

Details

void check(mixed $value = null)

Checks if the given value is valid and throws an exception if not.

Parameters

mixed $value

The value to validate.

Return Value

void

Exceptions

ValidationFailedException

bool isValid(mixed $value = null)

Checks if the given value is valid.

Parameters

mixed $value

The value to validate.

Return Value

bool

Whether the value is valid or not.

Result validate(mixed $value = null)

Validates the given value and returns the validation result.

Parameters

mixed $value

The value to validate.

Return Value

Result

The validation result (single or multiple).