CastToFloat
in package
implements
TypeCasting
FinalYes
Tags
Table of Contents
Interfaces
Properties
- $default : float|null
- $info : TypeCastingInfo
- $isNullable : bool
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
- init() : bool
Properties
$default
private
float|null
$default
= null
$info read-only
private
TypeCastingInfo
$info
$isNullable read-only
private
bool
$isNullable
Methods
__construct()
public
__construct(ReflectionProperty|ReflectionParameter $reflectionProperty) : mixed
Parameters
- $reflectionProperty : ReflectionProperty|ReflectionParameter
info()
public
info() : TypeCastingInfo
Return values
TypeCastingInfosetOptions()
Accepts additional parameters to configure the class Parameters should be scalar value, null or array containing only scalar value and null.
public
setOptions([int|float|null $default = null ][, bool $emptyStringAsNull = false ]) : void
Parameters
- $default : int|float|null = null
- $emptyStringAsNull : bool = false
toVariable()
public
toVariable(mixed $value) : TValue
Parameters
- $value : mixed
Tags
Return values
TValueinit()
private
init(ReflectionProperty|ReflectionParameter $reflectionProperty) : bool
Parameters
- $reflectionProperty : ReflectionProperty|ReflectionParameter