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

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