diff --git a/src/AbstractGithubObject.php b/src/AbstractGithubObject.php index c5a7e580..674c959e 100644 --- a/src/AbstractGithubObject.php +++ b/src/AbstractGithubObject.php @@ -159,7 +159,7 @@ protected function fetchUrl($path, $page = 0, $limit = 0) * @param Response $response The response. * @param integer $expectedCode The expected "good" code. * - * @return mixed + * @return Response * * @since 1.0 * @throws UnexpectedResponseException @@ -167,13 +167,13 @@ protected function fetchUrl($path, $page = 0, $limit = 0) protected function processResponse(Response $response, $expectedCode = 200) { // Validate the response code. - if ($response->code != $expectedCode) + if ($response->getStatusCode() != $expectedCode) { // Decode the error response and throw an exception. $error = json_decode($response->body); $message = isset($error->message) ? $error->message : 'Invalid response received from GitHub.'; - throw new UnexpectedResponseException($response, $message, $response->code); + throw new UnexpectedResponseException($response, $message, $response->getStatusCode()); } return json_decode($response->body);