You are here

json.php in Devel 8

Same filename and directory in other branches
  1. 8.2 kint/kint/parsers/custom/json.php

File

kint/kint/parsers/custom/json.php
View source
<?php

class Kint_Parsers_Json extends kintParser {
  protected function _parse(&$variable) {
    if (!KINT_PHP53 || !is_string($variable) || !isset($variable[0]) || $variable[0] !== '{' && $variable[0] !== '[' || ($json = json_decode($variable, true)) === null) {
      return false;
    }
    $val = (array) $json;
    if (empty($val)) {
      return false;
    }
    $this->value = kintParser::factory($val)->extendedValue;
    $this->type = 'JSON';
  }

}

Classes

Namesort descending Description
Kint_Parsers_Json