- Object type now show in invalid block arguments

This commit is contained in:
Dev 2026-06-09 19:26:27 +00:00
parent 210c8ae0bd
commit 722131d801

View File

@ -36,8 +36,10 @@ class BlockToken implements ControlStructure {
unset(\$inlineVariables);
}
catch(\TypeError \$ex) {
\$showArgs = fn(\$e) => (\$type = gettype(\$e)) === 'object' ? \$e::class : \$type;
throw new \Exception(
sprintf('A block awaiting arguments `%s` instead received `%s` with values `%s`', '$arguments', implode(', ', array_map('gettype', \$inlineVariables ?? [])), json_encode(\$inlineVariables))
sprintf('A block awaiting arguments (%s) instead received (%s) with values (%s)', '$arguments', implode(', ', array_map(\$showArgs, \$inlineVariables ?? [])), json_encode(\$inlineVariables))
);
}
/*%EXCEPTION_LINE_BASE%*/?>