@@ -54,23 +54,23 @@ discard block |
||
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 | } |
@@ -222,7 +222,7 @@ discard block |
||
222 | 222 | } |
223 | 223 | |
224 | 224 | // Order by low bound. |
225 | - uasort($numVals, function (array $i1, array $i2) { |
|
225 | + uasort($numVals, function(array $i1, array $i2) { |
|
226 | 226 | return ($i1[0] < $i2[0]) ? -1 : 1; |
227 | 227 | }); |
228 | 228 | |
@@ -238,7 +238,7 @@ discard block |
||
238 | 238 | } |
239 | 239 | |
240 | 240 | // Order by high bound. |
241 | - uasort($numVals, function (array $i1, array $i2) { |
|
241 | + uasort($numVals, function(array $i1, array $i2) { |
|
242 | 242 | return ($i1[1] < $i2[1]) ? -1 : 1; |
243 | 243 | }); |
244 | 244 | |
@@ -280,7 +280,7 @@ discard block |
||
280 | 280 | !empty($t) ? $this->palette->getColor($colorval) : 50, // Interval color |
281 | 281 | ($this->boundToString)($lowBound), // Interval start string value |
282 | 282 | ($this->boundToString)($highBound), // Interval end string value |
283 | - !empty($t) ? ($stingval) : null,// Interval string value |
|
283 | + !empty($t) ? ($stingval) : null, // Interval string value |
|
284 | 284 | ]; |
285 | 285 | } |
286 | 286 | } |
@@ -288,7 +288,7 @@ discard block |
||
288 | 288 | // Put discrete values at the end and reset indices. |
289 | 289 | // Reseting indices ensures the processed values are |
290 | 290 | // serialized as correctly ordered JSON arrays. |
291 | - usort($numVals, function ($i) { |
|
291 | + usort($numVals, function($i) { |
|
292 | 292 | return count($i) === 2 ? 1 : -1; |
293 | 293 | }); |
294 | 294 | |
@@ -314,7 +314,7 @@ discard block |
||
314 | 314 | ); |
315 | 315 | |
316 | 316 | // Remove empty interval generated when two or more intervals share a common bound. |
317 | - $adjacentIntervals = array_values(array_filter($adjacentIntervals, function ($i) { |
|
317 | + $adjacentIntervals = array_values(array_filter($adjacentIntervals, function($i) { |
|
318 | 318 | // Use weak comparison in case of object typed bounds. |
319 | 319 | return $i[0] != $i[1]; |
320 | 320 | })); |
@@ -339,7 +339,7 @@ discard block |
||
339 | 339 | */ |
340 | 340 | public static function extractDiscreteValues(array &$intervals) |
341 | 341 | { |
342 | - $discreteValues = array_filter($intervals, function ($interval) { |
|
342 | + $discreteValues = array_filter($intervals, function($interval) { |
|
343 | 343 | return $interval[0] === $interval[1]; |
344 | 344 | }); |
345 | 345 | |
@@ -366,7 +366,7 @@ discard block |
||
366 | 366 | $bounds[] = [$interval[1], isset($interval[2]) ? $interval[2] : null, '-', $key]; |
367 | 367 | } |
368 | 368 | // Order the bounds. |
369 | - usort($bounds, function (array $d1, array $d2) { |
|
369 | + usort($bounds, function(array $d1, array $d2) { |
|
370 | 370 | return ($d1[0] < $d2[0]) ? -1 : 1; |
371 | 371 | }); |
372 | 372 | return $bounds; |
@@ -447,7 +447,7 @@ discard block |
||
447 | 447 | } |
448 | 448 | |
449 | 449 | // Order by high bound. |
450 | - uasort($numericIntervals, function (array $i1, array $i2) { |
|
450 | + uasort($numericIntervals, function(array $i1, array $i2) { |
|
451 | 451 | return ($i1[1] < $i2[1]) ? -1 : 1; |
452 | 452 | }); |
453 | 453 | |
@@ -476,7 +476,7 @@ discard block |
||
476 | 476 | // Put discrete values at the end and reset indices. |
477 | 477 | // Reseting indices ensures the processed values are |
478 | 478 | // serialized as correctly ordered JSON arrays. |
479 | - usort($numericIntervals, function ($i) { |
|
479 | + usort($numericIntervals, function($i) { |
|
480 | 480 | return !is_array($i) ? 1 : -1; |
481 | 481 | }); |
482 | 482 |