@@ -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 { |
@@ -52,7 +52,7 @@ |
||
| 52 | 52 | |
| 53 | 53 | private function handleBadResponse(ResponseInterface $response) |
| 54 | 54 | { |
| 55 | - $body = (string) $response->getBody(); |
|
| 55 | + $body = (string)$response->getBody(); |
|
| 56 | 56 | $json = \GuzzleHttp\json_decode($body, true); |
| 57 | 57 | ErrorHandler::error($json); |
| 58 | 58 | } |
@@ -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']); |