Skip to content

Commit

Permalink
Applied static analysis fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
PHLAK committed Apr 20, 2021
1 parent 98d9cd8 commit 18b1802
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public function __construct($context = null, string $prefix = null)
*/
public static function fromDirectory(string $path): ConfigInterface
{
$config = new static();
$config = new self();

foreach (new DirectoryIterator($path) as $file) {
if ($file->isFile()) {
Expand Down Expand Up @@ -223,9 +223,9 @@ public function load(string $path, string $prefix = null, bool $override = true)
$newConfig = $prefix ? [$prefix => $loader->getArray()] : $loader->getArray();

if ($override) {
$this->config = (array) array_replace_recursive($this->config, $newConfig);
$this->config = array_replace_recursive($this->config, $newConfig);
} else {
$this->config = (array) array_replace_recursive($newConfig, $this->config);
$this->config = array_replace_recursive($newConfig, $this->config);
}

return $this;
Expand All @@ -243,9 +243,9 @@ public function load(string $path, string $prefix = null, bool $override = true)
public function merge(ConfigInterface $config, bool $override = true): ConfigInterface
{
if ($override) {
$this->config = (array) array_replace_recursive($this->config, $config->toArray());
$this->config = array_replace_recursive($this->config, $config->toArray());
} else {
$this->config = (array) array_replace_recursive($config->toArray(), $this->config);
$this->config = array_replace_recursive($config->toArray(), $this->config);
}

return $this;
Expand All @@ -260,7 +260,7 @@ public function merge(ConfigInterface $config, bool $override = true): ConfigInt
*/
public function split(string $key): ConfigInterface
{
return new static($this->get($key));
return new self($this->get($key));
}

/**
Expand Down

0 comments on commit 18b1802

Please sign in to comment.