class At extends Mutator (View source)

Get element at the specified index. If the index does not exist, the default value is returned.

If the default value is a callable, it will be invoked with the array and the index as arguments.

Methods

__construct(string|int $index, mixed $default = null)

No description

mixed
__invoke(mixed $value)

Mutate the input value.

from  Mutator
static At
make(string|int $index, mixed $default = null)

No description

mixed
mutate(mixed $value)

Mutate the input value.

Details

__construct(string|int $index, mixed $default = null)

No description

Parameters

string|int $index

The index to get

mixed $default

The default value to return if the index does not exist. Will be called with the array and the index as arguments if it is a callable (defaults to null).

final mixed __invoke(mixed $value)

Mutate the input value.

Parameters

mixed $value

Return Value

mixed

static At make(string|int $index, mixed $default = null)

No description

Parameters

string|int $index

The index to get

mixed $default

The default value to return if the index does not exist. Will be called with the array and the index as arguments if it is a callable (defaults to null).

Return Value

At

mixed mutate(mixed $value)

Mutate the input value.

Parameters

mixed $value

Return Value

mixed