/** * exp = e [ minus / plus ] 1*DIGIT * * @param Context $context */ private function handleExponentPart(Context $context) { // e = %x65 / %x45 $current = $context->current(); if ($current !== "e" && $current !== "E") { return; } $this->result .= "e"; $this->isFloat = true; $next = $context->next(); // [ minus / plus ] if ($next === "+" || $next === "-") { $this->result .= $next; $context->next(); } // 1*DIGIT $this->handleFirstDigit($context); $this->handleDigitSequence($context); }
/** * @covers Peach\DF\JsonCodec\Context::next * @expectedException Peach\DF\JsonCodec\DecodeException */ public function testNextFail() { $context = new Context("This is a pen.", new ArrayMap()); for ($i = 0; $i < 14; $i++) { $context->next(); } $this->assertFalse($context->hasNext()); $context->next(); }