From 393e47c5a7a493542b5d965109931594ae60205b Mon Sep 17 00:00:00 2001 From: Daimona Eaytoy Date: Sun, 1 Sep 2019 11:23:31 +0200 Subject: [PATCH] Upgrade phan-config to 0.7.1 Change-Id: I859d81eda8601da91602b27a223b6d6d59ecf563 --- composer.json | 2 +- includes/AFComputedVariable.php | 1 + includes/AbuseFilter.php | 4 ++-- includes/AbuseFilterHooks.php | 4 ++-- includes/special/SpecialAbuseLog.php | 1 + 5 files changed, 7 insertions(+), 5 deletions(-) diff --git a/composer.json b/composer.json index 77a789b69..c8ac15dd5 100644 --- a/composer.json +++ b/composer.json @@ -13,7 +13,7 @@ "mediawiki/mediawiki-codesniffer": "26.0.0", "jakub-onderka/php-console-highlighter": "0.3.2", "mediawiki/minus-x": "0.3.2", - "mediawiki/mediawiki-phan-config": "0.6.1" + "mediawiki/mediawiki-phan-config": "0.7.1" }, "scripts": { "fix": [ diff --git a/includes/AFComputedVariable.php b/includes/AFComputedVariable.php index 2d65ffe2b..032480f00 100644 --- a/includes/AFComputedVariable.php +++ b/includes/AFComputedVariable.php @@ -175,6 +175,7 @@ class AFComputedVariable { if ( !Hooks::run( 'AbuseFilter-interceptVariable', [ $this->mMethod, $vars, $parameters, &$result ] ) ) { + // @phan-suppress-next-line PhanImpossibleCondition False positive due to hook reference return $result instanceof AFPData ? $result : AFPData::newFromPHPVar( $result ); } diff --git a/includes/AbuseFilter.php b/includes/AbuseFilter.php index 3002d030d..827985898 100644 --- a/includes/AbuseFilter.php +++ b/includes/AbuseFilter.php @@ -580,7 +580,7 @@ class AbuseFilter { /** * @param string[] $filters - * @return array[] + * @return array[][] */ public static function getConsequencesForFilters( $filters ) { $globalFilters = []; @@ -620,7 +620,7 @@ class AbuseFilter { * @param IDatabase $dbr * @param string[] $filters * @param string $prefix - * @return array[] + * @return array[][] */ public static function loadConsequencesFromDB( IDatabase $dbr, $filters, $prefix = '' ) { $actionsByFilter = []; diff --git a/includes/AbuseFilterHooks.php b/includes/AbuseFilterHooks.php index af050d163..180dadff9 100644 --- a/includes/AbuseFilterHooks.php +++ b/includes/AbuseFilterHooks.php @@ -160,7 +160,7 @@ class AbuseFilterHooks { AFComputedVariable::$articleCache[$articleCacheKey] = $page; // Don't trigger for null edits. - if ( $content && $oldContent ) { + if ( $oldContent ) { // Compare Content objects if available if ( $content->equals( $oldContent ) ) { return null; @@ -327,7 +327,7 @@ class AbuseFilterHooks { $flags, Revision $revision, Status $status, $baseRevId ) { $curTitle = $wikiPage->getTitle()->getPrefixedText(); - if ( !isset( AbuseFilter::$logIds[ $curTitle ] ) || !$revision || + if ( !isset( AbuseFilter::$logIds[ $curTitle ] ) || $wikiPage !== self::$lastEditPage ) { // This isn't the edit AbuseFilter::$logIds was set for diff --git a/includes/special/SpecialAbuseLog.php b/includes/special/SpecialAbuseLog.php index 200881ae1..f405b82a3 100644 --- a/includes/special/SpecialAbuseLog.php +++ b/includes/special/SpecialAbuseLog.php @@ -478,6 +478,7 @@ class SpecialAbuseLog extends AbuseFilterSpecialPage { } } + // @phan-suppress-next-line PhanImpossibleCondition if ( $foundInvalid ) { $out->addHTML( Html::rawElement(