Structure
in package
implements
Schema
uses
Base
FinalYes
Table of Contents
Interfaces
Properties
- $items : array<string|int, Schema>
- $otherItems : Schema|null
- for array|list
- $range : array{?int, ?int}
- $skipDefaults : bool
Methods
- __construct() : mixed
- complete() : mixed
- Validation and finalization.
- completeDefault() : mixed
- default() : self
- extend() : self
- getShape() : array<string|int, mixed>
- max() : self
- merge() : mixed
- Merging.
- min() : self
- normalize() : mixed
- Normalization.
- otherItems() : self
- skipDefaults() : self
- validateItems() : void
Properties
$items
private
array<string|int, Schema>
$items
$otherItems
for array|list
private
Schema|null
$otherItems
= null
$range
private
array{?int, ?int}
$range
= [null, null]
$skipDefaults
private
bool
$skipDefaults
= false
Methods
__construct()
public
__construct(array<string|int, Schema> $shape) : mixed
Parameters
- $shape : array<string|int, Schema>
complete()
Validation and finalization.
public
complete(mixed $value, Context $context) : mixed
Parameters
- $value : mixed
- $context : Context
completeDefault()
public
completeDefault(Context $context) : mixed
Parameters
- $context : Context
default()
public
default(mixed $value) : self
Parameters
- $value : mixed
Return values
selfextend()
public
extend(array<string|int, mixed>|self $shape) : self
Parameters
- $shape : array<string|int, mixed>|self
Return values
selfgetShape()
public
getShape() : array<string|int, mixed>
Return values
array<string|int, mixed>max()
public
max(int|null $max) : self
Parameters
- $max : int|null
Return values
selfmerge()
Merging.
public
merge(mixed $value, mixed $base) : mixed
Parameters
- $value : mixed
- $base : mixed
min()
public
min(int|null $min) : self
Parameters
- $min : int|null
Return values
selfnormalize()
Normalization.
public
normalize(mixed $value, Context $context) : mixed
Parameters
- $value : mixed
- $context : Context
otherItems()
public
otherItems([string|Schema $type = 'mixed' ]) : self
Parameters
- $type : string|Schema = 'mixed'
Return values
selfskipDefaults()
public
skipDefaults([bool $state = true ]) : self
Parameters
- $state : bool = true
Return values
selfvalidateItems()
private
validateItems(array<string|int, mixed> &$value, Context $context) : void
Parameters
- $value : array<string|int, mixed>
- $context : Context