Merge "Fixed spacing"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Wed, 27 Aug 2014 18:43:05 +0000 (18:43 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Wed, 27 Aug 2014 18:43:05 +0000 (18:43 +0000)
18 files changed:
includes/Revision.php
includes/Setup.php
includes/Title.php
includes/WatchedItem.php
includes/htmlform/HTMLAutoCompleteSelectField.php
includes/htmlform/HTMLForm.php
includes/objectcache/MemcachedBagOStuff.php
includes/search/SearchHighlighter.php
includes/skins/SkinFactory.php
includes/specials/SpecialImport.php
tests/parser/parserTest.inc
tests/phpunit/MediaWikiTestCase.php
tests/phpunit/includes/deferred/DeferredUpdatesTest.php
tests/phpunit/includes/parser/NewParserTest.php
tests/phpunit/includes/parser/TidyTest.php
tests/phpunit/includes/resourceloader/ResourceLoaderModuleTest.php
tests/phpunit/includes/skins/SkinFactoryTest.php
tests/testHelpers.inc

index cad9f2c..28a825d 100644 (file)
@@ -1658,7 +1658,7 @@ class Revision implements IDBAccessObject {
         *                          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 @@ class Revision implements IDBAccessObject {
                        } 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;
                                        }
index acceb59..6dbaac6 100644 (file)
@@ -265,16 +265,16 @@ if ( $wgSkipSkin ) {
 
 // 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;
        } );
 } );
index bcf9cbd..7fdeb05 100644 (file)
@@ -2265,7 +2265,7 @@ class Title {
                } elseif ( $action == 'delete' ) {
                        $tempErrors = $this->checkPageRestrictions( 'edit',
                                $user, array(), $doExpensiveQueries, true );
-                       if( !$tempErrors ) {
+                       if ( !$tempErrors ) {
                                $tempErrors = $this->checkCascadingSourcesRestrictions( 'edit',
                                        $user, $tempErrors, $doExpensiveQueries, true );
                        }
index 488932c..ab136b8 100644 (file)
@@ -309,7 +309,7 @@ class WatchedItem {
                }
 
                $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' );
index 4ea5e99..4905362 100644 (file)
@@ -106,7 +106,7 @@ class HTMLAutoCompleteSelectField extends HTMLTextField {
 
                if ( $this->getOptions() ) {
                        $attribs['data-hide-if'] = FormatJson::encode(
-                               array( '!==',  $this->mName . '-select', 'other' )
+                               array( '!==', $this->mName . '-select', 'other' )
                        );
                }
 
index 50f7037..fc2222a 100644 (file)
@@ -937,7 +937,7 @@ class HTMLForm extends ContextSource {
                        }
 
                        if ( $useMediaWikiUIEverywhere ) {
-                               if ( isset( $attrs['class' ] ) ) {
+                               if ( isset( $attrs['class'] ) ) {
                                        $attrs['class'] .= ' mw-ui-button';
                                } else {
                                        $attrs['class'] = 'mw-ui-button';
index 54a464d..53edcdd 100644 (file)
@@ -154,7 +154,7 @@ class MemcachedBagOStuff extends BagOStuff {
                if ( $expiry > 2592000 && $expiry < 1000000000 ) {
                        $expiry = 2592000;
                }
-               return (int) $expiry;
+               return (int)$expiry;
        }
 
        /**
index 0bd6ca8..109c466 100644 (file)
@@ -564,11 +564,11 @@ class SearchHighlighter {
         * @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 );
        }
index 6448088..fb40857 100644 (file)
@@ -70,7 +70,7 @@ class SkinFactory {
         *     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
         */
index 1b45315..eab4784 100644 (file)
@@ -327,7 +327,7 @@ class SpecialImport extends SpecialPage {
                        foreach ( $importSources as $key => $value ) {
                                if ( is_int( $key ) ) {
                                        $key = $value;
-                               } else if ( $value !== $key ) {
+                               } elseif ( $value !== $key ) {
                                        $needSubprojectField = true;
                                }
 
index a342fec..25ffb02 100644 (file)
@@ -625,7 +625,7 @@ class ParserTest {
                                        return $this->showSkipped();
                                }
                                $out = MWTidy::tidy( $out );
-                               $out = preg_replace( '/\s+$/', '', $out);
+                               $out = preg_replace( '/\s+$/', '', $out );
                        }
 
                        if ( isset( $opts['showtitle'] ) ) {
index 873d979..1166817 100644 (file)
@@ -1120,13 +1120,13 @@ abstract class MediaWikiTestCase extends PHPUnit_Framework_TestCase {
         * @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 );
        }
 }
index b3d57e7..5348c85 100644 (file)
@@ -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 @@ class DeferredUpdatesTest extends MediaWikiTestCase {
                        function () use ( $updates ) {
                                echo $updates['2'];
                                DeferredUpdates::addCallableUpdate(
-                                       function() use ( $updates ) {
+                                       function () use ( $updates ) {
                                                echo $updates['2-1'];
                                        }
                                );
index 4e8c11f..dda15ec 100644 (file)
@@ -754,7 +754,7 @@ class NewParserTest extends MediaWikiTestCase {
                                        $this->markTestSkipped( "SKIPPED: tidy extension is not installed.\n" );
                                } else {
                                        $out = MWTidy::tidy( $out );
-                                       $out = preg_replace( '/\s+$/', '', $out);
+                                       $out = preg_replace( '/\s+$/', '', $out );
                                }
                        }
 
index 7b2a1da..c869258 100644 (file)
@@ -58,7 +58,7 @@ MathML;
                        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' ),
                );
        }
 }
index 6ca4793..b0edaaf 100644 (file)
@@ -10,7 +10,7 @@ class ResourceLoaderModuleTest extends ResourceLoaderTestCase {
                SkinFactory::getDefaultInstance()->register(
                        'fakeskin',
                        'FakeSkin',
-                       function(){
+                       function () {
                        }
                );
        }
index 36c56a9..d3663c8 100644 (file)
@@ -56,7 +56,9 @@ class SkinFactoryTest extends MediaWikiTestCase {
        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();
index 2f5fa9e..890952e 100644 (file)
@@ -423,7 +423,7 @@ class TestFileIterator implements Iterator {
                $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 @@ class TestFileIterator implements Iterator {
 
        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 @@ class TestFileIterator implements Iterator {
                                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();