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.
|
// already checked the local wiki.
|
||||||
unset( $info[wfWikiID()] );
|
unset( $info[wfWikiID()] );
|
||||||
usort( $info,
|
usort( $info,
|
||||||
function ( $a, $b ) {
|
static function ( $a, $b ) {
|
||||||
// descending order
|
// descending order
|
||||||
return $b['editCount'] - $a['editCount'];
|
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 it's a bundle, pass it the bundle count as param
|
||||||
if ( $this->isBundled() ) {
|
if ( $this->isBundled() ) {
|
||||||
$msg = $this->msg( 'notification-new-bundled-header-login-fail' );
|
$msg = $this->msg( 'notification-new-bundled-header-login-fail' );
|
||||||
$totalAttempts = array_reduce( $this->getBundledEvents(), function ( $sum, EchoEvent $event ) {
|
$totalAttempts = array_reduce(
|
||||||
return $sum + $event->getExtraParam( 'count', 0 );
|
$this->getBundledEvents(),
|
||||||
}, 0 );
|
static function ( $sum, EchoEvent $event ) {
|
||||||
|
return $sum + $event->getExtraParam( 'count', 0 );
|
||||||
|
},
|
||||||
|
0
|
||||||
|
);
|
||||||
$msg->params( $totalAttempts );
|
$msg->params( $totalAttempts );
|
||||||
} else {
|
} else {
|
||||||
// If the bundle is read or user goes to Special:Notifications, show
|
// If the bundle is read or user goes to Special:Notifications, show
|
||||||
|
|
Loading…
Reference in a new issue