misc style issues
authorAntoine Musso <hashar@free.fr>
Wed, 30 Jan 2013 15:05:17 +0000 (16:05 +0100)
committerAntoine Musso <hashar@free.fr>
Wed, 30 Jan 2013 15:12:59 +0000 (16:12 +0100)
7zip.inc : $stream is really a private property.

userDupes.inc : still only used by MysqlUpdater, added a comment about
it and made the properties private.

sql.php : make sure we actually do nothing in some method. Previously we
just had an empty IF statement.

purgeList : a private method was named the same as the class, that is
how we declared constructor with PHP4. Renamed it to doPurge() to make
it clear that it is not the constructor.

Rests are whitespaces fixes.

Change-Id: I0b83f83ee3af37c770817ebfce3e804082c2fb41

maintenance/7zip.inc
maintenance/benchmarks/bench_strtr_str_replace.php
maintenance/purgeList.php
maintenance/sql.php
maintenance/userDupes.inc

index 6bb0666..590cad2 100644 (file)
@@ -32,7 +32,7 @@
  * @ingroup Maintenance
  */
 class SevenZipStream {
-       var $stream;
+       protected $stream;
 
        private function stripPath( $path ) {
                $prefix = 'mediawiki.compress.7z://';
index 9fa7c8e..10c5cd0 100644 (file)
 require_once( __DIR__ . '/Benchmarker.php' );
 
 function bfNormalizeTitleStrTr( $str ) {
-    return strtr( $str, '_', ' ' );
+       return strtr( $str, '_', ' ' );
 }
 
 function bfNormalizeTitleStrReplace( $str ) {
-    return str_replace( '_', ' ', $str );
+       return str_replace( '_', ' ', $str );
 }
 
 /**
index 58fe880..d6baf42 100644 (file)
@@ -41,13 +41,13 @@ class PurgeList extends Maintenance {
                if( $this->hasOption( 'namespace' ) ) {
                        $this->purgeNamespace();
                } else {
-                       $this->purgeList();
+                       $this->doPurge();
                }
                $this->output( "Done!\n" );
        }
 
        /** Purge URL coming from stdin */
-       private function purgeList() {
+       private function doPurge() {
                $stdin = $this->getStdin();
                $urls = array();
 
index 72e6775..9b0b576 100644 (file)
@@ -105,6 +105,7 @@ class MwSql extends Maintenance {
        public function sqlPrintResult( $res, $db ) {
                if ( !$res ) {
                        // Do nothing
+                       return;
                } elseif ( is_object( $res ) && $res->numRows() ) {
                        foreach ( $res as $row ) {
                                $this->output( print_r( $row, true ) );
index 31bae8e..be45a11 100644 (file)
 
 /**
  * Look for duplicate user table entries and optionally prune them.
+ *
+ * This is still used by our MysqlUpdater at:
+ * includes/installer/MysqlUpdater.php
+ *
  * @ingroup Maintenance
  */
 class UserDupes {
-       var $db;
-       var $reassigned;
-       var $trimmed;
-       var $failed;
+       private $db;
+       private $reassigned;
+       private $trimmed;
+       private $failed;
        private $outputCallback;
 
        function __construct( &$database, $outputCallback ) {