code: public static function jsonDecode($json)
      {
          if (is_array($json)) {
              return $json;
          }
  
          $value = json_decode($json, true);
          if (null === $value) {
              return array();
          }
  
          return $value;
      }
docs: Decodes a json block
  @param $json
  
  @return array|mixed