respect-validation/docs/validators/All.md
Alexandre Gomes Gaigalas bd48bdcda4 Lint Changelog format in validator docs
Introduces a Markdown linter for checking the Changelog format.

"See Also" was transformed into a section to make it easier to
handle it with the `Content` class. The "Related" linter was
simplified to reflect that change too.

An additional "alignment" parameter was added to markdown table
generators, allowing the padding and headers to be explicitly
marked with a specific left (-1), middle (0) or right(1)
alignment.

Existing files were fixed using the `fix` option after the
changes.
2026-01-26 19:11:00 +00:00

1.3 KiB

All

  • All(Validator $validator)

Validates all items of the input against a given validator.

v::all(v::intType())->assert([1, 2, 3]);
// Validation passes successfully

v::all(v::intType())->assert([1, 2, '3']);
// → Every item in `[1, 2, "3"]` must be an integer

This validator is similar to Each, but as opposed to the former, it displays a single message when asserting an input.

Note

This validator uses Length with [GreaterThan][GreaterThan.md] internally. If an input has no items, the validation will fail.

Templates

All::TEMPLATE_STANDARD

Mode Template
default Every item in
inverted Every item in

Template as prefix

The template serves as a prefix to the template of the inner validator.

v::all(v::floatType())->assert([1.5, 2]);
// → Every item in `[1.5, 2]` must be float

v::not(v::all(v::intType()))->assert([1, 2, -3]);
// → Every item in `[1, 2, -3]` must not be an integer

Categorization

  • Comparisons
  • Transformations

Changelog

Version Description
3.0.0 Created

See Also