From 5505116a0228e465b340175a7525ddc01e316b50 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartosz=20Dziewo=C5=84ski?= Date: Fri, 15 Nov 2024 00:46:46 +0100 Subject: [PATCH] Fix Phan error related to message parameters Caused by type hints added in MediaWiki core in I3e0df790ff9db2fa630f82408a7254a359fe61ca. `->getVal( 'prefix', '' )` and `->getVal( 'prefix' ) ?? ''` are equivalent, but Phan can't detect that the former is non-null. Change-Id: Iab478ec65fcd91eac7b7cc9d3b04b011ec46a0cb --- includes/SpecialInterwiki.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/includes/SpecialInterwiki.php b/includes/SpecialInterwiki.php index 56b8b6bc..42c2ce13 100644 --- a/includes/SpecialInterwiki.php +++ b/includes/SpecialInterwiki.php @@ -244,7 +244,7 @@ class SpecialInterwiki extends SpecialPage { $status = Status::newGood(); $request = $this->getRequest(); $config = $this->getConfig(); - $prefix = $this->getRequest()->getVal( 'prefix', '' ); + $prefix = $this->getRequest()->getVal( 'prefix' ) ?? ''; $do = $request->getVal( 'action' ); // Show an error if the prefix is invalid (only when adding one). // Invalid characters for a title should also be invalid for a prefix. @@ -356,7 +356,6 @@ class SpecialInterwiki extends SpecialPage { [ $prefix, $theurl, $trans, $local ], $this->getUser() ); - // @phan-suppress-next-line PhanTypeMismatchArgumentNullable $lookup->invalidateCache( $prefix ); } break;