Structure
final class Structure implements Schema
Methods
No description
Allows extra keys not defined in the shape, validating their values against the given type.
When enabled, properties whose value equals the default are omitted from the output.
Creates a new structure by merging this shape with additional properties.
No description
Merges two normalized values, with $value taking priority over $base.
Returns the default value, or adds a missing-item error if the field is required.
Details
at line 33
__construct(array $shape)
No description
at line 45
Structure
default(mixed $value)
Not supported for structures; always throws.
at line 51
Structure
min(int|null $min)
No description
at line 58
Structure
max(int|null $max)
No description
at line 68
Structure
otherItems(Schema $type = 'mixed')
Allows extra keys not defined in the shape, validating their values against the given type.
at line 78
Structure
skipDefaults(bool $state = true)
When enabled, properties whose value equals the default are omitted from the output.
at line 89
Structure
extend(array|self $shape)
Creates a new structure by merging this shape with additional properties.
at line 97
array
getShape()
No description
at line 106
mixed
normalize(mixed $value, Context $context)
Applies pre-processing transformations to the raw input value (e.g., via before() hooks).
at line 128
mixed
merge(mixed $value, mixed $base)
Merges two normalized values, with $value taking priority over $base.
at line 155
mixed
complete(mixed $value, Context $context)
Validates the value and applies defaults, transforms, and assertions.
at line 208
mixed
completeDefault(Context $context)
Returns the default value, or adds a missing-item error if the field is required.