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

MenuItemComponent   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 6
dl 0
loc 27
rs 10
c 0
b 0
f 0
wmc 4

2 Methods

Rating   Name   Duplication   Size   Complexity  
A disabled() 0 4 2
A active() 0 4 2
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