public function pack(): PackedBoxList
    {
        $packedBoxes = $this->doVolumePacking();

        //If we have multiple boxes, try and optimise/even-out weight distribution
        if ($packedBoxes->count() > 1 && $packedBoxes->count() <= $this->maxBoxesToBalanceWeight) {
            $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;
    }
public function pack(): PackedBoxList
    {
        $packedBoxes = $this->doVolumePacking();

        //If we have multiple boxes, try and optimise/even-out weight distribution
        if ($packedBoxes->count() > 1 && $packedBoxes->count() <= $this->maxBoxesToBalanceWeight) {
            $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;
    }
public function pack ( ) : PackedBoxList { $ packedBoxes = $ this -> doVolumePacking ( ) ; //If we have multiple boxes, try and optimise/even-out weight distribution if ( $ packedBoxes -> count ( ) > 1 && $ packedBoxes -> count ( ) <= $ this -> maxBoxesToBalanceWeight ) { $ 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 ; }
Pack items into boxes.

@return PackedBoxList
Pack items into boxes .