Documentation

CastToInt
in package
implements TypeCasting

FinalYes
Tags
implements

Table of Contents

Interfaces

TypeCasting

Properties

$default  : int|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

$isNullable read-only

private bool $isNullable

Methods

__construct()

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

setOptions()

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

public setOptions([int|null $default = null ][, bool $emptyStringAsNull = false ]) : void
Parameters
$default : int|null = null
$emptyStringAsNull : bool = false

toVariable()

public toVariable(mixed $value) : TValue
Parameters
$value : mixed
Tags
throws
TypeCastingFailed
Return values
TValue

init()

private init(ReflectionProperty|ReflectionParameter $reflectionProperty) : bool
Parameters
$reflectionProperty : ReflectionProperty|ReflectionParameter
Return values
bool

        
On this page

Search results