Menu::__construct()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 6
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 8
ccs 6
cts 6
cp 1
rs 9.4285
c 0
b 0
f 0
cc 2
eloc 4
nc 2
nop 1
crap 2
1
<?php namespace NukaCode\Menu;
2
3
use Illuminate\Support\Collection;
4
use NukaCode\Menu\Traits\Insertable;
5
use NukaCode\Menu\Traits\Linkable;
6
7
/**
8
 * Class Menu
9
 *
10
 * @package NukaCode\Menu
11
 */
12
class Menu {
13
    use Linkable;
14
    use Insertable;
15
16
    /**
17
     * Name of this menu
18
     *
19
     * @var string
20
     */
21
    public $name;
22
23
    /**
24
     * Construct a menu
25
     *
26
     * @param $menuName
27
     */
28 17
    public function __construct($menuName = null)
29
    {
30 17
        $this->links = new Collection();
31
32 17
        if (isset($menuName)) {
33 13
            $this->name = $menuName;
34 13
        }
35
    }
36
}