@@ -17,14 +17,14 @@ discard block |
||
| 17 | 17 | use WebMarketingROI\OptimizelyPHP\Resource\v2\Audience; |
| 18 | 18 | |
| 19 | 19 | // Init class autloading. |
| 20 | -include dirname(__FILE__) . '/../../vendor/autoload.php'; |
|
| 20 | +include dirname(__FILE__).'/../../vendor/autoload.php'; |
|
| 21 | 21 | |
| 22 | 22 | // Include Utils.php - a file containing helper functions |
| 23 | -include dirname(__FILE__) . '/../Utils.php'; |
|
| 23 | +include dirname(__FILE__).'/../Utils.php'; |
|
| 24 | 24 | |
| 25 | 25 | // Read project ID from command line. |
| 26 | -if ($argc!=2) { |
|
| 27 | - die('Expected 1 command-line argument, while got ' . $argc-1); |
|
| 26 | +if ($argc != 2) { |
|
| 27 | + die('Expected 1 command-line argument, while got '.$argc - 1); |
|
| 28 | 28 | } |
| 29 | 29 | |
| 30 | 30 | $projectId = $argv[1]; |
@@ -59,6 +59,6 @@ discard block |
||
| 59 | 59 | |
| 60 | 60 | // Save access token for later use |
| 61 | 61 | $accessToken = $optimizelyClient->getAccessToken(); |
| 62 | -file_put_contents(dirname(__FILE__) . '/../access_token.json', json_encode($accessToken)); |
|
| 62 | +file_put_contents(dirname(__FILE__).'/../access_token.json', json_encode($accessToken)); |
|
| 63 | 63 | |
| 64 | 64 | echo "Done!\n"; |
@@ -16,14 +16,14 @@ discard block |
||
| 16 | 16 | use WebMarketingROI\OptimizelyPHP\Exception; |
| 17 | 17 | |
| 18 | 18 | // Init class autloading. |
| 19 | -include dirname(__FILE__) . '/../../vendor/autoload.php'; |
|
| 19 | +include dirname(__FILE__).'/../../vendor/autoload.php'; |
|
| 20 | 20 | |
| 21 | 21 | // Include Utils.php - a file containing helper functions |
| 22 | -include dirname(__FILE__) . '/../Utils.php'; |
|
| 22 | +include dirname(__FILE__).'/../Utils.php'; |
|
| 23 | 23 | |
| 24 | 24 | // Read project ID from command line. |
| 25 | -if ($argc!=2) { |
|
| 26 | - die('Expected 1 command-line argument, while got ' . $argc-1); |
|
| 25 | +if ($argc != 2) { |
|
| 26 | + die('Expected 1 command-line argument, while got '.$argc - 1); |
|
| 27 | 27 | } |
| 28 | 28 | $projectId = $argv[1]; |
| 29 | 29 | |
@@ -47,17 +47,17 @@ discard block |
||
| 47 | 47 | $audiences = $result->getPayload(); |
| 48 | 48 | |
| 49 | 49 | foreach ($audiences as $audience) { |
| 50 | - echo "Name: " . $audience->getName() . "\n"; |
|
| 51 | - echo "Conditions: " . $audience->getConditions() . "\n"; |
|
| 50 | + echo "Name: ".$audience->getName()."\n"; |
|
| 51 | + echo "Conditions: ".$audience->getConditions()."\n"; |
|
| 52 | 52 | echo "\n"; |
| 53 | 53 | } |
| 54 | 54 | |
| 55 | 55 | // Determine if there are more audiences. |
| 56 | - if ($result->getNextPage()==null) |
|
| 56 | + if ($result->getNextPage() == null) |
|
| 57 | 57 | break; |
| 58 | 58 | |
| 59 | 59 | // Increment page counter. |
| 60 | - $page ++; |
|
| 60 | + $page++; |
|
| 61 | 61 | } |
| 62 | 62 | |
| 63 | 63 | } catch (Exception $e) { |
@@ -71,6 +71,6 @@ discard block |
||
| 71 | 71 | |
| 72 | 72 | // Save access token for later use |
| 73 | 73 | $accessToken = $optimizelyClient->getAccessToken(); |
| 74 | -file_put_contents(dirname(__FILE__) . '/../access_token.json', json_encode($accessToken)); |
|
| 74 | +file_put_contents(dirname(__FILE__).'/../access_token.json', json_encode($accessToken)); |
|
| 75 | 75 | |
| 76 | 76 | echo "Done!\n"; |
@@ -53,8 +53,9 @@ |
||
| 53 | 53 | } |
| 54 | 54 | |
| 55 | 55 | // Determine if there are more audiences. |
| 56 | - if ($result->getNextPage()==null) |
|
| 57 | - break; |
|
| 56 | + if ($result->getNextPage()==null) { |
|
| 57 | + break; |
|
| 58 | + } |
|
| 58 | 59 | |
| 59 | 60 | // Increment page counter. |
| 60 | 61 | $page ++; |