r96385 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r96384‎ | r96385 | r96386 >
Date:23:11, 6 September 2011
Author:preilly
Status:ok
Tags:
Comment:
remove unneeded node variable from getClassElement
Modified paths:
  • /trunk/extensions/MobileFrontend/MobileFrontend.php (modified) (history)

Diff [purge]

Index: trunk/extensions/MobileFrontend/MobileFrontend.php
@@ -65,7 +65,7 @@
6666 );
6767
6868 class ExtMobileFrontend {
69 - const VERSION = '0.5.58';
 69+ const VERSION = '0.5.59';
7070
7171 /**
7272 * @var DOMDocument
@@ -728,13 +728,12 @@
729729 return $itemToRemoveRecords;
730730 }
731731
732 - private function getClassElement($DOMElement, $Node, $className) {
 732+ private function getClassElement( $DOMElement, $className ) {
733733 $children = $DOMElement->childNodes;
734734 foreach ( $children as $child ) {
735735 if ( $child->hasAttributes() &&
736736 $child->getAttribute( 'class' ) == $className ) {
737 - $$Node = $child;
738 - return $$Node;
 737+ return $child;
739738 }
740739 }
741740 return $DOMElement;
@@ -759,10 +758,10 @@
760759 switch ( self::$code ) {
761760 case 'de':
762761 $featuredArticle = $this->mainPage->getElementById( 'hauptseite-artikel' );
763 - $featuredArticle = $this->getClassElement($featuredArticle, 'featuredArticle', 'inhalt' );
 762+ $featuredArticle = $this->getClassElement($featuredArticle, 'inhalt' );
764763
765764 $newsItems = $this->mainPage->getElementById( 'hauptseite-nachrichten' );
766 - $newsItems = $this->getClassElement($newsItems, 'newsItems', 'inhalt' );
 765+ $newsItems = $this->getClassElement($newsItems, 'inhalt' );
767766 break;
768767 case 'fr':
769768 $featuredArticle = $this->mainPage->getElementById( 'accueil-lumieresur' );
@@ -770,7 +769,7 @@
771770 break;
772771 case 'ku':
773772 $newsItems = $this->mainPage->getElementById( 'hauptseite-wikipedia' );
774 - $newsItems = $this->getClassElement($newsItems, 'newsItems', 'inhalt' );
 773+ $newsItems = $this->getClassElement($newsItems, 'inhalt' );
775774 break;
776775 case 'bh':
777776 $featuredArticle = $this->mainPage->getElementById( 'mp-featured_article' );

Status & tagging log