Passed
Push — master ( 1101eb...a0d90f )
by Ruben
01:46
created
src/Persistence.php 2 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -175,7 +175,7 @@  discard block
 block discarded – undo
175 175
      * @param $config Configuration
176 176
      *
177 177
      */
178
-    public static function getCountsFromTest($pdo, $config, $tests){
178
+    public static function getCountsFromTest($pdo, $config, $tests) {
179 179
         $resp = [];
180 180
         foreach ($tests as $test) {
181 181
             $counts = self::getCountsById($pdo, $config, $test[0]);
@@ -189,7 +189,7 @@  discard block
 block discarded – undo
189 189
      * @param $config Configuration
190 190
      *
191 191
      */
192
-    public static function getFromByTest($pdo, $config, $tests){
192
+    public static function getFromByTest($pdo, $config, $tests) {
193 193
         $resp = [];
194 194
         foreach ($tests as $test) {
195 195
             $counts = FromDAO::findByFromById($pdo, $config, $test[1][1], $test[1][0]);
@@ -274,7 +274,7 @@  discard block
 block discarded – undo
274 274
      * @param $config Configuration
275 275
      *
276 276
      */
277
-    public static function findIdByTimeUser($pdo, $config, $by=[]) {
277
+    public static function findIdByTimeUser($pdo, $config, $by = []) {
278 278
         return OptionsDAO::findIdByTimeUser($pdo, $config, $by);
279 279
     }
280 280
     
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -179,7 +179,9 @@
 block discarded – undo
179 179
         $resp = [];
180 180
         foreach ($tests as $test) {
181 181
             $counts = self::getCountsById($pdo, $config, $test[0]);
182
-            if (count($counts) > 0) $resp[] = $counts;            
182
+            if (count($counts) > 0) {
183
+                $resp[] = $counts;
184
+            }
183 185
         }   
184 186
         return $resp;
185 187
     }
Please login to merge, or discard this patch.
src/FromDAO.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -76,7 +76,7 @@
 block discarded – undo
76 76
         $dbFromtable = $config->getFromTableName();
77 77
         $qdata = [$id];
78 78
         $tquery = "SELECT f.* FROM $dbFromtable f WHERE f.id = ?";
79
-        if ($from_id != null) {
79
+        if ($from_id!=null) {
80 80
             $tquery = $tquery." AND f.from_id = ?";
81 81
             $qdata[] = $from_id;
82 82
         }
Please login to merge, or discard this patch.
src/SiteAnalyzer.php 2 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
      */
83 83
     public static function getPDO($config, $options)
84 84
     {
85
-        if (array_key_exists("pdo",$options)) {
85
+        if (array_key_exists("pdo", $options)) {
86 86
             return $options["pdo"];
87 87
         }         
88 88
         return  Persistence::getPDO($config);
@@ -185,7 +185,7 @@  discard block
 block discarded – undo
185 185
         }
186 186
         
187 187
         $result = $data;
188
-        for ($i=1;$i<$level;$i++) {
188
+        for ($i = 1; $i < $level; $i++) {
189 189
             $tmp = Matrix::multiply($result, $data);
190 190
             $result = Matrix::sum($result, $tmp);
191 191
         }
@@ -218,7 +218,7 @@  discard block
 block discarded – undo
218 218
         }
219 219
         
220 220
         $result = $data;
221
-        for ($i=1;$i<$level;$i++) {
221
+        for ($i = 1; $i < $level; $i++) {
222 222
             $tmp = Matrix::multiply($result, $data);
223 223
             $result = Matrix::sum($result, $tmp);
224 224
         }
Please login to merge, or discard this patch.
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -179,8 +179,7 @@  discard block
 block discarded – undo
179 179
         
180 180
         if (array_key_exists("level", $options)) {
181 181
             $level = $options["level"];
182
-        }
183
-        else {
182
+        } else {
184 183
             $level = count($labels) - 1;
185 184
         }
186 185
         
@@ -212,8 +211,7 @@  discard block
 block discarded – undo
212 211
         
213 212
         if (array_key_exists("level", $options)) {
214 213
             $level = $options["level"];
215
-        }
216
-        else {
214
+        } else {
217 215
             $level = count($labels) - 1;
218 216
         }
219 217
         
Please login to merge, or discard this patch.
src/Statistics.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -26,14 +26,14 @@
 block discarded – undo
26 26
     public static function ABtest($testCounts, $targetCounts, $options)
27 27
     {
28 28
         $ntotal = 0;
29
-        $resp  = [];
30
-        foreach($testCounts as $testCount) {
29
+        $resp = [];
30
+        foreach ($testCounts as $testCount) {
31 31
             $ntotal += $testCount[1];
32 32
         }
33
-        foreach($testCounts as $testCount) {
33
+        foreach ($testCounts as $testCount) {
34 34
             foreach ($targetCounts as $targetCount) {
35
-                if ($testCount[0] === $targetCount[1]) {
36
-                    $resp[] = [$testCount[0], $testCount[1], $testCount[1]/$ntotal, $targetCount[2], $targetCount[2]/$testCount[1],$targetCount[2]/$ntotal];
35
+                if ($testCount[0]===$targetCount[1]) {
36
+                    $resp[] = [$testCount[0], $testCount[1], $testCount[1] / $ntotal, $targetCount[2], $targetCount[2] / $testCount[1], $targetCount[2] / $ntotal];
37 37
                 }                
38 38
             }
39 39
             
Please login to merge, or discard this patch.