private function processResponse(ResponseInterface $response)
    {
        if (200 !== $response->getStatusCode()) {
            throw new \RuntimeException('Query to the API server did not result in an appropriate response code');
        }

        $body = guzzle_json_decode((string) $response->getBody(), true);

        if ('OK' !== $body['error']) {
            throw new \RuntimeException('Query to the API server did not result in an appropriate response code');
        }

        return $body;
    }
private function processResponse(ResponseInterface $response)
    {
        if (200 !== $response->getStatusCode()) {
            throw new \RuntimeException('Query to the API server did not result in an appropriate response code');
        }

        $body = guzzle_json_decode((string) $response->getBody(), true);

        if ('OK' !== $body['error']) {
            throw new \RuntimeException('Query to the API server did not result in an appropriate response code');
        }

        return $body;
    }
private function processResponse ( ResponseInterface $ response ) { if ( 200 !== $ response -> getStatusCode ( ) ) { throw new \ RuntimeException ( 'Query to the API server did not result in an appropriate response code' ) ; } $ body = guzzle_json_decode ( ( string ) $ response -> getBody ( ) , true ) ; if ( 'OK' !== $ body [ 'error' ] ) { throw new \ RuntimeException ( 'Query to the API server did not result in an appropriate response code' ) ; } return $ body ; }
Checks if the Response object is valid, and throws an exception if not.

@param ResponseInterface $response

@throws \RuntimeException

@return array The response body
Checks if the Response object is valid and throws an exception if not .