Total Complexity | 6 |
Total Lines | 36 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 0 |
1 | <?php |
||
7 | class Item implements ItemInterface |
||
8 | { |
||
9 | private $id; |
||
10 | private $price; |
||
11 | private $quantity; |
||
12 | |||
13 | 7 | public function __construct(string $id, float $price = 0.00, int $quantity = 1) |
|
14 | { |
||
15 | 7 | $this->id = $id; |
|
16 | 7 | $this->price = $price; |
|
17 | 7 | $this->quantity = $quantity; |
|
18 | 7 | } |
|
19 | |||
20 | 1 | public function getId(): string |
|
21 | { |
||
22 | 1 | return $this->id; |
|
23 | } |
||
24 | |||
25 | 1 | public function getQuantity(): int |
|
28 | } |
||
29 | |||
30 | 1 | public function setQuantity(int $quantity) |
|
33 | 1 | } |
|
34 | |||
35 | 1 | public function getPrice(): float |
|
36 | { |
||
37 | 1 | return $this->price; |
|
38 | } |
||
39 | |||
40 | 1 | public function setPrice(float $price) |
|
43 | 1 | } |
|
44 | } |
||
45 |