ArrayType

February 3, 2026 · View on GitHub

  • ArrayType()

Validates whether the type of an input is array.

v::arrayType()->assert([]);
// Validation passes successfully

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

v::arrayType()->assert(new ArrayObject());
// → `ArrayObject { getArrayCopy() => [] }` must be an array

Templates

ArrayType::TEMPLATE_STANDARD

ModeTemplate
default{{subject}} must be an array
inverted{{subject}} must not be an array

Template placeholders

PlaceholderDescription
subjectThe validated input or the custom validator name (if specified).

Categorization

  • Arrays
  • Types

Changelog

VersionDescription
1.0.0Created

See Also