Fixed spacing
authorumherirrender <umherirrender_de.wp@web.de>
Tue, 19 Nov 2013 18:03:54 +0000 (19:03 +0100)
committerumherirrender <umherirrender_de.wp@web.de>
Tue, 19 Nov 2013 18:03:54 +0000 (19:03 +0100)
- Removed double spaces
- Added space after if/switch/foreach
- Removed space on elseif
- Added space around parentheses
- Added newline at end of file
- Removed space before semicolon at end of line

Change-Id: Id40b87e04786c6111e6686d7f7eea1e588bdf37d

40 files changed:
includes/Action.php
includes/GlobalFunctions.php
includes/HTMLForm.php
includes/Title.php
includes/api/ApiQuery.php
includes/db/DatabaseMysqlBase.php
includes/db/DatabaseMysqli.php
includes/filerepo/file/LocalFile.php
includes/installer/DatabaseUpdater.php
includes/media/FormatMetadata.php
includes/parser/ParserOutput.php
includes/resourceloader/ResourceLoaderFileModule.php
includes/specials/SpecialListfiles.php
includes/upload/UploadFromChunks.php
maintenance/benchmarks/bench_wfIsWindows.php
maintenance/mergeMessageFileList.php
maintenance/oracle/archives/patch_16_17_schema_changes.sql
maintenance/oracle/tables.sql
maintenance/purgeChangedFiles.php
maintenance/update.php
tests/phpunit/data/db/sqlite/tables-1.13.sql
tests/phpunit/includes/ExceptionTest.php
tests/phpunit/includes/FallbackTest.php
tests/phpunit/includes/MWExceptionHandlerTest.php
tests/phpunit/includes/StatusTest.php
tests/phpunit/includes/UserMailerTest.php
tests/phpunit/includes/XmlJsTest.php
tests/phpunit/includes/api/ApiEditPageTest.php
tests/phpunit/includes/api/ApiOptionsTest.php
tests/phpunit/includes/api/ApiTestContext.php
tests/phpunit/includes/api/MockApi.php
tests/phpunit/includes/api/UserWrapper.php
tests/phpunit/includes/db/DatabaseMysqlBaseTest.php
tests/phpunit/includes/db/DatabaseTest.php
tests/phpunit/includes/diff/DifferenceEngineTest.php
tests/phpunit/includes/media/FakeDimensionFile.php
tests/phpunit/includes/media/FormatMetadataTest.php
tests/phpunit/includes/parser/TidyTest.php
tests/phpunit/structure/AutoLoaderTest.php
tests/qunit/suites/resources/mediawiki/mediawiki.jqueryMsg.test.js

