| Conditions | 3 |
| Paths | 3 |
| Total Lines | 12 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 8 |
| CRAP Score | 3 |
| Changes | 0 | ||
| 1 | <?php |
||
| 32 | 8 | public function render($context = []) |
|
| 33 | { |
||
| 34 | 8 | if ($element = $this->getElement()) { |
|
| 35 | 8 | $class = $element->getAttribute('class', false); |
|
|
|
|||
| 36 | $class .= $class |
||
| 37 | 8 | ? ' form-control' |
|
| 38 | 8 | : 'form-control'; |
|
| 39 | 8 | $this->getElement()->setAttribute('class', $class); |
|
| 40 | 8 | } |
|
| 41 | |||
| 42 | 8 | return parent::render($context); |
|
| 43 | } |
||
| 44 | } |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: