Conditions | 3 |
Paths | 5 |
Total Lines | 15 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
47 | public function patch(array $config): array |
||
48 | { |
||
49 | try { |
||
50 | $target = &$this->dotGet($config, $this->position); |
||
51 | |||
52 | if ($this->key !== null) { |
||
53 | $target = array_merge([$this->key => $this->value], $target); |
||
54 | } else { |
||
55 | array_unshift($target, $this->value); |
||
56 | } |
||
57 | } catch (DotNotFoundException $e) { |
||
58 | throw new PatchException($e->getMessage(), $e->getCode(), $e); |
||
59 | } |
||
60 | |||
61 | return $config; |
||
62 | } |
||
64 |