@@ -102,18 +102,18 @@ |
||
| 102 | 102 | */ |
| 103 | 103 | public function getPossibleOrientationsInEmptyBox(Item $item, Box $box) |
| 104 | 104 | { |
| 105 | - $cacheKey = $item->getWidth() . |
|
| 106 | - '|' . |
|
| 107 | - $item->getLength() . |
|
| 108 | - '|' . |
|
| 109 | - $item->getDepth() . |
|
| 110 | - '|' . |
|
| 111 | - ($item->getKeepFlat() ? '2D' : '3D') . |
|
| 112 | - '|' . |
|
| 113 | - $box->getInnerWidth() . |
|
| 114 | - '|' . |
|
| 115 | - $box->getInnerLength() . |
|
| 116 | - '|' . |
|
| 105 | + $cacheKey = $item->getWidth(). |
|
| 106 | + '|'. |
|
| 107 | + $item->getLength(). |
|
| 108 | + '|'. |
|
| 109 | + $item->getDepth(). |
|
| 110 | + '|'. |
|
| 111 | + ($item->getKeepFlat() ? '2D' : '3D'). |
|
| 112 | + '|'. |
|
| 113 | + $box->getInnerWidth(). |
|
| 114 | + '|'. |
|
| 115 | + $box->getInnerLength(). |
|
| 116 | + '|'. |
|
| 117 | 117 | $box->getInnerDepth(); |
| 118 | 118 | |
| 119 | 119 | if (isset(static::$emptyBoxCache[$cacheKey])) { |
@@ -148,7 +148,7 @@ |
||
| 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 |
@@ -67,18 +67,18 @@ |
||
| 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()->asItemArray(); |
| 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 |