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

PrefixedNavigationItem   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A getPrefix() 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 PrefixedNavigationItem.
12
 * @author Ivan Barlog <[email protected]>
13
 */
14
class PrefixedNavigationItem extends NavigationItem implements PrefixableItem, ManualMatch
15
{
16
    use ManualMatchExtension;
17
18
    /** @var string */
19
    private $prefix;
20
21
    public function __construct(string $uri, string $label, string $regexPattern, Item $parent = null, array $children = [])
22
    {
23
        parent::__construct($uri, $label, $parent, $children);
24
25
        $this->prefix = $regexPattern;
26
    }
27
28
    public function getPrefix()
29
    {
30
        return $this->prefix;
31
    }
32
}
33