Link   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 58
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 2
dl 0
loc 58
ccs 6
cts 6
cp 1
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getOption() 0 8 2
A isDropDown() 0 4 1
1
<?php namespace NukaCode\Menu;
2
3
use NukaCode\Menu\Traits\Activate;
4
use NukaCode\Menu\Traits\Insertable;
5
6
/**
7
 * Class Link
8
 *
9
 * @package NukaCode\Menu
10
 */
11
class Link {
12
    use Insertable;
13
    use Activate;
14
15
    /**
16
     * The link slug
17
     *
18
     * @var string
19
     */
20
    public $slug;
21
22
    /**
23
     * Name of the link
24
     *
25
     * @var string
26
     */
27
    public $name;
28
29
    /**
30
     * Link url
31
     *
32
     * @var string
33
     */
34
    public $url;
35
36
    /**
37
     * Additional options for links
38
     *
39
     * @var array
40
     */
41
    public $options = [];
42
43
    /**
44
     * Get a menu option
45
     *
46
     * @param $name The name of the menu option
47
     *
48
     * @return string|bool Return the menu option if it exists or false.
49
     */
50 2
    public function getOption($name)
51
    {
52 2
        if (isset($this->options[$name])) {
53 1
            return $this->options[$name];
54
        }
55
56 1
        return false;
57
    }
58
59
    /**
60
     * Check if the current object is a drop down
61
     *
62
     * @return bool
63
     */
64 3
    public function isDropDown()
65
    {
66 3
        return false;
67
    }
68
}