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

RadioElement::checked()   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\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