Total Complexity | 5 |
Total Lines | 44 |
Duplicated Lines | 0 % |
Coverage | 12.5% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
9 | final class Inventory extends Collection |
||
10 | { |
||
11 | public function filterUsable(): self |
||
15 | ); |
||
16 | } |
||
17 | |||
18 | /** |
||
19 | * @note This method mutates state of the collection |
||
20 | */ |
||
21 | public function add(InventoryItem $item): self |
||
22 | { |
||
23 | $this->items[] = $item; |
||
24 | |||
25 | return $this; |
||
26 | } |
||
27 | |||
28 | /** |
||
29 | * @note This method mutates state of the collection |
||
30 | */ |
||
31 | public function addMany(InventoryItem ...$items): self |
||
32 | { |
||
33 | $this->items = array_merge($this->items, $items); |
||
34 | |||
35 | return $this; |
||
36 | } |
||
37 | |||
38 | /** |
||
39 | * @note This method mutates state of the collection |
||
40 | */ |
||
41 | public function remove(InventoryItem $item): self |
||
48 | } |
||
49 | |||
50 | 1 | protected function getType(): string |
|
53 | } |
||
54 | } |
||
55 |