public function decode($json)
    {
        if (empty($json)) {
            return '';
        }
        $decoded = json_decode($json, true);
        if (null !== $decoded) {
            return $decoded;
        }
        if (JSON_ERROR_NONE === json_last_error()) {
            return $json;
        }

        return self::$jsonErrors[json_last_error()];
    }
public function decode($json)
    {
        if (empty($json)) {
            return '';
        }
        $decoded = json_decode($json, true);
        if (null !== $decoded) {
            return $decoded;
        }
        if (JSON_ERROR_NONE === json_last_error()) {
            return $json;
        }

        return self::$jsonErrors[json_last_error()];
    }
public function decode ( $ json ) { if ( empty ( $ json ) ) { return '' ; } $ decoded = json_decode ( $ json , true ) ; if ( null !== $ decoded ) { return $ decoded ; } if ( JSON_ERROR_NONE === json_last_error ( ) ) { return $ json ; } return self :: $ jsonErrors [ json_last_error ( ) ] ; }
Decodes json response.

Returns $json if no error occurred during decoding but decoded value is
null.

@param string $json

@return array|string
Decodes json response .