CastToArray
in package
implements
TypeCasting
FinalYes
Tags
Table of Contents
Interfaces
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
$delimiter
private
string
$delimiter
= ''
$depth
private
int<1, max>
$depth
= 512
$enclosure
private
string
$enclosure
= '"'
$filterFlag
private
int
$filterFlag
$flags
private
int
$flags
= 0
$headerOffset
private
int|null
$headerOffset
= null
$info read-only
private
TypeCastingInfo
$info
$isNullable read-only
private
bool
$isNullable
$separator
private
non-empty-string
$separator
= ','
$shape
private
ArrayShape
$shape
$trimElementValueBeforeCasting
private
bool
$trimElementValueBeforeCasting
= false
$type read-only
private
Type
$type
Methods
__construct()
public
__construct(ReflectionProperty|ReflectionParameter $reflectionProperty) : mixed
Parameters
- $reflectionProperty : ReflectionProperty|ReflectionParameter
Tags
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([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
toVariable()
public
toVariable(mixed $value) : TValue
Parameters
- $value : mixed
Return values
TValuefilterElement()
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
Return values
inttrimString()
private
trimString(array<string|int, mixed> $record) : array<string|int, mixed>
Parameters
- $record : array<string|int, mixed>