Completed
Push — master ( 114b96...dedaf7 )
by Jakub
05:06
created

Menu::setHtmlId()

Size

Total Lines 2
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 1
nc 1
nop 1
dl 0
loc 2
ccs 1
cts 1
cp 1
c 0
b 0
f 0
1
<?php
2
declare(strict_types=1);
3
4
namespace Nexendrie\Menu;
5
6
use Nette\Localization\ITranslator;
7
8
/**
9
 * Menu
10
 *
11
 * @author Jakub Konečný
12
 * @property string $title
13
 * @property-read string $name
14
 * @property string $htmlId
15
 * @property ITranslator $translator
16
 */
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;
0 ignored issues
show
Bug introduced by
The property name is declared read-only in Nexendrie\Menu\Menu.
Loading history...
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) {
62 1
    $this->translator = $translator;
63 1
  }
64
}
65
?>