jenkins-bot has submitted this change and it was merged.

Change subject: Fixed spacing
......................................................................


Fixed spacing

- Added space after reserved words: function, foreach, if
- Combined 'else if' into elseif
- Added braces to one-line statements
- Added spaces after comma, before parentheses

Change-Id: Ie5bbf680d6fbe0f0872dab2700c16b1394906a72
---
M includes/Revision.php
M includes/Setup.php
M includes/Title.php
M includes/WatchedItem.php
M includes/htmlform/HTMLAutoCompleteSelectField.php
M includes/htmlform/HTMLForm.php
M includes/objectcache/MemcachedBagOStuff.php
M includes/search/SearchHighlighter.php
M includes/skins/SkinFactory.php
M includes/specials/SpecialImport.php
M tests/parser/parserTest.inc
M tests/phpunit/MediaWikiTestCase.php
M tests/phpunit/includes/deferred/DeferredUpdatesTest.php
M tests/phpunit/includes/parser/NewParserTest.php
M tests/phpunit/includes/parser/TidyTest.php
M tests/phpunit/includes/resourceloader/ResourceLoaderModuleTest.php
M tests/phpunit/includes/skins/SkinFactoryTest.php
M tests/testHelpers.inc
18 files changed, 36 insertions(+), 31 deletions(-)

Approvals:
  Aaron Schulz: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/includes/Revision.php b/includes/Revision.php
index cad9f2c..28a825d 100644
--- a/includes/Revision.php
+++ b/includes/Revision.php
@@ -1658,7 +1658,7 @@
         *                          instead of just plain userrights
         * @return bool
         */
