Total Complexity | 7 |
Total Lines | 40 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
16 | class Manager implements ManagerInterface |
||
17 | { |
||
18 | /** |
||
19 | * @var Element[] |
||
20 | */ |
||
21 | protected $elements; |
||
22 | |||
23 | public function __construct() |
||
24 | { |
||
25 | $this->elements = []; |
||
26 | } |
||
27 | |||
28 | public function addElement(Element $element): void |
||
29 | { |
||
30 | $this->elements[$element->getId()] = $element; |
||
31 | } |
||
32 | |||
33 | public function hasElement(string $id): bool |
||
34 | { |
||
35 | return array_key_exists($id, $this->elements); |
||
36 | } |
||
37 | |||
38 | public function getElement(string $id): Element |
||
41 | } |
||
42 | |||
43 | public function removeElement(string $id): void |
||
46 | } |
||
47 | |||
48 | public function getElements(): array |
||
49 | { |
||
50 | return $this->elements; |
||
51 | } |
||
52 | |||
53 | public function accept(Visitor $visitor): void |
||
56 | } |
||
57 | } |
||
58 |