Fixed spacing
authorumherirrender <umherirrender_de.wp@web.de>
Sat, 26 Sep 2015 20:32:31 +0000 (22:32 +0200)
committerReedy <reedy@wikimedia.org>
Sat, 26 Sep 2015 20:44:54 +0000 (20:44 +0000)
- Removed space after cast
- Removed spaces in array index
- Removed double spaces
- Added spaces around string concat
- Fixed mixed tabs and spaces at begin of line

Change-Id: I38e849723f055d2d4c05cba72f5c245a28e8d5da

17 files changed:
includes/EditPage.php
includes/Html.php
includes/OutputPage.php
includes/db/DatabaseSqlite.php
includes/db/loadbalancer/LoadMonitorMySQL.php
includes/debug/logger/LegacyLogger.php
includes/htmlform/HTMLButtonField.php
includes/media/WebP.php
includes/parser/MWTidy.php
includes/registration/ExtensionRegistry.php
includes/resourceloader/ResourceLoader.php
includes/specials/SpecialChangeContentModel.php
includes/utils/BatchRowIterator.php
includes/utils/FileContentsHasher.php
tests/phpunit/includes/UserTest.php
tests/phpunit/includes/filebackend/SwiftFileBackendTest.php
tests/phpunit/includes/filerepo/MigrateFileRepoLayoutTest.php

