| Conditions | 5 |
| Paths | 7 |
| Total Lines | 20 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 46 | public function patch(array $config): array |
||
| 47 | { |
||
| 48 | try { |
||
| 49 | $target = &$this->dotGet($config, $this->position); |
||
| 50 | |||
| 51 | if ($this->key !== null) { |
||
| 52 | unset($target[$this->key]); |
||
| 53 | } else { |
||
| 54 | foreach ($target as $key => $value) { |
||
| 55 | if ($value === $this->value) { |
||
| 56 | unset($target[$key]); |
||
| 57 | break; |
||
| 58 | } |
||
| 59 | } |
||
| 60 | } |
||
| 61 | } catch (DotNotFoundException $e) { |
||
| 62 | // doing nothing when section not found |
||
| 63 | } |
||
| 64 | |||
| 65 | return $config; |
||
| 66 | } |
||
| 68 |