mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/LoginNotify
synced 2024-11-28 00:40:38 +00:00
Use static closures where safe to use
Created by I25a17fb22b6b669e817317a0f45051ae9c608208 Change-Id: Iadeca93606fdce46f50dc587774673b6d5ed8315
This commit is contained in:
parent
c4874aa65f
commit
b34445b90a
|
@ -271,7 +271,7 @@ class LoginNotify implements LoggerAwareInterface {
|
|||
// already checked the local wiki.
|
||||
unset( $info[wfWikiID()] );
|
||||
usort( $info,
|
||||
function ( $a, $b ) {
|
||||
static function ( $a, $b ) {
|
||||
// descending order
|
||||
return $b['editCount'] - $a['editCount'];
|
||||
}
|
||||
|
|
|
@ -68,9 +68,13 @@ class PresentationModel extends EchoEventPresentationModel {
|
|||
// If it's a bundle, pass it the bundle count as param
|
||||
if ( $this->isBundled() ) {
|
||||
$msg = $this->msg( 'notification-new-bundled-header-login-fail' );
|
||||
$totalAttempts = array_reduce( $this->getBundledEvents(), function ( $sum, EchoEvent $event ) {
|
||||
return $sum + $event->getExtraParam( 'count', 0 );
|
||||
}, 0 );
|
||||
$totalAttempts = array_reduce(
|
||||
$this->getBundledEvents(),
|
||||
static function ( $sum, EchoEvent $event ) {
|
||||
return $sum + $event->getExtraParam( 'count', 0 );
|
||||
},
|
||||
0
|
||||
);
|
||||
$msg->params( $totalAttempts );
|
||||
} else {
|
||||
// If the bundle is read or user goes to Special:Notifications, show
|
||||
|
|
Loading…
Reference in a new issue