Total Complexity | 6 |
Total Lines | 27 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
6 | class Product |
||
7 | { |
||
8 | public function __construct(array $item) |
||
9 | { |
||
10 | foreach ($item as $property => $value) { |
||
11 | $this->{$property} = $value; |
||
12 | } |
||
13 | } |
||
14 | |||
15 | public function getName() : string |
||
16 | { |
||
17 | return $this->name; |
||
|
|||
18 | } |
||
19 | |||
20 | public function getPrice():int |
||
23 | } |
||
24 | |||
25 | public function getQuantity() : int |
||
26 | { |
||
27 | return (int)$this->quantity; |
||
28 | } |
||
29 | |||
30 | public function getCost() : int |
||
33 | } |
||
34 | } |
||
35 |