class KeyPathResolver (View source)

Provides methods for traversing variables according to a key path.

Methods

__construct(mixed $value)

KeyPathResolver constructor.

mixed
get(array $path)

Returns a value from the given key path.

Details

__construct(mixed $value)

KeyPathResolver constructor.

Parameters

mixed $value The initial value used to traversing

mixed get(array $path)

Returns a value from the given key path.

Parameters

array $path A list of keys used to traverse the value

Return Value

mixed The value for the key path

Exceptions

NotFoundException If a key in the path does not exist