mirror of
https://github.com/Respect/Validation.git
synced 2026-03-16 23:35:45 +01:00
Some templates were a bit confusing, and I would like to favour adding
the `{{name}}` at the beginning of the templates as it helps when
reading nested messages.
I also deleted the regression tests for issue #1348, because it's a
non-issue, actually. The best approach to that problem is indeed using
`When` insteaf of `OneOf`.
1.5 KiB
1.5 KiB
NoneOf
NoneOf(Rule $rule1, Rule $rule2, Rule ...$rule)
Validates if NONE of the given validators validate:
v::noneOf(
v::intVal(),
v::floatVal()
)->isValid('foo'); // true
In the sample above, 'foo' isn't a integer nor a float, so noneOf returns true.
Templates
NoneOf::TEMPLATE_SOME
Used when some rules have passed.
| Mode | Template |
|---|---|
default |
{{name}} must pass the rules |
inverted |
{{name}} must pass the rules |
NoneOf::TEMPLATE_ALL
Used when all rules have passed.
| Mode | Template |
|---|---|
default |
{{name}} must pass all the rules |
inverted |
{{name}} must pass all the rules |
Template placeholders
| Placeholder | Description |
|---|---|
name |
The validated input or the custom validator name (if specified). |
Categorization
- Composite
- Nesting
Changelog
| Version | Description |
|---|---|
| 3.0.0 | Require at least two rules to be passed |
| 0.3.9 | Created |
See also: