Completed
Push — 1.x-dev ( e51b9c...e05d1e )
by Doug
08:30
created
Packer.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -148,7 +148,7 @@
 block discarded – undo
148 148
 
149 149
             //Check iteration was productive
150 150
             if ($packedBoxesIteration->isEmpty()) {
151
-                throw new ItemTooLargeException('Item ' . $this->items->top()->getDescription() . ' is too large to fit into any box', $this->items->top());
151
+                throw new ItemTooLargeException('Item '.$this->items->top()->getDescription().' is too large to fit into any box', $this->items->top());
152 152
             }
153 153
 
154 154
             //Find best box of iteration, and remove packed items from unpacked list
Please login to merge, or discard this patch.
Unused Use Statements   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -6,9 +6,9 @@
 block discarded – undo
6 6
  */
7 7
 namespace DVDoug\BoxPacker;
8 8
 
9
+use Psr\Log\LogLevel;
9 10
 use Psr\Log\LoggerAwareInterface;
10 11
 use Psr\Log\LoggerAwareTrait;
11
-use Psr\Log\LogLevel;
12 12
 use Psr\Log\NullLogger;
13 13
 
14 14
 /**
Please login to merge, or discard this patch.
WeightRedistributor.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -67,18 +67,18 @@
 block discarded – undo
67 67
 
68 68
         do { //Keep moving items from most overweight box to most underweight box
69 69
             $tryRepack = false;
70
-            $this->logger->log(LogLevel::DEBUG, 'boxes under/over target: ' . count($underWeightBoxes) . '/' . count($overWeightBoxes));
70
+            $this->logger->log(LogLevel::DEBUG, 'boxes under/over target: '.count($underWeightBoxes).'/'.count($overWeightBoxes));
71 71
 
72 72
             foreach ($underWeightBoxes as $u => $underWeightBox) {
73
-                $this->logger->log(LogLevel::DEBUG, 'Underweight Box ' . $u);
73
+                $this->logger->log(LogLevel::DEBUG, 'Underweight Box '.$u);
74 74
                 foreach ($overWeightBoxes as $o => $overWeightBox) {
75
-                    $this->logger->log(LogLevel::DEBUG, 'Overweight Box ' . $o);
75
+                    $this->logger->log(LogLevel::DEBUG, 'Overweight Box '.$o);
76 76
                     $overWeightBoxItems = $overWeightBox->getItems()->asArray();
77 77
 
78 78
                     //For each item in the heavier box, try and move it to the lighter one
79 79
                     /** @var Item $overWeightBoxItem */
80 80
                     foreach ($overWeightBoxItems as $oi => $overWeightBoxItem) {
81
-                        $this->logger->log(LogLevel::DEBUG, 'Overweight Item ' . $oi);
81
+                        $this->logger->log(LogLevel::DEBUG, 'Overweight Item '.$oi);
82 82
                         if ($underWeightBox->getWeight() + $overWeightBoxItem->getWeight() > $targetWeight) {
83 83
                             $this->logger->log(LogLevel::DEBUG, 'Skipping item for hindering weight distribution');
84 84
                             continue; //skip if moving this item would hinder rather than help weight distribution
Please login to merge, or discard this patch.
OrientatedItemFactory.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -94,16 +94,16 @@
 block discarded – undo
94 94
      */
95 95
     public function getPossibleOrientationsInEmptyBox(Item $item, Box $box)
96 96
     {
97
-        $cacheKey = $item->getWidth() .
98
-            '|' .
99
-            $item->getLength() .
100
-            '|' .
101
-            $item->getDepth() .
102
-            '|' .
103
-            $box->getInnerWidth() .
104
-            '|' .
105
-            $box->getInnerLength() .
106
-            '|' .
97
+        $cacheKey = $item->getWidth().
98
+            '|'.
99
+            $item->getLength().
100
+            '|'.
101
+            $item->getDepth().
102
+            '|'.
103
+            $box->getInnerWidth().
104
+            '|'.
105
+            $box->getInnerLength().
106
+            '|'.
107 107
             $box->getInnerDepth();
108 108
 
109 109
         if (isset(static::$emptyBoxCache[$cacheKey])) {
Please login to merge, or discard this patch.