From 712bafdf9697df39360d6788613932ad77d3bd72 Mon Sep 17 00:00:00 2001 From: Wendell Adriel Date: Wed, 7 Jun 2023 19:30:15 +0100 Subject: [PATCH] Fix issue when loading config files --- src/helpers.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/helpers.php b/src/helpers.php index e5b97a5..790daf9 100644 --- a/src/helpers.php +++ b/src/helpers.php @@ -10,14 +10,14 @@ function load_config(array $defaultConfig): array { $config = []; - foreach ((array) glob(__DIR__.'/../config/*.php') as $configFile) { + foreach ((array) glob(__DIR__.'/../../../../config/*.php') as $configFile) { $configData = include $configFile; if (is_array($configData)) { - $config = array_merge($config, $configData); + $config = [...$config, ...$configData]; } } - return array_merge($defaultConfig, $config); + return [...$defaultConfig, ...$config]; } function envconfig(string $key, ?string $default = null): ?string