From: umherirrender Date: Mon, 21 Jul 2014 12:47:42 +0000 (+0200) Subject: Fixed spacing X-Git-Tag: 1.31.0-rc.0~14771^2 X-Git-Url: http://git.cyclocoop.org/%22%20.%20generer_url_ecrire%28%22statistiques_visites%22%2C%22%22%29%20.%20%22?a=commitdiff_plain;h=4ee680a8b36a5ea9f97dbb349b45cbcbca492384;p=lhc%2Fweb%2Fwiklou.git Fixed spacing - Removed spaces after not operator (!) - Removed spaces inside array index - use tab as indent instead of spaces - Add newline at end of file - Removed spaces after casts Change-Id: I9ba17c4385fcb43d38998d45f89cf42952bc791b --- diff --git a/includes/AjaxDispatcher.php b/includes/AjaxDispatcher.php index c9ca128302..dde8467f2f 100644 --- a/includes/AjaxDispatcher.php +++ b/includes/AjaxDispatcher.php @@ -55,7 +55,7 @@ class AjaxDispatcher { $this->mode = ""; - if ( ! empty( $_GET["rs"] ) ) { + if ( !empty( $_GET["rs"] ) ) { $this->mode = "get"; } @@ -66,7 +66,7 @@ class AjaxDispatcher { switch ( $this->mode ) { case 'get': $this->func_name = isset( $_GET["rs"] ) ? $_GET["rs"] : ''; - if ( ! empty( $_GET["rsargs"] ) ) { + if ( !empty( $_GET["rsargs"] ) ) { $this->args = $_GET["rsargs"]; } else { $this->args = array(); @@ -74,7 +74,7 @@ class AjaxDispatcher { break; case 'post': $this->func_name = isset( $_POST["rs"] ) ? $_POST["rs"] : ''; - if ( ! empty( $_POST["rsargs"] ) ) { + if ( !empty( $_POST["rsargs"] ) ) { $this->args = $_POST["rsargs"]; } else { $this->args = array(); @@ -105,7 +105,7 @@ class AjaxDispatcher { wfProfileIn( __METHOD__ ); - if ( ! in_array( $this->func_name, $wgAjaxExportList ) ) { + if ( !in_array( $this->func_name, $wgAjaxExportList ) ) { wfDebug( __METHOD__ . ' Bad Request for unknown function ' . $this->func_name . "\n" ); wfHttpError( diff --git a/includes/AjaxResponse.php b/includes/AjaxResponse.php index a3808a5496..41cbd24ca7 100644 --- a/includes/AjaxResponse.php +++ b/includes/AjaxResponse.php @@ -132,7 +132,7 @@ class AjaxResponse { * @param string $text */ function addText( $text ) { - if ( ! $this->mDisabled && $text ) { + if ( !$this->mDisabled && $text ) { $this->mText .= $text; } } @@ -141,7 +141,7 @@ class AjaxResponse { * Output text */ function printText() { - if ( ! $this->mDisabled ) { + if ( !$this->mDisabled ) { print $this->mText; } } diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php index 6850734f33..8bcd56e721 100644 --- a/includes/GlobalFunctions.php +++ b/includes/GlobalFunctions.php @@ -1873,7 +1873,7 @@ function wfReportTime() { $responseTime = round( ( microtime( true ) - $wgRequestTime ) * 1000 ); $reportVars = array( 'wgBackendResponseTime' => $responseTime ); if ( $wgShowHostnames ) { - $reportVars[ 'wgHostname' ] = wfHostname(); + $reportVars['wgHostname'] = wfHostname(); } return Skin::makeVariablesScript( $reportVars ); } diff --git a/includes/HtmlFormatter.php b/includes/HtmlFormatter.php index ebced709f2..02c6c5ec27 100644 --- a/includes/HtmlFormatter.php +++ b/includes/HtmlFormatter.php @@ -237,7 +237,7 @@ class HtmlFormatter { private function fixLibXML( $html ) { wfProfileIn( __METHOD__ ); static $replacements; - if ( ! $replacements ) { + if ( !$replacements ) { // We don't include rules like '"' => '&quot;' because entities had already been // normalized by libxml. Using this function with input not sanitized by libxml is UNSAFE! $replacements = new ReplacementArray( array( diff --git a/includes/HttpFunctions.php b/includes/HttpFunctions.php index c9dd0c067f..018c8677dd 100644 --- a/includes/HttpFunctions.php +++ b/includes/HttpFunctions.php @@ -772,7 +772,7 @@ class CurlHttpRequest extends MWHttpRequest { if ( $this->followRedirects && $this->canFollowRedirects() ) { wfSuppressWarnings(); - if ( ! curl_setopt( $curlHandle, CURLOPT_FOLLOWLOCATION, true ) ) { + if ( !curl_setopt( $curlHandle, CURLOPT_FOLLOWLOCATION, true ) ) { wfDebug( __METHOD__ . ": Couldn't set CURLOPT_FOLLOWLOCATION. " . "Probably safe_mode or open_basedir is set.\n" ); // Continue the processing. If it were in curl_setopt_array, diff --git a/includes/Import.php b/includes/Import.php index 6aab157520..d86a640384 100644 --- a/includes/Import.php +++ b/includes/Import.php @@ -533,7 +533,7 @@ class WikiImporter { private function handleSiteInfo() { // Site info is useful, but not actually used for dump imports. // Includes a quick short-circuit to save performance. - if ( ! $this->mSiteInfoCallback ) { + if ( !$this->mSiteInfoCallback ) { $this->reader->next(); return true; } diff --git a/includes/Linker.php b/includes/Linker.php index 1991694036..3f31d1b440 100644 --- a/includes/Linker.php +++ b/includes/Linker.php @@ -937,7 +937,7 @@ class Linker { $query = '', $unused1 = '', $unused2 = '', $time = false ) { global $wgEnableUploads, $wgUploadMissingFileUrl, $wgUploadNavigationUrl; - if ( ! $title instanceof Title ) { + if ( !$title instanceof Title ) { return "" . htmlspecialchars( $label ); } wfProfileIn( __METHOD__ ); diff --git a/includes/OutputPage.php b/includes/OutputPage.php index fbdde64d6c..b9cd6e8b26 100644 --- a/includes/OutputPage.php +++ b/includes/OutputPage.php @@ -3582,7 +3582,7 @@ $templates $group = $module->getGroup(); // Modules in groups different than the ones listed on top (see $styles assignment) // will be placed in the "other" group - $styles[ isset( $styles[$group] ) ? $group : 'other' ][] = $name; + $styles[isset( $styles[$group] ) ? $group : 'other'][] = $name; } // We want site, private and user styles to override dynamically added diff --git a/includes/Preferences.php b/includes/Preferences.php index b4bb6de638..0cc926db8c 100644 --- a/includes/Preferences.php +++ b/includes/Preferences.php @@ -1022,7 +1022,7 @@ class Preferences { */ static function searchPreferences( $user, IContextSource $context, &$defaultPreferences ) { foreach ( MWNamespace::getValidNamespaces() as $n ) { - $defaultPreferences[ 'searchNs' . $n ] = array( + $defaultPreferences['searchNs' . $n] = array( 'type' => 'api', ); } diff --git a/includes/Setup.php b/includes/Setup.php index 040aba585f..d551e767b3 100644 --- a/includes/Setup.php +++ b/includes/Setup.php @@ -488,7 +488,7 @@ if ( !$wgHTCPRouting && $wgHTCPMulticastAddress ) { } // Back compatibility for $wgRateLimitLog deprecated with 1.23 -if ( $wgRateLimitLog && ! array_key_exists( 'ratelimit', $wgDebugLogGroups ) ) { +if ( $wgRateLimitLog && !array_key_exists( 'ratelimit', $wgDebugLogGroups ) ) { $wgDebugLogGroups['ratelimit'] = $wgRateLimitLog; } diff --git a/includes/UserMailer.php b/includes/UserMailer.php index 25be921236..913b430742 100644 --- a/includes/UserMailer.php +++ b/includes/UserMailer.php @@ -397,7 +397,7 @@ class UserMailer { if ( self::$mErrorString ) { wfDebug( "Error sending mail: " . self::$mErrorString . "\n" ); return Status::newFatal( 'php-mail-error', self::$mErrorString ); - } elseif ( ! $sent ) { + } elseif ( !$sent ) { // mail function only tells if there's an error wfDebug( "Unknown error sending mail\n" ); return Status::newFatal( 'php-mail-error-unknown' ); diff --git a/includes/changes/EnhancedChangesList.php b/includes/changes/EnhancedChangesList.php index 0c073c6a0b..b471ea5ebe 100644 --- a/includes/changes/EnhancedChangesList.php +++ b/includes/changes/EnhancedChangesList.php @@ -40,7 +40,7 @@ class EnhancedChangesList extends ChangesList { // @todo: deprecate constructing with Skin $context = $obj->getContext(); } else { - if ( ! $obj instanceof IContextSource ) { + if ( !$obj instanceof IContextSource ) { throw new MWException( 'EnhancedChangesList must be constructed with a ' . 'context source or skin.' ); } diff --git a/includes/config/GlobalVarConfig.php b/includes/config/GlobalVarConfig.php index 0d7f3f06c9..175a76e36c 100644 --- a/includes/config/GlobalVarConfig.php +++ b/includes/config/GlobalVarConfig.php @@ -72,7 +72,7 @@ class GlobalVarConfig implements Config { if ( !array_key_exists( $var, $GLOBALS ) ) { throw new ConfigException( __METHOD__ . ": undefined variable: '$var'" ); } - return $GLOBALS[ $var ]; + return $GLOBALS[$var]; } /** @@ -83,6 +83,6 @@ class GlobalVarConfig implements Config { * @param mixed $value value to set */ protected function setWithPrefix( $prefix, $name, $value ) { - $GLOBALS[ $prefix . $name ] = $value; + $GLOBALS[$prefix . $name] = $value; } } diff --git a/includes/deferred/ViewCountUpdate.php b/includes/deferred/ViewCountUpdate.php index 901ef9f76e..8282295bb1 100644 --- a/includes/deferred/ViewCountUpdate.php +++ b/includes/deferred/ViewCountUpdate.php @@ -51,7 +51,7 @@ class ViewCountUpdate implements DeferrableUpdate { if ( $wgHitcounterUpdateFreq <= 1 || $dbw->getType() == 'sqlite' ) { $id = $this->id; $method = __METHOD__; - $dbw->onTransactionIdle( function() use ( $dbw, $id, $method ) { + $dbw->onTransactionIdle( function () use ( $dbw, $id, $method ) { try { $dbw->update( 'page', array( 'page_counter = page_counter + 1' ), diff --git a/includes/filebackend/SwiftFileBackend.php b/includes/filebackend/SwiftFileBackend.php index 9ef23f8472..9af53c3582 100644 --- a/includes/filebackend/SwiftFileBackend.php +++ b/includes/filebackend/SwiftFileBackend.php @@ -1521,7 +1521,7 @@ class SwiftFileBackend extends FileBackendStore { 'mtime' => $this->convertSwiftDate( $rhdrs['last-modified'], TS_MW ), // Empty objects actually return no content-length header in Ceph 'size' => isset( $rhdrs['content-length'] ) ? (int)$rhdrs['content-length'] : 0, - 'sha1' => $rhdrs[ 'x-object-meta-sha1base36'], + 'sha1' => $rhdrs['x-object-meta-sha1base36'], // Note: manifiest ETags are not an MD5 of the file 'md5' => ctype_xdigit( $rhdrs['etag'] ) ? $rhdrs['etag'] : null, 'xattr' => array( 'metadata' => $metadata, 'headers' => $headers ) diff --git a/includes/filerepo/file/File.php b/includes/filerepo/file/File.php index e970e38caf..260fde1198 100644 --- a/includes/filerepo/file/File.php +++ b/includes/filerepo/file/File.php @@ -1178,7 +1178,7 @@ abstract class File { return false; } - $this->tmpBucketedThumbCache[ $bucket ] = $tmpFile->getPath(); + $this->tmpBucketedThumbCache[$bucket] = $tmpFile->getPath(); // For the caching to work, we need to make the tmp file survive as long as // this object exists $tmpFile->bind( $this ); @@ -1204,8 +1204,8 @@ abstract class File { } // Try to avoid reading from storage if the file was generated by this script - if ( isset( $this->tmpBucketedThumbCache[ $bucket ] ) ) { - $tmpPath = $this->tmpBucketedThumbCache[ $bucket ]; + if ( isset( $this->tmpBucketedThumbCache[$bucket] ) ) { + $tmpPath = $this->tmpBucketedThumbCache[$bucket]; if ( file_exists( $tmpPath ) ) { return array( diff --git a/includes/installer/WebInstallerPage.php b/includes/installer/WebInstallerPage.php index c26028d3ba..1c3be758d7 100644 --- a/includes/installer/WebInstallerPage.php +++ b/includes/installer/WebInstallerPage.php @@ -1048,7 +1048,7 @@ class WebInstallerOptions extends WebInstallerPage { 'rawtext' => $skin, 'value' => $this->getVar( "skin-$skin", true ), // all found skins enabled by default ) ) . - '
' . $radioButtons[ strtolower( $skin ) ] . '
' . + '
' . $radioButtons[strtolower( $skin )] . '
' . ''; } } else { diff --git a/includes/media/Bitmap.php b/includes/media/Bitmap.php index c0d9b71177..b2802ddb31 100644 --- a/includes/media/Bitmap.php +++ b/includes/media/Bitmap.php @@ -329,7 +329,7 @@ class BitmapHandler extends ImageHandler { $animation_post = array(); $decoderHint = array(); if ( $params['mimeType'] == 'image/jpeg' ) { - $qualityVal = isset( $params['quality'] ) ? (string) $params['quality'] : null; + $qualityVal = isset( $params['quality'] ) ? (string)$params['quality'] : null; $quality = array( '-quality', $qualityVal ?: '80' ); // 80% # Sharpening, see bug 6193 if ( ( $params['physicalWidth'] + $params['physicalHeight'] ) @@ -458,7 +458,7 @@ class BitmapHandler extends ImageHandler { list( $radius, $sigma ) = explode( 'x', $wgSharpenParameter ); $im->sharpenImage( $radius, $sigma ); } - $qualityVal = isset( $params['quality'] ) ? (string) $params['quality'] : null; + $qualityVal = isset( $params['quality'] ) ? (string)$params['quality'] : null; $im->setCompressionQuality( $qualityVal ?: 80 ); } elseif ( $params['mimeType'] == 'image/png' ) { $im->setCompressionQuality( 95 ); diff --git a/includes/media/DjVu.php b/includes/media/DjVu.php index 299252bd01..daeb475f3f 100644 --- a/includes/media/DjVu.php +++ b/includes/media/DjVu.php @@ -73,7 +73,7 @@ class DjVuHandler extends ImageHandler { * @return bool */ function validateParam( $name, $value ) { - if ( $name === 'page' && trim( $value ) !== (string) intval( $value ) ) { + if ( $name === 'page' && trim( $value ) !== (string)intval( $value ) ) { // Extra junk on the end of page, probably actually a caption // e.g. [[File:Foo.djvu|thumb|Page 3 of the document shows foo]] return false; diff --git a/includes/page/Article.php b/includes/page/Article.php index 2f27826265..3f7719593a 100644 --- a/includes/page/Article.php +++ b/includes/page/Article.php @@ -1240,7 +1240,7 @@ class Article implements Page { $hookResult = wfRunHooks( 'BeforeDisplayNoArticleText', array( $this ) ); - if ( ! $hookResult ) { + if ( !$hookResult ) { return; } diff --git a/includes/page/WikiFilePage.php b/includes/page/WikiFilePage.php index 87cc7ba52f..bfcd4c3111 100644 --- a/includes/page/WikiFilePage.php +++ b/includes/page/WikiFilePage.php @@ -201,7 +201,7 @@ class WikiFilePage extends WikiPage { $title = $this->mTitle; $file = $this->mFile; - if ( ! $file instanceof LocalFile ) { + if ( !$file instanceof LocalFile ) { wfDebug( __CLASS__ . '::' . __METHOD__ . " is not supported for this file\n" ); return TitleArray::newFromResult( new FakeResultWrapper( array() ) ); } diff --git a/includes/page/WikiPage.php b/includes/page/WikiPage.php index fc269d851c..8d0f0afb0b 100644 --- a/includes/page/WikiPage.php +++ b/includes/page/WikiPage.php @@ -1603,7 +1603,7 @@ class WikiPage implements Page, IDBAccessObject { $oldContent = $rev->getContent(); } - if ( ! $oldContent ) { + if ( !$oldContent ) { wfDebug( __METHOD__ . ": no page text\n" ); wfProfileOut( __METHOD__ ); return null; @@ -2780,7 +2780,7 @@ class WikiPage implements Page, IDBAccessObject { } $user = is_null( $user ) ? $wgUser : $user; - if ( ! wfRunHooks( 'ArticleDelete', array( &$this, &$user, &$reason, &$error, &$status ) ) ) { + if ( !wfRunHooks( 'ArticleDelete', array( &$this, &$user, &$reason, &$error, &$status ) ) ) { if ( $status->isOK() ) { // Hook aborted but didn't set a fatal status $status->fatal( 'delete-hook-aborted' ); diff --git a/includes/resourceloader/ResourceLoaderStartUpModule.php b/includes/resourceloader/ResourceLoaderStartUpModule.php index 56eb0a0008..87782ec43c 100644 --- a/includes/resourceloader/ResourceLoaderStartUpModule.php +++ b/includes/resourceloader/ResourceLoaderStartUpModule.php @@ -233,7 +233,7 @@ class ResourceLoaderStartUpModule extends ResourceLoaderModule { ); } - $registryData[ $name ] = array( + $registryData[$name] = array( 'version' => $mtime, 'dependencies' => $module->getDependencies(), 'group' => $module->getGroup(), diff --git a/includes/search/SearchHighlighter.php b/includes/search/SearchHighlighter.php index b8b2baece7..792369932a 100644 --- a/includes/search/SearchHighlighter.php +++ b/includes/search/SearchHighlighter.php @@ -117,7 +117,7 @@ class SearchHighlighter { } $offset = $endMatches[0][1] + strlen( $endMatches[0][0] ); } - if ( ! $found ) { + if ( !$found ) { // couldn't find appropriate closing tag, skip $this->splitAndAdd( $textExt, $count, substr( $text, $start, strlen( $matches[0][0] ) ) ); $start += strlen( $matches[0][0] ); @@ -184,7 +184,7 @@ class SearchHighlighter { $succ = true; // check if first text contains all terms foreach ( $terms as $term ) { - if ( ! preg_match( "/$patPre" . $term . "$patPost/ui", $firstText ) ) { + if ( !preg_match( "/$patPre" . $term . "$patPost/ui", $firstText ) ) { $succ = false; break; } @@ -194,7 +194,7 @@ class SearchHighlighter { $offsets[$first] = 0; } } - if ( ! $snippets ) { + if ( !$snippets ) { // match whole query on text $this->process( $pat1, $textExt, $left, $contextchars, $snippets, $offsets ); // match whole query on templates/tables/images @@ -279,7 +279,7 @@ class SearchHighlighter { $processed = array(); foreach ( $terms as $term ) { - if ( ! isset( $processed[$term] ) ) { + if ( !isset( $processed[$term] ) ) { $pat3 = "/$patPre(" . $term . ")$patPost/ui"; // highlight word $extract = preg_replace( $pat3, "\\1\\2\\3", $extract ); @@ -528,7 +528,7 @@ class SearchHighlighter { } ++$lineno; $m = array(); - if ( ! preg_match( $pat1, $line, $m ) ) { + if ( !preg_match( $pat1, $line, $m ) ) { continue; } --$contextlines; diff --git a/includes/specials/SpecialWhatlinkshere.php b/includes/specials/SpecialWhatlinkshere.php index 694bc83749..81d40cc2a4 100644 --- a/includes/specials/SpecialWhatlinkshere.php +++ b/includes/specials/SpecialWhatlinkshere.php @@ -151,7 +151,7 @@ class SpecialWhatLinksHere extends IncludableSpecialPage { $conds['pagelinks'][] = 'rd_from is NOT NULL'; } - $queryFunc = function( $dbr, $table, $fromCol ) use ( $conds, $target, $limit ) { + $queryFunc = function ( $dbr, $table, $fromCol ) use ( $conds, $target, $limit ) { global $wgUseLinkNamespaceDBFields; // Read an extra row as an at-end check $queryLimit = $limit + 1; diff --git a/languages/Language.php b/languages/Language.php index 88d0f23eba..8b41b4efc4 100644 --- a/languages/Language.php +++ b/languages/Language.php @@ -3125,7 +3125,7 @@ class Language { */ function getMagic( $mw ) { // Saves a function call - if ( ! $this->mMagicHookDone ) { + if ( !$this->mMagicHookDone ) { $this->doMagicHook(); } @@ -3795,7 +3795,7 @@ class Language { foreach ( $forms as $index => $form ) { if ( preg_match( '/\d+=/i', $form ) ) { $pos = strpos( $form, '=' ); - if ( substr( $form, 0, $pos ) === (string) $count ) { + if ( substr( $form, 0, $pos ) === (string)$count ) { return substr( $form, $pos + 1 ); } unset( $forms[$index] ); @@ -4443,7 +4443,7 @@ class Language { if ( !isset( $format['avoid'] ) ) { $format['avoid'] = false; } - if ( !isset( $format['noabbrevs' ] ) ) { + if ( !isset( $format['noabbrevs'] ) ) { $format['noabbrevs'] = false; } $secondsMsg = wfMessage( diff --git a/languages/messages/MessagesFrp.php b/languages/messages/MessagesFrp.php index 3836ad97bb..8682ab0cfd 100644 --- a/languages/messages/MessagesFrp.php +++ b/languages/messages/MessagesFrp.php @@ -290,17 +290,17 @@ $magicWords = array( $linkTrail = '/^([a-zàâçéèêîœôû·’æäåāăëēïīòöōùü‘]+)(.*)$/sDu'; $dateFormats = array( - 'mdy time' => 'H:i', - 'mdy date' => 'F j, Y', - 'mdy both' => 'F j, Y "a" H:i', + 'mdy time' => 'H:i', + 'mdy date' => 'F j, Y', + 'mdy both' => 'F j, Y "a" H:i', - 'dmy time' => 'H:i', - 'dmy date' => 'j F Y', - 'dmy both' => 'j F Y "a" H:i', + 'dmy time' => 'H:i', + 'dmy date' => 'j F Y', + 'dmy both' => 'j F Y "a" H:i', - 'ymd time' => 'H:i', - 'ymd date' => 'Y F j', - 'ymd both' => 'Y F j "a" H:i', + 'ymd time' => 'H:i', + 'ymd date' => 'Y F j', + 'ymd both' => 'Y F j "a" H:i', ); $separatorTransformTable = array( ',' => "\xc2\xa0", '.' => ',' ); diff --git a/tests/parser/parserTest.inc b/tests/parser/parserTest.inc index 5d05ca0daf..e76b9df455 100644 --- a/tests/parser/parserTest.inc +++ b/tests/parser/parserTest.inc @@ -733,11 +733,11 @@ class ParserTest { if ( preg_match_all( $regex, $instring, $matches, PREG_SET_ORDER ) ) { foreach ( $matches as $bits ) { - $key = strtolower( $bits[ 'k' ] ); - if ( !isset( $bits[ 'v' ] ) ) { + $key = strtolower( $bits['k'] ); + if ( !isset( $bits['v'] ) ) { $opts[$key] = true; } else { - preg_match_all( $valueregex, $bits[ 'v' ], $vmatches ); + preg_match_all( $valueregex, $bits['v'], $vmatches ); $opts[$key] = array_map( array( $this, 'cleanupOption' ), $vmatches[0] ); if ( count( $opts[$key] ) == 1 ) { $opts[$key] = $opts[$key][0]; diff --git a/tests/phpunit/includes/StatusTest.php b/tests/phpunit/includes/StatusTest.php index 9e2f5b8ae7..b2e44593be 100644 --- a/tests/phpunit/includes/StatusTest.php +++ b/tests/phpunit/includes/StatusTest.php @@ -327,7 +327,7 @@ class StatusTest extends MediaWikiLangTestCase { public static function provideGetWikiTextAndHtml() { $testCases = array(); - $testCases[ 'GoodStatus' ] = array( + $testCases['GoodStatus'] = array( new Status(), "Internal error: Status::getWikiText called for a good result, this is incorrect\n", "

Internal error: Status::getWikiText called for a good result, this is incorrect\n

", @@ -335,7 +335,7 @@ class StatusTest extends MediaWikiLangTestCase { $status = new Status(); $status->ok = false; - $testCases[ 'GoodButNoError' ] = array( + $testCases['GoodButNoError'] = array( $status, "Internal error: Status::getWikiText: Invalid result object: no error text but not OK\n", "

Internal error: Status::getWikiText: Invalid result object: no error text but not OK\n

", @@ -343,7 +343,7 @@ class StatusTest extends MediaWikiLangTestCase { $status = new Status(); $status->warning( 'fooBar!' ); - $testCases[ '1StringWarning' ] = array( + $testCases['1StringWarning'] = array( $status, "", "

<fooBar!>\n

", @@ -352,7 +352,7 @@ class StatusTest extends MediaWikiLangTestCase { $status = new Status(); $status->warning( 'fooBar!' ); $status->warning( 'fooBar2!' ); - $testCases[ '2StringWarnings' ] = array( + $testCases['2StringWarnings'] = array( $status, "* \n* \n", "
  • <fooBar!>
  • \n
  • <fooBar2!>
\n", @@ -360,7 +360,7 @@ class StatusTest extends MediaWikiLangTestCase { $status = new Status(); $status->warning( new Message( 'fooBar!', array( 'foo', 'bar' ) ) ); - $testCases[ '1MessageWarning' ] = array( + $testCases['1MessageWarning'] = array( $status, "", "

<fooBar!>\n

", @@ -369,7 +369,7 @@ class StatusTest extends MediaWikiLangTestCase { $status = new Status(); $status->warning( new Message( 'fooBar!', array( 'foo', 'bar' ) ) ); $status->warning( new Message( 'fooBar2!' ) ); - $testCases[ '2MessageWarnings' ] = array( + $testCases['2MessageWarnings'] = array( $status, "* \n* \n", "
  • <fooBar!>
  • \n
  • <fooBar2!>
\n", @@ -399,7 +399,7 @@ class StatusTest extends MediaWikiLangTestCase { public static function provideGetMessage() { $testCases = array(); - $testCases[ 'GoodStatus' ] = array( + $testCases['GoodStatus'] = array( new Status(), array( "Status::getMessage called for a good result, this is incorrect\n" ), 'internalerror_info' @@ -407,7 +407,7 @@ class StatusTest extends MediaWikiLangTestCase { $status = new Status(); $status->ok = false; - $testCases[ 'GoodButNoError' ] = array( + $testCases['GoodButNoError'] = array( $status, array( "Status::getMessage: Invalid result object: no error text but not OK\n" ), 'internalerror_info' @@ -415,7 +415,7 @@ class StatusTest extends MediaWikiLangTestCase { $status = new Status(); $status->warning( 'fooBar!' ); - $testCases[ '1StringWarning' ] = array( + $testCases['1StringWarning'] = array( $status, array(), 'fooBar!' @@ -437,7 +437,7 @@ class StatusTest extends MediaWikiLangTestCase { $status = new Status(); $status->warning( new Message( 'fooBar!', array( 'foo', 'bar' ) ) ); - $testCases[ '1MessageWarning' ] = array( + $testCases['1MessageWarning'] = array( $status, array( 'foo', 'bar' ), 'fooBar!' @@ -446,7 +446,7 @@ class StatusTest extends MediaWikiLangTestCase { $status = new Status(); $status->warning( new Message( 'fooBar!', array( 'foo', 'bar' ) ) ); $status->warning( new Message( 'fooBar2!' ) ); - $testCases[ '2MessageWarnings' ] = array( + $testCases['2MessageWarnings'] = array( $status, array( new Message( 'fooBar!', array( 'foo', 'bar' ) ), new Message( 'fooBar2!' ) ), "* \$1\n* \$2" diff --git a/tests/phpunit/includes/api/ApiTestCase.php b/tests/phpunit/includes/api/ApiTestCase.php index 87ad2cdf57..0976b1a9bb 100644 --- a/tests/phpunit/includes/api/ApiTestCase.php +++ b/tests/phpunit/includes/api/ApiTestCase.php @@ -152,8 +152,8 @@ abstract class ApiTestCase extends MediaWikiLangTestCase { $data = $this->doApiRequest( array( 'action' => 'login', - 'lgname' => self::$users[ $user ]->username, - 'lgpassword' => self::$users[ $user ]->password ) ); + 'lgname' => self::$users[$user]->username, + 'lgpassword' => self::$users[$user]->password ) ); $token = $data[0]['login']['token']; @@ -161,8 +161,8 @@ abstract class ApiTestCase extends MediaWikiLangTestCase { array( 'action' => 'login', 'lgtoken' => $token, - 'lgname' => self::$users[ $user ]->username, - 'lgpassword' => self::$users[ $user ]->password, + 'lgname' => self::$users[$user]->username, + 'lgpassword' => self::$users[$user]->password, ), $data[2] ); diff --git a/tests/phpunit/includes/exception/MWExceptionHandlerTest.php b/tests/phpunit/includes/exception/MWExceptionHandlerTest.php index 2eb1c46e7a..dc5dc6aa32 100644 --- a/tests/phpunit/includes/exception/MWExceptionHandlerTest.php +++ b/tests/phpunit/includes/exception/MWExceptionHandlerTest.php @@ -27,7 +27,7 @@ class MWExceptionHandlerTest extends MediaWikiTestCase { $hasObject = false; $hasArray = false; foreach ( $trace as $frame ) { - if ( ! isset( $frame['args'] ) ) { + if ( !isset( $frame['args'] ) ) { continue; } foreach ( $frame['args'] as $arg ) { @@ -49,7 +49,7 @@ class MWExceptionHandlerTest extends MediaWikiTestCase { $redacted = MWExceptionHandler::getRedactedTrace( $e ); foreach ( $redacted as $frame ) { - if ( ! isset( $frame['args'] ) ) { + if ( !isset( $frame['args'] ) ) { continue; } foreach ( $frame['args'] as $arg ) { diff --git a/tests/phpunit/includes/media/DjVuTest.php b/tests/phpunit/includes/media/DjVuTest.php index d779207ec7..c0871f19fc 100644 --- a/tests/phpunit/includes/media/DjVuTest.php +++ b/tests/phpunit/includes/media/DjVuTest.php @@ -62,7 +62,7 @@ class DjVuTest extends MediaWikiMediaTestCase { $file = $this->dataFile( 'LoremIpsum.djvu', 'image/x.djvu' ); $this->assertEquals( "Lorem ipsum \n1 \n", - (string) $this->handler->getPageText( $file, 1 ), + (string)$this->handler->getPageText( $file, 1 ), "Text layer of page 1 of file LoremIpsum.djvu should be 'Lorem ipsum \n1 \n'" ); } diff --git a/tests/phpunit/includes/specials/SpecialMyLanguageTest.php b/tests/phpunit/includes/specials/SpecialMyLanguageTest.php index 020d436216..c09d68ccd0 100644 --- a/tests/phpunit/includes/specials/SpecialMyLanguageTest.php +++ b/tests/phpunit/includes/specials/SpecialMyLanguageTest.php @@ -62,4 +62,4 @@ class SpecialMyLanguageTest extends MediaWikiTestCase { array( 'Page/Another', 'Page/Another', 'en', 'es' ), ); } -} \ No newline at end of file +} diff --git a/tests/phpunit/structure/ResourcesTest.php b/tests/phpunit/structure/ResourcesTest.php index d7742a6976..55b2b6b4ea 100644 --- a/tests/phpunit/structure/ResourcesTest.php +++ b/tests/phpunit/structure/ResourcesTest.php @@ -115,7 +115,7 @@ class ResourcesTest extends MediaWikiTestCase { $media, $file, // XXX: Wrapped in an object to keep it out of PHPUnit output - (object) array( 'cssText' => $readStyleFile->invoke( $module, $file, $flip ) ), + (object)array( 'cssText' => $readStyleFile->invoke( $module, $file, $flip ) ), ); } } diff --git a/tests/testHelpers.inc b/tests/testHelpers.inc index 8c24f3981a..d7342af804 100644 --- a/tests/testHelpers.inc +++ b/tests/testHelpers.inc @@ -520,8 +520,8 @@ class TestFileIterator implements Iterator { $this->test = array( 'test' => ParserTest::chomp( $this->sectionData['test'] ), - 'input' => ParserTest::chomp( $this->sectionData[ $input ] ), - 'result' => ParserTest::chomp( $this->sectionData[ $result ] ), + 'input' => ParserTest::chomp( $this->sectionData[$input] ), + 'result' => ParserTest::chomp( $this->sectionData[$result] ), 'options' => ParserTest::chomp( $this->sectionData['options'] ), 'config' => ParserTest::chomp( $this->sectionData['config'] ), ); @@ -579,7 +579,7 @@ class TestFileIterator implements Iterator { $data = $this->sectionData; $tokens = array_filter( $tokens, function ( $token ) use ( $data ) { - return isset( $data[ $token ] ); + return isset( $data[$token] ); } ); if ( count( $tokens ) == 0 ) { @@ -605,7 +605,7 @@ class TestFileIterator implements Iterator { } $tokens = array_values( $tokens ); - return $tokens[ 0 ]; + return $tokens[0]; } }