| Conditions | 2 |
| Paths | 2 |
| Total Lines | 12 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 9 |
| CRAP Score | 2 |
| Changes | 0 | ||
| 1 | <?php |
||
| 28 | 2 | public function render($context = []) |
|
| 29 | { |
||
| 30 | 2 | $element = clone $this->element; |
|
| 31 | |||
| 32 | 2 | $value = $this->element->getAttribute('value', false); |
|
|
|
|||
| 33 | 2 | if ($value !== false) { |
|
| 34 | 2 | $this->element->getAttributes()->remove('value'); |
|
| 35 | 2 | } |
|
| 36 | 2 | $html = parent::render($context); |
|
| 37 | 2 | $this->element = $element; |
|
| 38 | 2 | return $html; |
|
| 39 | } |
||
| 40 | } |
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: