mirror of
https://github.com/Respect/Validation.git
synced 2026-03-18 08:09:51 +01:00
Some codes in the documentation were not code that actually works which can lead to some confusion of how to use Validation. Signed-off-by: Henrique Moody <henriquemoody@gmail.com>
558 B
558 B
AnyOf
AnyOf(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.
Changelog
| Version | Description |
|---|---|
| 2.0.0 | Renamed from OneOf to AnyOf |
| 0.3.9 | Created |
See also: