Documentation

CastToEnum
in package
implements TypeCasting

Tags
implements

Table of Contents

Interfaces

TypeCasting

Properties

$class  : string
$default  : UnitEnum|null
$info  : TypeCastingInfo
$isNullable  : bool
$type  : Type

Methods

__construct()  : mixed
info()  : TypeCastingInfo
setOptions()  : void
Accepts additional parameters to configure the class Parameters should be scalar value, null or array containing only scalar value and null.
toVariable()  : TValue
cast()  : BackedEnum|UnitEnum
init()  : array<string|int, mixed>

Properties

Methods

__construct()

public __construct(ReflectionProperty|ReflectionParameter $reflectionProperty) : mixed
Parameters
$reflectionProperty : ReflectionProperty|ReflectionParameter
Tags
throws
MappingFailed

setOptions()

Accepts additional parameters to configure the class Parameters should be scalar value, null or array containing only scalar value and null.

public setOptions([string|null $default = null ][, string|null $className = null ][, bool $emptyStringAsNull = false ]) : void
Parameters
$default : string|null = null
$className : string|null = null
$emptyStringAsNull : bool = false
Tags
throws
MappingFailed

cast()

private cast(mixed $value) : BackedEnum|UnitEnum
Parameters
$value : mixed
Tags
throws
TypeCastingFailed
Return values
BackedEnum|UnitEnum

init()

private init(ReflectionProperty|ReflectionParameter $reflectionProperty) : array<string|int, mixed>
Parameters
$reflectionProperty : ReflectionProperty|ReflectionParameter
Return values
array<string|int, mixed>

        
On this page

Search results