NavigationLink   A
last analyzed

Complexity

Total Complexity 7

Size/Duplication

Total Lines 63
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 2
Bugs 0 Features 0
Metric Value
eloc 17
c 2
b 0
f 0
dl 0
loc 63
ccs 0
cts 19
cp 0
rs 10
wmc 7

7 Methods

Rating   Name   Duplication   Size   Complexity  
A setTranslationDomain() 0 4 1
A __construct() 0 6 1
A getLink() 0 3 1
A getTranslationDomain() 0 3 1
A getParameters() 0 3 1
A getRoute() 0 3 1
A getIcon() 0 3 1
1
<?php
2
3
namespace Obblm\Core\Twig\Parts;
4
5
class NavigationLink implements NavigationElementInterface
6
{
7
    protected $route;
8
    protected $link;
9
    protected $parameters;
10
    protected $icon;
11
    protected $translationDomain = null;
12
13
    public function __construct(string $route = 'obblm_dashboard', string $link = "Home", array $parameters = [], string $icon = null)
14
    {
15
        $this->route = $route;
16
        $this->link = $link;
17
        $this->parameters = $parameters;
18
        $this->icon = $icon;
19
    }
20
21
    /**
22
     * @return string
23
     */
24
    public function getRoute(): string
25
    {
26
        return $this->route;
27
    }
28
29
    /**
30
     * @return string
31
     */
32
    public function getLink(): string
33
    {
34
        return $this->link;
35
    }
36
37
    /**
38
     * @return array
39
     */
40
    public function getParameters(): array
41
    {
42
        return $this->parameters;
43
    }
44
45
    /**
46
     * @return string|null
47
     */
48
    public function getIcon(): ?string
49
    {
50
        return $this->icon;
51
    }
52
53
    /**
54
     * @return mixed
55
     */
56
    public function getTranslationDomain()
57
    {
58
        return $this->translationDomain;
59
    }
60
61
    /**
62
     * @param string|null $translationDomain
63
     */
64
    public function setTranslationDomain(?string $translationDomain): self
65
    {
66
        $this->translationDomain = $translationDomain;
67
        return $this;
68
    }
69
}
70