Documentation

CastToArray
in package
implements TypeCasting

FinalYes
Tags
implements

Table of Contents

Interfaces

TypeCasting

Properties

$default  : array<string|int, mixed>|null
$delimiter  : string
$depth  : int<1, max>
$enclosure  : string
$filterFlag  : int
$flags  : int
$headerOffset  : int|null
$info  : TypeCastingInfo
$isNullable  : bool
$separator  : non-empty-string
$shape  : ArrayShape
$trimElementValueBeforeCasting  : 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
filterElement()  : array<string|int, mixed>
init()  : Type, 1: bool}
resolveFilterFlag()  : int
trimString()  : array<string|int, mixed>

Properties

$default

private array<string|int, mixed>|null $default = null

$separator

private non-empty-string $separator = ','

$trimElementValueBeforeCasting

private bool $trimElementValueBeforeCasting = false

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([array<string|int, mixed>|null $default = null ][, ArrayShape|string $shape = ArrayShape::List ][, non-empty-string $separator = ',' ][, non-empty-string $delimiter = ',' ][, string $enclosure = '"' ][, int<1, max> $depth = 512 ][, int $flags = 0 ][, Type|string $type = Type::String ][, bool $trimElementValueBeforeCasting = false ][, int|null $headerOffset = null ]) : void
Parameters
$default : array<string|int, mixed>|null = null
$shape : ArrayShape|string = ArrayShape::List
$separator : non-empty-string = ','
$delimiter : non-empty-string = ','
$enclosure : string = '"'
$depth : int<1, max> = 512
$flags : int = 0
$type : Type|string = Type::String
$trimElementValueBeforeCasting : bool = false
$headerOffset : int|null = null
Tags
throws
MappingFailed

toVariable()

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

filterElement()

private filterElement(array<string|int, mixed> $record) : array<string|int, mixed>
Parameters
$record : array<string|int, mixed>
Return values
array<string|int, mixed>

init()

private init(ReflectionProperty|ReflectionParameter $reflectionProperty) : Type, 1: bool}
Parameters
$reflectionProperty : ReflectionProperty|ReflectionParameter
Return values
Type, 1: bool}

resolveFilterFlag()

private resolveFilterFlag(Type|null $type) : int
Parameters
$type : Type|null
Tags
throws
MappingFailed

if the type is not supported

Return values
int

trimString()

private trimString(array<string|int, mixed> $record) : array<string|int, mixed>
Parameters
$record : array<string|int, mixed>
Return values
array<string|int, mixed>

        
On this page

Search results