@@ -46,15 +46,15 @@ |
||
| 46 | 46 | */ |
| 47 | 47 | public function patch(array $config): array |
| 48 | 48 | { |
| 49 | - try { |
|
| 49 | + try{ |
|
| 50 | 50 | $target = &$this->dotGet($config, $this->position); |
| 51 | 51 | |
| 52 | - if ($this->key !== null) { |
|
| 52 | + if ($this->key !== null){ |
|
| 53 | 53 | $target = array_merge([$this->key => $this->value], $target); |
| 54 | - } else { |
|
| 54 | + }else{ |
|
| 55 | 55 | array_unshift($target, $this->value); |
| 56 | 56 | } |
| 57 | - } catch (DotNotFoundException $e) { |
|
| 57 | + }catch (DotNotFoundException $e){ |
|
| 58 | 58 | throw new PatchException($e->getMessage(), $e->getCode(), $e); |
| 59 | 59 | } |
| 60 | 60 | |
@@ -46,15 +46,21 @@ |
||
| 46 | 46 | */ |
| 47 | 47 | public function patch(array $config): array |
| 48 | 48 | { |
| 49 | - try { |
|
| 49 | + try |
|
| 50 | + { |
|
| 50 | 51 | $target = &$this->dotGet($config, $this->position); |
| 51 | 52 | |
| 52 | - if ($this->key !== null) { |
|
| 53 | + if ($this->key !== null) |
|
| 54 | + { |
|
| 53 | 55 | $target = array_merge([$this->key => $this->value], $target); |
| 54 | - } else { |
|
| 56 | + } |
|
| 57 | + else |
|
| 58 | + { |
|
| 55 | 59 | array_unshift($target, $this->value); |
| 56 | 60 | } |
| 57 | - } catch (DotNotFoundException $e) { |
|
| 61 | + } |
|
| 62 | + catch (DotNotFoundException $e) |
|
| 63 | + { |
|
| 58 | 64 | throw new PatchException($e->getMessage(), $e->getCode(), $e); |
| 59 | 65 | } |
| 60 | 66 | |
@@ -30,8 +30,8 @@ |
||
| 30 | 30 | |
| 31 | 31 | protected function getFactory(string $directory = null, bool $strict = true): ConfigManager |
| 32 | 32 | { |
| 33 | - if (is_null($directory)) { |
|
| 34 | - $directory = __DIR__ . '/fixtures'; |
|
| 33 | + if (is_null($directory)){ |
|
| 34 | + $directory = __DIR__.'/fixtures'; |
|
| 35 | 35 | } |
| 36 | 36 | |
| 37 | 37 | return new ConfigManager(new DirectoryLoader($directory, $this->container), $strict); |
@@ -30,7 +30,8 @@ |
||
| 30 | 30 | |
| 31 | 31 | protected function getFactory(string $directory = null, bool $strict = true): ConfigManager |
| 32 | 32 | { |
| 33 | - if (is_null($directory)) { |
|
| 33 | + if (is_null($directory)) |
|
| 34 | + { |
|
| 34 | 35 | $directory = __DIR__ . '/fixtures'; |
| 35 | 36 | } |
| 36 | 37 | |