RadioComponent   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A checked() 0 4 2
1
<?php
2
3
namespace Lagdo\UiBuilder\Component\Base;
4
5
use Lagdo\UiBuilder\Component\HtmlComponent;
6
7
class RadioComponent extends HtmlComponent
8
{
9
    use Traits\InputLabelTrait;
10
    use Traits\InputValidationTrait;
11
12
    /**
13
     * @var string
14
     */
15
    public static string $tag = 'input';
16
17
    /**
18
     * @param bool $checked
19
     *
20
     * @return static
21
     */
22
    public function checked(bool $checked = false): static
23
    {
24
        $this->element()->setAttribute('checked', $checked ? 'checked' : false);
25
        return $this;
26
    }
27
}
28