r75760 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r75759‎ | r75760 | r75761 >
Date:23:19, 31 October 2010
Author:reedy
Status:ok
Tags:
Comment:
Remove a few more unused variables

Add a couple of braces to unobvious if
Modified paths:
  • /trunk/phase3/includes/ConfEditor.php (modified) (history)
  • /trunk/phase3/includes/GlobalFunctions.php (modified) (history)
  • /trunk/phase3/includes/LogEventsList.php (modified) (history)
  • /trunk/phase3/includes/MessageCache.php (modified) (history)
  • /trunk/phase3/includes/Skin.php (modified) (history)
  • /trunk/phase3/includes/User.php (modified) (history)
  • /trunk/phase3/includes/UserMailer.php (modified) (history)
  • /trunk/phase3/includes/db/DatabaseIbm_db2.php (modified) (history)
  • /trunk/phase3/includes/installer/Installer.php (modified) (history)
  • /trunk/phase3/maintenance/tests/parser/parserTest.inc (modified) (history)
  • /trunk/phase3/skins/Vector.php (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/tests/parser/parserTest.inc
@@ -515,7 +515,6 @@
516516
517517 private function parseOptions( $instring ) {
518518 $opts = array();
519 - $lines = explode( "\n", $instring );
520519 // foo
521520 // foo=bar
522521 // foo="bar baz"
@@ -554,7 +553,7 @@
555554
556555 if ( preg_match_all( $regex, $instring, $matches, PREG_SET_ORDER ) ) {
557556 foreach ( $matches as $bits ) {
558 - $match = array_shift( $bits );
 557+ array_shift( $bits );
559558 $key = strtolower( array_shift( $bits ) );
560559 if ( count( $bits ) == 0 ) {
561560 $opts[$key] = true;
Index: trunk/phase3/skins/Vector.php
@@ -680,7 +680,7 @@
681681 <div id="p-namespaces" class="vectorTabs<?php if ( count( $this->data['namespace_urls'] ) == 0 ) echo ' emptyPortlet'; ?>">
682682 <h5><?php $this->msg('namespaces') ?></h5>
683683 <ul<?php $this->html('userlangattributes') ?>>
684 - <?php foreach ($this->data['namespace_urls'] as $key => $link ): ?>
 684+ <?php foreach ($this->data['namespace_urls'] as $link ): ?>
685685 <li <?php echo $link['attributes'] ?>><span><a href="<?php echo htmlspecialchars( $link['href'] ) ?>" <?php echo $link['key'] ?>><?php echo htmlspecialchars( $link['text'] ) ?></a></span></li>
686686 <?php endforeach; ?>
687687 </ul>
@@ -692,7 +692,7 @@
693693 <div id="p-variants" class="vectorMenu<?php if ( count( $this->data['variant_urls'] ) == 0 ) echo ' emptyPortlet'; ?>">
694694 <?php if ( $wgVectorShowVariantName ): ?>
695695 <h4>
696 - <?php foreach ( $this->data['variant_urls'] as $key => $link ): ?>
 696+ <?php foreach ( $this->data['variant_urls'] as $link ): ?>
697697 <?php if ( stripos( $link['attributes'], 'selected' ) !== false ): ?>
698698 <?php echo htmlspecialchars( $link['text'] ) ?>
699699 <?php endif; ?>
@@ -702,7 +702,7 @@
703703 <h5><span><?php $this->msg('variants') ?></span><a href="#"></a></h5>
704704 <div class="menu">
705705 <ul<?php $this->html('userlangattributes') ?>>
706 - <?php foreach ( $this->data['variant_urls'] as $key => $link ): ?>
 706+ <?php foreach ( $this->data['variant_urls'] as $link ): ?>
707707 <li<?php echo $link['attributes'] ?>><a href="<?php echo htmlspecialchars( $link['href'] ) ?>" <?php echo $link['key'] ?>><?php echo htmlspecialchars( $link['text'] ) ?></a></li>
708708 <?php endforeach; ?>
709709 </ul>
Index: trunk/phase3/includes/User.php
@@ -693,7 +693,6 @@
694694 }
695695
696696 # Reject various classes of invalid names
697 - $name = $t->getText();
698697 global $wgAuth;
699698 $name = $wgAuth->getCanonicalName( $t->getText() );
700699
Index: trunk/phase3/includes/GlobalFunctions.php
@@ -425,13 +425,11 @@
426426 # Needs the sockets extension
427427 if ( preg_match( '!^(tcp|udp):(?://)?\[([0-9a-fA-F:]+)\]:(\d+)(?:/(.*))?$!', $file, $m ) ) {
428428 // IPv6 bracketed host
429 - $protocol = $m[1];
430429 $host = $m[2];
431430 $port = intval( $m[3] );
432431 $prefix = isset( $m[4] ) ? $m[4] : false;
433432 $domain = AF_INET6;
434433 } elseif ( preg_match( '!^(tcp|udp):(?://)?([a-zA-Z0-9.-]+):(\d+)(?:/(.*))?$!', $file, $m ) ) {
435 - $protocol = $m[1];
436434 $host = $m[2];
437435 if ( !IP::isIPv4( $host ) ) {
438436 $host = gethostbyname( $host );
Index: trunk/phase3/includes/MessageCache.php
@@ -634,7 +634,6 @@
635635 */
636636 function getMsgFromNamespace( $title, $code ) {
637637 global $wgAdaptiveMessageCache;
638 - $big = false;
639638
640639 $this->load( $code );
641640 if ( isset( $this->mCache[$code][$title] ) ) {
Index: trunk/phase3/includes/db/DatabaseIbm_db2.php
@@ -607,7 +607,6 @@
608608 } else {
609609 print '<li>Foreign keys done</li>';
610610 }
611 - $res = null;
612611
613612 // TODO: populate interwiki links
614613
Index: trunk/phase3/includes/UserMailer.php
@@ -471,13 +471,14 @@
472472 $keys['$CHANGEDORCREATED'] = wfMsgForContent( 'created' );
473473 }
474474
475 - if ($wgEnotifImpersonal && $this->oldid)
 475+ if ($wgEnotifImpersonal && $this->oldid) {
476476 /*
477477 * For impersonal mail, show a diff link to the last
478478 * revision.
479479 */
480480 $keys['$NEWPAGE'] = wfMsgForContent('enotif_lastdiff',
481481 $this->title->getFullURL("oldid={$this->oldid}&diff=next"));
 482+ }
482483
483484 $body = strtr( $body, $keys );
484485 $pagetitle = $this->title->getPrefixedText();
Index: trunk/phase3/includes/LogEventsList.php
@@ -460,7 +460,6 @@
461461 if( count($paramArray) >= 1 ) {
462462 $revdel = SpecialPage::getTitleFor( 'Revisiondelete' );
463463 // $paramArray[1] is a CSV of the IDs
464 - $Ids = explode( ',', $paramArray[0] );
465464 $query = $paramArray[0];
466465 // Link to each hidden object ID, $paramArray[1] is the url param
467466 $revert = '(' . $this->skin->link(
Index: trunk/phase3/includes/installer/Installer.php
@@ -683,7 +683,7 @@
684684 }
685685
686686 # Get a list of available locales.
687 - $lines = $ret = false;
 687+ $ret = false;
688688 $lines = wfShellExec( '/usr/bin/locale -a', $ret );
689689
690690 if ( $ret ) {
Index: trunk/phase3/includes/ConfEditor.php
@@ -510,7 +510,6 @@
511511 $indent = false;
512512 }
513513 if ( $indent !== false && $arrowPos !== false ) {
514 - $textToInsert = "$indent$key ";
515514 $arrowIndentLength = $arrowPos - $pos - $indentLength - strlen( $key );
516515 if ( $arrowIndentLength > 0 ) {
517516 $arrowIndent = str_repeat( ' ', $arrowIndentLength );
Index: trunk/phase3/includes/Skin.php
@@ -531,17 +531,11 @@
532532 */
533533 function setupUserCss( OutputPage $out ) {
534534 global $wgRequest;
535 - global $wgUseSiteCss, $wgAllowUserCss, $wgAllowUserCssPrefs, $wgSquidMaxage;
 535+ global $wgUseSiteCss, $wgAllowUserCss, $wgAllowUserCssPrefs;
536536
537537 wfProfileIn( __METHOD__ );
538538
539539 $this->setupSkinUserCss( $out );
540 -
541 - $siteargs = array(
542 - 'action' => 'raw',
543 - 'maxage' => $wgSquidMaxage,
544 - );
545 -
546540 // Add any extension CSS
547541 foreach ( $out->getExtStyle() as $url ) {
548542 $out->addStyle( $url );

Status & tagging log