From be12d8d38a3c84b2ec08da44208e4bb938551efa Mon Sep 17 00:00:00 2001 From: Anthony Axenov Date: Mon, 8 Jul 2024 00:06:03 +0800 Subject: [PATCH] Fixed execution without params --- src/Environment.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Environment.php b/src/Environment.php index 3fe8bf8..fae7b92 100644 --- a/src/Environment.php +++ b/src/Environment.php @@ -44,6 +44,9 @@ class Environment implements ArrayAccess */ public function readFromFile(string $filepath): static { + if (empty($filepath)) { + return $this; + } $content = file_get_contents(static::$filepath = $filepath); $content = json_decode($content, flags: JSON_THROW_ON_ERROR); //TODO try-catch $content || throw new JsonException("not a valid environment: $filepath");