Completed
Push — master ( 22d589...9fb66e )
by Doug
01:13
created
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/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/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.
src/OrientatedItemFactory.php 1 patch
Spacing   +16 added lines, -16 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);
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
             return null;
53 53
         }
54 54
 
55
-        usort($usableOrientations, function (OrientatedItem $a, OrientatedItem $b) use ($widthLeft, $lengthLeft) {
55
+        usort($usableOrientations, function(OrientatedItem $a, OrientatedItem $b) use ($widthLeft, $lengthLeft) {
56 56
             $orientationAWidthLeft = $widthLeft - $a->getWidth();
57 57
             $orientationALengthLeft = $lengthLeft - $a->getLength();
58 58
             $orientationBWidthLeft = $widthLeft - $b->getWidth();
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
         int $widthLeft,
91 91
         int $lengthLeft,
92 92
         int $depthLeft
93
-    ): array {
93
+    ) : array {
94 94
 
95 95
         $orientations = [];
96 96
 
@@ -126,18 +126,18 @@  discard block
 block discarded – undo
126 126
      */
127 127
     public function getPossibleOrientationsInEmptyBox(Item $item, Box $box): array
128 128
     {
129
-        $cacheKey = $item->getWidth() .
130
-            '|' .
131
-            $item->getLength() .
132
-            '|' .
133
-            $item->getDepth() .
134
-            '|' .
135
-            ($item->getKeepFlat() ? '2D' : '3D') .
136
-            '|' .
137
-            $box->getInnerWidth() .
138
-            '|' .
139
-            $box->getInnerLength() .
140
-            '|' .
129
+        $cacheKey = $item->getWidth().
130
+            '|'.
131
+            $item->getLength().
132
+            '|'.
133
+            $item->getDepth().
134
+            '|'.
135
+            ($item->getKeepFlat() ? '2D' : '3D').
136
+            '|'.
137
+            $box->getInnerWidth().
138
+            '|'.
139
+            $box->getInnerLength().
140
+            '|'.
141 141
             $box->getInnerDepth();
142 142
 
143 143
         if (isset(static::$emptyBoxCache[$cacheKey])) {
Please login to merge, or discard this patch.