From 252ab00a8e0674314be46d0d87f53c78dd4f295c Mon Sep 17 00:00:00 2001 From: jo Date: Sun, 4 Sep 2022 15:27:14 +0200 Subject: [PATCH] style(legacy): format config --- legacy/application/configs/conf.php | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/legacy/application/configs/conf.php b/legacy/application/configs/conf.php index d45449aa1..47de54993 100644 --- a/legacy/application/configs/conf.php +++ b/legacy/application/configs/conf.php @@ -113,7 +113,8 @@ class Config try { $values = $processor->processConfiguration($schema, [$dirty]); } catch (InvalidConfigurationException $error) { - echo "could not parse configuration: " . $error->getMessage(); + echo 'could not parse configuration: ' . $error->getMessage(); + exit; } @@ -128,10 +129,12 @@ class Config // Storage path if (!is_dir($values['storage']['path'])) { echo "the configured storage.path '{$values['storage']['path']}' does not exists!"; + exit; } if (!is_writable($values['storage']['path'])) { echo "the configured storage.path '{$values['storage']['path']}' is not writable!"; + exit; } @@ -161,13 +164,19 @@ class Config public static function get(...$args) { - if (is_null(self::$dot_values)) self::load(); + if (is_null(self::$dot_values)) { + self::load(); + } + return self::$dot_values->get(...$args); } public static function has(...$args) { - if (is_null(self::$dot_values)) self::load(); + if (is_null(self::$dot_values)) { + self::load(); + } + return self::$dot_values->has(...$args); }