Total Complexity | 8 |
Total Lines | 56 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
11 | class Menu |
||
12 | { |
||
13 | protected string $file = ''; |
||
14 | protected string $name = ''; |
||
15 | protected string $title = ''; |
||
16 | protected int $displayCount = 0; |
||
17 | /** @var Entry[] */ |
||
18 | protected array $entries = []; |
||
19 | |||
20 | 2 | public function clear(): self |
|
21 | { |
||
22 | 2 | return $this->setData('', '', '', 0); |
|
23 | } |
||
24 | |||
25 | 15 | public function setData(string $file, string $name, string $title, int $count): self |
|
26 | { |
||
27 | 15 | $this->name = strval($name); |
|
28 | 15 | $this->title = strval($title); |
|
29 | 15 | $this->file = strval($file); |
|
30 | 15 | $this->displayCount = intval($count); |
|
31 | 15 | $this->entries = []; |
|
32 | 15 | return $this; |
|
33 | } |
||
34 | |||
35 | 12 | public function addItem(Entry $entry): self |
|
36 | { |
||
37 | 12 | $this->entries[$entry->getId()] = $entry; |
|
38 | 12 | return $this; |
|
39 | } |
||
40 | |||
41 | 13 | public function getName(): string |
|
42 | { |
||
43 | 13 | return strval($this->name); |
|
44 | } |
||
45 | |||
46 | 15 | public function getTitle(): string |
|
47 | { |
||
48 | 15 | return strval($this->title); |
|
49 | } |
||
50 | |||
51 | 17 | public function getFile(): string |
|
52 | { |
||
53 | 17 | return strval($this->file); |
|
54 | } |
||
55 | |||
56 | 13 | public function getDisplayCount(): int |
|
59 | } |
||
60 | |||
61 | /** |
||
62 | * @return Entry[] |
||
63 | */ |
||
64 | 16 | public function getEntries(): array |
|
67 | } |
||
68 | } |
||
69 |