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
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
$data
protected
array<string|int, mixed>
$data
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
boolcontains()
public
contains(mixed $value) : bool
Parameters
- $value : mixed
Return values
boolcount()
public
count() : int<0, max>
Attributes
- #[Override]
Return values
int<0, max>get()
public
get(TKey $key) : TValue
Parameters
- $key : TKey
Return values
TValuegetAppList()
public
getAppList(TKey $key) : AppList
Parameters
- $key : TKey
Return values
AppListgetAppObject()
public
getAppObject(TKey $key) : AppObject<string|int, mixed>
Parameters
- $key : TKey
Return values
AppObject<string|int, mixed>getAppObjectWithItemClass()
public
getAppObjectWithItemClass(TKey $key, T> $itemFqcn) : AppObject<string|int, T>
Parameters
- $key : TKey
- $itemFqcn : T>
Tags
Return values
AppObject<string|int, T>getArray()
public
getArray(TKey $key) : array<string|int, mixed>
Parameters
- $key : TKey
Return values
array<string|int, mixed>getArrayable()
public
getArrayable(TKey $key) : IArrayable<TKey, mixed>
Parameters
- $key : TKey
Return values
IArrayable<TKey, mixed>getBool()
public
getBool(TKey $key) : bool
Parameters
- $key : TKey
Return values
boolgetBoolOrNull()
public
getBoolOrNull(TKey $key) : bool|null
Parameters
- $key : TKey
Return values
bool|nullgetFloat()
public
getFloat(TKey $key) : float
Parameters
- $key : TKey
Return values
floatgetFqcn()
public
getFqcn(TKey $key, T> $fqcn) : T>
Parameters
- $key : TKey
- $fqcn : T>
Tags
Return values
T>getInt()
public
getInt(TKey $key) : int
Parameters
- $key : TKey
Return values
intgetIntStrictlyPositive()
public
getIntStrictlyPositive(TKey $key) : positive-int
Parameters
- $key : TKey
Return values
positive-intgetIterator()
public
getIterator() : Traversable
Attributes
- #[Override]
Return values
TraversablegetNullableObject()
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
stringkeys()
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
booloffsetGet()
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
Attributes
- #[Override]