From ab20f80116acb97eb8f5a0020d7a701c9178af28 Mon Sep 17 00:00:00 2001 From: umherirrender Date: Wed, 13 Aug 2014 19:59:03 +0200 Subject: [PATCH] Fixed spacing - Added newline at end of files - Added/Removed spaces around comma, parentheses and negation - Added space after function word Change-Id: I2dd338153aeb5f07702ba015945e95c7d0ae673b --- includes/api/ApiModuleManager.php | 2 +- tests/phpunit/includes/api/ApiModuleManagerTest.php | 12 ++++++------ tests/phpunit/includes/content/JSONContentTest.php | 7 +++---- tests/phpunit/includes/skins/SkinFactoryTest.php | 2 +- 4 files changed, 11 insertions(+), 12 deletions(-) diff --git a/includes/api/ApiModuleManager.php b/includes/api/ApiModuleManager.php index fdf3f02ed4..f7d0ccf554 100644 --- a/includes/api/ApiModuleManager.php +++ b/includes/api/ApiModuleManager.php @@ -195,7 +195,7 @@ class ApiModuleManager extends ContextSource { // create instance from factory $instance = call_user_func( $factory, $this->mParent, $name ); - if ( ! $instance instanceof $class ) { + if ( !$instance instanceof $class ) { throw new MWException( "The factory function for module $name did not return an instance of $class!" ); } } else { diff --git a/tests/phpunit/includes/api/ApiModuleManagerTest.php b/tests/phpunit/includes/api/ApiModuleManagerTest.php index 1ac9b9df6c..19c0a7d7ad 100644 --- a/tests/phpunit/includes/api/ApiModuleManagerTest.php +++ b/tests/phpunit/includes/api/ApiModuleManagerTest.php @@ -39,8 +39,8 @@ class ApiModuleManagerTest extends MediaWikiTestCase { 'logout', 'action', 'ApiLogout', - function( ApiMain $main, $action ) { - return new ApiLogout( $main, $action ); + function ( ApiMain $main, $action ) { + return new ApiLogout( $main, $action ); }, ), ); @@ -80,7 +80,7 @@ class ApiModuleManagerTest extends MediaWikiTestCase { ), 'logout' => array( 'class' => 'ApiLogout', - 'factory' => function( ApiMain $main, $action ) { + 'factory' => function ( ApiMain $main, $action ) { return new ApiLogout( $main, $action ); }, ), @@ -113,9 +113,9 @@ class ApiModuleManagerTest extends MediaWikiTestCase { ), 'logout' => array( 'class' => 'ApiLogout', - 'factory' => function( ApiMain $main, $action ) { - return new ApiLogout( $main, $action ); - }, + 'factory' => function ( ApiMain $main, $action ) { + return new ApiLogout( $main, $action ); + }, ), ); diff --git a/tests/phpunit/includes/content/JSONContentTest.php b/tests/phpunit/includes/content/JSONContentTest.php index ec745749b6..acfdc0e59f 100644 --- a/tests/phpunit/includes/content/JSONContentTest.php +++ b/tests/phpunit/includes/content/JSONContentTest.php @@ -27,7 +27,7 @@ class JSONContentTest extends MediaWikiLangTestCase { * @dataProvider provideDataToEncode */ public function testBeautifyUsesFormatJson( $data ) { - $obj = new JSONContent( FormatJson::encode( $data) ); + $obj = new JSONContent( FormatJson::encode( $data ) ); $this->assertEquals( FormatJson::encode( $data, true ), $obj->beautifyJSON() ); } @@ -46,7 +46,7 @@ class JSONContentTest extends MediaWikiLangTestCase { */ public function testPreSaveTransform( $data ) { $obj = new JSONContent( FormatJson::encode( $data ) ); - $newObj = $obj->preSaveTransform( $this->getMockTitle(), $this->getMockUser() , $this->getMockParserOptions() ); + $newObj = $obj->preSaveTransform( $this->getMockTitle(), $this->getMockUser(), $this->getMockParserOptions() ); $this->assertTrue( $newObj->equals( new JSONContent( FormatJson::encode( $data, true ) ) ) ); } @@ -112,5 +112,4 @@ class JSONContentTest extends MediaWikiLangTestCase { ), ); } - -} \ No newline at end of file +} diff --git a/tests/phpunit/includes/skins/SkinFactoryTest.php b/tests/phpunit/includes/skins/SkinFactoryTest.php index 4497cbabec..7b7c7f86ea 100644 --- a/tests/phpunit/includes/skins/SkinFactoryTest.php +++ b/tests/phpunit/includes/skins/SkinFactoryTest.php @@ -7,7 +7,7 @@ class SkinFactoryTest extends MediaWikiTestCase { */ public function testRegister() { $factory = new SkinFactory(); - $factory->register( 'fallback', 'Fallback', function() { + $factory->register( 'fallback', 'Fallback', function () { return new SkinFallback(); } ); $this->assertTrue( true ); // No exception thrown -- 2.20.1