respect-validation/docs/rules/AnyOf.md
Henrique Moody 0417fea213
Fix confusion with some changelogs
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>
2019-05-11 21:44:44 +02:00

35 lines
590 B
Markdown

# AnyOf
- `AnyOf(Validatable ...$rule)`
This is a group validator that acts as an OR operator.
```php
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:
- [AllOf](AllOf.md)
- [ContainsAny](ContainsAny.md)
- [NoneOf](NoneOf.md)
- [OneOf](OneOf.md)
- [When](When.md)