MCPcopy Create free account
hub / github.com/apache/thrift / readJSONIntegerAsString

Method readJSONIntegerAsString

lib/php/lib/Protocol/TJSONProtocol.php:371–390  ·  view source on GitHub ↗

* Identical to readJSONInteger but without the final cast. * Needed for proper handling of i64 on 32 bit machines. Why a * separate function? So we don't have to force the rest of the * use cases through the extra conditional. */

()

Source from the content-addressed store, hash-verified

369 * use cases through the extra conditional.
370 */
371 private function readJSONIntegerAsString()
372 {
373 $this->context_->read();
374
375 if ($this->context_->escapeNum()) {
376 $this->readJSONSyntaxChar(self::QUOTE);
377 }
378
379 $str = $this->readJSONNumericChars();
380
381 if ($this->context_->escapeNum()) {
382 $this->readJSONSyntaxChar(self::QUOTE);
383 }
384
385 if (!is_numeric($str)) {
386 throw new TProtocolException("Invalid data in numeric: " . $str, TProtocolException::INVALID_DATA);
387 }
388
389 return $str;
390 }
391
392 private function readJSONDouble()
393 {

Callers 1

readI64Method · 0.95

Calls 4

readJSONSyntaxCharMethod · 0.95
readJSONNumericCharsMethod · 0.95
readMethod · 0.65
escapeNumMethod · 0.45

Tested by

no test coverage detected