private function parse_result($data) {
    try {
      if ($this->resp_type == 'json') {
        $result = @json_decode($data);
      } else {
        $result = @simplexml_load_string($data);
      }
    } catch (Exception $e) {
      throw new GiantBombException('Parse error occoured', null, $e);
    }

    if (empty($result)) {
      throw new GiantBombException('Unknown error occured');
    } else if (!empty($result->error) && strtoupper($result->error) != 'OK') {
      throw new GiantBombException('Following error encountered: ' . $result->error);
    }

    return $result;
  }
private function parse_result($data) {
    try {
      if ($this->resp_type == 'json') {
        $result = @json_decode($data);
      } else {
        $result = @simplexml_load_string($data);
      }
    } catch (Exception $e) {
      throw new GiantBombException('Parse error occoured', null, $e);
    }

    if (empty($result)) {
      throw new GiantBombException('Unknown error occured');
    } else if (!empty($result->error) && strtoupper($result->error) != 'OK') {
      throw new GiantBombException('Following error encountered: ' . $result->error);
    }

    return $result;
  }
private function parse_result ( $ data ) { try { if ( $ this -> resp_type == 'json' ) { $ result = @ json_decode ( $ data ) ; } else { $ result = @ simplexml_load_string ( $ data ) ; } } catch ( Exception $ e ) { throw new GiantBombException ( 'Parse error occoured' , null , $ e ) ; } if ( empty ( $ result ) ) { throw new GiantBombException ( 'Unknown error occured' ) ; } else if ( ! empty ( $ result -> error ) && strtoupper ( $ result -> error ) != 'OK' ) { throw new GiantBombException ( 'Following error encountered: ' . $ result -> error ) ; } return $ result ; }
Return parsed result of api response

@param $data string result of API

@return mixed parsed version of input string(object)
Return parsed result of api response