| Conditions | 4 |
| Paths | 2 |
| Total Lines | 13 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 8 |
| CRAP Score | 4 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 18 | 3 | public function execute(&$array, $value): array |
|
| 19 | { |
||
| 20 | 3 | $removedValues = []; |
|
| 21 | 3 | if (\is_array($array)) { |
|
| 22 | 3 | foreach ($array as $key => $val) { |
|
| 23 | 2 | if ($val === $value) { |
|
| 24 | 2 | $removedValues[$key] = $val; |
|
| 25 | 2 | unset($array[$key]); |
|
| 26 | } |
||
| 27 | } |
||
| 28 | } |
||
| 29 | |||
| 30 | 3 | return $removedValues; |
|
| 31 | } |
||
| 33 |