Merge "Remove empty lines at begin of function, if, foreach, switch"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Mon, 3 Jul 2017 19:19:27 +0000 (19:19 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Mon, 3 Jul 2017 19:19:27 +0000 (19:19 +0000)
129 files changed:
docs/hooks.txt
includes/Block.php
includes/Category.php
includes/CategoryFinder.php
includes/CategoryViewer.php
includes/DeprecatedGlobal.php
includes/FeedUtils.php
includes/Linker.php
includes/MediaWiki.php
includes/MovePage.php
includes/OutputHandler.php
includes/Sanitizer.php
includes/Title.php
includes/actions/CreditsAction.php
includes/api/ApiBase.php
includes/api/ApiEditPage.php
includes/api/ApiModuleManager.php
includes/api/ApiQueryBase.php
includes/api/ApiQueryUsers.php
includes/cache/BacklinkCache.php
includes/changes/ChangesListBooleanFilter.php
includes/changes/ChangesListFilter.php
includes/changes/ChangesListFilterGroup.php
includes/changes/ChangesListStringOptionsFilterGroup.php
includes/changes/EnhancedChangesList.php
includes/changes/OldChangesList.php
includes/changetags/ChangeTags.php
includes/changetags/ChangeTagsList.php
includes/changetags/ChangeTagsLogList.php
includes/changetags/ChangeTagsRevisionList.php
includes/content/AbstractContent.php
includes/content/ContentHandler.php
includes/content/WikitextContent.php
includes/debug/logger/monolog/LegacyHandler.php
includes/diff/DiffEngine.php
includes/diff/DiffFormatter.php
includes/diff/TableDiffFormatter.php
includes/export/XmlDumpWriter.php
includes/gallery/PackedOverlayImageGallery.php
includes/import/WikiImporter.php
includes/installer/PostgresUpdater.php
includes/interwiki/InterwikiLookupAdapter.php
includes/libs/CryptRand.php
includes/libs/objectcache/MemcachedClient.php
includes/libs/xmp/XMP.php
includes/media/BitmapMetadataHandler.php
includes/media/Exif.php
includes/media/IPTC.php
includes/media/JpegMetadataExtractor.php
includes/media/MediaHandler.php
includes/media/PNG.php
includes/media/TransformationalImageHandler.php
includes/page/Article.php
includes/page/WikiPage.php
includes/parser/CoreParserFunctions.php
includes/parser/Parser.php
includes/parser/Preprocessor_DOM.php
includes/parser/Preprocessor_Hash.php
includes/resourceloader/ResourceLoaderModule.php
includes/resourceloader/ResourceLoaderStartUpModule.php
includes/search/SearchNearMatcher.php
includes/site/MediaWikiPageNameNormalizer.php
includes/skins/MediaWikiI18N.php
includes/skins/Skin.php
includes/specialpage/ChangesListSpecialPage.php
includes/specialpage/QueryPage.php
includes/specialpage/SpecialPageFactory.php
includes/specials/SpecialChangeEmail.php
includes/specials/SpecialContributions.php
includes/specials/SpecialExport.php
includes/specials/SpecialPageData.php
includes/specials/SpecialRecentchanges.php
includes/specials/SpecialRecentchangeslinked.php
includes/specials/SpecialSearch.php
includes/specials/SpecialSpecialpages.php
includes/specials/SpecialStatistics.php
includes/specials/SpecialTags.php
includes/specials/SpecialUpload.php
includes/specials/SpecialUserrights.php
includes/specials/SpecialWatchlist.php
includes/title/MediaWikiTitleCodec.php
includes/upload/UploadBase.php
includes/user/UserGroupMembership.php
includes/utils/AutoloadGenerator.php
includes/widget/search/InterwikiSearchResultSetWidget.php
includes/widget/search/InterwikiSearchResultWidget.php
languages/Language.php
languages/LanguageConverter.php
languages/classes/LanguageBe_tarask.php
languages/classes/LanguageKk.php
languages/classes/LanguageKu_ku.php
languages/classes/LanguageYue.php
languages/classes/LanguageZh_hans.php
maintenance/checkSyntax.php
maintenance/deleteOldRevisions.php
maintenance/dumpTextPass.php
maintenance/importImages.php
maintenance/language/checkDupeMessages.php
maintenance/namespaceDupes.php
maintenance/nukePage.php
maintenance/oracle/alterSharedConstraints.php
maintenance/refreshLinks.php
maintenance/removeUnusedAccounts.php
maintenance/userOptions.inc
mw-config/index.php
phpcs.xml
tests/phpunit/MediaWikiTestCase.php
tests/phpunit/includes/GlobalFunctions/GlobalTest.php
tests/phpunit/includes/LinkerTest.php
tests/phpunit/includes/WatchedItemIntegrationTest.php
tests/phpunit/includes/api/generateRandomImages.php
tests/phpunit/includes/api/query/ApiQueryBasicTest.php
tests/phpunit/includes/changes/TestRecentChangesHelper.php
tests/phpunit/includes/import/ImportLinkCacheIntegrationTest.php
tests/phpunit/includes/interwiki/InterwikiLookupAdapterTest.php
tests/phpunit/includes/libs/xmp/XMPTest.php
tests/phpunit/includes/linkeddata/PageDataRequestHandlerTest.php
tests/phpunit/includes/media/GIFMetadataExtractorTest.php
tests/phpunit/includes/password/UserPasswordPolicyTest.php
tests/phpunit/includes/specials/SpecialPreferencesTest.php
tests/phpunit/includes/title/ForeignTitleTest.php
tests/phpunit/includes/title/NamespaceAwareForeignTitleFactoryTest.php
tests/phpunit/includes/title/SubpageImportTitleFactoryTest.php
tests/phpunit/includes/utils/MWCryptHKDFTest.php
tests/phpunit/maintenance/DumpTestCase.php
tests/phpunit/maintenance/MaintenanceTest.php
tests/phpunit/maintenance/backupTextPassTest.php
tests/phpunit/maintenance/backup_LogTest.php
tests/qunit/data/testrunner.js

index 3d310c3..62e5bdb 100644 (file)
@@ -74,9 +74,7 @@ Using a hook-running strategy, we can avoid having all this option-specific
 stuff in our mainline code. Using hooks, the function becomes:
 
        function showAnArticle( $article ) {
-
                if ( Hooks::run( 'ArticleShow', array( &$article ) ) ) {
-
                        # code to actually show the article goes here
 
                        Hooks::run( 'ArticleShowComplete', array( &$article ) );
index a7e7308..2c935df 100644 (file)
@@ -829,7 +829,6 @@ class Block {
         * @return bool
         */
        public function deleteIfExpired() {
-
                if ( $this->isExpired() ) {
                        wfDebug( "Block::deleteIfExpired() -- deleting\n" );
                        $this->delete();
@@ -1111,7 +1110,6 @@ class Block {
         *     not be the same as the target you gave if you used $vagueTarget!
         */
        public static function newFromTarget( $specificTarget, $vagueTarget = null, $fromMaster = false ) {
-
                list( $target, $type ) = self::parseTarget( $specificTarget );
                if ( $type == Block::TYPE_ID || $type == Block::TYPE_AUTO ) {
                        return Block::newFromID( $target );
index 5c7cb8d..c22ea64 100644 (file)
@@ -269,7 +269,6 @@ class Category {
         * @return TitleArray TitleArray object for category members.
         */
        public function getMembers( $limit = false, $offset = '' ) {
-
                $dbr = wfGetDB( DB_REPLICA );
 
                $conds = [ 'cl_to' => $this->getName(), 'cl_from = page_id' ];
index 595cf95..89bf5c7 100644 (file)
@@ -186,7 +186,6 @@ class CategoryFinder {
         * Scans a "parent layer" of the articles/categories in $this->next
         */
        private function scanNextLayer() {
-
                # Find all parents of the article currently in $this->next
                $layer = [];
                $res = $this->dbr->select(
index 7086a48..9d692d7 100644 (file)
@@ -108,7 +108,6 @@ class CategoryViewer extends ContextSource {
         * @return string HTML output
         */
        public function getHTML() {
-
                $this->showGallery = $this->getConfig()->get( 'CategoryMagicGallery' )
                        && !$this->getOutput()->mNoGallery;
 
index 14329d3..7c592c6 100644 (file)
@@ -38,7 +38,6 @@ class DeprecatedGlobal extends StubObject {
        // PSR2.Methods.MethodDeclaration.Underscore
        // PSR2.Classes.PropertyDeclaration.ScopeMissing
        function _newObject() {
-
                /* Put the caller offset for wfDeprecated as 6, as
                 * that gives the function that uses this object, since:
                 * 1 = this function ( _newObject )
index 3268291..96a88d3 100644 (file)
@@ -188,7 +188,6 @@ class FeedUtils {
                        }
 
                        if ( $html === null ) {
-
                                // Omit large new page diffs, T31110
                                // Also use diff link for non-textual content
                                $diffText = self::getDiffLink( $title, $newid );
index 6942a39..5845532 100644 (file)
@@ -1882,7 +1882,6 @@ class Linker {
         * @return string HTML output
         */
        public static function formatHiddenCategories( $hiddencats ) {
-
                $outText = '';
                if ( count( $hiddencats ) > 0 ) {
                        # Construct the HTML
index 9fdc95a..4df4d76 100644 (file)
@@ -821,7 +821,6 @@ class MediaWiki {
 
                        // ATTENTION: This hook is likely to be removed soon due to overall design of the system.
                        if ( Hooks::run( 'BeforeHttpsRedirect', [ $this->context, &$redirUrl ] ) ) {
-
                                if ( $request->wasPosted() ) {
                                        // This is weird and we'd hope it almost never happens. This
                                        // means that a POST came in via HTTP and policy requires us
index ce6ecad..8d0c33d 100644 (file)
@@ -440,8 +440,8 @@ class MovePage {
         * @throws MWException
         */
        private function moveToInternal( User $user, &$nt, $reason = '', $createRedirect = true,
-               array $changeTags = [] ) {
-
+               array $changeTags = []
+       ) {
                global $wgContLang;
                if ( $nt->exists() ) {
                        $moveOverRedirect = true;
index 2f47006..2dc3732 100644 (file)
@@ -183,7 +183,6 @@ function wfDoContentLength( $length ) {
  * @return string
  */
 function wfHtmlValidationHandler( $s ) {
-
        $errors = '';
        if ( MWTidy::checkErrors( $s, $errors ) ) {
                return $s;
index 8424432..dd4a314 100644 (file)
@@ -906,7 +906,6 @@ class Sanitizer {
         * @return string normalized css
         */
        public static function normalizeCss( $value ) {
-
                // Decode character references like &#123;
                $value = Sanitizer::decodeCharReferences( $value );
 
index 2ebeb0d..083a725 100644 (file)
@@ -3735,8 +3735,8 @@ class Title implements LinkTarget {
         * @return array|bool True on success, getUserPermissionsErrors()-like array on failure
         */
        public function moveTo( &$nt, $auth = true, $reason = '', $createRedirect = true,
-               array $changeTags = [] ) {
-
+               array $changeTags = []
+       ) {
                global $wgUser;
                $err = $this->isValidMoveOperation( $nt, $auth, $reason );
                if ( is_array( $err ) ) {
@@ -3773,8 +3773,8 @@ class Title implements LinkTarget {
         *     no pages were moved
         */
        public function moveSubpages( $nt, $auth = true, $reason = '', $createRedirect = true,
-               array $changeTags = [] ) {
-
+               array $changeTags = []
+       ) {
                global $wgMaximumMovedPages;
                // Check permissions
                if ( !$this->userCan( 'move-subpages' ) ) {
index 803695a..021f426 100644 (file)
@@ -44,7 +44,6 @@ class CreditsAction extends FormlessAction {
         * @return string HTML
         */
        public function onView() {
-
                if ( $this->page->getID() == 0 ) {
                        $s = $this->msg( 'nocredits' )->parse();
                } else {
index 3a9167f..2dcece1 100644 (file)
@@ -967,7 +967,6 @@ abstract class ApiBase extends ContextSource {
         * @return bool
         */
        protected function getWatchlistValue( $watchlist, $titleObj, $userOption = null ) {
-
                $userWatching = $this->getUser()->isWatched( $titleObj, User::IGNORE_USER_RIGHTS );
 
                switch ( $watchlist ) {
index 0b8156b..2245195 100644 (file)
@@ -64,7 +64,6 @@ class ApiEditPage extends ApiBase {
 
                                /** @var $newTitle Title */
                                foreach ( $titles as $id => $newTitle ) {
-
                                        if ( !isset( $titles[$id - 1] ) ) {
                                                $titles[$id - 1] = $oldTitle;
                                        }
index 42dfb71..b5e47ac 100644 (file)
@@ -97,7 +97,6 @@ class ApiModuleManager extends ContextSource {
         * @param string $group Which group modules belong to (action,format,...)
         */
        public function addModules( array $modules, $group ) {
-
                foreach ( $modules as $name => $moduleSpec ) {
                        if ( is_array( $moduleSpec ) ) {
                                $class = $moduleSpec['class'];
index baefbda..f8eaa84 100644 (file)
@@ -356,7 +356,6 @@ abstract class ApiQueryBase extends ApiBase {
         * @return ResultWrapper
         */
        protected function select( $method, $extraQuery = [], array &$hookData = null ) {
-
                $tables = array_merge(
                        $this->tables,
                        isset( $extraQuery['tables'] ) ? (array)$extraQuery['tables'] : []
index 5b094cd..2a0eadd 100644 (file)
@@ -182,7 +182,6 @@ class ApiQueryUsers extends ApiQueryBase {
                        }
 
                        foreach ( $res as $row ) {
-
                                // create user object and pass along $userGroups if set
                                // that reduces the number of database queries needed in User dramatically
                                if ( !isset( $userGroups ) ) {
index 11f3c2b..4341daa 100644 (file)
@@ -174,7 +174,6 @@ class BacklinkCache {
         * @return ResultWrapper
         */
        protected function queryLinks( $table, $startId, $endId, $max, $select = 'all' ) {
-
                $fromField = $this->getPrefix( $table ) . '_from';
 
                if ( !$startId && !$endId && is_infinite( $max )
index 73c0fb0..930269c 100644 (file)
@@ -184,8 +184,8 @@ class ChangesListBooleanFilter extends ChangesListFilter {
         * @param array &$join_conds Array of join conditions; see IDatabase::select $join_conds
         */
        public function modifyQuery( IDatabase $dbr, ChangesListSpecialPage $specialPage,
-               &$tables, &$fields, &$conds, &$query_options, &$join_conds ) {
-
+               &$tables, &$fields, &$conds, &$query_options, &$join_conds
+       ) {
                if ( $this->queryCallable === null ) {
                        return;
                }
index bd895bb..0b34a5d 100644 (file)
@@ -186,12 +186,8 @@ abstract class ChangesListFilter {
         * @param string $backwardKey i18n key for conflict message in reverse
         *  direction (when in UI context of $other object)
         */
-       public function conflictsWith( $other, $globalKey, $forwardKey,
-               $backwardKey ) {
-
-               if ( $globalKey === null || $forwardKey === null ||
-                       $backwardKey === null ) {
-
+       public function conflictsWith( $other, $globalKey, $forwardKey, $backwardKey ) {
+               if ( $globalKey === null || $forwardKey === null || $backwardKey === null ) {
                        throw new MWException( 'All messages must be specified' );
                }
 
@@ -220,9 +216,7 @@ abstract class ChangesListFilter {
         * @param string $contextDescription i18n key for conflict message in this
         *  direction (when in UI context of $this object)
         */
-       public function setUnidirectionalConflict( $other, $globalDescription,
-               $contextDescription ) {
-
+       public function setUnidirectionalConflict( $other, $globalDescription, $contextDescription ) {
                if ( $other instanceof ChangesListFilterGroup ) {
                        $this->conflictingGroups[] = [
                                'group' => $other->getName(),
index 3555158..0dc1145 100644 (file)
@@ -229,12 +229,8 @@ abstract class ChangesListFilterGroup {
         * @param string $backwardKey i18n key for conflict message in reverse
         *  direction (when in UI context of $other object)
         */
-       public function conflictsWith( $other, $globalKey, $forwardKey,
-               $backwardKey ) {
-
-               if ( $globalKey === null || $forwardKey === null ||
-                       $backwardKey === null ) {
-
+       public function conflictsWith( $other, $globalKey, $forwardKey, $backwardKey ) {
+               if ( $globalKey === null || $forwardKey === null || $backwardKey === null ) {
                        throw new MWException( 'All messages must be specified' );
                }
 
@@ -263,9 +259,7 @@ abstract class ChangesListFilterGroup {
         * @param string $contextDescription i18n key for conflict message in this
         *  direction (when in UI context of $this object)
         */
-       public function setUnidirectionalConflict( $other, $globalDescription,
-               $contextDescription ) {
-
+       public function setUnidirectionalConflict( $other, $globalDescription, $contextDescription ) {
                if ( $other instanceof ChangesListFilterGroup ) {
                        $this->conflictingGroups[] = [
                                'group' => $other->getName(),
index 86b4a8b..487120d 100644 (file)
@@ -185,8 +185,8 @@ class ChangesListStringOptionsFilterGroup extends ChangesListFilterGroup {
         * @param string $value URL parameter value
         */
        public function modifyQuery( IDatabase $dbr, ChangesListSpecialPage $specialPage,
-               &$tables, &$fields, &$conds, &$query_options, &$join_conds, $value ) {
-
+               &$tables, &$fields, &$conds, &$query_options, &$join_conds, $value
+       ) {
                $allowedFilterNames = [];
                foreach ( $this->filters as $filter ) {
                        $allowedFilterNames[] = $filter->getName();
index 64d4aa7..30c6995 100644 (file)
@@ -98,7 +98,6 @@ class EnhancedChangesList extends ChangesList {
         * @return string
         */
        public function recentChangesLine( &$rc, $watched = false, $linenumber = null ) {
-
                $date = $this->getLanguage()->userDate(
                        $rc->mAttribs['rc_timestamp'],
                        $this->getUser()
index 2a53d66..09205bd 100644 (file)
@@ -32,7 +32,6 @@ class OldChangesList extends ChangesList {
         * @return string|bool
         */
        public function recentChangesLine( &$rc, $watched = false, $linenumber = null ) {
-
                $classes = $this->getHTMLClasses( $rc, $watched );
                // use mw-line-even/mw-line-odd class only if linenumber is given (feature from T16468)
                if ( $linenumber ) {
index 6ba9c10..c9b5f96 100644 (file)
@@ -201,7 +201,6 @@ class ChangeTags {
                &$rev_id = null, &$log_id = null, $params = null, RecentChange $rc = null,
                User $user = null
        ) {
-
                $tagsToAdd = array_filter( (array)$tagsToAdd ); // Make sure we're submitting all tags...
                $tagsToRemove = array_filter( (array)$tagsToRemove );
 
@@ -275,8 +274,8 @@ class ChangeTags {
                // update the tag_summary row
                $prevTags = [];
                if ( !self::updateTagSummaryRow( $tagsToAdd, $tagsToRemove, $rc_id, $rev_id,
-                       $log_id, $prevTags ) ) {
-
+                       $log_id, $prevTags )
+               ) {
                        // nothing to do
                        return [ [], [], $prevTags ];
                }
@@ -343,8 +342,8 @@ class ChangeTags {
         * @since 1.25
         */
        protected static function updateTagSummaryRow( &$tagsToAdd, &$tagsToRemove,
-               $rc_id, $rev_id, $log_id, &$prevTags = [] ) {
-
+               $rc_id, $rev_id, $log_id, &$prevTags = []
+       ) {
                $dbw = wfGetDB( DB_MASTER );
 
                $tsConds = array_filter( [
@@ -419,9 +418,7 @@ class ChangeTags {
         * @return Status
         * @since 1.25
         */
-       public static function canAddTagsAccompanyingChange( array $tags,
-               User $user = null ) {
-
+       public static function canAddTagsAccompanyingChange( array $tags, User $user = null ) {
                if ( !is_null( $user ) ) {
                        if ( !$user->isAllowed( 'applychangetags' ) ) {
                                return Status::newFatal( 'tags-apply-no-permission' );
@@ -465,7 +462,6 @@ class ChangeTags {
        public static function addTagsAccompanyingChangeWithChecks(
                array $tags, $rc_id, $rev_id, $log_id, $params, User $user
        ) {
-
                // are we allowed to do this?
                $result = self::canAddTagsAccompanyingChange( $tags, $user );
                if ( !$result->isOK() ) {
@@ -491,8 +487,8 @@ class ChangeTags {
         * @since 1.25
         */
        public static function canUpdateTags( array $tagsToAdd, array $tagsToRemove,
-               User $user = null ) {
-
+               User $user = null
+       ) {
                if ( !is_null( $user ) ) {
                        if ( !$user->isAllowed( 'changetags' ) ) {
                                return Status::newFatal( 'tags-update-no-permission' );
@@ -554,8 +550,8 @@ class ChangeTags {
         * @since 1.25
         */
        public static function updateTagsWithChecks( $tagsToAdd, $tagsToRemove,
-               $rc_id, $rev_id, $log_id, $params, $reason, User $user ) {
-
+               $rc_id, $rev_id, $log_id, $params, $reason, User $user
+       ) {
                if ( is_null( $tagsToAdd ) ) {
                        $tagsToAdd = [];
                }
@@ -792,8 +788,8 @@ class ChangeTags {
         * @since 1.25
         */
        protected static function logTagManagementAction( $action, $tag, $reason,
-               User $user, $tagCount = null, array $logEntryTags = [] ) {
-
+               User $user, $tagCount = null, array $logEntryTags = []
+       ) {
                $dbw = wfGetDB( DB_MASTER );
 
                $logEntry = new ManualLogEntry( 'managetags', $action );
@@ -869,8 +865,8 @@ class ChangeTags {
         * @since 1.25
         */
        public static function activateTagWithChecks( $tag, $reason, User $user,
-               $ignoreWarnings = false, array $logEntryTags = [] ) {
-
+               $ignoreWarnings = false, array $logEntryTags = []
+       ) {
                // are we allowed to do this?
                $result = self::canActivateTag( $tag, $user );
                if ( $ignoreWarnings ? !$result->isOK() : !$result->isGood() ) {
@@ -932,8 +928,8 @@ class ChangeTags {
         * @since 1.25
         */
        public static function deactivateTagWithChecks( $tag, $reason, User $user,
-               $ignoreWarnings = false, array $logEntryTags = [] ) {
-
+               $ignoreWarnings = false, array $logEntryTags = []
+       ) {
                // are we allowed to do this?
                $result = self::canDeactivateTag( $tag, $user );
                if ( $ignoreWarnings ? !$result->isOK() : !$result->isGood() ) {
@@ -1034,8 +1030,8 @@ class ChangeTags {
         * @since 1.25
         */
        public static function createTagWithChecks( $tag, $reason, User $user,
-               $ignoreWarnings = false, array $logEntryTags = [] ) {
-
+               $ignoreWarnings = false, array $logEntryTags = []
+       ) {
                // are we allowed to do this?
                $result = self::canCreateTag( $tag, $user );
                if ( $ignoreWarnings ? !$result->isOK() : !$result->isGood() ) {
@@ -1165,8 +1161,8 @@ class ChangeTags {
         * @since 1.25
         */
        public static function deleteTagWithChecks( $tag, $reason, User $user,
-               $ignoreWarnings = false, array $logEntryTags = [] ) {
-
+               $ignoreWarnings = false, array $logEntryTags = []
+       ) {
                // are we allowed to do this?
                $result = self::canDeleteTag( $tag, $user );
                if ( $ignoreWarnings ? !$result->isOK() : !$result->isGood() ) {
index a37f5f2..afbbb2b 100644 (file)
@@ -39,8 +39,8 @@ abstract class ChangeTagsList extends RevisionListBase {
         * @throws Exception If you give an unknown $typeName
         */
        public static function factory( $typeName, IContextSource $context,
-               Title $title, array $ids ) {
-
+               Title $title, array $ids
+       ) {
                switch ( $typeName ) {
                        case 'revision':
                                $className = 'ChangeTagsRevisionList';
index 271005f..e6d918a 100644 (file)
@@ -71,9 +71,7 @@ class ChangeTagsLogList extends ChangeTagsList {
         * @param User $user
         * @return Status
         */
-       public function updateChangeTagsOnAll( $tagsToAdd, $tagsToRemove, $params,
-               $reason, $user ) {
-
+       public function updateChangeTagsOnAll( $tagsToAdd, $tagsToRemove, $params, $reason, $user ) {
                // @codingStandardsIgnoreStart Generic.CodeAnalysis.ForLoopWithTestFunctionCall.NotAllowed
                for ( $this->reset(); $this->current(); $this->next() ) {
                        // @codingStandardsIgnoreEnd
index a0248c6..91193b0 100644 (file)
@@ -81,9 +81,7 @@ class ChangeTagsRevisionList extends ChangeTagsList {
         * @param User $user
         * @return Status
         */
-       public function updateChangeTagsOnAll( $tagsToAdd, $tagsToRemove, $params,
-               $reason, $user ) {
-
+       public function updateChangeTagsOnAll( $tagsToAdd, $tagsToRemove, $params, $reason, $user ) {
                // @codingStandardsIgnoreStart Generic.CodeAnalysis.ForLoopWithTestFunctionCall.NotAllowed
                for ( $this->reset(); $this->current(); $this->next() ) {
                        // @codingStandardsIgnoreEnd
index 811b241..1d472e0 100644 (file)
@@ -488,8 +488,8 @@ abstract class AbstractContent implements Content {
                $po = new ParserOutput();
 
                if ( Hooks::run( 'ContentGetParserOutput',
-                       [ $this, $title, $revId, $options, $generateHtml, &$po ] ) ) {
-
+                       [ $this, $title, $revId, $options, $generateHtml, &$po ] )
+               ) {
                        // Save and restore the old value, just in case something is reusing
                        // the ParserOptions object in some weird way.
                        $oldRedir = $options->getRedirectTarget();
index 85894ed..f85b00d 100644 (file)
@@ -619,8 +619,8 @@ abstract class ContentHandler {
         */
        public function createDifferenceEngine( IContextSource $context, $old = 0, $new = 0,
                $rcid = 0, // FIXME: Deprecated, no longer used
-               $refreshCache = false, $unhide = false ) {
-
+               $refreshCache = false, $unhide = false
+       ) {
                // hook: get difference engine
                $differenceEngine = null;
                if ( !Hooks::run( 'GetDifferenceEngine',
index d649baf..942390f 100644 (file)
@@ -68,7 +68,6 @@ class WikitextContent extends TextContent {
         * @see Content::replaceSection()
         */
        public function replaceSection( $sectionId, Content $with, $sectionTitle = '' ) {
-
                $myModelId = $this->getModel();
                $sectionModelId = $with->getModel();
 
index 58fca8e..dbeb136 100644 (file)
@@ -194,7 +194,6 @@ class LegacyHandler extends AbstractProcessingHandler {
 
                $text = (string)$record['formatted'];
                if ( $this->useUdp() ) {
-
                        // Clean it up for the multiplexer
                        if ( $this->prefix !== '' ) {
                                $leader = ( $this->prefix === '{channel}' ) ?
index 25d50d3..53378e5 100644 (file)
@@ -79,7 +79,6 @@ class DiffEngine {
         * @return DiffOp[]
         */
        public function diff( $from_lines, $to_lines ) {
-
                // Diff and store locally
                $this->diffInternal( $from_lines, $to_lines );
 
index 4b44b3c..6231c78 100644 (file)
@@ -60,7 +60,6 @@ abstract class DiffFormatter {
         * @return string The formatted output.
         */
        public function format( $diff ) {
-
                $xi = $yi = 1;
                $block = false;
                $context = [];
index bcae746..14307b5 100644 (file)
@@ -196,7 +196,6 @@ class TableDiffFormatter extends DiffFormatter {
         * @param string[] $closing
         */
        protected function changed( $orig, $closing ) {
-
                $diff = new WordLevelDiff( $orig, $closing );
                $del = $diff->orig();
                $add = $diff->closing();
index 5a1f92c..943408c 100644 (file)
@@ -199,7 +199,6 @@ class XmlDumpWriter {
         * @access private
         */
        function writeRevision( $row ) {
-
                $out = "    <revision>\n";
                $out .= "      " . Xml::element( 'id', null, strval( $row->rev_id ) ) . "\n";
                if ( isset( $row->rev_parent_id ) && $row->rev_parent_id ) {
@@ -287,7 +286,6 @@ class XmlDumpWriter {
         * @access private
         */
        function writeLogItem( $row ) {
-
                $out = "  <logitem>\n";
                $out .= "    " . Xml::element( 'id', null, strval( $row->log_id ) ) . "\n";
 
index e1ee7fa..db8ce68 100644 (file)
@@ -31,7 +31,6 @@ class PackedOverlayImageGallery extends PackedImageGallery {
         * @return string
         */
        protected function wrapGalleryText( $galleryText, $thumb ) {
-
                // If we have no text, do not output anything to avoid
                // ugly white overlay.
                if ( trim( $galleryText ) === '' ) {
index 2fc9f5e..63258cb 100644 (file)
@@ -394,8 +394,8 @@ class WikiImporter {
         * @return bool
         */
        public function finishImportPage( $title, $foreignTitle, $revCount,
-                       $sRevCount, $pageInfo ) {
-
+               $sRevCount, $pageInfo
+       ) {
                // Update article count statistics (T42009)
                // The normal counting logic in WikiPage->doEditUpdates() is designed for
                // one-revision-at-a-time editing, not bulk imports. In this situation it
@@ -691,7 +691,6 @@ class WikiImporter {
         * @return bool|mixed
         */
        private function processLogItem( $logInfo ) {
-
                $revision = new WikiRevision( $this->config );
 
                if ( isset( $logInfo['id'] ) ) {
index 39cb89c..0172f1a 100644 (file)
@@ -751,7 +751,6 @@ END;
        }
 
        protected function setDefault( $table, $field, $default ) {
-
                $info = $this->db->fieldInfo( $table, $field );
                if ( $info->defaultValue() !== $default ) {
                        $this->output( "Changing '$table.$field' default value\n" );
index 3baea1a..076c37f 100644 (file)
@@ -60,7 +60,6 @@ class InterwikiLookupAdapter implements InterwikiLookup {
         * @return bool Whether it exists
         */
        public function isValidInterwiki( $prefix ) {
-
                return array_key_exists( $prefix, $this->getInterwikiMap() );
        }
 
index 4b4a913..859d58b 100644 (file)
@@ -234,7 +234,6 @@ class CryptRand {
         * @return string Raw binary random data
         */
        public function generate( $bytes, $forceStrong = false ) {
-
                $bytes = floor( $bytes );
                static $buffer = '';
                if ( is_null( $this->strong ) ) {
index a94f86a..5cb49a9 100644 (file)
@@ -469,7 +469,6 @@ class MemcachedClient {
         * @return mixed
         */
        public function get( $key, &$casToken = null ) {
-
                if ( $this->_debug ) {
                        $this->_debugprint( "get($key)" );
                }
index 9d886bf..debe869 100644 (file)
@@ -135,7 +135,6 @@ class XMPReader implements LoggerAwareInterface {
         * Primary job is to initialize the XMLParser
         */
        function __construct( LoggerInterface $logger = null ) {
-
                if ( !function_exists( 'xml_parser_create_ns' ) ) {
                        // this should already be checked by this point
                        throw new RuntimeException( 'XMP support requires XML Parser' );
@@ -174,7 +173,6 @@ class XMPReader implements LoggerAwareInterface {
         * For example in jpeg's with extendedXMP
         */
        private function resetXMLParser() {
-
                $this->destroyXMLParser();
 
                $this->xmlParser = xml_parser_create_ns( 'UTF-8', ' ' );
@@ -495,7 +493,6 @@ class XMPReader implements LoggerAwareInterface {
         * @throws RuntimeException On invalid data
         */
        function char( $parser, $data ) {
-
                $data = trim( $data );
                if ( trim( $data ) === "" ) {
                        return;
@@ -644,7 +641,6 @@ class XMPReader implements LoggerAwareInterface {
         * @throws RuntimeException
         */
        private function endElementNested( $elm ) {
-
                /* cur item must be the same as $elm, unless if in MODE_STRUCT
                 * in which case it could also be rdf:Description */
                if ( $this->curItem[0] !== $elm
@@ -754,7 +750,6 @@ class XMPReader implements LoggerAwareInterface {
         * @param string $elm Namespace and element
         */
        private function endElementModeQDesc( $elm ) {
-
                if ( $elm === self::NS_RDF . ' value' ) {
                        list( $ns, $tag ) = explode( ' ', $this->curItem[0], 2 );
                        $this->saveValue( $ns, $tag, $this->charContent );
@@ -1191,7 +1186,6 @@ class XMPReader implements LoggerAwareInterface {
         * @throws RuntimeException
         */
        function startElement( $parser, $elm, $attribs ) {
-
                if ( $elm === self::NS_RDF . ' RDF'
                        || $elm === 'adobe:ns:meta/ xmpmeta'
                        || $elm === 'adobe:ns:meta/ xapmeta'
@@ -1332,7 +1326,6 @@ class XMPReader implements LoggerAwareInterface {
         * @param string $val Value to save
         */
        private function saveValue( $ns, $tag, $val ) {
-
                $info =& $this->items[$ns][$tag];
                $finalName = isset( $info['map_name'] )
                        ? $info['map_name'] : $tag;
index c5f9cbb..35c9751 100644 (file)
@@ -230,7 +230,6 @@ class BitmapMetadataHandler {
         * @return array Metadata array
         */
        public static function GIF( $filename ) {
-
                $meta = new self();
                $baseArray = GIFMetadataExtractor::getMetadata( $filename );
 
index 95fa859..9bfbc96 100644 (file)
@@ -362,7 +362,6 @@ class Exif {
         * if we make up our own types like Exif::DATE.
         */
        function collapseData() {
-
                $this->exifGPStoNumber( 'GPSLatitude' );
                $this->exifGPStoNumber( 'GPSDestLatitude' );
                $this->exifGPStoNumber( 'GPSLongitude' );
@@ -446,7 +445,6 @@ class Exif {
         */
        private function charCodeString( $prop ) {
                if ( isset( $this->mFilteredExifData[$prop] ) ) {
-
                        if ( strlen( $this->mFilteredExifData[$prop] ) <= 8 ) {
                                // invalid. Must be at least 9 bytes long.
 
index b7ebfc9..343adc2 100644 (file)
@@ -476,7 +476,6 @@ class IPTC {
         * only code that seems to have wide use. It does detect that code.
         */
        static function getCharset( $tag ) {
-
                // According to iim standard, charset is defined by the tag 1:90.
                // in which there are iso 2022 escape sequences to specify the character set.
                // the iim standard seems to encourage that all necessary escape sequences are
index 67c957a..211845c 100644 (file)
@@ -94,7 +94,6 @@ class JpegMetadataExtractor {
                                $buffer = fread( $fh, 1 );
                        }
                        if ( $buffer === "\xFE" ) {
-
                                // COM section -- file comment
                                // First see if valid utf-8,
                                // if not try to convert it to windows-1252.
index 8896264..76c979e 100644 (file)
@@ -157,7 +157,6 @@ abstract class MediaHandler {
         */
        function convertMetadataVersion( $metadata, $version = 1 ) {
                if ( !is_array( $metadata ) ) {
-
                        // unserialize to keep return parameter consistent.
                        MediaWiki\suppressWarnings();
                        $ret = unserialize( $metadata );
index 294abb3..b6288bc 100644 (file)
@@ -112,7 +112,6 @@ class PNGHandler extends BitmapHandler {
        }
 
        function isMetadataValid( $image, $metadata ) {
-
                if ( $metadata === self::BROKEN_FILE ) {
                        // Do not repetitivly regenerate metadata on broken file.
                        return self::METADATA_GOOD;
index 2a74e0d..742a5b7 100644 (file)
@@ -156,7 +156,6 @@ abstract class TransformationalImageHandler extends ImageHandler {
                        && $scalerParams['physicalHeight'] == $scalerParams['srcHeight']
                        && !isset( $scalerParams['quality'] )
                ) {
-
                        # normaliseParams (or the user) wants us to return the unscaled image
                        wfDebug( __METHOD__ . ": returning unscaled image\n" );
 
index dd54232..656e610 100644 (file)
@@ -214,7 +214,6 @@ class Article implements Page {
         * @since 1.21
         */
        protected function getContentObject() {
-
                if ( $this->mPage->getId() === 0 ) {
                        # If this is a MediaWiki:x message, then load the messages
                        # and return the message value for x.
@@ -569,8 +568,8 @@ class Article implements Page {
                                        $outputPage->setRevisionTimestamp( $this->mPage->getTimestamp() );
 
                                        if ( !Hooks::run( 'ArticleContentViewCustom',
-                                                       [ $this->fetchContentObject(), $this->getTitle(), $outputPage ] ) ) {
-
+                                               [ $this->fetchContentObject(), $this->getTitle(), $outputPage ] )
+                                       ) {
                                                # Allow extensions do their own custom view for certain pages
                                                $outputDone = true;
                                        }
index 5c7c7fe..3ba2d2e 100644 (file)
@@ -1314,7 +1314,6 @@ class WikiPage implements Page, IDBAccessObject {
         * @return bool
         */
        public function updateIfNewerOn( $dbw, $revision ) {
-
                $row = $dbw->selectRow(
                        [ 'revision', 'page' ],
                        [ 'rev_id', 'rev_timestamp', 'page_is_redirect' ],
@@ -1386,7 +1385,6 @@ class WikiPage implements Page, IDBAccessObject {
        public function replaceSectionContent(
                $sectionId, Content $sectionContent, $sectionTitle = '', $edittime = null
        ) {
-
                $baseRevId = null;
                if ( $edittime && $sectionId !== 'new' ) {
                        $dbr = wfGetDB( DB_REPLICA );
@@ -1425,7 +1423,6 @@ class WikiPage implements Page, IDBAccessObject {
        public function replaceSectionAtRev( $sectionId, Content $sectionContent,
                $sectionTitle = '', $baseRevId = null
        ) {
-
                if ( strval( $sectionId ) === '' ) {
                        // Whole-page edit; let the whole text through
                        $newContent = $sectionContent;
index e34d10b..f0f1f5f 100644 (file)
@@ -174,7 +174,6 @@ class CoreParserFunctions {
                        $magicWords = new MagicWordArray( [ 'url_path', 'url_query', 'url_wiki' ] );
                }
                switch ( $magicWords->matchStartToEnd( $arg ) ) {
-
                        // Encode as though it's a wiki page, '_' for ' '.
                        case 'url_wiki':
                                $func = 'wfUrlencode';
index b0d0e5c..9ea65e0 100644 (file)
@@ -1075,7 +1075,6 @@ class Parser {
         * @return string
         */
        public function doTableStuff( $text ) {
-
                $lines = StringUtils::explode( "\n", $text );
                $out = '';
                $td_history = []; # Is currently a td tag open?
@@ -1279,7 +1278,6 @@ class Parser {
         * @return string
         */
        public function internalParse( $text, $isMain = true, $frame = false ) {
-
                $origText = $text;
 
                // Avoid PHP 7.1 warning from passing $this by reference
@@ -1855,7 +1853,6 @@ class Parser {
         * @return string
         */
        public function replaceExternalLinks( $text ) {
-
                $bits = preg_split( $this->mExtLinkBracketedRegex, $text, -1, PREG_SPLIT_DELIM_CAPTURE );
                if ( $bits === false ) {
                        throw new MWException( "PCRE needs to be compiled with "
@@ -3031,7 +3028,6 @@ class Parser {
         * @return string The text of the template
         */
        public function braceSubstitution( $piece, $frame ) {
-
                // Flags
 
                // $text has been filled
@@ -3786,7 +3782,6 @@ class Parser {
         * @return array
         */
        public function argSubstitution( $piece, $frame ) {
-
                $error = false;
                $parts = $piece['parts'];
                $nameWithSpaces = $frame->expand( $piece['title'] );
@@ -3967,7 +3962,6 @@ class Parser {
         * @return string
         */
        public function doDoubleUnderscore( $text ) {
-
                # The position of __TOC__ needs to be recorded
                $mw = MagicWord::get( 'toc' );
                if ( $mw->match( $text ) ) {
@@ -4948,7 +4942,6 @@ class Parser {
         * @return string HTML
         */
        public function renderImageGallery( $text, $params ) {
-
                $mode = false;
                if ( isset( $params['mode'] ) ) {
                        $mode = $params['mode'];
index 7539307..3c750ad 100644 (file)
@@ -148,7 +148,6 @@ class Preprocessor_DOM extends Preprocessor {
         * @return PPNode_DOM
         */
        public function preprocessToObj( $text, $flags = 0 ) {
-
                $xml = $this->cacheGetTree( $text, $flags );
                if ( $xml === false ) {
                        $xml = $this->preprocessToXml( $text, $flags );
@@ -373,7 +372,6 @@ class Preprocessor_DOM extends Preprocessor {
                                }
                                // Handle comments
                                if ( isset( $matches[2] ) && $matches[2] == '!--' ) {
-
                                        // To avoid leaving blank lines, when a sequence of
                                        // space-separated comments is both preceded and followed by
                                        // a newline (ignoring spaces), then
index 597d1f2..25d253f 100644 (file)
@@ -304,7 +304,6 @@ class Preprocessor_Hash extends Preprocessor {
                                }
                                // Handle comments
                                if ( isset( $matches[2] ) && $matches[2] == '!--' ) {
-
                                        // To avoid leaving blank lines, when a sequence of
                                        // space-separated comments is both preceded and followed by
                                        // a newline (ignoring spaces), then
index 743b69b..1c767fa 100644 (file)
@@ -461,7 +461,6 @@ abstract class ResourceLoaderModule implements LoggerAwareInterface {
         * @param array $localFileRefs List of files
         */
        protected function saveFileDependencies( ResourceLoaderContext $context, $localFileRefs ) {
-
                try {
                        // Related bugs and performance considerations:
                        // 1. Don't needlessly change the database value with the same list in a
@@ -757,7 +756,6 @@ abstract class ResourceLoaderModule implements LoggerAwareInterface {
                // (e.g. startup module) iterate more than once over all modules to get versions.
                $contextHash = $context->getHash();
                if ( !array_key_exists( $contextHash, $this->versionHash ) ) {
-
                        if ( $this->enableModuleContentVersion() ) {
                                // Detect changes directly
                                $str = json_encode( $this->getModuleContent( $context ) );
index d92dc0a..8973fe3 100644 (file)
@@ -33,7 +33,6 @@ class ResourceLoaderStartUpModule extends ResourceLoaderModule {
         * @return array
         */
        protected function getConfigSettings( $context ) {
-
                $hash = $context->getHash();
                if ( isset( $this->configVars[$hash] ) ) {
                        return $this->configVars[$hash];
@@ -135,7 +134,6 @@ class ResourceLoaderStartUpModule extends ResourceLoaderModule {
                // The list of implicit dependencies won't be altered, so we can
                // cache them without having to worry.
                if ( !isset( $dependencyCache[$moduleName] ) ) {
-
                        if ( !isset( $registryData[$moduleName] ) ) {
                                // Dependencies may not exist
                                $dependencyCache[$moduleName] = [];
index 0400021..8e86865 100644 (file)
@@ -70,7 +70,6 @@ class SearchNearMatcher {
                }
 
                foreach ( $allSearchTerms as $term ) {
-
                        # Exact match? No need to look further.
                        $title = Title::newFromText( $term );
                        if ( is_null( $title ) ) {
index 1a079b4..c4e490a 100644 (file)
@@ -69,7 +69,6 @@ class MediaWikiPageNameNormalizer {
         * @throws \MWException
         */
        public function normalizePageName( $pageName, $apiUrl ) {
-
                // Check if we have strings as arguments.
                if ( !is_string( $pageName ) ) {
                        throw new \MWException( '$pageName must be a string' );
index 02e8391..7fcdb3c 100644 (file)
@@ -33,7 +33,6 @@ class MediaWikiI18N {
        }
 
        function translate( $value ) {
-
                // Hack for i18n:attributes in PHPTAL 1.0.0 dev version as of 2004-10-23
                $value = preg_replace( '/^string:/', '', $value );
 
index e9d2f07..6834ca5 100644 (file)
@@ -1391,7 +1391,6 @@ abstract class Skin extends ContextSource {
         * @return string
         */
        function getNewtalks() {
-
                $newMessagesAlert = '';
                $user = $this->getUser();
                $newtalks = $user->getNewMessageLinks();
index 1b561ef..0be0646 100644 (file)
@@ -92,8 +92,8 @@ abstract class ChangesListSpecialPage extends SpecialPage {
                                                'showHideSuffix' => 'showhideliu',
                                                'default' => false,
                                                'queryCallable' => function ( $specialClassName, $ctx, $dbr, &$tables, &$fields, &$conds,
-                                                       &$query_options, &$join_conds ) {
-
+                                                       &$query_options, &$join_conds
+                                               ) {
                                                        $conds[] = 'rc_user = 0';
                                                },
                                                'cssClassSuffix' => 'liu',
@@ -111,8 +111,8 @@ abstract class ChangesListSpecialPage extends SpecialPage {
                                                'showHideSuffix' => 'showhideanons',
                                                'default' => false,
                                                'queryCallable' => function ( $specialClassName, $ctx, $dbr, &$tables, &$fields, &$conds,
-                                                       &$query_options, &$join_conds ) {
-
+                                                       &$query_options, &$join_conds
+                                               ) {
                                                        $conds[] = 'rc_user != 0';
                                                },
                                                'cssClassSuffix' => 'anon',
@@ -182,8 +182,8 @@ abstract class ChangesListSpecialPage extends SpecialPage {
                                                'showHideSuffix' => 'showhidemine',
                                                'default' => false,
                                                'queryCallable' => function ( $specialClassName, $ctx, $dbr, &$tables, &$fields, &$conds,
-                                                       &$query_options, &$join_conds ) {
-
+                                                       &$query_options, &$join_conds
+                                               ) {
                                                        $user = $ctx->getUser();
                                                        $conds[] = 'rc_user_text != ' . $dbr->addQuotes( $user->getName() );
                                                },
@@ -198,8 +198,8 @@ abstract class ChangesListSpecialPage extends SpecialPage {
                                                'description' => 'rcfilters-filter-editsbyother-description',
                                                'default' => false,
                                                'queryCallable' => function ( $specialClassName, $ctx, $dbr, &$tables, &$fields, &$conds,
-                                                       &$query_options, &$join_conds ) {
-
+                                                       &$query_options, &$join_conds
+                                               ) {
                                                        $user = $ctx->getUser();
                                                        $conds[] = 'rc_user_text = ' . $dbr->addQuotes( $user->getName() );
                                                },
@@ -225,8 +225,8 @@ abstract class ChangesListSpecialPage extends SpecialPage {
                                                'showHideSuffix' => 'showhidebots',
                                                'default' => false,
                                                'queryCallable' => function ( $specialClassName, $ctx, $dbr, &$tables, &$fields, &$conds,
-                                                       &$query_options, &$join_conds ) {
-
+                                                       &$query_options, &$join_conds
+                                               ) {
                                                        $conds[] = 'rc_bot = 0';
                                                },
                                                'cssClassSuffix' => 'bot',
@@ -240,8 +240,8 @@ abstract class ChangesListSpecialPage extends SpecialPage {
                                                'description' => 'rcfilters-filter-humans-description',
                                                'default' => false,
                                                'queryCallable' => function ( $specialClassName, $ctx, $dbr, &$tables, &$fields, &$conds,
-                                                       &$query_options, &$join_conds ) {
-
+                                                       &$query_options, &$join_conds
+                                               ) {
                                                        $conds[] = 'rc_bot = 1';
                                                },
                                                'cssClassSuffix' => 'human',
@@ -269,8 +269,8 @@ abstract class ChangesListSpecialPage extends SpecialPage {
                                                'showHideSuffix' => 'showhideminor',
                                                'default' => false,
                                                'queryCallable' => function ( $specialClassName, $ctx, $dbr, &$tables, &$fields, &$conds,
-                                                       &$query_options, &$join_conds ) {
-
+                                                       &$query_options, &$join_conds
+                                               ) {
                                                        $conds[] = 'rc_minor = 0';
                                                },
                                                'cssClassSuffix' => 'minor',
@@ -284,8 +284,8 @@ abstract class ChangesListSpecialPage extends SpecialPage {
                                                'description' => 'rcfilters-filter-major-description',
                                                'default' => false,
                                                'queryCallable' => function ( $specialClassName, $ctx, $dbr, &$tables, &$fields, &$conds,
-                                                       &$query_options, &$join_conds ) {
-
+                                                       &$query_options, &$join_conds
+                                               ) {
                                                        $conds[] = 'rc_minor = 1';
                                                },
                                                'cssClassSuffix' => 'major',
@@ -347,8 +347,8 @@ abstract class ChangesListSpecialPage extends SpecialPage {
                                                'default' => false,
                                                'priority' => -2,
                                                'queryCallable' => function ( $specialClassName, $ctx, $dbr, &$tables, &$fields, &$conds,
-                                                       &$query_options, &$join_conds ) {
-
+                                                       &$query_options, &$join_conds
+                                               ) {
                                                        $conds[] = 'rc_type != ' . $dbr->addQuotes( RC_EDIT );
                                                },
                                                'cssClassSuffix' => 'src-mw-edit',
@@ -363,8 +363,8 @@ abstract class ChangesListSpecialPage extends SpecialPage {
                                                'default' => false,
                                                'priority' => -3,
                                                'queryCallable' => function ( $specialClassName, $ctx, $dbr, &$tables, &$fields, &$conds,
-                                                       &$query_options, &$join_conds ) {
-
+                                                       &$query_options, &$join_conds
+                                               ) {
                                                        $conds[] = 'rc_type != ' . $dbr->addQuotes( RC_NEW );
                                                },
                                                'cssClassSuffix' => 'src-mw-new',
@@ -382,8 +382,8 @@ abstract class ChangesListSpecialPage extends SpecialPage {
                                                'default' => false,
                                                'priority' => -5,
                                                'queryCallable' => function ( $specialClassName, $ctx, $dbr, &$tables, &$fields, &$conds,
-                                                       &$query_options, &$join_conds ) {
-
+                                                       &$query_options, &$join_conds
+                                               ) {
                                                        $conds[] = 'rc_type != ' . $dbr->addQuotes( RC_LOG );
                                                },
                                                'cssClassSuffix' => 'src-mw-log',
@@ -412,8 +412,8 @@ abstract class ChangesListSpecialPage extends SpecialPage {
                                                'showHideSuffix' => 'showhidepatr',
                                                'default' => false,
                                                'queryCallable' => function ( $specialClassName, $ctx, $dbr, &$tables, &$fields, &$conds,
-                                                       &$query_options, &$join_conds ) {
-
+                                                       &$query_options, &$join_conds
+                                               ) {
                                                        $conds[] = 'rc_patrolled = 0';
                                                },
                                                'cssClassSuffix' => 'patrolled',
@@ -427,8 +427,8 @@ abstract class ChangesListSpecialPage extends SpecialPage {
                                                'description' => 'rcfilters-filter-unpatrolled-description',
                                                'default' => false,
                                                'queryCallable' => function ( $specialClassName, $ctx, $dbr, &$tables, &$fields, &$conds,
-                                                       &$query_options, &$join_conds ) {
-
+                                                       &$query_options, &$join_conds
+                                               ) {
                                                        $conds[] = 'rc_patrolled = 1';
                                                },
                                                'cssClassSuffix' => 'unpatrolled',
@@ -450,8 +450,8 @@ abstract class ChangesListSpecialPage extends SpecialPage {
                        'default' => false,
                        'priority' => -4,
                        'queryCallable' => function ( $specialClassName, $ctx, $dbr, &$tables, &$fields, &$conds,
-                               &$query_options, &$join_conds ) {
-
+                               &$query_options, &$join_conds
+                       ) {
                                $conds[] = 'rc_type != ' . $dbr->addQuotes( RC_CATEGORIZE );
                        },
                        'cssClassSuffix' => 'src-mw-categorize',
@@ -470,7 +470,6 @@ abstract class ChangesListSpecialPage extends SpecialPage {
                $opts = $this->getOptions();
                /** @var ChangesListFilterGroup $group */
                foreach ( $this->getFilterGroups() as $group ) {
-
                        if ( $group->getConflictingGroups() ) {
                                wfLogWarning(
                                        $group->getName() .
@@ -487,7 +486,6 @@ abstract class ChangesListSpecialPage extends SpecialPage {
 
                        /** @var ChangesListFilter $filter */
                        foreach ( $group->getFilters() as $filter ) {
-
                                /** @var ChangesListFilter $conflictingFilter */
                                foreach ( $filter->getConflictingFilters() as $conflictingFilter ) {
                                        if (
@@ -1061,8 +1059,8 @@ abstract class ChangesListSpecialPage extends SpecialPage {
         * @param FormOptions $opts
         */
        protected function buildQuery( &$tables, &$fields, &$conds, &$query_options,
-               &$join_conds, FormOptions $opts ) {
-
+               &$join_conds, FormOptions $opts
+       ) {
                $dbr = $this->getDB();
                $user = $this->getUser();
 
@@ -1121,8 +1119,8 @@ abstract class ChangesListSpecialPage extends SpecialPage {
         * @return bool|ResultWrapper Result or false
         */
        protected function doMainQuery( $tables, $fields, $conds,
-               $query_options, $join_conds, FormOptions $opts ) {
-
+               $query_options, $join_conds, FormOptions $opts
+       ) {
                $tables[] = 'recentchanges';
                $fields = array_merge( RecentChange::selectFields(), $fields );
 
@@ -1332,8 +1330,8 @@ abstract class ChangesListSpecialPage extends SpecialPage {
         *   (optional)
         */
        public function filterOnUserExperienceLevel( $specialPageClassName, $context, $dbr,
-               &$tables, &$fields, &$conds, &$query_options, &$join_conds, $selectedExpLevels, $now = 0 ) {
-
+               &$tables, &$fields, &$conds, &$query_options, &$join_conds, $selectedExpLevels, $now = 0
+       ) {
                global $wgLearnerEdits,
                        $wgExperiencedUserEdits,
                        $wgLearnerMemberSince,
index 93873c0..73b8128 100644 (file)
@@ -601,7 +601,6 @@ abstract class QueryPage extends SpecialPage {
                        # Get the cached result, select one extra row for navigation
                        $res = $this->fetchFromCache( $dbLimit, $this->offset );
                        if ( !$this->listoutput ) {
-
                                # Fetch the timestamp of this update
                                $ts = $this->getCachedTimestamp();
                                $lang = $this->getLanguage();
index 88336dd..8dcb30c 100644 (file)
@@ -234,7 +234,6 @@ class SpecialPageFactory {
                global $wgPageLanguageUseDB, $wgContentHandlerUseDB;
 
                if ( !is_array( self::$list ) ) {
-
                        self::$list = self::$coreList;
 
                        if ( !$wgDisableInternalSearch ) {
index eb98fe7..c514300 100644 (file)
@@ -63,7 +63,6 @@ class SpecialChangeEmail extends FormSpecialPage {
        }
 
        protected function checkExecutePermissions( User $user ) {
-
                if ( !AuthManager::singleton()->allowsPropertyChange( 'emailaddress' ) ) {
                        throw new ErrorPageError( 'changeemail', 'cannotchangeemail' );
                }
index 40706ac..3845649 100644 (file)
@@ -329,7 +329,6 @@ class SpecialContributions extends IncludableSpecialPage {
         * @return array
         */
        public static function getUserLinks( SpecialPage $sp, User $target ) {
-
                $id = $target->getId();
                $username = $target->getName();
                $userpage = $target->getUserPage();
index f5e9e49..d5c5528 100644 (file)
@@ -330,7 +330,6 @@ class SpecialExport extends SpecialPage {
         * @param bool $exportall Whether to export everything
         */
        private function doExport( $page, $history, $list_authors, $exportall ) {
-
                // If we are grabbing everything, enable full history and ignore the rest
                if ( $exportall ) {
                        $history = WikiExporter::FULL;
index f7084a8..c52c426 100644 (file)
@@ -48,7 +48,6 @@ class SpecialPageData extends SpecialPage {
         * @return PageDataRequestHandler
         */
        private function newDefaultRequestHandler() {
-
                return new PageDataRequestHandler();
        }
 
index d28604e..d856d4b 100644 (file)
@@ -367,8 +367,8 @@ class SpecialRecentChanges extends ChangesListSpecialPage {
         * @inheritdoc
         */
        protected function buildQuery( &$tables, &$fields, &$conds,
-               &$query_options, &$join_conds, FormOptions $opts ) {
-
+               &$query_options, &$join_conds, FormOptions $opts
+       ) {
                $dbr = $this->getDB();
                parent::buildQuery( $tables, $fields, $conds,
                        $query_options, $join_conds, $opts );
@@ -392,8 +392,8 @@ class SpecialRecentChanges extends ChangesListSpecialPage {
         * @inheritdoc
         */
        protected function doMainQuery( $tables, $fields, $conds, $query_options,
-               $join_conds, FormOptions $opts ) {
-
+               $join_conds, FormOptions $opts
+       ) {
                $dbr = $this->getDB();
                $user = $this->getUser();
 
index 873285b..b3b9210 100644 (file)
@@ -50,8 +50,8 @@ class SpecialRecentChangesLinked extends SpecialRecentChanges {
         * @inheritdoc
         */
        protected function doMainQuery( $tables, $select, $conds, $query_options,
-               $join_conds, FormOptions $opts ) {
-
+               $join_conds, FormOptions $opts
+       ) {
                $target = $opts['target'];
                $showlinkedto = $opts['showlinkedto'];
                $limit = $opts['limit'];
index e89dbc9..e5adeb5 100644 (file)
@@ -399,7 +399,6 @@ class SpecialSearch extends SpecialPage {
                $mainResultWidget = new FullSearchResultWidget( $this, $linkRenderer );
 
                if ( $search->getFeatureData( 'enable-new-crossproject-page' ) ) {
-
                        $sidebarResultWidget = new InterwikiSearchResultWidget( $this, $linkRenderer );
                        $sidebarResultsWidget = new InterwikiSearchResultSetWidget(
                                $this,
index b18b370..451669c 100644 (file)
@@ -96,7 +96,6 @@ class SpecialSpecialpages extends UnlistedSpecialPage {
                $includesCachedPages = false;
 
                foreach ( $groups as $group => $sortedPages ) {
-
                        $out->wrapWikiMsg(
                                "<h2 class=\"mw-specialpagesgroup\" id=\"mw-specialpagesgroup-$group\">$1</h2>\n",
                                "specialpages-group-$group"
index 19850e6..a60549b 100644 (file)
@@ -253,7 +253,6 @@ class SpecialStatistics extends SpecialPage {
                foreach ( $stats as $header => $items ) {
                        // Identify the structure used
                        if ( is_array( $items ) ) {
-
                                // Ignore headers that are recursively set as legacy header
                                if ( $header !== 'statistics-header-hooks' ) {
                                        $return .= $this->formatRowHeader( $header );
index e67356f..605ee00 100644 (file)
@@ -246,7 +246,6 @@ class SpecialTags extends SpecialPage {
                }
 
                if ( $showManageActions ) { // we've already checked that the user had the requisite userright
-
                        // activate
                        if ( ChangeTags::canActivateTag( $tag )->isOK() ) {
                                $actionLinks[] = $linkRenderer->makeKnownLink(
@@ -264,7 +263,6 @@ class SpecialTags extends SpecialPage {
                                        [],
                                        [ 'tag' => $tag ] );
                        }
-
                }
 
                if ( $showDeleteActions || $showManageActions ) {
index def639d..073e58d 100644 (file)
@@ -678,7 +678,6 @@ class SpecialUpload extends SpecialPage {
         */
        protected function processVerificationError( $details ) {
                switch ( $details['status'] ) {
-
                        /** Statuses that only require name changing **/
                        case UploadBase::MIN_LENGTH_PARTNAME:
                                $this->showRecoverableUploadError( $this->msg( 'minlength1' )->escaped() );
index d0a0317..0a712ef 100644 (file)
@@ -326,8 +326,8 @@ class UserrightsPage extends SpecialPage {
         * @return array Tuple of added, then removed groups
         */
        function doSaveUserGroups( $user, $add, $remove, $reason = '', $tags = [],
-               $groupExpiries = [] ) {
-
+               $groupExpiries = []
+       ) {
                // Validate input set...
                $isself = $user->getName() == $this->getUser()->getName();
                $groups = $user->getGroups();
@@ -433,8 +433,8 @@ class UserrightsPage extends SpecialPage {
         * @param array $newUGMs Associative array of (group name => UserGroupMembership)
         */
        protected function addLogEntry( $user, $oldGroups, $newGroups, $reason, $tags,
-               $oldUGMs, $newUGMs ) {
-
+               $oldUGMs, $newUGMs
+       ) {
                // make sure $oldUGMs and $newUGMs are in the same order, and serialise
                // each UGM object to a simplified array
                $oldUGMs = array_map( function ( $group ) use ( $oldUGMs ) {
index e9d3f26..65131ec 100644 (file)
@@ -246,8 +246,8 @@ class SpecialWatchlist extends ChangesListSpecialPage {
         * @inheritdoc
         */
        protected function buildQuery( &$tables, &$fields, &$conds, &$query_options,
-               &$join_conds, FormOptions $opts ) {
-
+               &$join_conds, FormOptions $opts
+       ) {
                $dbr = $this->getDB();
                parent::buildQuery( $tables, $fields, $conds, $query_options, $join_conds,
                        $opts );
@@ -263,8 +263,8 @@ class SpecialWatchlist extends ChangesListSpecialPage {
         * @inheritdoc
         */
        protected function doMainQuery( $tables, $fields, $conds, $query_options,
-               $join_conds, FormOptions $opts ) {
-
+               $join_conds, FormOptions $opts
+       ) {
                $dbr = $this->getDB();
                $user = $this->getUser();
 
index 7a71714..0fff97c 100644 (file)
@@ -86,7 +86,6 @@ class MediaWikiTitleCodec implements TitleFormatter, TitleParser {
                if ( $this->language->needsGenderDistinction() &&
                        MWNamespace::hasGenderDistinction( $namespace )
                ) {
-
                        // NOTE: we are assuming here that the title text is a user name!
                        $gender = $this->genderCache->getGenderOf( $text, __METHOD__ );
                        $name = $this->language->getGenderNsText( $namespace, $gender );
index 57bb22a..f08f4cf 100644 (file)
@@ -321,7 +321,6 @@ abstract class UploadBase {
         * @return mixed Const self::OK or else an array with error information
         */
        public function verifyUpload() {
-
                /**
                 * If there was no filename or a zero size given, give up quick.
                 */
@@ -1431,7 +1430,6 @@ abstract class UploadBase {
         * @return bool
         */
        public function checkSvgScriptCallback( $element, $attribs, $data = null ) {
-
                list( $namespace, $strippedElement ) = $this->splitXmlNamespace( $element );
 
                // We specifically don't include:
@@ -1666,7 +1664,6 @@ abstract class UploadBase {
         * @return bool true if the CSS contains an illegal string, false if otherwise
         */
        private static function checkCssFragment( $value ) {
-
                # Forbid external stylesheets, for both reliability and to protect viewer's privacy
                if ( stripos( $value, '@import' ) !== false ) {
                        return true;
index cf05df3..a06be83 100644 (file)
@@ -344,8 +344,8 @@ class UserGroupMembership {
         * @return string
         */
        public static function getLink( $ugm, IContextSource $context, $format,
-               $userName = null ) {
-
+               $userName = null
+       ) {
                if ( $format !== 'wiki' && $format !== 'html' ) {
                        throw new MWException( 'UserGroupMembership::getLink() $format parameter should be ' .
                                "'wiki' or 'html'" );
index 54a8677..8931e3c 100644 (file)
@@ -137,13 +137,11 @@ class AutoloadGenerator {
                // format class-name : path when they get converted into json.
                foreach ( $this->classes as $path => $contained ) {
                        foreach ( $contained as $fqcn ) {
-
                                // Using substr to remove the leading '/'
                                $json[$key][$fqcn] = substr( $path, 1 );
                        }
                }
                foreach ( $this->overrides as $path => $fqcn ) {
-
                        // Using substr to remove the leading '/'
                        $json[$key][$fqcn] = substr( $path, 1 );
                }
@@ -223,7 +221,6 @@ EOD;
         * @return string
         */
        public function getAutoload( $commandName = 'AutoloadGenerator' ) {
-
                // We need to check whether an extenson.json or skin.json exists or not, and
                // incase it doesn't, update the autoload.php file.
 
index ef93362..9145bb6 100644 (file)
@@ -123,7 +123,6 @@ class InterwikiSearchResultSetWidget implements SearchResultSetWidget {
         * @return string HTML
         */
        protected function footerHtml( $term, $iwPrefix ) {
-
                $href = Title::makeTitle( NS_SPECIAL, 'Search', null, $iwPrefix )->getLocalURL(
                        [ 'search' => $term, 'fulltext' => 1 ]
                );
@@ -171,7 +170,6 @@ class InterwikiSearchResultSetWidget implements SearchResultSetWidget {
         * @return OOUI\IconWidget
         **/
        protected function iwIcon( $iwPrefix ) {
-
                $interwiki = $this->iwLookup->fetch( $iwPrefix );
                $parsed = wfParseUrl( wfExpandUrl( $interwiki ? $interwiki->getURL() : '/' ) );
 
index 861fb6d..bcd1c16 100644 (file)
@@ -29,7 +29,6 @@ class InterwikiSearchResultWidget implements SearchResultWidget {
         * @return string HTML
         */
        public function render( SearchResult $result, $terms, $position ) {
-
                $title = $result->getTitle();
                $iwPrefix = $result->getTitle()->getInterwiki();
                $titleSnippet = $result->getTitleSnippet();
@@ -46,7 +45,6 @@ class InterwikiSearchResultWidget implements SearchResultWidget {
                $redirectTitle = $result->getRedirectTitle();
                $redirect = '';
                if ( $redirectTitle !== null ) {
-
                        $redirectText = $result->getRedirectSnippet();
 
                        if ( $redirectText ) {
index b5eef8c..83dff65 100644 (file)
@@ -361,7 +361,6 @@ class Language {
         * @return bool
         */
        public static function isValidBuiltInCode( $code ) {
-
                if ( !is_string( $code ) ) {
                        if ( is_object( $code ) ) {
                                $addmsg = " of class " . get_class( $code );
index 2137786..6d0368c 100644 (file)
@@ -339,7 +339,6 @@ class LanguageConverter {
         * @return string The converted text
         */
        public function autoConvert( $text, $toVariant = false ) {
-
                $this->loadTables();
 
                if ( !$toVariant ) {
index 56faa4a..6007bb4 100644 (file)
@@ -44,7 +44,6 @@ class LanguageBe_tarask extends Language {
         * @return string
         */
        function normalizeForSearch( $string ) {
-
                # MySQL fulltext index doesn't grok utf-8, so we
                # need to fold cases and convert to hex
 
index 3a50987..f6f03c4 100644 (file)
@@ -86,7 +86,6 @@ class KkConverter extends LanguageConverter {
        }
 
        function loadRegs() {
-
                $this->mCyrl2Latn = [
                        # # Punctuation
                        '/№/u' => 'No.',
@@ -423,7 +422,6 @@ class LanguageKk extends LanguageKk_cyrl {
         * @return string
         */
        function convertGrammar( $word, $case ) {
-
                $variant = $this->getPreferredVariant();
                switch ( $variant ) {
                        case 'kk-arab':
index e745965..4e9c365 100644 (file)
@@ -37,7 +37,6 @@ class LanguageKu_ku extends Language {
         * @return string
         */
        function commafy( $_ ) {
-
                if ( !preg_match( '/^\d{1,4}$/', $_ ) ) {
                        return strrev( (string)preg_replace( '/(\d{3})(?=\d)(?!\d*\.)/', '$1,', strrev( $_ ) ) );
                } else {
index d5f3e76..1107fa6 100644 (file)
@@ -54,7 +54,6 @@ class LanguageYue extends Language {
         * @return string
         */
        function normalizeForSearch( $string ) {
-
                // Double-width roman characters
                $s = self::convertDoubleWidth( $string );
                $s = trim( $s );
index 77a41e1..9d81c21 100644 (file)
@@ -56,7 +56,6 @@ class LanguageZh_hans extends Language {
         * @return string
         */
        function normalizeForSearch( $s ) {
-
                // Double-width roman characters
                $s = parent::normalizeForSearch( $s );
                $s = trim( $s );
index 49bd05c..3910f29 100644 (file)
@@ -168,7 +168,6 @@ class CheckSyntax extends Maintenance {
         * @return array Resulting list of changed files
         */
        private function getGitModifiedFiles( $path ) {
-
                global $wgMaxShellMemory;
 
                if ( !is_dir( "$path/.git" ) ) {
index 24a63a3..9559623 100644 (file)
@@ -43,7 +43,6 @@ class DeleteOldRevisions extends Maintenance {
        }
 
        function doDelete( $delete = false, $args = [] ) {
-
                # Data should come off the master, wrapped in a transaction
                $dbw = $this->getDB( DB_MASTER );
                $this->beginTransaction( $dbw, __METHOD__ );
index c6e9aad..2b79b54 100644 (file)
@@ -575,7 +575,6 @@ TEXT
                }
 
                while ( $failures < $this->maxFailures ) {
-
                        // As soon as we found a good text for the $id, we will return immediately.
                        // Hence, if we make it past the try catch block, we know that we did not
                        // find a good text.
index b3866c1..625e1f7 100644 (file)
@@ -185,9 +185,7 @@ class ImportImages extends Maintenance {
                # Batch "upload" operation
                $count = count( $files );
                if ( $count > 0 ) {
-
                        foreach ( $files as $file ) {
-
                                if ( $sleep && ( $processed > 0 ) ) {
                                        sleep( $sleep );
                                }
index baf917c..92ddc44 100644 (file)
@@ -93,7 +93,6 @@ if ( $run ) {
        $count = 0;
 
        if ( ( $messageExist ) && ( $messageCExist ) ) {
-
                if ( !strcmp( $runMode, 'php' ) ) {
                        print "<?php\n";
                        print '$dupeMessages = [' . "\n";
index 0bd627f..4a2b49a 100644 (file)
@@ -256,7 +256,6 @@ class NamespaceConflictChecker extends Maintenance {
 
                $ok = true;
                foreach ( $targets as $row ) {
-
                        // Find the new title and determine the action to take
 
                        $newTitle = $this->getDestinationTitle( $ns, $name,
index de037dc..ff821cc 100644 (file)
@@ -39,7 +39,6 @@ class NukePage extends Maintenance {
        }
 
        public function execute() {
-
                $name = $this->getArg();
                $delete = $this->getOption( 'delete', false );
 
index 48c3d37..ed412da 100644 (file)
@@ -67,8 +67,8 @@ class AlterSharedConstraints extends Maintenance {
                                                AND ucc.constraint_name = uc.constraint_name
                                                AND uccpk.constraint_name = uc.r_constraint_name
                                                AND uccpk.table_name = '$ltable'" );
-                       while ( ( $row = $result->fetchRow() ) !== false ) {
 
+                       while ( ( $row = $result->fetchRow() ) !== false ) {
                                $this->output( "Altering {$row['constraint_name']} ..." );
 
                                try {
index 9f3552a..facc506 100644 (file)
@@ -178,7 +178,6 @@ class RefreshLinks extends Maintenance {
                        $this->output( "Starting from page_id $start of $end.\n" );
 
                        for ( $id = $start; $id <= $end; $id++ ) {
-
                                if ( !( $id % self::REPORTING_INTERVAL ) ) {
                                        $this->output( "$id\n" );
                                        wfWaitForSlaves();
@@ -191,7 +190,6 @@ class RefreshLinks extends Maintenance {
                                $this->output( "Starting from page_id $start of $end.\n" );
 
                                for ( $id = $start; $id <= $end; $id++ ) {
-
                                        if ( !( $id % self::REPORTING_INTERVAL ) ) {
                                                $this->output( "$id\n" );
                                                wfWaitForSlaves();
index ec8fcfe..c750784 100644 (file)
@@ -39,7 +39,6 @@ class RemoveUnusedAccounts extends Maintenance {
        }
 
        public function execute() {
-
                $this->output( "Remove unused accounts\n\n" );
 
                # Do an initial scan for inactive accounts and report the result
index c657c03..5d773d1 100644 (file)
@@ -82,7 +82,6 @@ class UserOptions {
         * @return bool
         */
        private function initializeOpts( $opts, $args ) {
-
                $this->mQuick = isset( $opts['nowarn'] );
                $this->mQuiet = isset( $opts['quiet'] );
                $this->mDry = isset( $opts['dry'] );
@@ -149,12 +148,10 @@ class UserOptions {
                );
 
                foreach ( $result as $id ) {
-
                        $user = User::newFromId( $id->user_id );
 
                        // Get the options and update stats
                        if ( $this->mAnOption ) {
-
                                if ( !array_key_exists( $this->mAnOption, $defaultOptions ) ) {
                                        print "Invalid user option. Use --list to see valid choices\n";
                                        exit;
@@ -203,14 +200,12 @@ class UserOptions {
                );
 
                foreach ( $result as $id ) {
-
                        $user = User::newFromId( $id->user_id );
 
                        $curValue = $user->getOption( $this->mAnOption );
                        $username = $user->getName();
 
                        if ( $curValue == $this->mOldValue ) {
-
                                if ( !$this->mQuiet ) {
                                        print "Setting {$this->mAnOption} for $username from '{$this->mOldValue}' " .
                                                "to '{$this->mNewValue}'): ";
@@ -279,7 +274,6 @@ USAGE;
         * @return bool
         */
        public function warn() {
-
                if ( $this->mQuick ) {
                        return true;
                }
index be9debc..10b8d97 100644 (file)
@@ -44,7 +44,6 @@ function wfInstallerMain() {
        $installer = InstallerOverrides::getWebInstaller( $wgRequest );
 
        if ( !$installer->startSession() ) {
-
                if ( $installer->request->getVal( "css" ) ) {
                        // Do not display errors on css pages
                        $installer->outputCss();
index 7eca9ea..a02e1a8 100644 (file)
--- a/phpcs.xml
+++ b/phpcs.xml
@@ -1,6 +1,9 @@
 <?xml version="1.0"?>
 <ruleset name="MediaWiki">
        <rule ref="./vendor/mediawiki/mediawiki-codesniffer/MediaWiki">
+               <exclude name="Generic.ControlStructures.InlineControlStructure" />
+               <!-- Rule will pass in 0.10.0 but update depends on T167168 -->
+               <exclude name="MediaWiki.WhiteSpace.SpaceBeforeClassBrace.NoSpaceBeforeBrace" />
                <!-- Disable rules added in 0.8.0 that don't pass yet -->
                <exclude name="MediaWiki.Commenting.FunctionComment.ExtraParamComment" />
                <exclude name="MediaWiki.Commenting.FunctionComment.MissingParamComment" />
@@ -17,9 +20,6 @@
                <exclude name="MediaWiki.Commenting.IllegalSingleLineComment.IllegalSingleLineCommentEnd" />
                <exclude name="MediaWiki.ControlStructures.AssignmentInControlStructures.AssignmentInControlStructures" />
                <exclude name="MediaWiki.NamingConventions.LowerCamelFunctionsName.FunctionName" />
-               <exclude name="MediaWiki.WhiteSpace.DisallowEmptyLineFunctions.NoEmptyLine" />
-               <exclude name="MediaWiki.WhiteSpace.SpaceBeforeControlStructureBrace.EmptyLines" />
-               <exclude name="MediaWiki.WhiteSpace.SpaceBeforeClassBrace.NoSpaceBeforeBrace" />
                <exclude name="MediaWiki.WhiteSpace.SpaceBeforeSingleLineComment.NewLineComment" />
                <exclude name="MediaWiki.WhiteSpace.SpaceBeforeSingleLineComment.SingleSpaceBeforeSingleLineComment" />
                <exclude name="MediaWiki.Usage.DbrQueryUsage.DbrQueryFound" />
                        <property name="ignoreList" type="array" value="$IP,$messageMemc,$parserMemc" />
                </properties>
        </rule>
-       <file>.</file>
-       <arg name="encoding" value="UTF-8"/>
-       <arg name="extensions" value="php,php5,inc,sample"/>
        <rule ref="Generic.Files.LineLength">
                <exclude-pattern>*/languages/messages/Messages*.php</exclude-pattern>
        </rule>
        <rule ref="PSR2.Methods.MethodDeclaration.Underscore">
                <exclude-pattern>*/includes/StubObject.php</exclude-pattern>
        </rule>
-       <rule ref="Generic.ControlStructures.InlineControlStructure.NotAllowed">
-               <severity>0</severity>
-       </rule>
+       <file>.</file>
+       <arg name="encoding" value="UTF-8"/>
+       <arg name="extensions" value="php,php5,inc,sample"/>
        <exclude-pattern>node_modules/</exclude-pattern>
        <exclude-pattern>vendor/</exclude-pattern>
        <exclude-pattern type="relative">^extensions/</exclude-pattern>
index c2eebfa..26ee420 100644 (file)
@@ -1049,7 +1049,6 @@ abstract class MediaWikiTestCase extends PHPUnit_Framework_TestCase {
 
        private function addCoreDBData() {
                if ( $this->db->getType() == 'oracle' ) {
-
                        # Insert 0 user to prevent FK violations
                        # Anonymous user
                        if ( !$this->db->selectField( 'user', '1', [ 'user_id' => 0 ] ) ) {
@@ -1713,7 +1712,6 @@ abstract class MediaWikiTestCase extends PHPUnit_Framework_TestCase {
                        if ( !isset( $wgNamespaceContentModels[$ns] ) ||
                                $wgNamespaceContentModels[$ns] === CONTENT_MODEL_WIKITEXT
                        ) {
-
                                $wikitextNS = $ns;
 
                                return $wikitextNS;
index 33b6e2f..5e54b8d 100644 (file)
@@ -362,7 +362,6 @@ class GlobalTest extends MediaWikiTestCase {
         * @covers ::wfClientAcceptsGzip
         */
        public function testClientAcceptsGzipTest() {
-
                $settings = [
                        'gzip' => true,
                        'bzip' => false,
@@ -396,7 +395,6 @@ class GlobalTest extends MediaWikiTestCase {
         * @covers ::wfPercent
         */
        public function testWfPercentTest() {
-
                $pcts = [
                        [ 6 / 7, '0.86%', 2, false ],
                        [ 3 / 3, '1%' ],
index 2ca5935..3e3fb0f 100644 (file)
@@ -265,7 +265,6 @@ class LinkerTest extends MediaWikiLangTestCase {
         * @dataProvider provideCasesForFormatLinksInComment
         */
        public function testFormatLinksInComment( $expected, $input, $wiki ) {
-
                $conf = new SiteConfiguration();
                $conf->settings = [
                        'wgServer' => [
index 65a8c86..01e7ecb 100644 (file)
@@ -28,7 +28,6 @@ class WatchedItemIntegrationTest extends MediaWikiTestCase {
        }
 
        public function testWatchAndUnWatchItem() {
-
                $user = $this->getUser();
                $title = Title::newFromText( 'WatchedItemIntegrationTestPage' );
                // Cleanup after previous tests
index d499714..d4a5acf 100644 (file)
@@ -16,7 +16,6 @@ class GenerateRandomImages extends Maintenance {
        }
 
        public function execute() {
-
                $getOptSpec = [
                        'dictionaryFile::',
                        'minWidth::',
index fbc794e..c612f26 100644 (file)
@@ -248,7 +248,6 @@ class ApiQueryBasicTest extends ApiQueryTestBase {
         * Test basic lists
         */
        public function testAllTogether() {
-
                // All props together
                $this->check( $this->merge(
                        self::$links,
index 2f908fe..4da09d8 100644 (file)
@@ -12,7 +12,6 @@ class TestRecentChangesHelper {
        public function makeEditRecentChange( User $user, $titleText, $curid, $thisid, $lastid,
                $timestamp, $counter, $watchingUsers
        ) {
-
                $attribs = array_merge(
                        $this->getDefaultAttributes( $titleText, $timestamp ),
                        [
@@ -72,7 +71,6 @@ class TestRecentChangesHelper {
        public function makeNewBotEditRecentChange( User $user, $titleText, $curid, $thisid, $lastid,
                $timestamp, $counter, $watchingUsers
        ) {
-
                $attribs = array_merge(
                        $this->getDefaultAttributes( $titleText, $timestamp ),
                        [
@@ -111,7 +109,6 @@ class TestRecentChangesHelper {
        public function makeCategorizationRecentChange(
                User $user, $titleText, $curid, $thisid, $lastid, $timestamp
        ) {
-
                $attribs = array_merge(
                        $this->getDefaultAttributes( $titleText, $timestamp ),
                        [
index 8e06f9e..bdb4831 100644 (file)
@@ -27,7 +27,6 @@ class ImportLinkCacheIntegrationTest extends MediaWikiTestCase {
        }
 
        public function testImportForImportSource() {
-
                $this->doImport( $this->importStreamSource );
 
                // Imported title
@@ -56,7 +55,6 @@ class ImportLinkCacheIntegrationTest extends MediaWikiTestCase {
         * @depends testImportForImportSource
         */
        public function testReImportForImportSource() {
-
                $this->doImport( $this->importStreamSource );
 
                // ReImported title
@@ -76,7 +74,6 @@ class ImportLinkCacheIntegrationTest extends MediaWikiTestCase {
        }
 
        private function doImport( $importStreamSource ) {
-
                $importer = new WikiImporter(
                        $importStreamSource->value,
                        MediaWikiServices::getInstance()->getMainConfig()
index 1d62a78..31c9e50 100644 (file)
@@ -39,7 +39,6 @@ class InterwikiLookupAdapterTest extends MediaWikiTestCase {
        }
 
        public function testFetch() {
-
                $interwiki = $this->interwikiLookup->fetch( '' );
                $this->assertNull( $interwiki );
 
index 9291eb6..5eee8b8 100644 (file)
@@ -181,7 +181,6 @@ class XMPTest extends PHPUnit_Framework_TestCase  {
         * @covers XMPReader::checkParseSafety
         */
        public function testCheckParseSafety() {
-
                // Test for detection
                $xmpPath = __DIR__ . '/../../../data/xmp/';
                $file = fopen( $xmpPath . 'doctype-included.xmp', 'rb' );
index 666dcf2..2b18b08 100644 (file)
@@ -77,7 +77,6 @@ class PageDataRequestHandlerTest extends \MediaWikiTestCase {
        }
 
        public function handleRequestProvider() {
-
                $cases = [];
 
                $cases[] = [ '', [], [], '!!', 400 ];
index 1044e52..278b441 100644 (file)
@@ -24,7 +24,6 @@ class GIFMetadataExtractorTest extends MediaWikiTestCase {
        }
 
        public static function provideGetMetadata() {
-
                $xmpNugget = <<<EOF
 <?xpacket begin='' id='W5M0MpCehiHzreSzNTczkc9d'?>
 <x:xmpmeta xmlns:x='adobe:ns:meta/' x:xmptk='Image::ExifTool 7.30'>
index 3bd82b4..0839cfb 100644 (file)
@@ -58,7 +58,6 @@ class UserPasswordPolicyTest extends MediaWikiTestCase {
        }
 
        public function testGetPoliciesForUser() {
-
                $upp = $this->getUserPasswordPolicy();
 
                $user = User::newFromName( 'TestUserPolicy' );
@@ -100,7 +99,6 @@ class UserPasswordPolicyTest extends MediaWikiTestCase {
         * @dataProvider provideCheckUserPassword
         */
        public function testCheckUserPassword( $username, $groups, $password, $valid, $ok, $msg ) {
-
                $upp = $this->getUserPasswordPolicy();
 
                $user = User::newFromName( $username );
index fd587bf..ac58d68 100644 (file)
@@ -21,7 +21,6 @@ class SpecialPreferencesTest extends MediaWikiTestCase {
         * @todo give this test a real name explaining what is being tested here
         */
        public function testBug41337() {
-
                // Set a low limit
                $this->setMwGlobals( 'wgMaxSigChars', 2 );
 
index b6c2427..25ff186 100644 (file)
@@ -51,8 +51,8 @@ class ForeignTitleTest extends MediaWikiTestCase {
         * @dataProvider basicProvider
         */
        public function testBasic( ForeignTitle $title, $expectedId, $expectedName,
-               $expectedText ) {
-
+               $expectedText
+       ) {
                $this->assertEquals( true, $title->isNamespaceIdKnown() );
                $this->assertEquals( $expectedId, $title->getNamespaceId() );
                $this->assertEquals( $expectedName, $title->getNamespaceName() );
index 520108a..9aa3578 100644 (file)
@@ -76,7 +76,6 @@ class NamespaceAwareForeignTitleFactoryTest extends MediaWikiTestCase {
         * @dataProvider basicProvider
         */
        public function testBasic( $title, $ns, ForeignTitle $foreignTitle ) {
-
                $foreignNamespaces = [
                        0 => '', 1 => 'Talk', 100 => 'Portal', 9000 => 'Bogus'
                ];
index baeb95c..93ce080 100644 (file)
@@ -60,8 +60,8 @@ class SubpageImportTitleFactoryTest extends MediaWikiTestCase {
         * @dataProvider basicProvider
         */
        public function testBasic( ForeignTitle $foreignTitle, Title $rootPage,
-               Title $title ) {
-
+               Title $title
+       ) {
                $factory = new SubpageImportTitleFactory( $rootPage );
                $testTitle = $factory->createTitleFromForeignTitle( $foreignTitle );
 
index 760d41e..86c19ae 100644 (file)
@@ -40,7 +40,6 @@ class MWCryptHKDFTest extends MediaWikiTestCase {
         * Test vectors from Appendix A on https://tools.ietf.org/html/rfc5869
         */
        public static function providerRfc5869() {
-
                // @codingStandardsIgnoreStart Generic.Files.LineLength
                return [
                        // A.1
index 1d55ab8..99bd427 100644 (file)
@@ -298,7 +298,6 @@ abstract class DumpTestCase extends MediaWikiLangTestCase {
         * @param string $name Title of the current page
         */
        protected function assertPageStart( $id, $ns, $name ) {
-
                $this->assertNodeStart( "page" );
                $this->skipWhitespace();
 
@@ -393,7 +392,6 @@ abstract class DumpTestCase extends MediaWikiLangTestCase {
                        if ( ( $this->xml->nodeType == XMLReader::END_ELEMENT )
                                && ( $this->xml->name == "text" )
                        ) {
-
                                $this->xml->read();
                        }
                        $this->skipWhitespace();
index 6b0e344..e21e726 100644 (file)
@@ -52,7 +52,6 @@ class MaintenanceFixup extends Maintenance {
         * Simulates what Maintenance wants to happen at script's end.
         */
        public function simulateShutdown() {
-
                if ( $this->shutdownSimulated ) {
                        $this->testCase->fail( __METHOD__ . " called more than once" );
                }
@@ -175,7 +174,6 @@ class MaintenanceTest extends MediaWikiTestCase {
         *   after shutdown simulation.
         */
        private function assertOutputPrePostShutdown( $preShutdownOutput, $expectNLAppending ) {
-
                $this->assertEquals( $preShutdownOutput, $this->getActualOutput(),
                        "Output before shutdown simulation" );
 
index ea5ca8d..8242c79 100644 (file)
@@ -265,7 +265,6 @@ class TextPassDumperDatabaseTest extends DumpTestCase {
                // duration. If the dump did not take long enough increase the iteration
                // count, to generate a bigger stub file next time.
                while ( $lastDuration < $minDuration ) {
-
                        // Setting up the dump
                        wfRecursiveRemoveDir( $nameOutputDir );
                        $this->assertTrue( wfMkdirParents( $nameOutputDir ),
@@ -323,7 +322,6 @@ class TextPassDumperDatabaseTest extends DumpTestCase {
                // Each run of the following loop body tries to handle exactly 1 /page/ (not
                // iteration of stub content). $i is only increased after having treated page 4.
                for ( $i = 0; $i < $iterations; ) {
-
                        // 1. Assuring a file is opened and ready. Skipping across header if
                        //    necessary.
                        if ( !$fileOpened ) {
@@ -511,7 +509,6 @@ class TextPassDumperDatabaseTest extends DumpTestCase {
                $content = $header;
                $iterations = intval( $iterations );
                for ( $i = 0; $i < $iterations; $i++ ) {
-
                        $page1 = '  <page>
     <title>BackupDumperTestP1</title>
     <ns>0</ns>
index 0019a3f..91e1b1e 100644 (file)
@@ -104,7 +104,6 @@ class BackupDumperLoggerTest extends DumpTestCase {
        private function assertLogItem( $id, $user_name, $user_id, $comment, $type,
                $subtype, $title, $parameters = []
        ) {
-
                $this->assertNodeStart( "logitem" );
                $this->skipWhitespace();
 
index 39baf17..d7da5a0 100644 (file)
 
                        return {
                                setup: function () {
-
                                        // Greetings, mock environment!
                                        mw.config = new MwMap();
                                        mw.config.set( freshConfigCopy( localEnv.config ) );