Conditions | 4 |
Paths | 2 |
Total Lines | 11 |
Code Lines | 5 |
Lines | 0 |
Ratio | 0 % |
Tests | 6 |
CRAP Score | 4 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
25 | 7 | protected function generateInput(): string |
|
26 | { |
||
27 | 7 | $value = $this->getValue(); |
|
28 | |||
29 | 7 | if (!is_string($value) && !is_numeric($value) && $value !== null) { |
|
30 | 1 | throw new InvalidArgumentException('Hidden widget requires a string, numeric or null value.'); |
|
31 | } |
||
32 | |||
33 | 6 | $inputAttributes = $this->getInputAttributes(); |
|
34 | |||
35 | 6 | return Html::hiddenInput($this->getName(), $value, $inputAttributes)->render(); |
|
36 | } |
||
38 |