Comments, braces, explicit member variables
authorSam Reed <reedy@users.mediawiki.org>
Wed, 16 Nov 2011 13:22:03 +0000 (13:22 +0000)
committerSam Reed <reedy@users.mediawiki.org>
Wed, 16 Nov 2011 13:22:03 +0000 (13:22 +0000)
Remove a couple of unused variables

includes/LogEventsList.php
includes/StubObject.php
includes/parser/Tidy.php
includes/specials/SpecialBlock.php
maintenance/pruneFileCache.php
maintenance/updateCollation.php
tests/parser/parserTest.inc

index f78da63..e73d0a6 100644 (file)
@@ -677,9 +677,10 @@ class LogEventsList {
                                 $logBody .
                                 $loglist->endLogEventsList();
                } else {
-                       if ( $showIfEmpty )
+                       if ( $showIfEmpty ) {
                                $s = Html::rawElement( 'div', array( 'class' => 'mw-warning-logempty' ),
                                        wfMsgExt( 'logempty', array( 'parseinline' ) ) );
+                       }
                }
                if( $pager->getNumRows() > $pager->mLimit ) { # Show "Full log" link
                        $urlParam = array();
@@ -706,7 +707,7 @@ class LogEventsList {
                        $s .= '</div>';
                }
 
-               if ( $wrap!='' ) { // Wrap message in html
+               if ( $wrap != '' ) { // Wrap message in html
                        $s = str_replace( '$1', $s, $wrap );
                }
 
@@ -992,7 +993,11 @@ class LogPager extends ReverseChronologicalPager {
                return $info;
        }
 
-       // Checks if $this->mConds has $field matched to a *single* value
+       /**
+        * Checks if $this->mConds has $field matched to a *single* value
+        * @param $field
+        * @return bool
+        */
        protected function hasEqualsClause( $field ) {
                return (
                        array_key_exists( $field, $this->mConds ) &&
index be865e1..141de57 100644 (file)
@@ -90,8 +90,9 @@ class StubObject {
        function _unstub( $name = '_unstub', $level = 2 ) {
                static $recursionLevel = 0;
 
-               if ( !($GLOBALS[$this->mGlobal] instanceof StubObject) )
+               if ( !($GLOBALS[$this->mGlobal] instanceof StubObject) ) {
                        return $GLOBALS[$this->mGlobal]; // already unstubbed.
+               }
 
                if ( get_class( $GLOBALS[$this->mGlobal] ) != $this->mClass ) {
                        $fname = __METHOD__.'-'.$this->mGlobal;
@@ -124,6 +125,9 @@ class StubContLang extends StubObject {
                return $this->_call( $name, $args );
        }
 
+       /**
+        * @return Language
+        */
        function _newObject() {
                global $wgLanguageCode;
                $obj = Language::factory( $wgLanguageCode );
@@ -148,6 +152,9 @@ class StubUserLang extends StubObject {
                return $this->_call( $name, $args );
        }
 
+       /**
+        * @return Language
+        */
        function _newObject() {
                return RequestContext::getMain()->getLang();
        }
index 3a6d3e9..2b98f01 100644 (file)
@@ -11,7 +11,7 @@
  * we may create a real postprocessor or something that will replace this.
  * It's called wrapper because for now it basically takes over MWTidy::tidy's task
  * of wrapping the text in a xhtml block
- * 
+ *
  * This re-uses some of the parser's UNIQ tricks, though some of it is private so it's
  * duplicated. Perhaps we should create an abstract marker hiding class.
  */
@@ -40,7 +40,7 @@ class MWTidyWrapper {
                $this->mUniqPrefix = "\x7fUNIQ" .
                        dechex( mt_rand( 0, 0x7fffffff ) ) . dechex( mt_rand( 0, 0x7fffffff ) );
                $this->mMarkerIndex = 0;
-       
+
                $wrappedtext = preg_replace_callback( ParserOutput::EDITSECTION_REGEX,
                        array( &$this, 'replaceEditSectionLinksCallback' ), $text );
 
@@ -126,7 +126,7 @@ class MWTidy {
         */
        public static function checkErrors( $text, &$errorStr = null ) {
                global $wgTidyInternal;
-               
+
                $retval = 0;
                if( $wgTidyInternal ) {
                        $errorStr = self::execInternalTidy( $text, true, $retval );
@@ -166,7 +166,7 @@ class MWTidy {
                                2 => array( 'file', wfGetNull(), 'a' )
                        );
                }
-               
+
                $readpipe = $stderr ? 2 : 1;
                $pipes = array();
 
@@ -217,7 +217,7 @@ class MWTidy {
                if ( !MWInit::classExists( 'tidy' ) ) {
                        wfWarn( "Unable to load internal tidy class." );
                        $retval = -1;
-                       
+
                        wfProfileOut( __METHOD__ );
                        return null;
                }
@@ -245,7 +245,7 @@ class MWTidy {
                                                "\n-->";
                                }
                        }
-       
+
                        wfProfileOut( __METHOD__ );
                        return $cleansource;
                }
index a53b1bb..f35709f 100644 (file)
@@ -297,7 +297,6 @@ class SpecialBlock extends FormSpecialPage {
 
        /**
         * Add header elements like block log entries, etc.
-        * @return void
         */
        protected function preText(){
                $text = $this->msg( 'blockiptext' )->parse();
index 11b6f99..f1a1cfd 100644 (file)
@@ -23,6 +23,9 @@
 require_once( dirname( __FILE__ ) . '/Maintenance.php' );
 
 class PruneFileCache extends Maintenance {
+
+       protected $minSurviveTimestamp;
+
        public function __construct() {
                parent::__construct();
                $this->mDescription = "Build file cache for content pages";
index 7e8a7ee..023409f 100644 (file)
@@ -43,7 +43,7 @@ using the page title and cl_sortkey_prefix.  If everything's collation is
 up-to-date, it will do nothing.
 TEXT;
 
-               $this->addOption( 'force', 'Run on all rows, even if the collation is ' . 
+               $this->addOption( 'force', 'Run on all rows, even if the collation is ' .
                        'supposed to be up-to-date.' );
                $this->addOption( 'previous-collation', 'Set the previous value of ' .
                        '$wgCategoryCollation here to speed up this script, especially if your ' .
@@ -111,7 +111,7 @@ TEXT;
                                        # This is an old-style row, so the sortkey needs to be
                                        # converted.
                                        if ( $row->cl_sortkey == $title->getText()
-                                       || $row->cl_sortkey == $title->getPrefixedText() ) {
+                                               || $row->cl_sortkey == $title->getPrefixedText() ) {
                                                $prefix = '';
                                        } else {
                                                # Custom sortkey, use it as a prefix
@@ -148,14 +148,14 @@ TEXT;
                        if ( $force && $row ) {
                                $encFrom = $dbw->addQuotes( $row->cl_from );
                                $encTo = $dbw->addQuotes( $row->cl_to );
-                               $batchConds = array( 
+                               $batchConds = array(
                                        "(cl_from = $encFrom AND cl_to > $encTo) " .
                                        " OR cl_from > $encFrom" );
                        }
 
                        $count += $res->numRows();
                        $this->output( "$count done.\n" );
-                       
+
                        if ( ++$batchCount % self::SYNC_INTERVAL == 0 ) {
                                $this->output( "Waiting for slaves ... " );
                                wfWaitForSlaves();
index af0d4bf..b9fd221 100644 (file)
@@ -766,7 +766,6 @@ class ParserTest {
                }
 
                $temporary = $this->useTemporaryTables || $dbType == 'postgres';
-               $tables = $this->listTables();
                $prefix = $dbType != 'oracle' ? 'parsertest_' : 'pt_';
 
                $this->dbClone = new CloneDatabase( $this->db, $this->listTables(), $prefix );