\JmesPathTreeInterpreter

Tree visitor used to evaluates JMESPath AST expressions.

Summary

Methods
Properties
Constants
__construct()
visit()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
dispatch()
relativeCmp()
$fnDispatcher
N/A

Properties

$fnDispatcher

$fnDispatcher : callable

Type

callable

Methods

__construct()

__construct(callable|null  $fnDispatcher = null) : mixed

Parameters

callable|null $fnDispatcher

Function dispatching function that accepts a function name argument and an array of function arguments and returns the result.

Returns

mixed —

visit()

visit(array  $node, mixed  $data) : mixed

Visits each node in a JMESPath AST and returns the evaluated result.

Parameters

array $node

JMESPath AST node

mixed $data

Data to evaluate

Returns

mixed —

dispatch()

dispatch(array  $node, mixed  $value) : mixed

Recursively traverses an AST using depth-first, pre-order traversal.

The evaluation logic for each node type is embedded into a large switch statement to avoid the cost of "double dispatch".

Parameters

array $node
mixed $value

Returns

mixed —

relativeCmp()

relativeCmp(mixed  $left, mixed  $right, mixed  $cmp) : bool

Parameters

mixed $left
mixed $right
mixed $cmp

Returns

bool —