Skip to content

Commit ff896bb

Browse files
committed
changes in client class
1 parent 64a4685 commit ff896bb

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

src/Client.php

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -222,11 +222,9 @@ public function request($method,$url,array $options)
222222
}
223223
catch (RequestException $e)
224224
{
225-
226-
if(!empty($e->getResponse()->getBody()->getContents()))
227-
{
228-
$json_error = json_decode($e->getResponse()->getBody()->getContents(),true);
229-
$error_message = isset($json_error['errors'])?$json_error['errors']:\GuzzleHttp\json_encode($json_error);
225+
$json_error = json_decode($e->getResponse()->getBody()->getContents(),true);
226+
if (isset($json_error['errors'])) {
227+
$error_message = \GuzzleHttp\json_encode($json_error);
230228
}
231229
else {
232230
$error_message = $e->getMessage();

test/PublicAppTest.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,11 @@ public function testAccessToken()
4848
$this->testClient->getAccessToken($api_data);
4949
}
5050

51+
/**
52+
* prepare oauth url with redirect uri
53+
* set scope and request_uri
54+
* @return void
55+
*/
5156
public function testAuthUrl()
5257
{
5358
$redirect_uri = 'test.com';
@@ -59,4 +64,6 @@ public function testAuthUrl()
5964
$this->testClient->prepareAuthorizeUrl($redirect_uri, $scope, $this->testClient->getState())
6065
);
6166
}
67+
68+
6269
}

0 commit comments

Comments
 (0)