index 05e0ac0..89b484c 100644 (file)
@@ -3705,7 +3705,7 @@ HTML
                $imagesAvailable = $wgEnableUploads || count( $wgForeignFileRepos );
                $showSignature = true;
                if ( $title ) {
-                        $showSignature = MWNamespace::wantSignatures( $title->getNamespace() );
+                       $showSignature = MWNamespace::wantSignatures( $title->getNamespace() );
                }
 
                /**
index 62ae0b8..c61dca8 100644 (file)
@@ -857,7 +857,7 @@ class Html {
                        } elseif ( is_int( $nsId ) ) {
                                $nsName = $wgContLang->convertNamespace( $nsId );
                        }
-                       $optionsOut[ $nsId ] = $nsName;
+                       $optionsOut[$nsId] = $nsName;
                }
 
                return $optionsOut;
index 552e181..336e4f4 100644 (file)
@@ -3973,7 +3973,7 @@ class OutputPage extends ContextSource {
                $themes = ExtensionRegistry::getInstance()->getAttribute( 'SkinOOUIThemes' );
                // Make keys (skin names) lowercase for case-insensitive matching.
                $themes = array_change_key_case( $themes, CASE_LOWER );
-               $theme = isset( $themes[ $skinName ] ) ? $themes[ $skinName ] : 'MediaWiki';
+               $theme = isset( $themes[$skinName] ) ? $themes[$skinName] : 'MediaWiki';
                // For example, 'OOUI\MediaWikiTheme'.
                $themeClass = "OOUI\\{$theme}Theme";
                OOUI\Theme::setSingleton( new $themeClass() );
index 7ece56d..0a7629e 100644 (file)
@@ -985,7 +985,7 @@ class DatabaseSqlite extends DatabaseBase {
                        $indexInfo = $this->query( 'PRAGMA INDEX_INFO(' . $this->addQuotes( $index->name ) . ')' );
                        $fields = array();
                        foreach ( $indexInfo as $indexInfoRow ) {
-                               $fields[ $indexInfoRow->seqno ] = $indexInfoRow->name;
+                               $fields[$indexInfoRow->seqno] = $indexInfoRow->name;
                        }
 
                        $sql .= '(' . implode( ',', $fields ) . ')';
index 3008419..39ced1b 100644 (file)
@@ -58,7 +58,7 @@ class LoadMonitorMySQL implements LoadMonitor {
                # (a) Check the local APC cache
                $value = $this->srvCache->get( $key );
                if ( $value && $value['timestamp'] > ( microtime( true ) - $ttl ) ) {
-                       wfDebugLog( 'replication',  __FUNCTION__ . ": got lag times ($key) from local cache" );
+                       wfDebugLog( 'replication', __FUNCTION__ . ": got lag times ($key) from local cache" );
                        return $value['lagTimes']; // cache hit
                }
                $staleValue = $value ?: false;
@@ -67,7 +67,7 @@ class LoadMonitorMySQL implements LoadMonitor {
                $value = $this->mainCache->get( $key );
                if ( $value && $value['timestamp'] > ( microtime( true ) - $ttl ) ) {
                        $this->srvCache->set( $key, $value, $staleTTL );
-                       wfDebugLog( 'replication',  __FUNCTION__ . ": got lag times ($key) from main cache" );
+                       wfDebugLog( 'replication', __FUNCTION__ . ": got lag times ($key) from main cache" );
 
                        return $value['lagTimes']; // cache hit
                }
@@ -106,7 +106,7 @@ class LoadMonitorMySQL implements LoadMonitor {
                $value = array( 'lagTimes' => $lagTimes, 'timestamp' => microtime( true ) );
                $this->mainCache->set( $key, $value, $staleTTL );
                $this->srvCache->set( $key, $value, $staleTTL );
-               wfDebugLog( 'replication',  __FUNCTION__ . ": re-calculated lag times ($key)" );
+               wfDebugLog( 'replication', __FUNCTION__ . ": re-calculated lag times ($key)" );
 
                return $value['lagTimes'];
        }
index 0f4c648..bb3c7e1 100644 (file)
@@ -357,7 +357,7 @@ class LegacyLogger extends AbstractLogger {
                }
 
                if ( is_scalar( $item ) ) {
-                       return (string) $item;
+                       return (string)$item;
                }
 
                if ( is_array( $item ) ) {
@@ -376,7 +376,7 @@ class LegacyLogger extends AbstractLogger {
 
                if ( is_object( $item ) ) {
                        if ( method_exists( $item, '__toString' ) ) {
-                               return (string) $item;
+                               return (string)$item;
                        }
 
                        return '[Object ' . get_class( $item ) . ']';
index 56a23ad..ff0025b 100644 (file)
@@ -28,7 +28,7 @@ class HTMLButtonField extends HTMLFormField {
                ) {
                        $prefix = 'mw-ui-';
                        // add mw-ui-button separately, so the descriptor doesn't need to set it
-                       $flags .= ' ' . $prefix.'button';
+                       $flags .= ' ' . $prefix . 'button';
                }
                foreach ( $this->mFlags as $flag ) {
                        $flags .= ' ' . $prefix . $flag;
index ff4dcee..f894618 100644 (file)
@@ -102,7 +102,7 @@ class WebPHandler extends BitmapHandler {
 
                if ( $info['fourCC'] != 'WEBP' ) {
                        wfDebugLog( 'WebP', __METHOD__ . ': FourCC was not WEBP: ' .
-                               bin2hex( $info['fourCC'] ) .  " \n" );
+                               bin2hex( $info['fourCC'] ) . " \n" );
                        return false;
                }
 
@@ -187,7 +187,7 @@ class WebPHandler extends BitmapHandler {
                // Bytes 4-7 are chunk stream size
                // Byte 8 is 0x2F called the signature
                if ( $header{8} != "\x2F" ) {
-                       wfDebugLog( 'WebP',  __METHOD__ . ': Invalid signature: ' .
+                       wfDebugLog( 'WebP', __METHOD__ . ': Invalid signature: ' .
                                bin2hex( $header{8} ) . "\n" );
                        return array();
                }
index 807842b..3a2bb17 100644 (file)
@@ -45,7 +45,7 @@ class MWTidy {
        public static function tidy( $text ) {
                $driver = self::singleton();
                if ( !$driver ) {
-                       throw new MWException( __METHOD__.
+                       throw new MWException( __METHOD__ .
                                ': tidy is disabled, caller should have checked MWTidy::isEnabled()' );
                }
                return $driver->tidy( $text );
@@ -61,7 +61,7 @@ class MWTidy {
        public static function checkErrors( $text, &$errorStr = null ) {
                $driver = self::singleton();
                if ( !$driver ) {
-                       throw new MWException( __METHOD__.
+                       throw new MWException( __METHOD__ .
                                ': tidy is disabled, caller should have checked MWTidy::isEnabled()' );
                }
                if ( $driver->supportsValidate() ) {
index f91aeff..59b9249 100644 (file)
@@ -204,7 +204,7 @@ class ExtensionRegistry {
                        ) {
                                // Doesn't match, mark it as incompatible.
                                $incompatible[] = "{$info['name']} is not compatible with the current "
-                                       . "MediaWiki core (version {$wgVersion}), it requires: ". $requires[self::MEDIAWIKI_CORE]
+                                       . "MediaWiki core (version {$wgVersion}), it requires: " . $requires[self::MEDIAWIKI_CORE]
                                        . '.';
                                continue;
                        }
index ab36701..4a9cd0e 100644 (file)
@@ -747,7 +747,7 @@ class ResourceLoader implements LoggerAwareInterface {
 
                if ( $context->getImageObj() && $this->errors ) {
                        // We can't show both the error messages and the response when it's an image.
-                       $response = implode( "\n\n",  $this->errors );
+                       $response = implode( "\n\n", $this->errors );
                } elseif ( $this->errors ) {
                        $errorText = implode( "\n\n", $this->errors );
                        $errorResponse = self::makeComment( $errorText );
index cce5da5..b0def59 100644 (file)
@@ -139,7 +139,7 @@ class SpecialChangeContentModel extends FormSpecialPage {
                        throw new RuntimeException( "Form submission was not POSTed" );
                }
 
-               $this->title = Title::newFromText( $data['pagetitle' ] );
+               $this->title = Title::newFromText( $data['pagetitle'] );
                $user = $this->getUser();
                // Check permissions and make sure the user has permission to edit the specific page
                $errors = $this->title->getUserPermissionsErrors( 'editcontentmodel', $user );
index 9441608..fb2ae2a 100644 (file)
@@ -90,7 +90,7 @@ class BatchRowIterator implements RecursiveIterator {
                }
                $this->db = $db;
                $this->table = $table;
-               $this->primaryKey = (array) $primaryKey;
+               $this->primaryKey = (array)$primaryKey;
                $this->fetchColumns = $this->primaryKey;
                $this->orderBy = implode( ' ASC,', $this->primaryKey ) . ' ASC';
                $this->batchSize = $batchSize;
@@ -169,7 +169,7 @@ class BatchRowIterator implements RecursiveIterator {
         * @return boolean True when the iterator is in a valid state
         */
        public function valid() {
-               return (bool) $this->current;
+               return (bool)$this->current;
        }
 
        /**
index 67eb9d2..655c1d0 100644 (file)
@@ -93,7 +93,7 @@ class FileContentsHasher {
                $instance = self::singleton();
 
                if ( !is_array( $filePaths ) ) {
-                       $filePaths = (array) $filePaths;
+                       $filePaths = (array)$filePaths;
                }
 
                if ( count( $filePaths ) === 1 ) {
index 77132bb..17c1b8e 100644 (file)
@@ -527,7 +527,7 @@ class UserTest extends MediaWikiTestCase {
 
                $setcookieInvocations = $setcookieSpy->getInvocations();
                $setcookieInvocation = end( $setcookieInvocations );
-               $actualExpiry = $setcookieInvocation->parameters[ 2 ];
+               $actualExpiry = $setcookieInvocation->parameters[2];
 
                // TODO: ± 300 seconds compensates for
                // slow-running tests. However, the dependency on the time
index adcbe74..a683750 100644 (file)
@@ -75,7 +75,7 @@ class SwiftFileBackendTest extends MediaWikiTestCase {
                                array(
                                        'content-length' => 345,
                                        'content-type'   => 'image+bitmap/jpeg',
-                                       'content-disposition' => 'filename='. str_repeat( 'o', 1024 ) . ';inline',
+                                       'content-disposition' => 'filename=' . str_repeat( 'o', 1024 ) . ';inline',
                                        'content-duration' => 35.6363,
                                        'content-custom' => 'hello',
                                        'x-content-custom' => 'hello'
index 679382b..3f08fd2 100644 (file)
@@ -71,7 +71,7 @@ class MigrateFileRepoLayoutTest extends MediaWikiTestCase {
                        }
                }
 
-               rmdir( $directory );
+               rmdir( $directory );
        }
 
        protected function tearDown() {