/** * * @param Context $context */ public function handle(Context $context) { $ws = WS::getInstance(); $ws->handle($context); if (!$context->hasNext()) { $context->throwException("Unexpected end of JSON"); } $this->handleChar($context); $ws->handle($context); }
/** * * @param Context $context * @throws DecodeException */ public function handle(Context $context) { $ws = WS::getInstance(); $ws->handle($context); $value = new Value(); $value->handle($context); $ws->handle($context); if ($context->hasNext()) { $current = $context->current(); $context->throwException("Unexpected character('{$current}')"); } $this->result = $value->getResult(); }