ArrayType
class ArrayType extends Type (View source)
Properties
| protected | $required | Whether the type is required. |
from Type |
| protected | $title | The type's title. |
from Type |
| protected | $description | The type's description. |
from Type |
| protected | $default | The default value for the type. |
from Type |
| protected array<int,mixed>|null | $enum | The set of allowed values for the type. |
from Type |
| protected | $nullable | Indicates if the type is nullable. |
from Type |
| protected | $minItems | The minimum number of items (inclusive). |
|
| protected | $maxItems | The maximum number of items (inclusive). |
|
| protected | $items | The schema of the items contained in the array. |
Methods
Dynamically pass static methods to the schema instance.
Details
static Type
__callStatic(string $name, mixed $arguments)
Dynamically pass static methods to the schema instance.
in
Type at line 47
Type
required(bool $required = true)
Indicate that the type is required.
in
Type at line 59
Type
nullable(bool $nullable = true)
Indicate that the type is optional.
in
Type at line 71
Type
title(string $value)
Set the type's title.
in
Type at line 81
Type
description(string $value)
Set the type's description.
in
Type at line 93
Type
enum(array|string $values)
Restrict the value to one of the provided enumerated values.
in
Type at line 114
array
toArray()
Convert the type to an array.
in
Type at line 122
string
toString()
Convert the type to its string representation.
in
Type at line 130
string
__toString()
Convert the type to its string representation.
ArrayType
min(int $value)
Set the minimum number of items (inclusive).
ArrayType
max(int $value)
Set the maximum number of items (inclusive).
ArrayType
default(array $value)
Set the type's default value.