0 follower

Interface Yiisoft\Hydrator\TypeCaster\TypeCasterInterface

Implemented byYiisoft\Hydrator\TypeCaster\CompositeTypeCaster, Yiisoft\Hydrator\TypeCaster\EnumTypeCaster, Yiisoft\Hydrator\TypeCaster\HydratorTypeCaster, Yiisoft\Hydrator\TypeCaster\NoTypeCaster, Yiisoft\Hydrator\TypeCaster\NullTypeCaster, Yiisoft\Hydrator\TypeCaster\PhpNativeTypeCaster

Casts value to a type obtained from {@see ReflectionType} passed.

Method Details

Hide inherited methods

cast() public abstract method

public abstract Yiisoft\Hydrator\Result cast ( mixed $value, Yiisoft\Hydrator\TypeCaster\TypeCastContext $context )
$value mixed

Value to cast.

$context Yiisoft\Hydrator\TypeCaster\TypeCastContext

Type cast context.

return Yiisoft\Hydrator\Result

The result object.

                public function cast(mixed $value, TypeCastContext $context): Result;