| Conditions | 3 |
| Paths | 2 |
| Total Lines | 14 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 7 |
| CRAP Score | 3.0175 |
| Changes | 2 | ||
| 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->getFormElementTagAttributes(); |
|
| 27 | |||
| 28 | 28 | $this->prepareIdInFormElementTagAttributes($tagAttributes); |
|
| 29 | 28 | $this->preparePlaceholderInFormElementTagAttributes($tagAttributes); |
|
| 30 | |||
| 31 | 28 | return Html::textInput($this->getInputName(), $value, $tagAttributes)->render(); |
|
| 32 | } |
||
| 34 |