Passed
Push — main ( 7f60ea...60225c )
by Thierry
08:29
created

MenuItemElement::disabled()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

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