@@ -56,10 +56,10 @@ discard block |
||
| 56 | 56 | public function __construct($token, $config = []) |
| 57 | 57 | { |
| 58 | 58 | $default_config = [ |
| 59 | - 'base_uri' => 'https://www.eventbriteapi.com/v3/', |
|
| 60 | - // Turn exceptions off so we can handle the responses ourselves. |
|
| 61 | - 'exceptions' => false, |
|
| 62 | - 'timeout' => 30, |
|
| 59 | + 'base_uri' => 'https://www.eventbriteapi.com/v3/', |
|
| 60 | + // Turn exceptions off so we can handle the responses ourselves. |
|
| 61 | + 'exceptions' => false, |
|
| 62 | + 'timeout' => 30, |
|
| 63 | 63 | ]; |
| 64 | 64 | $config = array_merge($config, $default_config); |
| 65 | 65 | // Add this last so it's always there and isn't overwritten. |
@@ -93,7 +93,7 @@ discard block |
||
| 93 | 93 | $pv = isset($options['protocol_version']) ? $options['protocol_version'] : '1.1'; |
| 94 | 94 | // Make the request. |
| 95 | 95 | $request = new Request($http_method, $endpoint, $headers, $body, |
| 96 | - $pv); |
|
| 96 | + $pv); |
|
| 97 | 97 | // Send it. |
| 98 | 98 | $response = $this->client->send($request, $options); |
| 99 | 99 | if ($response instanceof ResponseInterface) { |
@@ -108,7 +108,7 @@ discard block |
||
| 108 | 108 | } else { |
| 109 | 109 | // This only really happens when the network is interrupted. |
| 110 | 110 | throw new BadResponseException('A bad response was received.', |
| 111 | - $request); |
|
| 111 | + $request); |
|
| 112 | 112 | } |
| 113 | 113 | } else { |
| 114 | 114 | throw new \Exception('Unrecognised HTTP verb.'); |
@@ -142,9 +142,9 @@ discard block |
||
| 142 | 142 | { |
| 143 | 143 | $body = $response->getBody()->getContents(); |
| 144 | 144 | return [ |
| 145 | - 'code' => $response->getStatusCode(), |
|
| 146 | - 'headers' => $response->getHeaders(), |
|
| 147 | - 'body' => ($this->isValidJson($body)) ? json_decode($body, |
|
| 145 | + 'code' => $response->getStatusCode(), |
|
| 146 | + 'headers' => $response->getHeaders(), |
|
| 147 | + 'body' => ($this->isValidJson($body)) ? json_decode($body, |
|
| 148 | 148 | true) : $body, |
| 149 | 149 | ]; |
| 150 | 150 | } |