style: fix up commas in function arguments
authorAntoine Musso <hashar@free.fr>
Wed, 30 Jan 2013 14:03:58 +0000 (15:03 +0100)
committerAntoine Musso <hashar@free.fr>
Wed, 6 Feb 2013 18:30:39 +0000 (19:30 +0100)
Fix up spaces in our function calls, we do not want spaces before a
comma and try to avoid multiple commas whenever possible.

Errors:

* No space found after comma in function call
* Space found before comma in function call

Change-Id: I51aec02016f742422fa60b92ad35ba3f0ef59ba3

17 files changed:
img_auth.php
includes/Defines.php
includes/IP.php
includes/MimeMagic.php
includes/normal/UtfNormal.php
languages/Language.php
maintenance/Maintenance.php
maintenance/backupPrefetch.inc
maintenance/changePassword.php
maintenance/lag.php
maintenance/language/languages.inc
maintenance/mwdocgen.php
maintenance/purgeList.php
maintenance/refreshImageMetadata.php
maintenance/showStats.php
opensearch_desc.php
profileinfo.php

index b04974b..2f7fb39 100644 (file)
@@ -106,7 +106,7 @@ function wfImageAuthMain() {
 
        // Check to see if the file exists
        if ( !$repo->fileExists( $filename ) ) {
-               wfForbidden( 'img-auth-accessdenied','img-auth-nofile', $filename );
+               wfForbidden( 'img-auth-accessdenied', 'img-auth-nofile', $filename );
                return;
        }
 
index 882f318..46b0947 100644 (file)
@@ -227,7 +227,7 @@ define( 'MW_SUPPORTS_RESOURCE_MODULES', 1 );
 define( 'OT_HTML', 1 );
 define( 'OT_WIKI', 2 );
 define( 'OT_PREPROCESS', 3 );
-define( 'OT_MSG' , 3 );  // b/c alias for OT_PREPROCESS
+define( 'OT_MSG', 3 );  // b/c alias for OT_PREPROCESS
 define( 'OT_PLAIN', 4 );
 /**@}*/
 
index 1b40f4b..5c50c22 100644 (file)
@@ -714,7 +714,9 @@ class IP {
         * @return String: valid dotted quad IPv4 address or null
         */
        public static function canonicalize( $addr ) {
-               $addr = preg_replace( '/\%.*/','', $addr ); // remove zone info (bug 35738)
+               // remove zone info (bug 35738)
+               $addr = preg_replace( '/\%.*/', '', $addr );
+
                if ( self::isValid( $addr ) ) {
                        return $addr;
                }
index 108ba1d..5b88480 100644 (file)
@@ -39,7 +39,7 @@
  * appending MM_WELL_KNOWN_MIME_TYPES behind $wgMimeTypeFile, but who knows
  * what will break? In practice this probably isn't a problem anyway -- Bryan)
  */
-define('MM_WELL_KNOWN_MIME_TYPES',<<<END_STRING
+define('MM_WELL_KNOWN_MIME_TYPES', <<<END_STRING
 application/ogg ogx ogg ogm ogv oga spx
 application/pdf pdf
 application/vnd.oasis.opendocument.chart odc
index 64d9618..f5b698a 100644 (file)
@@ -627,8 +627,8 @@ class UtfNormal {
                $lastHangul = 0;
                $startChar = '';
                $combining = '';
-               $x1 = ord(substr(UTF8_HANGUL_VBASE,0,1));
-               $x2 = ord(substr(UTF8_HANGUL_TEND,0,1));
+               $x1 = ord(substr(UTF8_HANGUL_VBASE, 0, 1));
+               $x2 = ord(substr(UTF8_HANGUL_TEND, 0, 1));
                for( $i = 0; $i < $len; $i++ ) {
                        $c = $string[$i];
                        $n = ord( $c );
index 5538ac8..ffb3268 100644 (file)
@@ -3067,7 +3067,7 @@ class Language {
                                if ( $start < 0 ) {
                                        $start = 0;
                                }
-                               $groupedNumber = substr( $number , $start, $end -$start ) . $groupedNumber ;
+                               $groupedNumber = substr( $number, $start, $end -$start ) . $groupedNumber ;
                                $end = $start;
                                if ( $numMatches > 1 ) {
                                        // use the last pattern for the rest of the number
index 2a8b8e5..b2bbf9b 100644 (file)
@@ -920,7 +920,7 @@ abstract class Maintenance {
                if ( !is_readable( $settingsFile ) ) {
                        $this->error( "A copy of your installation's LocalSettings.php\n" .
                                                "must exist and be readable in the source directory.\n" .
-                                               "Use --conf to specify it." , true );
+                                               "Use --conf to specify it.", true );
                }
                $wgCommandLineMode = true;
                return $settingsFile;
index 0e12a1c..cc0a7e1 100644 (file)
@@ -48,9 +48,9 @@ class BaseDump {
        var $infiles = null;
 
        function BaseDump( $infile ) {
-               $this->infiles = explode(';',$infile);
+               $this->infiles = explode( ';', $infile );
                $this->reader = new XMLReader();
-               $infile = array_shift($this->infiles);
+               $infile = array_shift( $this->infiles );
                if (defined( 'LIBXML_PARSEHUGE' ) ) {
                        $this->reader->open( $infile, null, LIBXML_PARSEHUGE );
                }
index f276fc1..861610b 100644 (file)
@@ -46,7 +46,7 @@ class ChangePassword extends Maintenance {
                } elseif ( $this->hasOption( "userid" ) ) {
                        $user = User::newFromId( $this->getOption( 'userid' ) );
                } else {
-                       $this->error( "A \"user\" or \"userid\" must be set to change the password for" , true );
+                       $this->error( "A \"user\" or \"userid\" must be set to change the password for", true );
                }
                if ( !$user || !$user->getId() ) {
                        $this->error( "No such user: " . $this->getOption( 'user' ), true );
index 3ad0864..3df1169 100644 (file)
@@ -51,7 +51,7 @@ class DatabaseLag extends Maintenance {
                                unset( $lags[0] );
                                echo gmdate( 'H:i:s' ) . ' ';
                                foreach ( $lags as $lag ) {
-                                       printf( "%-12s " , $lag === false ? 'false' : $lag );
+                                       printf( "%-12s ", $lag === false ? 'false' : $lag );
                                }
                                echo "\n";
                                sleep( 5 );
@@ -61,7 +61,7 @@ class DatabaseLag extends Maintenance {
                        $lags = $lb->getLagTimes();
                        foreach ( $lags as $i => $lag ) {
                                $name = $lb->getServerName( $i );
-                               $this->output( sprintf( "%-20s %s\n" , $name, $lag === false ? 'false' : $lag ) );
+                               $this->output( sprintf( "%-20s %s\n", $name, $lag === false ? 'false' : $lag ) );
                        }
                }
        }
index b1c16ad..420e842 100644 (file)
@@ -508,7 +508,7 @@ class languages {
 
 
                        if ( isset( $messages[$key] ) ) {
-                               $messages[$key] = implode( $messages[$key],", " );
+                               $messages[$key] = implode( $messages[$key], ", " );
                        }
                }
                return $messages;
index 429e3b3..5e505eb 100644 (file)
@@ -131,7 +131,7 @@ function generateConfigFile( $doxygenTemplate, $outputDirectory, $stripFromPath,
        );
        $tmpCfg = str_replace( array_keys( $replacements ), array_values( $replacements ), $template );
        $tmpFileName = tempnam( wfTempDir(), 'mwdocgen-' );
-       file_put_contents( $tmpFileName , $tmpCfg ) or die( "Could not write doxygen configuration to file $tmpFileName\n" );
+       file_put_contents( $tmpFileName, $tmpCfg ) or die( "Could not write doxygen configuration to file $tmpFileName\n" );
 
        return $tmpFileName;
 }
index 58fe880..850d032 100644 (file)
@@ -32,7 +32,7 @@ class PurgeList extends Maintenance {
        public function __construct() {
                parent::__construct();
                $this->mDescription = "Send purge requests for listed pages to squid";
-               $this->addOption( 'purge', 'Whether to update page_touched.' , false, false );
+               $this->addOption( 'purge', 'Whether to update page_touched.', false, false );
                $this->addOption( 'namespace', 'Namespace number', false, true );
                $this->setBatchSize( 100 );
        }
index 12da7a8..55f5b4a 100644 (file)
@@ -53,7 +53,7 @@ class RefreshImageMetadata extends Maintenance {
                $this->addOption( 'start', 'Name of file to start with', false, true );
                $this->addOption( 'end', 'Name of file to end with', false, true );
 
-               $this->addOption( 'mime', '(Inefficient!) Only refresh files with this mime type. Can accept wild-card image/*' , false, true );
+               $this->addOption( 'mime', '(Inefficient!) Only refresh files with this mime type. Can accept wild-card image/*', false, true );
                $this->addOption( 'metadata-contains', '(Inefficient!) Only refresh files where the img_metadata field contains this string. Can be used if its known a specific property was being extracted incorrectly.', false, true );
 
        }
index 657c056..3036406 100644 (file)
@@ -59,7 +59,7 @@ class ShowStats extends Maintenance {
                $max_length_value = $max_length_desc = 0;
                foreach ( $fields as $field => $desc ) {
                        $max_length_value = max( $max_length_value, strlen( $stats->$field ) );
-                       $max_length_desc  = max( $max_length_desc , strlen( $desc ) ) ;
+                       $max_length_desc  = max( $max_length_desc strlen( $desc ) ) ;
                }
 
                // Show them
index 95f028a..4e8a1a2 100644 (file)
@@ -65,7 +65,7 @@ print Xml::element( 'Image',
                'height' => 16,
                'width' => 16,
                'type' => 'image/x-icon' ),
-       wfExpandUrl( $wgFavicon , PROTO_CURRENT ) );
+       wfExpandUrl( $wgFavicon, PROTO_CURRENT ) );
 
 $urls = array();
 
index cbbf2ab..885a9e9 100644 (file)
@@ -221,9 +221,9 @@ class profile_point {
                <td class="mw-profileinfo-count"><?php echo $this->count(); ?></td>
                <td class="mw-profileinfo-cpr"><?php echo round( sprintf( '%.2f', $this->callsPerRequest() ), 2 ); ?></td>
                <td class="mw-profileinfo-tpc"><?php echo round( sprintf( '%.2f', $this->timePerCall() ), 2 ); ?></td>
-               <td class="mw-profileinfo-mpc"><?php echo round( sprintf( '%.2f' ,$this->memoryPerCall() / 1024 ), 2 ); ?></td>
+               <td class="mw-profileinfo-mpc"><?php echo round( sprintf( '%.2f'$this->memoryPerCall() / 1024 ), 2 ); ?></td>
                <td class="mw-profileinfo-tpr"><?php echo @round( sprintf( '%.2f', $this->time() / self::$totalcount ), 2 ); ?></td>
-               <td class="mw-profileinfo-mpr"><?php echo @round( sprintf( '%.2f' ,$this->memory() / self::$totalcount / 1024 ), 2 ); ?></td>
+               <td class="mw-profileinfo-mpr"><?php echo @round( sprintf( '%.2f'$this->memory() / self::$totalcount / 1024 ), 2 ); ?></td>
                </tr>
                <?php
                if ( $ex ) {