| 1 | <?php |
||
| 12 | class TestItem implements Item |
||
| 13 | { |
||
| 14 | /** |
||
| 15 | * @var string |
||
| 16 | */ |
||
| 17 | private $description; |
||
| 18 | |||
| 19 | /** |
||
| 20 | * @var int |
||
| 21 | */ |
||
| 22 | private $width; |
||
| 23 | |||
| 24 | /** |
||
| 25 | * @var int |
||
| 26 | */ |
||
| 27 | private $length; |
||
| 28 | |||
| 29 | /** |
||
| 30 | * @var int |
||
| 31 | */ |
||
| 32 | private $depth; |
||
| 33 | |||
| 34 | /** |
||
| 35 | * @var int |
||
| 36 | */ |
||
| 37 | private $weight; |
||
| 38 | |||
| 39 | /** |
||
| 40 | * @var int |
||
| 41 | */ |
||
| 42 | private $volume; |
||
| 43 | |||
| 44 | /** |
||
| 45 | * TestItem constructor. |
||
| 46 | * |
||
| 47 | * @param string $description |
||
| 48 | * @param int $width |
||
| 49 | * @param int $length |
||
| 50 | * @param int $depth |
||
| 51 | * @param int $weight |
||
| 52 | */ |
||
| 53 | public function __construct($description, $width, $length, $depth, $weight) |
||
| 54 | { |
||
| 55 | $this->description = $description; |
||
| 56 | $this->width = $width; |
||
| 57 | $this->length = $length; |
||
| 58 | $this->depth = $depth; |
||
| 59 | $this->weight = $weight; |
||
| 60 | |||
| 61 | $this->volume = $this->width * $this->length * $this->depth; |
||
| 62 | } |
||
| 63 | |||
| 64 | /** |
||
| 65 | * @return string |
||
| 66 | */ |
||
| 67 | public function getDescription() |
||
| 68 | { |
||
| 69 | return $this->description; |
||
| 70 | } |
||
| 71 | |||
| 72 | /** |
||
| 73 | * @return int |
||
| 74 | */ |
||
| 75 | public function getWidth() |
||
| 76 | { |
||
| 77 | return $this->width; |
||
| 78 | } |
||
| 79 | |||
| 80 | /** |
||
| 81 | * @return int |
||
| 82 | */ |
||
| 83 | public function getLength() |
||
| 84 | { |
||
| 85 | return $this->length; |
||
| 86 | } |
||
| 87 | |||
| 88 | /** |
||
| 89 | * @return int |
||
| 90 | */ |
||
| 91 | public function getDepth() |
||
| 92 | { |
||
| 93 | return $this->depth; |
||
| 94 | } |
||
| 95 | |||
| 96 | /** |
||
| 97 | * @return int |
||
| 98 | */ |
||
| 99 | public function getWeight() |
||
| 100 | { |
||
| 101 | return $this->weight; |
||
| 102 | } |
||
| 103 | |||
| 104 | /** |
||
| 105 | * @return int |
||
| 106 | */ |
||
| 107 | public function getVolume() |
||
| 108 | { |
||
| 109 | return $this->volume; |
||
| 110 | } |
||
| 111 | } |
||
| 112 |