From 49bca1bf9e81158c6dcf2756327ba3f9acb6a4df Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim=20D=C3=BCsterhus?= Date: Wed, 1 Jun 2022 11:26:31 +0200 Subject: [PATCH] Remove useless use of `else` in ControllerMap::isDefaultController() MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit The “then” part always returns from the function, thus there is no need for an explicit `else` here. --- .../lib/system/request/ControllerMap.class.php | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/wcfsetup/install/files/lib/system/request/ControllerMap.class.php b/wcfsetup/install/files/lib/system/request/ControllerMap.class.php index 56bf21d2dd..36e7e681c0 100644 --- a/wcfsetup/install/files/lib/system/request/ControllerMap.class.php +++ b/wcfsetup/install/files/lib/system/request/ControllerMap.class.php @@ -311,17 +311,17 @@ class ControllerMap extends SingletonFactory && $matches['languageID'] != LanguageFactory::getInstance()->getDefaultLanguageID() ) { return false; - } else { - if ( - $matches['controller'] == $this->landingPages[$application]['controller'] - && isset($this->customUrls['lookup'][$application]['']) - && $this->customUrls['lookup'][$application][''] !== $controller - ) { - return false; - } + } - $controller = $matches['controller']; + if ( + $matches['controller'] == $this->landingPages[$application]['controller'] + && isset($this->customUrls['lookup'][$application]['']) + && $this->customUrls['lookup'][$application][''] !== $controller + ) { + return false; } + + $controller = $matches['controller']; } if (\strpos($controller, '__WCF_CMS__') !== false) { -- 2.20.1