src/VK/Client/VKApiRequest.php
private function parseResponse(TransportClientResponse $response) {
        $this->checkHttpStatus($response);

        $body = $response->getBody();
        $decode_body = $this->decodeBody($body);

        if (isset($decode_body[static::KEY_ERROR])) {
            $error = $decode_body[static::KEY_ERROR];
            $api_error = new VKApiError($error);
            throw ExceptionMapper::parse($api_error);
        }

        if (isset($decode_body[static::KEY_RESPONSE])) {
            return $decode_body[static::KEY_RESPONSE];
        } else {
            return $decode_body;
        }
    }
private function parseResponse(TransportClientResponse $response) {
        $this->checkHttpStatus($response);

        $body = $response->getBody();
        $decode_body = $this->decodeBody($body);

        if (isset($decode_body[static::KEY_ERROR])) {
            $error = $decode_body[static::KEY_ERROR];
            $api_error = new VKApiError($error);
            throw ExceptionMapper::parse($api_error);
        }

        if (isset($decode_body[static::KEY_RESPONSE])) {
            return $decode_body[static::KEY_RESPONSE];
        } else {
            return $decode_body;
        }
    }
private function parseResponse ( TransportClientResponse $ response ) { $ this -> checkHttpStatus ( $ response ) ; $ body = $ response -> getBody ( ) ; $ decode_body = $ this -> decodeBody ( $ body ) ; if ( isset ( $ decode_body [ static :: KEY_ERROR ] ) ) { $ error = $ decode_body [ static :: KEY_ERROR ] ; $ api_error = new VKApiError ( $ error ) ; throw ExceptionMapper :: parse ( $ api_error ) ; } if ( isset ( $ decode_body [ static :: KEY_RESPONSE ] ) ) { return $ decode_body [ static :: KEY_RESPONSE ] ; } else { return $ decode_body ; } }
Decodes the response and checks its status code and whether it has an Api error. Returns decoded response.

@param TransportClientResponse $response

@return mixed

@throws VKApiException
@throws VKClientException
Decodes the response and checks its status code and whether it has an Api error . Returns decoded response .