| Conditions | 3 |
| Paths | 2 |
| Total Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 7 |
| CRAP Score | 3.0175 |
| Changes | 0 | ||
| 1 | <?php |
||
| 45 | 1 | public function uncheckValue($key): void |
|
| 46 | { |
||
| 47 | 1 | $value = $this->getValue(); |
|
| 48 | |||
| 49 | 1 | if (is_array($value) && in_array($key, $value, true)) { |
|
| 50 | 1 | $index = array_search($key, $value, true); |
|
| 51 | 1 | unset($value[$index]); |
|
| 52 | 1 | $this->setValue($value); |
|
| 53 | } else { |
||
| 54 | $this->setValue(null); |
||
| 55 | } |
||
| 56 | } |
||
| 57 | } |
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: