Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Use json function on response object which gives proper exception if unparsable #2

Merged
merged 1 commit into from

2 participants

@naderman
Owner

No description provided.

@till till merged commit 9438862 into master
@till till deleted the guzzle-json branch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
Showing with 1 addition and 1 deletion.
  1. +1 −1  src/app.php
View
2  src/app.php
@@ -54,7 +54,7 @@ function (HttpFoundation\Request $request) use ($app) {
$accessToken = $token->getAccessToken();
$client = new GuzzleHttp\Client();
$response = $client->get('https://api.github.com/user/orgs?access_token=' . $accessToken);
- $githubOrgs = json_decode($response->getBody()->__toString(), true);
+ $githubOrgs = $response->json();
$userOrgs = [];
foreach ($githubOrgs as $userOrg) {
Something went wrong with that request. Please try again.