respect-validation/docs/rules/AnyOf.md
Henrique Moody 2610a380dc
Replace "LazyConsecutive" with "Consecutive"
With this and the Lazy rule, the LazyConsecutive lost its purpose.

While working on it, I did refactor the Domain rule a bit, but mainly to
check how this rule could behave.

Signed-off-by: Henrique Moody <henriquemoody@gmail.com>
2024-03-06 23:57:49 +01:00

712 B

AnyOf

  • AnyOf(Validatable $rule1, Validatable $rule2, Validatable ...$rule)

This is a group validator that acts as an OR operator.

v::anyOf(v::intVal(), v::floatVal())->validate(15.5); // true

In the sample above, IntVal() doesn't validates, but FloatVal() validates, so AnyOf() returns true.

AnyOf() returns true if at least one inner validator passes.

Categorization

  • Composite
  • Nesting

Changelog

Version Description
3.0.0 Require at least two rules to be passed
2.0.0 Created

See also: