Activate::setActive()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 1
dl 0
loc 6
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace JumpGate\Menu\Traits;
4
5
/**
6
 * Class Activate
7
 *
8
 * @package JumpGate\Menu\Traits
9
 */
10
trait Activate
11
{
12
    /**
13
     * Is the link active.
14
     *
15
     * @var bool
16
     */
17
    public $active = false;
18
19
    /**
20
     * Set this link as active.
21
     *
22
     * @param bool $bool
23
     *
24
     * @return $this
25
     */
26
    public function setActive($bool = true)
27
    {
28
        $this->active = $bool;
29
30
        return $this;
31
    }
32
33
    /**
34
     * Check if the link is active or not.
35
     *
36
     * @return bool
37
     */
38
    public function isActive()
39
    {
40
        return $this->active;
41
    }
42
}
43