| 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 |
||
| 18 | 29 | protected function generateInput(): string |
|
| 19 | { |
||
| 20 | 29 | $value = $this->getAttributeValue(); |
|
| 21 | |||
| 22 | 29 | if (!is_string($value) && $value !== null) { |
|
| 23 | throw new InvalidArgumentException('Text widget must be a string or null value.'); |
||
| 24 | } |
||
| 25 | |||
| 26 | 29 | $tagAttributes = $this->getFormElementTagAttributes(); |
|
| 27 | |||
| 28 | 29 | return Html::textInput($this->getInputName(), $value, $tagAttributes)->render(); |
|
| 29 | } |
||
| 31 |