@@ -163,7 +163,7 @@ |
||
163 | 163 | /** |
164 | 164 | * Checks if the HTTP method being used is correct. |
165 | 165 | * |
166 | - * @param $http_method |
|
166 | + * @param string $http_method |
|
167 | 167 | * |
168 | 168 | * @return bool |
169 | 169 | */ |
@@ -62,10 +62,10 @@ discard block |
||
62 | 62 | public function __construct($token, $config = []) |
63 | 63 | { |
64 | 64 | $default_config = [ |
65 | - 'base_uri' => 'https://www.eventbriteapi.com/v3/', |
|
66 | - // Turn exceptions off so we can handle the responses ourselves. |
|
67 | - 'exceptions' => false, |
|
68 | - 'timeout' => 30, |
|
65 | + 'base_uri' => 'https://www.eventbriteapi.com/v3/', |
|
66 | + // Turn exceptions off so we can handle the responses ourselves. |
|
67 | + 'exceptions' => false, |
|
68 | + 'timeout' => 30, |
|
69 | 69 | ]; |
70 | 70 | $config = array_merge($config, $default_config); |
71 | 71 | // Add this last so it's always there and isn't overwritten. |
@@ -113,7 +113,7 @@ discard block |
||
113 | 113 | } else { |
114 | 114 | // This only really happens when the network is interrupted. |
115 | 115 | throw new BadResponseException('A bad response was received.', |
116 | - $request); |
|
116 | + $request); |
|
117 | 117 | } |
118 | 118 | } else { |
119 | 119 | throw new \Exception('Unrecognised HTTP verb.'); |
@@ -145,8 +145,8 @@ discard block |
||
145 | 145 | } |
146 | 146 | // Merge the mergeable arrays if necessary. |
147 | 147 | $mergeable = [ |
148 | - 'query' => $params, |
|
149 | - 'headers' => $headers, |
|
148 | + 'query' => $params, |
|
149 | + 'headers' => $headers, |
|
150 | 150 | ]; |
151 | 151 | foreach ($mergeable as $key => $value) { |
152 | 152 | if ($value !== null) { |
@@ -186,9 +186,9 @@ discard block |
||
186 | 186 | { |
187 | 187 | $body = $response->getBody()->getContents(); |
188 | 188 | return [ |
189 | - 'code' => $response->getStatusCode(), |
|
190 | - 'headers' => $response->getHeaders(), |
|
191 | - 'body' => ($this->isValidJson($body)) ? json_decode($body, |
|
189 | + 'code' => $response->getStatusCode(), |
|
190 | + 'headers' => $response->getHeaders(), |
|
191 | + 'body' => ($this->isValidJson($body)) ? json_decode($body, |
|
192 | 192 | true) : $body, |
193 | 193 | ]; |
194 | 194 | } |
@@ -242,8 +242,7 @@ |
||
242 | 242 | if ($this->validMethod($method)) { |
243 | 243 | array_unshift($args, $method); |
244 | 244 | return call_user_func_array(array($this, 'makeRequest'), $args); |
245 | - } |
|
246 | - else { |
|
245 | + } else { |
|
247 | 246 | throw new \BadMethodCallException('Method not found in class.'); |
248 | 247 | } |
249 | 248 | } |