Fix whitespace issues around parentheses
authorVivek Ghaisas <v.a.ghaisas@gmail.com>
Tue, 16 Jun 2015 19:06:19 +0000 (22:06 +0300)
committerVivek Ghaisas <v.a.ghaisas@gmail.com>
Tue, 16 Jun 2015 19:14:02 +0000 (22:14 +0300)
Fix issues found by MediaWiki.WhiteSpace.SpaceyParenthesis sniff.

Bug: T102617
Change-Id: Iec7f71e64081659fba373ec20d9d2006306a98f4

53 files changed:
docs/doxygen_first_page.php
includes/AjaxResponse.php
includes/Block.php
includes/CategoryViewer.php
includes/GlobalFunctions.php
includes/Setup.php
includes/StreamFile.php
includes/api/ApiEditPage.php
includes/api/ApiExpandTemplates.php
includes/api/ApiParse.php
includes/api/ApiQuerySearch.php
includes/debug/logger/LegacyLogger.php
includes/diff/DifferenceEngine.php
includes/installer/MssqlUpdater.php
includes/json/FormatJson.php
includes/media/XMP.php
includes/parser/Parser.php
includes/profiler/ProfilerFunctions.php
includes/search/SearchHighlighter.php
includes/specialpage/QueryPage.php
includes/specials/SpecialJavaScriptTest.php
includes/specials/SpecialMediaStatistics.php
includes/specials/SpecialUserrights.php
languages/Language.php
languages/classes/LanguageEo.php
languages/classes/LanguageFi.php
languages/classes/LanguageKsh.php
maintenance/convertExtensionToRegistration.php
maintenance/validateRegistrationFile.php
tests/phpunit/includes/LinkFilterTest.php
tests/phpunit/includes/MovePageTest.php
tests/phpunit/includes/OutputPageTest.php
tests/phpunit/includes/StatusTest.php
tests/phpunit/includes/TitleTest.php
tests/phpunit/includes/api/ApiBlockTest.php
tests/phpunit/includes/api/ApiEditPageTest.php
tests/phpunit/includes/api/ApiUnblockTest.php
tests/phpunit/includes/config/HashConfigTest.php
tests/phpunit/includes/content/JsonContentTest.php
tests/phpunit/includes/db/DatabaseMysqlBaseTest.php
tests/phpunit/includes/diff/ArrayDiffFormatterTest.php
tests/phpunit/includes/exception/MWExceptionTest.php
tests/phpunit/includes/libs/ArrayUtilsTest.php
tests/phpunit/includes/libs/XhprofTest.php
tests/phpunit/includes/objectcache/WANObjectCacheTest.php
tests/phpunit/includes/resourceloader/ResourceLoaderFileModuleTest.php
tests/phpunit/includes/resourceloader/ResourceLoaderTest.php
tests/phpunit/includes/title/ForeignTitleTest.php
tests/phpunit/includes/title/MediaWikiPageLinkRendererTest.php
tests/phpunit/languages/classes/LanguageArqTest.php
tests/phpunit/maintenance/backupTextPassTest.php
tests/testHelpers.inc
thumb.php

index 9949d13..77ae1dc 100644 (file)
@@ -1,5 +1,5 @@
 <?php
