Completed
Push — master ( f2d606...ed3e7f )
by Oleg
02:59
created
lib/WebMarketingROI/OptimizelyPHP/Service/v2/Projects.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -35,13 +35,13 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
         
Please login to merge, or discard this patch.
lib/WebMarketingROI/OptimizelyPHP/Resource/v2/Datapoint.php 2 patches
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -91,8 +91,9 @@
 block discarded – undo
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;
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
         
Please login to merge, or discard this patch.
lib/WebMarketingROI/OptimizelyPHP/Resource/v2/Action.php 2 patches
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -91,8 +91,9 @@
 block discarded – undo
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;
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
         
Please login to merge, or discard this patch.
lib/WebMarketingROI/OptimizelyPHP/Resource/v2/Metric.php 2 patches
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -91,8 +91,9 @@
 block discarded – undo
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;
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -63,9 +63,9 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
         
Please login to merge, or discard this patch.
lib/WebMarketingROI/OptimizelyPHP/Resource/v2/Variation.php 2 patches
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -91,8 +91,9 @@
 block discarded – undo
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;
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
         
Please login to merge, or discard this patch.
lib/WebMarketingROI/OptimizelyPHP/Resource/v2/Change.php 3 patches
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -91,8 +91,9 @@
 block discarded – undo
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;
Please login to merge, or discard this patch.
Doc Comments   +9 added lines patch added patch discarded remove patch
@@ -316,6 +316,9 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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;
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -161,7 +161,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
         
Please login to merge, or discard this patch.
lib/WebMarketingROI/OptimizelyPHP/Resource/v2/Event.php 2 patches
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -91,8 +91,9 @@
 block discarded – undo
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;
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -139,7 +139,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
         
Please login to merge, or discard this patch.
lib/WebMarketingROI/OptimizelyPHP/Resource/v2/VariantResults.php 2 patches
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -91,8 +91,9 @@
 block discarded – undo
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;
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
         
Please login to merge, or discard this patch.
lib/WebMarketingROI/OptimizelyPHP/Resource/v2/CampaignMetricResults.php 2 patches
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -91,8 +91,9 @@
 block discarded – undo
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;
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -88,7 +88,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
         
Please login to merge, or discard this patch.