Completed
Push — master ( 17ecec...f96e7f )
by Doug
51:32 queued 50:04
created
src/PackedBoxList.php 2 patches
Unused Use Statements   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -7,7 +7,9 @@
 block discarded – undo
7 7
 declare(strict_types=1);
8 8
 namespace DVDoug\BoxPacker;
9 9
 
10
-use ArrayIterator, Countable, IteratorAggregate, Traversable;
10
+use ArrayIterator;
11
+use IteratorAggregate;
12
+use Traversable;
11 13
 use function reset;
12 14
 
13 15
 /**
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -4,7 +4,7 @@
 block discarded – undo
4 4
  * @package BoxPacker
5 5
  * @author Doug Wright
6 6
  */
7
-declare(strict_types=1);
7
+declare(strict_types = 1);
8 8
 namespace DVDoug\BoxPacker;
9 9
 
10 10
 use ArrayIterator, Countable, IteratorAggregate, Traversable;
Please login to merge, or discard this patch.
src/Packer.php 2 patches
Unused Use Statements   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -8,9 +8,9 @@
 block discarded – undo
8 8
 namespace DVDoug\BoxPacker;
9 9
 
10 10
 use function array_unshift;
11
+use Psr\Log\LogLevel;
11 12
 use Psr\Log\LoggerAwareInterface;
12 13
 use Psr\Log\LoggerAwareTrait;
13
-use Psr\Log\LogLevel;
14 14
 use Psr\Log\NullLogger;
15 15
 
16 16
 /**
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -4,7 +4,7 @@  discard block
 block discarded – undo
4 4
  * @package BoxPacker
5 5
  * @author Doug Wright
6 6
  */
7
-declare(strict_types=1);
7
+declare(strict_types = 1);
8 8
 namespace DVDoug\BoxPacker;
9 9
 
10 10
 use function array_unshift;
@@ -169,7 +169,7 @@  discard block
 block discarded – undo
169 169
 
170 170
             //Check iteration was productive
171 171
             if (!$packedBoxesIteration) {
172
-                throw new ItemTooLargeException('Item ' . $this->items->top()->getDescription() . ' is too large to fit into any box', $this->items->top());
172
+                throw new ItemTooLargeException('Item '.$this->items->top()->getDescription().' is too large to fit into any box', $this->items->top());
173 173
             }
174 174
 
175 175
             //Find best box of iteration, and remove packed items from unpacked list
Please login to merge, or discard this patch.
src/VolumePacker.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -4,7 +4,7 @@  discard block
 block discarded – undo
4 4
  * @package BoxPacker
5 5
  * @author Doug Wright
6 6
  */
7
-declare(strict_types=1);
7
+declare(strict_types = 1);
8 8
 namespace DVDoug\BoxPacker;
9 9
 
10 10
 use Psr\Log\LoggerAwareInterface;
@@ -192,7 +192,7 @@  discard block
 block discarded – undo
192 192
         int $maxWidth,
193 193
         int $maxLength,
194 194
         int $maxDepth
