Fixed Fatal error: Uncaught TypeError: array_replace_recursive(): Argument #1 ($array) must be of type array, null given in /var/ncc/packages/net.nosial.configlib=1.0.2/src/ConfigLib/Configuration.php:331

This commit is contained in:
Netkas 2023-07-13 17:05:32 -04:00
parent 4cffe41bf0
commit 5afae885db
No known key found for this signature in database
GPG key ID: 5DAF58535614062B
3 changed files with 17 additions and 4 deletions

View file

@ -328,15 +328,23 @@
return;
}
$fs = new Filesystem();
// If the configuration file is a YAML file, import it instead
if(str_ends_with($this->path, '.yaml') || str_ends_with($this->path, '.yml'))
{
$this->import($this->path);
if(!$fs->exists($this->path))
{
throw new RuntimeException(sprintf('Unable to import configuration file "%s" from environment, file does not exist', $path));
}
$yaml = file_get_contents($this->path);
$this->configuration = Yaml::parse($yaml);
return;
}
$fs = new Filesystem();
if (!$fs->exists($this->path))
{
return;