@@ -209,7 +209,7 @@ public function isMember($id, $user)
209209
210210 $ response = $ this ->client ->get ($ this ->fetchUrl ($ path ));
211211
212- switch ($ response ->code ) {
212+ switch ($ response ->getStatusCode () ) {
213213 case 204 :
214214 // Response if user is a member
215215 return true ;
@@ -219,7 +219,7 @@ public function isMember($id, $user)
219219 return false ;
220220
221221 default :
222- throw new \UnexpectedValueException ('Unexpected response code: ' . $ response ->code );
222+ throw new \UnexpectedValueException ('Unexpected response code: ' . $ response ->getStatusCode () );
223223 }
224224 }
225225
@@ -294,10 +294,10 @@ public function getTeamMembership($id, $user)
294294
295295 $ response = $ this ->client ->get ($ this ->fetchUrl ($ path ));
296296
297- switch ($ response ->code ) {
297+ switch ($ response ->getStatusCode () ) {
298298 case 200 :
299299 // Response if user is an active member or pending membership
300- $ body = json_decode ($ response ->body );
300+ $ body = json_decode ($ response ->getBody ()-> getContents () );
301301
302302 return $ body ->state ;
303303
@@ -306,7 +306,7 @@ public function getTeamMembership($id, $user)
306306 return false ;
307307
308308 default :
309- throw new \UnexpectedValueException ('Unexpected response code: ' . $ response ->code );
309+ throw new \UnexpectedValueException ('Unexpected response code: ' . $ response ->getStatusCode () );
310310 }
311311 }
312312
@@ -403,7 +403,7 @@ public function checkRepo($id, $owner, $repo)
403403
404404 $ response = $ this ->client ->get ($ this ->fetchUrl ($ path ));
405405
406- switch ($ response ->code ) {
406+ switch ($ response ->getStatusCode () ) {
407407 case 204 :
408408 // Response if repo is managed by this team.
409409 return true ;
@@ -413,7 +413,7 @@ public function checkRepo($id, $owner, $repo)
413413 return false ;
414414
415415 default :
416- throw new \UnexpectedValueException ('Unexpected response code: ' . $ response ->code );
416+ throw new \UnexpectedValueException ('Unexpected response code: ' . $ response ->getStatusCode () );
417417 }
418418 }
419419
0 commit comments