Flow PHP

ArrayType implements Type

Read onlyYes
FinalYes
Tags
implements

Interfaces

Type

Methods

assert()  : array<string|int, mixed>
Checks if the value is of the type of given type.
cast()  : array<string|int, mixed>
Takes a value and when necessary casts it to the type of this object.
isValid()  : bool
Checks if the value is of the type of this object.
normalize()  : array<string, string>
toString()  : string
Returns a string representation of the type.

Methods

assert()

Checks if the value is of the type of given type.

public assert(mixed $value) : array<string|int, mixed>
Parameters
$value : mixed
Return values
array<string|int, mixed>

cast()

Takes a value and when necessary casts it to the type of this object.

public cast(mixed $value) : array<string|int, mixed>
Parameters
$value : mixed
Return values
array<string|int, mixed>

isValid()

Checks if the value is of the type of this object.

public isValid(mixed $value) : bool

When isValid method is used, it will not narrow the type of the value for static analysis tools.

Parameters
$value : mixed
Return values
bool

normalize()

public normalize() : array<string, string>
Return values
array<string, string>

toString()

Returns a string representation of the type.

public toString() : string
  • string - for type_string()
  • int - for type_int()
  • ?float - for type_optional(type_float())
Return values
string

        
On this page

Search results