JmesPath\TreeInterpreter::visit PHP Method

visit() public method

Visits each node in a JMESPath AST and returns the evaluated result.
public visit ( array $node, mixed $data ) : mixed
$node array JMESPath AST node
$data mixed Data to evaluate
return mixed
    public function visit(array $node, $data)
    {
        return $this->dispatch($node, $data);
    }

Usage Example

 public function testReturnsNullWhenMergingNonArray()
 {
     $t = new TreeInterpreter();
     $this->assertNull($t->visit(array('type' => 'flatten', 'children' => array(array('type' => 'literal', 'value' => 1), array('type' => 'literal', 'value' => 1))), array(), array('runtime' => new AstRuntime())));
 }