class BuiltinTypeCast implements Cast, IterableItemCast

Methods

__construct(string $type)

Create a built-in type cast.

mixed
cast(DataProperty $property, mixed $value, array $properties, CreationContext $context)

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

mixed
castIterableItem(DataProperty $property, mixed $value, array $properties, 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 18
__construct(string $type)

Create a built-in type cast.

Parameters

string $type

at line 26
mixed cast(DataProperty $property, mixed $value, array $properties, CreationContext $context)

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

Parameters

DataProperty $property
mixed $value
array $properties

the object's declared property values, keyed by property name

CreationContext $context

Return Value

mixed

at line 38
mixed castIterableItem(DataProperty $property, mixed $value, array $properties, CreationContext $context)

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

Parameters

DataProperty $property
mixed $value
array $properties

the object's declared property values, keyed by property name

CreationContext $context

Return Value

mixed

at line 50
protected mixed runCast(mixed $value)

Cast one value to the configured type.

Parameters

mixed $value

Return Value

mixed