@@ -231,8 +231,9 @@ discard block |
||
231 | 231 | |
232 | 232 | public function testIntegration() |
233 | 233 | { |
234 | - if (!getenv('OPTIMIZELY_PHP_TEST_INTEGRATION')) |
|
235 | - $this->markTestSkipped('OPTIMIZELY_PHP_TEST_INTEGRATION env var is not set'); |
|
234 | + if (!getenv('OPTIMIZELY_PHP_TEST_INTEGRATION')) { |
|
235 | + $this->markTestSkipped('OPTIMIZELY_PHP_TEST_INTEGRATION env var is not set'); |
|
236 | + } |
|
236 | 237 | |
237 | 238 | $credentials = $this->loadCredentialsFromFile(); |
238 | 239 | |
@@ -284,8 +285,9 @@ discard block |
||
284 | 285 | } |
285 | 286 | } |
286 | 287 | |
287 | - if ($result->getNextPage()==null) |
|
288 | - break; |
|
288 | + if ($result->getNextPage()==null) { |
|
289 | + break; |
|
290 | + } |
|
289 | 291 | |
290 | 292 | $page ++; |
291 | 293 | } |
@@ -55,8 +55,9 @@ |
||
55 | 55 | } |
56 | 56 | |
57 | 57 | // Determine if there are more projects. |
58 | - if ($result->getNextPage()==null) |
|
59 | - break; |
|
58 | + if ($result->getNextPage()==null) { |
|
59 | + break; |
|
60 | + } |
|
60 | 61 | |
61 | 62 | // Increment page counter. |
62 | 63 | $page ++; |
@@ -56,8 +56,9 @@ |
||
56 | 56 | } |
57 | 57 | |
58 | 58 | // Determine if there are more projects. |
59 | - if ($result->getNextPage()==null) |
|
60 | - break; |
|
59 | + if ($result->getNextPage()==null) { |
|
60 | + break; |
|
61 | + } |
|
61 | 62 | |
62 | 63 | // Increment page counter. |
63 | 64 | $page ++; |
@@ -265,8 +265,10 @@ discard block |
||
265 | 265 | $headers = explode("\n", $headers); |
266 | 266 | $parsedHeaders = array(); |
267 | 267 | foreach ($headers as $i=>$header) { |
268 | - if ($i==0) |
|
269 | - continue; // Skip first line (http code). |
|
268 | + if ($i==0) { |
|
269 | + continue; |
|
270 | + } |
|
271 | + // Skip first line (http code). |
|
270 | 272 | $pos = strpos($header, ':'); |
271 | 273 | if ($pos!=false) { |
272 | 274 | $headerName = trim(strtolower(substr($header, 0, $pos))); |
@@ -419,14 +421,17 @@ discard block |
||
419 | 421 | */ |
420 | 422 | private function getAccessTokenByRefreshToken() |
421 | 423 | { |
422 | - if (!isset($this->authCredentials['client_id'])) |
|
423 | - throw new Exception('OAuth 2.0 client ID is not set'); |
|
424 | + if (!isset($this->authCredentials['client_id'])) { |
|
425 | + throw new Exception('OAuth 2.0 client ID is not set'); |
|
426 | + } |
|
424 | 427 | |
425 | - if (!isset($this->authCredentials['client_secret'])) |
|
426 | - throw new Exception('OAuth 2.0 client secret is not set'); |
|
428 | + if (!isset($this->authCredentials['client_secret'])) { |
|
429 | + throw new Exception('OAuth 2.0 client secret is not set'); |
|
430 | + } |
|
427 | 431 | |
428 | - if (!isset($this->authCredentials['refresh_token'])) |
|
429 | - throw new Exception('Refresh token is not set'); |
|
432 | + if (!isset($this->authCredentials['refresh_token'])) { |
|
433 | + throw new Exception('Refresh token is not set'); |
|
434 | + } |
|
430 | 435 | |
431 | 436 | $clientId = $this->authCredentials['client_id']; |
432 | 437 | $clientSecret = $this->authCredentials['client_secret']; |
@@ -55,20 +55,25 @@ |
||
55 | 55 | { |
56 | 56 | parent::__construct($message, $code); |
57 | 57 | |
58 | - if (isset($options['http_code'])) |
|
59 | - $this->setHttpCode($options['http_code']); |
|
58 | + if (isset($options['http_code'])) { |
|
59 | + $this->setHttpCode($options['http_code']); |
|
60 | + } |
|
60 | 61 | |
61 | - if (isset($options['uuid'])) |
|
62 | - $this->setUuid($options['uuid']); |
|
62 | + if (isset($options['uuid'])) { |
|
63 | + $this->setUuid($options['uuid']); |
|
64 | + } |
|
63 | 65 | |
64 | - if (isset($options['rate_limit'])) |
|
65 | - $this->setRateLimit($options['rate_limit']); |
|
66 | + if (isset($options['rate_limit'])) { |
|
67 | + $this->setRateLimit($options['rate_limit']); |
|
68 | + } |
|
66 | 69 | |
67 | - if (isset($options['rate_limit_remaining'])) |
|
68 | - $this->setRateLimitRemaining($options['rate_limit_remaining']); |
|
70 | + if (isset($options['rate_limit_remaining'])) { |
|
71 | + $this->setRateLimitRemaining($options['rate_limit_remaining']); |
|
72 | + } |
|
69 | 73 | |
70 | - if (isset($options['rate_limit_reset'])) |
|
71 | - $this->setRateLimitReset($options['rate_limit_reset']); |
|
74 | + if (isset($options['rate_limit_reset'])) { |
|
75 | + $this->setRateLimitReset($options['rate_limit_reset']); |
|
76 | + } |
|
72 | 77 | } |
73 | 78 | |
74 | 79 | /** |