Documentation

ImmutableArray
in package
implements ArrayAccess, Countable, IArrayable, IteratorAggregate

Read onlyYes
AbstractYes

Immutable array.

An immutable array consists of key-value pairs named properties. Keys are either integers or strings (the only admissible key types in PHP), and values can be any data type.

Tags
template

TKey of int|non-decimal-int-string

implements
todo

Should not contain references to AppObject or AppList.

Table of Contents

Interfaces

ArrayAccess
Countable
IArrayable
IteratorAggregate

Properties

$data  : array<string|int, mixed>

Methods

__construct()  : mixed
all()  : bool
contains()  : bool
count()  : int<0, max>
get()  : TValue
getAppList()  : AppList
getAppObject()  : AppObject<string|int, mixed>
getAppObjectWithItemClass()  : AppObject<string|int, T>
getArray()  : array<string|int, mixed>
getArrayable()  : IArrayable<TKey, mixed>
getBool()  : bool
getBoolOrNull()  : bool|null
getFloat()  : float
getFqcn()  : T>
getInt()  : int
getIntStrictlyPositive()  : positive-int
getIterator()  : Traversable
getNullableObject()  : mixed
getNullableScalar()  : mixed
getString()  : string
keys()  : array<int, TKey>
offsetExists()  : bool
Built-in method that checks that given offset exists in the array and is STRICTLY the same.
offsetGet()  : mixed
offsetSet()  : void
offsetUnset()  : void
toArray()  : TArray

Properties

Methods

__construct()

public __construct(TArray $data) : mixed
Parameters
$data : TArray

all()

public all(callable(TValue, TKey): bool $callback) : bool
Parameters
$callback : callable(TValue, TKey): bool
Return values
bool

contains()

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

count()

public count() : int<0, max>
Attributes
#[Override]
Return values
int<0, max>

get()

public get(TKey $key) : TValue
Parameters
$key : TKey
Return values
TValue

getAppObjectWithItemClass()

public getAppObjectWithItemClass(TKey $key, T> $itemFqcn) : AppObject<string|int, T>
Parameters
$key : TKey
$itemFqcn : T>
Tags
template
Return values
AppObject<string|int, T>

getArray()

public getArray(TKey $key) : array<string|int, mixed>
Parameters
$key : TKey
Return values
array<string|int, mixed>

getBool()

public getBool(TKey $key) : bool
Parameters
$key : TKey
Return values
bool

getBoolOrNull()

public getBoolOrNull(TKey $key) : bool|null
Parameters
$key : TKey
Return values
bool|null

getFloat()

public getFloat(TKey $key) : float
Parameters
$key : TKey
Return values
float

getFqcn()

public getFqcn(TKey $key, T> $fqcn) : T>
Parameters
$key : TKey
$fqcn : T>
Tags
template
Return values
T>

getInt()

public getInt(TKey $key) : int
Parameters
$key : TKey
Return values
int

getIntStrictlyPositive()

public getIntStrictlyPositive(TKey $key) : positive-int
Parameters
$key : TKey
Return values
positive-int

getIterator()

public getIterator() : Traversable
Attributes
#[Override]
Return values
Traversable

getNullableObject()

public getNullableObject(TKey $key, string $fqcn) : mixed
Parameters
$key : TKey
$fqcn : string

getNullableScalar()

public getNullableScalar(TKey $key, string $type) : mixed
Parameters
$key : TKey
$type : string

getString()

public getString(TKey $key) : string
Parameters
$key : TKey
Return values
string

keys()

public keys() : array<int, TKey>
Return values
array<int, TKey>

offsetExists()

Built-in method that checks that given offset exists in the array and is STRICTLY the same.

public offsetExists(TKey $offset) : bool

For instance, an object with the property key '3' will return false if given an offset of 3.

Parameters
$offset : TKey
Attributes
#[Override]
Return values
bool

offsetGet()

public offsetGet(TKey $offset) : mixed
Parameters
$offset : TKey
Attributes
#[Override]

offsetSet()

public offsetSet(mixed $offset, mixed $value) : void
Parameters
$offset : mixed
$value : mixed
Attributes
#[Override]

offsetUnset()

public offsetUnset(mixed $offset) : void
Parameters
$offset : mixed
Attributes
#[Override]

toArray()

public toArray() : TArray
Tags
todo

Delete?

Attributes
#[Override]
Return values
TArray
On this page

Search results