Copied!

AbstractInMemoryCollection

AbstractInMemoryCollection.php : 21

Properties

protected $items

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

Methods

public__construct()

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

Parameters

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

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

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

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()

AbstractInMemoryCollection.php : 97
protected abstract createFrom(array<string|int, TValue$items) : self

Parameters

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

Return values

self