Completed
Push — master ( 9d7981...5c5914 )
by Doug
05:35
created
WeightRedistributor.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -65,17 +65,17 @@
 block discarded – undo
65 65
 
66 66
         do { //Keep moving items from most overweight box to most underweight box
67 67
             $tryRepack = false;
68
-            $this->logger->log(LogLevel::DEBUG, 'boxes under/over target: ' . count($underWeightBoxes) . '/' . count($overWeightBoxes));
68
+            $this->logger->log(LogLevel::DEBUG, 'boxes under/over target: '.count($underWeightBoxes).'/'.count($overWeightBoxes));
69 69
 
70 70
             foreach ($underWeightBoxes as $u => $underWeightBox) {
71
-                $this->logger->log(LogLevel::DEBUG, 'Underweight Box ' . $u);
71
+                $this->logger->log(LogLevel::DEBUG, 'Underweight Box '.$u);
72 72
                 foreach ($overWeightBoxes as $o => $overWeightBox) {
73
-                    $this->logger->log(LogLevel::DEBUG, 'Overweight Box ' . $o);
73
+                    $this->logger->log(LogLevel::DEBUG, 'Overweight Box '.$o);
74 74
                     $overWeightBoxItems = $overWeightBox->getItems()->asArray();
75 75
 
76 76
                     //For each item in the heavier box, try and move it to the lighter one
77 77
                     foreach ($overWeightBoxItems as $oi => $overWeightBoxItem) {
78
-                        $this->logger->log(LogLevel::DEBUG, 'Overweight Item ' . $oi);
78
+                        $this->logger->log(LogLevel::DEBUG, 'Overweight Item '.$oi);
79 79
                         if ($underWeightBox->getWeight() + $overWeightBoxItem->getWeight() > $targetWeight) {
80 80
                             $this->logger->log(LogLevel::DEBUG, 'Skipping item for hindering weight distribution');
81 81
                             continue; //skip if moving this item would hinder rather than help weight distribution
Please login to merge, or discard this patch.
Packer.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -145,7 +145,7 @@
 block discarded – undo
145 145
 
146 146
             //Check iteration was productive
147 147
             if ($packedBoxesIteration->isEmpty()) {
148
-                throw new \RuntimeException('Item ' . $this->items->top()->getDescription() . ' is too large to fit into any box');
148
+                throw new \RuntimeException('Item '.$this->items->top()->getDescription().' is too large to fit into any box');
149 149
             }
150 150
 
151 151
             //Find best box of iteration, and remove packed items from unpacked list
Please login to merge, or discard this patch.
VolumePacker.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -152,7 +152,7 @@  discard block
 block discarded – undo
152 152
 
153 153
         /** @var OrientatedItem $orientation */
154 154
         foreach ($orientations as $o => $orientation) {
155
-            $orientationFit = min($widthLeft   - $orientation->getWidth(), $lengthLeft  - $orientation->getLength());
155
+            $orientationFit = min($widthLeft - $orientation->getWidth(), $lengthLeft - $orientation->getLength());
156 156
 
157 157
             $orientationFits[$o] = $orientationFit;
158 158
         }
@@ -200,7 +200,7 @@  discard block
 block discarded – undo
200 200
         }
201 201
 
202 202
         //remove any that simply don't fit
203
-        return array_filter($orientations, function (OrientatedItem $i) use ($widthLeft, $lengthLeft, $depthLeft) {
203
+        return array_filter($orientations, function(OrientatedItem $i) use ($widthLeft, $lengthLeft, $depthLeft) {
204 204
             return $i->getWidth() <= $widthLeft && $i->getLength() <= $lengthLeft && $i->getDepth() <= $depthLeft;
205 205
         });
206 206
 
Please login to merge, or discard this patch.
BoxList.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -61,7 +61,7 @@
 block discarded – undo
61 61
         if (!$this->isSorted) {
62 62
             uasort(
63 63
                 $this->list,
64
-                function (Box $boxA, Box $boxB) {
64
+                function(Box $boxA, Box $boxB) {
65 65
                     if ($boxB->getInnerVolume() > $boxA->getInnerVolume()) {
66 66
                         return -1;
67 67
                     } elseif ($boxB->getInnerVolume() < $boxA->getInnerVolume()) {
Please login to merge, or discard this patch.