BaseCollection
abstract class BaseCollection
Abstract base class to represent collections like vectors or maps.
Traits
Constants
| CB_ZERO_ARG |
|
Methods
Count how many elements a collection has.
Convert the collection into a PHP array.
Determines if at least an element of the collection satisfies a condition.
Determines if all elements of the collection satisfies a condition.
Create a new collection instance from the specified iterable.
Determine if a collection is empty.
Details
at line 52
abstract int
count()
Count how many elements a collection has.
at line 41
abstract array
toArray()
Convert the collection into a PHP array.
in
WithCollection at line 15
mixed
first()
No description
in
WithCollection at line 23
mixed
firstOr(mixed $default)
No description
in
WithCollection at line 45
bool
any(callable $callable)
Determines if at least an element of the collection satisfies a condition.
The execution of callbacks stop after a callable returned true.
in
WithCollection at line 78
bool
all(callable $callable)
Determines if all elements of the collection satisfies a condition.
The execution of callbacks stop after a callable returned false.
at line 24
abstract static BaseCollection
from(iterable $items)
Create a new collection instance from the specified iterable.
at line 59
abstract bool
isEmpty()
Determine if a collection is empty.