Passed
Pull Request — master (#8)
by
unknown
02:32
created

ParentNode   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 3
dl 0
loc 24
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getParent() 0 3 1
A __construct() 0 4 1
A getItem() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Everlution\Navigation\Builder;
6
7
use Everlution\Navigation\Item\ItemInterface;
8
9
/**
10
 * Class ParentNode.
11
 *
12
 * @author Ivan Barlog <[email protected]>
13
 */
14
class ParentNode extends RootNode
15
{
16
    /** @var ItemInterface */
17
    private $item;
18
    /** @var RootNode */
19
    private $parent;
20
21
    public function __construct(ItemInterface $item, RootNode $parent)
22
    {
23
        $this->item = $item;
24
        $this->parent = $parent;
25
    }
26
27
    public function getItem(): ItemInterface
28
    {
29
        return $this->item;
30
    }
31
32
    /**
33
     * @return RootNode
34
     */
35
    public function getParent(): RootNode
36
    {
37
        return $this->parent;
38
    }
39
}
40