From 968d4823b5560a51018840ef72d6d08bc96e92da Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Mon, 7 Nov 2016 21:45:35 +0100 Subject: [PATCH] Fixing console web run --- Localization/Localization.php | 2 ++ Uri/Http.php | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Localization/Localization.php b/Localization/Localization.php index fdc8eb585..8c0c9bfaa 100644 --- a/Localization/Localization.php +++ b/Localization/Localization.php @@ -224,6 +224,8 @@ class Localization * * @return void * + * @throws InvalidEnumValue + * * @since 1.0.0 * @author Dennis Eichhorn */ diff --git a/Uri/Http.php b/Uri/Http.php index 8d0c9b6cf..7c9bf561e 100644 --- a/Uri/Http.php +++ b/Uri/Http.php @@ -155,7 +155,7 @@ class Http implements UriInterface $this->port = $url['port'] ?? null; $this->user = $url['user'] ?? null; $this->pass = $url['pass'] ?? null; - $this->path = $url['path'] ?? null; + $this->path = $url['path'] ?? ''; if (StringUtils::endsWith($this->path, '.php')) { $this->path = substr($this->path, 0, -4); @@ -183,7 +183,7 @@ class Http implements UriInterface public static function getCurrent() : string { /** @noinspection PhpUndefinedConstantInspection */ - return 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; + return 'http://' . ($_SERVER['HTTP_HOST'] ?? '') . ($_SERVER['REQUEST_URI'] ?? ''); } /**