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

MenuItemElement   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Importance

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

2 Methods

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