- Object type now show in invalid block arguments
This commit is contained in:
parent
210c8ae0bd
commit
722131d801
@ -36,8 +36,10 @@ class BlockToken implements ControlStructure {
|
|||||||
unset(\$inlineVariables);
|
unset(\$inlineVariables);
|
||||||
}
|
}
|
||||||
catch(\TypeError \$ex) {
|
catch(\TypeError \$ex) {
|
||||||
|
\$showArgs = fn(\$e) => (\$type = gettype(\$e)) === 'object' ? \$e::class : \$type;
|
||||||
|
|
||||||
throw new \Exception(
|
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%*/?>
|
/*%EXCEPTION_LINE_BASE%*/?>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user