class Last extends Mutator (View source)

Returns the last element of an array.

Methods

__construct(callable $callback = null)

No description

mixed
__invoke(mixed $value)

Mutate the input value.

from  Mutator
static Last
make(callable $callback = null)

No description

mixed
mutate(mixed $value)

Mutate the input value.

Details

__construct(callable $callback = null)

No description

Parameters

callable $callback

A callback to filter the array (optional)

final mixed __invoke(mixed $value)

Mutate the input value.

Parameters

mixed $value

Return Value

mixed

static Last make(callable $callback = null)

No description

Parameters

callable $callback

A callback to filter the array (optional)

Return Value

Last

mixed mutate(mixed $value)

Mutate the input value.

Parameters

mixed $value

Return Value

mixed