for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace DVDoug\BoxPacker;
class FitBox implements Box
{
/**
* FitBox constructor.
* @param Item $item
*/
public function __construct(Item $item)
$this->item = $item;
}
* @var Item
protected $item;
* Reference for box type (e.g. SKU or description)
* @return string
public function getReference()
return $this->item->getDescription();
* Outer width in mm
* @return int
public function getOuterWidth()
return $this->item->getWidth() + 1;
* Outer length in mm
public function getOuterLength()
return $this->item->getLength() + 1;
* Outer depth in mm
public function getOuterDepth()
return $this->item->getDepth() + 1;
* Empty weight in g
public function getEmptyWeight()
return 0;
* Inner width in mm
public function getInnerWidth()
* Inner length in mm
public function getInnerLength()
* Inner depth in mm
public function getInnerDepth()
* Total inner volume of packing in mm^3
public function getInnerVolume()
return $this->getInnerDepth() * $this->getInnerLength() * $this->getInnerWidth();
* Max weight the packaging can hold in g
public function getMaxWeight()
return $this->item->getWeight() + 1;