mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/AbuseFilter.git
synced 2024-11-27 15:30:42 +00:00
Merge "Clean up Throttle::throttleIdentifier"
This commit is contained in:
commit
ca31a12be4
|
@ -187,7 +187,7 @@ class Throttle extends Consequence implements ConsequencesDisablerConsequence {
|
|||
break;
|
||||
case 'editcount':
|
||||
// Hack for detecting different single-purpose accounts.
|
||||
$identifier = $user->isRegistered() ? $this->userEditTracker->getUserEditCount( $user ) : 0;
|
||||
$identifier = $this->userEditTracker->getUserEditCount( $user ) ?: 0;
|
||||
break;
|
||||
case 'site':
|
||||
$identifier = 1;
|
||||
|
@ -203,7 +203,6 @@ class Throttle extends Consequence implements ConsequencesDisablerConsequence {
|
|||
// @codeCoverageIgnoreEnd
|
||||
}
|
||||
|
||||
// @phan-suppress-next-line PhanTypeMismatchReturnNullable Simplify 'editcount' in 1.37+
|
||||
return $identifier;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -308,9 +308,7 @@ class LazyVariableComputer {
|
|||
case 'user-editcount':
|
||||
/** @var UserIdentity $userIdentity */
|
||||
$userIdentity = $parameters['user-identity'];
|
||||
$result = $userIdentity->isRegistered()
|
||||
? $this->userEditTracker->getUserEditCount( $userIdentity )
|
||||
: null;
|
||||
$result = $this->userEditTracker->getUserEditCount( $userIdentity );
|
||||
break;
|
||||
case 'user-emailconfirm':
|
||||
/** @var User $user */
|
||||
|
|
Loading…
Reference in a new issue