Completed
Push — master ( e54ea7...7cecbb )
by Oleg
05:53
created

SubMenu::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 5
ccs 4
cts 4
cp 1
rs 9.4285
cc 1
eloc 3
nc 1
nop 2
crap 1
1
<?php
2
namespace Malezha\Menu\Entity;
3
4
use Malezha\Menu\Contracts\Builder as BuilderContract;
5
use Malezha\Menu\Contracts\SubMenu as SubMenuContract;
6
use Malezha\Menu\Contracts\Item as ItemContract;
7
8
/**
9
 * Class SubMenu
10
 * @package Malezha\Menu\Entity
11
 */
12
class SubMenu implements SubMenuContract
13
{
14
15
    /**
16
     * @var ItemContract
17
     */
18
    protected $item;
19
20
    /**
21
     * @var BuilderContract
22
     */
23
    protected $menu;
24
25
    /**
26
     * @inheritDoc
27
     */
28 5
    public function __construct(BuilderContract $menu, ItemContract $item)
29
    {
30 5
        $this->menu = $menu;
31 5
        $this->item = $item;
32 5
    }
33
34
    /**
35
     * @inheritDoc
36
     */
37 4
    public function getMenu()
38
    {
39 4
        return $this->menu;
40
    }
41
42
    /**
43
     * @inheritDoc
44
     */
45 4
    public function getItem()
46
    {
47 4
        return $this->item;
48
    }
49
}