Remove some unused variables
authorSam Reed <reedy@users.mediawiki.org>
Mon, 20 Sep 2010 14:32:38 +0000 (14:32 +0000)
committerSam Reed <reedy@users.mediawiki.org>
Mon, 20 Sep 2010 14:32:38 +0000 (14:32 +0000)
Add some braces

includes/ProfilerStub.php
includes/api/ApiProtect.php
includes/api/ApiQueryAllmessages.php
includes/api/ApiQueryUserInfo.php
includes/api/ApiUndelete.php
includes/specials/SpecialNewimages.php
includes/specials/SpecialTags.php
maintenance/convertLinks.php
maintenance/reassignEdits.php
maintenance/storage/storageTypeStats.php

index 575fa7e..e624e6f 100644 (file)
@@ -30,12 +30,15 @@ function wfProfileIn( $fn = '' ) {
  */
 function wfProfileOut( $fn = '' ) {
        global $hackwhere, $wgDBname, $haveProctitle;
-       if( !$haveProctitle )
+       if( !$haveProctitle ) {
                return;
-       if( count( $hackwhere ) )
+       }
+       if( count( $hackwhere ) ) {
                array_pop( $hackwhere );
-       if( count( $hackwhere ) )
+       }
+       if( count( $hackwhere ) ) {
                setproctitle( $hackwhere[count( $hackwhere )-1] . " [$wgDBname]" );
+       }
 }
 
 /**
index 1841db6..7617ae0 100644 (file)
@@ -42,8 +42,6 @@ class ApiProtect extends ApiBase {
                global $wgUser, $wgRestrictionLevels;
                $params = $this->extractRequestParams();
 
-               $titleObj = null;
-
                $titleObj = Title::newFromText( $params['title'] );
                if ( !$titleObj ) {
                        $this->dieUsageMsg( array( 'invalidtitle', $params['title'] ) );
index 33f3c1c..9159685 100644 (file)
@@ -54,7 +54,6 @@ class ApiQueryAllmessages extends ApiQueryBase {
                $prop = array_flip( (array)$params['prop'] );
 
                // Determine which messages should we print
-               $messages_target = array();
                if ( in_array( '*', $params['messages'] ) ) {
                        $message_names = array_keys( Language::getMessagesFor( 'en' ) );
                        sort( $message_names );
index 3eb7e7e..a6b2713 100644 (file)
@@ -43,13 +43,13 @@ class ApiQueryUserInfo extends ApiQueryBase {
        public function execute() {
                $params = $this->extractRequestParams();
                $result = $this->getResult();
-               $r = array();
 
                if ( !is_null( $params['prop'] ) ) {
                        $this->prop = array_flip( $params['prop'] );
                } else {
                        $this->prop = array();
                }
+
                $r = $this->getCurrentUserInfo();
                $result->addValue( 'query', $this->getModuleName(), $r );
        }
index 83c3fbe..98c06d0 100644 (file)
@@ -42,8 +42,6 @@ class ApiUndelete extends ApiBase {
                global $wgUser;
                $params = $this->extractRequestParams();
 
-               $titleObj = null;
-
                if ( !$wgUser->isAllowed( 'undelete' ) ) {
                        $this->dieUsageMsg( array( 'permdenied-undelete' ) );
                }
index 898f2e2..53a92fc 100644 (file)
@@ -68,7 +68,6 @@ function wfSpecialNewimages( $par, $specialPage ) {
        } else {
                $ts = false;
        }
-       $sql = '';
 
        # If we were clever, we'd use this to cache.
        $latestTimestamp = wfTimestamp( TS_MW, $ts );
@@ -100,7 +99,7 @@ function wfSpecialNewimages( $par, $specialPage ) {
                $where[] = "img_timestamp >= '" . $dbr->timestamp( $from ) . "'";
                $invertSort = true;
        }
-       $sql='SELECT img_size, img_name, img_user, img_user_text,'.
+       $sql = 'SELECT img_size, img_name, img_user, img_user_text,'.
             "img_description,img_timestamp FROM $image";
 
        if( $hidebotsql ) {
index eee1664..b0368c7 100644 (file)
@@ -42,7 +42,6 @@ class SpecialTags extends SpecialPage {
                $wgOut->wrapWikiMsg( "<div class='mw-tags-intro'>\n$1\n</div>", 'tags-intro' );
 
                // Write the headers
-               $html = '';
                $html = Xml::tags( 'tr', null, Xml::tags( 'th', null, wfMsgExt( 'tags-tag', 'parseinline' ) ) .
                                Xml::tags( 'th', null, wfMsgExt( 'tags-display-header', 'parseinline' ) ) .
                                Xml::tags( 'th', null, wfMsgExt( 'tags-description-header', 'parseinline' ) ) .
index c2d3bd8..1c2bd56 100644 (file)
@@ -53,7 +53,7 @@ This gives a huge speed improvement for very large links tables which are MyISAM
 
                global $wgContLang;
        
-               $tuplesAdded = $numBadLinks = $curRowsRead = 0; # counters etc
+               $numBadLinks = $curRowsRead = 0; # counters etc
                $totalTuplesInserted = 0; # total tuples INSERTed into links_temp
 
                $reportCurReadProgress = true; # whether or not to give progress reports while reading IDs from cur table
index 0613c75..e59c654 100644 (file)
@@ -47,8 +47,9 @@ class ReassignEdits extends Maintenance {
                                $report = $this->hasOption( 'report' );
                                $count = $this->doReassignEdits( $from, $to, !$this->hasOption( 'norc' ), $report );
                                # If reporting, and there were items, advise the user to run without --report   
-                               if ( $report )
+                               if ( $report ) {
                                        $this->output( "Run the script again without --report to update.\n" );
+                               }
                        } else {
                                $ton = $to->getName();
                                $this->error( "User '{$ton}' not found." );
index 337a2bb..5608d15 100644 (file)
@@ -12,7 +12,6 @@ class StorageTypeStats extends Maintenance {
                        exit( 1 );
                }
 
-               $rangeStart = 0;
                $binSize = intval( pow( 10, floor( log10( $endId ) ) - 3 ) );
                if ( $binSize < 100 ) {
                        $binSize = 100;