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
| Mode | Template |
|---|---|
default | {{subject}} must be an array |
inverted | {{subject}} must not be an array |
Template placeholders
| Placeholder | Description |
|---|---|
subject | The validated input or the custom validator name (if specified). |
Categorization
- Arrays
- Types
Changelog
| Version | Description |
|---|---|
| 1.0.0 | Created |