-die("Not a valid entry point\n");
+die( "Not a valid entry point\n" );
 /**
  * This file does not hold any code. It is only there so we can generate
  * the doxygen documentation main page.
index 2984c33..6c2efc2 100644 (file)
@@ -166,12 +166,12 @@ class AjaxResponse {
                        HttpStatus::header( $n );
                }
 
-               header ( "Content-Type: " . $this->mContentType );
+               header( "Content-Type: " . $this->mContentType );
 
                if ( $this->mLastModified ) {
-                       header ( "Last-Modified: " . $this->mLastModified );
+                       header( "Last-Modified: " . $this->mLastModified );
                } else {
-                       header ( "Last-Modified: " . gmdate( "D, d M Y H:i:s" ) . " GMT" );
+                       header( "Last-Modified: " . gmdate( "D, d M Y H:i:s" ) . " GMT" );
                }
 
                if ( $this->mCacheDuration ) {
@@ -193,20 +193,20 @@ class AjaxResponse {
 
                        } else {
                                # Let the client do the caching. Cache is not purged.
-                               header ( "Expires: " . gmdate( "D, d M Y H:i:s", time() + $this->mCacheDuration ) . " GMT" );
-                               header ( "Cache-Control: s-maxage={$this->mCacheDuration}," .
+                               header( "Expires: " . gmdate( "D, d M Y H:i:s", time() + $this->mCacheDuration ) . " GMT" );
+                               header( "Cache-Control: s-maxage={$this->mCacheDuration}," .
                                        "public,max-age={$this->mCacheDuration}" );
                        }
 
                } else {
                        # always expired, always modified
-                       header ( "Expires: Mon, 26 Jul 1997 05:00:00 GMT" );    // Date in the past
-                       header ( "Cache-Control: no-cache, must-revalidate" );  // HTTP/1.1
-                       header ( "Pragma: no-cache" );                          // HTTP/1.0
+                       header( "Expires: Mon, 26 Jul 1997 05:00:00 GMT" );    // Date in the past
+                       header( "Cache-Control: no-cache, must-revalidate" );  // HTTP/1.1
+                       header( "Pragma: no-cache" );                          // HTTP/1.0
                }
 
                if ( $this->mVary ) {
-                       header ( "Vary: " . $this->mVary );
+                       header( "Vary: " . $this->mVary );
                }
        }
 
index d582201..85cfe59 100644 (file)
@@ -1109,7 +1109,7 @@ class Block {
                $blocks = array();
                foreach ( $rows as $row ) {
                        $block = self::newFromRow( $row );
-                       if ( !$block->deleteIfExpired()  ) {
+                       if ( !$block->deleteIfExpired() ) {
                                $blocks[] = $block;
                        }
                }
index 66079c0..e2c31a6 100644 (file)
@@ -329,7 +329,7 @@ class CategoryViewer extends ContextSource {
                                        'category' => array( 'LEFT JOIN', array(
                                                'cat_title = page_title',
                                                'page_namespace' => NS_CATEGORY
-                                       ))
+                                       ) )
                                )
                        );
 
index 7a9b27b..e2e0666 100644 (file)
@@ -1756,7 +1756,7 @@ function wfMsgExt( $key, $options ) {
        }
 
        if ( in_array( 'escape', $options, true ) ) {
-               $string = htmlspecialchars ( $string );
+               $string = htmlspecialchars( $string );
        } elseif ( in_array( 'escapenoentities', $options, true ) ) {
                $string = Sanitizer::escapeHtmlAllowEntities( $string );
        }
@@ -2758,7 +2758,7 @@ function wfShellExec( $cmd, &$retval = null, $environ = array(),
 
        $useLogPipe = false;
        if ( is_executable( '/bin/bash' ) ) {
-               $time = intval ( isset( $limits['time'] ) ? $limits['time'] : $wgMaxShellTime );
+               $time = intval( isset( $limits['time'] ) ? $limits['time'] : $wgMaxShellTime );
                if ( isset( $limits['walltime'] ) ) {
                        $wallTime = intval( $limits['walltime'] );
                } elseif ( isset( $limits['time'] ) ) {
@@ -2766,8 +2766,8 @@ function wfShellExec( $cmd, &$retval = null, $environ = array(),
                } else {
                        $wallTime = intval( $wgMaxShellWallClockTime );
                }
-               $mem = intval ( isset( $limits['memory'] ) ? $limits['memory'] : $wgMaxShellMemory );
-               $filesize = intval ( isset( $limits['filesize'] ) ? $limits['filesize'] : $wgMaxShellFileSize );
+               $mem = intval( isset( $limits['memory'] ) ? $limits['memory'] : $wgMaxShellMemory );
+               $filesize = intval( isset( $limits['filesize'] ) ? $limits['filesize'] : $wgMaxShellFileSize );
 
                if ( $time > 0 || $mem > 0 || $filesize > 0 || $wallTime > 0 ) {
                        $cmd = '/bin/bash ' . escapeshellarg( "$IP/includes/limit.sh" ) . ' ' .
index 8462f68..2fa9de1 100644 (file)
@@ -369,7 +369,7 @@ if ( $wgResourceLoaderMaxQueryLength === false ) {
        } else {
                $wgResourceLoaderMaxQueryLength = 2000;
        }
-       unset($suhosinMaxValueLength);
+       unset( $suhosinMaxValueLength );
 }
 
 /**
@@ -429,7 +429,7 @@ if ( !$wgHtml5Version && $wgAllowRdfaAttributes ) {
 }
 
 // Blacklisted file extensions shouldn't appear on the "allowed" list
-$wgFileExtensions = array_values( array_diff ( $wgFileExtensions, $wgFileBlacklist ) );
+$wgFileExtensions = array_values( array_diff( $wgFileExtensions, $wgFileBlacklist ) );
 
 if ( $wgInvalidateCacheOnLocalSettingsChange ) {
        MediaWiki\suppressWarnings();
index bac4db6..3f73ae3 100644 (file)
@@ -78,7 +78,7 @@ class StreamFile {
        ) {
                if ( !is_array( $info ) ) {
                        if ( $sendErrors ) {
-                               HttpStatus::header( 404  );
+                               HttpStatus::header( 404 );
                                header( 'Cache-Control: no-cache' );
                                header( 'Content-Type: text/html; charset=utf-8' );
                                $encFile = htmlspecialchars( $path );
index aad71b9..6189f68 100644 (file)
@@ -246,7 +246,7 @@ class ApiEditPage extends ApiBase {
                                $titleObj->getNextRevisionID( $undoafterRev->getID() ) == $params['undo']
                        ) {
                                $params['summary'] = wfMessage( 'undo-summary' )
-                                       ->params ( $params['undo'], $undoRev->getUserText() )->inContentLanguage()->text();
+                                       ->params( $params['undo'], $undoRev->getUserText() )->inContentLanguage()->text();
                        }
                }
 
index 966af53..6112534 100644 (file)
@@ -162,7 +162,7 @@ class ApiExpandTemplates extends ApiBase {
                                        !isset( $prop['jsconfigvars'] ) && !isset( $prop['encodedjsconfigvars'] ) ) {
                                        $this->setWarning( "Property 'modules' was set but not 'jsconfigvars' " .
                                                "or 'encodedjsconfigvars'. Configuration variables are necessary " .
-                                               "for proper module usage.");
+                                               "for proper module usage." );
                                }
                        }
                }
index 1833434..fa6f30e 100644 (file)
@@ -376,7 +376,7 @@ class ApiParse extends ApiBase {
                        !isset( $prop['jsconfigvars'] ) && !isset( $prop['encodedjsconfigvars'] ) ) {
                        $this->setWarning( "Property 'modules' was set but not 'jsconfigvars' " .
                                "or 'encodedjsconfigvars'. Configuration variables are necessary " .
-                               "for proper module usage.");
+                               "for proper module usage." );
                }
 
                if ( isset( $prop['indicators'] ) ) {
index 90af15a..349e7fa 100644 (file)
@@ -238,7 +238,7 @@ class ApiQuerySearch extends ApiQueryGeneratorBase {
 
                                                // Add item to results and see whether it fits
                                                $fit = $apiResult->addValue(
-                                                       array( 'query', 'interwiki' . $this->getModuleName(), $result->getInterwikiPrefix()  ),
+                                                       array( 'query', 'interwiki' . $this->getModuleName(), $result->getInterwikiPrefix() ),
                                                        null,
                                                        $vals
                                                );
index 71fc328..6bd6411 100644 (file)
@@ -181,7 +181,7 @@ class LegacyLogger extends AbstractLogger {
                } elseif ( $channel === 'profileoutput' ) {
                        // Legacy wfLogProfilingData formatitng
                        $forward = '';
-                       if ( isset( $context['forwarded_for'] )) {
+                       if ( isset( $context['forwarded_for'] ) ) {
                                $forward = " forwarded for {$context['forwarded_for']}";
                        }
                        if ( isset( $context['client_ip'] ) ) {
index 07a0522..ac29ae0 100644 (file)
@@ -1040,7 +1040,7 @@ class DifferenceEngine extends ContextSource {
                        $key = $title->quickUserCan( 'edit', $user ) ? 'editold' : 'viewsourceold';
                        $msg = $this->msg( $key )->escaped();
                        $editLink = $this->msg( 'parentheses' )->rawParams(
-                               Linker::linkKnown( $title, $msg, array( ), $editQuery ) )->escaped();
+                               Linker::linkKnown( $title, $msg, array(), $editQuery ) )->escaped();
                        $header .= ' ' . Html::rawElement(
                                'span',
                                array( 'class' => 'mw-diff-edit' ),
index 5eef335..164cfab 100644 (file)
@@ -41,7 +41,7 @@ class MssqlUpdater extends DatabaseUpdater {
                        array( 'addField', 'mwuser', 'user_password_expires', 'patch-user_password_expires.sql' ),
 
                        // 1.24
-                       array( 'addField', 'page', 'page_lang', 'patch-page-page_lang.sql'),
+                       array( 'addField', 'page', 'page_lang', 'patch-page-page_lang.sql' ),
 
                        // 1.25
                        array( 'dropTable', 'hitcounter' ),
index 095811f..f85ee92 100644 (file)
@@ -380,7 +380,7 @@ class FormatJson {
                $inComment = false;
                $multiline = false;
 
-               for ($idx = 0; $idx < $maxLen; $idx++) {
+               for ( $idx = 0; $idx < $maxLen; $idx++ ) {
                        switch ( $str[$idx] ) {
                                case '"':
                                        $lookBehind = ( $idx - 1 >= 0 ) ? $str[$idx - 1] : '';
index 3fb86ba..b9d0ae5 100644 (file)
@@ -415,7 +415,7 @@ class XMPReader implements LoggerAwareInterface {
                $len = unpack( 'Nlength/Noffset', substr( $content, 32, 8 ) );
 
                if ( !$len || $len['length'] < 4 || $len['offset'] < 0 || $len['offset'] > $len['length'] ) {
-                       $this->logger->info(  __METHOD__ . 'Error reading extended XMP block, invalid length or offset.' );
+                       $this->logger->info( __METHOD__ . 'Error reading extended XMP block, invalid length or offset.' );
 
                        return false;
                }
index 928c3a8..432e12a 100644 (file)
@@ -1438,7 +1438,7 @@ class Parser {
                                '-' => '',
                                ' ' => '',
                                'x' => 'X',
-                       ));
+                       ) );
                        $titleObj = SpecialPage::getTitleFor( 'Booksources', $num );
                        return '<a href="' .
                                htmlspecialchars( $titleObj->getLocalURL() ) .
@@ -1481,7 +1481,7 @@ class Parser {
                # Don't break a trailing HTML entity by moving the ; into $trail
                # This is in hot code, so use substr_compare to avoid having to
                # create a new string object for the comparison
-               if ( $numSepChars && substr_compare( $url, ";", -$numSepChars, 1 ) === 0) {
+               if ( $numSepChars && substr_compare( $url, ";", -$numSepChars, 1 ) === 0 ) {
                        # more optimization: instead of running preg_match with a $
                        # anchor, which can be slow, do the match on the reversed
                        # string starting at the desired offset.
index 4984e77..6c58453 100644 (file)
@@ -32,7 +32,7 @@
 function wfGetRusage() {
        if ( !function_exists( 'getrusage' ) ) {
                return false;
-       } elseif ( defined ( 'HHVM_VERSION' ) ) {
+       } elseif ( defined( 'HHVM_VERSION' ) ) {
                return getrusage( 2 /* RUSAGE_THREAD */ );
        } else {
                return getrusage( 0 /* RUSAGE_SELF */ );
index 5087e8d..7d5d38f 100644 (file)
@@ -218,7 +218,7 @@ class SearchHighlighter {
                        }
 
                        // calc by how much to extend existing snippets
-                       $targetchars = intval( ( $contextchars * $contextlines ) / count ( $snippets ) );
+                       $targetchars = intval( ( $contextchars * $contextlines ) / count( $snippets ) );
                }
 
                foreach ( $snippets as $index => $line ) {
index 92409cd..bd3b55b 100644 (file)
@@ -70,7 +70,7 @@ abstract class QueryPage extends SpecialPage {
                                array( 'DeadendPagesPage', 'Deadendpages' ),
                                array( 'DoubleRedirectsPage', 'DoubleRedirects' ),
                                array( 'FileDuplicateSearchPage', 'FileDuplicateSearch' ),
-                               array( 'ListDuplicatedFilesPage', 'ListDuplicatedFiles'),
+                               array( 'ListDuplicatedFilesPage', 'ListDuplicatedFiles' ),
                                array( 'LinkSearchPage', 'LinkSearch' ),
                                array( 'ListredirectsPage', 'Listredirects' ),
                                array( 'LonelyPagesPage', 'Lonelypages' ),
index e9639e1..d330b0e 100644 (file)
@@ -229,7 +229,7 @@ HTML;
                // writes a script tag (the one loading mediawiki.js). Script tags are synchronous, block
                // each other, and run in order. But they don't nest. The code appended after the startup
                // module runs before the added script tag is parsed and executed.
-               echo Xml::encodeJsCall( 'document.write', array( Html::inlineScript( $code  ) ) );
+               echo Xml::encodeJsCall( 'document.write', array( Html::inlineScript( $code ) ) );
        }
 
        private function plainQUnit() {
index 8f14a41..7a7979c 100644 (file)
@@ -236,7 +236,7 @@ class MediaStatisticsPage extends QueryPage {
                                        'mw-mediastats-table-' . strtolower( $mediaType ),
                                        'sortable',
                                        'wikitable'
-                               ))
+                               ) )
                        )
                );
                $this->getOutput()->addHTML( $this->getTableHeaderRow() );
