@@ -1,6 +1,6 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types = 1); |
|
3 | +declare(strict_types=1); |
|
4 | 4 | |
5 | 5 | namespace drupol\phpartition\Partition; |
6 | 6 |
@@ -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 drupol\phpartition; |
6 | 6 | |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | final public function export(int $chunks = 1) |
43 | 43 | { |
44 | 44 | return \array_map( |
45 | - static function (Partition $partition) { |
|
45 | + static function(Partition $partition) { |
|
46 | 46 | return \array_values($partition->exportArrayCopy()); |
47 | 47 | }, |
48 | 48 | $this |
@@ -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 drupol\phpartition; |
6 | 6 | |
@@ -19,7 +19,7 @@ discard block |
||
19 | 19 | { |
20 | 20 | // Greedy needs a dataset sorted DESC. |
21 | 21 | $dataset->uasort( |
22 | - static function ($left, $right) { |
|
22 | + static function($left, $right) { |
|
23 | 23 | return $right->getWeight() <=> $left->getWeight(); |
24 | 24 | } |
25 | 25 | ); |
@@ -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 drupol\phpartition; |
6 | 6 | |
@@ -20,7 +20,7 @@ discard block |
||
20 | 20 | $partitionItemFactory = $this->getPartitionItemFactory(); |
21 | 21 | |
22 | 22 | // Greedy needs a dataset sorted DESC. |
23 | - $dataset->uasort(static function ($a, $b) use ($partitionItemFactory) { |
|
23 | + $dataset->uasort(static function($a, $b) use ($partitionItemFactory) { |
|
24 | 24 | $left = $partitionItemFactory::create($a); |
25 | 25 | $right = $partitionItemFactory::create($b); |
26 | 26 |
@@ -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 drupol\phpartition; |
6 | 6 | |
@@ -22,7 +22,7 @@ discard block |
||
22 | 22 | $partitionItemFactory = $this->getPartitionItemFactory(); |
23 | 23 | |
24 | 24 | // Greedy needs a dataset sorted DESC. |
25 | - $dataset->uasort(static function ($a, $b) use ($partitionItemFactory) { |
|
25 | + $dataset->uasort(static function($a, $b) use ($partitionItemFactory) { |
|
26 | 26 | $left = $partitionItemFactory::create($a); |
27 | 27 | $right = $partitionItemFactory::create($b); |
28 | 28 |
@@ -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 drupol\phpartition\Utils; |
6 | 6 | |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | $mean = self::meanPartition($partition); |
32 | 32 | |
33 | 33 | $sumSquareDiff = \array_sum(\array_map( |
34 | - static function ($sum) use ($mean) { |
|
34 | + static function($sum) use ($mean) { |
|
35 | 35 | return ($sum - $mean) ** 2; |
36 | 36 | }, |
37 | 37 | $partition->getArrayCopy() |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | { |
49 | 49 | $partition = new Partition( |
50 | 50 | \array_map( |
51 | - static function (Partition $partition) { |
|
51 | + static function(Partition $partition) { |
|
52 | 52 | return $partition->getWeight(); |
53 | 53 | }, |
54 | 54 | $partitions->partitions() |
@@ -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 drupol\phpartition; |
6 | 6 | |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | protected function fillPartitions(Partitions $partitions, Partition $dataset, int $chunks): void |
67 | 67 | { |
68 | 68 | $partition = new Partition($dataset); |
69 | - $partition->uasort(function ($left, $right) { |
|
69 | + $partition->uasort(function($left, $right) { |
|
70 | 70 | return $left->getWeight() <=> $right->getWeight(); |
71 | 71 | }); |
72 | 72 | $dataset = $partition->getArrayCopy(); |