@@ -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\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(); |
@@ -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 | |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | |
35 | 35 | // Greedy needs a dataset sorted DESC. |
36 | 36 | $dataset->uasort( |
37 | - static function (PartitionItem $left, PartitionItem $right) { |
|
37 | + static function(PartitionItem $left, PartitionItem $right) { |
|
38 | 38 | return $left->getWeight() <=> $right->getWeight(); |
39 | 39 | } |
40 | 40 | ); |
@@ -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 | { |
23 | 23 | // Greedy needs a dataset sorted DESC. |
24 | 24 | $dataset->uasort( |
25 | - static function (PartitionItem $left, PartitionItem $right) { |
|
25 | + static function(PartitionItem $left, PartitionItem $right) { |
|
26 | 26 | return $right->getWeight() <=> $left->getWeight(); |
27 | 27 | } |
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; |
6 | 6 | |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | |
35 | 35 | // Greedy needs a dataset sorted DESC. |
36 | 36 | $dataset->uasort( |
37 | - static function (PartitionItem $left, PartitionItem $right) { |
|
37 | + static function(PartitionItem $left, PartitionItem $right) { |
|
38 | 38 | return $right->getWeight() <=> $left->getWeight(); |
39 | 39 | } |
40 | 40 | ); |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | $partitionWeightMinusBest = $partition->getWeight() - $best; |
88 | 88 | |
89 | 89 | $solutions = \array_map( |
90 | - static function (PartitionItem $item) use ($partitionWeightMinusBest) { |
|
90 | + static function(PartitionItem $item) use ($partitionWeightMinusBest) { |
|
91 | 91 | return \abs($partitionWeightMinusBest + $item->getWeight()); |
92 | 92 | }, |
93 | 93 | \iterator_to_array($dataset) |
@@ -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\Contract; |
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 | |
@@ -22,7 +22,7 @@ discard block |
||
22 | 22 | { |
23 | 23 | // Greedy needs a dataset sorted DESC. |
24 | 24 | $dataset->uasort( |
25 | - static function (PartitionItem $left, PartitionItem $right) { |
|
25 | + static function(PartitionItem $left, PartitionItem $right) { |
|
26 | 26 | return $right->getWeight() <=> $left->getWeight(); |
27 | 27 | } |
28 | 28 | ); |