/** * Process response. * * @return array */ protected function processResponse() { $parsedResponse = \json_decode($this->response->getBody(), true); // Test if return a valid JSON. if (JSON_ERROR_NONE !== json_last_error()) { $message = function_exists('json_last_error_msg') ? json_last_error_msg() : 'Invalid JSON returned'; throw new HttpClientException($message, $this->response->getCode(), $this->request, $this->response); } $this->lookForErrors($parsedResponse); return $parsedResponse; }
/** * Process response. * * @return array */ protected function processResponse() { $parsedResponse = $this->decodeResponseBody($this->response->getBody()); $this->lookForErrors($parsedResponse); return $parsedResponse; }