Upgrade 1-11.38

This commit is contained in:
xesmyd
2026-03-30 14:10:30 +02:00
parent f2a7e6d1fc
commit ac648ef29d
24665 changed files with 69682 additions and 2205004 deletions
+5 -7
View File
@@ -39,7 +39,7 @@ class ExpressionFunction
* @param callable $compiler A callable able to compile the function
* @param callable $evaluator A callable able to evaluate the function
*/
public function __construct($name, callable $compiler, callable $evaluator)
public function __construct(string $name, callable $compiler, callable $evaluator)
{
$this->name = $name;
$this->compiler = $compiler;
@@ -85,14 +85,12 @@ class ExpressionFunction
throw new \InvalidArgumentException(sprintf('An expression function name must be defined when PHP function "%s" is namespaced.', $phpFunctionName));
}
$compiler = function () use ($phpFunctionName) {
return sprintf('\%s(%s)', $phpFunctionName, implode(', ', \func_get_args()));
$compiler = function (...$args) use ($phpFunctionName) {
return sprintf('\%s(%s)', $phpFunctionName, implode(', ', $args));
};
$evaluator = function () use ($phpFunctionName) {
$args = \func_get_args();
return \call_user_func_array($phpFunctionName, array_splice($args, 1));
$evaluator = function ($p, ...$args) use ($phpFunctionName) {
return $phpFunctionName(...$args);
};
return new self($expressionFunctionName ?: end($parts), $compiler, $evaluator);