From d19e7d5b257d93ecf3545a89d5fe18c1b3ef6b05 Mon Sep 17 00:00:00 2001 From: tracer Date: Sun, 23 Oct 2022 12:36:24 +0200 Subject: [PATCH] fixed a typo --- src/Service/Config.php | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/Service/Config.php b/src/Service/Config.php index d750d36..e7d4273 100644 --- a/src/Service/Config.php +++ b/src/Service/Config.php @@ -1,4 +1,11 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + * + */ namespace App\Service; @@ -11,23 +18,21 @@ class Config { private array $config; - /** - * @throws Exception - */ public function __construct() { + // Check for either config.json.local or config.json. $configFile = dirname(path: __DIR__, levels: 2) . "/config.json.local"; if (!file_exists(filename: $configFile)) { $configFile = dirname(path: __DIR__, levels: 2) . "/config.json"; } if (!file_exists(filename: $configFile)) { - throw new Exception(message: 'Missing config file'); + die('Missing config file'); } $configJSON = file_get_contents(filename: $configFile); if (json_decode(json: $configJSON) === null) { - throw new Exception(message: 'Config file is not valid JSON.'); + die('Config file is not valid JSON.'); } $this->config = json_decode(json: $configJSON, associative: true);