From 645133e2c6356c0c00392d2323e6d3eb36970f3d Mon Sep 17 00:00:00 2001 From: Paul Gilzow Date: Thu, 14 Sep 2023 11:48:28 -0500 Subject: [PATCH] returns empty string if envPrefix+SMTP_HOST is requested via ->getValue. Closes #17 --- src/Config.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/Config.php b/src/Config.php index 8fa32ea..130d4e6 100644 --- a/src/Config.php +++ b/src/Config.php @@ -508,6 +508,14 @@ public function hasRelationship(string $relationship) : bool protected function getValue(string $name) : ?string { $checkName = $this->envPrefix . strtoupper($name); + /* + * If enable_smtp is to `false` for the project, then the envPrefix.SMTP_HOST environmental variable is not + * included in the environment. Therefore, if the environmental variable isn't set, return an empty string, not + * a null + */ + if('SMTP_HOST' === $name) { + return $this->environmentVariables[$checkName] ?? ""; + } return $this->environmentVariables[$checkName] ?? null; }