Skip to content

Commit

Permalink
Merge pull request #147 from hassankhan/fix-merge
Browse files Browse the repository at this point in the history
Fix merge
  • Loading branch information
DavidePastore committed Mar 26, 2022
2 parents a3f02c5 + 830e8b2 commit 68a97c5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/AbstractConfig.php
Expand Up @@ -146,6 +146,7 @@ public function has($key)
public function merge(ConfigInterface $config)
{
$this->data = array_replace_recursive($this->data, $config->all());
$this->cache = [];
return $this;
}

Expand Down
2 changes: 2 additions & 0 deletions tests/AbstractConfigTest.php
Expand Up @@ -290,6 +290,8 @@ public function testMerge()
]
);

// Trigger the cache
$this->config->get('host');
$this->config->merge($remote);

$this->assertEquals('127.0.0.1', $this->config['host']);
Expand Down

0 comments on commit 68a97c5

Please sign in to comment.