EntryTypeResolver
Read onlyYes
FinalYes
Resolves the concrete Type an Entry should be created as, entries cannot carry union types.
Methods
- fromDefinition() : Type<string|int, mixed>
- OptionalType cannot wrap a UnionType, nullability of union definitions is handled during union resolution.
- fromUnion() : Type<string|int, mixed>
- A union is resolved to the first member accepting the value, falling back to the first member the value can be cast to, mirroring UnionType::cast().
Methods
fromDefinition()
OptionalType cannot wrap a UnionType, nullability of union definitions is handled during union resolution.
public
fromDefinition(Definition<string|int, mixed> $definition) : Type<string|int, mixed>
Parameters
- $definition : Definition<string|int, mixed>
Return values
Type<string|int, mixed>fromUnion()
A union is resolved to the first member accepting the value, falling back to the first member the value can be cast to, mirroring UnionType::cast().
public
fromUnion(Type<string|int, mixed>|UnionType<mixed, mixed> $type, mixed $value, string $entryName) : Type<string|int, mixed>
Parameters
- $type : Type<string|int, mixed>|UnionType<mixed, mixed>
- $value : mixed
- $entryName : string