All(Validator $validator)
Validates all items of the input against a given validator.
v::all(v::intType())->isValid([1, 2, 3]); // true
v::all(v::intType())->isValid([1, 2, '3']); // falseThis validator is similar to Each, but as opposed to the former, it displays a single message when asserting an input.
This validator uses Length with [GreaterThan][GreaterThan.md] internally. If an input has no items, the validation will fail.
| Mode | Template |
|---|---|
default |
Every item in |
inverted |
Every item in |
This template serve as message prefixes.:
v::all(v::floatType())->assert([1.5, 2]);
// Message: Every item in `[1.5, 2]` must be float
v::not(v::all(v::intType()))->assert([1, 2, -3]);
// Message: Every item in `[1, 2, -3]` must not be an integer- Comparisons
- Transformations
| Version | Description |
|---|---|
| 3.0.0 | Created |
See also: