r73377 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r73376‎ | r73377 | r73378 >
Date:14:32, 20 September 2010
Author:reedy
Status:ok
Tags:
Comment:
Remove some unused variables

Add some braces
Modified paths:
  • /trunk/phase3/includes/ProfilerStub.php (modified) (history)
  • /trunk/phase3/includes/api/ApiProtect.php (modified) (history)
  • /trunk/phase3/includes/api/ApiQueryAllmessages.php (modified) (history)
  • /trunk/phase3/includes/api/ApiQueryUserInfo.php (modified) (history)
  • /trunk/phase3/includes/api/ApiUndelete.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialNewimages.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialTags.php (modified) (history)
  • /trunk/phase3/maintenance/convertLinks.php (modified) (history)
  • /trunk/phase3/maintenance/reassignEdits.php (modified) (history)
  • /trunk/phase3/maintenance/storage/storageTypeStats.php (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/storage/storageTypeStats.php
@@ -12,7 +12,6 @@
1313 exit( 1 );
1414 }
1515
16 - $rangeStart = 0;
1716 $binSize = intval( pow( 10, floor( log10( $endId ) ) - 3 ) );
1817 if ( $binSize < 100 ) {
1918 $binSize = 100;
Index: trunk/phase3/maintenance/reassignEdits.php
@@ -47,8 +47,9 @@
4848 $report = $this->hasOption( 'report' );
4949 $count = $this->doReassignEdits( $from, $to, !$this->hasOption( 'norc' ), $report );
5050 # If reporting, and there were items, advise the user to run without --report
51 - if ( $report )
 51+ if ( $report ) {
5252 $this->output( "Run the script again without --report to update.\n" );
 53+ }
5354 } else {
5455 $ton = $to->getName();
5556 $this->error( "User '{$ton}' not found." );
Index: trunk/phase3/maintenance/convertLinks.php
@@ -53,7 +53,7 @@
5454
5555 global $wgContLang;
5656
57 - $tuplesAdded = $numBadLinks = $curRowsRead = 0; # counters etc
 57+ $numBadLinks = $curRowsRead = 0; # counters etc
5858 $totalTuplesInserted = 0; # total tuples INSERTed into links_temp
5959
6060 $reportCurReadProgress = true; # whether or not to give progress reports while reading IDs from cur table
Index: trunk/phase3/includes/ProfilerStub.php
@@ -30,12 +30,15 @@
3131 */
3232 function wfProfileOut( $fn = '' ) {
3333 global $hackwhere, $wgDBname, $haveProctitle;
34 - if( !$haveProctitle )
 34+ if( !$haveProctitle ) {
3535 return;
36 - if( count( $hackwhere ) )
 36+ }
 37+ if( count( $hackwhere ) ) {
3738 array_pop( $hackwhere );
38 - if( count( $hackwhere ) )
 39+ }
 40+ if( count( $hackwhere ) ) {
3941 setproctitle( $hackwhere[count( $hackwhere )-1] . " [$wgDBname]" );
 42+ }
4043 }
4144
4245 /**
Index: trunk/phase3/includes/api/ApiProtect.php
@@ -42,8 +42,6 @@
4343 global $wgUser, $wgRestrictionLevels;
4444 $params = $this->extractRequestParams();
4545
46 - $titleObj = null;
47 -
4846 $titleObj = Title::newFromText( $params['title'] );
4947 if ( !$titleObj ) {
5048 $this->dieUsageMsg( array( 'invalidtitle', $params['title'] ) );
Index: trunk/phase3/includes/api/ApiQueryAllmessages.php
@@ -54,7 +54,6 @@
5555 $prop = array_flip( (array)$params['prop'] );
5656
5757 // Determine which messages should we print
58 - $messages_target = array();
5958 if ( in_array( '*', $params['messages'] ) ) {
6059 $message_names = array_keys( Language::getMessagesFor( 'en' ) );
6160 sort( $message_names );
Index: trunk/phase3/includes/api/ApiQueryUserInfo.php
@@ -43,13 +43,13 @@
4444 public function execute() {
4545 $params = $this->extractRequestParams();
4646 $result = $this->getResult();
47 - $r = array();
4847
4948 if ( !is_null( $params['prop'] ) ) {
5049 $this->prop = array_flip( $params['prop'] );
5150 } else {
5251 $this->prop = array();
5352 }
 53+
5454 $r = $this->getCurrentUserInfo();
5555 $result->addValue( 'query', $this->getModuleName(), $r );
5656 }
Index: trunk/phase3/includes/api/ApiUndelete.php
@@ -42,8 +42,6 @@
4343 global $wgUser;
4444 $params = $this->extractRequestParams();
4545
46 - $titleObj = null;
47 -
4846 if ( !$wgUser->isAllowed( 'undelete' ) ) {
4947 $this->dieUsageMsg( array( 'permdenied-undelete' ) );
5048 }
Index: trunk/phase3/includes/specials/SpecialTags.php
@@ -42,7 +42,6 @@
4343 $wgOut->wrapWikiMsg( "<div class='mw-tags-intro'>\n$1\n</div>", 'tags-intro' );
4444
4545 // Write the headers
46 - $html = '';
4746 $html = Xml::tags( 'tr', null, Xml::tags( 'th', null, wfMsgExt( 'tags-tag', 'parseinline' ) ) .
4847 Xml::tags( 'th', null, wfMsgExt( 'tags-display-header', 'parseinline' ) ) .
4948 Xml::tags( 'th', null, wfMsgExt( 'tags-description-header', 'parseinline' ) ) .
Index: trunk/phase3/includes/specials/SpecialNewimages.php
@@ -68,7 +68,6 @@
6969 } else {
7070 $ts = false;
7171 }
72 - $sql = '';
7372
7473 # If we were clever, we'd use this to cache.
7574 $latestTimestamp = wfTimestamp( TS_MW, $ts );
@@ -100,7 +99,7 @@
101100 $where[] = "img_timestamp >= '" . $dbr->timestamp( $from ) . "'";
102101 $invertSort = true;
103102 }
104 - $sql='SELECT img_size, img_name, img_user, img_user_text,'.
 103+ $sql = 'SELECT img_size, img_name, img_user, img_user_text,'.
105104 "img_description,img_timestamp FROM $image";
106105
107106 if( $hidebotsql ) {

Status & tagging log