diff --git a/src/Sys.php b/src/Sys.php index f15b7ea..d19f3f5 100644 --- a/src/Sys.php +++ b/src/Sys.php @@ -54,17 +54,17 @@ public static function isRoot(): bool /** * Returns a home directory of current user. * - * @return string + * @return string|null * * @SuppressWarnings(PHPMD.Superglobals) */ - public static function getHome(): string + public static function getHome() { if (Arr::key('HOMEDRIVE', $_SERVER)) { return $_SERVER['HOMEDRIVE'] . $_SERVER['HOMEPATH']; } - return $_SERVER['HOME']; + return $_SERVER['HOME'] ?? null; } /**