Skip to content

Commit 3fc560e

Browse files
committed
Merge branch '4.4' into 5.2
* 4.4: add missing return type declaration Modernize func_get_args() calls to variadic parameters Use a lazyintertor to close files descriptors when no longer used
2 parents 7bf30a4 + a6b2c71 commit 3fc560e

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

ExpressionFunction.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,12 +84,12 @@ public static function fromPhp(string $phpFunctionName, string $expressionFuncti
8484
throw new \InvalidArgumentException(sprintf('An expression function name must be defined when PHP function "%s" is namespaced.', $phpFunctionName));
8585
}
8686

87-
$compiler = function () use ($phpFunctionName) {
88-
return sprintf('\%s(%s)', $phpFunctionName, implode(', ', \func_get_args()));
87+
$compiler = function (...$args) use ($phpFunctionName) {
88+
return sprintf('\%s(%s)', $phpFunctionName, implode(', ', $args));
8989
};
9090

91-
$evaluator = function () use ($phpFunctionName) {
92-
return $phpFunctionName(...\array_slice(\func_get_args(), 1));
91+
$evaluator = function ($p, ...$args) use ($phpFunctionName) {
92+
return $phpFunctionName(...$args);
9393
};
9494

9595
return new self($expressionFunctionName ?: end($parts), $compiler, $evaluator);

0 commit comments

Comments
 (0)