@@ -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 | } |
@@ -224,7 +224,7 @@ discard block |
||
224 | 224 | } |
225 | 225 | |
226 | 226 | // Order by low bound. |
227 | - uasort($numVals, function (array $i1, array $i2) { |
|
227 | + uasort($numVals, function(array $i1, array $i2) { |
|
228 | 228 | return ($i1[0] < $i2[0]) ? -1 : 1; |
229 | 229 | }); |
230 | 230 | |
@@ -240,7 +240,7 @@ discard block |
||
240 | 240 | } |
241 | 241 | |
242 | 242 | // Order by high bound. |
243 | - uasort($numVals, function (array $i1, array $i2) { |
|
243 | + uasort($numVals, function(array $i1, array $i2) { |
|
244 | 244 | return ($i1[1] < $i2[1]) ? -1 : 1; |
245 | 245 | }); |
246 | 246 | |
@@ -283,7 +283,7 @@ discard block |
||
283 | 283 | !empty($originalValues) ? $this->palette->getColor($colval) : 50, // Interval color |
284 | 284 | ($this->boundToString)($lowBound), // Interval start string value |
285 | 285 | ($this->boundToString)($highBound), // Interval end string value |
286 | - !empty($originalValues) ? ($strval) : null,// Interval string value |
|
286 | + !empty($originalValues) ? ($strval) : null, // Interval string value |
|
287 | 287 | ]; |
288 | 288 | } |
289 | 289 | } |
@@ -291,7 +291,7 @@ discard block |
||
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 | |
@@ -317,7 +317,7 @@ discard block |
||
317 | 317 | ); |
318 | 318 | |
319 | 319 | // Remove empty interval generated when two or more intervals share a common bound. |
320 | - $adjacentIntervals = array_values(array_filter($adjacentIntervals, function ($i) { |
|
320 | + $adjacentIntervals = array_values(array_filter($adjacentIntervals, function($i) { |
|
321 | 321 | // Use weak comparison in case of object typed bounds. |
322 | 322 | return $i[0] != $i[1]; |
323 | 323 | })); |
@@ -342,7 +342,7 @@ discard block |
||
342 | 342 | */ |
343 | 343 | public static function extractDiscreteValues(array &$intervals) |
344 | 344 | { |
345 | - $discreteValues = array_filter($intervals, function ($interval) { |
|
345 | + $discreteValues = array_filter($intervals, function($interval) { |
|
346 | 346 | return $interval[0] === $interval[1]; |
347 | 347 | }); |
348 | 348 | |
@@ -369,7 +369,7 @@ discard block |
||
369 | 369 | $bounds[] = [$interval[1], isset($interval[2]) ? $interval[2] : null, '-', $key]; |
370 | 370 | } |
371 | 371 | // Order the bounds. |
372 | - usort($bounds, function (array $d1, array $d2) { |
|
372 | + usort($bounds, function(array $d1, array $d2) { |
|
373 | 373 | return ($d1[0] < $d2[0]) ? -1 : 1; |
374 | 374 | }); |
375 | 375 | return $bounds; |
@@ -450,7 +450,7 @@ discard block |
||
450 | 450 | } |
451 | 451 | |
452 | 452 | // Order by high bound. |
453 | - uasort($numericIntervals, function (array $i1, array $i2) { |
|
453 | + uasort($numericIntervals, function(array $i1, array $i2) { |
|
454 | 454 | return ($i1[1] < $i2[1]) ? -1 : 1; |
455 | 455 | }); |
456 | 456 | |
@@ -479,7 +479,7 @@ discard block |
||
479 | 479 | // Put discrete values at the end and reset indices. |
480 | 480 | // Reseting indices ensures the processed values are |
481 | 481 | // serialized as correctly ordered JSON arrays. |
482 | - usort($numericIntervals, function ($i) { |
|
482 | + usort($numericIntervals, function($i) { |
|
483 | 483 | return !is_array($i) ? 1 : -1; |
484 | 484 | }); |
485 | 485 |