Skip to content

Commit 73a16ef

Browse files
committed
Fix parameter type error in strict mode
1 parent b70c9c2 commit 73a16ef

File tree

2 files changed

+7
-12
lines changed

2 files changed

+7
-12
lines changed

src/Runtime.php

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,20 +9,11 @@ final class Runtime
99
{
1010
/**
1111
* Output debug info.
12-
*
13-
* @param string $v expression
14-
* @param string $f runtime function name
1512
*/
16-
public static function debug(string $v, string $f, RuntimeContext $cx)
13+
public static function debug(string $expression, string $runtimeFn, ...$rest)
1714
{
18-
// Build array of reference for call_user_func_array
19-
$P = func_get_args();
20-
$params = [];
21-
for ($i = 2; $i < count($P); $i++) {
22-
$params[] = &$P[$i];
23-
}
2415
$runtime = self::class;
25-
return call_user_func_array("$runtime::$f", $params);
16+
return call_user_func_array("$runtime::$runtimeFn", $rest);
2617
}
2718

2819
/**

tests/HandlebarsSpecTest.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,11 @@ public function testSpecs($spec)
126126
($spec['description'] === 'blocks - decorators') ||
127127

128128
// strict mode
129-
$spec['description'] === 'strict - strict mode' ||
129+
(
130+
$spec['description'] === 'strict - strict mode' && (
131+
str_starts_with($spec['it'], 'should allow undefined ') || $spec['it'] === 'should handle explicit undefined'
132+
)
133+
) ||
130134
$spec['description'] === 'strict - assume objects' ||
131135

132136
// helper for raw block

0 commit comments

Comments
 (0)