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

Method readJSONString

lib/php/lib/Protocol/TJSONProtocol.php:277–301  ·  view source on GitHub ↗
($skipContext)

Source from the content-addressed store, hash-verified

275 }
276
277 private function readJSONString($skipContext)
278 {
279 if (!$skipContext) {
280 $this->context_->read();
281 }
282
283 $jsonString = '';
284 $lastChar = null;
285 while (true) {
286 $ch = $this->reader_->read();
287 $jsonString .= $ch;
288 if ($ch == self::QUOTE &&
289 $lastChar !== null &&
290 $lastChar !== self::ESCSEQ) {
291 break;
292 }
293 if ($ch == self::ESCSEQ && $lastChar == self::ESCSEQ) {
294 $lastChar = self::DOUBLEESC;
295 } else {
296 $lastChar = $ch;
297 }
298 }
299
300 return json_decode($jsonString);
301 }
302
303 private function isJSONNumeric($b)
304 {

Callers 14

readJSONDoubleMethod · 0.95
readMessageBeginMethod · 0.95
readFieldBeginMethod · 0.95
readMapBeginMethod · 0.95
readListBeginMethod · 0.95
readSetBeginMethod · 0.95
readStringMethod · 0.95
readUuidMethod · 0.95
readMessageBeginMethod · 0.95
readFieldBeginMethod · 0.95
readMapBeginMethod · 0.95
readCollectionBeginMethod · 0.95

Calls 1

readMethod · 0.65

Tested by

no test coverage detected