Completed
Push — master ( 4f84cc...331858 )
by Oleg
02:30
created
lib/WebMarketingROI/OptimizelyPHP/Resource/v2/Experiment.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -178,7 +178,7 @@  discard block
 block discarded – undo
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
     }
@@ -198,7 +198,7 @@  discard block
 block discarded – undo
198 198
             'key' => $this->getKey(),
199 199
             'last_modified' => $this->getLastModified(),
200 200
             'name' => $this->getName(),
201
-            'schedule' => $this->getSchedule()?$this->getSchedule()->toArray():null,
201
+            'schedule' => $this->getSchedule() ? $this->getSchedule()->toArray() : null,
202 202
             'status' => $this->getStatus(),            
203 203
             'id' => $this->getId(),
204 204
             'is_classic' => $this->getIsClassic(),
@@ -236,7 +236,7 @@  discard block
 block discarded – undo
236 236
         // Remove options with empty values
237 237
         $cleanedOptions = array();
238 238
         foreach ($options as $name=>$value) {
239
-            if ($value!==null)
239
+            if ($value !== null)
240 240
                 $cleanedOptions[$name] = $value;
241 241
         }
242 242
         
Please login to merge, or discard this patch.
tests/OptimizelyPHPTest/Service/v2/ExperimentsTest.php 1 patch
Indentation   +206 added lines, -206 removed lines patch added patch discarded remove patch
@@ -27,20 +27,20 @@  discard block
 block discarded – undo
27 27
                         array(
28 28
                             "project_id" => 1000,
29 29
                             "audience_ids" => array(
30
-                              1234,
31
-                              1212,
32
-                              1432
30
+                                1234,
31
+                                1212,
32
+                                1432
33 33
                             ),
34 34
                             "campaign_id" => 2000,
35 35
                             "changes" => array(
36
-                              array(
36
+                                array(
37 37
                                 "type" => "custom_code",
38 38
                                 "allow_additional_redirect" => true,
39 39
                                 "async" => true,
40 40
                                 "selector" => "a[href*=\"optimizely\"]",
41 41
                                 "dependencies" => array(
42
-                                  24,
43
-                                  26
42
+                                    24,
43
+                                    26
44 44
                                 ),
45 45
                                 "destination" => "https://app.optimizely.com/",
46 46
                                 "extension_id" => 1234,
@@ -48,39 +48,39 @@  discard block
 block discarded – undo
48 48
                                 "src" => 524,
49 49
                                 "value" => "window.someGlobalFunction();",
50 50
                                 "id" => "string"
51
-                              )
51
+                                )
52 52
                             ),
53 53
                             "description" => "string",
54 54
                             "holdback" => 5000,
55 55
                             "key" => "home_page_experiment",
56 56
                             "metrics" => array(
57
-                              array(
57
+                                array(
58 58
                                 "aggregator" => "unique",
59 59
                                 "event_id" => 0,
60 60
                                 "field" => "revenue",
61 61
                                 "scope" => "visitor"
62
-                              )
62
+                                )
63 63
                             ),
64 64
                             "name" => "Blue Button Experiment",
65 65
                             "schedule" => array(
66
-                              "start_time" => "2016-10-17T07:05:00.070Z",
67
-                              "stop_time" => "2016-10-17T07:05:00.070Z",
68
-                              "time_zone" => "UTC"
66
+                                "start_time" => "2016-10-17T07:05:00.070Z",
67
+                                "stop_time" => "2016-10-17T07:05:00.070Z",
68
+                                "time_zone" => "UTC"
69 69
                             ),
70 70
                             "status" => "active",
71 71
                             "variations" => array(
72
-                              array(
72
+                                array(
73 73
                                 "actions" => array(
74
-                                  array(
74
+                                    array(
75 75
                                     "changes" => array(
76
-                                      array(
76
+                                        array(
77 77
                                         "type" => "custom_code",
78 78
                                         "allow_additional_redirect" => true, 
79 79
                                         "async" => true,
80 80
                                         "selector" => "a[href*=\"optimizely\"]",
81 81
                                         "dependencies" => array(
82
-                                          24,
83
-                                          26
82
+                                            24,
83
+                                            26
84 84
                                         ),
85 85
                                         "destination" => "https://app.optimizely.com/",
86 86
                                         "extension_id" => 1234,
@@ -88,23 +88,23 @@  discard block
 block discarded – undo
88 88
                                         "src" => 524,
89 89
                                         "value" => "window.someGlobalFunction();",
90 90
                                         "id" => "string"
91
-                                      )
91
+                                        )
92 92
                                     ),
93 93
                                     "page_id" => 0
94
-                                  )
94
+                                    )
95 95
                                 ),
96 96
                                 "archived"=> true,
97 97
                                 "key" => "blue_button_variation",
98 98
                                 "name" => "Blue Button",
99 99
                                 "variation_id" => 0,
100 100
                                 "weight" => 0
101
-                              )
101
+                                )
102 102
                             ),
103 103
                             "created" => "2016-10-17T07:05:00.070Z",
104 104
                             "id" => 3000,
105 105
                             "is_classic" => false,
106 106
                             "last_modified" => "2016-10-17T07:05:00.070Z"
107
-                          )
107
+                            )
108 108
                         ), 200);
