Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit f0c62cd

Browse files
committed
Merge branch 'Return-Response' of github.com:joomla-framework/github-api into Return-Response
2 parents 83fae7b + 5625e59 commit f0c62cd

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/AbstractGithubObject.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -146,23 +146,23 @@ protected function fetchUrl($path, $page = 0, $limit = 0)
146146
* @param Response $response The response.
147147
* @param integer $expectedCode The expected "good" code.
148148
*
149-
* @return mixed
149+
* @return Response
150150
*
151151
* @since 1.0
152152
* @throws UnexpectedResponseException
153153
*/
154154
protected function processResponse(Response $response, $expectedCode = 200)
155155
{
156156
// Validate the response code.
157-
if ($response->code != $expectedCode)
157+
if ($response->getStatusCode() != $expectedCode)
158158
{
159159
// Decode the error response and throw an exception.
160160
$error = json_decode($response->body);
161161

162162
// Check if the error message is set; send a generic one if not
163163
$message = isset($error->message) ? $error->message : 'Invalid response received from GitHub.';
164164

165-
throw new UnexpectedResponseException($response, $message, $response->code);
165+
throw new UnexpectedResponseException($response, $message, $response->getStatusCode());
166166
}
167167

168168
return $response;

0 commit comments

Comments
 (0)