Skip to content

Commit b0c8185

Browse files
committed
Simplifying static runtime usage
1 parent 6f6148e commit b0c8185

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

src/Env.php

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,6 @@ final class Env
1414
{
1515
const COMPILE_DIR = 'JP_PHP_COMPILE';
1616

17-
/** @var callable */
18-
private static $runtime;
19-
2017
/**
2118
* Returns data from the input array that matches a JMESPath expression.
2219
*
@@ -27,11 +24,10 @@ final class Env
2724
*/
2825
public static function search($expression, $data)
2926
{
30-
if (!self::$runtime) {
31-
self::$runtime = self::createRuntime();
27+
static $runtime;
28+
if (!$runtime) {
29+
$runtime = Env::createRuntime();
3230
}
33-
34-
$runtime = self::$runtime;
3531
return $runtime($expression, $data);
3632
}
3733

0 commit comments

Comments
 (0)