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
This commit is contained in:
Bartosz Dziewoński 2024-11-15 00:46:46 +01:00
parent 68c828e813
commit 5505116a02

View file

@ -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;