| Conditions | 3 |
| Paths | 2 |
| Total Lines | 17 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 7 |
| CRAP Score | 3.0987 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 19 | 4 | final protected function generateInput(): string |
|
| 20 | { |
||
| 21 | 4 | $value = $this->getAttributeValue(); |
|
| 22 | |||
| 23 | 4 | if (!is_string($value) && $value !== null) { |
|
| 24 | throw new InvalidArgumentException( |
||
| 25 | (new ReflectionClass($this))->getShortName() . |
||
| 26 | ' widget must be a string or null value.' |
||
| 27 | ); |
||
| 28 | } |
||
| 29 | |||
| 30 | 4 | $tagAttributes = $this->getInputTagAttributes(); |
|
| 31 | |||
| 32 | /** @psalm-suppress MixedArgumentTypeCoercion */ |
||
| 33 | 4 | return Html::input($this->getInputType(), $this->getInputName(), $value) |
|
| 34 | 4 | ->attributes($tagAttributes) |
|
| 35 | 4 | ->render(); |
|
| 36 | } |
||
| 40 |