CompilerRuntime
in package
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:
- Start with the string "jmespath_"
- Append the MD5 checksum of the expression.
- Append ".php"
Table of Contents
- $cacheDir : mixed
- $compiler : mixed
- $interpreter : mixed
- $parser : mixed
- __construct() : mixed
- __invoke() : mixed
- Returns data from the provided input that matches a given JMESPath expression.
- compile() : mixed
Properties
$cacheDir
private
mixed
$cacheDir
$compiler
private
mixed
$compiler
$interpreter
private
mixed
$interpreter
$parser
private
mixed
$parser
Methods
__construct()
public
__construct([string|null $dir = null ][, Parser|null $parser = null ]) : mixed
Parameters
- $dir : string|null = null
-
Directory used to store compiled PHP files.
- $parser : Parser|null = null
-
JMESPath parser to utilize
Tags
Return values
mixed —__invoke()
Returns data from the provided input that matches a given JMESPath expression.
public
__invoke(string $expression, mixed $data) : mixed
Parameters
- $expression : string
-
JMESPath expression to evaluate
- $data : mixed
-
Data to search. This data should be data that is similar to data returned from json_decode using associative arrays rather than objects.
Tags
Return values
mixed —Returns the matching data or null
compile()
private
compile(mixed $filename, mixed $expression, mixed $functionName) : mixed
Parameters
- $filename : mixed
- $expression : mixed
- $functionName : mixed