class Filter extends ArrayMutator (View source)

Filter an array using a callback. The callback receives both the value and the key of the array.

Methods

__construct(callable $callback = null)

No description

mixed
__invoke(mixed $value)

Mutate the input value.

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

No description

mixed
mutate(mixed $value)

Mutate the input value.

array
mutateArray(array $array)

No description

Details

__construct(callable $callback = null)

No description

Parameters

callable $callback

The callback to use for filtering (optional).

final mixed __invoke(mixed $value)

Mutate the input value.

Parameters

mixed $value

Return Value

mixed

static Filter make(callable $callback = null)

No description

Parameters

callable $callback

The callback to use for filtering (optional).

Return Value

Filter

mixed mutate(mixed $value)

Mutate the input value.

Parameters

mixed $value

Return Value

mixed

protected array mutateArray(array $array)

No description

Parameters

array $array

Return Value

array