-       public static function userCanBitfield( $bitfield, $field, User $user = 
null ,
+       public static function userCanBitfield( $bitfield, $field, User $user = 
null,
                Title $title = null
        ) {
                if ( $bitfield & $field ) { // aspect is deleted
@@ -1680,7 +1680,7 @@
                        } else {
                                $text = $title->getPrefixedText();
                                wfDebug( "Checking for $permissionlist on $text 
due to $field match on $bitfield\n" );
-                               foreach( $permissions as $perm ) {
+                               foreach ( $permissions as $perm ) {
                                        if ( $title->userCan( $perm, $user ) ) {
                                                return true;
                                        }
diff --git a/includes/Setup.php b/includes/Setup.php
index acceb59..6dbaac6 100644
--- a/includes/Setup.php
+++ b/includes/Setup.php
@@ -265,16 +265,16 @@
 
 // Register skins
 // Use a closure to avoid leaking into global state
-call_user_func( function() use ( $wgValidSkinNames ) {
+call_user_func( function () use ( $wgValidSkinNames ) {
        $factory = SkinFactory::getDefaultInstance();
        foreach ( $wgValidSkinNames as $name => $skin ) {
-               $factory->register( $name, $skin, function() use ( $name, $skin 
) {
+               $factory->register( $name, $skin, function () use ( $name, 
$skin ) {
                        $class = "Skin$skin";
                        return new $class( $name );
                } );
        }
        // Register a hidden "fallback" skin
-       $factory->register( 'fallback', 'Fallback', function() {
+       $factory->register( 'fallback', 'Fallback', function () {
                return new SkinFallback;
        } );
 } );
diff --git a/includes/Title.php b/includes/Title.php
index bcf9cbd..7fdeb05 100644
--- a/includes/Title.php
+++ b/includes/Title.php
@@ -2265,7 +2265,7 @@
                } elseif ( $action == 'delete' ) {
                        $tempErrors = $this->checkPageRestrictions( 'edit',
                                $user, array(), $doExpensiveQueries, true );
-                       if( !$tempErrors ) {
+                       if ( !$tempErrors ) {
                                $tempErrors = 
$this->checkCascadingSourcesRestrictions( 'edit',
                                        $user, $tempErrors, 
$doExpensiveQueries, true );
                        }
diff --git a/includes/WatchedItem.php b/includes/WatchedItem.php
index 488932c..ab136b8 100644
--- a/includes/WatchedItem.php
+++ b/includes/WatchedItem.php
@@ -309,7 +309,7 @@
                }
 
                $dbw = wfGetDB( DB_MASTER );
-               foreach( array_chunk( $rows, 100 ) as $toInsert ) {
+               foreach ( array_chunk( $rows, 100 ) as $toInsert ) {
                        // Use INSERT IGNORE to avoid overwriting the 
notification timestamp
                        // if there's already an entry for this page
                        $dbw->insert( 'watchlist', $toInsert, __METHOD__, 
'IGNORE' );
diff --git a/includes/htmlform/HTMLAutoCompleteSelectField.php 
b/includes/htmlform/HTMLAutoCompleteSelectField.php
index 4ea5e99..4905362 100644
--- a/includes/htmlform/HTMLAutoCompleteSelectField.php
+++ b/includes/htmlform/HTMLAutoCompleteSelectField.php
@@ -106,7 +106,7 @@
 
                if ( $this->getOptions() ) {
                        $attribs['data-hide-if'] = FormatJson::encode(
-                               array( '!==',  $this->mName . '-select', 
'other' )
+                               array( '!==', $this->mName . '-select', 'other' 
)
                        );
                }
 
diff --git a/includes/htmlform/HTMLForm.php b/includes/htmlform/HTMLForm.php
index 50f7037..fc2222a 100644
--- a/includes/htmlform/HTMLForm.php
+++ b/includes/htmlform/HTMLForm.php
@@ -937,7 +937,7 @@
                        }
 
                        if ( $useMediaWikiUIEverywhere ) {
-                               if ( isset( $attrs['class' ] ) ) {
+                               if ( isset( $attrs['class'] ) ) {
                                        $attrs['class'] .= ' mw-ui-button';
                                } else {
                                        $attrs['class'] = 'mw-ui-button';
diff --git a/includes/objectcache/MemcachedBagOStuff.php 
b/includes/objectcache/MemcachedBagOStuff.php
index 54a464d..53edcdd 100644
--- a/includes/objectcache/MemcachedBagOStuff.php
+++ b/includes/objectcache/MemcachedBagOStuff.php
@@ -154,7 +154,7 @@
                if ( $expiry > 2592000 && $expiry < 1000000000 ) {
                        $expiry = 2592000;
                }
-               return (int) $expiry;
+               return (int)$expiry;
        }
 
        /**
diff --git a/includes/search/SearchHighlighter.php 
b/includes/search/SearchHighlighter.php
index 0bd6ca8..109c466 100644
--- a/includes/search/SearchHighlighter.php
+++ b/includes/search/SearchHighlighter.php
@@ -564,11 +564,11 @@
         * @param int $contextchars average number of characters per line
         * @return string
         */
-       public function highlightNone( $text, $contextlines, $contextchars) {
+       public function highlightNone( $text, $contextlines, $contextchars ) {
                $match = array();
                $text = ltrim( $text ) . "\n"; // make sure the preg_match may 
find the last line
-               $text = str_replace( "\n\n", "\n", $text); // remove empty lines
-               preg_match( "/^(.*\n){0,$contextlines}/", $text , $match);
+               $text = str_replace( "\n\n", "\n", $text ); // remove empty 
lines
+               preg_match( "/^(.*\n){0,$contextlines}/", $text, $match );
                $text = htmlspecialchars( substr( trim( $match[0] ), 0, 
$contextlines * $contextchars ) ); // trim and limit to max number of chars
                return str_replace( "\n", '<br>', $text );
        }
diff --git a/includes/skins/SkinFactory.php b/includes/skins/SkinFactory.php
index 6448088..fb40857 100644
--- a/includes/skins/SkinFactory.php
+++ b/includes/skins/SkinFactory.php
@@ -70,7 +70,7 @@
         *     to be, but doing so would change the case of i18n message keys).
         * @param string $displayName For backwards-compatibility with old skin 
loading system. This is
         *     the text used as skin's human-readable name when the 
'skinname-<skin>' message is not
-   *     available. It should be the same as the skin name provided in 
$wgExtensionCredits.
+        *     available. It should be the same as the skin name provided in 
$wgExtensionCredits.
         * @param callable $callback Callback that takes the skin name as an 
argument
         * @throws InvalidArgumentException If an invalid callback is provided
         */
diff --git a/includes/specials/SpecialImport.php 
b/includes/specials/SpecialImport.php
index 1b45315..eab4784 100644
--- a/includes/specials/SpecialImport.php
+++ b/includes/specials/SpecialImport.php
@@ -327,7 +327,7 @@
                        foreach ( $importSources as $key => $value ) {
                                if ( is_int( $key ) ) {
                                        $key = $value;
-                               } else if ( $value !== $key ) {
+                               } elseif ( $value !== $key ) {
                                        $needSubprojectField = true;
                                }
 
diff --git a/tests/parser/parserTest.inc b/tests/parser/parserTest.inc
index a342fec..25ffb02 100644
--- a/tests/parser/parserTest.inc
+++ b/tests/parser/parserTest.inc
@@ -625,7 +625,7 @@
                                        return $this->showSkipped();
                                }
                                $out = MWTidy::tidy( $out );
-                               $out = preg_replace( '/\s+$/', '', $out);
+                               $out = preg_replace( '/\s+$/', '', $out );
                        }
 
                        if ( isset( $opts['showtitle'] ) ) {
diff --git a/tests/phpunit/MediaWikiTestCase.php 
b/tests/phpunit/MediaWikiTestCase.php
index 873d979..1166817 100644
--- a/tests/phpunit/MediaWikiTestCase.php
+++ b/tests/phpunit/MediaWikiTestCase.php
@@ -1120,13 +1120,13 @@
         * @param string $message
         * @param bool $isHtml
         */
-       public static function assertTag($matcher, $actual, $message = '', 
$isHtml = true) {
+       public static function assertTag( $matcher, $actual, $message = '', 
$isHtml = true ) {
                //trigger_error(__METHOD__ . ' is deprecated', 
E_USER_DEPRECATED);
 
-               $dom     = PHPUnit_Util_XML::load($actual, $isHtml);
-               $tags    = PHPUnit_Util_XML::findNodes($dom, $matcher, $isHtml);
-               $matched = count($tags) > 0 && $tags[0] instanceof DOMNode;
+               $dom = PHPUnit_Util_XML::load( $actual, $isHtml );
+               $tags = PHPUnit_Util_XML::findNodes( $dom, $matcher, $isHtml );
+               $matched = count( $tags ) > 0 && $tags[0] instanceof DOMNode;
 
-               self::assertTrue($matched, $message);
+               self::assertTrue( $matched, $message );
        }
 }
diff --git a/tests/phpunit/includes/deferred/DeferredUpdatesTest.php 
b/tests/phpunit/includes/deferred/DeferredUpdatesTest.php
index b3d57e7..5348c85 100644
--- a/tests/phpunit/includes/deferred/DeferredUpdatesTest.php
+++ b/tests/phpunit/includes/deferred/DeferredUpdatesTest.php
@@ -3,7 +3,7 @@
 class DeferredUpdatesTest extends MediaWikiTestCase {
 
        public function testDoUpdates() {
-               $updates = array (
+               $updates = array(
                        '1' => 'deferred update 1',
                        '2' => 'deferred update 2',
                        '3' => 'deferred update 3',
@@ -18,7 +18,7 @@
                        function () use ( $updates ) {
                                echo $updates['2'];
                                DeferredUpdates::addCallableUpdate(
-                                       function() use ( $updates ) {
+                                       function () use ( $updates ) {
                                                echo $updates['2-1'];
                                        }
                                );
diff --git a/tests/phpunit/includes/parser/NewParserTest.php 
b/tests/phpunit/includes/parser/NewParserTest.php
index 4e8c11f..dda15ec 100644
--- a/tests/phpunit/includes/parser/NewParserTest.php
+++ b/tests/phpunit/includes/parser/NewParserTest.php
@@ -754,7 +754,7 @@
                                        $this->markTestSkipped( "SKIPPED: tidy 
extension is not installed.\n" );
                                } else {
                                        $out = MWTidy::tidy( $out );
-                                       $out = preg_replace( '/\s+$/', '', 
$out);
+                                       $out = preg_replace( '/\s+$/', '', $out 
);
                                }
                        }
 
diff --git a/tests/phpunit/includes/parser/TidyTest.php 
b/tests/phpunit/includes/parser/TidyTest.php
index 7b2a1da..c869258 100644
--- a/tests/phpunit/includes/parser/TidyTest.php
+++ b/tests/phpunit/includes/parser/TidyTest.php
@@ -58,7 +58,7 @@
                        array( '<mw:toc>foo</mw:toc>', '<mw:toc>foo</mw:toc>', 
'<mw:toc> should survive tidy' ),
                        array( "<link foo=\"bar\" />\nfoo", '<link 
foo="bar"/>foo', '<link> should survive tidy' ),
                        array( "<meta foo=\"bar\" />\nfoo", '<meta 
foo="bar"/>foo', '<meta> should survive tidy' ),
-                       array( $testMathML , $testMathML, '<math> should 
survive tidy' ),
+                       array( $testMathML, $testMathML, '<math> should survive 
tidy' ),
                );
        }
 }
diff --git a/tests/phpunit/includes/resourceloader/ResourceLoaderModuleTest.php 
b/tests/phpunit/includes/resourceloader/ResourceLoaderModuleTest.php
index 6ca4793..b0edaaf 100644
--- a/tests/phpunit/includes/resourceloader/ResourceLoaderModuleTest.php
+++ b/tests/phpunit/includes/resourceloader/ResourceLoaderModuleTest.php
@@ -10,7 +10,7 @@
                SkinFactory::getDefaultInstance()->register(
                        'fakeskin',
                        'FakeSkin',
-                       function(){
+                       function () {
                        }
                );
        }
diff --git a/tests/phpunit/includes/skins/SkinFactoryTest.php 
b/tests/phpunit/includes/skins/SkinFactoryTest.php
index 36c56a9..d3663c8 100644
--- a/tests/phpunit/includes/skins/SkinFactoryTest.php
+++ b/tests/phpunit/includes/skins/SkinFactoryTest.php
@@ -56,7 +56,9 @@
        public function testGetSkinNames() {
                $factory = new SkinFactory();
                // A fake callback we can use that will never be called
-               $callback = function() {};
+               $callback = function () {
+                       // NOP
+               };
                $factory->register( 'skin1', 'Skin1', $callback );
                $factory->register( 'skin2', 'Skin2', $callback );
                $names = $factory->getSkinNames();
diff --git a/tests/testHelpers.inc b/tests/testHelpers.inc
index 2f5fa9e..890952e 100644
--- a/tests/testHelpers.inc
+++ b/tests/testHelpers.inc
@@ -423,7 +423,7 @@
                $input = $this->checkSection( array( 'wikitext', 'input' ), 
false );
                $result = $this->checkSection( array( 'html/php', 'html/*', 
'html', 'result' ), false );
                // some tests have "with tidy" and "without tidy" variants
-               $tidy = $this->checkSection( array( 'html/php+tidy', 
'html+tidy'), false );
+               $tidy = $this->checkSection( array( 'html/php+tidy', 
'html+tidy' ), false );
                if ( $tidy != false ) {
                        if ( $this->nextSubTest == 0 ) {
                                if ( $result != false ) {
@@ -475,9 +475,11 @@
 
        function readNextTest() {
                # Run additional subtests of previous test
-               while ( $this->nextSubTest > 0 )
-                       if ( $this->setupCurrentTest() )
+               while ( $this->nextSubTest > 0 ) {
+                       if ( $this->setupCurrentTest() ) {
                                return true;
+                       }
+               }
 
                $this->clearSection();
                # Reset hooks for the delayed test object
@@ -554,8 +556,9 @@
                                if ( $this->section == 'end' ) {
                                        $this->checkSection( 'test' );
                                        do {
-                                               if ( $this->setupCurrentTest() )
+                                               if ( $this->setupCurrentTest() 
) {
                                                        return true;
+                                               }
                                        } while ( $this->nextSubTest > 0 );
                                        # go on to next test (since this was 
disabled)
                                        $this->clearSection();

-- 
To view, visit https://gerrit.wikimedia.org/r/156149
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ie5bbf680d6fbe0f0872dab2700c16b1394906a72
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Umherirrender <[email protected]>
Gerrit-Reviewer: Aaron Schulz <[email protected]>
Gerrit-Reviewer: Cscott <[email protected]>
Gerrit-Reviewer: Daniel Friesen <[email protected]>
Gerrit-Reviewer: Jack Phoenix <[email protected]>
Gerrit-Reviewer: Jackmcbarn <[email protected]>
Gerrit-Reviewer: Siebrand <[email protected]>
Gerrit-Reviewer: TTO <[email protected]>
Gerrit-Reviewer: Umherirrender <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to