@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare(strict_types=1); |
|
| 3 | +declare(strict_types = 1); |
|
| 4 | 4 | |
| 5 | 5 | namespace MartanLV\Koki; |
| 6 | 6 | |
@@ -21,7 +21,7 @@ discard block |
||
| 21 | 21 | */ |
| 22 | 22 | public function __construct(array $intervals, bool $preSorted = false) |
| 23 | 23 | { |
| 24 | - !$preSorted && usort($intervals, function (IntervalInterface $i0, IntervalInterface $i) { |
|
| 24 | + !$preSorted && usort($intervals, function(IntervalInterface $i0, IntervalInterface $i) { |
|
| 25 | 25 | return $i0->getStart() <=> $i->getStart(); |
| 26 | 26 | }); |
| 27 | 27 | $this->root = $this->toTree($intervals); |
@@ -42,7 +42,7 @@ discard block |
||
| 42 | 42 | return; |
| 43 | 43 | } |
| 44 | 44 | |
| 45 | - array_walk($intervals, function (IntervalInterface $el) use (&$max) { |
|
| 45 | + array_walk($intervals, function(IntervalInterface $el) use (&$max) { |
|
| 46 | 46 | if ($max < $el->getEnd()) { |
| 47 | 47 | $max = $el->getEnd(); |
| 48 | 48 | } |
@@ -68,7 +68,7 @@ discard block |
||
| 68 | 68 | */ |
| 69 | 69 | public function select(int $low, int $high): array |
| 70 | 70 | { |
| 71 | - return $this->root ? $this->root->select($low, $high) : []; |
|
| 71 | + return $this->root ? $this->root->select($low, $high) : [ ]; |
|
| 72 | 72 | } |
| 73 | 73 | |
| 74 | 74 | /** |
@@ -78,7 +78,7 @@ discard block |
||
| 78 | 78 | { |
| 79 | 79 | $arr = $this->all(); |
| 80 | 80 | |
| 81 | - usort($arr, function (IntervalInterface $i0, IntervalInterface $i) { |
|
| 81 | + usort($arr, function(IntervalInterface $i0, IntervalInterface $i) { |
|
| 82 | 82 | return $i0->getStart() <=> $i->getStart(); |
| 83 | 83 | }); |
| 84 | 84 | |
@@ -87,17 +87,17 @@ discard block |
||
| 87 | 87 | |
| 88 | 88 | public function yieldInterSelect(int $low, int $high) |
| 89 | 89 | { |
| 90 | - return $this->root ? $this->root->yieldInterSelect($low, $high) : []; |
|
| 90 | + return $this->root ? $this->root->yieldInterSelect($low, $high) : [ ]; |
|
| 91 | 91 | } |
| 92 | 92 | |
| 93 | 93 | public function interSelect(int $low, int $high): array |
| 94 | 94 | { |
| 95 | - return $this->root ? $this->root->interSelect($low, $high) : []; |
|
| 95 | + return $this->root ? $this->root->interSelect($low, $high) : [ ]; |
|
| 96 | 96 | } |
| 97 | 97 | |
| 98 | 98 | public function yieldSelect(int $low, int $high) |
| 99 | 99 | { |
| 100 | - return $this->root ? $this->root->yieldSelect($low, $high) : []; |
|
| 100 | + return $this->root ? $this->root->yieldSelect($low, $high) : [ ]; |
|
| 101 | 101 | } |
| 102 | 102 | |
| 103 | 103 | /** |
@@ -105,7 +105,7 @@ discard block |
||
| 105 | 105 | */ |
| 106 | 106 | public function all(): array |
| 107 | 107 | { |
| 108 | - return $this->root ? $this->root->all() : []; |
|
| 108 | + return $this->root ? $this->root->all() : [ ]; |
|
| 109 | 109 | } |
| 110 | 110 | |
| 111 | 111 | /** |
@@ -115,6 +115,6 @@ discard block |
||
| 115 | 115 | */ |
| 116 | 116 | public function yieldAll() |
| 117 | 117 | { |
| 118 | - return $this->root ? $this->root->yieldAll() : []; |
|
| 118 | + return $this->root ? $this->root->yieldAll() : [ ]; |
|
| 119 | 119 | } |
| 120 | 120 | } |