\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

$compiler

$compiler

$cacheDir

$cacheDir

$interpreter

$interpreter

Methods

__construct()

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

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

Returns

mixed —

__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(mixed  $filename, mixed  $expression, mixed  $functionName) : mixed

Parameters

mixed $filename
mixed $expression
mixed $functionName

Returns

mixed —