Completed
Push — master ( 761598...d09c54 )
by Victor
02:43
created
src/IntervalGraph.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -54,23 +54,23 @@  discard block
 block discarded – undo
54 54
             $this->setIntervals($intervals);
55 55
         }
56 56
 
57
-        $this->boundToNumeric = function (DateTime $bound) {
57
+        $this->boundToNumeric = function(DateTime $bound) {
58 58
             return $bound->getTimestamp();
59 59
         };
60 60
 
61
-        $this->boundToString = function (DateTime $bound) {
61
+        $this->boundToString = function(DateTime $bound) {
62 62
             return $bound->format("Y-m-d");
63 63
         };
64 64
 
65
-        $this->valueToNumeric = function ($v) {
65
+        $this->valueToNumeric = function($v) {
66 66
             return $v === null ? null : (int)($v * 100);
67 67
         };
68 68
 
69
-        $this->valueToString = function ($v) {
69
+        $this->valueToString = function($v) {
70 70
             return $v === null ? null : ($v * 100 . '%');
71 71
         };
72 72
 
73
-        $this->aggregateFunction = function ($a, $b) {
73
+        $this->aggregateFunction = function($a, $b) {
74 74
             if ($a === null && $b === null) {
75 75
                 return null;
76 76
             }
@@ -225,7 +225,7 @@  discard block
 block discarded – undo
225 225
         }
226 226
 
227 227
         // Order by low bound.
228
-        uasort($numVals, function (array $i1, array $i2) {
228
+        uasort($numVals, function(array $i1, array $i2) {
229 229
             return ($i1[0] < $i2[0]) ? -1 : 1;
230 230
         });
231 231
 
@@ -241,7 +241,7 @@  discard block
 block discarded – undo
241 241
         }
242 242
 
243 243
         // Order by high bound.
244
-        uasort($numVals, function (array $i1, array $i2) {
244
+        uasort($numVals, function(array $i1, array $i2) {
245 245
             return ($i1[1] < $i2[1]) ? -1 : 1;
246 246
         });
247 247
 
@@ -283,7 +283,7 @@  discard block
 block discarded – undo
283 283
                     !empty($t) ? $this->palette->getColor($colorval) : 50, // Interval color
284 284
                     ($this->boundToString)($lowBound), // Interval start string value
285 285
                     ($this->boundToString)($highBound), // Interval end string value
286
-                    !empty($t) ? ($stingval) : null,// Interval string value
286
+                    !empty($t) ? ($stingval) : null, // Interval string value
287 287
                 ];
288 288
             }
289 289
         }
@@ -291,7 +291,7 @@  discard block
 block discarded – undo
291 291
         // Put discrete values at the end and reset indices.
292 292
         // Reseting indices ensures the processed values are
293 293
         // serialized as correctly ordered JSON arrays.
294
-        usort($numVals, function ($i) {
294
+        usort($numVals, function($i) {
295 295
             return count($i) === 2 ? 1 : -1;
296 296
         });
297 297
 
@@ -315,7 +315,7 @@  discard block
 block discarded – undo
315 315
         $adjacentIntervals = self::calcAdjacentIntervals($signedBounds, $intervals, $aggregateFunction);
316 316
 
317 317
         // Remove empty interval generated when two or more intervals share a common bound.
318
-        $adjacentIntervals = array_values(array_filter($adjacentIntervals, function ($i) {
318
+        $adjacentIntervals = array_values(array_filter($adjacentIntervals, function($i) {
319 319
             // Use weak comparison in case of object typed bounds.
320 320
             return $i[0] != $i[1];
321 321
         }));
@@ -340,7 +340,7 @@  discard block
 block discarded – undo
340 340
      */
341 341
     public static function extractDiscreteValues(array &$intervals)
342 342
     {
343
-        $discreteValues = array_filter($intervals, function ($interval) {
343
+        $discreteValues = array_filter($intervals, function($interval) {
344 344
             return $interval[0] === $interval[1];
345 345
         });
346 346
 
@@ -367,7 +367,7 @@  discard block
 block discarded – undo
367 367
             $bounds[] = [$interval[1], isset($interval[2]) ? $interval[2] : null, '-', $key];
368 368
         }
369 369
         // Order the bounds.
370
-        usort($bounds, function (array $d1, array $d2) {
370
+        usort($bounds, function(array $d1, array $d2) {
371 371
             return ($d1[0] < $d2[0]) ? -1 : 1;
372 372
         });
373 373
         return $bounds;
@@ -447,13 +447,13 @@  discard block
 block discarded – undo
447 447
         }
448 448
 
449 449
         // Order by low bound.
450
-        uasort($numericIntervals, function (array $i1, array $i2) {
450
+        uasort($numericIntervals, function(array $i1, array $i2) {
451 451
             return ($i1[0] < $i2[0]) ? -1 : 1;
452 452
         });
453 453
         
454 454
 
455 455
         // Order by high bound.
456
-        uasort($numericIntervals, function (array $i1, array $i2) {
456
+        uasort($numericIntervals, function(array $i1, array $i2) {
457 457
             return ($i1[1] < $i2[1]) ? -1 : 1;
458 458
         });
459 459
         
@@ -482,7 +482,7 @@  discard block
 block discarded – undo
482 482
         // Put discrete values at the end and reset indices.
483 483
         // Reseting indices ensures the processed values are
484 484
         // serialized as correctly ordered JSON arrays.
485
-        usort($numericIntervals, function ($i) {
485
+        usort($numericIntervals, function($i) {
486 486
             return !is_array($i) ? 1 : -1;
487 487
         });
488 488
 
Please login to merge, or discard this patch.