From 71d6a1b51ff5c8e6476fdb71260e8b957746f8f5 Mon Sep 17 00:00:00 2001 From: Dmytro Novash Date: Wed, 10 Jul 2024 14:58:58 +0300 Subject: [PATCH 1/2] fix var types --- src/main.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/main.php b/src/main.php index b12d0e7..a47d274 100644 --- a/src/main.php +++ b/src/main.php @@ -87,9 +87,11 @@ public function __construct($config=[]) { // load config from environment variables foreach (array_keys($this->config) as $key) { if (($value = getenv('IFM_' . strtoupper($key))) !== false) { - if (is_numeric($value)) - $value = intval($value); - $this->config[$key] = trim($value, implode(['"', "'"])); // remove quotes from env vars + if (is_numeric($value)) { + $this->config[$key] = intval($value); + } else { + $this->config[$key] = trim($value, implode(['"', "'"])); // remove quotes from env vars + } } } From 0fcd3b5ed8dec5eeeafb01c6f1c5c40f476859d6 Mon Sep 17 00:00:00 2001 From: Dmytro Novash Date: Wed, 10 Jul 2024 15:05:44 +0300 Subject: [PATCH 2/2] fix tabs --- src/main.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main.php b/src/main.php index a47d274..3cea790 100644 --- a/src/main.php +++ b/src/main.php @@ -87,11 +87,11 @@ public function __construct($config=[]) { // load config from environment variables foreach (array_keys($this->config) as $key) { if (($value = getenv('IFM_' . strtoupper($key))) !== false) { - if (is_numeric($value)) { - $this->config[$key] = intval($value); - } else { - $this->config[$key] = trim($value, implode(['"', "'"])); // remove quotes from env vars - } + if (is_numeric($value)) { + $this->config[$key] = intval($value); + } else { + $this->config[$key] = trim($value, implode(['"', "'"])); // remove quotes from env vars + } } }