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 $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

static Type
__callStatic(string $name, mixed $arguments)

Dynamically pass static methods to the schema instance.

required()

Indicate that the type is required.

from  Type
title(string $value)

Set the type's title.

from  Type
description(string $value)

Set the type's description.

from  Type
enum(array $values)

Restrict the value to one of the provided enumerated values.

from  Type
array
toArray()

Convert the type to an array.

from  Type
string
toString()

Convert the type to its string representation.

from  Type
string
__toString()

Convert the type to its string representation.

from  Type
min(int $value)

Set the minimum number of items (inclusive).

max(int $value)

Set the maximum number of items (inclusive).

items(Type $type)

Set the schema for array items.

default(array $value)

Set the type's default value.

Details

static Type __callStatic(string $name, mixed $arguments)

Dynamically pass static methods to the schema instance.

Parameters

string $name
mixed $arguments

Return Value

Type

Type required()

Indicate that the type is required.

Return Value

Type

Type title(string $value)

Set the type's title.

Parameters

string $value

Return Value

Type

Type description(string $value)

Set the type's description.

Parameters

string $value

Return Value

Type

Type enum(array $values)

Restrict the value to one of the provided enumerated values.

Parameters

array $values

Return Value

Type

array toArray()

Convert the type to an array.

Return Value

array

string toString()

Convert the type to its string representation.

Return Value

string

string __toString()

Convert the type to its string representation.

Return Value

string

ArrayType min(int $value)

Set the minimum number of items (inclusive).

Parameters

int $value

Return Value

ArrayType

ArrayType max(int $value)

Set the maximum number of items (inclusive).

Parameters

int $value

Return Value

ArrayType

ArrayType items(Type $type)

Set the schema for array items.

Parameters

Type $type

Return Value

ArrayType

ArrayType default(array $value)

Set the type's default value.

Parameters

array $value

Return Value

ArrayType