Completed
Push — master ( 15d6df...440a91 )
by Doug
15:50
created
src/VolumePacker.php 3 patches
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -8,7 +8,6 @@
 block discarded – undo
8 8
 
9 9
 use Psr\Log\LoggerAwareInterface;
10 10
 use Psr\Log\LoggerAwareTrait;
11
-use Psr\Log\LoggerInterface;
12 11
 use Psr\Log\NullLogger;
13 12
 
14 13
 /**
Please login to merge, or discard this patch.
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -205,7 +205,7 @@
 block discarded – undo
205 205
      * Used when we've packed a tall item, and have just put a shorter one next to it
206 206
      *
207 207
      * @param PackedItemList $packedItems
208
-     * @param ?PackedItem $prevItem
208
+     * @param null|PackedItem $prevItem
209 209
      * @param int $maxWidth
210 210
      * @param int $maxLength
211 211
      * @param int $maxDepth
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 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;
@@ -180,7 +180,7 @@  discard block
 block discarded – undo
180 180
         int $maxWidth,
181 181
         int $maxLength,
182 182
         int $maxDepth
183
-    ): ?OrientatedItem {
183
+    ) : ?OrientatedItem {
184 184
         $this->logger->debug(
185 185
             "evaluating item {$itemToPack->getDescription()} for fit",
186 186
             [
@@ -222,7 +222,7 @@  discard block
 block discarded – undo
222 222
         int $x,
223 223
         int $y,
224 224
         int $z
225
-    ): void {
225
+    ) : void {
226 226
         while (!$this->items->isEmpty() && $this->checkNonDimensionalConstraints($this->items->top(), $packedItems)) {
227 227
             $stackedItem = $this->getOrientationForItem(
228 228
                 $this->items->top(),
Please login to merge, or discard this patch.
src/OrientatedItem.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
 /**
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,18 +68,18 @@  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
             foreach ($underWeightBoxes as $u => $underWeightBox) {
74
-                $this->logger->log(LogLevel::DEBUG, 'Underweight Box ' . $u);
74
+                $this->logger->log(LogLevel::DEBUG, 'Underweight Box '.$u);
75 75
                 foreach ($overWeightBoxes as $o => $overWeightBox) {
76
-                    $this->logger->log(LogLevel::DEBUG, 'Overweight Box ' . $o);
76
+                    $this->logger->log(LogLevel::DEBUG, 'Overweight Box '.$o);
77 77
                     $overWeightBoxItems = $overWeightBox->getItems()->asItemArray();
78 78
 
79 79
                     //For each item in the heavier box, try and move it to the lighter one
80 80
                     /** @var Item $overWeightBoxItem */
81 81
                     foreach ($overWeightBoxItems as $oi => $overWeightBoxItem) {
82
-                        $this->logger->log(LogLevel::DEBUG, 'Overweight Item ' . $oi);
82
+                        $this->logger->log(LogLevel::DEBUG, 'Overweight Item '.$oi);
83 83
                         if ($underWeightBox->getWeight() + $overWeightBoxItem->getWeight() > $targetWeight) {
84 84
                             $this->logger->log(LogLevel::DEBUG, 'Skipping item for hindering weight distribution');
85 85
                             continue; //skip if moving this item would hinder rather than help weight distribution
Please login to merge, or discard this patch.
src/Packer.php 1 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 Psr\Log\LoggerAwareInterface;
@@ -149,7 +149,7 @@  discard block
 block discarded – undo
149 149
 
150 150
             //Check iteration was productive
151 151
             if ($packedBoxesIteration->isEmpty()) {
152
-                throw new ItemTooLargeException('Item ' . $this->items->top()->getDescription() . ' is too large to fit into any box', $this->items->top());
152
+                throw new ItemTooLargeException('Item '.$this->items->top()->getDescription().' is too large to fit into any box', $this->items->top());
153 153
             }
154 154
 
155 155
             //Find best box of iteration, and remove packed items from unpacked list
Please login to merge, or discard this patch.
src/OrientatedItemFactory.php 1 patch
Spacing   +15 added lines, -15 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;
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
         int $widthLeft,
44 44
         int $lengthLeft,
45 45
         int $depthLeft
46
-    ): ?OrientatedItem {
46
+    ) : ?OrientatedItem {
47 47
 
48 48
         $possibleOrientations = $this->getPossibleOrientations($item, $prevItem, $widthLeft, $lengthLeft, $depthLeft);
49 49
         $usableOrientations = $this->getUsableOrientations($possibleOrientations, $box, $item, $isLastItem);
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
         int $widthLeft,
82 82
         int $lengthLeft,
83 83
         int $depthLeft
84
-    ): array {
84
+    ) : array {
85 85
 
86 86
         $orientations = [];
87 87
 
@@ -117,18 +117,18 @@  discard block
 block discarded – undo
117 117
      */
118 118
     public function getPossibleOrientationsInEmptyBox(Item $item, Box $box): array
119 119
     {
120
-        $cacheKey = $item->getWidth() .
121
-            '|' .
122
-            $item->getLength() .
123
-            '|' .
124
-            $item->getDepth() .
125
-            '|' .
126
-            ($item->getKeepFlat() ? '2D' : '3D') .
127
-            '|' .
128
-            $box->getInnerWidth() .
129
-            '|' .
130
-            $box->getInnerLength() .
131
-            '|' .
120
+        $cacheKey = $item->getWidth().
121
+            '|'.
122
+            $item->getLength().
123
+            '|'.
124
+            $item->getDepth().
125
+            '|'.
126
+            ($item->getKeepFlat() ? '2D' : '3D').
127
+            '|'.
128
+            $box->getInnerWidth().
129
+            '|'.
130
+            $box->getInnerLength().
131
+            '|'.
132 132
             $box->getInnerDepth();
133 133
 
134 134
         if (isset(static::$emptyBoxCache[$cacheKey])) {
Please login to merge, or discard this patch.
src/ConstrainedItem.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
 /**
Please login to merge, or discard this patch.
src/PackedBox.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
 /**
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
 /**
Please login to merge, or discard this patch.
src/Item.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
 /**
Please login to merge, or discard this patch.