Total Complexity | 3 |
Total Lines | 29 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
14 | class Checkbox extends AControl implements IOriginalValue |
||
15 | { |
||
16 | use TChecked; |
||
17 | |||
18 | private static int $uniqid = 0; |
||
19 | protected string $templateInput = '<input type="checkbox" value="%1$s"%2$s />'; |
||
20 | |||
21 | /** |
||
22 | * @param string $alias |
||
23 | * @param string|int|float|null $value |
||
24 | * @param string $label |
||
25 | * @return $this |
||
26 | */ |
||
27 | 5 | public function set(string $alias, $value = null, string $label = ''): self |
|
28 | { |
||
29 | 5 | $this->setEntry($alias, $value, $label); |
|
30 | 5 | $this->setAttribute('id', sprintf('%s_%s', $this->getKey(), self::$uniqid)); |
|
31 | 5 | self::$uniqid++; |
|
32 | 5 | return $this; |
|
33 | } |
||
34 | |||
35 | 1 | public function getOriginalValue() |
|
36 | { |
||
37 | 1 | return $this->originalValue; |
|
38 | } |
||
39 | |||
40 | 5 | protected function fillTemplate(): string |
|
43 | } |
||
44 | } |
||
45 |