Total Complexity | 9 |
Total Lines | 60 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 0 |
1 | <?php |
||
11 | class Entry |
||
12 | { |
||
13 | protected string $id = ''; |
||
14 | protected string $name = ''; |
||
15 | protected string $desc = ''; |
||
16 | protected int $position = 0; |
||
17 | protected bool $goSub = false; |
||
18 | protected ?Menu $submenu = null; |
||
19 | |||
20 | 16 | public function setData(string $id, string $name, string $desc, int $position, bool $goSub = false): self |
|
21 | { |
||
22 | 16 | $this->id = $id; |
|
23 | 16 | $this->name = $name; |
|
24 | 16 | $this->desc = $desc; |
|
25 | 16 | $this->position = $position; |
|
26 | 16 | $this->goSub = $goSub; |
|
27 | 16 | $this->submenu = null; |
|
28 | 16 | return $this; |
|
29 | } |
||
30 | |||
31 | 3 | public function setPosition(int $position): self |
|
32 | { |
||
33 | 3 | $this->position = $position; |
|
34 | 3 | return $this; |
|
35 | } |
||
36 | |||
37 | 1 | public function addSubmenu(?Menu $menu): self |
|
38 | { |
||
39 | 1 | $this->submenu = $menu; |
|
40 | 1 | return $this; |
|
41 | } |
||
42 | |||
43 | 13 | public function getId(): string |
|
46 | } |
||
47 | |||
48 | 9 | public function getName(): string |
|
49 | { |
||
50 | 9 | return $this->name; |
|
51 | } |
||
52 | |||
53 | 9 | public function getDesc(): string |
|
54 | { |
||
55 | 9 | return $this->desc; |
|
56 | } |
||
57 | |||
58 | 14 | public function getPosition(): int |
|
59 | { |
||
60 | 14 | return $this->position; |
|
61 | } |
||
62 | |||
63 | 9 | public function canGoSub(): bool |
|
66 | } |
||
67 | |||
68 | 2 | public function getSubmenu(): ?Menu |
|
69 | { |
||
70 | 2 | return $this->submenu; |
|
71 | } |
||
72 | } |
||
73 |