From c38f95f62b9d36e0b3822c11e07425cb73be75d0 Mon Sep 17 00:00:00 2001 From: Ricordisamoa Date: Wed, 10 Feb 2016 23:52:46 +0100 Subject: [PATCH] Stop doing $that = $this in includes/user Closures support $this as of PHP 5.4 Change-Id: If79be54276fe2a35bdd004908cfc160e6636f7c5 --- includes/user/User.php | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/includes/user/User.php b/includes/user/User.php index da6307551c..749ec46840 100644 --- a/includes/user/User.php +++ b/includes/user/User.php @@ -3485,22 +3485,21 @@ class User implements IDBAccessObject { return; } - $that = $this; // Try to update the DB post-send and only if needed... - DeferredUpdates::addCallableUpdate( function() use ( $that, $title, $oldid ) { - if ( !$that->getNewtalk() ) { + DeferredUpdates::addCallableUpdate( function() use ( $title, $oldid ) { + if ( !$this->getNewtalk() ) { return; // no notifications to clear } // Delete the last notifications (they stack up) - $that->setNewtalk( false ); + $this->setNewtalk( false ); // If there is a new, unseen, revision, use its timestamp $nextid = $oldid ? $title->getNextRevisionID( $oldid, Title::GAID_FOR_UPDATE ) : null; if ( $nextid ) { - $that->setNewtalk( true, Revision::newFromId( $nextid ) ); + $this->setNewtalk( true, Revision::newFromId( $nextid ) ); } } ); } @@ -4871,9 +4870,8 @@ class User implements IDBAccessObject { * Deferred version of incEditCountImmediate() */ public function incEditCount() { - $that = $this; - wfGetDB( DB_MASTER )->onTransactionPreCommitOrIdle( function() use ( $that ) { - $that->incEditCountImmediate(); + wfGetDB( DB_MASTER )->onTransactionPreCommitOrIdle( function() { + $this->incEditCountImmediate(); } ); } -- 2.20.1