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

SubMenu   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 38
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 38
wmc 3
lcom 0
cbo 0
ccs 8
cts 8
cp 1
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A getMenu() 0 4 1
A getItem() 0 4 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
}