Flow PHP

ArrayType implements Type

Read onlyYes
FinalYes
Tags
implements

Interfaces

Type

Properties

$empty  : bool

Methods

__construct()  : mixed
empty()  : self
fromArray()  : Type<string|int, T>
isComparableWith()  : bool
isCompatible()  : bool
Checks if another type is compatible with this type. Nullability is validated from a schema evolution perspective.
isEqual()  : bool
Checks if another type is equal to this type. Nullability is not considered in this comparison.
isSame()  : bool
Checks if another type is the same as this type, including nullability.
isValid()  : bool
makeNullable()  : Type<string|int, T>
merge()  : Type<string|int, mixed>
normalize()  : array<string|int, mixed>
nullable()  : bool
toString()  : string

Properties

Methods

__construct()

public __construct([bool $empty = false ][, bool $nullable = false ]) : mixed
Parameters
$empty : bool = false
$nullable : bool = false

empty()

public static empty() : self
Return values
self

fromArray()

public static fromArray(array<string|int, mixed> $data) : Type<string|int, T>
Parameters
$data : array<string|int, mixed>
Return values
Type<string|int, T>

isComparableWith()

public isComparableWith(Type $type) : bool
Parameters
$type : Type
Return values
bool

isCompatible()

Checks if another type is compatible with this type. Nullability is validated from a schema evolution perspective.

public isCompatible(Type $type) : bool

This means that when current type is nullable and ther other type is not nullable, it is still compatible. When given type is not nullable and current type is nullable, it is not compatible.

Parameters
$type : Type
Return values
bool

isEqual()

Checks if another type is equal to this type. Nullability is not considered in this comparison.

public isEqual(Type $type) : bool
Parameters
$type : Type
Tags
psalm
Return values
bool

isSame()

Checks if another type is the same as this type, including nullability.

public isSame(Type $type) : bool
Parameters
$type : Type
Return values
bool

isValid()

public isValid(mixed $value) : bool
Parameters
$value : mixed
Return values
bool

makeNullable()

public makeNullable(bool $nullable) : Type<string|int, T>
Parameters
$nullable : bool
Return values
Type<string|int, T>

normalize()

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

nullable()

public nullable() : bool
Return values
bool

toString()

public toString() : string
Return values
string

        
On this page

Search results