trait WithCollection

Methods

int
count()

No description

array
toArray()

No description

mixed
first()

No description

mixed
firstOr(mixed $default)

No description

bool
any(callable $callable)

Determines if at least an element of the collection satisfies a condition.

bool
all(callable $callable)

Determines if all elements of the collection satisfies a condition.

Details

at line 12
abstract int count()

No description

Return Value

int

at line 13
abstract array toArray()

No description

Return Value

array

at line 15
mixed first()

No description

Return Value

mixed

at line 23
mixed firstOr(mixed $default)

No description

Parameters

mixed $default

Return Value

mixed

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.

Parameters

callable $callable

A method returning a boolean with key and value or only value as arguments.

Return Value

bool

True if callback is true for at least one of the elements

Exceptions

ReflectionException

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.

Parameters

callable $callable

A method returning a boolean with key and value or only value as arguments.

Return Value

bool

True if callback is true for all the elements

Exceptions

ReflectionException