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