Skip to content
This repository has been archived by the owner on Jun 30, 2024. It is now read-only.

Commit

Permalink
Fix Phan errors
Browse files Browse the repository at this point in the history
(cherry picked from commit 9031ff7)
  • Loading branch information
lens0021 committed Sep 26, 2020
1 parent 65e948e commit 5142c5d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions includes/SanctionsHooks.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

use Flow\Exception\InvalidInputException;
use Flow\Model\UUID;
use MediaWiki\Revision\RevisionRecord;
use MediaWiki\User\UserIdentity;

class SanctionsHooks {
/**
Expand Down Expand Up @@ -210,7 +212,7 @@ public static function onUserToolLinksEdit( $userId, $userText, &$items ) {
* @return bool|void True or no return value to continue or false to abort
*/
public static function onDiffTools( $newRevRecord, &$links, $oldRevRecord, $userIdentity ) {
if ( $userIdentity == null || !SanctionsUtils::hasVoteRight( $userIdentity ) ) {
if ( !SanctionsUtils::hasVoteRight( User::newFromIdentity( $userIdentity ) ) ) {
return true;
}

Expand Down Expand Up @@ -238,7 +240,7 @@ public static function onDiffTools( $newRevRecord, &$links, $oldRevRecord, $user
* @return bool|void True or no return value to continue or false to abort
*/
public static function onHistoryTools( $revRecord, &$links, $prevRevRecord, $userIdentity ) {
if ( $userIdentity == null || !SanctionsUtils::hasVoteRight( $userIdentity ) ) {
if ( !SanctionsUtils::hasVoteRight( User::newFromIdentity( $userIdentity ) ) ) {
return true;
}

Expand Down

0 comments on commit 5142c5d

Please sign in to comment.