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

RadioElement   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A checked() 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\RadioInterface;
7
8
class RadioElement extends Element implements RadioInterface
9
{
10
    /**
11
     * @var string
12
     */
13
    public static string $tag = 'input';
14
15
    /**
16
     * @inheritDoc
17
     */
18
    public function checked(bool $checked = false): static
19
    {
20
        $checked && $this->setAttribute('checked', 'checked');
21
        return $this;
22
    }
23
}
24