@@ -275,7 +275,7 @@ class MediaStatisticsPage extends QueryPage {
                                array( 'class' => array(
                                        'mw-mediastats-mediatype',
                                        'mw-mediastats-mediatype-' . strtolower( $mediaType )
-                               )),
+                               ) ),
                                // for grep
                                // mediastatistics-header-unknown, mediastatistics-header-bitmap,
                                // mediastatistics-header-drawing, mediastatistics-header-audio,
index 758e3c0..ab53951 100644 (file)
@@ -249,7 +249,7 @@ class UserrightsPage extends SpecialPage {
                if ( $remove ) {
                        foreach ( $remove as $index => $group ) {
                                if ( !$user->removeGroup( $group ) ) {
-                                       unset($remove[$index]);
+                                       unset( $remove[$index] );
                                }
                        }
                        $newGroups = array_diff( $newGroups, $remove );
@@ -257,7 +257,7 @@ class UserrightsPage extends SpecialPage {
                if ( $add ) {
                        foreach ( $add as $index => $group ) {
                                if ( !$user->addGroup( $group ) ) {
-                                       unset($add[$index]);
+                                       unset( $add[$index] );
                                }
                        }
                        $newGroups = array_merge( $newGroups, $add );
index 0a61be6..b1d88bc 100644 (file)
@@ -1336,7 +1336,7 @@ class Language {
                                case 'xmn':
                                        $usedHijriMonth = true;
                                        if ( !$hijri ) {
-                                               $hijri = self::tsToHijri ( $ts );
+                                               $hijri = self::tsToHijri( $ts );
                                        }
                                        $num = $hijri[1];
                                        break;
@@ -3444,7 +3444,7 @@ class Language {
                                // the string does not have any number part. Eg: .12345
                                return $sign . $groupedNumber;
                        }
-                       $start = $end = ($integerPart) ? strlen( $integerPart[0] ) : 0;
+                       $start = $end = ( $integerPart ) ? strlen( $integerPart[0] ) : 0;
                        while ( $start > 0 ) {
                                $match = $matches[0][$numMatches - 1];
                                $matchLen = strlen( $match );
index 15fc8c0..1b7dbfa 100644 (file)
@@ -61,7 +61,7 @@ class LanguageEo extends Language {
         */
        function iconv( $in, $out, $string ) {
                if ( strcasecmp( $in, 'x' ) == 0 && strcasecmp( $out, 'utf-8' ) == 0 ) {
-                       return preg_replace_callback (
+                       return preg_replace_callback(
                                '/([cghjsu]x?)((?:xx)*)(?!x)/i',
                                array( $this, 'strrtxuCallback' ), $string );
                } elseif ( strcasecmp( $in, 'UTF-8' ) == 0 && strcasecmp( $out, 'x' ) == 0 ) {
index 2379cac..a96b0a9 100644 (file)
@@ -149,10 +149,10 @@ class LanguageFi extends Language {
                );
 
                $final = '';
-               $tokens = explode ( ' ', $str );
+               $tokens = explode( ' ', $str );
                foreach ( $tokens as $item ) {
                        if ( !is_numeric( $item ) ) {
-                               if ( count ( explode( '-', $item ) ) == 3 && strlen( $item ) == 10 ) {
+                               if ( count( explode( '-', $item ) ) == 3 && strlen( $item ) == 10 ) {
                                        list( $yyyy, $mm, $dd ) = explode( '-', $item );
                                        $final .= ' ' . $this->date( "{$yyyy}{$mm}{$dd}000000" );
                                        continue;
index 6b6c95d..ddd866f 100644 (file)
@@ -91,7 +91,7 @@ class LanguageKsh extends Language {
        function convertGrammar( $word, $case ) {
                $lord = strtolower( $word );
                $gender = 'm'; // Nuutnaarel // default
-               if ( preg_match ( '/wiki$/', $lord ) ) {
+               if ( preg_match( '/wiki$/', $lord ) ) {
                        $gender = 'n';  // Dat xyz-wiki
                }
                if ( isset( self::$familygender[$lord] ) ) {
index 8adae2d..ce95e3a 100644 (file)
@@ -182,7 +182,7 @@ class ConvertExtensionToRegistration extends Maintenance {
                $this->json[$realName] = $out;
        }
 
-       protected function handleCredits( $realName, $value) {
+       protected function handleCredits( $realName, $value ) {
                $keys = array_keys( $value );
                $this->json['type'] = $keys[0];
                $values = array_values( $value );
index 08af11a..9cf7b2b 100644 (file)
@@ -18,7 +18,7 @@ class ValidateRegistrationFile extends Maintenance {
                        $this->error( "$path is not a valid JSON file.", 1 );
                }
                if ( !isset( $data->manifest_version ) ) {
-                       $this->output("Warning: No manifest_version set, assuming 1.\n" );
+                       $this->output( "Warning: No manifest_version set, assuming 1.\n" );
                        // For backwards-compatability assume 1
                        $data->manifest_version = 1;
                }
@@ -39,7 +39,7 @@ class ValidateRegistrationFile extends Maintenance {
                                . ExtensionRegistry::MANIFEST_VERSION . "\n" );
                }
                $retriever = new JsonSchema\Uri\UriRetriever();
-               $schema = $retriever->retrieve('file://' . $schemaPath );
+               $schema = $retriever->retrieve( 'file://' . $schemaPath );
 
                $validator = new JsonSchema\Validator();
                $validator->check( $data, $schema );
index f2c9cb4..6808105 100644 (file)
@@ -76,7 +76,7 @@ class LinkFilterTest extends MediaWikiLangTestCase {
                        array( 'https://', '*.com', 'https://name:pass@secure.com/index.html' ),
                        array( 'http://', 'name:pass@test.com', 'http://test.com' ),
                        array( 'http://', 'test.com', 'http://name:pass@test.com' ),
-                       array( 'http://', '*.test.com', 'http://a.b.c.test.com/dir/dir/file?a=6'),
+                       array( 'http://', '*.test.com', 'http://a.b.c.test.com/dir/dir/file?a=6' ),
                        array( null, 'http://*.test.com', 'http://www.test.com' ),
                        array( 'mailto:', 'name@mail.test123.com', 'mailto:name@mail.test123.com' ),
                        array( '',
@@ -122,8 +122,8 @@ class LinkFilterTest extends MediaWikiLangTestCase {
                        array( '', 'git://github.com/prwef/abc-def.git', 'git://github.com/prwef/abc-def.git' ),
                        array( 'git://', 'github.com/', 'git://github.com/prwef/abc-def.git' ),
                        array( 'git://', '*.github.com/', 'git://a.b.c.d.e.f.github.com/prwef/abc-def.git' ),
-                       array( '', 'gopher://*.test.com/', 'gopher://gopher.test.com/0/v2/vstat'),
-                       array( 'telnet://', '*.test.com', 'telnet://shell.test.com/~home/'),
+                       array( '', 'gopher://*.test.com/', 'gopher://gopher.test.com/0/v2/vstat' ),
+                       array( 'telnet://', '*.test.com', 'telnet://shell.test.com/~home/' ),
 
                        //
                        // The following only work in PHP >= 5.3.7, due to a bug in parse_url which eats
@@ -243,10 +243,10 @@ class LinkFilterTest extends MediaWikiLangTestCase {
                        array( 'http://*.test.*' ),
                        array( 'http://*test.com' ),
                        array( 'https://*' ),
-                       array( '*://test.com'),
+                       array( '*://test.com' ),
                        array( 'mailto:name:pass@t*est.com' ),
-                       array( 'http://*:888/'),
-                       array( '*http://'),
+                       array( 'http://*:888/' ),
+                       array( '*http://' ),
                        array( 'test.com/*/index' ),
                        array( 'test.com/dir/index?arg=*' ),
                );
index 9501e45..0ef2fa6 100644 (file)
@@ -57,7 +57,7 @@ class MovePageTest extends MediaWikiTestCase {
                        WikiPage::factory( $oldTitle )->getRevision()
                );
                $this->assertNotNull(
-                       WikiPage::factory( $newTitle)->getRevision()
+                       WikiPage::factory( $newTitle )->getRevision()
                );
        }
 }
index 6c6d95e..7dddf77 100644 (file)
@@ -244,36 +244,36 @@ document.write("\u003Cscript src=\"http://127.0.0.1:8080/w/load.php?debug=false\
                        'test.foo' => new ResourceLoaderTestModule( array(
                                'script' => 'mw.test.foo( { a: true } );',
                                'styles' => '.mw-test-foo { content: "style"; }',
-                       )),
+                       ) ),
                        'test.bar' => new ResourceLoaderTestModule( array(
                                'script' => 'mw.test.bar( { a: true } );',
                                'styles' => '.mw-test-bar { content: "style"; }',
-                       )),
+                       ) ),
                        'test.baz' => new ResourceLoaderTestModule( array(
                                'script' => 'mw.test.baz( { a: true } );',
                                'styles' => '.mw-test-baz { content: "style"; }',
-                       )),
+                       ) ),
                        'test.quux' => new ResourceLoaderTestModule( array(
                                'script' => 'mw.test.baz( { token: 123 } );',
                                'styles' => '/* pref-animate=off */ .mw-icon { transition: none; }',
                                'group' => 'private',
-                       )),
+                       ) ),
                        'test.raw' => new ResourceLoaderTestModule( array(
                                'script' => 'mw.test.baz( { token: 123 } );',
                                'isRaw' => true,
-                       )),
+                       ) ),
                        'test.noscript' => new ResourceLoaderTestModule( array(
                                'styles' => '.mw-test-noscript { content: "style"; }',
                                'group' => 'noscript',
-                       )),
+                       ) ),
                        'test.group.bar' => new ResourceLoaderTestModule( array(
                                'styles' => '.mw-group-bar { content: "style"; }',
                                'group' => 'bar',
-                       )),
+                       ) ),
                        'test.group.foo' => new ResourceLoaderTestModule( array(
                                'styles' => '.mw-group-foo { content: "style"; }',
                                'group' => 'foo',
-                       )),
+                       ) ),
                ) );
                $links = $method->invokeArgs( $out, $args );
                // Strip comments to avoid variation due to wgDBname in WikiID and cache key
@@ -286,19 +286,19 @@ document.write("\u003Cscript src=\"http://127.0.0.1:8080/w/load.php?debug=false\
  * MessageBlobStore that doesn't do anything
  */
 class NullMessageBlobStore extends MessageBlobStore {
-       public function get ( ResourceLoader $resourceLoader, $modules, $lang ) {
+       public function get( ResourceLoader $resourceLoader, $modules, $lang ) {
                return array();
        }
 
-       public function insertMessageBlob ( $name, ResourceLoaderModule $module, $lang ) {
+       public function insertMessageBlob( $name, ResourceLoaderModule $module, $lang ) {
                return false;
        }
 
-       public function updateModule ( $name, ResourceLoaderModule $module, $lang ) {
+       public function updateModule( $name, ResourceLoaderModule $module, $lang ) {
                return;
        }
 
-       public function updateMessage ( $key ) {
+       public function updateMessage( $key ) {
        }
        public function clear() {
        }
index c013f4f..291ed31 100644 (file)
@@ -372,7 +372,7 @@ class StatusTest extends MediaWikiLangTestCase {
                );
 
                $status = new Status();
-               $status->warning( new Message( 'fooBar!', array( 'foo', 'bar' )  ) );
+               $status->warning( new Message( 'fooBar!', array( 'foo', 'bar' ) ) );
                $testCases['1MessageWarning'] = array(
                        $status,
                        "<fooBar!>",
@@ -449,7 +449,7 @@ class StatusTest extends MediaWikiLangTestCase {
 //             );
 
                $status = new Status();
-               $status->warning( new Message( 'fooBar!', array( 'foo', 'bar' )  ) );
+               $status->warning( new Message( 'fooBar!', array( 'foo', 'bar' ) ) );
                $testCases['1MessageWarning'] = array(
                        $status,
                        array( 'foo', 'bar' ),
index a8cffd1..a2c6f23 100644 (file)
@@ -145,7 +145,7 @@ class TitleTest extends MediaWikiTestCase {
                                        }
                                )
                        )
-               ));
+               ) );
        }
 
        /**
index d98eec6..880572b 100644 (file)
@@ -68,7 +68,7 @@ class ApiBlockTest extends ApiTestCase {
         * @expectedException UsageException
         * @expectedExceptionMessage The token parameter must be set
         */
-       public function testBlockingActionWithNoToken( ) {
+       public function testBlockingActionWithNoToken() {
                $this->doApiRequest(
                        array(
                                'action' => 'block',
index 865f1c2..fa528da 100644 (file)
@@ -218,7 +218,7 @@ class ApiEditPageTest extends ApiTestCase {
                        'section' => 'new',
                        'text' => 'test',
                        'summary' => 'header',
-               ));
+               ) );
 
                $this->assertEquals( 'Success', $re['edit']['result'] );
                // Check the page text is correct
@@ -235,7 +235,7 @@ class ApiEditPageTest extends ApiTestCase {
                        'section' => 'new',
                        'text' => 'test',
                        'summary' => 'header',
-               ));
+               ) );
 
                $this->assertEquals( 'Success', $re2['edit']['result'] );
                $text = WikiPage::factory( Title::newFromText( $name ) )
index 2c2370a..e9dff9f 100644 (file)
@@ -16,7 +16,7 @@ class ApiUnblockTest extends ApiTestCase {
        /**
         * @expectedException UsageException
         */
-       public function testWithNoToken( ) {
+       public function testWithNoToken() {
                $this->doApiRequest(
                        array(
                                'action' => 'unblock',
index 06973b0..4aa3e30 100644 (file)
@@ -30,7 +30,7 @@ class HashConfigTest extends MediaWikiTestCase {
        public function testGet() {
                $conf = new HashConfig( array(
                        'one' => '1',
-               ));
+               ) );
                $this->assertEquals( '1', $conf->get( 'one' ) );
                $this->setExpectedException( 'ConfigException', 'HashConfig::get: undefined option' );
                $conf->get( 'two' );
index cccfe7b..8a9d2ab 100644 (file)
@@ -138,7 +138,7 @@ class JsonContentTest extends MediaWikiLangTestCase {
                                '<tr><th>0</th><td class="value">"bar"</td></tr></tbody></table>'
                        ),
                        array(
-                               (object)array( '<script>alert("evil!")</script>'),
+                               (object)array( '<script>alert("evil!")</script>' ),
                                '<table class="mw-json"><tbody><tr><th>0</th><td class="value">"' .
                                '&lt;script>alert("evil!")&lt;/script>"' .
                                '</td></tr></tbody></table>',
index b4292a6..42ea58e 100644 (file)
@@ -181,7 +181,7 @@ class DatabaseMysqlBaseTest extends MediaWikiTestCase {
                                array( 'Tables_in_' => 'view2' ),
                                array( 'Tables_in_' => 'myview' ),
                                false  # no more rows
-                       ));
+                       ) );
                return $db;
        }
        /**
index 3bea9b3..a546bec 100644 (file)
@@ -69,11 +69,11 @@ class ArrayDiffFormatterTest extends MediaWikiTestCase {
 
                $otherTestCases = array();
                $otherTestCases[] = array(
-                       $this->getMockDiff( array( $this->getMockDiffOp( 'add', array( ), array( 'a1' ) ) ) ),
+                       $this->getMockDiff( array( $this->getMockDiffOp( 'add', array(), array( 'a1' ) ) ) ),
                        array( array( 'action' => 'add', 'new' => 'a1', 'newline' => 1 ) ),
                );
                $otherTestCases[] = array(
-                       $this->getMockDiff( array( $this->getMockDiffOp( 'add', array( ), array( 'a1', 'a2' ) ) ) ),
+                       $this->getMockDiff( array( $this->getMockDiffOp( 'add', array(), array( 'a1', 'a2' ) ) ) ),
                        array(
                                array( 'action' => 'add', 'new' => 'a1', 'newline' => 1 ),
                                array( 'action' => 'add', 'new' => 'a2', 'newline' => 2 ),
index ef0f2a9..f11fda3 100644 (file)
@@ -178,7 +178,7 @@ class MWExceptionTest extends MediaWikiTestCase {
                $this->setMwGlobals( array( 'wgLogExceptionBacktrace' => true ) );
 
                $json = json_decode(
-                       MWExceptionHandler::jsonSerializeException( new $exClass())
+                       MWExceptionHandler::jsonSerializeException( new $exClass() )
                );
                $this->assertObjectHasAttribute( $key, $json,
                        "JSON serialized exception is missing key '$key'"
index a91cc95..32b150c 100644 (file)
@@ -212,7 +212,7 @@ class ArrayUtilsTest extends PHPUnit_Framework_TestCase {
                                array(),
                                array( 1 => 1 ),
                                array( 1 ),
-                               array( 1 => 1),
+                               array( 1 => 1 ),
                        ),
                        array(
                                array(),
index 2440fc0..77b188c 100644 (file)
@@ -255,43 +255,43 @@ class XhprofTest extends PHPUnit_Framework_TestCase {
         */
        protected function getXhprofFixture( array $opts = array() ) {
                $xhprof = new Xhprof( $opts );
-               $xhprof->loadRawData( array (
-                       'foo==>bar' => array (
+               $xhprof->loadRawData( array(
+                       'foo==>bar' => array(
                                'ct' => 2,
                                'wt' => 57,
                                'cpu' => 92,
                                'mu' => 1896,
                                'pmu' => 0,
                        ),
-                       'foo==>strlen' => array (
+                       'foo==>strlen' => array(
                                'ct' => 2,
                                'wt' => 21,
                                'cpu' => 141,
                                'mu' => 752,
                                'pmu' => 0,
                        ),
-                       'bar==>bar@1' => array (
+                       'bar==>bar@1' => array(
                                'ct' => 1,
                                'wt' => 18,
                                'cpu' => 19,
                                'mu' => 752,
                                'pmu' => 0,
                        ),
-                       'main()==>foo' => array (
+                       'main()==>foo' => array(
                                'ct' => 1,
                                'wt' => 304,
                                'cpu' => 307,
                                'mu' => 4008,
                                'pmu' => 0,
                        ),
-                       'main()==>xhprof_disable' => array (
+                       'main()==>xhprof_disable' => array(
                                'ct' => 1,
                                'wt' => 8,
                                'cpu' => 10,
                                'mu' => 768,
                                'pmu' => 392,
                        ),
-                       'main()' => array (
+                       'main()' => array(
                                'ct' => 1,
                                'wt' => 353,
                                'cpu' => 351,
@@ -311,7 +311,7 @@ class XhprofTest extends PHPUnit_Framework_TestCase {
         */
        protected function assertArrayStructure( $struct, $actual, $label = null ) {
                $this->assertInternalType( 'array', $actual, $label );
-               $this->assertCount( count($struct), $actual, $label );
+               $this->assertCount( count( $struct ), $actual, $label );
                foreach ( $struct as $key => $type ) {
                        $this->assertArrayHasKey( $key, $actual );
                        $this->assertInternalType( $type, $actual[$key] );
index 284a67d..10dee83 100644 (file)
@@ -68,7 +68,7 @@ class WANObjectCacheTest extends MediaWikiTestCase {
                $key = wfRandomString();
                for ( $i=0; $i<3; ++$i ) {
                        $value = wfRandomString();
-                       $this->cache->set($key, $value, 3);
+                       $this->cache->set( $key, $value, 3 );
 
                        $this->assertEquals( $this->cache->get( $key ), $value );
                }
index 358d2a1..9d97b28 100644 (file)
@@ -158,7 +158,7 @@ class ResourceLoaderFileModuleTest extends ResourceLoaderTestCase {
         * @covers ResourceLoaderFileModule::getStyles
         * @covers ResourceLoaderFileModule::getStyleFiles
         */
-       public function testMixedCssAnnotations(  ) {
+       public function testMixedCssAnnotations() {
                $basePath = __DIR__ . '/../../data/css';
                $testModule = new ResourceLoaderFileModule( array(
                        'localBasePath' => $basePath,
index ca7307e..cc20e7f 100644 (file)
@@ -16,7 +16,7 @@ class ResourceLoaderTest extends ResourceLoaderTestCase {
                                },
                        ),
                        'wgResourceLoaderLESSImportPaths' => array(
-                               dirname( dirname( __DIR__  ) ) . '/data/less/common',
+                               dirname( dirname( __DIR__ ) ) . '/data/less/common',
                        ),
                        'wgResourceLoaderLESSVars' => array(
                                'foo'  => '2px',
index 599d2a3..10b7e28 100644 (file)
@@ -59,7 +59,7 @@ class ForeignTitleTest extends MediaWikiTestCase {
                $this->assertEquals( $expectedText, $title->getText() );
        }
 
-       public function testUnknownNamespaceCheck( ) {
+       public function testUnknownNamespaceCheck() {
                $title = new ForeignTitle( null, 'this', 'that' );
 
                $this->assertEquals( false, $title->isNamespaceIdKnown() );
@@ -67,7 +67,7 @@ class ForeignTitleTest extends MediaWikiTestCase {
                $this->assertEquals( 'that', $title->getText() );
        }
 
-       public function testUnknownNamespaceError( ) {
+       public function testUnknownNamespaceError() {
                $this->setExpectedException( 'MWException' );
                $title = new ForeignTitle( null, 'this', 'that' );
                $title->getNamespaceId();
index cd0d0b1..1e5f9d0 100644 (file)
@@ -158,7 +158,7 @@ class MediaWikiPageLinkRendererTest extends MediaWikiTestCase {
                                function ( TitleValue $title ) {
                                        return str_replace( '_', ' ', "$title" );
                                }
-                       ));
+                       ) );
 
                $renderer = new MediaWikiPageLinkRenderer( $formatter, '/' );
                $actual = $renderer->renderWikitextLink( $title, $text );
index 3fa56d7..71e0583 100644 (file)
@@ -18,7 +18,7 @@ class LanguageArqTest extends LanguageClassesTestCase {
 
        public static function provideNumber() {
                return array(
-                       array( '1.234.567', '1234567'),
+                       array( '1.234.567', '1234567' ),
                        array( '-12,89', -12.89 ),
                        );
        }
index 7fc9997..6c4839e 100644 (file)
@@ -633,7 +633,7 @@ class TextPassDumperDatabaselessTest extends MediaWikiLangTestCase {
         */
        function testBufferSizeSetting( $expected, $size, $msg ) {
                $dumper = new TextPassDumperAccessor( array( "--buffersize=" . $size ) );
-               $this->assertEquals( $expected, $dumper->getBufferSize(), $msg);
+               $this->assertEquals( $expected, $dumper->getBufferSize(), $msg );
        }
 
        /**
index 6d3ac2f..16f458b 100644 (file)
@@ -695,7 +695,7 @@ class DelayedParserTest {
         * @throws MWException
         */
        public function unleash( &$parserTest ) {
-               if ( !( $parserTest instanceof ParserTest || $parserTest instanceof NewParserTest )     ) {
+               if ( !( $parserTest instanceof ParserTest || $parserTest instanceof NewParserTest ) ) {
                        throw new MWException( __METHOD__ . " must be passed an instance of ParserTest or "
                                . "NewParserTest classes\n" );
                }
index 40f3754..c77cddc 100644 (file)
--- a/thumb.php
+++ b/thumb.php
@@ -235,7 +235,7 @@ function wfStreamThumb( array $params ) {
                $imsUnix = strtotime( $imsString );
                MediaWiki\restoreWarnings();
                if ( wfTimestamp( TS_UNIX, $img->getTimestamp() ) <= $imsUnix ) {
-                       HttpStatus::header( 304  );
+                       HttpStatus::header( 304 );
                        return;
                }
        }