| Total Complexity | 9 |
| Total Lines | 46 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 0 | ||
| 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 | $this->name = $name; |
|
|
|
|||
| 29 | 1 | $this->htmlId = $htmlId; |
|
| 30 | 1 | $this->translator = new class implements ITranslator { |
|
| 31 | public function translate($message, $count = NULL): string { |
||
| 32 | 1 | return $message; |
|
| 33 | } |
||
| 34 | }; |
||
| 35 | 1 | } |
|
| 36 | |||
| 37 | public function getTitle(): string { |
||
| 38 | 1 | return $this->title; |
|
| 39 | } |
||
| 40 | |||
| 41 | public function setTitle(string $title) { |
||
| 42 | 1 | $this->title = $title; |
|
| 43 | 1 | } |
|
| 44 | |||
| 45 | public function getName(): string { |
||
| 46 | 1 | return $this->name; |
|
| 47 | } |
||
| 48 | |||
| 49 | public function getHtmlId(): string { |
||
| 50 | 1 | return $this->htmlId; |
|
| 51 | } |
||
| 52 | |||
| 53 | public function setHtmlId(string $htmlId) { |
||
| 54 | 1 | $this->htmlId = $htmlId; |
|
| 55 | 1 | } |
|
| 56 | |||
| 57 | public function getTranslator(): ITranslator { |
||
| 58 | 1 | return $this->translator; |
|
| 59 | } |
||
| 60 | |||
| 61 | public function setTranslator(ITranslator $translator) { |
||
| 63 | 1 | } |
|
| 64 | } |
||
| 65 | ?> |