We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent bb5e723 commit 4c69362Copy full SHA for 4c69362
1 file changed
src/Parser.php
@@ -219,7 +219,13 @@ private static function parseKey(ParsingInput $input): string
219
private static function parseBoolean(ParsingInput $input): bool
220
{
221
$input->consumeChar('?');
222
- return match ($input->consumeChar()) {
+ $value = '';
223
+ try {
224
+ $value = $input->consumeChar();
225
+ } catch (\RuntimeException) {
226
+ // Consume may throw if value character is missing at end of string. Fall through to default error.
227
+ }
228
+ return match ($value) {
229
'0' => false,
230
'1' => true,
231
default => throw new ParseException('Invalid boolean at position ' . $input->position()),
0 commit comments