Conditions | 4 |
Paths | 2 |
Total Lines | 12 |
Code Lines | 5 |
Lines | 0 |
Ratio | 0 % |
Tests | 5 |
CRAP Score | 4.074 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
18 | 1 | protected function generateInput(): string |
|
19 | { |
||
20 | 1 | $value = $this->getAttributeValue(); |
|
21 | |||
22 | 1 | if (!is_string($value) && !is_numeric($value) && $value !== null) { |
|
23 | throw new InvalidArgumentException('Hidden widget requires a string, numeric or null value.'); |
||
24 | } |
||
25 | |||
26 | 1 | $tagAttributes = $this->getInputTagAttributes(); |
|
27 | |||
28 | /** @psalm-suppress MixedArgumentTypeCoercion */ |
||
29 | 1 | return Html::hiddenInput($this->getInputName(), $value, $tagAttributes)->render(); |
|
30 | } |
||
32 |