@@ -18,7 +18,7 @@ discard block |
||
18 | 18 | { |
19 | 19 | $this->accessToken = $accessToken; |
20 | 20 | $this->apiUrl = $apiUrl; |
21 | - $this->client = new Client(['base_uri' => $this->apiUrl . '/']); |
|
21 | + $this->client = new Client(['base_uri' => $this->apiUrl.'/']); |
|
22 | 22 | } |
23 | 23 | |
24 | 24 | public function getAccessToken(): string |
@@ -39,12 +39,12 @@ discard block |
||
39 | 39 | public function setApiUrl(string $apiUrl) |
40 | 40 | { |
41 | 41 | $this->apiUrl = $apiUrl; |
42 | - $this->client = new Client(['base_uri' => $apiUrl . '/']); |
|
42 | + $this->client = new Client(['base_uri' => $apiUrl.'/']); |
|
43 | 43 | } |
44 | 44 | |
45 | 45 | private function handleBadResponse(ResponseInterface $response) |
46 | 46 | { |
47 | - $body = (string) $response->getBody(); |
|
47 | + $body = (string)$response->getBody(); |
|
48 | 48 | $json = \GuzzleHttp\json_decode($body, true); |
49 | 49 | ErrorHandler::error($json); |
50 | 50 | } |
@@ -62,7 +62,9 @@ |
||
62 | 62 | { |
63 | 63 | $headers['Content-Type'] = 'application/json'; |
64 | 64 | $body = null; |
65 | - if ($params) $body = \GuzzleHttp\json_encode($params); |
|
65 | + if ($params) { |
|
66 | + $body = \GuzzleHttp\json_encode($params); |
|
67 | + } |
|
66 | 68 | $request = new GuzzleRequest('POST', $endpoint, $headers, $body); |
67 | 69 | |
68 | 70 | try { |
@@ -14,7 +14,7 @@ |
||
14 | 14 | { |
15 | 15 | public static function error(array $error) |
16 | 16 | { |
17 | - switch($error['error']) { |
|
17 | + switch ($error['error']) { |
|
18 | 18 | case 'invalid_request': throw new InvalidRequestException($error['message']); |
19 | 19 | case 'account_banned': throw new AccountBannedException($error['message']); |
20 | 20 | case 'account_deleted': throw new AccountDeletedException($error['message']); |