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