Passed
Push — master ( 20e747...679572 )
by Ivan
01:59
created

RouteNavigationItem   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
dl 0
loc 29
c 0
b 0
f 0
wmc 3
lcom 0
cbo 2
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 11 1
A getRoute() 0 4 1
A getParameters() 0 4 1
1
<?php
2
3
declare(strict_types = 1);
4
5
namespace Everlution\Navigation;
6
7
use Everlution\Navigation\Extension\ManualMatch;
8
use Everlution\Navigation\Extension\ManualMatchExtension;
9
10
/**
11
 * Class RouteNavigationItem.
12
 * @author Ivan Barlog <[email protected]>
13
 */
14
class RouteNavigationItem extends NavigationItem implements RoutableItem, ManualMatch
15
{
16
    use ManualMatchExtension;
17
18
    /** @var array */
19
    private $parameters;
20
21
    public function __construct(
22
        string $label,
23
        string $route,
24
        array $parameters = [],
25
        Item $parent = null,
26
        array $children = []
27
    ) {
28
        parent::__construct($route, $label, $parent, $children);
29
30
        $this->parameters = $parameters;
31
    }
32
33
    public function getRoute(): string
34
    {
35
        return $this->getUri();
36
    }
37
38
    public function getParameters(): array
39
    {
40
        return $this->parameters;
41
    }
42
}
43