r76191 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r76190‎ | r76191 | r76192 >
Date:15:10, 6 November 2010
Author:reedy
Status:resolved (Comments)
Tags:
Comment:
Add missing credits from r75975

Remove a few unused array keys in API foreach loops

Remove part of Html::Hidden comment
Modified paths:
  • /trunk/phase3/CREDITS (modified) (history)
  • /trunk/phase3/includes/Html.php (modified) (history)
  • /trunk/phase3/includes/api/ApiMain.php (modified) (history)
  • /trunk/phase3/includes/api/ApiPageSet.php (modified) (history)
  • /trunk/phase3/includes/api/ApiParse.php (modified) (history)

Diff [purge]

Index: trunk/phase3/CREDITS
@@ -91,6 +91,7 @@
9292 * Jidanni
9393 * Jimmy Xu
9494 * John Du Hart
 95+* Jonathan Wiltshire
9596 * Karun Dambietz
9697 * Kim Hyun-Joon
9798 * Lee Worden
Index: trunk/phase3/includes/Html.php
@@ -547,8 +547,7 @@
548548 }
549549
550550 /**
551 - * Convenience function to produce an input element with type=hidden, like
552 - * Xml::hidden.
 551+ * Convenience function to produce an input element with type=hidden
553552 *
554553 * @param $name string name attribute
555554 * @param $value string value attribute
Index: trunk/phase3/includes/api/ApiParse.php
@@ -345,7 +345,7 @@
346346 private function formatIWLinks( $iw ) {
347347 $result = array();
348348 foreach ( $iw as $prefix => $titles ) {
349 - foreach ( $titles as $title => $id ) {
 349+ foreach ( $titles as $title ) {
350350 $entry = array();
351351 $entry['prefix'] = $prefix;
352352
Index: trunk/phase3/includes/api/ApiMain.php
@@ -833,7 +833,7 @@
834834
835835 $astriks = str_repeat( '*** ', 10 );
836836 $msg .= "\n\n$astriks Modules $astriks\n\n";
837 - foreach ( $this->mModules as $moduleName => $unused ) {
 837+ foreach ( $this->mModules as $moduleName ) {
838838 $module = new $this->mModules[$moduleName] ( $this, $moduleName );
839839 $msg .= self::makeHelpMsgHeader( $module, 'action' );
840840 $msg2 = $module->makeHelpMsg();
@@ -852,7 +852,7 @@
853853 }
854854
855855 $msg .= "\n$astriks Formats $astriks\n\n";
856 - foreach ( $this->mFormats as $formatName => $unused ) {
 856+ foreach ( $this->mFormats as $formatName ) {
857857 $module = $this->createPrinterByName( $formatName );
858858 $msg .= self::makeHelpMsgHeader( $module, 'format' );
859859 $msg2 = $module->makeHelpMsg();
Index: trunk/phase3/includes/api/ApiPageSet.php
@@ -501,7 +501,7 @@
502502 if ( $processTitles ) {
503503 // The remaining titles in $remaining are non-existent pages
504504 foreach ( $remaining as $ns => $dbkeys ) {
505 - foreach ( $dbkeys as $dbkey => $unused ) {
 505+ foreach ( $dbkeys as $dbkey ) {
506506 $title = Title::makeTitle( $ns, $dbkey );
507507 $this->mAllPages[$ns][$dbkey] = $this->mFakePageId;
508508 $this->mMissingTitles[$this->mFakePageId] = $title;

Follow-up revisions

RevisionCommit summaryAuthorDate
r76196Fixup fail from r76191. Thanks Nikerabbitreedy16:11, 6 November 2010

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r75975Minor expansion of document. Per patch by Jonathan Wiltshire on bug 24132reedy01:59, 4 November 2010

Comments

#Comment by Nikerabbit (talk | contribs)   15:58, 6 November 2010

-foreach ( $dbkeys as $dbkey => $unused ) {

+foreach ( $dbkeys as $dbkey ) {

You're making more of the bugs of the kind I just fixed one. Your version is actually the same as

foreach ( $dbkeys as $unused ) {

Status & tagging log