From 2a7c95acda4b28703518145a3201e81afde44b19 Mon Sep 17 00:00:00 2001 From: umherirrender Date: Thu, 30 Oct 2014 17:50:19 +0100 Subject: [PATCH] Fixed spacing - Changed spaces to tabs for indentation - space after 'function'/'if' - Added/Removed space after parenthesis/brackets/end of line - Removed space after cast Change-Id: I0e8e6a19b84b5e1308b632a0266cb78f688494ee --- includes/GlobalFunctions.php | 2 +- includes/api/ApiFormatBase.php | 4 ++-- includes/api/ApiMain.php | 2 +- includes/db/ORMTable.php | 2 +- includes/debug/logger/legacy/Logger.php | 2 +- includes/debug/logger/legacy/Spi.php | 2 +- includes/debug/logger/monolog/Handler.php | 2 +- includes/resourceloader/ResourceLoaderFileModule.php | 2 +- includes/specials/SpecialImport.php | 2 +- includes/specials/SpecialNewpages.php | 2 +- tests/phpunit/includes/TestUser.php | 6 +++--- 11 files changed, 14 insertions(+), 14 deletions(-) diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php index cc7086c943..261cb92a1c 100644 --- a/includes/GlobalFunctions.php +++ b/includes/GlobalFunctions.php @@ -3709,7 +3709,7 @@ function wfWaitForSlaves( // Figure out which clusters need to be checked $lbs = array(); if ( $cluster === '*' ) { - wfGetLBFactory()->forEachLB( function( LoadBalancer $lb ) use ( &$lbs ) { + wfGetLBFactory()->forEachLB( function ( LoadBalancer $lb ) use ( &$lbs ) { $lbs[] = $lb; } ); } elseif ( $cluster !== false ) { diff --git a/includes/api/ApiFormatBase.php b/includes/api/ApiFormatBase.php index 230a3408d6..913b8ebc4a 100644 --- a/includes/api/ApiFormatBase.php +++ b/includes/api/ApiFormatBase.php @@ -164,8 +164,8 @@ abstract class ApiFormatBase extends ApiBase { $out->setPageTitle( $context->msg( 'api-format-title' ) ); $header = $context->msg( 'api-format-prettyprint-header' ) - ->params( $format, strtolower( $format ) ) - ->parseAsBlock(); + ->params( $format, strtolower( $format ) ) + ->parseAsBlock(); $out->addHTML( Html::rawElement( 'div', array( 'class' => 'api-pretty-header' ), ApiHelp::fixHelpLinks( $header ) diff --git a/includes/api/ApiMain.php b/includes/api/ApiMain.php index 472f753df7..f7588a3a62 100644 --- a/includes/api/ApiMain.php +++ b/includes/api/ApiMain.php @@ -310,7 +310,7 @@ class ApiMain extends ApiBase { // then there's an appropriate Vary header set by whatever set // their non-default language. wfDebug( __METHOD__ . ": downgrading cache mode 'public' to " . - "'anon-public-user-private' due to uselang=user\n" ); + "'anon-public-user-private' due to uselang=user\n" ); $mode = 'anon-public-user-private'; } diff --git a/includes/db/ORMTable.php b/includes/db/ORMTable.php index 1868073833..b22df39fb6 100644 --- a/includes/db/ORMTable.php +++ b/includes/db/ORMTable.php @@ -800,7 +800,7 @@ class ORMTable extends DBAccessBase implements IORMTable { private function stripFieldPrefix( array $fieldNames ) { $start = strlen( $this->fieldPrefix ); - return array_map( function( $fieldName ) use ( $start ) { + return array_map( function ( $fieldName ) use ( $start ) { return substr( $fieldName, $start ); }, $fieldNames ); } diff --git a/includes/debug/logger/legacy/Logger.php b/includes/debug/logger/legacy/Logger.php index ff6336bd00..a19bcc9d24 100644 --- a/includes/debug/logger/legacy/Logger.php +++ b/includes/debug/logger/legacy/Logger.php @@ -83,7 +83,7 @@ class MWLoggerLegacyLogger extends \Psr\Log\AbstractLogger { if ( $channel === 'wfLogDBError' ) { // wfLogDBError messages are emitted if a database log location is // specfied. - $shouldEmit = (bool) $wgDBerrorLog; + $shouldEmit = (bool)$wgDBerrorLog; } elseif ( $channel === 'wfErrorLog' ) { // All messages on the wfErrorLog channel should be emitted. diff --git a/includes/debug/logger/legacy/Spi.php b/includes/debug/logger/legacy/Spi.php index 51e14a27ae..a3d34fa85a 100644 --- a/includes/debug/logger/legacy/Spi.php +++ b/includes/debug/logger/legacy/Spi.php @@ -50,7 +50,7 @@ class MWLoggerLegacySpi implements MWLoggerSpi { */ public function getLogger( $channel ) { if ( !isset( $this->singletons[$channel] ) ) { - $this->singletons[$channel] = new MWLoggerLegacyLogger($channel); + $this->singletons[$channel] = new MWLoggerLegacyLogger( $channel ); } return $this->singletons[$channel]; } diff --git a/includes/debug/logger/monolog/Handler.php b/includes/debug/logger/monolog/Handler.php index 1472459f02..02ab309891 100644 --- a/includes/debug/logger/monolog/Handler.php +++ b/includes/debug/logger/monolog/Handler.php @@ -168,7 +168,7 @@ class MWLoggerMonologHandler extends \Monolog\Handler\AbstractProcessingHandler $this->openSink(); } - $text = (string) $record['formatted']; + $text = (string)$record['formatted']; if ( $this->useUdp() ) { // Clean it up for the multiplexer diff --git a/includes/resourceloader/ResourceLoaderFileModule.php b/includes/resourceloader/ResourceLoaderFileModule.php index d4e8159341..bcef149db4 100644 --- a/includes/resourceloader/ResourceLoaderFileModule.php +++ b/includes/resourceloader/ResourceLoaderFileModule.php @@ -993,7 +993,7 @@ class ResourceLoaderFileModule extends ResourceLoaderModule { $localPath = $this->getLocalPath( $templatePath ); if ( file_exists( $localPath ) ) { $content = file_get_contents( $localPath ); - $templates[ $alias ] = $content; + $templates[$alias] = $content; } else { $msg = __METHOD__ . ": template file not found: \"$localPath\""; wfDebugLog( 'resourceloader', $msg ); diff --git a/includes/specials/SpecialImport.php b/includes/specials/SpecialImport.php index 3d762aa313..05bb607aa1 100644 --- a/includes/specials/SpecialImport.php +++ b/includes/specials/SpecialImport.php @@ -251,7 +251,7 @@ class SpecialImport extends SpecialPage { Xml::label( $this->msg( 'import-comment' )->text(), 'mw-import-comment' ) . " " . - Xml::input( 'log-comment', 50, + Xml::input( 'log-comment', 50, ( $this->sourceName == 'upload' ? $this->logcomment : '' ), array( 'id' => 'mw-import-comment', 'type' => 'text' ) ) . ' ' . " diff --git a/includes/specials/SpecialNewpages.php b/includes/specials/SpecialNewpages.php index 5b34297bfd..ad1f051204 100644 --- a/includes/specials/SpecialNewpages.php +++ b/includes/specials/SpecialNewpages.php @@ -255,7 +255,7 @@ class SpecialNewpages extends IncludableSpecialPage { // The form should be visible on each request (inclusive requests with submitted forms), so // return always false here. $htmlForm->setSubmitCallback( - function() { + function () { return false; } ); diff --git a/tests/phpunit/includes/TestUser.php b/tests/phpunit/includes/TestUser.php index 499353e0d9..754568d0b2 100644 --- a/tests/phpunit/includes/TestUser.php +++ b/tests/phpunit/includes/TestUser.php @@ -28,7 +28,7 @@ class TestUser { private function assertNotReal() { global $wgDBprefix; - if( $wgDBprefix !== MediaWikiTestCase::DB_PREFIX && $wgDBprefix !== MediaWikiTestCase::ORA_DB_PREFIX ) { + if ( $wgDBprefix !== MediaWikiTestCase::DB_PREFIX && $wgDBprefix !== MediaWikiTestCase::ORA_DB_PREFIX ) { throw new MWException( "Can't create user on real database" ); } } @@ -114,9 +114,9 @@ class TestUser { $passwordFactory = $this->user->getPasswordFactory(); $oldDefaultType = $passwordFactory->getDefaultType(); - // A is unsalted MD5 (thus fast) ... we don't care about security here, this is test only + // A is unsalted MD5 (thus fast) ... we don't care about security here, this is test only $passwordFactory->setDefaultType( 'A' ); - $newPassword = $passwordFactory->newFromPlaintext( $password , $this->user->getPassword() ); + $newPassword = $passwordFactory->newFromPlaintext( $password, $this->user->getPassword() ); $change = false; if ( !$this->user->getPassword()->equals( $newPassword ) ) { -- 2.20.1