Skip to content

Commit dd74278

Browse files
committed
Improve value getting
1 parent eec6cef commit dd74278

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

src/Environment.php

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,11 +87,16 @@ private static function setString(string $key, string $default): void
8787

8888
private static function getRawValue(string $key): ?string
8989
{
90-
if (isset($_ENV[$key])) {
91-
return $_ENV[$key];
90+
$value = getenv($key, true);
91+
if ($value !== false) {
92+
return $value;
9293
}
9394

94-
$result = getenv($key);
95-
return $result === false ? null : $result;
95+
$value = getenv($key);
96+
if ($value !== false) {
97+
return $value;
98+
}
99+
100+
return $_ENV[$key] ?? null;
96101
}
97102
}

0 commit comments

Comments
 (0)