Total Complexity | 4 |
Total Lines | 36 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
9 | class Checkbox extends Component |
||
10 | { |
||
11 | public string $uuid; |
||
12 | |||
13 | public function __construct( |
||
14 | public ?string $id = null, |
||
15 | public ?string $label = null, |
||
16 | public ?bool $right = false, |
||
17 | public ?string $hint = null, |
||
18 | public ?string $hintClass = 'fieldset-label', |
||
19 | |||
20 | // Validations |
||
21 | public ?string $errorField = null, |
||
22 | public ?string $errorClass = 'text-error', |
||
23 | public ?bool $omitError = false, |
||
24 | public ?bool $firstErrorOnly = false, |
||
25 | ) { |
||
26 | $this->uuid = md5(serialize($this)) . $id; |
||
27 | } |
||
28 | |||
29 | public function modelName(): ?string |
||
32 | } |
||
33 | |||
34 | public function errorFieldName(): ?string |
||
35 | { |
||
36 | return $this->errorField ?? $this->modelName(); |
||
37 | } |
||
38 | |||
39 | /** |
||
40 | * Get the view / contents that represent the component. |
||
41 | */ |
||
42 | public function render(): View|Closure|string |
||
45 | } |
||
46 | } |
||
47 |