Total Complexity | 9 |
Total Lines | 49 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
12 | class Option extends Element implements Fillable |
||
13 | { |
||
14 | use Fill; |
||
15 | |||
16 | protected string $type = 'option'; |
||
17 | |||
18 | |||
19 | 38 | public function __construct(string $name, ?string $title = null) |
|
20 | { |
||
21 | 38 | parent::__construct($name, $title); |
|
22 | 38 | $this->setAttributes( |
|
23 | 38 | AttributeFactory::createFromArray([ |
|
24 | 38 | 'value' => $name, |
|
25 | 38 | ]) |
|
26 | 38 | ); |
|
27 | 38 | $this->removeAttribute('name'); |
|
28 | 38 | $this->removeAttribute('id'); |
|
29 | } |
||
30 | |||
31 | /** |
||
32 | * |
||
33 | * @param mixed $value |
||
34 | * @return $this |
||
35 | */ |
||
36 | 36 | protected function setDefault(mixed $value = null): static |
|
52 | } |
||
53 | |||
54 | 10 | public function baseHtml(): string |
|
61 | } |
||
62 | } |
||
63 |