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 | 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 | $this->prepareIdInFormElementTagAttributes($tagAttributes); |
|
29 | 29 | $this->preparePlaceholderInFormElementTagAttributes($tagAttributes); |
|
30 | |||
31 | 29 | return Html::textInput($this->getInputName(), $value, $tagAttributes)->render(); |
|
32 | } |
||
34 |