From: Ricordisamoa Date: Wed, 10 Feb 2016 22:52:46 +0000 (+0100) Subject: Stop doing $that = $this in includes/user X-Git-Tag: 1.31.0-rc.0~7999^2 X-Git-Url: http://git.cyclocoop.org/data/%24oldEdit?a=commitdiff_plain;h=c38f95f62b9d36e0b3822c11e07425cb73be75d0;p=lhc%2Fweb%2Fwiklou.git Stop doing $that = $this in includes/user Closures support $this as of PHP 5.4 Change-Id: If79be54276fe2a35bdd004908cfc160e6636f7c5 --- 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(); } ); }