index 4b6e446..72be46f 100644 (file)
@@ -167,7 +167,7 @@ abstract class Action {
        final public function getContext() {
                if ( $this->context instanceof IContextSource ) {
                        return $this->context;
-               } else if ( $this->page instanceof Article ) {
+               } elseif ( $this->page instanceof Article ) {
                        // NOTE: $this->page can be a WikiPage, which does not have a context.
                        wfDebug( __METHOD__ . ': no context known, falling back to Article\'s context.' );
                        return $this->page->getContext();
index 688300a..57877a2 100644 (file)
@@ -3810,7 +3810,7 @@ function wfGetNull() {
  * @param string|bool $cluster Cluster name accepted by LBFactory. Default: false.
  */
 function wfWaitForSlaves( $maxLag = false, $wiki = false, $cluster = false ) {
-       if( $cluster !== false ) {
+       if ( $cluster !== false ) {
                $lb = wfGetLBFactory()->getExternalLB( $cluster );
        } else {
                $lb = wfGetLB( $wiki );
index d260862..b60146a 100644 (file)
@@ -1034,7 +1034,7 @@ class HTMLForm extends ContextSource {
                $subsectionHtml = '';
                $hasLabel = false;
 
-               switch( $displayFormat ) {
+               switch ( $displayFormat ) {
                        case 'table':
                                $getFieldHtmlMethod = 'getTableRow';
                                break;
index 4b8a141..c726e9d 100644 (file)
@@ -4830,7 +4830,7 @@ class Title {
                        $langObj = wfGetLangObj( $contentHandler->getPageLanguage( $this ) );
                        $this->mPageLanguage = array( $langObj->getCode(), $wgLanguageCode );
                } else {
-                       $langObj =  wfGetLangObj( $this->mPageLanguage[0] );
+                       $langObj = wfGetLangObj( $this->mPageLanguage[0] );
                }
                wfProfileOut( __METHOD__ );
                return $langObj;
index 79a3b05..cec1ca8 100644 (file)
@@ -714,7 +714,7 @@ class ApiQuery extends ApiBase {
                        'meta' => 'Which metadata to get about the site. Module help is available below',
                        'indexpageids' => 'Include an additional pageids section listing all returned page IDs',
                        'export' => 'Export the current revisions of all given or generated pages',
-                       'exportnowrap' => 'Return the export XML without wrapping it in an '.
+                       'exportnowrap' => 'Return the export XML without wrapping it in an ' .
                                'XML result (same format as Special:Export). Can only be used with export',
                        'iwurl' => 'Whether to get the full URL if the title is an interwiki link',
                        'continue' => array(
index 5be460f..6a3ebcb 100644 (file)
@@ -480,7 +480,7 @@ abstract class DatabaseMysqlBase extends DatabaseBase {
        public function addIdentifierQuotes( $s ) {
                // Characters in the range \u0001-\uFFFF are valid in a quoted identifier
                // Remove NUL bytes and escape backticks by doubling
-               return '`' . str_replace( array( "\0", '`' ), array( '', '``' ), $s )  . '`';
+               return '`' . str_replace( array( "\0", '`' ), array( '', '``' ), $s ) . '`';
        }
 
        /**
@@ -1024,12 +1024,12 @@ abstract class DatabaseMysqlBase extends DatabaseBase {
                        // Query for the VIEWS
                        $result = $this->query( 'SHOW FULL TABLES WHERE TABLE_TYPE = "VIEW"' );
                        $this->allViews = array();
-                       while ( ($row = $this->fetchRow($result)) !== false ) {
+                       while ( ( $row = $this->fetchRow( $result ) ) !== false ) {
                                array_push( $this->allViews, $row[$propertyName] );
                        }
                }
 
-               if ( is_null($prefix) || $prefix === '' ) {
+               if ( is_null( $prefix ) || $prefix === '' ) {
                        return $this->allViews;
                }
 
index 5b2e11d..a47c804 100644 (file)
@@ -187,7 +187,7 @@ class DatabaseMysqli extends DatabaseMysqlBase {
        }
 
        protected function mysqlError( $conn = null ) {
-               if ($conn === null) {
+               if ( $conn === null ) {
                        return mysqli_connect_error();
                } else {
                        return $conn->error;
index fe769be..b609f43 100644 (file)
@@ -539,7 +539,7 @@ class LocalFile extends File {
                                'img_media_type' => $this->media_type,
                                'img_major_mime' => $major,
                                'img_minor_mime' => $minor,
-                               'img_metadata' => $dbw->encodeBlob($this->metadata),
+                               'img_metadata' => $dbw->encodeBlob( $this->metadata ),
                                'img_sha1' => $this->sha1,
                        ),
                        array( 'img_name' => $this->getName() ),
@@ -1225,7 +1225,7 @@ class LocalFile extends File {
                                'img_description' => $comment,
                                'img_user' => $user->getId(),
                                'img_user_text' => $user->getName(),
-                               'img_metadata' => $dbw->encodeBlob($this->metadata),
+                               'img_metadata' => $dbw->encodeBlob( $this->metadata ),
                                'img_sha1' => $this->sha1
                        ),
                        __METHOD__,
@@ -1276,7 +1276,7 @@ class LocalFile extends File {
                                        'img_description' => $comment,
                                        'img_user'        => $user->getId(),
                                        'img_user_text'   => $user->getName(),
-                                       'img_metadata'    => $dbw->encodeBlob($this->metadata),
+                                       'img_metadata'    => $dbw->encodeBlob( $this->metadata ),
                                        'img_sha1'        => $this->sha1
                                ),
                                array( 'img_name' => $this->getName() ),
index 41cbf50..3f2e2cb 100644 (file)
@@ -1045,7 +1045,7 @@ abstract class DatabaseUpdater {
        protected function disableContentHandlerUseDB() {
                global $wgContentHandlerUseDB;
 
-               if( $wgContentHandlerUseDB ) {
+               if ( $wgContentHandlerUseDB ) {
                        $this->output( "Turning off Content Handler DB fields for this part of upgrade.\n" );
                        $this->holdContentHandlerUseDB = $wgContentHandlerUseDB;
                        $wgContentHandlerUseDB = false;
@@ -1058,7 +1058,7 @@ abstract class DatabaseUpdater {
        protected function enableContentHandlerUseDB() {
                global $wgContentHandlerUseDB;
 
-               if( $this->holdContentHandlerUseDB ) {
+               if ( $this->holdContentHandlerUseDB ) {
                        $this->output( "Content Handler DB fields should be usable now.\n" );
                        $wgContentHandlerUseDB = $this->holdContentHandlerUseDB;
                }
index 91c4c9a..1b1841c 100644 (file)
@@ -977,7 +977,7 @@ class FormatMetadata extends ContextSource {
                                        $defaultItem = $vals['x-default'];
                                        unset( $vals['x-default'] );
                                }
-                               foreach( $priorityLanguages as $pLang ) {
+                               foreach ( $priorityLanguages as $pLang ) {
                                        if ( isset( $vals[$pLang] ) ) {
                                                $isDefault = false;
                                                if ( $vals[$pLang] === $defaultItem ) {
@@ -1506,7 +1506,7 @@ class FormatMetadata extends ContextSource {
                        // This is an API-specific function so it would be cleaner to call it from
                        // outside fetchExtendedMetadata, but this way we don't need to redo the
                        // computation on a cache hit.
-                       $this->sanitizeArrayForXml($extendedMetadata);
+                       $this->sanitizeArrayForXml( $extendedMetadata );
                        $valueToCache = array( 'data' => $extendedMetadata, 'timestamp' => wfTimestampNow() );
                        $wgMemc->set( $cacheKey, $valueToCache, $maxCacheTime );
                }
@@ -1628,7 +1628,7 @@ class FormatMetadata extends ContextSource {
 
                // choose the language best matching user or site settings
                $priorityLanguages = $this->getPriorityLanguages();
-               foreach( $priorityLanguages as $lang ) {
+               foreach ( $priorityLanguages as $lang ) {
                        if ( isset( $value[$lang] ) ) {
                                return $value[$lang];
                        }
@@ -1640,9 +1640,9 @@ class FormatMetadata extends ContextSource {
                }
 
                // otherwise just return any one language
-               unset($value['_type']);
-               if (!empty($value)) {
-                       return reset($value);
+               unset( $value['_type'] );
+               if ( !empty( $value ) ) {
+                       return reset( $value );
                }
 
                // this should not happen; signal error
index 502f0fd..2950227 100644 (file)
@@ -83,7 +83,7 @@ class ParserOutput extends CacheTime {
                        $text = str_replace( array( Parser::TOC_START, Parser::TOC_END ), '', $text );
                } else {
                        $text = preg_replace(
-                               '#'. preg_quote( Parser::TOC_START ) . '.*?' . preg_quote( Parser::TOC_END ) . '#s',
+                               '#' . preg_quote( Parser::TOC_START ) . '.*?' . preg_quote( Parser::TOC_END ) . '#s',
                                '',
                                $text
                        );
index 7b85001..8183999 100644 (file)
@@ -585,7 +585,7 @@ class ResourceLoaderFileModule extends ResourceLoaderModule {
         */
        public function getAllStyleFiles() {
                $files = array();
-               foreach( (array)$this->styles as $key => $value ) {
+               foreach ( (array)$this->styles as $key => $value ) {
                        if ( is_array( $value ) ) {
                                $path = $key;
                        } else {
index dff1cf7..7484995 100644 (file)
@@ -240,7 +240,7 @@ class ImageListPager extends TablePager {
                                }
                                $field = $prefix . substr( $field, 3 ) . ' AS ' . $field;
                        }
-                       $fields[array_search('top', $fields)] = "'no' AS top";
+                       $fields[array_search( 'top', $fields )] = "'no' AS top";
                } else {
                        if ( $this->mShowAll ) {
                                $fields[array_search( 'top', $fields )] = "'yes' AS top";
index 091bd78..b572499 100644 (file)
@@ -127,7 +127,7 @@ class UploadFromChunks extends UploadFromFile {
                // Get a 0-byte temp file to perform the concatenation at
                $tmpFile = TempFSFile::factory( 'chunkedupload_', $ext );
                $tmpPath = false; // fail in concatenate()
-               if( $tmpFile ) {
+               if ( $tmpFile ) {
                        // keep alive with $this
                        $tmpPath = $tmpFile->bind( $this )->getPath();
                }
index 1cd2016..76cea2c 100644 (file)
@@ -47,7 +47,7 @@ class bench_wfIsWindows extends Benchmarker {
        }
 
        static function is_win() {
-               return substr( php_uname(), 0, 7 ) == 'Windows' ;
+               return substr( php_uname(), 0, 7 ) == 'Windows';
        }
 
        // bench function 1
index e918337..5bf04c6 100644 (file)
@@ -148,7 +148,7 @@ foreach ( $mmfl['setupFiles'] as $fileName ) {
                fwrite( STDERR, "Loading data from $fileName\n" );
        }
        // Include the extension to update $wgExtensionMessagesFiles
-       if ( !( include_once( $fileName ) ) ) {
+       if ( !( include_once $fileName ) ) {
                fwrite( STDERR, "Unable to read $fileName\n" );
                exit( 1 );
        }
index 64c2848..cd99f7c 100644 (file)
@@ -67,7 +67,7 @@ CREATE TABLE &mw_prefix.msg_resource (
   mr_lang varchar2(32) NOT NULL,
   mr_blob BLOB NOT NULL,
   mr_timestamp TIMESTAMP(6) WITH TIME ZONE NOT NULL
-) ;
+);
 CREATE UNIQUE INDEX &mw_prefix.msg_resource_u01 ON &mw_prefix.msg_resource (mr_resource, mr_lang);
 
 ALTER TABLE &mw_prefix.oldimage MODIFY oi_name DEFAULT 0;
index 607d7b9..2395bc5 100644 (file)
@@ -663,7 +663,7 @@ CREATE TABLE &mw_prefix.msg_resource (
   mr_lang varchar2(32) NOT NULL,
   mr_blob BLOB NOT NULL,
   mr_timestamp TIMESTAMP(6) WITH TIME ZONE NOT NULL
-) ;
+);
 CREATE UNIQUE INDEX &mw_prefix.msg_resource_u01 ON &mw_prefix.msg_resource (mr_resource, mr_lang);
 
 CREATE TABLE &mw_prefix.msg_resource_links (
index c21301b..91c36f2 100644 (file)
@@ -121,7 +121,7 @@ class PurgeChangedFiles extends Maintenance {
                        $this->mOptions['verbose'] = 1;
                }
 
-               $this->verbose( 'Purging files that were: ' . implode( ', ', $typeList ) . "\n");
+               $this->verbose( 'Purging files that were: ' . implode( ', ', $typeList ) . "\n" );
                foreach ( $typeList as $type ) {
                        $this->verbose( "Checking for {$type} files...\n" );
                        $this->purgeFromLogType( $type );
@@ -186,7 +186,7 @@ class PurgeChangedFiles extends Maintenance {
                                        // Purge items from fileachive table (rows are likely here)
                                        $this->purgeFromArchiveTable( $repo, $file );
 
-                               } else if ( $logType === 'move' ) {
+                               } elseif ( $logType === 'move' ) {
                                        // Purge the target file as well
 
                                        $params = unserialize( $row->log_params );
index e39661a..6b08480 100644 (file)
@@ -169,7 +169,7 @@ class UpdateMediaWiki extends Maintenance {
                $time2 = new MWTimestamp();
 
                $this->output( "\nDone.\n" );
-               $this->output( "\nThe job took ". $time2->diff( $time1 )->format( "%i:%S" ). "\n" );
+               $this->output( "\nThe job took " . $time2->diff( $time1 )->format( "%i:%S" ) . "\n" );
        }
 
        function afterFinalSetup() {
index 66847ab..2efb7a0 100644 (file)
@@ -50,12 +50,12 @@ CREATE TABLE /*$wgDBprefix*/revision (
   rev_minor_edit tinyint  default '0',
   rev_deleted tinyint  default '0',
   rev_len int,
-  rev_parent_id INTEGER default NULL) /*$wgDBTableOptions*/  ;
+  rev_parent_id INTEGER default NULL) /*$wgDBTableOptions*/;
 
 CREATE TABLE /*$wgDBprefix*/text (
   old_id INTEGER  PRIMARY KEY AUTOINCREMENT,
   old_text mediumblob ,
-  old_flags tinyblob ) /*$wgDBTableOptions*/  ;
+  old_flags tinyblob ) /*$wgDBTableOptions*/;
 
 CREATE TABLE /*$wgDBprefix*/archive (
   ar_namespace INTEGER  default '0',
@@ -124,7 +124,7 @@ CREATE TABLE /*$wgDBprefix*/site_stats (
 
 CREATE TABLE /*$wgDBprefix*/hitcounter (
   hc_id INTEGER
-)  ;
+);
 
 CREATE TABLE /*$wgDBprefix*/ipblocks (
   ipb_id INTEGER  PRIMARY KEY AUTOINCREMENT,
@@ -245,7 +245,7 @@ CREATE TABLE /*$wgDBprefix*/math (
 CREATE TABLE /*$wgDBprefix*/searchindex (
   si_page INTEGER ,
   si_title varchar(255)  default '',
-  si_text mediumtext ) ;
+  si_text mediumtext );
 
 CREATE TABLE /*$wgDBprefix*/interwiki (
   iw_prefix varchar(32) ,
index 9e76045..63fff6e 100644 (file)
@@ -49,7 +49,7 @@ class ExceptionTest extends MediaWikiTestCase {
         * @param $key String Name of the key to validate in the serialized JSON
         * @dataProvider provideJsonSerializedKeys
         */
-       function testJsonserializeexceptionKeys($expectedKeyType, $exClass, $key) {
+       function testJsonserializeexceptionKeys( $expectedKeyType, $exClass, $key ) {
 
                # Make sure we log a backtrace:
                $this->setMwGlobals( array( 'wgLogExceptionBacktrace' => true ) );
@@ -61,7 +61,7 @@ class ExceptionTest extends MediaWikiTestCase {
                        "JSON serialized exception is missing key '$key'"
                );
                $this->assertInternalType( $expectedKeyType, $json->$key,
-                       "JSON serialized key '$key' has type " . gettype($json->$key)
+                       "JSON serialized key '$key' has type " . gettype( $json->$key )
                        . " (expected: $expectedKeyType)."
                );
        }
@@ -71,7 +71,7 @@ class ExceptionTest extends MediaWikiTestCase {
         */
        function provideJsonSerializedKeys() {
                $testCases = array();
-               foreach( array( 'Exception', 'MWException' ) as $exClass ) {
+               foreach ( array( 'Exception', 'MWException' ) as $exClass ) {
                        $exTests = array(
                                array( 'string',  $exClass,  'id' ),
                                array( 'string',  $exClass,  'file' ),
@@ -81,7 +81,7 @@ class ExceptionTest extends MediaWikiTestCase {
                                # Backtrace only enabled with wgLogExceptionBacktrace = true
                                array( 'array',   $exClass,  'backtrace' ),
                        );
-                       $testCases = array_merge($testCases, $exTests);
+                       $testCases = array_merge( $testCases, $exTests );
                }
                return $testCases;
        }
index f408f47..910b766 100644 (file)
@@ -69,5 +69,4 @@ class FallbackTest extends MediaWikiTestCase {
                        );
                }
        }
-
-}
\ No newline at end of file
+}
index aebd65f..dd76e3b 100644 (file)
@@ -19,7 +19,7 @@ class MWExceptionHandlerTest extends MediaWikiTestCase {
                        $array = array( 'a', 'b' );
                        $object = new StdClass();
                        self::helperThrowAnException( $array, $object, $refvar );
-               } catch (Exception $e) {
+               } catch ( Exception $e ) {
                }
 
                # Make sure our strack trace contains an array and an object passed to
@@ -37,7 +37,7 @@ class MWExceptionHandlerTest extends MediaWikiTestCase {
                                $hasArray = $hasArray || is_array( $arg );
                        }
 
-                       if( $hasObject && $hasArray ) {
+                       if ( $hasObject && $hasArray ) {
                                break;
                        }
                }
@@ -55,8 +55,8 @@ class MWExceptionHandlerTest extends MediaWikiTestCase {
                                continue;
                        }
                        foreach ( $frame['args'] as $arg ) {
-                               $this->assertNotInternalType( 'array', $arg);
-                               $this->assertNotInternalType( 'object', $arg);
+                               $this->assertNotInternalType( 'array', $arg );
+                               $this->assertNotInternalType( 'object', $arg );
                        }
                }
 
index 0a7cc04..9424d97 100644 (file)
@@ -5,7 +5,7 @@
  */
 class StatusTest extends MediaWikiTestCase {
 
-       public function testCanConstruct(){
+       public function testCanConstruct() {
                new Status();
                $this->assertTrue( true );
        }
@@ -17,14 +17,14 @@ class StatusTest extends MediaWikiTestCase {
         * @covers Status::isGood
         * @covers Status::isOK
         */
-       public function testNewGood( $value = null ){
+       public function testNewGood( $value = null ) {
                $status = Status::newGood( $value );
                $this->assertTrue( $status->isGood() );
                $this->assertTrue( $status->isOK() );
                $this->assertEquals( $value, $status->getValue() );
        }
 
-       public static function provideValues(){
+       public static function provideValues() {
                return array(
                        array(),
                        array( 'foo' ),
@@ -96,13 +96,13 @@ class StatusTest extends MediaWikiTestCase {
                $status = new Status();
                $messages = $this->getMockMessages( $mockDetails );
 
-               foreach( $messages as $message ){
+               foreach ( $messages as $message ) {
                        $status->warning( $message );
                }
                $warnings = $status->getWarningsArray();
 
                $this->assertEquals( count( $messages ), count( $warnings ) );
-               foreach( $messages as $key => $message ) {
+               foreach ( $messages as $key => $message ) {
                        $expectedArray = array_merge( array( $message->getKey() ), $message->getParams() );
                        $this->assertEquals( $warnings[$key], $expectedArray );
                }
@@ -117,13 +117,13 @@ class StatusTest extends MediaWikiTestCase {
                $status = new Status();
                $messages = $this->getMockMessages( $mockDetails );
 
-               foreach( $messages as $message ){
+               foreach ( $messages as $message ) {
                        $status->error( $message );
                }
                $errors = $status->getErrorsArray();
 
                $this->assertEquals( count( $messages ), count( $errors ) );
-               foreach( $messages as $key => $message ) {
+               foreach ( $messages as $key => $message ) {
                        $expectedArray = array_merge( array( $message->getKey() ), $message->getParams() );
                        $this->assertEquals( $errors[$key], $expectedArray );
                }
@@ -146,15 +146,15 @@ class StatusTest extends MediaWikiTestCase {
         * @param array $messageDetails eg. array( 'KEY' => array(/PARAMS/) )
         * @return Message[]
         */
-       protected function getMockMessages( $messageDetails ){
+       protected function getMockMessages( $messageDetails ) {
                $messages = array();
-               foreach( $messageDetails as $key => $paramsArray ){
+               foreach ( $messageDetails as $key => $paramsArray ) {
                        $messages[] = $this->getMockMessage( $key, $paramsArray );
                }
                return $messages;
        }
 
-       public static function provideMockMessageDetails(){
+       public static function provideMockMessageDetails() {
                return array(
                        array( array( 'key1' => array( 'foo' => 'bar' ) ) ),
                        array( array( 'key1' => array( 'foo' => 'bar' ), 'key2' => array( 'foo2' => 'bar2' ) ) ),
@@ -165,7 +165,7 @@ class StatusTest extends MediaWikiTestCase {
         * @covers Status::merge
         * @todo test merge with $overwriteValue true
         */
-       public function testMerge(){
+       public function testMerge() {
                $status1 = new Status();
                $status2 = new Status();
                $message1 = $this->getMockMessage( 'warn1' );
index 278edfa..dca8aeb 100644 (file)
@@ -11,4 +11,4 @@ class UserMailerTest extends MediaWikiLangTestCase {
                        UserMailer::quotedPrintable( "\xc4\x88u legebla?", "UTF-8" ) );
        }
 
-}
\ No newline at end of file
+}
index 161468e..907ce79 100644 (file)
@@ -14,7 +14,7 @@ class XmlJs extends MediaWikiTestCase {
                $this->assertEquals( $value, $obj->value );
        }
 
-       public function provideConstruction(){
+       public function provideConstruction() {
                return array(
                        array( null ),
                        array( '' ),
index 7521dcf..8fe08e1 100644 (file)
@@ -212,7 +212,7 @@ class ApiEditPageTest extends ApiTestCase {
                        'text' => "==section 1==\nnew content 1",
                ) );
                $this->assertEquals( 'Success', $re['edit']['result'] );
-               $newtext = WikiPage::factory( Title::newFromText( $name) )->getContent( Revision::RAW )->getNativeData();
+               $newtext = WikiPage::factory( Title::newFromText( $name ) )->getContent( Revision::RAW )->getNativeData();
                $this->assertEquals( $newtext, "==section 1==\nnew content 1\n\n==section 2==\ncontent2" );
 
                // Test that we raise a 'nosuchsection' error
index 3168f32..6e5edbf 100644 (file)
@@ -10,7 +10,7 @@
 class ApiOptionsTest extends MediaWikiLangTestCase {
 
        /** @var PHPUnit_Framework_MockObject_MockObject */
-       private $mUserMock ;
+       private $mUserMock;
        /** @var ApiOptions */
        private $mTested;
        private $mSession;
index 43637c2..80d7ea6 100644 (file)
@@ -18,4 +18,4 @@ class ApiTestContext extends RequestContext {
 
                return $context;
        }
-}
\ No newline at end of file
+}
index 3686048..d94aa2c 100644 (file)
@@ -17,4 +17,4 @@ class MockApi extends ApiBase {
                        'sessionkey' => null,
                );
        }
-}
\ No newline at end of file
+}
index 3262e6c..f8da0ff 100644 (file)
@@ -22,4 +22,4 @@ class UserWrapper {
                }
                $this->user->saveSettings();
        }
-}
\ No newline at end of file
+}
index 2162a02..58f2014 100644 (file)
@@ -65,7 +65,7 @@ class DatabaseMysqlBaseTest extends MediaWikiTestCase {
        public function testAddIdentifierQuotes( $expected, $in ) {
                $db = new FakeDatabaseMysqlBase();
                $quoted = $db->addIdentifierQuotes( $in );
-               $this->assertEquals($expected, $quoted);
+               $this->assertEquals( $expected, $quoted );
        }
 
 
@@ -121,7 +121,7 @@ class DatabaseMysqlBaseTest extends MediaWikiTestCase {
                );
        }
 
-       private static function createUnicodeString($str) {
+       private static function createUnicodeString( $str ) {
                return json_decode( '"' . $str . '"' );
        }
 
@@ -156,9 +156,9 @@ class DatabaseMysqlBaseTest extends MediaWikiTestCase {
                $db = $this->getMockForViews();
 
                // The first call populate an internal cache of views
-               $this->assertEquals( array( 'view1', 'view2', 'myview'),
+               $this->assertEquals( array( 'view1', 'view2', 'myview' ),
                        $db->listViews() );
-               $this->assertEquals( array( 'view1', 'view2', 'myview'),
+               $this->assertEquals( array( 'view1', 'view2', 'myview' ),
                        $db->listViews() );
 
                // Prefix filtering
@@ -168,7 +168,7 @@ class DatabaseMysqlBaseTest extends MediaWikiTestCase {
                        $db->listViews( 'my' ) );
                $this->assertEquals( array(),
                        $db->listViews( 'UNUSED_PREFIX' ) );
-               $this->assertEquals( array( 'view1', 'view2', 'myview'),
+               $this->assertEquals( array( 'view1', 'view2', 'myview' ),
                        $db->listViews( '' ) );
        }
 
@@ -179,7 +179,7 @@ class DatabaseMysqlBaseTest extends MediaWikiTestCase {
        function testIsView( $isView, $viewName ) {
                $db = $this->getMockForViews();
 
-               switch( $isView ) {
+               switch ( $isView ) {
                        case true:
                                $this->assertTrue( $db->isView( $viewName ),
                                        "$viewName should be considered a view" );
index 301fc99..35a8e4c 100644 (file)
@@ -109,7 +109,7 @@ class DatabaseTest extends MediaWikiTestCase {
                }
 
                if ( $this->db->getType() === 'oracle' ) {
-                       return strtoupper($database . $quote . $prefix . $table);
+                       return strtoupper( $database . $quote . $prefix . $table );
                } else {
                        return $database . $quote . $prefix . $table . $quote;
                }
index 738121a..5c3f36a 100644 (file)
@@ -47,7 +47,7 @@ class DifferenceEngineTest extends MediaWikiTestCase {
                $strings = array( "it is a kitten", "two kittens", "three kittens", "four kittens" );
                $revisions = array();
 
-               foreach( $strings as $string ) {
+               foreach ( $strings as $string ) {
                        $content = ContentHandler::makeContent( $string, $title );
                        $page->doEditContent( $content, 'edit page' );
                        $revisions[] = $page->getLatest();
@@ -59,7 +59,7 @@ class DifferenceEngineTest extends MediaWikiTestCase {
        public function testMapDiffPrevNext() {
                $cases = $this->getMapDiffPrevNextCases();
 
-               foreach( $cases as $case ) {
+               foreach ( $cases as $case ) {
                        list( $expected, $old, $new, $message ) = $case;
 
                        $diffEngine = new DifferenceEngine( $this->context, $old, $new, 2, true, false );
@@ -81,7 +81,7 @@ class DifferenceEngineTest extends MediaWikiTestCase {
        public function testLoadRevisionData() {
                $cases = $this->getLoadRevisionDataCases();
 
-               foreach( $cases as $case ) {
+               foreach ( $cases as $case ) {
                        list( $expectedOld, $expectedNew, $old, $new, $message ) = $case;
 
                        $diffEngine = new DifferenceEngine( $this->context, $old, $new, 2, true, false );
index 7926000..7bc785e 100644 (file)
@@ -25,4 +25,4 @@ class FakeDimensionFile extends File {
        public function getPath() {
                return '';
        }
-}
\ No newline at end of file
+}
index 6ff928e..a4f71db 100644 (file)
@@ -65,20 +65,20 @@ class FormatMetadataTest extends MediaWikiTestCase {
 
        public static function provideFlattenArray() {
                return array(
-                       array (
-                               array(1 ,2 ,3), 'ul', false, false,
+                       array(
+                               array( 1, 2, 3 ), 'ul', false, false,
                                "<ul><li>1</li>\n<li>2</li>\n<li>3</li></ul>",
                        ),
-                       array (
-                               array(1 ,2 ,3), 'ol', false, false,
+                       array(
+                               array( 1, 2, 3 ), 'ol', false, false,
                                "<ol><li>1</li>\n<li>2</li>\n<li>3</li></ol>",
                        ),
-                       array (
-                               array(1 ,2 ,3), 'ul', true, false,
+                       array(
+                               array( 1, 2, 3 ), 'ul', true, false,
                                "\n*1\n*2\n*3",
                        ),
-                       array (
-                               array(1 ,2 ,3), 'ol', true, false,
+                       array(
+                               array( 1, 2, 3 ), 'ol', true, false,
                                "\n#1\n#2\n#3",
                        ),
                        // TODO: more test cases
index 57a88b9..d2ab4d3 100644 (file)
@@ -41,4 +41,4 @@ class TidyTest extends MediaWikiTestCase {
                        array( "<meta foo=\"bar\" />\nfoo", '<meta foo="bar"/>foo', '<meta> should survive tidy' ),
                );
        }
-}
\ No newline at end of file
+}
index 733368d..d8b90d5 100644 (file)
@@ -90,6 +90,6 @@ class AutoLoaderTest extends MediaWikiTestCase {
                $dummyCereal = 'O:29:"testautoloadedserializedclass":0:{}';
                $uncerealized = unserialize( $dummyCereal );
                $this->assertFalse( $uncerealized instanceof __PHP_Incomplete_Class,
-                       "unserialize() can load classes case-insensitively.");
+                       "unserialize() can load classes case-insensitively." );
        }
 }
index be362e2..90cd546 100644 (file)
@@ -554,7 +554,7 @@ QUnit.test( 'formatnum', formatnumTests.length, function ( assert ) {
                                return;
                        }
                        mw.messages.set(test.message );
-                       mw.config.set( 'wgUserLanguage', test.lang ) ;
+                       mw.config.set( 'wgUserLanguage', test.lang );
                        var parser = new mw.jqueryMsg.parser( { language: langClass } );
                        assert.equal(
                                parser.parse( test.integer ? 'formatnum-msg-int' : 'formatnum-msg',