for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* Box packing (3D bin packing, knapsack problem).
*
* @author Doug Wright
*/
declare(strict_types=1);
namespace DVDoug\BoxPacker;
use JsonSerializable;
* Class WorkingVolume.
* @internal
class WorkingVolume implements Box, JsonSerializable
{
* @var int
private $width;
private $length;
private $depth;
private $maxWeight;
* Constructor.
* @param int $width
* @param int $length
* @param int $depth
* @param int $maxWeight
public function __construct(
int $width,
int $length,
int $depth,
int $maxWeight
) {
$this->width = $width;
$this->length = $length;
$this->depth = $depth;
$this->maxWeight = $maxWeight;
}
* @return string
public function getReference(): string
return 'Working Volume';
* @return int
public function getOuterWidth(): int
return $this->width;
public function getOuterLength(): int
return $this->length;
public function getOuterDepth(): int
return $this->depth;
public function getEmptyWeight(): int
return 0;
public function getInnerWidth(): int
public function getInnerLength(): int
public function getInnerDepth(): int
public function getMaxWeight(): int
return $this->maxWeight;
* {@inheritdoc}
public function jsonSerialize(): array
return [
'reference' => $this->getReference(),
'width' => $this->width,
'length' => $this->length,
'depth' => $this->depth,
'maxWeight' => $this->maxWeight,
];