109 109
         
110 110
         $optimizelyApiClientMock->method('sendApiRequest')
@@ -175,20 +175,20 @@  discard block
 block discarded – undo
175 175
         $result = new Result(array(
176 176
                             "project_id" => 1000,
177 177
                             "audience_ids" => array(
178
-                              1234,
179
-                              1212,
180
-                              1432
178
+                                1234,
179
+                                1212,
180
+                                1432
181 181
                             ),
182 182
                             "campaign_id" => 2000,
183 183
                             "changes" => array(
184
-                              array(
184
+                                array(
185 185
                                 "type" => "custom_code",
186 186
                                 "allow_additional_redirect" => true,
187 187
                                 "async" => true,
188 188
                                 "selector" => "a[href*=\"optimizely\"]",
189 189
                                 "dependencies" => array(
190
-                                  24,
191
-                                  26
190
+                                    24,
191
+                                    26
192 192
                                 ),
193 193
                                 "destination" => "https://app.optimizely.com/",
194 194
                                 "extension_id" => 1234,
@@ -196,39 +196,39 @@  discard block
 block discarded – undo
196 196
                                 "src" => 524,
197 197
                                 "value" => "window.someGlobalFunction();",
198 198
                                 "id" => "string"
199
-                              )
199
+                                )
200 200
                             ),
201 201
                             "description" => "string",
202 202
                             "holdback" => 5000,
203 203
                             "key" => "home_page_experiment",
204 204
                             "metrics" => array(
205
-                              array(
205
+                                array(
206 206
                                 "aggregator" => "unique",
207 207
                                 "event_id" => 0,
208 208
                                 "field" => "revenue",
209 209
                                 "scope" => "session"
210
-                              )
210
+                                )
211 211
                             ),
212 212
                             "name" => "Blue Button Experiment",
213 213
                             "schedule" => array(
214
-                              "start_time" => "2016-10-17T07:05:00.070Z",
215
-                              "stop_time" => "2016-10-17T07:05:00.070Z",
216
-                              "time_zone" => "UTC"
214
+                                "start_time" => "2016-10-17T07:05:00.070Z",
215
+                                "stop_time" => "2016-10-17T07:05:00.070Z",
216
+                                "time_zone" => "UTC"
217 217
                             ),
218 218
                             "status" => "active",
219 219
                             "variations" => array(
220
-                              array(
220
+                                array(
221 221
                                 "actions" => array(
222
-                                  array(
222
+                                    array(
223 223
                                     "changes" => array(
224
-                                      array(
224
+                                        array(
225 225
                                         "type" => "custom_code",
226 226
                                         "allow_additional_redirect" => true, 
227 227
                                         "async" => true,
228 228
                                         "selector" => "a[href*=\"optimizely\"]",
229 229
                                         "dependencies" => array(
230
-                                          24,
231
-                                          26
230
+                                            24,
231
+                                            26
232 232
                                         ),
233 233
                                         "destination" => "https://app.optimizely.com/",
234 234
                                         "extension_id" => 1234,
@@ -236,23 +236,23 @@  discard block
 block discarded – undo
236 236
                                         "src" => 524,
237 237
                                         "value" => "window.someGlobalFunction();",
238 238
                                         "id" => "string"
239
-                                      )
239
+                                        )
240 240
                                     ),
241 241
                                     "page_id" => 0
242
-                                  )
242
+                                    )
243 243
                                 ),
244 244
                                 "archived"=> true,
245 245
                                 "key" => "blue_button_variation",
246 246
                                 "name" => "Blue Button",
247 247
                                 "variation_id" => 0,
248 248
                                 "weight" => 0
249
-                              )
249
+                                )
250 250
                             ),
251 251
                             "created" => "2016-10-17T07:05:00.070Z",
252 252
                             "id" => 3000,
253 253
                             "is_classic" => false,
254 254
                             "last_modified" => "2016-10-17T07:05:00.070Z"
255
-                          ), 200);
255
+                            ), 200);
256 256
         
