Total Complexity | 9 |
Total Lines | 44 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
15 | class RemoveKey extends AbstractOperation implements RemoveKeyInterface |
||
16 | { |
||
17 | /** |
||
18 | * @return mixed |
||
19 | */ |
||
20 | 8 | public function execute(&$array, $key, $default = null) |
|
29 | } |
||
30 | |||
31 | 8 | private function &getArrayFromWhichKeyMustBeRemoved(&$array, &$key): array |
|
46 | } |
||
47 | |||
48 | 5 | private function unsetKeyAndReturnItsValue(&$array, $key) |
|
49 | { |
||
50 | 5 | $removedKeyValue = $array[$key]; |
|
51 | 5 | unset($array[$key]); |
|
52 | |||
53 | 5 | return $removedKeyValue; |
|
54 | } |
||
55 | |||
56 | 8 | private function canRemoveKey($array, $key): bool |
|
59 | } |
||
60 | |||
62 |