@@ -58,13 +58,13 @@ discard block |
||
| 58 | 58 | public function __construct($token, $config = []) |
| 59 | 59 | { |
| 60 | 60 | $default_config = [ |
| 61 | - 'base_uri' => 'https://www.eventbriteapi.com/v3/', |
|
| 62 | - 'headers' => [ |
|
| 61 | + 'base_uri' => 'https://www.eventbriteapi.com/v3/', |
|
| 62 | + 'headers' => [ |
|
| 63 | 63 | 'User-Agent' => 'jamiehollern\eventbrite v' . self::VERSION . ' ' . \GuzzleHttp\default_user_agent(), |
| 64 | 64 | 'timeout' => 30, |
| 65 | - ], |
|
| 66 | - // Turn exceptions off so we can handle the responses ourselves. |
|
| 67 | - 'exceptions' => false, |
|
| 65 | + ], |
|
| 66 | + // Turn exceptions off so we can handle the responses ourselves. |
|
| 67 | + 'exceptions' => false, |
|
| 68 | 68 | ]; |
| 69 | 69 | $config = array_merge($config, $default_config); |
| 70 | 70 | if (!empty($token)) { |
@@ -116,7 +116,7 @@ discard block |
||
| 116 | 116 | } else { |
| 117 | 117 | // This only really happens when the network is interrupted. |
| 118 | 118 | throw new BadResponseException('A bad response was received.', |
| 119 | - $request); |
|
| 119 | + $request); |
|
| 120 | 120 | } |
| 121 | 121 | } else { |
| 122 | 122 | throw new \Exception('Unrecognised HTTP verb.'); |
@@ -150,9 +150,9 @@ discard block |
||
| 150 | 150 | { |
| 151 | 151 | $body = $response->getBody()->getContents(); |
| 152 | 152 | return [ |
| 153 | - 'code' => $response->getStatusCode(), |
|
| 154 | - 'headers' => $response->getHeaders(), |
|
| 155 | - 'body' => ($this->isValidJson($body)) ? json_decode($body, |
|
| 153 | + 'code' => $response->getStatusCode(), |
|
| 154 | + 'headers' => $response->getHeaders(), |
|
| 155 | + 'body' => ($this->isValidJson($body)) ? json_decode($body, |
|
| 156 | 156 | true) : $body, |
| 157 | 157 | ]; |
| 158 | 158 | } |