class BuiltinTypeCast implements Cast, IterableItemCast

Methods

__construct(string $type)

Create a built-in type cast.

mixed
cast(DataProperty $property, mixed $value, ConstructionState $state, CreationContext $context)

Cast a property value to the configured built-in type.

mixed
castIterableItem(DataProperty $property, mixed $value, ConstructionState $state, CreationContext $context)

Cast an iterable item to the configured built-in type.

mixed
runCast(mixed $value)

Cast one value to the configured type.

Details

at line 19
__construct(string $type)

Create a built-in type cast.

Parameters

string $type

at line 27
mixed cast(DataProperty $property, mixed $value, ConstructionState $state, CreationContext $context)

Cast a property value to the configured built-in type.

Parameters

DataProperty $property
mixed $value
ConstructionState $state
CreationContext $context

Return Value

mixed

at line 39
mixed castIterableItem(DataProperty $property, mixed $value, ConstructionState $state, CreationContext $context)

Cast an iterable item to the configured built-in type.

Parameters

DataProperty $property
mixed $value
ConstructionState $state
CreationContext $context

Return Value

mixed

at line 51
protected mixed runCast(mixed $value)

Cast one value to the configured type.

Parameters

mixed $value

Return Value

mixed