MaxSem has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/67352


Change subject: Get rid of several pointless returns
......................................................................

Get rid of several pointless returns

Change-Id: I00ee0e3b16cef60d4bf96f62768f1d3125f8300f
---
M includes/MobileFrontend.body.php
M includes/skins/SkinMobileBase.php
2 files changed, 18 insertions(+), 23 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend 
refs/changes/52/67352/1

diff --git a/includes/MobileFrontend.body.php b/includes/MobileFrontend.body.php
index ffb0584..3496c90 100644
--- a/includes/MobileFrontend.body.php
+++ b/includes/MobileFrontend.body.php
@@ -25,7 +25,6 @@
 
        /**
         * @param $out OutputPage
-        * @return bool: Whether processing should be continued
         */
        protected function beforePageDisplay( $out ) {
                wfProfileIn( __METHOD__ );
@@ -36,7 +35,6 @@
                $this->sendHeaders();
 
                wfProfileOut( __METHOD__ );
-               return true;
        }
 
        public static function parseContentFormat( $format ) {
@@ -53,7 +51,6 @@
 
        /**
         * Disables caching if the request is coming from a trusted proxy
-        * @return bool
         */
        private function disableCaching() {
                wfProfileIn( __METHOD__ );
@@ -75,7 +72,6 @@
                }
 
                wfProfileOut( __METHOD__ );
-               return true;
        }
 
        private function sendHeaders() {
@@ -99,7 +95,6 @@
                $out->addVaryHeader( 'X-Subdomain' );
                $out->addVaryHeader( 'X-Images' );
                wfProfileOut( __METHOD__ );
-               return true;
        }
 
        /**
@@ -110,9 +105,7 @@
        public function DOMParse( OutputPage $out ) {
                wfProfileIn( __METHOD__ );
 
-               if ( !$this->beforePageDisplay( $out ) ) {
-                       return false;
-               }
+               $this->beforePageDisplay( $out );
                $html = $out->getHTML();
 
                wfProfileIn( __METHOD__ . '-formatter-init' );
diff --git a/includes/skins/SkinMobileBase.php 
b/includes/skins/SkinMobileBase.php
index 90d6123..8898b14 100644
--- a/includes/skins/SkinMobileBase.php
+++ b/includes/skins/SkinMobileBase.php
@@ -190,7 +190,9 @@
        public function outputPage( OutputPage $out = null ) {
                global $wgMFNoindexPages;
                wfProfileIn( __METHOD__ );
-               $out = $this->getOutput();
+               if ( !$out ) {
+                       $out = $this->getOutput();
+               }
                if ( $wgMFNoindexPages ) {
                        $out->setRobotPolicy( 'noindex,nofollow' );
                }
@@ -202,20 +204,20 @@
                        }
                }
                $html = $this->extMobileFrontend->DOMParse( $out );
-               if ( $html !== false ) {
-                       wfProfileIn( __METHOD__  . '-tpl' );
-                       $tpl = $this->prepareTemplate();
-                       $tpl->set( 'headelement', $out->headElement( $this ) );
-                       $tpl->set( 'bodytext', $html );
-                       // FIXME: Move to ZeroRatedMobileAccess extension
-                       $tpl->set( 'zeroRatedBanner', 
$this->extMobileFrontend->getZeroRatedBanner() );
-                       $notice = '';
-                       wfRunHooks( 'GetMobileNotice', array( $this, &$notice ) 
);
-                       $tpl->set( 'notice', $notice );
-                       $tpl->set( 'reporttime', wfReportTime() );
-                       $tpl->execute();
-                       wfProfileOut( __METHOD__  . '-tpl' );
-               }
+
+               wfProfileIn( __METHOD__  . '-tpl' );
+               $tpl = $this->prepareTemplate();
+               $tpl->set( 'headelement', $out->headElement( $this ) );
+               $tpl->set( 'bodytext', $html );
+               // FIXME: Move to ZeroRatedMobileAccess extension
+               $tpl->set( 'zeroRatedBanner', 
$this->extMobileFrontend->getZeroRatedBanner() );
+               $notice = '';
+               wfRunHooks( 'GetMobileNotice', array( $this, &$notice ) );
+               $tpl->set( 'notice', $notice );
+               $tpl->set( 'reporttime', wfReportTime() );
+               $tpl->execute();
+               wfProfileOut( __METHOD__  . '-tpl' );
+
                wfProfileOut( __METHOD__ );
        }
 

-- 
To view, visit https://gerrit.wikimedia.org/r/67352
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I00ee0e3b16cef60d4bf96f62768f1d3125f8300f
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: MaxSem <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to