Skip to content

Commit a6b2c71

Browse files
committed
Modernize func_get_args() calls to variadic parameters
1 parent 066402a commit a6b2c71

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
@@ -85,12 +85,12 @@ public static function fromPhp($phpFunctionName, $expressionFunctionName = null)
8585
throw new \InvalidArgumentException(sprintf('An expression function name must be defined when PHP function "%s" is namespaced.', $phpFunctionName));
8686
}
8787

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

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

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

0 commit comments

Comments
 (0)