195
-    ): ?OrientatedItem {
195
+    ) : ?OrientatedItem {
196 196
         $this->logger->debug(
197 197
             "evaluating item {$itemToPack->getDescription()} for fit",
198 198
             [
@@ -234,7 +234,7 @@  discard block
 block discarded – undo
234 234
         int $x,
235 235
         int $y,
236 236
         int $z
237
-    ): void {
237
+    ) : void {
238 238
         while (count($this->items) > 0 && $this->checkNonDimensionalConstraints($this->items->top(), $packedItems)) {
239 239
             $stackedItem = $this->getOrientationForItem(
240 240
                 $this->items->top(),
@@ -328,7 +328,7 @@  discard block
 block discarded – undo
328 328
             $items = iterator_to_array($packedItems, false);
329 329
             $packedItems = new PackedItemList();
330 330
             /** @var PackedItem $item */
331
-            foreach($items as $item) {
331
+            foreach ($items as $item) {
332 332
                 $packedItems->insert(
333 333
                     new PackedItem(
334 334
                         $item->getItem(),
Please login to merge, or discard this patch.
src/BoxList.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -4,7 +4,7 @@
 block discarded – undo
4 4
  * @package BoxPacker
5 5
  * @author Doug Wright
6 6
  */
7
-declare(strict_types=1);
7
+declare(strict_types = 1);
8 8
 namespace DVDoug\BoxPacker;
9 9
 
10 10
 use ArrayIterator, IteratorAggregate, Traversable;
Please login to merge, or discard this patch.
src/WeightRedistributor.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -4,7 +4,7 @@  discard block
 block discarded – undo
4 4
  * @package BoxPacker
5 5
  * @author Doug Wright
6 6
  */
7
-declare(strict_types=1);
7
+declare(strict_types = 1);
8 8
 namespace DVDoug\BoxPacker;
9 9
 
10 10
 use Psr\Log\LoggerAwareInterface;
@@ -68,21 +68,21 @@  discard block
 block discarded – undo
68 68
 
69 69
         do { //Keep moving items from most overweight box to most underweight box
70 70
             $tryRepack = false;
71
-            $this->logger->log(LogLevel::DEBUG, 'boxes under/over target: ' . count($underWeightBoxes) . '/' . count($overWeightBoxes));
71
+            $this->logger->log(LogLevel::DEBUG, 'boxes under/over target: '.count($underWeightBoxes).'/'.count($overWeightBoxes));
72 72
 
73 73
             usort($overWeightBoxes, [$this, 'sortMoreSpaceFirst']);
74 74
             usort($underWeightBoxes, [$this, 'sortMoreSpaceFirst']);
75 75
 
76 76
             foreach ($underWeightBoxes as $u => $underWeightBox) {
77
-                $this->logger->log(LogLevel::DEBUG, 'Underweight Box ' . $u);
77
+                $this->logger->log(LogLevel::DEBUG, 'Underweight Box '.$u);
78 78
                 foreach ($overWeightBoxes as $o => $overWeightBox) {
79
-                    $this->logger->log(LogLevel::DEBUG, 'Overweight Box ' . $o);
79
+                    $this->logger->log(LogLevel::DEBUG, 'Overweight Box '.$o);
80 80
                     $overWeightBoxItems = $overWeightBox->getItems()->asItemArray();
81 81
 
82 82
                     //For each item in the heavier box, try and move it to the lighter one
83 83
                     /** @var Item $overWeightBoxItem */
84 84
                     foreach ($overWeightBoxItems as $oi => $overWeightBoxItem) {
85
-                        $this->logger->log(LogLevel::DEBUG, 'Overweight Item ' . $oi);
85
+                        $this->logger->log(LogLevel::DEBUG, 'Overweight Item '.$oi);
86 86
                         if ($underWeightBox->getWeight() + $overWeightBoxItem->getWeight() > $targetWeight) {
87 87
                             $this->logger->log(LogLevel::DEBUG, 'Skipping item for hindering weight distribution');
88 88
                             continue; //skip if moving this item would hinder rather than help weight distribution
Please login to merge, or discard this patch.
src/ItemList.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -4,7 +4,7 @@
 block discarded – undo
4 4
  * @package BoxPacker
5 5
  * @author Doug Wright
6 6
  */
7
-declare(strict_types=1);
7
+declare(strict_types = 1);
8 8
 namespace DVDoug\BoxPacker;
9 9
 
10 10
 use ArrayIterator, Countable, IteratorAggregate, Traversable;
Please login to merge, or discard this patch.
src/PackedItemList.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -4,7 +4,7 @@
 block discarded – undo
4 4
  * @package BoxPacker
5 5
  * @author Doug Wright
6 6
  */
7
-declare(strict_types=1);
7
+declare(strict_types = 1);
8 8
 namespace DVDoug\BoxPacker;
9 9
 
10 10
 use ArrayIterator, Countable, IteratorAggregate, Traversable;
Please login to merge, or discard this patch.