@@ -35,13 +35,13 @@ discard block |
||
| 35 | 35 | * @return Result |
| 36 | 36 | * @throws Exception |
| 37 | 37 | */ |
| 38 | - public function listAll($page=1, $perPage=25) |
|
| 38 | + public function listAll($page = 1, $perPage = 25) |
|
| 39 | 39 | { |
| 40 | - if ($page<0) { |
|
| 40 | + if ($page < 0) { |
|
| 41 | 41 | throw new Exception('Invalid page number passed'); |
| 42 | 42 | } |
| 43 | 43 | |
| 44 | - if ($perPage<0 || $perPage>100) { |
|
| 44 | + if ($perPage < 0 || $perPage > 100) { |
|
| 45 | 45 | throw new Exception('Invalid page size passed'); |
| 46 | 46 | } |
| 47 | 47 | |
@@ -69,7 +69,7 @@ discard block |
||
| 69 | 69 | */ |
| 70 | 70 | public function get($projectId) |
| 71 | 71 | { |
| 72 | - $projectId = (string)$projectId; |
|
| 72 | + $projectId = (string) $projectId; |
|
| 73 | 73 | |
| 74 | 74 | if (!preg_match('/^\d+$/', $projectId)) { |
| 75 | 75 | throw new Exception("A positive integer project ID expected, while got $projectId"); |
@@ -114,13 +114,13 @@ discard block |
||
| 114 | 114 | */ |
| 115 | 115 | public function update($projectId, $project) |
| 116 | 116 | { |
| 117 | - $projectId = (string)$projectId; |
|
| 117 | + $projectId = (string) $projectId; |
|
| 118 | 118 | |
| 119 | 119 | if (!preg_match('/\d+/', $projectId)) { |
| 120 | 120 | throw new Exception("A positive integer project ID expected, while got $projectId"); |
| 121 | 121 | } |
| 122 | 122 | |
| 123 | - if ($projectId<0) { |
|
| 123 | + if ($projectId < 0) { |
|
| 124 | 124 | throw new Exception("A positive project ID expected"); |
| 125 | 125 | } |
| 126 | 126 | |
@@ -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; |
@@ -76,7 +76,7 @@ discard block |
||
| 76 | 76 | case 'visitors_remaining': $this->setVisitorsRemaining($value); break; |
| 77 | 77 | case 'lift_status': $this->setLiftStatus($value); break; |
| 78 | 78 | default: |
| 79 | - throw new Exception('Unknown option found in the Datapoint entity: ' . $name); |
|
| 79 | + throw new Exception('Unknown option found in the Datapoint entity: '.$name); |
|
| 80 | 80 | } |
| 81 | 81 | } |
| 82 | 82 | } |
@@ -99,7 +99,7 @@ discard block |
||
| 99 | 99 | // Remove options with empty values |
| 100 | 100 | $cleanedOptions = array(); |
| 101 | 101 | foreach ($options as $name=>$value) { |
| 102 | - if ($value!==null) |
|
| 102 | + if ($value !== null) |
|
| 103 | 103 | $cleanedOptions[$name] = $value; |
| 104 | 104 | } |
| 105 | 105 | |
@@ -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; |
@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | case 'page_id': $this->setPageId($value); break; |
| 50 | 50 | case 'share_link': $this->setShareLink($value); break; |
| 51 | 51 | default: |
| 52 | - throw new Exception('Unknown option found in the Action entity: ' . $name); |
|
| 52 | + throw new Exception('Unknown option found in the Action entity: '.$name); |
|
| 53 | 53 | } |
| 54 | 54 | } |
| 55 | 55 | } |
@@ -72,7 +72,7 @@ discard block |
||
| 72 | 72 | // Remove options with empty values |
| 73 | 73 | $cleanedOptions = array(); |
| 74 | 74 | foreach ($options as $name=>$value) { |
| 75 | - if ($value!==null) |
|
| 75 | + if ($value !== null) |
|
| 76 | 76 | $cleanedOptions[$name] = $value; |
| 77 | 77 | } |
| 78 | 78 | |
@@ -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; |
@@ -63,9 +63,9 @@ discard block |
||
| 63 | 63 | case 'aggregator': $this->setAggregator($value); break; |
| 64 | 64 | case 'field': $this->setField($value); break; |
| 65 | 65 | case 'scope': $this->setScope($value); break; |
| 66 | - case 'winning_direction' : $this->setWinningDirection($value); break; |
|
| 66 | + case 'winning_direction' : $this->setWinningDirection($value); break; |
|
| 67 | 67 | default: |
| 68 | - throw new Exception('Unknown option found in the Metric entity: ' . $name); |
|
| 68 | + throw new Exception('Unknown option found in the Metric entity: '.$name); |
|
| 69 | 69 | } |
| 70 | 70 | } |
| 71 | 71 | } |
@@ -86,7 +86,7 @@ discard block |
||
| 86 | 86 | // Remove options with empty values |
| 87 | 87 | $cleanedOptions = array(); |
| 88 | 88 | foreach ($options as $name=>$value) { |
| 89 | - if ($value!==null) |
|
| 89 | + if ($value !== null) |
|
| 90 | 90 | $cleanedOptions[$name] = $value; |
| 91 | 91 | } |
| 92 | 92 | |
@@ -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; |
@@ -85,7 +85,7 @@ discard block |
||
| 85 | 85 | case 'status': $this->setStatus($value); break; |
| 86 | 86 | case 'description': $this->setDescription($value); break; |
| 87 | 87 | default: |
| 88 | - throw new Exception('Unknown option found in the Variation entity: ' . $name); |
|
| 88 | + throw new Exception('Unknown option found in the Variation entity: '.$name); |
|
| 89 | 89 | } |
| 90 | 90 | } |
| 91 | 91 | } |
@@ -113,7 +113,7 @@ discard block |
||
| 113 | 113 | // Remove options with empty values |
| 114 | 114 | $cleanedOptions = array(); |
| 115 | 115 | foreach ($options as $name=>$value) { |
| 116 | - if ($value!==null) |
|
| 116 | + if ($value !== null) |
|
| 117 | 117 | $cleanedOptions[$name] = $value; |
| 118 | 118 | } |
| 119 | 119 | |
@@ -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; |
@@ -316,6 +316,9 @@ discard block |
||
| 316 | 316 | return $this->attributes; |
| 317 | 317 | } |
| 318 | 318 | |
| 319 | + /** |
|
| 320 | + * @param ChangeAttribute $attributes |
|
| 321 | + */ |
|
| 319 | 322 | public function setAttributes($attributes) |
| 320 | 323 | { |
| 321 | 324 | $this->attributes = $attributes; |
@@ -326,6 +329,9 @@ discard block |
||
| 326 | 329 | return $this->rearrange; |
| 327 | 330 | } |
| 328 | 331 | |
| 332 | + /** |
|
| 333 | + * @param string $rearrange |
|
| 334 | + */ |
|
| 329 | 335 | public function setRearrange($rearrange) |
| 330 | 336 | { |
| 331 | 337 | $this->rearrange = $rearrange; |
@@ -346,6 +352,9 @@ discard block |
||
| 346 | 352 | return $this->css; |
| 347 | 353 | } |
| 348 | 354 | |
| 355 | + /** |
|
| 356 | + * @param CssAttribute $css |
|
| 357 | + */ |
|
| 349 | 358 | public function setCss($css) |
| 350 | 359 | { |
| 351 | 360 | $this->css = $css; |
@@ -161,7 +161,7 @@ discard block |
||
| 161 | 161 | case 'name': $this->setName($value); break; |
| 162 | 162 | case 'operator': $this->setOperator($value); break; |
| 163 | 163 | default: |
| 164 | - throw new Exception('Unknown option found in the Change entity: ' . $name); |
|
| 164 | + throw new Exception('Unknown option found in the Change entity: '.$name); |
|
| 165 | 165 | } |
| 166 | 166 | } |
| 167 | 167 | } |
@@ -183,10 +183,10 @@ discard block |
||
| 183 | 183 | 'value' => $this->getValue(), |
| 184 | 184 | 'id' => $this->getId(), |
| 185 | 185 | 'selector' => $this->getSelector(), |
| 186 | - 'attributes' => $this->getAttributes()?$this->getAttributes()->toArray():null, |
|
| 186 | + 'attributes' => $this->getAttributes() ? $this->getAttributes()->toArray() : null, |
|
| 187 | 187 | 'rearrange' => $this->getRearrange(), |
| 188 | 188 | 'config' => $this->getConfig(), |
| 189 | - 'css' => $this->getCss()?$this->getCss()->toArray():null, |
|
| 189 | + 'css' => $this->getCss() ? $this->getCss()->toArray() : null, |
|
| 190 | 190 | 'name' => $this->getName(), |
| 191 | 191 | 'operator' => $this->getOperator(), |
| 192 | 192 | ); |
@@ -194,7 +194,7 @@ discard block |
||
| 194 | 194 | // Remove options with empty values |
| 195 | 195 | $cleanedOptions = array(); |
| 196 | 196 | foreach ($options as $name=>$value) { |
| 197 | - if ($value!==null) |
|
| 197 | + if ($value !== null) |
|
| 198 | 198 | $cleanedOptions[$name] = $value; |
| 199 | 199 | } |
| 200 | 200 | |
@@ -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; |
@@ -139,7 +139,7 @@ discard block |
||
| 139 | 139 | case 'is_editable': $this->setIsEditable($value); break; |
| 140 | 140 | case 'config': $this->setConfig(new InPageEventConfig($value)); break; |
| 141 | 141 | default: |
| 142 | - throw new Exception('Unknown option found in the Event entity: ' . $name); |
|
| 142 | + throw new Exception('Unknown option found in the Event entity: '.$name); |
|
| 143 | 143 | } |
| 144 | 144 | } |
| 145 | 145 | } |
@@ -156,7 +156,7 @@ discard block |
||
| 156 | 156 | 'created' => $this->getCreated(), |
| 157 | 157 | 'last_modified' => $this->getLastModified(), |
| 158 | 158 | 'description' => $this->getDescription(), |
| 159 | - 'event_filter' => $this->getEventFilter()?$this->getEventFilter()->toArray():null, |
|
| 159 | + 'event_filter' => $this->getEventFilter() ? $this->getEventFilter()->toArray() : null, |
|
| 160 | 160 | 'event_type' => $this->getEventType(), |
| 161 | 161 | 'key' => $this->getKey(), |
| 162 | 162 | 'name' => $this->getName(), |
@@ -165,13 +165,13 @@ discard block |
||
| 165 | 165 | 'id' => $this->getId(), |
| 166 | 166 | 'is_classic' => $this->getIsClassic(), |
| 167 | 167 | 'is_editable' => $this->getIsEditable(), |
| 168 | - 'config' => $this->getConfig()?$this->getConfig()->toArray():null, |
|
| 168 | + 'config' => $this->getConfig() ? $this->getConfig()->toArray() : null, |
|
| 169 | 169 | ); |
| 170 | 170 | |
| 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; |
@@ -109,7 +109,7 @@ discard block |
||
| 109 | 109 | case 'samples': $this->setSamples($value); break; |
| 110 | 110 | case 'variance': $this->setVariance($value); break; |
| 111 | 111 | default: |
| 112 | - throw new Exception('Unknown option found in the VariantResults entity: ' . $name); |
|
| 112 | + throw new Exception('Unknown option found in the VariantResults entity: '.$name); |
|
| 113 | 113 | } |
| 114 | 114 | } |
| 115 | 115 | } |
@@ -123,11 +123,11 @@ discard block |
||
| 123 | 123 | 'experiment_id' => $this->getExperimentId(), |
| 124 | 124 | 'is_baseline' => $this->getIsBaseline(), |
| 125 | 125 | 'level' => $this->getLevel(), |
| 126 | - 'lift' => $this->getLift()?$this->getLift()->toArray():null, |
|
| 126 | + 'lift' => $this->getLift() ? $this->getLift()->toArray() : null, |
|
| 127 | 127 | 'name' => $this->getName(), |
| 128 | 128 | 'rate' => $this->getRate(), |
| 129 | 129 | 'scope' => $this->getScope(), |
| 130 | - 'total_increase' => $this->getTotalIncrease()?$this->getTotalIncrease()->toArray():null, |
|
| 130 | + 'total_increase' => $this->getTotalIncrease() ? $this->getTotalIncrease()->toArray() : null, |
|
| 131 | 131 | 'value' => $this->getValue(), |
| 132 | 132 | 'variation_id' => $this->getVariationId(), |
| 133 | 133 | 'samples' => $this->getSamples(), |
@@ -137,7 +137,7 @@ discard block |
||
| 137 | 137 | // Remove options with empty values |
| 138 | 138 | $cleanedOptions = array(); |
| 139 | 139 | foreach ($options as $name=>$value) { |
| 140 | - if ($value!==null) |
|
| 140 | + if ($value !== null) |
|
| 141 | 141 | $cleanedOptions[$name] = $value; |
| 142 | 142 | } |
| 143 | 143 | |
@@ -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; |
@@ -88,7 +88,7 @@ discard block |
||
| 88 | 88 | } |
| 89 | 89 | case 'unit': $this->setUnit($value); break; |
| 90 | 90 | default: |
| 91 | - throw new Exception('Unknown option found in CampaignMetricResults entity: ' . $name); |
|
| 91 | + throw new Exception('Unknown option found in CampaignMetricResults entity: '.$name); |
|
| 92 | 92 | } |
| 93 | 93 | } |
| 94 | 94 | } |
@@ -115,7 +115,7 @@ discard block |
||
| 115 | 115 | // Remove options with empty values |
| 116 | 116 | $cleanedOptions = array(); |
| 117 | 117 | foreach ($options as $name=>$value) { |
| 118 | - if ($value!==null) |
|
| 118 | + if ($value !== null) |
|
| 119 | 119 | $cleanedOptions[$name] = $value; |
| 120 | 120 | } |
| 121 | 121 | |