@@ -231,10 +231,11 @@ discard block |
||
231 | 231 | $headers[] = "Content-length:" . strlen($content); |
232 | 232 | |
233 | 233 | // Set HTTP options. |
234 | - if (!function_exists('curl_reset')) |
|
235 | - $this->curlHandle = curl_init(); |
|
236 | - else |
|
237 | - curl_reset($this->curlHandle); |
|
234 | + if (!function_exists('curl_reset')) { |
|
235 | + $this->curlHandle = curl_init(); |
|
236 | + } else { |
|
237 | + curl_reset($this->curlHandle); |
|
238 | + } |
|
238 | 239 | |
239 | 240 | curl_setopt($this->curlHandle, CURLOPT_URL, $url); |
240 | 241 | curl_setopt($this->curlHandle, CURLOPT_CUSTOMREQUEST, $method); |
@@ -271,8 +272,10 @@ discard block |
||
271 | 272 | $headers = explode("\n", $headers); |
272 | 273 | $parsedHeaders = array(); |
273 | 274 | foreach ($headers as $i=>$header) { |
274 | - if ($i==0) |
|
275 | - continue; // Skip first line (http code). |
|
275 | + if ($i==0) { |
|
276 | + continue; |
|
277 | + } |
|
278 | + // Skip first line (http code). |
|
276 | 279 | $pos = strpos($header, ':'); |
277 | 280 | if ($pos!=false) { |
278 | 281 | $headerName = trim(strtolower(substr($header, 0, $pos))); |
@@ -424,14 +427,17 @@ discard block |
||
424 | 427 | */ |
425 | 428 | private function getAccessTokenByRefreshToken() |
426 | 429 | { |
427 | - if (!isset($this->authCredentials['client_id'])) |
|
428 | - throw new Exception('OAuth 2.0 client ID is not set'); |
|
430 | + if (!isset($this->authCredentials['client_id'])) { |
|
431 | + throw new Exception('OAuth 2.0 client ID is not set'); |
|
432 | + } |
|
429 | 433 | |
430 | - if (!isset($this->authCredentials['client_secret'])) |
|
431 | - throw new Exception('OAuth 2.0 client secret is not set'); |
|
434 | + if (!isset($this->authCredentials['client_secret'])) { |
|
435 | + throw new Exception('OAuth 2.0 client secret is not set'); |
|
436 | + } |
|
432 | 437 | |
433 | - if (!isset($this->authCredentials['refresh_token'])) |
|
434 | - throw new Exception('Refresh token is not set'); |
|
438 | + if (!isset($this->authCredentials['refresh_token'])) { |
|
439 | + throw new Exception('Refresh token is not set'); |
|
440 | + } |
|
435 | 441 | |
436 | 442 | $clientId = $this->authCredentials['client_id']; |
437 | 443 | $clientSecret = $this->authCredentials['client_secret']; |