@@ -41,7 +41,7 @@ discard block |
||
| 41 | 41 | } |
| 42 | 42 | case 'page_id': $this->setPageId($value); break; |
| 43 | 43 | default: |
| 44 | - throw new \Exception('Unknown option: ' . $name); |
|
| 44 | + throw new \Exception('Unknown option: '.$name); |
|
| 45 | 45 | } |
| 46 | 46 | } |
| 47 | 47 | } |
@@ -63,7 +63,7 @@ discard block |
||
| 63 | 63 | // Remove options with empty values |
| 64 | 64 | $cleanedOptions = array(); |
| 65 | 65 | foreach ($options as $name=>$value) { |
| 66 | - if ($value!==null) |
|
| 66 | + if ($value !== null) |
|
| 67 | 67 | $cleanedOptions[$name] = $value; |
| 68 | 68 | } |
| 69 | 69 | |
@@ -91,8 +91,9 @@ |
||
| 91 | 91 | // Remove options with empty values |
| 92 | 92 | $cleanedOptions = array(); |
| 93 | 93 | foreach ($options as $name=>$value) { |
| 94 | - if ($value!==null) |
|
| 95 | - $cleanedOptions[$name] = $value; |
|
| 94 | + if ($value!==null) { |
|
| 95 | + $cleanedOptions[$name] = $value; |
|
| 96 | + } |
|
| 96 | 97 | } |
| 97 | 98 | |
| 98 | 99 | return $cleanedOptions; |
@@ -82,7 +82,7 @@ discard block |
||
| 82 | 82 | case 'id': $this->setId($value); break; |
| 83 | 83 | case 'last_modified': $this->setLastModified($value); break; |
| 84 | 84 | default: |
| 85 | - throw new \Exception('Unknown option: ' . $name); |
|
| 85 | + throw new \Exception('Unknown option: '.$name); |
|
| 86 | 86 | } |
| 87 | 87 | } |
| 88 | 88 | } |
@@ -107,7 +107,7 @@ discard block |
||
| 107 | 107 | // Remove options with empty values |
| 108 | 108 | $cleanedOptions = array(); |
| 109 | 109 | foreach ($options as $name=>$value) { |
| 110 | - if ($value!==null) |
|
| 110 | + if ($value !== null) |
|
| 111 | 111 | $cleanedOptions[$name] = $value; |
| 112 | 112 | } |
| 113 | 113 | |
@@ -91,8 +91,9 @@ |
||
| 91 | 91 | // Remove options with empty values |
| 92 | 92 | $cleanedOptions = array(); |
| 93 | 93 | foreach ($options as $name=>$value) { |
| 94 | - if ($value!==null) |
|
| 95 | - $cleanedOptions[$name] = $value; |
|
| 94 | + if ($value!==null) { |
|
| 95 | + $cleanedOptions[$name] = $value; |
|
| 96 | + } |
|
| 96 | 97 | } |
| 97 | 98 | |
| 98 | 99 | return $cleanedOptions; |
@@ -70,7 +70,7 @@ discard block |
||
| 70 | 70 | case 'variation_id': $this->setVariationId($value); break; |
| 71 | 71 | case 'weight': $this->setWeight($value); break; |
| 72 | 72 | default: |
| 73 | - throw new \Exception('Unknown option: ' . $name); |
|
| 73 | + throw new \Exception('Unknown option: '.$name); |
|
| 74 | 74 | } |
| 75 | 75 | } |
| 76 | 76 | } |
@@ -96,7 +96,7 @@ discard block |
||
| 96 | 96 | // Remove options with empty values |
| 97 | 97 | $cleanedOptions = array(); |
| 98 | 98 | foreach ($options as $name=>$value) { |
| 99 | - if ($value!==null) |
|
| 99 | + if ($value !== null) |
|
| 100 | 100 | $cleanedOptions[$name] = $value; |
| 101 | 101 | } |
| 102 | 102 | |
@@ -91,8 +91,9 @@ |
||
| 91 | 91 | // Remove options with empty values |
| 92 | 92 | $cleanedOptions = array(); |
| 93 | 93 | foreach ($options as $name=>$value) { |
| 94 | - if ($value!==null) |
|
| 95 | - $cleanedOptions[$name] = $value; |
|
| 94 | + if ($value!==null) { |
|
| 95 | + $cleanedOptions[$name] = $value; |
|
| 96 | + } |
|
| 96 | 97 | } |
| 97 | 98 | |
| 98 | 99 | return $cleanedOptions; |
@@ -33,7 +33,7 @@ discard block |
||
| 33 | 33 | case 'filter_type': $this->setFilterType($value); break; |
| 34 | 34 | case 'selector': $this->setSelector($value); break; |
| 35 | 35 | default: |
| 36 | - throw new \Exception('Unknown option: ' . $name); |
|
| 36 | + throw new \Exception('Unknown option: '.$name); |
|
| 37 | 37 | } |
| 38 | 38 | } |
| 39 | 39 | } |
@@ -51,7 +51,7 @@ discard block |
||
| 51 | 51 | // Remove options with empty values |
| 52 | 52 | $cleanedOptions = array(); |
| 53 | 53 | foreach ($options as $name=>$value) { |
| 54 | - if ($value!==null) |
|
| 54 | + if ($value !== null) |
|
| 55 | 55 | $cleanedOptions[$name] = $value; |
| 56 | 56 | } |
| 57 | 57 | |
@@ -91,8 +91,9 @@ |
||
| 91 | 91 | // Remove options with empty values |
| 92 | 92 | $cleanedOptions = array(); |
| 93 | 93 | foreach ($options as $name=>$value) { |
| 94 | - if ($value!==null) |
|
| 95 | - $cleanedOptions[$name] = $value; |
|
| 94 | + if ($value!==null) { |
|
| 95 | + $cleanedOptions[$name] = $value; |
|
| 96 | + } |
|
| 96 | 97 | } |
| 97 | 98 | |
| 98 | 99 | return $cleanedOptions; |
@@ -70,7 +70,7 @@ discard block |
||
| 70 | 70 | break; |
| 71 | 71 | } |
| 72 | 72 | default: |
| 73 | - throw new \Exception('Unknown option: ' . $name); |
|
| 73 | + throw new \Exception('Unknown option: '.$name); |
|
| 74 | 74 | } |
| 75 | 75 | } |
| 76 | 76 | } |
@@ -96,7 +96,7 @@ discard block |
||
| 96 | 96 | // Remove options with empty values |
| 97 | 97 | $cleanedOptions = array(); |
| 98 | 98 | foreach ($options as $name=>$value) { |
| 99 | - if ($value!==null) |
|
| 99 | + if ($value !== null) |
|
| 100 | 100 | $cleanedOptions[$name] = $value; |
| 101 | 101 | } |
| 102 | 102 | |
@@ -91,8 +91,9 @@ |
||
| 91 | 91 | // Remove options with empty values |
| 92 | 92 | $cleanedOptions = array(); |
| 93 | 93 | foreach ($options as $name=>$value) { |
| 94 | - if ($value!==null) |
|
| 95 | - $cleanedOptions[$name] = $value; |
|
| 94 | + if ($value!==null) { |
|
| 95 | + $cleanedOptions[$name] = $value; |
|
| 96 | + } |
|
| 96 | 97 | } |
| 97 | 98 | |
| 98 | 99 | return $cleanedOptions; |
@@ -133,7 +133,7 @@ discard block |
||
| 133 | 133 | case 'type': $this->setType($value); break; |
| 134 | 134 | case 'id': $this->setId($value); break; |
| 135 | 135 | default: |
| 136 | - throw new \Exception('Unknown option: ' . $name); |
|
| 136 | + throw new \Exception('Unknown option: '.$name); |
|
| 137 | 137 | } |
| 138 | 138 | } |
| 139 | 139 | } |
@@ -171,7 +171,7 @@ discard block |
||
| 171 | 171 | // Remove options with empty values |
| 172 | 172 | $cleanedOptions = array(); |
| 173 | 173 | foreach ($options as $name=>$value) { |
| 174 | - if ($value!==null) |
|
| 174 | + if ($value !== null) |
|
| 175 | 175 | $cleanedOptions[$name] = $value; |
| 176 | 176 | } |
| 177 | 177 | |
@@ -91,8 +91,9 @@ |
||
| 91 | 91 | // Remove options with empty values |
| 92 | 92 | $cleanedOptions = array(); |
| 93 | 93 | foreach ($options as $name=>$value) { |
| 94 | - if ($value!==null) |
|
| 95 | - $cleanedOptions[$name] = $value; |
|
| 94 | + if ($value!==null) { |
|
| 95 | + $cleanedOptions[$name] = $value; |
|
| 96 | + } |
|
| 96 | 97 | } |
| 97 | 98 | |
| 98 | 99 | return $cleanedOptions; |
@@ -47,7 +47,7 @@ discard block |
||
| 47 | 47 | case 'variation_id': $this->setVariationId($value); break; |
| 48 | 48 | case 'variation_reach': $this->setVariationReach($value); break; |
| 49 | 49 | default: |
| 50 | - throw new \Exception('Unknown option: ' . $name); |
|
| 50 | + throw new \Exception('Unknown option: '.$name); |
|
| 51 | 51 | } |
| 52 | 52 | } |
| 53 | 53 | } |
@@ -67,7 +67,7 @@ discard block |
||
| 67 | 67 | // Remove options with empty values |
| 68 | 68 | $cleanedOptions = array(); |
| 69 | 69 | foreach ($options as $name=>$value) { |
| 70 | - if ($value!==null) |
|
| 70 | + if ($value !== null) |
|
| 71 | 71 | $cleanedOptions[$name] = $value; |
| 72 | 72 | } |
| 73 | 73 | |
@@ -91,8 +91,9 @@ |
||
| 91 | 91 | // Remove options with empty values |
| 92 | 92 | $cleanedOptions = array(); |
| 93 | 93 | foreach ($options as $name=>$value) { |
| 94 | - if ($value!==null) |
|
| 95 | - $cleanedOptions[$name] = $value; |
|
| 94 | + if ($value!==null) { |
|
| 95 | + $cleanedOptions[$name] = $value; |
|
| 96 | + } |
|
| 96 | 97 | } |
| 97 | 98 | |
| 98 | 99 | return $cleanedOptions; |
@@ -33,7 +33,7 @@ discard block |
||
| 33 | 33 | case 'kind': $this->setKind($value); break; |
| 34 | 34 | case 'id': $this->setId($value); break; |
| 35 | 35 | default: |
| 36 | - throw new \Exception('Unknown option: ' . $name); |
|
| 36 | + throw new \Exception('Unknown option: '.$name); |
|
| 37 | 37 | } |
| 38 | 38 | } |
| 39 | 39 | } |
@@ -51,7 +51,7 @@ discard block |
||
| 51 | 51 | // Remove options with empty values |
| 52 | 52 | $cleanedOptions = array(); |
| 53 | 53 | foreach ($options as $name=>$value) { |
| 54 | - if ($value!==null) |
|
| 54 | + if ($value !== null) |
|
| 55 | 55 | $cleanedOptions[$name] = $value; |
| 56 | 56 | } |
| 57 | 57 | |
@@ -91,8 +91,9 @@ |
||
| 91 | 91 | // Remove options with empty values |
| 92 | 92 | $cleanedOptions = array(); |
| 93 | 93 | foreach ($options as $name=>$value) { |
| 94 | - if ($value!==null) |
|
| 95 | - $cleanedOptions[$name] = $value; |
|
| 94 | + if ($value!==null) { |
|
| 95 | + $cleanedOptions[$name] = $value; |
|
| 96 | + } |
|
| 96 | 97 | } |
| 97 | 98 | |
| 98 | 99 | return $cleanedOptions; |
@@ -16,14 +16,14 @@ discard block |
||
| 16 | 16 | use WebMarketingROI\OptimizelyPHP\Resource\v2\Project; |
| 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 | |
@@ -44,11 +44,11 @@ discard block |
||
| 44 | 44 | $createdProject = $optimizelyClient->projects()->create($project); |
| 45 | 45 | |
| 46 | 46 | } catch (\Exception $e) { |
| 47 | - echo "Exception caught: " . $e->getMessage() . "\n"; |
|
| 47 | + echo "Exception caught: ".$e->getMessage()."\n"; |
|
| 48 | 48 | } |
| 49 | 49 | |
| 50 | 50 | // Save access token for later use |
| 51 | 51 | $accessToken = $optimizelyClient->getAccessToken(); |
| 52 | -file_put_contents(dirname(__FILE__) . '/../access_token.json', json_encode($accessToken)); |
|
| 52 | +file_put_contents(dirname(__FILE__).'/../access_token.json', json_encode($accessToken)); |
|
| 53 | 53 | |
| 54 | 54 | echo "Done!\n"; |
| 55 | 55 | \ No newline at end of file |