Conditions | 3 |
Paths | 2 |
Total Lines | 11 |
Code Lines | 5 |
Lines | 0 |
Ratio | 0 % |
Tests | 5 |
CRAP Score | 3.0416 |
Changes | 3 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
19 | 29 | protected function generateInput(): string |
|
20 | { |
||
21 | 29 | $value = $this->getAttributeValue(); |
|
22 | |||
23 | 29 | if (!is_string($value) && $value !== null) { |
|
24 | throw new InvalidArgumentException('Text widget must be a string or null value.'); |
||
25 | } |
||
26 | |||
27 | 29 | $tagAttributes = $this->getFormElementTagAttributes(); |
|
28 | |||
29 | 29 | return Html::textInput($this->getInputName(), $value, $tagAttributes)->render(); |
|
30 | } |
||
32 |