final class Type implements Schema

Methods

__construct(string $type)

No description

nullable()

Allows the value to be null in addition to the declared type.

mergeDefaults(bool $state = true)

No description

mergeMode(MergeMode $mode)

Sets how arrays are combined when merging multiple configurations.

dynamic()

Allows the value to be a DynamicParameter, which is recorded for deferred validation.

min(float|null $min)

No description

max(float|null $max)

No description

items(Schema $valueType = 'mixed', Schema|null $keyType = null)

No description

pattern(string|null $pattern)

Sets a regex pattern the string value must match entirely (anchored to start and end).

mixed
normalize(mixed $value, Context $context)

Applies pre-processing transformations to the raw input value (e.g., via before() hooks).

mixed
merge(mixed $value, mixed $base)

Merges two normalized values, with $value taking priority over $base.

mixed
complete(mixed $value, Context $context)

Validates the value and applies defaults, transforms, and assertions.

Details

at line 33
__construct(string $type)

No description

Parameters

string $type

at line 44
Type nullable()

Allows the value to be null in addition to the declared type.

Return Value

Type

at line 51
Type mergeDefaults(bool $state = true)

No description

Parameters

bool $state

Return Value

Type

at line 65
Type mergeMode(MergeMode $mode)

Sets how arrays are combined when merging multiple configurations.

Parameters

MergeMode $mode

Return Value

Type

at line 75
Type dynamic()

Allows the value to be a DynamicParameter, which is recorded for deferred validation.

Return Value

Type

at line 82
Type min(float|null $min)

No description

Parameters

float|null $min

Return Value

Type

at line 89
Type max(float|null $max)

No description

Parameters

float|null $max

Return Value

Type

at line 99
Type items(Schema $valueType = 'mixed', Schema|null $keyType = null)

internal  use arrayOf() or listOf()
 

No description

Parameters

Schema $valueType
Schema|null $keyType

Return Value

Type

at line 114
Type pattern(string|null $pattern)

Sets a regex pattern the string value must match entirely (anchored to start and end).

Parameters

string|null $pattern

Return Value

Type

at line 124
mixed normalize(mixed $value, Context $context)

Applies pre-processing transformations to the raw input value (e.g., via before() hooks).

Parameters

mixed $value
Context $context

Return Value

mixed

at line 147
mixed merge(mixed $value, mixed $base)

Merges two normalized values, with $value taking priority over $base.

Parameters

mixed $value
mixed $base

Return Value

mixed

at line 173
mixed complete(mixed $value, Context $context)

Validates the value and applies defaults, transforms, and assertions.

Parameters

mixed $value
Context $context

Return Value

mixed

Traits