Skip to content

Commit

Permalink
uppdate file src/BaseConfig.php
Browse files Browse the repository at this point in the history
  • Loading branch information
juancristobalgd1 authored Dec 26, 2023
1 parent e0592f6 commit 0ff9246
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/BaseConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,11 @@ public static function make()
* @param bool $merge Whether to merge the loaded configuration.
* @return self Instance of the class.
*/
public function load(string|array $file, bool $merge = true): self
public function load(string|array $file, bool $merge = true, ?string $pathConfig = null): self
{
is_string($file)
? $this->openFileConfig($file, $merge)
: $this->recursiveLoadFiles($file, $merge);
? $this->openFileConfig($file, $merge, $pathConfig)
: $this->recursiveLoadFiles($file, $merge, $pathConfig);

return self::$instance;
}
Expand Down Expand Up @@ -130,11 +130,11 @@ private function getData(string $file, string $ext)
* @return array
* @throws RuntimeException
*/
private function recursiveLoadFiles(array $files, bool $merge = true): array
private function recursiveLoadFiles(array $files, bool $merge = true, ?string $pathConfig = null): array
{
$config = [];
foreach ($files as $file) {
$data = $this->openFileConfig($file, $merge);
$data = $this->openFileConfig($file, $merge, $pathConfig);
$config = array_merge($config, $data);
}

Expand Down Expand Up @@ -228,7 +228,6 @@ public function clearCache()
$this->cache = [];
}


/**
* Magic method to retrieve configuration values.
*
Expand Down

0 comments on commit 0ff9246

Please sign in to comment.