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 |
||
24 | 4 | protected function generateInput(): string |
|
25 | { |
||
26 | 4 | $value = $this->getAttributeValue(); |
|
27 | |||
28 | 4 | if (!is_string($value) && !is_numeric($value) && $value !== null) { |
|
29 | 1 | throw new InvalidArgumentException('Hidden widget requires a string, numeric or null value.'); |
|
30 | } |
||
31 | |||
32 | 3 | $tagAttributes = $this->getInputTagAttributes(); |
|
33 | |||
34 | 3 | return Html::hiddenInput($this->getInputName(), $value, $tagAttributes)->render(); |
|
35 | } |
||
37 |