From 18b18029eed8a923bc76e4d7bd89a44461619c25 Mon Sep 17 00:00:00 2001 From: Chris Kankiewicz Date: Mon, 19 Apr 2021 20:59:19 -0700 Subject: [PATCH] Applied static analysis fixes --- src/Config.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Config.php b/src/Config.php index 6dcbb4b..46ee696 100644 --- a/src/Config.php +++ b/src/Config.php @@ -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()) { @@ -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; @@ -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; @@ -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)); } /**