From 5a7d9a0720db75f61ed3febf8c7f054762e745ab Mon Sep 17 00:00:00 2001 From: Juan Cristobal <65052633+juancristobalgd1@users.noreply.github.com> Date: Sun, 4 Aug 2024 18:24:33 +0200 Subject: [PATCH] Update Config.php --- src/Config.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/Config.php b/src/Config.php index 2fcb95c..a287bb4 100644 --- a/src/Config.php +++ b/src/Config.php @@ -67,9 +67,8 @@ public static function set(string $var, $value): void */ public function read(string $file, string $path = null, bool $force = false): array { - if ($force) { + if ($force) return self::$config[$file] = self::load($file, $path); - } return self::$config[$file] ??= self::load($file, $path); } @@ -80,9 +79,8 @@ public function read(string $file, string $path = null, bool $force = false): ar public static function load(string $name, string $path = null): array { $path = $path ?? self::DEFAULT_DIR; - if (is_file($fileConfig = $path . $name . '.php')) { + if (is_file($fileConfig = $path . $name . '.php')) return require $fileConfig; - } throw new \Exception(sprintf('Error when opening the configuration file [ %s ] ', $fileConfig)); }