From: Reedy Date: Thu, 20 Sep 2018 23:06:07 +0000 (+0100) Subject: Collapse some unnecessary else conditions X-Git-Tag: 1.34.0-rc.0~4034^2 X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=commitdiff_plain;h=4e8eed74233db1db69f178fb0f4f1f8d6416bd52 Collapse some unnecessary else conditions Change-Id: I9fe505f2f4ed4d10e13813d9f05127fd6571c874 --- diff --git a/includes/specialpage/SpecialPageFactory.php b/includes/specialpage/SpecialPageFactory.php index c6ffbe4d70..b9c2204e1b 100644 --- a/includes/specialpage/SpecialPageFactory.php +++ b/includes/specialpage/SpecialPageFactory.php @@ -419,16 +419,14 @@ class SpecialPageFactory { if ( $page instanceof SpecialPage ) { return $page; - } else { - // It's not a classname, nor a callback, nor a legacy constructor array, - // nor a special page object. Give up. - wfLogWarning( "Cannot instantiate special page $realName: bad spec!" ); - return null; } - } else { - return null; + // It's not a classname, nor a callback, nor a legacy constructor array, + // nor a special page object. Give up. + wfLogWarning( "Cannot instantiate special page $realName: bad spec!" ); } + + return null; } /** @@ -565,9 +563,9 @@ class SpecialPageFactory { $context->getOutput()->redirect( $url ); return $title; - } else { - $context->setTitle( $page->getPageTitle( $par ) ); } + + $context->setTitle( $page->getPageTitle( $par ) ); } elseif ( !$page->isIncludable() ) { return false; } @@ -714,8 +712,8 @@ class SpecialPageFactory { list( $name, $subpage ) = $this->resolveAlias( $alias ); if ( $name != null ) { return SpecialPage::getTitleFor( $name, $subpage ); - } else { - return null; } + + return null; } }