257 257
         $optimizelyApiClientMock->method('sendApiRequest')
258 258
                     ->willReturn($result);
@@ -308,7 +308,7 @@  discard block
 block discarded – undo
308 308
                             "end_time" => "2016-10-17T07:05:00.089Z",
309 309
                             "experiment_id" => 3000,
310 310
                             "metrics" => array(
311
-                              array(
311
+                                array(
312 312
                                 "event" => "string",
313 313
                                 "event_name" => "string",
314 314
                                 "measure" => "conversions",
@@ -316,54 +316,54 @@  discard block
 block discarded – undo
316 316
                                 "priority" => 1,
317 317
                                 "unit" => "session",
318 318
                                 "variation_results" => array(
319
-                                  "9000" => array(
319
+                                    "9000" => array(
320 320
                                     "experiment_id" => 0,
321 321
                                     "is_baseline" => true,
322 322
                                     "lift" => array(
323
-                                      "confidence_interval" => array(
323
+                                        "confidence_interval" => array(
324 324
                                         0.010399560300730457,
325 325
                                         0.0850821459929161
326
-                                      ),
327
-                                      "is_most_conclusive" => true,
328
-                                      "is_significant" => true,
329
-                                      "significance" => 0,
330
-                                      "value" => 0,
331
-                                      "visitors_remaining" => 0
326
+                                        ),
327
+                                        "is_most_conclusive" => true,
328
+                                        "is_significant" => true,
329
+                                        "significance" => 0,
330
+                                        "value" => 0,
331
+                                        "visitors_remaining" => 0
332 332
                                     ),
333 333
                                     "name" => "Blue Button",
334 334
                                     "rate" => 0,
335 335
                                     "scope" => "variation",
336 336
                                     "total_increase" => array(
337
-                                      "confidence_interval" => array(
337
+                                        "confidence_interval" => array(
338 338
                                         0.010399560300730457,
339 339
                                         0.0850821459929161
340
-                                      ),
341
-                                      "is_most_conclusive" => true,
342
-                                      "is_significant" => true,
343
-                                      "significance" => 0,
344
-                                      "value" => 0,
345
-                                      "visitors_remaining" => 0
340
+                                        ),
341
+                                        "is_most_conclusive" => true,
342
+                                        "is_significant" => true,
343
+                                        "significance" => 0,
344
+                                        "value" => 0,
345
+                                        "visitors_remaining" => 0
346 346
                                     ),
347 347
                                     "value" => 0,
348 348
                                     "variation_id" => "string"
349
-                                  )
349
+                                    )
350
+                                )
350 351
                                 )
351
-                              )
352 352
                             ),
