@@ -166,12 +166,12 @@ |
||
| 166 | 166 | } |
| 167 | 167 | |
| 168 | 168 | // If access token is not set or token has expired, acquire new token |
| 169 | - if (empty($this->accessToken)){ |
|
| 170 | - $this->acquireAccessToken(); |
|
| 171 | - }else if($this->tokenHasExpired()){ |
|
| 172 | - return 'expired'; |
|
| 173 | - /*throw new Exception("token is expired and need to update");*/ |
|
| 174 | - } |
|
| 169 | + if (empty($this->accessToken)){ |
|
| 170 | + $this->acquireAccessToken(); |
|
| 171 | + }else if($this->tokenHasExpired()){ |
|
| 172 | + return 'expired'; |
|
| 173 | + /*throw new Exception("token is expired and need to update");*/ |
|
| 174 | + } |
|
| 175 | 175 | |
| 176 | 176 | $client = $this->client(); |
| 177 | 177 | |
@@ -166,9 +166,9 @@ discard block |
||
| 166 | 166 | } |
| 167 | 167 | |
| 168 | 168 | // If access token is not set or token has expired, acquire new token |
| 169 | - if (empty($this->accessToken)){ |
|
| 169 | + if (empty($this->accessToken)) { |
|
| 170 | 170 | $this->acquireAccessToken(); |
| 171 | - }else if($this->tokenHasExpired()){ |
|
| 171 | + } else if ($this->tokenHasExpired()) { |
|
| 172 | 172 | return 'expired'; |
| 173 | 173 | /*throw new Exception("token is expired and need to update");*/ |
| 174 | 174 | } |
@@ -202,12 +202,12 @@ discard block |
||
| 202 | 202 | } |
| 203 | 203 | |
| 204 | 204 | // If we have a token, sign the request |
| 205 | - if (! $this->needsAuthentication() && ! empty($this->accessToken)) { |
|
| 205 | + if ( ! $this->needsAuthentication() && ! empty($this->accessToken)) { |
|
| 206 | 206 | $headers['Authorization'] = 'Bearer ' . $this->accessToken; |
| 207 | 207 | } |
| 208 | 208 | |
| 209 | 209 | // Create param string |
| 210 | - if (! empty($params)) { |
|
| 210 | + if ( ! empty($params)) { |
|
| 211 | 211 | $endpoint .= '?' . http_build_query($params); |
| 212 | 212 | } |
| 213 | 213 | |
@@ -518,7 +518,7 @@ discard block |
||
| 518 | 518 | */ |
| 519 | 519 | private function getTimestampFromExpiresIn($expiresIn) |
| 520 | 520 | { |
| 521 | - if (! ctype_digit($expiresIn)) { |
|
| 521 | + if ( ! ctype_digit($expiresIn)) { |
|
| 522 | 522 | throw new \InvalidArgumentException('Function requires a numeric expires value'); |
| 523 | 523 | } |
| 524 | 524 | |
@@ -619,7 +619,7 @@ discard block |
||
| 619 | 619 | */ |
| 620 | 620 | private function parseExceptionForErrorMessages(Exception $e) |
| 621 | 621 | { |
| 622 | - if (! $e instanceof BadResponseException) { |
|
| 622 | + if ( ! $e instanceof BadResponseException) { |
|
| 623 | 623 | throw new ApiException($e->getMessage(), 0, $e); |
| 624 | 624 | } |
| 625 | 625 | |
@@ -631,7 +631,7 @@ discard block |
||
| 631 | 631 | $responseBody = $response->getBody()->getContents(); |
| 632 | 632 | $decodedResponseBody = json_decode($responseBody, true); |
| 633 | 633 | |
| 634 | - if (! is_null($decodedResponseBody) && isset($decodedResponseBody['error']['message']['value'])) { |
|
| 634 | + if ( ! is_null($decodedResponseBody) && isset($decodedResponseBody['error']['message']['value'])) { |
|
| 635 | 635 | $errorMessage = $decodedResponseBody['error']['message']['value']; |
| 636 | 636 | } else { |
| 637 | 637 | $errorMessage = $responseBody; |
@@ -168,7 +168,7 @@ |
||
| 168 | 168 | // If access token is not set or token has expired, acquire new token |
| 169 | 169 | if (empty($this->accessToken)){ |
| 170 | 170 | $this->acquireAccessToken(); |
| 171 | - }else if($this->tokenHasExpired()){ |
|
| 171 | + } else if($this->tokenHasExpired()){ |
|
| 172 | 172 | return 'expired'; |
| 173 | 173 | /*throw new Exception("token is expired and need to update");*/ |
| 174 | 174 | } |