Remove useless $out parameter from SkinTemplate::prepareQuickTemplate()
authorAlexandre Emsenhuber <ialex.wiki@gmail.com>
Sun, 15 Dec 2013 14:53:20 +0000 (15:53 +0100)
committerAlexandre Emsenhuber <ialex.wiki@gmail.com>
Sun, 15 Dec 2013 14:53:20 +0000 (15:53 +0100)
Fix for I0a9a7f10ea (f5a0c23); use $this->getOutput() instead.

Passing different OutputPage object to Skin methods than the one set in
the context is deprecated, so there is no point having that parameter.

The method's signature is also misleading, since it allows null to be
passed, but if that value would be passed to it, the code would
crash since a such case is not handled in the method.

The $out parameter passed to the method from outputPage() is left since
it is required by the MobileFrontend extension. A similar commit will
be done in the extension, and the parameter's removal will happen once
this condition is lifted.

Change-Id: I4fac5b14afeab25f6f79f889c7ce56874827717d

includes/SkinTemplate.php

index 7da3de9..3ad2f8e 100644 (file)
@@ -271,10 +271,9 @@ class SkinTemplate extends Skin {
         * initialize various variables and generate the template
         *
         * @since 1.23
-        * @param $out OutputPage
         * @return QuickTemplate the template to be executed by outputPage
         */
-       protected function prepareQuickTemplate( OutputPage $out = null ) {
+       protected function prepareQuickTemplate() {
                global $wgContLang, $wgScript, $wgStylePath,
                        $wgMimeType, $wgJsMimeType, $wgXhtmlNamespaces, $wgHtml5Version,
                        $wgDisableCounters, $wgSitename, $wgLogo, $wgMaxCredits,
@@ -285,6 +284,7 @@ class SkinTemplate extends Skin {
 
                $title = $this->getTitle();
                $request = $this->getRequest();
+               $out = $this->getOutput();
                $tpl = $this->setupTemplateForOutput();
 
                wfProfileIn( __METHOD__ . '-stuff-head' );