@@ -4,7 +4,7 @@ |
||
| 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 | /** |
@@ -4,7 +4,7 @@ |
||
| 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 | /** |
@@ -4,7 +4,7 @@ |
||
| 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 | /** |
@@ -4,7 +4,7 @@ discard block |
||
| 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; |
@@ -68,18 +68,18 @@ discard block |
||
| 68 | 68 | |
| 69 | 69 | do { //Keep moving items from most overweight box to most underweight box |
| 70 | 70 | $tryRepack = false; |
| 71 | - $this->logger->log(LogLevel::DEBUG, 'boxes under/over target: ' . count($underWeightBoxes) . '/' . count($overWeightBoxes)); |
|
| 71 | + $this->logger->log(LogLevel::DEBUG, 'boxes under/over target: '.count($underWeightBoxes).'/'.count($overWeightBoxes)); |
|
| 72 | 72 | |
| 73 | 73 | foreach ($underWeightBoxes as $u => $underWeightBox) { |
| 74 | - $this->logger->log(LogLevel::DEBUG, 'Underweight Box ' . $u); |
|
| 74 | + $this->logger->log(LogLevel::DEBUG, 'Underweight Box '.$u); |
|
| 75 | 75 | foreach ($overWeightBoxes as $o => $overWeightBox) { |
| 76 | - $this->logger->log(LogLevel::DEBUG, 'Overweight Box ' . $o); |
|
| 76 | + $this->logger->log(LogLevel::DEBUG, 'Overweight Box '.$o); |
|
| 77 | 77 | $overWeightBoxItems = $overWeightBox->getItems()->asItemArray(); |
| 78 | 78 | |
| 79 | 79 | //For each item in the heavier box, try and move it to the lighter one |
| 80 | 80 | /** @var Item $overWeightBoxItem */ |
| 81 | 81 | foreach ($overWeightBoxItems as $oi => $overWeightBoxItem) { |
| 82 | - $this->logger->log(LogLevel::DEBUG, 'Overweight Item ' . $oi); |
|
| 82 | + $this->logger->log(LogLevel::DEBUG, 'Overweight Item '.$oi); |
|
| 83 | 83 | if ($underWeightBox->getWeight() + $overWeightBoxItem->getWeight() > $targetWeight) { |
| 84 | 84 | $this->logger->log(LogLevel::DEBUG, 'Skipping item for hindering weight distribution'); |
| 85 | 85 | continue; //skip if moving this item would hinder rather than help weight distribution |
@@ -5,7 +5,7 @@ |
||
| 5 | 5 | * @package BoxPacker |
| 6 | 6 | * @author Doug Wright |
| 7 | 7 | */ |
| 8 | -declare(strict_types=1); |
|
| 8 | +declare(strict_types = 1); |
|
| 9 | 9 | namespace DVDoug\BoxPacker; |
| 10 | 10 | |
| 11 | 11 | /** |
@@ -4,7 +4,7 @@ discard block |
||
| 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; |
@@ -180,7 +180,7 @@ discard block |
||
| 180 | 180 | int $maxWidth, |
| 181 | 181 | int $maxLength, |
| 182 | 182 | int $maxDepth |
| 183 | - ): ?OrientatedItem { |
|
| 183 | + ) : ?OrientatedItem { |
|
| 184 | 184 | $this->logger->debug( |
| 185 | 185 | "evaluating item {$itemToPack->getDescription()} for fit", |
| 186 | 186 | [ |
@@ -222,7 +222,7 @@ discard block |
||
| 222 | 222 | int $x, |
| 223 | 223 | int $y, |
| 224 | 224 | int $z |
| 225 | - ): void { |
|
| 225 | + ) : void { |
|
| 226 | 226 | while (!$this->items->isEmpty() && $this->checkNonDimensionalConstraints($this->items->top(), $packedItems)) { |
| 227 | 227 | $stackedItem = $this->getOrientationForItem( |
| 228 | 228 | $this->items->top(), |
@@ -4,7 +4,7 @@ |
||
| 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 | /** |
@@ -4,7 +4,7 @@ |
||
| 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 | /** |
@@ -4,7 +4,7 @@ |
||
| 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 | /** |