@@ -108,7 +108,7 @@ |
||
108 | 108 | |
109 | 109 | $result = $this->connection()->get($this->url(), $request, $headers); |
110 | 110 | |
111 | - if (! empty($divisionId)) { |
|
111 | + if ( ! empty($divisionId)) { |
|
112 | 112 | $this->connection()->setDivision($originalDivision); // Restore division |
113 | 113 | } |
114 | 114 |
@@ -206,7 +206,7 @@ discard block |
||
206 | 206 | */ |
207 | 207 | public function exists() |
208 | 208 | { |
209 | - if (! array_key_exists($this->primaryKey, $this->attributes)) { |
|
209 | + if ( ! array_key_exists($this->primaryKey, $this->attributes)) { |
|
210 | 210 | return false; |
211 | 211 | } |
212 | 212 | |
@@ -231,7 +231,7 @@ discard block |
||
231 | 231 | |
232 | 232 | $attributes[$attribute] = []; |
233 | 233 | foreach ($collection as $value) { |
234 | - if (! empty($value->deferred)) { |
|
234 | + if ( ! empty($value->deferred)) { |
|
235 | 235 | $value->attributes = array_merge($value->attributes, $value->deferred); |
236 | 236 | } |
237 | 237 |
@@ -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 | } |