class AnyOf implements Rule, ValidatorAwareRule (View source)

Properties

protected array $rules

The rules to match against.

protected Validator $validator

The validator performing the validation.

Methods

__construct(ValidationRule[][] $rules)

Sets the validation rules to match against.

bool
passes(string $attribute, mixed $value)

Determine if the validation rule passes.

string|array
message()

Get the validation error messages.

$this
setValidator(Validator $validator)

Set the current validator.

Details

__construct(ValidationRule[][] $rules)

Sets the validation rules to match against.

Parameters

ValidationRule[][] $rules

Exceptions

InvalidArgumentException

bool passes(string $attribute, mixed $value)

Determine if the validation rule passes.

Parameters

string $attribute
mixed $value

Return Value

bool

string|array message()

Get the validation error messages.

Return Value

string|array

$this setValidator(Validator $validator)

Set the current validator.

Parameters

Validator $validator

Return Value

$this