| Total Complexity | 10 |
| Total Lines | 68 |
| Duplicated Lines | 0 % |
| Coverage | 44.44% |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 13 | 1 | class Menu extends Collection { |
|
| 14 | public string $title = ""; |
||
| 15 | public string $name; |
||
| 16 | public string $htmlId; |
||
| 17 | public ITranslator $translator; |
||
| 18 | |||
| 19 | public function __construct(string $name = "default", string $htmlId = "menu") { |
||
| 20 | 1 | parent::__construct(); |
|
| 21 | 1 | $this->name = $name; |
|
| 22 | 1 | $this->htmlId = $htmlId; |
|
| 23 | 1 | $this->translator = new class implements ITranslator { |
|
| 24 | public function translate($message, ... $parameters): string { |
||
|
1 ignored issue
–
show
|
|||
| 25 | 1 | return $message; |
|
| 26 | } |
||
| 27 | }; |
||
| 28 | 1 | } |
|
| 29 | |||
| 30 | /** |
||
| 31 | * @deprecated Access the property directly |
||
| 32 | */ |
||
| 33 | public function getTitle(): string { |
||
| 34 | return $this->title; |
||
| 35 | } |
||
| 36 | |||
| 37 | /** |
||
| 38 | * @deprecated Access the property directly |
||
| 39 | */ |
||
| 40 | public function setTitle(string $title): void { |
||
| 41 | $this->title = $title; |
||
| 42 | } |
||
| 43 | |||
| 44 | /** |
||
| 45 | * @deprecated Access the property directly |
||
| 46 | */ |
||
| 47 | public function getName(): string { |
||
| 48 | return $this->name; |
||
| 49 | } |
||
| 50 | |||
| 51 | protected function setName(string $name): void { |
||
| 52 | $this->name = $name; |
||
| 53 | } |
||
| 54 | |||
| 55 | /** |
||
| 56 | * @deprecated Access the property directly |
||
| 57 | */ |
||
| 58 | public function getHtmlId(): string { |
||
| 59 | return $this->htmlId; |
||
| 60 | } |
||
| 61 | |||
| 62 | /** |
||
| 63 | * @deprecated Access the property directly |
||
| 64 | */ |
||
| 65 | public function setHtmlId(string $htmlId): void { |
||
| 66 | $this->htmlId = $htmlId; |
||
| 67 | } |
||
| 68 | |||
| 69 | /** |
||
| 70 | * @deprecated Access the property directly |
||
| 71 | */ |
||
| 72 | public function getTranslator(): ITranslator { |
||
| 73 | return $this->translator; |
||
| 74 | } |
||
| 75 | |||
| 76 | /** |
||
| 77 | * @deprecated Access the property directly |
||
| 78 | */ |
||
| 79 | public function setTranslator(ITranslator $translator): void { |
||
| 81 | 1 | } |
|
| 82 | } |
||
| 83 | ?> |