/** * Pack items into boxes * * @throws \RuntimeException * @return PackedBoxList */ public function pack() { $packedBoxes = $this->doVolumePacking(); //If we have multiple boxes, try and optimise/even-out weight distribution if ($packedBoxes->count() > 1) { $redistributor = new WeightRedistributor($this->boxes); $redistributor->setLogger($this->logger); $packedBoxes = $redistributor->redistributeWeight($packedBoxes); } $this->logger->log(LogLevel::INFO, "packing completed, {$packedBoxes->count()} boxes"); return $packedBoxes; }