@@ -58,19 +58,19 @@ discard block |
||
| 58 | 58 | $this->setIntervals($intervals); |
| 59 | 59 | } |
| 60 | 60 | |
| 61 | - $this->boundToNumeric = static function (DateTime $bound) { |
|
| 61 | + $this->boundToNumeric = static function(DateTime $bound) { |
|
| 62 | 62 | return $bound->getTimestamp(); |
| 63 | 63 | }; |
| 64 | 64 | |
| 65 | - $this->boundToString = static function (DateTime $bound) { |
|
| 65 | + $this->boundToString = static function(DateTime $bound) { |
|
| 66 | 66 | return $bound->format('Y-m-d'); |
| 67 | 67 | }; |
| 68 | 68 | |
| 69 | - $this->valueToNumeric = static function ($v) { |
|
| 69 | + $this->valueToNumeric = static function($v) { |
|
| 70 | 70 | return $v === null ? null : (int)($v * 100); |
| 71 | 71 | }; |
| 72 | 72 | |
| 73 | - $this->valueToString = static function ($v) { |
|
| 73 | + $this->valueToString = static function($v) { |
|
| 74 | 74 | return $v === null ? null : ($v * 100 . '%'); |
| 75 | 75 | }; |
| 76 | 76 | |
@@ -234,7 +234,7 @@ discard block |
||
| 234 | 234 | } |
| 235 | 235 | |
| 236 | 236 | // Order by low bound. |
| 237 | - uasort($numVals, static function (array $i1, array $i2) { |
|
| 237 | + uasort($numVals, static function(array $i1, array $i2) { |
|
| 238 | 238 | return ($i1[0] < $i2[0]) ? -1 : 1; |
| 239 | 239 | }); |
| 240 | 240 | |
@@ -250,7 +250,7 @@ discard block |
||
| 250 | 250 | } |
| 251 | 251 | |
| 252 | 252 | // Order by high bound. |
| 253 | - uasort($numVals, static function (array $i1, array $i2) { |
|
| 253 | + uasort($numVals, static function(array $i1, array $i2) { |
|
| 254 | 254 | return ($i1[1] < $i2[1]) ? -1 : 1; |
| 255 | 255 | }); |
| 256 | 256 | |
@@ -293,7 +293,7 @@ discard block |
||
| 293 | 293 | !empty($originalValues) ? $this->palette->getColor($colval) : 50, // Interval color |
| 294 | 294 | ($this->boundToString)($lowBound), // Interval start string value |
| 295 | 295 | ($this->boundToString)($highBound), // Interval end string value |
| 296 | - !empty($originalValues) ? $strval : null,// Interval string value |
|
| 296 | + !empty($originalValues) ? $strval : null, // Interval string value |
|
| 297 | 297 | ]; |
| 298 | 298 | } |
| 299 | 299 | } |
@@ -301,7 +301,7 @@ discard block |
||
| 301 | 301 | // Put discrete values at the end and reset indices. |
| 302 | 302 | // Reseting indices ensures the processed values are |
| 303 | 303 | // serialized as correctly ordered JSON arrays. |
| 304 | - usort($numVals, static function ($i) { |
|
| 304 | + usort($numVals, static function($i) { |
|
| 305 | 305 | return count($i) === 2 ? 1 : -1; |
| 306 | 306 | }); |
| 307 | 307 | |
@@ -332,7 +332,7 @@ discard block |
||
| 332 | 332 | } |
| 333 | 333 | |
| 334 | 334 | // Order by high bound. |
| 335 | - uasort($numericIntervals, static function (array $i1, array $i2) { |
|
| 335 | + uasort($numericIntervals, static function(array $i1, array $i2) { |
|
| 336 | 336 | return ($i1[1] < $i2[1]) ? -1 : 1; |
| 337 | 337 | }); |
| 338 | 338 | |
@@ -361,7 +361,7 @@ discard block |
||
| 361 | 361 | // Put discrete values at the end and reset indices. |
| 362 | 362 | // Reseting indices ensures the processed values are |
| 363 | 363 | // serialized as correctly ordered JSON arrays. |
| 364 | - usort($numericIntervals, static function ($i) { |
|
| 364 | + usort($numericIntervals, static function($i) { |
|
| 365 | 365 | return !is_array($i) ? 1 : -1; |
| 366 | 366 | }); |
| 367 | 367 | |
@@ -73,7 +73,7 @@ discard block |
||
| 73 | 73 | $bounds[] = [$interval[0], '+', true, $key, $interval[2] ?? null]; |
| 74 | 74 | } |
| 75 | 75 | // Order the bounds. |
| 76 | - usort($bounds, static function (array $d1, array $d2) { |
|
| 76 | + usort($bounds, static function(array $d1, array $d2) { |
|
| 77 | 77 | return ($d1[0] < $d2[0]) ? -1 : 1; |
| 78 | 78 | }); |
| 79 | 79 | return $bounds; |
@@ -91,7 +91,7 @@ discard block |
||
| 91 | 91 | */ |
| 92 | 92 | public static function extractDiscreteValues(array &$intervals): array |
| 93 | 93 | { |
| 94 | - $discreteValues = array_filter($intervals, static function ($interval) { |
|
| 94 | + $discreteValues = array_filter($intervals, static function($interval) { |
|
| 95 | 95 | return $interval[0] === $interval[1]; |
| 96 | 96 | }); |
| 97 | 97 | |
@@ -162,7 +162,7 @@ discard block |
||
| 162 | 162 | } |
| 163 | 163 | |
| 164 | 164 | // Remove empty interval generated when two or more intervals share a common bound. |
| 165 | - $newIntervals = array_values(array_filter($newIntervals, static function ($i) { |
|
| 165 | + $newIntervals = array_values(array_filter($newIntervals, static function($i) { |
|
| 166 | 166 | // Use weak comparison in case of object typed bounds. |
| 167 | 167 | return $i[0] != $i[1]; |
| 168 | 168 | })); |