@@ -65,17 +65,17 @@ |
||
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 |
@@ -56,5 +56,5 @@ |
||
56 | 56 | */ |
57 | 57 | public function getKeepFlat(); |
58 | 58 | |
59 | - } |
|
59 | + } |
|
60 | 60 |
@@ -145,7 +145,7 @@ |
||
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 |
@@ -208,9 +208,9 @@ |
||
208 | 208 | } |
209 | 209 | |
210 | 210 | /** |
211 | - * @param $layerWidth |
|
212 | - * @param $layerLength |
|
213 | - * @param $layerDepth |
|
211 | + * @param integer $layerWidth |
|
212 | + * @param integer $layerLength |
|
213 | + * @param integer $layerDepth |
|
214 | 214 | * @return bool |
215 | 215 | */ |
216 | 216 | protected function isLayerStarted($layerWidth, $layerLength, $layerDepth) { |
@@ -184,7 +184,7 @@ |
||
184 | 184 | /** @var OrientatedItem $orientation */ |
185 | 185 | foreach ($orientations as $o => $orientation) { |
186 | 186 | $orientationFit = min($widthLeft - $orientation->getWidth(), |
187 | - $lengthLeft - $orientation->getLength()); |
|
187 | + $lengthLeft - $orientation->getLength()); |
|
188 | 188 | |
189 | 189 | if ($orientationFit >= 0 && $depthLeft - $orientation->getDepth() >= 0) { |
190 | 190 | $orientationFits[$o] = $orientationFit; |
@@ -152,8 +152,8 @@ discard block |
||
152 | 152 | |
153 | 153 | /** @var OrientatedItem $orientation */ |
154 | 154 | foreach ($orientations as $o => $orientation) { |
155 | - $orientationFit = min($widthLeft - $orientation->getWidth(), |
|
156 | - $lengthLeft - $orientation->getLength()); |
|
155 | + $orientationFit = min($widthLeft - $orientation->getWidth(), |
|
156 | + $lengthLeft - $orientation->getLength()); |
|
157 | 157 | |
158 | 158 | if ($orientationFit >= 0 && $depthLeft - $orientation->getDepth() >= 0) { |
159 | 159 | $orientationFits[$o] = $orientationFit; |
@@ -203,7 +203,7 @@ discard block |
||
203 | 203 | } |
204 | 204 | |
205 | 205 | //remove any that simply don't fit |
206 | - return array_filter($orientations, function (OrientatedItem $i) use ($widthLeft, $lengthLeft, $depthLeft) { |
|
206 | + return array_filter($orientations, function(OrientatedItem $i) use ($widthLeft, $lengthLeft, $depthLeft) { |
|
207 | 207 | return $i->getWidth() <= $widthLeft && $i->getLength() <= $lengthLeft && $i->getDepth() <= $depthLeft; |
208 | 208 | }); |
209 | 209 |
@@ -56,5 +56,5 @@ |
||
56 | 56 | */ |
57 | 57 | public function getKeepFlat(); |
58 | 58 | |
59 | - } |
|
59 | + } |
|
60 | 60 |