From a8c9fab2ccf0918e42411367413edfb1281beb2d Mon Sep 17 00:00:00 2001 From: libraryupgrader Date: Sat, 16 Mar 2024 18:52:48 +0000 Subject: [PATCH] build: Updating mediawiki/mediawiki-codesniffer to 43.0.0 The following sniffs are failing and were disabled: * MediaWiki.Commenting.FunctionComment.MissingDocumentationPublic Change-Id: I6075c76d53a899aac56af027f9a956a6b9e6a667 --- .phpcs.xml | 4 ++- AbuseFilter.alias.php | 2 +- composer.json | 7 ++++- includes/AbuseLogger.php | 2 +- .../Consequences/ConsequencesExecutor.php | 2 +- includes/Consequences/ConsequencesLookup.php | 2 +- includes/FilterProfiler.php | 2 +- includes/FilterValidator.php | 2 +- .../AbuseFilterModifyLogFormatter.php | 2 +- includes/Pager/AbuseFilterPager.php | 2 +- includes/Parser/AFPTreeParser.php | 2 +- includes/Parser/FilterEvaluator.php | 26 +++++++++---------- includes/Parser/SyntaxChecker.php | 18 ++++++------- includes/Special/SpecialAbuseLog.php | 2 +- includes/SpecsFormatter.php | 2 +- includes/ThrottleFilterPresentationModel.php | 2 +- .../RunVariableGenerator.php | 4 +-- includes/View/AbuseFilterViewEdit.php | 6 ++--- maintenance/MigrateActorsAF.php | 4 +-- tests/phpunit/AbuseFilterConsequencesTest.php | 14 +++++----- .../FilteredActionsHandlerTest.php | 2 +- tests/phpunit/unit/FilterProfilerTest.php | 2 +- 22 files changed, 59 insertions(+), 52 deletions(-) diff --git a/.phpcs.xml b/.phpcs.xml index 233f5ffaa..e7014813c 100644 --- a/.phpcs.xml +++ b/.phpcs.xml @@ -1,6 +1,8 @@ - + + + AbuseFilter\.alias\.php diff --git a/AbuseFilter.alias.php b/AbuseFilter.alias.php index b830a5ba4..5b47e8150 100644 --- a/AbuseFilter.alias.php +++ b/AbuseFilter.alias.php @@ -500,7 +500,7 @@ $specialPageAliases['uk'] = [ /** Urdu (اردو) */ $specialPageAliases['ur'] = [ 'AbuseLog' => [ 'نوشتہ_غلط_کاری' ], - 'AbuseFilter' => [ 'مقطر_غلط_کاری', 'مقطار_غلط_کاری' ], + 'AbuseFilter' => [ 'مقطر_غلط_کاری', 'مقطار_غلط_کاری' ], ]; /** Venetian (vèneto) */ diff --git a/composer.json b/composer.json index e07ec44ac..057a68359 100644 --- a/composer.json +++ b/composer.json @@ -8,7 +8,7 @@ "wikimedia/equivset": "^1.6.1" }, "require-dev": { - "mediawiki/mediawiki-codesniffer": "41.0.0", + "mediawiki/mediawiki-codesniffer": "43.0.0", "mediawiki/mediawiki-phan-config": "0.14.0", "mediawiki/minus-x": "1.1.1", "php-parallel-lint/php-console-highlighter": "1.0.0", @@ -26,5 +26,10 @@ ], "phan": "phan -d . --long-progress-bar", "phpcs": "phpcs -sp --cache" + }, + "config": { + "allow-plugins": { + "dealerdirect/phpcodesniffer-composer-installer": true + } } } diff --git a/includes/AbuseLogger.php b/includes/AbuseLogger.php index a44997256..1baa8c7ed 100644 --- a/includes/AbuseLogger.php +++ b/includes/AbuseLogger.php @@ -121,7 +121,7 @@ class AbuseLogger { $loggedGlobalFilters = []; foreach ( $actionsTaken as $filter => $actions ) { - list( $filterID, $global ) = GlobalNameUtils::splitGlobalName( $filter ); + [ $filterID, $global ] = GlobalNameUtils::splitGlobalName( $filter ); $thisLog = $logTemplate; $thisLog['afl_filter_id'] = $filterID; $thisLog['afl_global'] = (int)$global; diff --git a/includes/Consequences/ConsequencesExecutor.php b/includes/Consequences/ConsequencesExecutor.php index 3fee9c5e3..fe2b6e830 100644 --- a/includes/Consequences/ConsequencesExecutor.php +++ b/includes/Consequences/ConsequencesExecutor.php @@ -333,7 +333,7 @@ class ConsequencesExecutor { switch ( $actionName ) { case 'throttle': $throttleId = array_shift( $rawParams ); - list( $rateCount, $ratePeriod ) = explode( ',', array_shift( $rawParams ) ); + [ $rateCount, $ratePeriod ] = explode( ',', array_shift( $rawParams ) ); $throttleParams = [ 'id' => $throttleId, diff --git a/includes/Consequences/ConsequencesLookup.php b/includes/Consequences/ConsequencesLookup.php index 0578d3c8d..60434a3a4 100644 --- a/includes/Consequences/ConsequencesLookup.php +++ b/includes/Consequences/ConsequencesLookup.php @@ -51,7 +51,7 @@ class ConsequencesLookup { $localFilters = []; foreach ( $filters as $filter ) { - list( $filterID, $global ) = GlobalNameUtils::splitGlobalName( $filter ); + [ $filterID, $global ] = GlobalNameUtils::splitGlobalName( $filter ); if ( $global ) { $globalFilters[] = $filterID; diff --git a/includes/FilterProfiler.php b/includes/FilterProfiler.php index 3ca007645..d18538917 100644 --- a/includes/FilterProfiler.php +++ b/includes/FilterProfiler.php @@ -220,7 +220,7 @@ class FilterProfiler { $slowFilterThreshold = $this->options->get( 'AbuseFilterSlowFilterRuntimeLimit' ); foreach ( $data as $filterName => $params ) { - list( $filterID, $global ) = GlobalNameUtils::splitGlobalName( $filterName ); + [ $filterID, $global ] = GlobalNameUtils::splitGlobalName( $filterName ); // @todo Maybe add a parameter to recordProfilingResult to record global filters // data separately (in the foreign wiki) if ( !$global ) { diff --git a/includes/FilterValidator.php b/includes/FilterValidator.php index 8fd062cb8..cf8283ec3 100644 --- a/includes/FilterValidator.php +++ b/includes/FilterValidator.php @@ -223,7 +223,7 @@ class FilterValidator { * @return Status */ public function checkThrottleParameters( array $params ): Status { - list( $throttleCount, $throttlePeriod ) = explode( ',', $params[1], 2 ); + [ $throttleCount, $throttlePeriod ] = explode( ',', $params[1], 2 ); $throttleGroups = array_slice( $params, 2 ); $validGroups = [ 'ip', diff --git a/includes/LogFormatter/AbuseFilterModifyLogFormatter.php b/includes/LogFormatter/AbuseFilterModifyLogFormatter.php index d26d89b9c..e7f7a0531 100644 --- a/includes/LogFormatter/AbuseFilterModifyLogFormatter.php +++ b/includes/LogFormatter/AbuseFilterModifyLogFormatter.php @@ -25,7 +25,7 @@ class AbuseFilterModifyLogFormatter extends LogFormatter { protected function extractParameters() { $parameters = $this->entry->getParameters(); if ( $this->entry->isLegacy() ) { - list( $historyId, $filterId ) = $parameters; + [ $historyId, $filterId ] = $parameters; } else { $historyId = $parameters['historyId']; $filterId = $parameters['newId']; diff --git a/includes/Pager/AbuseFilterPager.php b/includes/Pager/AbuseFilterPager.php index fcdeda085..bdeaa3aa1 100644 --- a/includes/Pager/AbuseFilterPager.php +++ b/includes/Pager/AbuseFilterPager.php @@ -148,7 +148,7 @@ class AbuseFilterPager extends TablePager { return parent::reallyDoQuery( $offset, $limit, $order ); } - list( $tables, $fields, $conds, $fname, $options, $join_conds ) = + [ $tables, $fields, $conds, $fname, $options, $join_conds ] = $this->buildQueryInfo( $offset, $limit, $order ); unset( $options['LIMIT'] ); diff --git a/includes/Parser/AFPTreeParser.php b/includes/Parser/AFPTreeParser.php index bbb1f5b17..bcfc5ab0f 100644 --- a/includes/Parser/AFPTreeParser.php +++ b/includes/Parser/AFPTreeParser.php @@ -88,7 +88,7 @@ class AFPTreeParser { * Advances the parser to the next token in the filter code. */ private function move() { - list( $this->mCur, $this->mPos ) = $this->mTokens[$this->mPos]; + [ $this->mCur, $this->mPos ] = $this->mTokens[$this->mPos]; } /** diff --git a/includes/Parser/FilterEvaluator.php b/includes/Parser/FilterEvaluator.php index 6276b268c..4ab2c05f8 100644 --- a/includes/Parser/FilterEvaluator.php +++ b/includes/Parser/FilterEvaluator.php @@ -497,7 +497,7 @@ class FilterEvaluator { return $this->callFunc( $functionName, $dataArgs, $node->position ); case AFPTreeNode::ARRAY_INDEX: - list( $array, $offset ) = $node->children; + [ $array, $offset ] = $node->children; $array = $this->evalNode( $array ); // Note: we MUST evaluate the offset to ensure it is valid, regardless @@ -529,7 +529,7 @@ class FilterEvaluator { return $array[$offset]; case AFPTreeNode::UNARY: - list( $operation, $argument ) = $node->children; + [ $operation, $argument ] = $node->children; $argument = $this->evalNode( $argument ); if ( $operation === '-' ) { return $argument->unaryMinus(); @@ -537,30 +537,30 @@ class FilterEvaluator { return $argument; case AFPTreeNode::KEYWORD_OPERATOR: - list( $keyword, $leftOperand, $rightOperand ) = $node->children; + [ $keyword, $leftOperand, $rightOperand ] = $node->children; $leftOperand = $this->evalNode( $leftOperand ); $rightOperand = $this->evalNode( $rightOperand ); return $this->callKeyword( $keyword, $leftOperand, $rightOperand, $node->position ); case AFPTreeNode::BOOL_INVERT: - list( $argument ) = $node->children; + [ $argument ] = $node->children; $argument = $this->evalNode( $argument ); return $argument->boolInvert(); case AFPTreeNode::POW: - list( $base, $exponent ) = $node->children; + [ $base, $exponent ] = $node->children; $base = $this->evalNode( $base ); $exponent = $this->evalNode( $exponent ); return $base->pow( $exponent ); case AFPTreeNode::MUL_REL: - list( $op, $leftOperand, $rightOperand ) = $node->children; + [ $op, $leftOperand, $rightOperand ] = $node->children; $leftOperand = $this->evalNode( $leftOperand ); $rightOperand = $this->evalNode( $rightOperand ); return $leftOperand->mulRel( $rightOperand, $op, $node->position ); case AFPTreeNode::SUM_REL: - list( $op, $leftOperand, $rightOperand ) = $node->children; + [ $op, $leftOperand, $rightOperand ] = $node->children; $leftOperand = $this->evalNode( $leftOperand ); $rightOperand = $this->evalNode( $rightOperand ); switch ( $op ) { @@ -575,14 +575,14 @@ class FilterEvaluator { } // Unreachable line case AFPTreeNode::COMPARE: - list( $op, $leftOperand, $rightOperand ) = $node->children; + [ $op, $leftOperand, $rightOperand ] = $node->children; $leftOperand = $this->evalNode( $leftOperand ); $rightOperand = $this->evalNode( $rightOperand ); $this->raiseCondCount(); return $leftOperand->compareOp( $rightOperand, $op ); case AFPTreeNode::LOGIC: - list( $op, $leftOperand, $rightOperand ) = $node->children; + [ $op, $leftOperand, $rightOperand ] = $node->children; $leftOperand = $this->evalNode( $leftOperand ); $value = $leftOperand->getType() === AFPData::DUNDEFINED ? false : $leftOperand->toBool(); // Short-circuit. @@ -596,7 +596,7 @@ class FilterEvaluator { return $leftOperand->boolOp( $rightOperand, $op ); case AFPTreeNode::CONDITIONAL: - list( $condition, $valueIfTrue, $valueIfFalse ) = $node->children; + [ $condition, $valueIfTrue, $valueIfFalse ] = $node->children; $condition = $this->evalNode( $condition ); $isTrue = $condition->getType() === AFPData::DUNDEFINED ? false : $condition->toBool(); if ( $isTrue ) { @@ -613,13 +613,13 @@ class FilterEvaluator { } case AFPTreeNode::ASSIGNMENT: - list( $varName, $value ) = $node->children; + [ $varName, $value ] = $node->children; $value = $this->evalNode( $value ); $this->setUserVariable( $varName, $value ); return $value; case AFPTreeNode::INDEX_ASSIGNMENT: - list( $varName, $offset, $value ) = $node->children; + [ $varName, $offset, $value ] = $node->children; $array = $this->getVarValue( $varName ); @@ -658,7 +658,7 @@ class FilterEvaluator { return $value; case AFPTreeNode::ARRAY_APPEND: - list( $varName, $value ) = $node->children; + [ $varName, $value ] = $node->children; $array = $this->getVarValue( $varName ); $value = $this->evalNode( $value ); diff --git a/includes/Parser/SyntaxChecker.php b/includes/Parser/SyntaxChecker.php index 9e06e7826..e800c6612 100644 --- a/includes/Parser/SyntaxChecker.php +++ b/includes/Parser/SyntaxChecker.php @@ -164,7 +164,7 @@ class SyntaxChecker { case AFPTreeNode::LOGIC: $result = $this->newNodeBinop( $node ); - list( $op, $left, $right ) = $result->children; + [ $op, $left, $right ] = $result->children; if ( $op === '&' || $op === '|' ) { return $this->desugarAndOr( $op, $left, $right, $node->position ); } else { @@ -190,7 +190,7 @@ class SyntaxChecker { return $this->newNodeMapAll( $node ); case AFPTreeNode::ASSIGNMENT: - list( $varname, $value ) = $node->children; + [ $varname, $value ] = $node->children; return new AFPTreeNode( AFPTreeNode::FUNCTION_CALL, @@ -484,19 +484,19 @@ class SyntaxChecker { } case AFPTreeNode::BINOP: - list( , $left, $right ) = $node->children; + [ , $left, $right ] = $node->children; return $this->check( $right, $this->check( $left, $bound ) ); case AFPTreeNode::UNARY: - list( , $argument ) = $node->children; + [ , $argument ] = $node->children; return $this->check( $argument, $bound ); case AFPTreeNode::BOOL_INVERT: - list( $argument ) = $node->children; + [ $argument ] = $node->children; return $this->check( $argument, $bound ); // phpcs:ignore PSR2.ControlStructures.SwitchDeclaration.TerminatingComment case AFPTreeNode::CONDITIONAL: - list( $condition, $exprIfTrue, $exprIfFalse ) = $node->children; + [ $condition, $exprIfTrue, $exprIfFalse ] = $node->children; $bound = $this->check( $condition, $bound ); $boundLeft = $this->check( $exprIfTrue, $bound ); $boundRight = $this->check( $exprIfFalse, $bound ); @@ -512,7 +512,7 @@ class SyntaxChecker { } case AFPTreeNode::INDEX_ASSIGNMENT: - list( $varName, $offset, $value ) = $node->children; + [ $varName, $offset, $value ] = $node->children; // deal with unbound $varName $bound = $this->lookupVar( $varName, $node->position, $bound ); @@ -522,7 +522,7 @@ class SyntaxChecker { return $this->assignVar( $varName, $node->position, $bound ); case AFPTreeNode::ARRAY_APPEND: - list( $varName, $value ) = $node->children; + [ $varName, $value ] = $node->children; // deal with unbound $varName $bound = $this->lookupVar( $varName, $node->position, $bound ); @@ -646,7 +646,7 @@ class SyntaxChecker { throw new InvalidArgumentException( "$func is not a valid function." ); // @codeCoverageIgnoreEnd } - list( $min, $max ) = FilterEvaluator::FUNC_ARG_COUNT[ $func ]; + [ $min, $max ] = FilterEvaluator::FUNC_ARG_COUNT[ $func ]; if ( count( $args ) < $min ) { throw new UserVisibleException( $min === 1 ? 'noparams' : 'notenoughargs', diff --git a/includes/Special/SpecialAbuseLog.php b/includes/Special/SpecialAbuseLog.php index eba2a1ab1..321ef961f 100644 --- a/includes/Special/SpecialAbuseLog.php +++ b/includes/Special/SpecialAbuseLog.php @@ -549,7 +549,7 @@ class SpecialAbuseLog extends AbuseFilterSpecialPage { $filterConds = [ 'local' => [], 'global' => [] ]; foreach ( $searchIDs as $filter ) { - list( $filterID, $isGlobal ) = GlobalNameUtils::splitGlobalName( $filter ); + [ $filterID, $isGlobal ] = GlobalNameUtils::splitGlobalName( $filter ); $key = $isGlobal ? 'global' : 'local'; $filterConds[$key][] = $filterID; } diff --git a/includes/SpecsFormatter.php b/includes/SpecsFormatter.php index 41a2cf3b1..1befb287d 100644 --- a/includes/SpecsFormatter.php +++ b/includes/SpecsFormatter.php @@ -84,7 +84,7 @@ class SpecsFormatter { $displayAction = $lang->commaList( $messages ); } elseif ( $action === 'throttle' ) { array_shift( $parameters ); - list( $actions, $time ) = explode( ',', array_shift( $parameters ) ); + [ $actions, $time ] = explode( ',', array_shift( $parameters ) ); // Join comma-separated groups in a commaList with a final "and", and convert to messages. // Messages used here: abusefilter-throttle-ip, abusefilter-throttle-user, diff --git a/includes/ThrottleFilterPresentationModel.php b/includes/ThrottleFilterPresentationModel.php index a3116cde7..f34a47471 100644 --- a/includes/ThrottleFilterPresentationModel.php +++ b/includes/ThrottleFilterPresentationModel.php @@ -19,7 +19,7 @@ class ThrottleFilterPresentationModel extends EchoEventPresentationModel { */ public function getHeaderMessage() { $text = $this->event->getTitle()->getText(); - list( , $filter ) = explode( '/', $text, 2 ); + [ , $filter ] = explode( '/', $text, 2 ); $disabledActions = $this->event->getExtraParam( 'throttled-actions' ); if ( $disabledActions === null ) { // BC for when we didn't include the actions here. diff --git a/includes/VariableGenerator/RunVariableGenerator.php b/includes/VariableGenerator/RunVariableGenerator.php index fa8b6e986..593f2c55b 100644 --- a/includes/VariableGenerator/RunVariableGenerator.php +++ b/includes/VariableGenerator/RunVariableGenerator.php @@ -89,7 +89,7 @@ class RunVariableGenerator extends VariableGenerator { if ( $filterText === null ) { return null; } - list( $oldContent, $oldAfText, $text ) = $filterText; + [ $oldContent, $oldAfText, $text ] = $filterText; return $this->newVariableHolderForEdit( $page, $summary, $content, $text, $oldAfText, $oldContent ); @@ -202,7 +202,7 @@ class RunVariableGenerator extends VariableGenerator { if ( $filterText === null ) { return null; } - list( $oldContent, $oldAfText, $text ) = $filterText; + [ $oldContent, $oldAfText, $text ] = $filterText; } else { // Optimization $oldContent = null; diff --git a/includes/View/AbuseFilterViewEdit.php b/includes/View/AbuseFilterViewEdit.php index 187f2dc54..b442837bc 100644 --- a/includes/View/AbuseFilterViewEdit.php +++ b/includes/View/AbuseFilterViewEdit.php @@ -226,7 +226,7 @@ class AbuseFilterViewEdit extends AbuseFilterView { $out->redirect( $this->getTitle()->getLocalURL() ); } else { // Everything went fine! - list( $new_id, $history_id ) = $status->getValue(); + [ $new_id, $history_id ] = $status->getValue(); $out->redirect( $this->getTitle()->getLocalURL( [ @@ -661,7 +661,7 @@ class AbuseFilterViewEdit extends AbuseFilterView { if ( $set ) { // @phan-suppress-next-line PhanTypeArraySuspiciousNullable $parameters is array here - list( $throttleCount, $throttlePeriod ) = explode( ',', $parameters[1], 2 ); + [ $throttleCount, $throttlePeriod ] = explode( ',', $parameters[1], 2 ); $throttleGroups = array_slice( $parameters, 2 ); } else { @@ -921,7 +921,7 @@ class AbuseFilterViewEdit extends AbuseFilterView { case 'block': if ( $set && count( $parameters ) === 3 ) { // Both blocktalk and custom block durations available - list( $blockTalk, $defaultAnonDuration, $defaultUserDuration ) = $parameters; + [ $blockTalk, $defaultAnonDuration, $defaultUserDuration ] = $parameters; } else { if ( $set && count( $parameters ) === 1 ) { // Only blocktalk available diff --git a/maintenance/MigrateActorsAF.php b/maintenance/MigrateActorsAF.php index 6b2d6e575..a0423e72f 100644 --- a/maintenance/MigrateActorsAF.php +++ b/maintenance/MigrateActorsAF.php @@ -265,7 +265,7 @@ class MigrateActorsAF extends LoggedUpdateMaintenance { // Update the existing rows foreach ( $rows as $row ) { if ( !$row->actor_id ) { - list( , $display ) = $this->makeNextCond( $dbw, $primaryKey, $row ); + [ , $display ] = $this->makeNextCond( $dbw, $primaryKey, $row ); $this->error( "Could not make actor for row with $display " . "$userField={$row->$userField} $nameField={$row->$nameField}\n" @@ -286,7 +286,7 @@ class MigrateActorsAF extends LoggedUpdateMaintenance { $countUpdated += $dbw->affectedRows(); } - list( $next, $display ) = $this->makeNextCond( $dbw, $primaryKey, $lastRow ); + [ $next, $display ] = $this->makeNextCond( $dbw, $primaryKey, $lastRow ); $this->output( "... $display\n" ); $this->waitForReplication(); } diff --git a/tests/phpunit/AbuseFilterConsequencesTest.php b/tests/phpunit/AbuseFilterConsequencesTest.php index 8b11ea257..2e368ecb3 100644 --- a/tests/phpunit/AbuseFilterConsequencesTest.php +++ b/tests/phpunit/AbuseFilterConsequencesTest.php @@ -784,7 +784,7 @@ class AbuseFilterConsequencesTest extends MediaWikiIntegrationTestCase { public function testFilterConsequences( $createIds, $actionParams, $expectedConsequences ) { $this->createFilters( $createIds ); $result = $this->doAction( $actionParams ); - list( $expected, $actual ) = $this->checkConsequences( $result, $actionParams, $expectedConsequences ); + [ $expected, $actual ] = $this->checkConsequences( $result, $actionParams, $expectedConsequences ); $this->assertEquals( $expected, @@ -1007,7 +1007,7 @@ class AbuseFilterConsequencesTest extends MediaWikiIntegrationTestCase { $results = $this->doActions( $actionsParams ); $res = $this->checkThrottleConsequence( $results ); $lastParams = array_pop( $actionsParams ); - list( $expected, $actual ) = $this->checkConsequences( $res, $lastParams, $consequences ); + [ $expected, $actual ] = $this->checkConsequences( $res, $lastParams, $consequences ); $this->assertEquals( $expected, @@ -1115,9 +1115,9 @@ class AbuseFilterConsequencesTest extends MediaWikiIntegrationTestCase { public function testWarn( $createIds, $actionParams, $warnIDs, $consequences ) { $this->createFilters( $createIds ); $params = [ $actionParams, $actionParams ]; - list( $warnedStatus, $finalStatus ) = $this->doActions( $params ); + [ $warnedStatus, $finalStatus ] = $this->doActions( $params ); - list( $expectedWarn, $actualWarn ) = $this->checkConsequences( + [ $expectedWarn, $actualWarn ] = $this->checkConsequences( $warnedStatus, $actionParams, [ 'warn' => $warnIDs ] @@ -1129,7 +1129,7 @@ class AbuseFilterConsequencesTest extends MediaWikiIntegrationTestCase { 'The error messages for the first action do not match.' ); - list( $expectedFinal, $actualFinal ) = $this->checkConsequences( + [ $expectedFinal, $actualFinal ] = $this->checkConsequences( $finalStatus, $actionParams, $consequences @@ -1351,7 +1351,7 @@ class AbuseFilterConsequencesTest extends MediaWikiIntegrationTestCase { $this->fail( "Did not $type the cache as expected for a stashed edit." ); } - list( $expected, $actual ) = $this->checkConsequences( $result, $actionParams, $consequences ); + [ $expected, $actual ] = $this->checkConsequences( $result, $actionParams, $consequences ); $this->assertEquals( $expected, @@ -1494,7 +1494,7 @@ class AbuseFilterConsequencesTest extends MediaWikiIntegrationTestCase { AbuseFilterServices::getFilterLookup( $this->getServiceContainer() )->hideLocalFiltersForTesting(); $result = $this->doAction( $actionParams ); - list( $expected, $actual ) = $this->checkConsequences( $result, $actionParams, $consequences ); + [ $expected, $actual ] = $this->checkConsequences( $result, $actionParams, $consequences ); // First check that the filters work as expected $this->assertEquals( diff --git a/tests/phpunit/integration/FilteredActionsHandlerTest.php b/tests/phpunit/integration/FilteredActionsHandlerTest.php index 7ed030d0a..052a82187 100644 --- a/tests/phpunit/integration/FilteredActionsHandlerTest.php +++ b/tests/phpunit/integration/FilteredActionsHandlerTest.php @@ -104,7 +104,7 @@ class FilteredActionsHandlerTest extends \MediaWikiIntegrationTestCase { $variablesManager = $this->createMock( VariablesManager::class ); $variablesManager->method( 'getVar' ) - ->willReturnCallback( fn( $unused, $vars ) => AFPData::newFromPHPVar( $urlsAdded ) ); + ->willReturnCallback( fn ( $unused, $vars ) => AFPData::newFromPHPVar( $urlsAdded ) ); $blockedDomainStorage = $this->createMock( BlockedDomainStorage::class ); $blockedDomainStorage->method( 'loadComputed' ) diff --git a/tests/phpunit/unit/FilterProfilerTest.php b/tests/phpunit/unit/FilterProfilerTest.php index c635c2a0f..e270aebb0 100644 --- a/tests/phpunit/unit/FilterProfilerTest.php +++ b/tests/phpunit/unit/FilterProfilerTest.php @@ -148,7 +148,7 @@ class FilterProfilerTest extends MediaWikiUnitTestCase { ); $found = false; - foreach ( $logger->getBuffer() as list( , $entry ) ) { + foreach ( $logger->getBuffer() as [ , $entry ] ) { $check = preg_match( "/^Edit filter .+ on .+ is taking longer than expected$/", $entry