AnyOf
final class AnyOf implements Schema
Schema that accepts any of a fixed set of values or sub-schemas (union type / enumeration).
Methods
No description
Sets the first variant as the default value (instead of null).
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 28
__construct(mixed ...$set)
No description
at line 41
AnyOf
firstIsDefault()
Sets the first variant as the default value (instead of null).
at line 51
AnyOf
nullable()
Allows null as an accepted value in addition to the defined variants.
at line 61
AnyOf
dynamic()
Allows the value to be a DynamicParameter as an accepted variant.
at line 71
mixed
normalize(mixed $value, Context $context)
Applies pre-processing transformations to the raw input value (e.g., via before() hooks).
at line 77
mixed
merge(mixed $value, mixed $base)
Merges two normalized values, with $value taking priority over $base.
at line 83
mixed
complete(mixed $value, Context $context)
Validates the value and applies defaults, transforms, and assertions.
at line 138
mixed
completeDefault(Context $context)
Returns the default value, or adds a missing-item error if the field is required.