Merge "Improve return types in class MagicWordArray"
[lhc/web/wiklou.git] / includes / specialpage / RedirectSpecialPage.php
index 01a88f4..c28b89e 100644 (file)
@@ -35,23 +35,19 @@ abstract class RedirectSpecialPage extends UnlistedSpecialPage {
 
        /**
         * @param string|null $subpage
-        * @return Title|bool
         */
        public function execute( $subpage ) {
                $redirect = $this->getRedirect( $subpage );
-               $query = $this->getRedirectQuery();
-               // Redirect to a page title with possible query parameters
+               $query = $this->getRedirectQuery( $subpage );
+
                if ( $redirect instanceof Title ) {
+                       // Redirect to a page title with possible query parameters
                        $url = $redirect->getFullUrlForRedirect( $query );
                        $this->getOutput()->redirect( $url );
-
-                       return $redirect;
                } elseif ( $redirect === true ) {
                        // Redirect to index.php with query parameters
                        $url = wfAppendQuery( wfScript( 'index' ), $query );
                        $this->getOutput()->redirect( $url );
-
-                       return $redirect;
                } else {
                        $this->showNoRedirectPage();
                }
@@ -70,9 +66,10 @@ abstract class RedirectSpecialPage extends UnlistedSpecialPage {
         * Return part of the request string for a special redirect page
         * This allows passing, e.g. action=history to Special:Mypage, etc.
         *
+        * @param string|null $subpage
         * @return array|bool
         */
-       public function getRedirectQuery() {
+       public function getRedirectQuery( $subpage ) {
                $params = [];
                $request = $this->getRequest();