Passed
Push — main ( 68e606...997043 )
by Thierry
02:29
created

MenuItemComponent::active()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 2
nc 2
nop 1
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Lagdo\UiBuilder\Component\Base;
4
5
use Lagdo\UiBuilder\Component\HtmlComponent;
6
7
class MenuItemComponent extends HtmlComponent
8
{
9
    /**
10
     * @var string
11
     */
12
    public static string $tag = 'a';
13
14
    /**
15
     * @param bool $active
16
     *
17
     * @return static
18
     */
19
    public function active(bool $active): static
20
    {
21
        $active && $this->element()->addClass('active');
22
        return $this;
23
    }
24
25
    /**
26
     * @param bool $disabled
27
     *
28
     * @return static
29
     */
30
    public function disabled(bool $disabled): static
31
    {
32
        $disabled && $this->element()->addClass('disabled');
33
        return $this;
34
    }
35
}
36