src/Peach/DF/JsonCodec/StructuralChar.php
private function handleChar(Context $context)
    {
        $chr      = $context->current();
        $expected = $this->expected;
        if (in_array($chr, $expected, true)) {
            $this->result = $chr;
            $context->next();
            return;
        }
        
        $quote = function ($chr) {
            return "'{$chr}'";
        };
        $expectedList = implode(", ", array_map($quote, $expected));
        throw $context->createException("'{$chr}' is not allowed (expected: {$expectedList})");
    }
private function handleChar(Context $context)
    {
        $chr      = $context->current();
        $expected = $this->expected;
        if (in_array($chr, $expected, true)) {
            $this->result = $chr;
            $context->next();
            return;
        }
        
        $quote = function ($chr) {
            return "'{$chr}'";
        };
        $expectedList = implode(", ", array_map($quote, $expected));
        throw $context->createException("'{$chr}' is not allowed (expected: {$expectedList})");
    }
空白以外の文字を検知した際の処理です.

@param Context $context
@throws DecodeException 期待されている文字以外の文字を検知した場合