\JmesPathCompilerRuntime

Compiles JMESPath expressions to PHP source code and executes it.

JMESPath file names are stored in the cache directory using the following logic to determine the filename:

  1. Start with the string "jmespath_"
  2. Append the MD5 checksum of the expression.
  3. Append ".php"

Summary

Methods
Properties
Constants
__construct()
__invoke()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
compile()
$parser
$compiler
$cacheDir
$interpreter
N/A

Properties

$parser

$parser : 

Type

$compiler

$compiler : 

Type

$cacheDir

$cacheDir : 

Type

$interpreter

$interpreter : 

Type

Methods

__construct()

__construct(string|null  $dir = null, \JmesPath\Parser|null  $parser = null) 

Parameters

string|null $dir

Directory used to store compiled PHP files.

\JmesPath\Parser|null $parser

JMESPath parser to utilize

Throws

\RuntimeException

if the cache directory cannot be created

__invoke()

__invoke(string  $expression, mixed  $data) : mixed

Returns data from the provided input that matches a given JMESPath expression.

Parameters

string $expression

JMESPath expression to evaluate

mixed $data

Data to search. This data should be data that is similar to data returned from json_decode using associative arrays rather than objects.

Throws

\RuntimeException

Returns

mixed —

Returns the matching data or null

compile()

compile(  $filename,   $expression,   $functionName) 

Parameters

$filename
$expression
$functionName