Fix new Phan errors

MediaWiki core change Icb8822def9ce56f42ff52a8e469bb08d61d576c6
improved the type hints for OutputPage::addWikiMsg(), resulting in
two new errors:

* AbuseFilterViewEdit.php: False positive, update suppression
  to include new error code.

* SpecialAbuseLog.php: Genuine bug, the return value of
  Status::getErrors() can't be used directly as a message key.
  I have another change pending that introduces a nicer way
  to do this: Ibc4ce11594cf36ce7b2495d2636ee080d3443b04,
  but in the meantime, make do with the available getters.

Change-Id: Iee0e87496e27a5261adccb977361b3ccf4c9ee2c
This commit is contained in:
Bartosz Dziewoński 2024-04-11 01:07:29 +02:00
parent 5142ff49c4
commit ac777ee88a
2 changed files with 3 additions and 2 deletions

View file

@ -1053,7 +1053,8 @@ class SpecialAbuseLog extends AbuseFilterSpecialPage {
$status = self::getPrivateDetailsRow( $user, $id );
if ( !$status->isGood() ) {
$out->addWikiMsg( $status->getErrors()[0] );
$errArray = $status->getErrors()[0];
$out->addWikiMsgArray( $errArray['message'], $errArray['params'] );
return;
}
$row = $status->getValue();

View file

@ -588,7 +588,7 @@ class AbuseFilterViewEdit extends AbuseFilterView {
$out->addHTML( $form );
if ( $history_id ) {
// @phan-suppress-next-line PhanPossiblyUndeclaredVariable
// @phan-suppress-next-line PhanPossiblyUndeclaredVariable,PhanTypeMismatchArgumentNullable
$out->addWikiMsg( $oldWarningMessage, $history_id, $filter );
}
}