Copied!

ArrayList

ArrayList.php : 19
Implements ListInterface

Properties

protected $items

AbstractInMemoryCollection.php : 24
protected array<string|int, mixed> $items

Methods

public__construct()

ArrayList.php : 24
public __construct([array<string|int, mixed> $items = [] ])

Parameters

Name Type Default value Description
$items array<string|int, mixed> [] -

publiccontains()

ArrayList.php : 50
public contains(mixed $value) : bool

Parameters

Name Type Default value Description
$value mixed - -

Return values

bool

publiccount()

AbstractInMemoryCollection.php : 49
public count() : int

Return values

int

publicexists()

AbstractInMemoryCollection.php : 81

Tests the existence of an element that satisfies the given predicate.

public exists(Closure $predicate) : bool

Parameters

Name Type Default value Description
$predicate Closure - -

Return values

bool

publicfilter()

AbstractInMemoryCollection.php : 57

Returns all the elements of this collection that satisfy the predicate.

public filter(Closure $predicate) : self

Parameters

Name Type Default value Description
$predicate Closure - -

Return values

self

publicfirst()

ArrayList.php : 29

Return first element of collection.

public first() : TValue

Return values

TValue

publicforAll()

AbstractInMemoryCollection.php : 70

Tests whether the given predicate holds for all elements of this collection.

public forAll(Closure $predicate) : bool

Parameters

Name Type Default value Description
$predicate Closure - -

Return values

bool

publicgetIterator()

AbstractInMemoryCollection.php : 44
public getIterator() : Iterator

Return values

Iterator

publicisEmpty()

AbstractInMemoryCollection.php : 34
public isEmpty() : bool

Return values

bool

publiclast()

ArrayList.php : 38

Return last element of collection.

public last() : TValue

Return values

TValue

publicmap()

AbstractInMemoryCollection.php : 65

Applies the given function to each element in the collection and returns a new collection with the elements returned by the function.

public map(Closure $function) : self

Parameters

Name Type Default value Description
$function Closure - -

Return values

self

publictoArray()

AbstractInMemoryCollection.php : 39
public toArray() : array<string|int, TValue>

Return values

array<string|int, TValue>

protectedcreateFrom()

ArrayList.php : 60
protected createFrom(array<string|int, mixed> $items) : self

Parameters

Name Type Default value Description
$items array<string|int, mixed> - -

Return values

self