| 1 | <?php declare(strict_types = 1); |
||
| 5 | class Cart |
||
| 6 | { |
||
| 7 | |||
| 8 | /** |
||
| 9 | * @var CartItem[] |
||
| 10 | */ |
||
| 11 | private $items = []; |
||
| 12 | |||
| 13 | /** |
||
| 14 | * @var Currency |
||
| 15 | */ |
||
| 16 | private $currency; |
||
| 17 | |||
| 18 | 2 | public function __construct(Currency $currency) |
|
| 22 | |||
| 23 | 2 | public function addItem(string $name, int $quantity, int $amount, string $description = null) |
|
| 27 | |||
| 28 | /** |
||
| 29 | * @return CartItem[] |
||
| 30 | */ |
||
| 31 | 1 | public function getItems(): array |
|
| 35 | |||
| 36 | 1 | public function getCurrentPrice(): Price |
|
| 43 | |||
| 44 | 1 | private function countTotalAmount(): int |
|
| 54 | |||
| 55 | } |
||
| 56 |