| Conditions | 3 |
| Paths | 2 |
| Total Lines | 14 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 7 |
| CRAP Score | 3.0175 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 31 | 1 | protected function generateInput(): string |
|
| 32 | { |
||
| 33 | 1 | $value = $this->getAttributeValue(); |
|
| 34 | |||
| 35 | 1 | if (!is_string($value) && $value !== null) { |
|
| 36 | throw new InvalidArgumentException('Telephone widget must be a string or null value.'); |
||
| 37 | } |
||
| 38 | |||
| 39 | 1 | $tagAttributes = $this->getInputTagAttributes(); |
|
| 40 | |||
| 41 | /** @psalm-suppress MixedArgumentTypeCoercion */ |
||
| 42 | 1 | return Html::input('tel', $this->getInputName(), $value) |
|
| 43 | 1 | ->attributes($tagAttributes) |
|
| 44 | 1 | ->render(); |
|
| 45 | } |
||
| 47 |