build: Updating mediawiki/mediawiki-codesniffer to 23.0.0
Avoid use of __METHOD__ magic constant in closure Change-Id: I28d519530ca2fcde026a6cbb419848098d4617ca
This commit is contained in:
parent
22d2f1c102
commit
efe5761c93
5 changed files with 22 additions and 17 deletions
|
|
@ -64,7 +64,7 @@
|
|||
"jakub-onderka/php-parallel-lint": "0.9.2",
|
||||
"jetbrains/phpstorm-stubs": "dev-master#38ff1a581b297f7901e961b8c923862ea80c3b96",
|
||||
"justinrainbow/json-schema": "~5.2",
|
||||
"mediawiki/mediawiki-codesniffer": "22.0.0",
|
||||
"mediawiki/mediawiki-codesniffer": "23.0.0",
|
||||
"monolog/monolog": "~1.22.1",
|
||||
"nikic/php-parser": "3.1.3",
|
||||
"seld/jsonlint": "1.7.1",
|
||||
|
|
|
|||
|
|
@ -70,11 +70,12 @@ class RollbackAction extends FormlessAction {
|
|||
}
|
||||
|
||||
// @TODO: remove this hack once rollback uses POST (T88044)
|
||||
$fname = __METHOD__;
|
||||
$trxLimits = $this->context->getConfig()->get( 'TrxProfilerLimits' );
|
||||
$trxProfiler = Profiler::instance()->getTransactionProfiler();
|
||||
$trxProfiler->setExpectations( $trxLimits['POST'], __METHOD__ );
|
||||
DeferredUpdates::addCallableUpdate( function () use ( $trxProfiler, $trxLimits ) {
|
||||
$trxProfiler->setExpectations( $trxLimits['PostSend-POST'], __METHOD__ );
|
||||
$trxProfiler->setExpectations( $trxLimits['POST'], $fname );
|
||||
DeferredUpdates::addCallableUpdate( function () use ( $trxProfiler, $trxLimits, $fname ) {
|
||||
$trxProfiler->setExpectations( $trxLimits['PostSend-POST'], $fname );
|
||||
} );
|
||||
|
||||
$data = null;
|
||||
|
|
|
|||
|
|
@ -56,11 +56,12 @@ class ApiRollback extends ApiBase {
|
|||
}
|
||||
|
||||
// @TODO: remove this hack once rollback uses POST (T88044)
|
||||
$fname = __METHOD__;
|
||||
$trxLimits = $this->getConfig()->get( 'TrxProfilerLimits' );
|
||||
$trxProfiler = Profiler::instance()->getTransactionProfiler();
|
||||
$trxProfiler->setExpectations( $trxLimits['POST'], __METHOD__ );
|
||||
DeferredUpdates::addCallableUpdate( function () use ( $trxProfiler, $trxLimits ) {
|
||||
$trxProfiler->setExpectations( $trxLimits['PostSend-POST'], __METHOD__ );
|
||||
$trxProfiler->setExpectations( $trxLimits['POST'], $fname );
|
||||
DeferredUpdates::addCallableUpdate( function () use ( $trxProfiler, $trxLimits, $fname ) {
|
||||
$trxProfiler->setExpectations( $trxLimits['PostSend-POST'], $fname );
|
||||
} );
|
||||
|
||||
$retval = $pageObj->doRollback(
|
||||
|
|
|
|||
|
|
@ -348,13 +348,14 @@ class ChangeTags {
|
|||
foreach ( $tagsToAdd as $tag ) {
|
||||
$changeTagMapping[$tag] = $changeTagDefStore->acquireId( $tag );
|
||||
}
|
||||
$fname = __METHOD__;
|
||||
// T207881: update the counts at the end of the transaction
|
||||
$dbw->onTransactionPreCommitOrIdle( function () use ( $dbw, $tagsToAdd ) {
|
||||
$dbw->onTransactionPreCommitOrIdle( function () use ( $dbw, $tagsToAdd, $fname ) {
|
||||
$dbw->update(
|
||||
'change_tag_def',
|
||||
[ 'ctd_count = ctd_count + 1' ],
|
||||
[ 'ctd_name' => $tagsToAdd ],
|
||||
__METHOD__
|
||||
$fname
|
||||
);
|
||||
} );
|
||||
|
||||
|
|
@ -381,6 +382,7 @@ class ChangeTags {
|
|||
|
||||
// delete from change_tag
|
||||
if ( count( $tagsToRemove ) ) {
|
||||
$fname = __METHOD__;
|
||||
foreach ( $tagsToRemove as $tag ) {
|
||||
$conds = array_filter(
|
||||
[
|
||||
|
|
@ -393,18 +395,18 @@ class ChangeTags {
|
|||
$dbw->delete( 'change_tag', $conds, __METHOD__ );
|
||||
if ( $dbw->affectedRows() ) {
|
||||
// T207881: update the counts at the end of the transaction
|
||||
$dbw->onTransactionPreCommitOrIdle( function () use ( $dbw, $tag ) {
|
||||
$dbw->onTransactionPreCommitOrIdle( function () use ( $dbw, $tag, $fname ) {
|
||||
$dbw->update(
|
||||
'change_tag_def',
|
||||
[ 'ctd_count = ctd_count - 1' ],
|
||||
[ 'ctd_name' => $tag ],
|
||||
__METHOD__
|
||||
$fname
|
||||
);
|
||||
|
||||
$dbw->delete(
|
||||
'change_tag_def',
|
||||
[ 'ctd_name' => $tag, 'ctd_count' => 0, 'ctd_user_defined' => 0 ],
|
||||
__METHOD__
|
||||
$fname
|
||||
);
|
||||
} );
|
||||
}
|
||||
|
|
@ -1459,7 +1461,7 @@ class ChangeTags {
|
|||
'change_tag_def',
|
||||
'ctd_name',
|
||||
[ 'ctd_user_defined' => 1 ],
|
||||
__METHOD__
|
||||
$fname
|
||||
);
|
||||
|
||||
return array_filter( array_unique( $tags ) );
|
||||
|
|
|
|||
|
|
@ -68,14 +68,15 @@ class UserEditCountUpdate implements DeferrableUpdate, MergeableUpdate {
|
|||
public function doUpdate() {
|
||||
$lb = MediaWikiServices::getInstance()->getDBLoadBalancer();
|
||||
$dbw = $lb->getConnection( DB_MASTER );
|
||||
$fname = __METHOD__;
|
||||
|
||||
( new AutoCommitUpdate( $dbw, __METHOD__, function () use ( $lb, $dbw ) {
|
||||
( new AutoCommitUpdate( $dbw, __METHOD__, function () use ( $lb, $dbw, $fname ) {
|
||||
foreach ( $this->infoByUser as $userId => $info ) {
|
||||
$dbw->update(
|
||||
'user',
|
||||
[ 'user_editcount=user_editcount+' . (int)$info['increment'] ],
|
||||
[ 'user_id' => $userId, 'user_editcount IS NOT NULL' ],
|
||||
__METHOD__
|
||||
$fname
|
||||
);
|
||||
/** @var User[] $affectedInstances */
|
||||
$affectedInstances = $info['instances'];
|
||||
|
|
@ -87,7 +88,7 @@ class UserEditCountUpdate implements DeferrableUpdate, MergeableUpdate {
|
|||
if ( $dbr !== $dbw ) {
|
||||
// This method runs after the new revisions were committed.
|
||||
// Wait for the replica to catch up so they will all be counted.
|
||||
$dbr->flushSnapshot( __METHOD__ );
|
||||
$dbr->flushSnapshot( $fname );
|
||||
$lb->safeWaitForMasterPos( $dbr );
|
||||
}
|
||||
$affectedInstances[0]->initEditCountInternal();
|
||||
|
|
@ -96,7 +97,7 @@ class UserEditCountUpdate implements DeferrableUpdate, MergeableUpdate {
|
|||
'user',
|
||||
[ 'user_editcount' ],
|
||||
[ 'user_id' => $userId ],
|
||||
__METHOD__
|
||||
$fname
|
||||
);
|
||||
|
||||
// Update the edit count in the instance caches. This is mostly useful
|
||||
|
|
|
|||
Loading…
Reference in a new issue