353 353
                             "reach" => array(
354
-                              "baseline_count" => 0,
355
-                              "baseline_reach" => 0,
356
-                              "total_count" => 0,
357
-                              "treatment_count" => 0,
358
-                              "treatment_reach" => 0,
359
-                              "variations" => array(
354
+                                "baseline_count" => 0,
355
+                                "baseline_reach" => 0,
356
+                                "total_count" => 0,
357
+                                "treatment_count" => 0,
358
+                                "treatment_reach" => 0,
359
+                                "variations" => array(
360 360
                                 "9000" => array(
361
-                                  "count" => 0,
362
-                                  "name" => "Blue Button",
363
-                                  "variation_id" => "string",
364
-                                  "variation_reach" => 0
361
+                                    "count" => 0,
362
+                                    "name" => "Blue Button",
363
+                                    "variation_id" => "string",
364
+                                    "variation_reach" => 0
365
+                                )
365 366
                                 )
366
-                              )
367 367
                             ),
368 368
                             "start_time" => "2016-10-17T07:05:00.090Z"
369 369
                         ), 200);
@@ -390,20 +390,20 @@  discard block
 block discarded – undo
390 390
         $result = new Result(array(
391 391
                             "project_id" => 1000,
392 392
                             "audience_ids" => array(
393
-                              1234,
394
-                              1212,
395
-                              1432
393
+                                1234,
394
+                                1212,
395
+                                1432
396 396
                             ),
397 397
                             "campaign_id" => 2000,
398 398
                             "changes" => array(
399
-                              array(
399
+                                array(
400 400
                                 "type" => "custom_code",
401 401
                                 "allow_additional_redirect" => true,
402 402
                                 "async" => true,
403 403
                                 "selector" => "a[href*=\"optimizely\"]",
404 404
                                 "dependencies" => array(
405
-                                  24,
406
-                                  26
405
+                                    24,
406
+                                    26
407 407
                                 ),
408 408
                                 "destination" => "https://app.optimizely.com/",
409 409
                                 "extension_id" => 1234,
@@ -411,39 +411,39 @@  discard block
 block discarded – undo
411 411
                                 "src" => 524,
412 412
                                 "value" => "window.someGlobalFunction();",
413 413
                                 "id" => "string"
414
-                              )
414
+                                )
415 415
                             ),
416 416
                             "description" => "string",
417 417
                             "holdback" => 5000,
418 418
                             "key" => "home_page_experiment",
419 419
                             "metrics" => array(
420
-                              array(
420
+                                array(
421 421
                                 "aggregator" => "unique",
422 422
                                 "event_id" => 0,
423 423
                                 "field" => "revenue",
424 424
                                 "scope" => "session"
425
-                              )
425
+                                )
426 426
                             ),
427 427
                             "name" => "Blue Button Experiment",
428 428
                             "schedule" => array(
429
-                              "start_time" => "2016-10-17T07:05:00.099Z",
430
-                              "stop_time" => "2016-10-17T07:05:00.099Z",
431
-                              "time_zone" => "UTC"
429
+                                "start_time" => "2016-10-17T07:05:00.099Z",
430
+                                "stop_time" => "2016-10-17T07:05:00.099Z",
431
+                                "time_zone" => "UTC"
432 432
                             ),
433 433
                             "status" => "active",
434 434
                             "variations" => array(
435
-                              array(
435
+                                array(
436 436
                                 "actions" => array(
437
-                                  array(
437
+                                    array(
438 438
                                     "changes" => array(
439
-                                      array(
439
+                                        array(
440 440
                                         "type" => "custom_code",
441 441
                                         "allow_additional_redirect" => true,
442 442
                                         "async" => true,
443 443
                                         "selector" => "a[href*=\"optimizely\"]",
444 444
                                         "dependencies" => array(
445
-                                          24,
446
-                                          26
445
+                                            24,
446
+                                            26
447 447
                                         ),
448 448
                                         "destination" => "https://app.optimizely.com/",
449 449
                                         "extension_id" => 1234,
@@ -451,17 +451,17 @@  discard block
 block discarded – undo
451 451
                                         "src" => 524,
452 452
                                         "value" => "window.someGlobalFunction();",
453 453
                                         "id" => "string"
454
-                                      )
454
+                                        )
455 455
                                     ),
456 456
                                     "page_id" => 0
457
-                                  )
457
+                                    )
458 458
                                 ),
459 459
                                 "archived" => true,
460 460
                                 "key" => "blue_button_variation",
461 461
                                 "name" => "Blue Button",
462 462
                                 "variation_id" => 0,
463 463
                                 "weight" => 0
464
-                              )
464
+                                )
465 465
                             ),
466 466
                             "created" => "2016-10-17T07:05:00.099Z",
467 467
                             "id" => 3000,
@@ -477,76 +477,76 @@  discard block
 block discarded – undo
477 477
         $experiment = new Experiment(array(
478 478
             "project_id" => 1000,
479 479
             "audience_ids" => array(
480
-              1234,
481
-              1212,
482
-              1432
480
+                1234,
481
+                1212,
482
+                1432
483 483
             ),
484 484
             "campaign_id" => 2000,
485 485
             "changes" => array(
486
-              array(
486
+                array(
487 487
                 "type" => "custom_code",
488 488
                 "allow_additional_redirect" => true,
489 489
                 "async" => true,
490 490
                 "selector" => "a[href*=\"optimizely\"]",
491 491
                 "dependencies" => array(
492
-                  24,
493
-                  26
492
+                    24,
493
+                    26
494 494
                 ),
495 495
                 "destination" => "https://app.optimizely.com/",
496 496
                 "extension_id" => 1234,
497 497
                 "preserve_parameters" => true,
498 498
                 "src" => 524,
499 499
                 "value" => "window.someGlobalFunction();"
500
-              )
500
+                )
501 501
             ),
502 502
             "description" => "string",
503 503
             "holdback" => 5000,
504 504
             "key" => "home_page_experiment",
505 505
             "metrics" => array(
506
-              array(
506
+                array(
507 507
                 "aggregator" => "unique",
508 508
                 "event_id" => 0,
509 509
                 "field" => "revenue",
510 510
                 "scope" => "session"
511
-              )
511
+                )
512 512
             ),
513 513
             "name" => "Blue Button Experiment",
514 514
             "schedule" => array(
515
-              "start_time" => "2016-10-17T07:04:59.724Z",
516
-              "stop_time" => "2016-10-17T07:04:59.724Z",
517
-              "time_zone" => "UTC"
515
+                "start_time" => "2016-10-17T07:04:59.724Z",
516
+                "stop_time" => "2016-10-17T07:04:59.724Z",
517
+                "time_zone" => "UTC"
518 518
             ),
519 519
             "status" => "active",
520 520
             "variations" => array(
521
-              array(
521
+                array(
522 522
                 "actions" => array(
523
-                  array(
523
+                    array(
524 524
                     "changes" => array(
525
-                      array(
525
+                        array(
526 526
                         "type" => "custom_code",
527 527
                         "allow_additional_redirect" => true,
528 528
                         "async" => true,
529 529
                         "selector" => "a[href*=\"optimizely\"]",
530 530
                         "dependencies" => array(
531
-                          24,
532
-                          26
531
+                            24,
532
+                            26
533 533
                         ),
534 534
                         "destination" => "https://app.optimizely.com/",
535 535
                         "extension_id" => 1234,
536 536
                         "preserve_parameters" => true,
537 537
                         "src" => 524,
538 538
                         "value" => "window.someGlobalFunction();"
539
-                      )
539
+                        )
540 540
                     ),
541 541
                     "page_id" => 0
542
-                  )
542
+                    )
543 543
                 ),
544 544
                 "archived" => true,
545 545
                 "key" => "blue_button_variation",
546 546
                 "name" => "Blue Button",
547 547
                 "variation_id" => 0,
548 548
                 "weight" => 0
549
-              )
549
+                )
550 550
             )
551 551
         ));
552 552
         
@@ -567,20 +567,20 @@  discard block
 block discarded – undo
567 567
         $result = new Result(array(
568 568
                         "project_id" => 1000,
569 569
                         "audience_ids" => array(
570
-                          1234,
571
-                          1212,
572
-                          1432
570
+                            1234,
571
+                            1212,
572
+                            1432
573 573
                         ),
574 574
                         "campaign_id" => 2000,
575 575
                         "changes" => array(
576
-                          array(
576
+                            array(
577 577
                             "type" => "custom_code",
578 578
                             "allow_additional_redirect" => true,
579 579
                             "async" => true,
580 580
                             "selector" => "a[href*=\"optimizely\"]",
581 581
                             "dependencies" => array(
582
-                              24,
583
-                              26
582
+                                24,
583
+                                26
584 584
                             ),
585 585
                             "destination" => "https://app.optimizely.com/",
586 586
                             "extension_id" => 1234,
@@ -588,39 +588,39 @@  discard block
 block discarded – undo
588 588
                             "src" => 524,
589 589
                             "value" => "window.someGlobalFunction();",
590 590
                             "id" => "string"
591
-                          )
591
+                            )
592 592
                         ),
593 593
                         "description" => "string",
594 594
                         "holdback" => 5000,
595 595
                         "key" => "home_page_experiment",
596 596
                         "metrics" => array(
597
-                          array(
597
+                            array(
598 598
                             "aggregator" => "unique",
599 599
                             "event_id" => 0,
600 600
                             "field" => "revenue",
601 601
                             "scope" => "session"
602
-                          )
602
+                            )
603 603
                         ),
604 604
                         "name" => "Blue Button Experiment",
605 605
                         "schedule" => array(
606
-                          "start_time" => "2016-10-17T07:05:00.109Z",
607
-                          "stop_time" => "2016-10-17T07:05:00.109Z",
608
-                          "time_zone" => "UTC"
606
+                            "start_time" => "2016-10-17T07:05:00.109Z",
607
+                            "stop_time" => "2016-10-17T07:05:00.109Z",
608
+                            "time_zone" => "UTC"
609 609
                         ),
610 610
                         "status" => "active",
611 611
                         "variations" => array(
612
-                          array(
612
+                            array(
613 613
                             "actions" => array(
614
-                              array(
614
+                                array(
615 615
                                 "changes" => array(
616
-                                  array(
616
+                                    array(
617 617
                                     "type" => "custom_code",
618 618
                                     "allow_additional_redirect" => true,
619 619
                                     "async" => true,
620 620
                                     "selector" => "a[href*=\"optimizely\"]",
621 621
                                     "dependencies" => array(
622
-                                      24,
623
-                                      26
622
+                                        24,
623
+                                        26
624 624
                                     ),
625 625
                                     "destination" => "https://app.optimizely.com/",
626 626
                                     "extension_id" => 1234,
@@ -628,17 +628,17 @@  discard block
 block discarded – undo
628 628
                                     "src" => 524,
629 629
                                     "value" => "window.someGlobalFunction();",
630 630
                                     "id" => "string"
631
-                                  )
631
+                                    )
632 632
                                 ),
633 633
                                 "page_id" => 0
634
-                              )
634
+                                )
635 635
                             ),
636 636
                             "archived" => true,
637 637
                             "key" => "blue_button_variation",
638 638
                             "name" => "Blue Button",
639 639
                             "variation_id" => 0,
640 640
                             "weight" => 0
641
-                          )
641
+                            )
642 642
                         ),
643 643
                         "created" => "2016-10-17T07:05:00.109Z",
644 644
                         "id" => 3000,
@@ -652,75 +652,75 @@  discard block
 block discarded – undo
652 652
         $experimentsService = new Experiments($optimizelyApiClientMock);
653 653
         
654 654
         $experiment = new Experiment(array(
655
-              "audience_ids" => array(
655
+                "audience_ids" => array(
656 656
                 0
657
-              ),
658
-              "changes" => array(
657
+                ),
658
+                "changes" => array(
659 659
                 array(
660
-                  "type" => "custom_code",
661
-                  "allow_additional_redirect" => true,
662
-                  "async" => true,
663
-                  "selector" => "a[href*=\"optimizely\"]",
664
-                  "dependencies" => array(
660
+                    "type" => "custom_code",
661
+                    "allow_additional_redirect" => true,
662
+                    "async" => true,
663
+                    "selector" => "a[href*=\"optimizely\"]",
664
+                    "dependencies" => array(
665 665
                     24,
666 666
                     26
667
-                  ),
668
-                  "destination" => "https://app.optimizely.com/",
669
-                  "extension_id" => 1234,
670
-                  "preserve_parameters" => true,
671
-                  "src" => 524,
672
-                  "value" => "window.someGlobalFunction();"
667
+                    ),
668
+                    "destination" => "https://app.optimizely.com/",
669
+                    "extension_id" => 1234,
670
+                    "preserve_parameters" => true,
671
+                    "src" => 524,
672
+                    "value" => "window.someGlobalFunction();"
673 673
                 )
674
-              ),
675
-              "description" => "AB Test to see if the Blue Button converts more visitors",
676
-              "holdback" => 0,
677
-              "key" => "home_page_experiment",
678
-              "metrics" => array(
674
+                ),
675
+                "description" => "AB Test to see if the Blue Button converts more visitors",
676
+                "holdback" => 0,
677
+                "key" => "home_page_experiment",
678
+                "metrics" => array(
679 679
                 array(
680
-                  "aggregator" => "unique",
681
-                  "event_id" => 0,
682
-                  "field" => "revenue",
683
-                  "scope" => "session"
680
+                    "aggregator" => "unique",
681
+                    "event_id" => 0,
682
+                    "field" => "revenue",
683
+                    "scope" => "session"
684 684
                 )
685
-              ),
686
-              "name" => "Blue Button Experiment",
687
-              "schedule" => array(
685
+                ),
686
+                "name" => "Blue Button Experiment",
687
+                "schedule" => array(
688 688
                 "start_time" => "2016-10-17T07:04:59.731Z",
689 689
                 "stop_time" => "2016-10-17T07:04:59.731Z",
690 690
                 "time_zone" => "UTC"
691
-              ),
692
-              "status" => "active",
693
-              "variations" => array(
691
+                ),
692
+                "status" => "active",
693
+                "variations" => array(
694 694
                 array(
695
-                  "actions" => array(
695
+                    "actions" => array(
696 696
                     array(
697
-                      "changes" => array(
697
+                        "changes" => array(
698 698
                         array(
699
-                          "type" => "custom_code",
700
-                          "allow_additional_redirect" => true,
701
-                          "async" => true,
702
-                          "selector" => "a[href*=\"optimizely\"]",
703
-                          "dependencies" => array(
699
+                            "type" => "custom_code",
700
+                            "allow_additional_redirect" => true,
701
+                            "async" => true,
702
+                            "selector" => "a[href*=\"optimizely\"]",
703
+                            "dependencies" => array(
704 704
                             24,
705 705
                             26
706
-                          ),
707
-                          "destination" => "https://app.optimizely.com/",
708
-                          "extension_id" => 1234,
709
-                          "preserve_parameters" => true,
710
-                          "src" => 524,
711
-                          "value" => "window.someGlobalFunction();"
706
+                            ),
707
+                            "destination" => "https://app.optimizely.com/",
708
+                            "extension_id" => 1234,
709
+                            "preserve_parameters" => true,
710
+                            "src" => 524,
711
+                            "value" => "window.someGlobalFunction();"
712 712
                         )
713
-                      ),
714
-                      "page_id" => 0
713
+                        ),
714
+                        "page_id" => 0
715 715
                     )
716
-                  ),
717
-                  "archived" => true,
718
-                  "key" => "blue_button_variation",
719
-                  "name" => "Blue Button",
720
-                  "variation_id" => 0,
721
-                  "weight" => 0
716
+                    ),
717
+                    "archived" => true,
718
+                    "key" => "blue_button_variation",
719
+                    "name" => "Blue Button",
720
+                    "variation_id" => 0,
721
+                    "weight" => 0
722
+                )
722 723
                 )
723
-              )
724 724
         ));
725 725
         
726 726
         $result = $experimentsService->update(1000, $experiment, 'start');
@@ -768,14 +768,14 @@  discard block
 block discarded – undo
768 768
             "platform" => "web",
769 769
             "status" => "active",
770 770
             "web_snippet" => array(
771
-              "enable_force_variation" => false,
772
-              "exclude_disabled_experiments" => false,
773
-              "exclude_names" => true,
774
-              "include_jquery" => true,
775
-              "ip_anonymization" => false,
776
-              "ip_filter" => "^206\\.23\\.100\\.([5-9][0-9]|1([0-4][0-9]|50))$",
777
-              "library" => "jquery-1.11.3-trim",
778
-              "project_javascript" => "alert(\"Active Experiment\")"
771
+                "enable_force_variation" => false,
772
+                "exclude_disabled_experiments" => false,
773
+                "exclude_names" => true,
774
+                "include_jquery" => true,
775
+                "ip_anonymization" => false,
776
+                "ip_filter" => "^206\\.23\\.100\\.([5-9][0-9]|1([0-4][0-9]|50))$",
777
+                "library" => "jquery-1.11.3-trim",
778
+                "project_javascript" => "alert(\"Active Experiment\")"
779 779
             )
780 780
         ));
781 781
         
@@ -804,22 +804,22 @@  discard block
 block discarded – undo
804 804
         
805 805
         // Create new event in the project
806 806
         $event = new ClickEvent(array(
807
-              "event_filter" => array(
807
+                "event_filter" => array(
808 808
                 "filter_type" => "target_selector",
809 809
                 "selector" => ".menu-options"
810
-              ),
811
-              "name" => "Add to Cart",
812
-              "archived" => true,
813
-              "category" => "add_to_cart",
814
-              "description" => "Some simple event",
815
-              "event_type" => "click",
816
-              "key" => "add_to_cart",
817
-              "created" => "2016-10-18T05:07:04.153Z",
818
-              "id" => 0,
819
-              "is_classic" => false,
820
-              //"is_editable" => true,
821
-              "page_id" => $createdPage->getId(),
822
-              "project_id" => $createdProject->getId()
810
+                ),
811
+                "name" => "Add to Cart",
812
+                "archived" => true,
813
+                "category" => "add_to_cart",
814
+                "description" => "Some simple event",
815
+                "event_type" => "click",
816
+                "key" => "add_to_cart",
817
+                "created" => "2016-10-18T05:07:04.153Z",
818
+                "id" => 0,
819
+                "is_classic" => false,
820
+                //"is_editable" => true,
821
+                "page_id" => $createdPage->getId(),
822
+                "project_id" => $createdProject->getId()
823 823
         ));
824 824
         
825 825
         $result = $optimizelyClient->events()->createClickEvent($createdPage->getId(), $event);
@@ -944,12 +944,12 @@  discard block
 block discarded – undo
944 944
             "holdback" => 5000,
945 945
             "key" => "home_page_experiment",
946 946
             "metrics" => array(
947
-              array(
947
+                array(
948 948
                 "aggregator" => "unique",
949 949
                 "event_id" => $createdEvent->getId(),
950 950
                 "field" => "revenue",
951 951
                 "scope" => "visitor"
952
-              )
952
+                )
953 953
             ),
954 954
             "name" => "Blue Button Experiment",
955 955
             /*"schedule" => array(
Please login to merge, or discard this patch.