Автор: Doug Wright
Наследование: implements Psr\Log\LoggerAwareInterface, use trait Psr\Log\LoggerAwareTrait
Пример #1
0
 /**
  * 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;
 }