Skin: Remove more use of QuickTemplate::setRef()
authorTimo Tijhof <krinklemail@gmail.com>
Wed, 23 Aug 2017 19:30:01 +0000 (20:30 +0100)
committerKrinkle <krinklemail@gmail.com>
Wed, 23 Aug 2017 19:48:12 +0000 (19:48 +0000)
Follows-up 2c01147c13be.

* language_links: The local array variable is only used once to
  obtain the value from Skin::getLanguages(), and then never passed
  elsewhere or otherwise potentially changed, so this reference
  doesn't seem useful.
  The getLanguages() method itself also creates a new array every
  time it is called, so the reference from there can't change either.

* Same for content_navigation and content_actions. These are never
  modified, and the method that returns the array creates a new one
  on each call.
  Follows-up r3014 (f4755755daed1f8).

* Same for bodytext.

Presumably these were only set as references to save memory.

Bug: T140664
Change-Id: I1224a7a89c1d7ad05c73132ff73299fd78ade7fb

includes/skins/SkinTemplate.php

index cbffe1e..180a6df 100644 (file)
@@ -462,11 +462,11 @@ class SkinTemplate extends Skin {
                $tpl->set( 'printfooter', $this->printSource() );
                // Wrap the bodyText with #mw-content-text element
                $out->mBodytext = $this->wrapHTML( $title, $out->mBodytext );
-               $tpl->setRef( 'bodytext', $out->mBodytext );
+               $tpl->set( 'bodytext', $out->mBodytext );
 
                $language_urls = $this->getLanguages();
                if ( count( $language_urls ) ) {
-                       $tpl->setRef( 'language_urls', $language_urls );
+                       $tpl->set( 'language_urls', $language_urls );
                } else {
                        $tpl->set( 'language_urls', false );
                }
@@ -475,8 +475,8 @@ class SkinTemplate extends Skin {
                $tpl->set( 'personal_urls', $this->buildPersonalUrls() );
                $content_navigation = $this->buildContentNavigationUrls();
                $content_actions = $this->buildContentActionUrls( $content_navigation );
-               $tpl->setRef( 'content_navigation', $content_navigation );
-               $tpl->setRef( 'content_actions', $content_actions );
+               $tpl->set( 'content_navigation', $content_navigation );
+               $tpl->set( 'content_actions', $content_actions );
 
                $tpl->set( 'sidebar', $this->buildSidebar() );
                $tpl->set( 'nav_urls', $this->buildNavUrls() );