From e33818cd086ea770b320311b692cbbf106de24aa Mon Sep 17 00:00:00 2001 From: Amir Sarabadani Date: Mon, 24 Jul 2023 18:59:29 +0200 Subject: [PATCH] Fix space after comma in single-line array declaration We are introducing a new phpcs sniff to make sure this doesn't happen That sniff found this so far. Bug: T342297 Change-Id: Ibce3f3d28e7d2cb5b0ff7230f584e76446965ddc --- includes/deferred/UserEditCountUpdate.php | 2 +- includes/installer/PostgresUpdater.php | 10 +++++----- maintenance/cleanupInvalidDbKeys.php | 2 +- tests/phpunit/includes/WikiMapTest.php | 4 ++-- .../includes/language/LanguageConverterFactoryTest.php | 2 +- tests/phpunit/includes/linker/LinkTargetStoreTest.php | 2 +- tests/phpunit/includes/user/BotPasswordTest.php | 2 +- 7 files changed, 12 insertions(+), 12 deletions(-) diff --git a/includes/deferred/UserEditCountUpdate.php b/includes/deferred/UserEditCountUpdate.php index c186d8ba6ef..5e297e7f5dc 100644 --- a/includes/deferred/UserEditCountUpdate.php +++ b/includes/deferred/UserEditCountUpdate.php @@ -78,7 +78,7 @@ class UserEditCountUpdate implements DeferrableUpdate, MergeableUpdate { $dbw->newUpdateQueryBuilder() ->update( 'user' ) ->set( [ 'user_editcount=user_editcount+' . (int)$info->getIncrement() ] ) - ->where( [ 'user_id' => $userId,'user_editcount IS NOT NULL' ] ) + ->where( [ 'user_id' => $userId, 'user_editcount IS NOT NULL' ] ) ->caller( $fname )->execute(); // Lazy initialization check... if ( $dbw->affectedRows() == 0 ) { diff --git a/includes/installer/PostgresUpdater.php b/includes/installer/PostgresUpdater.php index 1b65c6c7317..c8fe04801ab 100644 --- a/includes/installer/PostgresUpdater.php +++ b/includes/installer/PostgresUpdater.php @@ -213,7 +213,7 @@ class PostgresUpdater extends DatabaseUpdater { [ 'dropFkey', 'page_props', 'pp_page' ], // page_props primary key change moved from the Schema SQL file to here in 1.36 [ 'changePrimaryKey', 'page_props', [ 'pp_page', 'pp_propname' ], 'page_props_pk' ], - [ 'setDefault','job', 'job_cmd', '' ], + [ 'setDefault', 'job', 'job_cmd', '' ], [ 'changeField', 'job', 'job_namespace', 'INTEGER', '' ], [ 'dropPgIndex', 'job', 'job_cmd_namespace_title' ], [ 'addPgIndex', 'job', 'job_cmd', '(job_cmd, job_namespace, job_title, job_params)' ], @@ -225,10 +225,10 @@ class PostgresUpdater extends DatabaseUpdater { [ 'renameIndex', 'page', 'page_unique_name', 'page_name_title' ], [ 'addPGIndex', 'page', 'page_redirect_namespace_len', '(page_is_redirect, page_namespace, page_len)' ], [ 'dropFkey', 'categorylinks', 'cl_from' ], - [ 'setDefault','categorylinks', 'cl_from', 0 ], - [ 'setDefault','categorylinks', 'cl_to', '' ], - [ 'setDefault','categorylinks', 'cl_sortkey', '' ], - [ 'setDefault','categorylinks', 'cl_collation', '' ], + [ 'setDefault', 'categorylinks', 'cl_from', 0 ], + [ 'setDefault', 'categorylinks', 'cl_to', '' ], + [ 'setDefault', 'categorylinks', 'cl_sortkey', '' ], + [ 'setDefault', 'categorylinks', 'cl_collation', '' ], [ 'changeNullableField', 'categorylinks', 'cl_sortkey', 'NOT NULL', true ], [ 'addIndex', 'categorylinks', 'categorylinks_pkey', 'patch-categorylinks-pk.sql' ], [ 'addPgIndex', 'categorylinks', 'cl_timestamp', '(cl_to, cl_timestamp)' ], diff --git a/maintenance/cleanupInvalidDbKeys.php b/maintenance/cleanupInvalidDbKeys.php index 7da894e2ff9..c76dfebd18c 100644 --- a/maintenance/cleanupInvalidDbKeys.php +++ b/maintenance/cleanupInvalidDbKeys.php @@ -143,7 +143,7 @@ TEXT $joinConds = []; $tables = [ $table ]; if ( isset( $linksMigration::$mapping[$table] ) ) { - [ $nsField,$titleField ] = $linksMigration->getTitleFields( $table ); + [ $nsField, $titleField ] = $linksMigration->getTitleFields( $table ); $joinConds = $linksMigration->getQueryInfo( $table )['joins']; $tables = $linksMigration->getQueryInfo( $table )['tables']; } diff --git a/tests/phpunit/includes/WikiMapTest.php b/tests/phpunit/includes/WikiMapTest.php index aab1c7047c5..05213fd7d81 100644 --- a/tests/phpunit/includes/WikiMapTest.php +++ b/tests/phpunit/includes/WikiMapTest.php @@ -284,8 +284,8 @@ class WikiMapTest extends MediaWikiLangTestCase { public static function provideIsCurrentWikiId() { return [ [ 'db', 'db', null, '' ], - [ 'db-schema-','db', 'schema', '' ], - [ 'db','db', 'mediawiki', '' ], // common b/c case + [ 'db-schema-', 'db', 'schema', '' ], + [ 'db', 'db', 'mediawiki', '' ], // common b/c case [ 'db-prefix_', 'db', null, 'prefix_' ], [ 'db-schema-prefix_', 'db', 'schema', 'prefix_' ], [ 'db-prefix_', 'db', 'mediawiki', 'prefix_' ], // common b/c case diff --git a/tests/phpunit/includes/language/LanguageConverterFactoryTest.php b/tests/phpunit/includes/language/LanguageConverterFactoryTest.php index 9843aadf1d2..bf99130be5e 100644 --- a/tests/phpunit/includes/language/LanguageConverterFactoryTest.php +++ b/tests/phpunit/includes/language/LanguageConverterFactoryTest.php @@ -523,6 +523,6 @@ class LanguageConverterFactoryTest extends MediaWikiLangTestCase { 'zh-sg' => 'zh-sg', 'zh-tw' => 'zh-tw' ]; - yield 'zh' => [ 'zh', 'zh', ZhConverter::class, $zh_variants, $zh_variantfallbacks,[], $zh_flags, $zh_ml ]; + yield 'zh' => [ 'zh', 'zh', ZhConverter::class, $zh_variants, $zh_variantfallbacks, [], $zh_flags, $zh_ml ]; } } diff --git a/tests/phpunit/includes/linker/LinkTargetStoreTest.php b/tests/phpunit/includes/linker/LinkTargetStoreTest.php index d9956bf83eb..cd01d20fe5b 100644 --- a/tests/phpunit/includes/linker/LinkTargetStoreTest.php +++ b/tests/phpunit/includes/linker/LinkTargetStoreTest.php @@ -27,7 +27,7 @@ class LinkTargetStoreTest extends MediaWikiIntegrationTestCase { $db = $this->getServiceContainer()->getDBLoadBalancer()->getConnection( DB_PRIMARY ); $id = $linkTargetStore->acquireLinkTargetId( $target, $db ); $row = $db->newSelectQueryBuilder() - ->select( [ 'lt_id','lt_namespace','lt_title' ] ) + ->select( [ 'lt_id', 'lt_namespace', 'lt_title' ] ) ->from( 'linktarget' ) ->where( [ 'lt_namespace' => $target->getNamespace(), 'lt_title' => $target->getDBkey() ] ) ->fetchRow(); diff --git a/tests/phpunit/includes/user/BotPasswordTest.php b/tests/phpunit/includes/user/BotPasswordTest.php index 822bb84e6c2..c6181f0baca 100644 --- a/tests/phpunit/includes/user/BotPasswordTest.php +++ b/tests/phpunit/includes/user/BotPasswordTest.php @@ -65,7 +65,7 @@ class BotPasswordTest extends MediaWikiIntegrationTestCase { $dbw = wfGetDB( DB_PRIMARY ); $dbw->newDeleteQueryBuilder() ->delete( 'bot_passwords' ) - ->where( [ 'bp_user' => [ 42,43 ], 'bp_app_id' => 'BotPassword' ] ) + ->where( [ 'bp_user' => [ 42, 43 ], 'bp_app_id' => 'BotPassword' ] ) ->caller( __METHOD__ )->execute(); $dbw->insert( 'bot_passwords',