mirror of
https://github.com/Respect/Validation.git
synced 2024-06-26 17:20:16 +02:00
0417fea213
The changelogs that this commit will change are confusing. From a code perspective, the rule Date was renamed to DateTime, and OneOf was renamed to AnyOf, but because we also created a Date and OneOf rule with different behaviours, it makes more sense to say that their behaviour changed, rather than saying that they were created in version 2.0.0. Signed-off-by: Henrique Moody <henriquemoody@gmail.com>
590 B
590 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.
Categorization
- Composite
- Nesting
Changelog
Version | Description |
---|---|
2.0.0 | Created |
See also: