Merge "Collapse some unnecessary else conditions"
[lhc/web/wiklou.git] / includes / specialpage / SpecialPageFactory.php
index e136ce0..013ceb2 100644 (file)
@@ -408,16 +408,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;
        }
 
        /**
@@ -554,9 +552,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;
                }
@@ -703,8 +701,8 @@ class SpecialPageFactory {
                list( $name, $subpage ) = $this->resolveAlias( $alias );
                if ( $name != null ) {
                        return SpecialPage::getTitleFor( $name, $subpage );
-               } else {
-                       return null;
                }
+
+               return null;
        }
 }