@@ -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 |
@@ -346,6 +346,9 @@ |
||
346 | 346 | return $this->schedule; |
347 | 347 | } |
348 | 348 | |
349 | + /** |
|
350 | + * @param Schedule $schedule |
|
351 | + */ |
|
349 | 352 | public function setSchedule($schedule) |
350 | 353 | { |
351 | 354 | $this->schedule = $schedule; |
@@ -178,7 +178,7 @@ discard block |
||
178 | 178 | case 'type': $this->setType($value); break; |
179 | 179 | case 'audience_conditions': $this->setAudienceConditions($value); break; |
180 | 180 | default: |
181 | - throw new Exception('Unknown option found in the Experiment entity: ' . $name); |
|
181 | + throw new Exception('Unknown option found in the Experiment entity: '.$name); |
|
182 | 182 | } |
183 | 183 | } |
184 | 184 | } |
@@ -200,7 +200,7 @@ discard block |
||
200 | 200 | 'last_modified' => $this->getLastModified(), |
201 | 201 | 'metrics' => array(), |
202 | 202 | 'name' => $this->getName(), |
203 | - 'schedule' => $this->getSchedule()?$this->getSchedule()->toArray():null, |
|
203 | + 'schedule' => $this->getSchedule() ? $this->getSchedule()->toArray() : null, |
|
204 | 204 | 'status' => $this->getStatus(), |
205 | 205 | 'variations' => array(), |
206 | 206 | 'id' => $this->getId(), |
@@ -224,7 +224,7 @@ discard block |
||
224 | 224 | // Remove options with empty values |
225 | 225 | $cleanedOptions = array(); |
226 | 226 | foreach ($options as $name=>$value) { |
227 | - if ($value!==null) |
|
227 | + if ($value !== null) |
|
228 | 228 | $cleanedOptions[$name] = $value; |
229 | 229 | } |
230 | 230 |
@@ -1,7 +1,6 @@ |
||
1 | 1 | <?php |
2 | 2 | namespace OptimizelyPHPTest\Service\v2; |
3 | 3 | |
4 | -use PHPUnit_Framework_TestCase; |
|
5 | 4 | use WebMarketingROI\OptimizelyPHP\OptimizelyApiClient; |
6 | 5 | use WebMarketingROI\OptimizelyPHP\Result; |
7 | 6 | use WebMarketingROI\OptimizelyPHP\Service\v2\Experiments; |
@@ -24,20 +24,20 @@ discard block |
||
24 | 24 | array( |
25 | 25 | "project_id" => 1000, |
26 | 26 | "audience_ids" => array( |
27 | - 1234, |
|
28 | - 1212, |
|
29 | - 1432 |
|
27 | + 1234, |
|
28 | + 1212, |
|
29 | + 1432 |
|
30 | 30 | ), |
31 | 31 | "campaign_id" => 2000, |
32 | 32 | "changes" => array( |
33 | - array( |
|
33 | + array( |
|
34 | 34 | "type" => "custom_code", |
35 | 35 | "allow_additional_redirect" => true, |
36 | 36 | "async" => true, |
37 | 37 | "selector" => "a[href*=\"optimizely\"]", |
38 | 38 | "dependencies" => array( |
39 | - 24, |
|
40 | - 26 |
|
39 | + 24, |
|
40 | + 26 |
|
41 | 41 | ), |
42 | 42 | "destination" => "https://app.optimizely.com/", |
43 | 43 | "extension_id" => 1234, |
@@ -45,39 +45,39 @@ discard block |
||
45 | 45 | "src" => 524, |
46 | 46 | "value" => "window.someGlobalFunction();", |
47 | 47 | "id" => "string" |
48 | - ) |
|
48 | + ) |
|
49 | 49 | ), |
50 | 50 | "description" => "string", |
51 | 51 | "holdback" => 5000, |
52 | 52 | "key" => "home_page_experiment", |
53 | 53 | "metrics" => array( |
54 | - array( |
|
54 | + array( |
|
55 | 55 | "aggregator" => "unique", |
56 | 56 | "event_id" => 0, |
57 | 57 | "field" => "revenue", |
58 | 58 | "scope" => "session" |
59 | - ) |
|
59 | + ) |
|
60 | 60 | ), |
61 | 61 | "name" => "Blue Button Experiment", |
62 | 62 | "schedule" => array( |
63 | - "start_time" => "2016-10-17T07:05:00.070Z", |
|
64 | - "stop_time" => "2016-10-17T07:05:00.070Z", |
|
65 | - "time_zone" => "UTC" |
|
63 | + "start_time" => "2016-10-17T07:05:00.070Z", |
|
64 | + "stop_time" => "2016-10-17T07:05:00.070Z", |
|
65 | + "time_zone" => "UTC" |
|
66 | 66 | ), |
67 | 67 | "status" => "active", |
68 | 68 | "variations" => array( |
69 | - array( |
|
69 | + array( |
|
70 | 70 | "actions" => array( |
71 | - array( |
|
71 | + array( |
|
72 | 72 | "changes" => array( |
73 | - array( |
|
73 | + array( |
|
74 | 74 | "type" => "custom_code", |
75 | 75 | "allow_additional_redirect" => true, |
76 | 76 | "async" => true, |
77 | 77 | "selector" => "a[href*=\"optimizely\"]", |
78 | 78 | "dependencies" => array( |
79 | - 24, |
|
80 | - 26 |
|
79 | + 24, |
|
80 | + 26 |
|
81 | 81 | ), |
82 | 82 | "destination" => "https://app.optimizely.com/", |
83 | 83 | "extension_id" => 1234, |
@@ -85,23 +85,23 @@ discard block |
||
85 | 85 | "src" => 524, |
86 | 86 | "value" => "window.someGlobalFunction();", |
87 | 87 | "id" => "string" |
88 | - ) |
|
88 | + ) |
|
89 | 89 | ), |
90 | 90 | "page_id" => 0 |
91 | - ) |
|
91 | + ) |
|
92 | 92 | ), |
93 | 93 | "archived"=> true, |
94 | 94 | "key" => "blue_button_variation", |
95 | 95 | "name" => "Blue Button", |
96 | 96 | "variation_id" => 0, |
97 | 97 | "weight" => 0 |
98 | - ) |
|
98 | + ) |
|
99 | 99 | ), |
100 | 100 | "created" => "2016-10-17T07:05:00.070Z", |
101 | 101 | "id" => 3000, |
102 | 102 | "is_classic" => false, |
103 | 103 | "last_modified" => "2016-10-17T07:05:00.070Z" |
104 | - ) |
|
104 | + ) |
|
105 | 105 | ), 200); |
106 | 106 | |
107 | 107 | $optimizelyApiClientMock->method('sendApiRequest') |
@@ -172,20 +172,20 @@ discard block |
||
172 | 172 | $result = new Result(array( |
173 | 173 | "project_id" => 1000, |
174 | 174 | "audience_ids" => array( |
175 | - 1234, |
|
176 | - 1212, |
|
177 | - 1432 |
|
175 | + 1234, |
|
176 | + 1212, |
|
177 | + 1432 |
|
178 | 178 | ), |
179 | 179 | "campaign_id" => 2000, |
180 | 180 | "changes" => array( |
181 | - array( |
|
181 | + array( |
|
182 | 182 | "type" => "custom_code", |
183 | 183 | "allow_additional_redirect" => true, |
184 | 184 | "async" => true, |
185 | 185 | "selector" => "a[href*=\"optimizely\"]", |
186 | 186 | "dependencies" => array( |
187 | - 24, |
|
188 | - 26 |
|
187 | + 24, |
|
188 | + 26 |
|
189 | 189 | ), |
190 | 190 | "destination" => "https://app.optimizely.com/", |
191 | 191 | "extension_id" => 1234, |
@@ -193,39 +193,39 @@ discard block |
||
193 | 193 | "src" => 524, |
194 | 194 | "value" => "window.someGlobalFunction();", |
195 | 195 | "id" => "string" |
196 | - ) |
|
196 | + ) |
|
197 | 197 | ), |
198 | 198 | "description" => "string", |
199 | 199 | "holdback" => 5000, |
200 | 200 | "key" => "home_page_experiment", |
201 | 201 | "metrics" => array( |
202 | - array( |
|
202 | + array( |
|
203 | 203 | "aggregator" => "unique", |
204 | 204 | "event_id" => 0, |
205 | 205 | "field" => "revenue", |
206 | 206 | "scope" => "session" |
207 | - ) |
|
207 | + ) |
|
208 | 208 | ), |
209 | 209 | "name" => "Blue Button Experiment", |
210 | 210 | "schedule" => array( |
211 | - "start_time" => "2016-10-17T07:05:00.070Z", |
|
212 | - "stop_time" => "2016-10-17T07:05:00.070Z", |
|
213 | - "time_zone" => "UTC" |
|
211 | + "start_time" => "2016-10-17T07:05:00.070Z", |
|
212 | + "stop_time" => "2016-10-17T07:05:00.070Z", |
|
213 | + "time_zone" => "UTC" |
|
214 | 214 | ), |
215 | 215 | "status" => "active", |
216 | 216 | "variations" => array( |
217 | - array( |
|
217 | + array( |
|
218 | 218 | "actions" => array( |
219 | - array( |
|
219 | + array( |
|
220 | 220 | "changes" => array( |
221 | - array( |
|
221 | + array( |
|
222 | 222 | "type" => "custom_code", |
223 | 223 | "allow_additional_redirect" => true, |
224 | 224 | "async" => true, |
225 | 225 | "selector" => "a[href*=\"optimizely\"]", |
226 | 226 | "dependencies" => array( |
227 | - 24, |
|
228 | - 26 |
|
227 | + 24, |
|
228 | + 26 |
|
229 | 229 | ), |
230 | 230 | "destination" => "https://app.optimizely.com/", |
231 | 231 | "extension_id" => 1234, |
@@ -233,23 +233,23 @@ discard block |
||
233 | 233 | "src" => 524, |
234 | 234 | "value" => "window.someGlobalFunction();", |
235 | 235 | "id" => "string" |
236 | - ) |
|
236 | + ) |
|
237 | 237 | ), |
238 | 238 | "page_id" => 0 |
239 | - ) |
|
239 | + ) |
|
240 | 240 | ), |
241 | 241 | "archived"=> true, |
242 | 242 | "key" => "blue_button_variation", |
243 | 243 | "name" => "Blue Button", |
244 | 244 | "variation_id" => 0, |
245 | 245 | "weight" => 0 |
246 | - ) |
|
246 | + ) |
|
247 | 247 | ), |
248 | 248 | "created" => "2016-10-17T07:05:00.070Z", |
249 | 249 | "id" => 3000, |
250 | 250 | "is_classic" => false, |
251 | 251 | "last_modified" => "2016-10-17T07:05:00.070Z" |
252 | - ), 200); |
|
252 | + ), 200); |
|
253 | 253 | |
254 | 254 | $optimizelyApiClientMock->method('sendApiRequest') |
255 | 255 | ->willReturn($result); |
@@ -305,7 +305,7 @@ discard block |
||
305 | 305 | "end_time" => "2016-10-17T07:05:00.089Z", |
306 | 306 | "experiment_id" => 3000, |
307 | 307 | "metrics" => array( |
308 | - array( |
|
308 | + array( |
|
309 | 309 | "event" => "string", |
310 | 310 | "event_name" => "string", |
311 | 311 | "measure" => "conversions", |
@@ -313,54 +313,54 @@ discard block |
||
313 | 313 | "priority" => 1, |
314 | 314 | "unit" => "session", |
315 | 315 | "variation_results" => array( |
316 | - "9000" => array( |
|
316 | + "9000" => array( |
|
317 | 317 | "experiment_id" => 0, |
318 | 318 | "is_baseline" => true, |
319 | 319 | "lift" => array( |
320 | - "confidence_interval" => array( |
|
320 | + "confidence_interval" => array( |
|
321 | 321 | 0.010399560300730457, |
322 | 322 | 0.0850821459929161 |
323 | - ), |
|
324 | - "is_most_conclusive" => true, |
|
325 | - "is_significant" => true, |
|
326 | - "significance" => 0, |
|
327 | - "value" => 0, |
|
328 | - "visitors_remaining" => 0 |
|
323 | + ), |
|
324 | + "is_most_conclusive" => true, |
|
325 | + "is_significant" => true, |
|
326 | + "significance" => 0, |
|
327 | + "value" => 0, |
|
328 | + "visitors_remaining" => 0 |
|
329 | 329 | ), |
330 | 330 | "name" => "Blue Button", |
331 | 331 | "rate" => 0, |
332 | 332 | "scope" => "variation", |
333 | 333 | "total_increase" => array( |
334 | - "confidence_interval" => array( |
|
334 | + "confidence_interval" => array( |
|
335 | 335 | 0.010399560300730457, |
336 | 336 | 0.0850821459929161 |
337 | - ), |
|
338 | - "is_most_conclusive" => true, |
|
339 | - "is_significant" => true, |
|
340 | - "significance" => 0, |
|
341 | - "value" => 0, |
|
342 | - "visitors_remaining" => 0 |
|
337 | + ), |
|
338 | + "is_most_conclusive" => true, |
|
339 | + "is_significant" => true, |
|
340 | + "significance" => 0, |
|
341 | + "value" => 0, |
|
342 | + "visitors_remaining" => 0 |
|
343 | 343 | ), |
344 | 344 | "value" => 0, |
345 | 345 | "variation_id" => "string" |
346 | - ) |
|
346 | + ) |
|
347 | + ) |
|
347 | 348 | ) |
348 | - ) |
|
349 | 349 | ), |
350 | 350 | "reach" => array( |
351 | - "baseline_count" => 0, |
|
352 | - "baseline_reach" => 0, |
|
353 | - "total_count" => 0, |
|
354 | - "treatment_count" => 0, |
|
355 | - "treatment_reach" => 0, |
|
356 | - "variations" => array( |
|
351 | + "baseline_count" => 0, |
|
352 | + "baseline_reach" => 0, |
|
353 | + "total_count" => 0, |
|
354 | + "treatment_count" => 0, |
|
355 | + "treatment_reach" => 0, |
|
356 | + "variations" => array( |
|
357 | 357 | "9000" => array( |
358 | - "count" => 0, |
|
359 | - "name" => "Blue Button", |
|
360 | - "variation_id" => "string", |
|
361 | - "variation_reach" => 0 |
|
358 | + "count" => 0, |
|
359 | + "name" => "Blue Button", |
|
360 | + "variation_id" => "string", |
|
361 | + "variation_reach" => 0 |
|
362 | + ) |
|
362 | 363 | ) |
363 | - ) |
|
364 | 364 | ), |
365 | 365 | "start_time" => "2016-10-17T07:05:00.090Z" |
366 | 366 | ), 200); |
@@ -387,20 +387,20 @@ discard block |
||
387 | 387 | $result = new Result(array( |
388 | 388 | "project_id" => 1000, |
389 | 389 | "audience_ids" => array( |
390 | - 1234, |
|
391 | - 1212, |
|
392 | - 1432 |
|
390 | + 1234, |
|
391 | + 1212, |
|
392 | + 1432 |
|
393 | 393 | ), |
394 | 394 | "campaign_id" => 2000, |
395 | 395 | "changes" => array( |
396 | - array( |
|
396 | + array( |
|
397 | 397 | "type" => "custom_code", |
398 | 398 | "allow_additional_redirect" => true, |
399 | 399 | "async" => true, |
400 | 400 | "selector" => "a[href*=\"optimizely\"]", |
401 | 401 | "dependencies" => array( |
402 | - 24, |
|
403 | - 26 |
|
402 | + 24, |
|
403 | + 26 |
|
404 | 404 | ), |
405 | 405 | "destination" => "https://app.optimizely.com/", |
406 | 406 | "extension_id" => 1234, |
@@ -408,39 +408,39 @@ discard block |
||
408 | 408 | "src" => 524, |
409 | 409 | "value" => "window.someGlobalFunction();", |
410 | 410 | "id" => "string" |
411 | - ) |
|
411 | + ) |
|
412 | 412 | ), |
413 | 413 | "description" => "string", |
414 | 414 | "holdback" => 5000, |
415 | 415 | "key" => "home_page_experiment", |
416 | 416 | "metrics" => array( |
417 | - array( |
|
417 | + array( |
|
418 | 418 | "aggregator" => "unique", |
419 | 419 | "event_id" => 0, |
420 | 420 | "field" => "revenue", |
421 | 421 | "scope" => "session" |
422 | - ) |
|
422 | + ) |
|
423 | 423 | ), |
424 | 424 | "name" => "Blue Button Experiment", |
425 | 425 | "schedule" => array( |
426 | - "start_time" => "2016-10-17T07:05:00.099Z", |
|
427 | - "stop_time" => "2016-10-17T07:05:00.099Z", |
|
428 | - "time_zone" => "UTC" |
|
426 | + "start_time" => "2016-10-17T07:05:00.099Z", |
|
427 | + "stop_time" => "2016-10-17T07:05:00.099Z", |
|
428 | + "time_zone" => "UTC" |
|
429 | 429 | ), |
430 | 430 | "status" => "active", |
431 | 431 | "variations" => array( |
432 | - array( |
|
432 | + array( |
|
433 | 433 | "actions" => array( |
434 | - array( |
|
434 | + array( |
|
435 | 435 | "changes" => array( |
436 | - array( |
|
436 | + array( |
|
437 | 437 | "type" => "custom_code", |
438 | 438 | "allow_additional_redirect" => true, |
439 | 439 | "async" => true, |
440 | 440 | "selector" => "a[href*=\"optimizely\"]", |
441 | 441 | "dependencies" => array( |
442 | - 24, |
|
443 | - 26 |
|
442 | + 24, |
|
443 | + 26 |
|
444 | 444 | ), |
445 | 445 | "destination" => "https://app.optimizely.com/", |
446 | 446 | "extension_id" => 1234, |
@@ -448,17 +448,17 @@ discard block |
||
448 | 448 | "src" => 524, |
449 | 449 | "value" => "window.someGlobalFunction();", |
450 | 450 | "id" => "string" |
451 | - ) |
|
451 | + ) |
|
452 | 452 | ), |
453 | 453 | "page_id" => 0 |
454 | - ) |
|
454 | + ) |
|
455 | 455 | ), |
456 | 456 | "archived" => true, |
457 | 457 | "key" => "blue_button_variation", |
458 | 458 | "name" => "Blue Button", |
459 | 459 | "variation_id" => 0, |
460 | 460 | "weight" => 0 |
461 | - ) |
|
461 | + ) |
|
462 | 462 | ), |
463 | 463 | "created" => "2016-10-17T07:05:00.099Z", |
464 | 464 | "id" => 3000, |
@@ -474,76 +474,76 @@ discard block |
||
474 | 474 | $experiment = new Experiment(array( |
475 | 475 | "project_id" => 1000, |
476 | 476 | "audience_ids" => array( |
477 | - 1234, |
|
478 | - 1212, |
|
479 | - 1432 |
|
477 | + 1234, |
|
478 | + 1212, |
|
479 | + 1432 |
|
480 | 480 | ), |
481 | 481 | "campaign_id" => 2000, |
482 | 482 | "changes" => array( |
483 | - array( |
|
483 | + array( |
|
484 | 484 | "type" => "custom_code", |
485 | 485 | "allow_additional_redirect" => true, |
486 | 486 | "async" => true, |
487 | 487 | "selector" => "a[href*=\"optimizely\"]", |
488 | 488 | "dependencies" => array( |
489 | - 24, |
|
490 | - 26 |
|
489 | + 24, |
|
490 | + 26 |
|
491 | 491 | ), |
492 | 492 | "destination" => "https://app.optimizely.com/", |
493 | 493 | "extension_id" => 1234, |
494 | 494 | "preserve_parameters" => true, |
495 | 495 | "src" => 524, |
496 | 496 | "value" => "window.someGlobalFunction();" |
497 | - ) |
|
497 | + ) |
|
498 | 498 | ), |
499 | 499 | "description" => "string", |
500 | 500 | "holdback" => 5000, |
501 | 501 | "key" => "home_page_experiment", |
502 | 502 | "metrics" => array( |
503 | - array( |
|
503 | + array( |
|
504 | 504 | "aggregator" => "unique", |
505 | 505 | "event_id" => 0, |
506 | 506 | "field" => "revenue", |
507 | 507 | "scope" => "session" |
508 | - ) |
|
508 | + ) |
|
509 | 509 | ), |
510 | 510 | "name" => "Blue Button Experiment", |
511 | 511 | "schedule" => array( |
512 | - "start_time" => "2016-10-17T07:04:59.724Z", |
|
513 | - "stop_time" => "2016-10-17T07:04:59.724Z", |
|
514 | - "time_zone" => "UTC" |
|
512 | + "start_time" => "2016-10-17T07:04:59.724Z", |
|
513 | + "stop_time" => "2016-10-17T07:04:59.724Z", |
|
514 | + "time_zone" => "UTC" |
|
515 | 515 | ), |
516 | 516 | "status" => "active", |
517 | 517 | "variations" => array( |
518 | - array( |
|
518 | + array( |
|
519 | 519 | "actions" => array( |
520 | - array( |
|
520 | + array( |
|
521 | 521 | "changes" => array( |
522 | - array( |
|
522 | + array( |
|
523 | 523 | "type" => "custom_code", |
524 | 524 | "allow_additional_redirect" => true, |
525 | 525 | "async" => true, |
526 | 526 | "selector" => "a[href*=\"optimizely\"]", |
527 | 527 | "dependencies" => array( |
528 | - 24, |
|
529 | - 26 |
|
528 | + 24, |
|
529 | + 26 |
|
530 | 530 | ), |
531 | 531 | "destination" => "https://app.optimizely.com/", |
532 | 532 | "extension_id" => 1234, |
533 | 533 | "preserve_parameters" => true, |
534 | 534 | "src" => 524, |
535 | 535 | "value" => "window.someGlobalFunction();" |
536 | - ) |
|
536 | + ) |
|
537 | 537 | ), |
538 | 538 | "page_id" => 0 |
539 | - ) |
|
539 | + ) |
|
540 | 540 | ), |
541 | 541 | "archived" => true, |
542 | 542 | "key" => "blue_button_variation", |
543 | 543 | "name" => "Blue Button", |
544 | 544 | "variation_id" => 0, |
545 | 545 | "weight" => 0 |
546 | - ) |
|
546 | + ) |
|
547 | 547 | ) |
548 | 548 | )); |
549 | 549 | |
@@ -564,20 +564,20 @@ discard block |
||
564 | 564 | $result = new Result(array( |
565 | 565 | "project_id" => 1000, |
566 | 566 | "audience_ids" => array( |
567 | - 1234, |
|
568 | - 1212, |
|
569 | - 1432 |
|
567 | + 1234, |
|
568 | + 1212, |
|
569 | + 1432 |
|
570 | 570 | ), |
571 | 571 | "campaign_id" => 2000, |
572 | 572 | "changes" => array( |
573 | - array( |
|
573 | + array( |
|
574 | 574 | "type" => "custom_code", |
575 | 575 | "allow_additional_redirect" => true, |
576 | 576 | "async" => true, |
577 | 577 | "selector" => "a[href*=\"optimizely\"]", |
578 | 578 | "dependencies" => array( |
579 | - 24, |
|
580 | - 26 |
|
579 | + 24, |
|
580 | + 26 |
|
581 | 581 | ), |
582 | 582 | "destination" => "https://app.optimizely.com/", |
583 | 583 | "extension_id" => 1234, |
@@ -585,39 +585,39 @@ discard block |
||
585 | 585 | "src" => 524, |
586 | 586 | "value" => "window.someGlobalFunction();", |
587 | 587 | "id" => "string" |
588 | - ) |
|
588 | + ) |
|
589 | 589 | ), |
590 | 590 | "description" => "string", |
591 | 591 | "holdback" => 5000, |
592 | 592 | "key" => "home_page_experiment", |
593 | 593 | "metrics" => array( |
594 | - array( |
|
594 | + array( |
|
595 | 595 | "aggregator" => "unique", |
596 | 596 | "event_id" => 0, |
597 | 597 | "field" => "revenue", |
598 | 598 | "scope" => "session" |
599 | - ) |
|
599 | + ) |
|
600 | 600 | ), |
601 | 601 | "name" => "Blue Button Experiment", |
602 | 602 | "schedule" => array( |
603 | - "start_time" => "2016-10-17T07:05:00.109Z", |
|
604 | - "stop_time" => "2016-10-17T07:05:00.109Z", |
|
605 | - "time_zone" => "UTC" |
|
603 | + "start_time" => "2016-10-17T07:05:00.109Z", |
|
604 | + "stop_time" => "2016-10-17T07:05:00.109Z", |
|
605 | + "time_zone" => "UTC" |
|
606 | 606 | ), |
607 | 607 | "status" => "active", |
608 | 608 | "variations" => array( |
609 | - array( |
|
609 | + array( |
|
610 | 610 | "actions" => array( |
611 | - array( |
|
611 | + array( |
|
612 | 612 | "changes" => array( |
613 | - array( |
|
613 | + array( |
|
614 | 614 | "type" => "custom_code", |
615 | 615 | "allow_additional_redirect" => true, |
616 | 616 | "async" => true, |
617 | 617 | "selector" => "a[href*=\"optimizely\"]", |
618 | 618 | "dependencies" => array( |
619 | - 24, |
|
620 | - 26 |
|
619 | + 24, |
|
620 | + 26 |
|
621 | 621 | ), |
622 | 622 | "destination" => "https://app.optimizely.com/", |
623 | 623 | "extension_id" => 1234, |
@@ -625,17 +625,17 @@ discard block |
||
625 | 625 | "src" => 524, |
626 | 626 | "value" => "window.someGlobalFunction();", |
627 | 627 | "id" => "string" |
628 | - ) |
|
628 | + ) |
|
629 | 629 | ), |
630 | 630 | "page_id" => 0 |
631 | - ) |
|
631 | + ) |
|
632 | 632 | ), |
633 | 633 | "archived" => true, |
634 | 634 | "key" => "blue_button_variation", |
635 | 635 | "name" => "Blue Button", |
636 | 636 | "variation_id" => 0, |
637 | 637 | "weight" => 0 |
638 | - ) |
|
638 | + ) |
|
639 | 639 | ), |
640 | 640 | "created" => "2016-10-17T07:05:00.109Z", |
641 | 641 | "id" => 3000, |
@@ -649,75 +649,75 @@ discard block |
||
649 | 649 | $experimentsService = new Experiments($optimizelyApiClientMock); |
650 | 650 | |
651 | 651 | $experiment = new Experiment(array( |
652 | - "audience_ids" => array( |
|
652 | + "audience_ids" => array( |
|
653 | 653 | 0 |
654 | - ), |
|
655 | - "changes" => array( |
|
654 | + ), |
|
655 | + "changes" => array( |
|
656 | 656 | array( |
657 | - "type" => "custom_code", |
|
658 | - "allow_additional_redirect" => true, |
|
659 | - "async" => true, |
|
660 | - "selector" => "a[href*=\"optimizely\"]", |
|
661 | - "dependencies" => array( |
|
657 | + "type" => "custom_code", |
|
658 | + "allow_additional_redirect" => true, |
|
659 | + "async" => true, |
|
660 | + "selector" => "a[href*=\"optimizely\"]", |
|
661 | + "dependencies" => array( |
|
662 | 662 | 24, |
663 | 663 | 26 |
664 | - ), |
|
665 | - "destination" => "https://app.optimizely.com/", |
|
666 | - "extension_id" => 1234, |
|
667 | - "preserve_parameters" => true, |
|
668 | - "src" => 524, |
|
669 | - "value" => "window.someGlobalFunction();" |
|
664 | + ), |
|
665 | + "destination" => "https://app.optimizely.com/", |
|
666 | + "extension_id" => 1234, |
|
667 | + "preserve_parameters" => true, |
|
668 | + "src" => 524, |
|
669 | + "value" => "window.someGlobalFunction();" |
|
670 | 670 | ) |
671 | - ), |
|
672 | - "description" => "AB Test to see if the Blue Button converts more visitors", |
|
673 | - "holdback" => 0, |
|
674 | - "key" => "home_page_experiment", |
|
675 | - "metrics" => array( |
|
671 | + ), |
|
672 | + "description" => "AB Test to see if the Blue Button converts more visitors", |
|
673 | + "holdback" => 0, |
|
674 | + "key" => "home_page_experiment", |
|
675 | + "metrics" => array( |
|
676 | 676 | array( |
677 | - "aggregator" => "unique", |
|
678 | - "event_id" => 0, |
|
679 | - "field" => "revenue", |
|
680 | - "scope" => "session" |
|
677 | + "aggregator" => "unique", |
|
678 | + "event_id" => 0, |
|
679 | + "field" => "revenue", |
|
680 | + "scope" => "session" |
|
681 | 681 | ) |
682 | - ), |
|
683 | - "name" => "Blue Button Experiment", |
|
684 | - "schedule" => array( |
|
682 | + ), |
|
683 | + "name" => "Blue Button Experiment", |
|
684 | + "schedule" => array( |
|
685 | 685 | "start_time" => "2016-10-17T07:04:59.731Z", |
686 | 686 | "stop_time" => "2016-10-17T07:04:59.731Z", |
687 | 687 | "time_zone" => "UTC" |
688 | - ), |
|
689 | - "status" => "active", |
|
690 | - "variations" => array( |
|
688 | + ), |
|
689 | + "status" => "active", |
|
690 | + "variations" => array( |
|
691 | 691 | array( |
692 | - "actions" => array( |
|
692 | + "actions" => array( |
|
693 | 693 | array( |
694 | - "changes" => array( |
|
694 | + "changes" => array( |
|
695 | 695 | array( |
696 | - "type" => "custom_code", |
|
697 | - "allow_additional_redirect" => true, |
|
698 | - "async" => true, |
|
699 | - "selector" => "a[href*=\"optimizely\"]", |
|
700 | - "dependencies" => array( |
|
696 | + "type" => "custom_code", |
|
697 | + "allow_additional_redirect" => true, |
|
698 | + "async" => true, |
|
699 | + "selector" => "a[href*=\"optimizely\"]", |
|
700 | + "dependencies" => array( |
|
701 | 701 | 24, |
702 | 702 | 26 |
703 | - ), |
|
704 | - "destination" => "https://app.optimizely.com/", |
|
705 | - "extension_id" => 1234, |
|
706 | - "preserve_parameters" => true, |
|
707 | - "src" => 524, |
|
708 | - "value" => "window.someGlobalFunction();" |
|
703 | + ), |
|
704 | + "destination" => "https://app.optimizely.com/", |
|
705 | + "extension_id" => 1234, |
|
706 | + "preserve_parameters" => true, |
|
707 | + "src" => 524, |
|
708 | + "value" => "window.someGlobalFunction();" |
|
709 | 709 | ) |
710 | - ), |
|
711 | - "page_id" => 0 |
|
710 | + ), |
|
711 | + "page_id" => 0 |
|
712 | 712 | ) |
713 | - ), |
|
714 | - "archived" => true, |
|
715 | - "key" => "blue_button_variation", |
|
716 | - "name" => "Blue Button", |
|
717 | - "variation_id" => 0, |
|
718 | - "weight" => 0 |
|
713 | + ), |
|
714 | + "archived" => true, |
|
715 | + "key" => "blue_button_variation", |
|
716 | + "name" => "Blue Button", |
|
717 | + "variation_id" => 0, |
|
718 | + "weight" => 0 |
|
719 | + ) |
|
719 | 720 | ) |
720 | - ) |
|
721 | 721 | )); |
722 | 722 | |
723 | 723 | $result = $experimentsService->update(1000, $experiment, true, true); |
@@ -765,14 +765,14 @@ discard block |
||
765 | 765 | "platform" => "web", |
766 | 766 | "status" => "active", |
767 | 767 | "web_snippet" => array( |
768 | - "enable_force_variation" => false, |
|
769 | - "exclude_disabled_experiments" => false, |
|
770 | - "exclude_names" => true, |
|
771 | - "include_jquery" => true, |
|
772 | - "ip_anonymization" => false, |
|
773 | - "ip_filter" => "^206\\.23\\.100\\.([5-9][0-9]|1([0-4][0-9]|50))$", |
|
774 | - "library" => "jquery-1.11.3-trim", |
|
775 | - "project_javascript" => "alert(\"Active Experiment\")" |
|
768 | + "enable_force_variation" => false, |
|
769 | + "exclude_disabled_experiments" => false, |
|
770 | + "exclude_names" => true, |
|
771 | + "include_jquery" => true, |
|
772 | + "ip_anonymization" => false, |
|
773 | + "ip_filter" => "^206\\.23\\.100\\.([5-9][0-9]|1([0-4][0-9]|50))$", |
|
774 | + "library" => "jquery-1.11.3-trim", |
|
775 | + "project_javascript" => "alert(\"Active Experiment\")" |
|
776 | 776 | ) |
777 | 777 | )); |
778 | 778 | |
@@ -783,12 +783,12 @@ discard block |
||
783 | 783 | $experiment = new Experiment(array( |
784 | 784 | "project_id" => $createdProject->getId(), |
785 | 785 | "variations" => array( |
786 | - array( |
|
786 | + array( |
|
787 | 787 | "weight" => 0, |
788 | 788 | "actions" => array( |
789 | - array( |
|
789 | + array( |
|
790 | 790 | "changes" => array( |
791 | - /*array( |
|
791 | + /*array( |
|
792 | 792 | "type" => "attribute", |
793 | 793 | "allow_additional_redirect" => true, |
794 | 794 | "async" => true, |
@@ -830,17 +830,17 @@ discard block |
||
830 | 830 | )*/ |
831 | 831 | ), |
832 | 832 | "page_id" => 0 |
833 | - ) |
|
833 | + ) |
|
834 | 834 | ), |
835 | 835 | "archived" => true, |
836 | 836 | "key" => "blue_button_variation", |
837 | 837 | "name" => "Blue Button" |
838 | - ) |
|
838 | + ) |
|
839 | 839 | ), |
840 | 840 | "audience_conditions" => "[\"and\", {\"audience_id\": 7000}, {\"audience_id\":7001}]", |
841 | 841 | "campaign_id" => 2000, |
842 | 842 | "changes" => array( |
843 | - /*array( |
|
843 | + /*array( |
|
844 | 844 | "type" => "attribute", |
845 | 845 | "allow_additional_redirect" => true, |
846 | 846 | "async" => true, |
@@ -885,18 +885,18 @@ discard block |
||
885 | 885 | "holdback" => 5000, |
886 | 886 | "key" => "home_page_experiment", |
887 | 887 | "metrics" => array( |
888 | - array( |
|
888 | + array( |
|
889 | 889 | "aggregator" => "unique", |
890 | 890 | "event_id" => 0, |
891 | 891 | "field" => "revenue", |
892 | 892 | "scope" => "session" |
893 | - ) |
|
893 | + ) |
|
894 | 894 | ), |
895 | 895 | "name" => "Blue Button Experiment", |
896 | 896 | "schedule" => array( |
897 | - "start_time" => "string", |
|
898 | - "stop_time" => "string", |
|
899 | - "time_zone" => "GMT-01:00" |
|
897 | + "start_time" => "string", |
|
898 | + "stop_time" => "string", |
|
899 | + "time_zone" => "GMT-01:00" |
|
900 | 900 | ), |
901 | 901 | "type" => "a/b" |
902 | 902 | )); |
@@ -112,9 +112,9 @@ discard block |
||
112 | 112 | $result = $experimentsService->listAll(1000); |
113 | 113 | $experiments = $result->getPayload(); |
114 | 114 | |
115 | - $this->assertTrue(count($experiments)==1); |
|
115 | + $this->assertTrue(count($experiments) == 1); |
|
116 | 116 | $this->assertTrue($experiments[0] instanceOf Experiment); |
117 | - $this->assertTrue($experiments[0]->getName()=='Blue Button Experiment'); |
|
117 | + $this->assertTrue($experiments[0]->getName() == 'Blue Button Experiment'); |
|
118 | 118 | } |
119 | 119 | |
120 | 120 | /** |
@@ -260,7 +260,7 @@ discard block |
||
260 | 260 | $experiment = $result->getPayload(); |
261 | 261 | |
262 | 262 | $this->assertTrue($experiment instanceOf Experiment); |
263 | - $this->assertTrue($experiment->getName()=='Blue Button Experiment'); |
|
263 | + $this->assertTrue($experiment->getName() == 'Blue Button Experiment'); |
|
264 | 264 | } |
265 | 265 | |
266 | 266 | /** |
@@ -374,7 +374,7 @@ discard block |
||
374 | 374 | $experimentResults = $result->getPayload(); |
375 | 375 | |
376 | 376 | $this->assertTrue($experimentResults instanceOf ExperimentResults); |
377 | - $this->assertTrue($experimentResults->getConfidenceThreshold()==0.9); |
|
377 | + $this->assertTrue($experimentResults->getConfidenceThreshold() == 0.9); |
|
378 | 378 | } |
379 | 379 | |
380 | 380 | public function testCreate() |
@@ -551,7 +551,7 @@ discard block |
||
551 | 551 | $createdExperiment = $result->getPayload(); |
552 | 552 | |
553 | 553 | $this->assertTrue($createdExperiment instanceOf Experiment); |
554 | - $this->assertTrue($createdExperiment->getName()=='Blue Button Experiment'); |
|
554 | + $this->assertTrue($createdExperiment->getName() == 'Blue Button Experiment'); |
|
555 | 555 | } |
556 | 556 | |
557 | 557 | public function testUpdate() |
@@ -724,7 +724,7 @@ discard block |
||
724 | 724 | $updatedExperiment = $result->getPayload(); |
725 | 725 | |
726 | 726 | $this->assertTrue($updatedExperiment instanceOf Experiment); |
727 | - $this->assertTrue($updatedExperiment->getName()=='Blue Button Experiment'); |
|
727 | + $this->assertTrue($updatedExperiment->getName() == 'Blue Button Experiment'); |
|
728 | 728 | } |
729 | 729 | |
730 | 730 | public function testDelete() |
@@ -754,7 +754,7 @@ discard block |
||
754 | 754 | $credentials = $this->loadCredentialsFromFile(); |
755 | 755 | |
756 | 756 | $optimizelyClient = new OptimizelyApiClient($credentials, 'v2'); |
757 | - $this->assertTrue($optimizelyClient!=null); |
|
757 | + $this->assertTrue($optimizelyClient != null); |
|
758 | 758 | |
759 | 759 | // Create new project |
760 | 760 | $curDate = date('Y-m-d H:i:s'); |
@@ -906,7 +906,7 @@ discard block |
||
906 | 906 | $createdExperiment = $result->getPayload(); |
907 | 907 | |
908 | 908 | $this->assertTrue($createdExperiment instanceOf Experiment); |
909 | - $this->assertTrue($createdExperiment->getName()=='Blue Button Experiment'); |
|
909 | + $this->assertTrue($createdExperiment->getName() == 'Blue Button Experiment'); |
|
910 | 910 | |
911 | 911 | // List all existing experiments and try to find the created experiment |
912 | 912 | $experimentFound = false; |
@@ -918,16 +918,16 @@ discard block |
||
918 | 918 | $experiments = $result->getPayload(); |
919 | 919 | |
920 | 920 | foreach ($experiments as $experiment) { |
921 | - if ($experiment->getName()=="Blue Button Experiment") { |
|
921 | + if ($experiment->getName() == "Blue Button Experiment") { |
|
922 | 922 | $experimentFound = true; |
923 | 923 | break; |
924 | 924 | } |
925 | 925 | } |
926 | 926 | |
927 | - if ($result->getNextPage()==null) |
|
927 | + if ($result->getNextPage() == null) |
|
928 | 928 | break; |
929 | 929 | |
930 | - $page ++; |
|
930 | + $page++; |
|
931 | 931 | } |
932 | 932 | } |
933 | 933 | catch (Exception $e) { |
@@ -947,7 +947,7 @@ discard block |
||
947 | 947 | $updatedExperiment = $result->getPayload(); |
948 | 948 | |
949 | 949 | $this->assertTrue($updatedExperiment instanceOf Experiment); |
950 | - $this->assertTrue($updatedExperiment->getName()=='Some new experiment name'); |
|
950 | + $this->assertTrue($updatedExperiment->getName() == 'Some new experiment name'); |
|
951 | 951 | |
952 | 952 | // Delete experiment |
953 | 953 | $result = $optimizelyClient->experiments()->delete($createdExperiment->getId()); |
@@ -748,8 +748,9 @@ discard block |
||
748 | 748 | |
749 | 749 | public function testIntegration() |
750 | 750 | { |
751 | - if (!getenv('OPTIMIZELY_PHP_TEST_INTEGRATION')) |
|
752 | - $this->markTestSkipped('OPTIMIZELY_PHP_TEST_INTEGRATION env var is not set'); |
|
751 | + if (!getenv('OPTIMIZELY_PHP_TEST_INTEGRATION')) { |
|
752 | + $this->markTestSkipped('OPTIMIZELY_PHP_TEST_INTEGRATION env var is not set'); |
|
753 | + } |
|
753 | 754 | |
754 | 755 | $credentials = $this->loadCredentialsFromFile(); |
755 | 756 | |
@@ -924,13 +925,13 @@ discard block |
||
924 | 925 | } |
925 | 926 | } |
926 | 927 | |
927 | - if ($result->getNextPage()==null) |
|
928 | - break; |
|
928 | + if ($result->getNextPage()==null) { |
|
929 | + break; |
|
930 | + } |
|
929 | 931 | |
930 | 932 | $page ++; |
931 | 933 | } |
932 | - } |
|
933 | - catch (Exception $e) { |
|
934 | + } catch (Exception $e) { |
|
934 | 935 | // Handle error. |
935 | 936 | $code = $e->getCode(); |
936 | 937 | $httpCode = $e->getHttpCode(); |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | case 'style': $this->setStyle($value); break; |
78 | 78 | case 'text': $this->setText($value); break; |
79 | 79 | default: |
80 | - throw new Exception('Unknown option found in the ChangeAttribute entity: ' . $name); |
|
80 | + throw new Exception('Unknown option found in the ChangeAttribute entity: '.$name); |
|
81 | 81 | } |
82 | 82 | } |
83 | 83 | } |
@@ -101,7 +101,7 @@ discard block |
||
101 | 101 | // Remove options with empty values |
102 | 102 | $cleanedOptions = array(); |
103 | 103 | foreach ($options as $name=>$value) { |
104 | - if ($value!==null) |
|
104 | + if ($value !== null) |
|
105 | 105 | $cleanedOptions[$name] = $value; |
106 | 106 | } |
107 | 107 |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | case 'field': $this->setField($value); break; |
60 | 60 | case 'scope': $this->setScope($value); break; |
61 | 61 | default: |
62 | - throw new Exception('Unknown option found in the Metric entity: ' . $name); |
|
62 | + throw new Exception('Unknown option found in the Metric entity: '.$name); |
|
63 | 63 | } |
64 | 64 | } |
65 | 65 | } |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | // Remove options with empty values |
80 | 80 | $cleanedOptions = array(); |
81 | 81 | foreach ($options as $name=>$value) { |
82 | - if ($value!==null) |
|
82 | + if ($value !== null) |
|
83 | 83 | $cleanedOptions[$name] = $value; |
84 | 84 | } |
85 | 85 |
@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | case 'is_classic': $this->setIsClassic($value); break; |
125 | 125 | case 'is_editable': $this->setIsEditable($value); break; |
126 | 126 | default: |
127 | - throw new Exception('Unknown option: ' . $name); |
|
127 | + throw new Exception('Unknown option: '.$name); |
|
128 | 128 | } |
129 | 129 | } |
130 | 130 | } |
@@ -140,7 +140,7 @@ discard block |
||
140 | 140 | 'category' => $this->getCategory(), |
141 | 141 | 'created' => $this->getCreated(), |
142 | 142 | 'description' => $this->getDescription(), |
143 | - 'event_filter' => $this->getEventFilter()?$this->getEventFilter()->toArray():null, |
|
143 | + 'event_filter' => $this->getEventFilter() ? $this->getEventFilter()->toArray() : null, |
|
144 | 144 | 'event_type' => $this->getEventType(), |
145 | 145 | 'key' => $this->getKey(), |
146 | 146 | 'name' => $this->getName(), |
@@ -154,7 +154,7 @@ discard block |
||
154 | 154 | // Remove options with empty values |
155 | 155 | $cleanedOptions = array(); |
156 | 156 | foreach ($options as $name=>$value) { |
157 | - if ($value!==null) |
|
157 | + if ($value !== null) |
|
158 | 158 | $cleanedOptions[$name] = $value; |
159 | 159 | } |
160 | 160 |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | case 'position': $this->setPosition($value); break; |
55 | 55 | case 'width': $this->setWidth($value); break; |
56 | 56 | default: |
57 | - throw new Exception('Unknown option found in the CssAttribute entity: ' . $name); |
|
57 | + throw new Exception('Unknown option found in the CssAttribute entity: '.$name); |
|
58 | 58 | } |
59 | 59 | } |
60 | 60 | } |
@@ -81,7 +81,7 @@ discard block |
||
81 | 81 | // Remove options with empty values |
82 | 82 | $cleanedOptions = array(); |
83 | 83 | foreach ($options as $name=>$value) { |
84 | - if ($value!==null) |
|
84 | + if ($value !== null) |
|
85 | 85 | $cleanedOptions[$name] = $value; |
86 | 86 | } |
87 | 87 |
@@ -122,7 +122,7 @@ discard block |
||
122 | 122 | case 'last_modified': $this->setLastModified($value); break; |
123 | 123 | case 'socket_token': $this->setSocketToken($value); break; |
124 | 124 | default: |
125 | - throw new Exception('Unknown option found in the Project entity: ' . $name); |
|
125 | + throw new Exception('Unknown option found in the Project entity: '.$name); |
|
126 | 126 | } |
127 | 127 | } |
128 | 128 | } |
@@ -140,7 +140,7 @@ discard block |
||
140 | 140 | 'platform' => $this->getPlatform(), |
141 | 141 | 'sdks' => $this->getSdks(), |
142 | 142 | 'status' => $this->getStatus(), |
143 | - 'web_snippet' => $this->getWebSnippet()?$this->getWebSnippet()->toArray():null, |
|
143 | + 'web_snippet' => $this->getWebSnippet() ? $this->getWebSnippet()->toArray() : null, |
|
144 | 144 | 'created' => $this->getCreated(), |
145 | 145 | 'id' => $this->getId(), |
146 | 146 | 'is_classic' => $this->getIsClassic(), |
@@ -151,7 +151,7 @@ discard block |
||
151 | 151 | // Remove options with empty values |
152 | 152 | $cleanedOptions = array(); |
153 | 153 | foreach ($options as $name=>$value) { |
154 | - if ($value!==null) |
|
154 | + if ($value !== null) |
|
155 | 155 | $cleanedOptions[$name] = $value; |
156 | 156 | } |
157 | 157 |
@@ -93,7 +93,7 @@ discard block |
||
93 | 93 | case 'last_modified': $this->setLastModified($value); break; |
94 | 94 | case 'is_classic': $this->getIsClassic($value); break; |
95 | 95 | default: |
96 | - throw new Exception('Unknown option: ' . $name); |
|
96 | + throw new Exception('Unknown option: '.$name); |
|
97 | 97 | } |
98 | 98 | } |
99 | 99 | } |
@@ -119,7 +119,7 @@ discard block |
||
119 | 119 | // Remove options with empty values |
120 | 120 | $cleanedOptions = array(); |
121 | 121 | foreach ($options as $name=>$value) { |
122 | - if ($value!==null) |
|
122 | + if ($value !== null) |
|
123 | 123 | $cleanedOptions[$name] = $value; |
124 | 124 | } |
125 | 125 |