Merge "Simplify code that generates different error messages"

This commit is contained in:
jenkins-bot 2022-02-05 23:41:30 +00:00 committed by Gerrit Code Review
commit 1f08bd8abc

View file

@ -88,12 +88,11 @@ class InputBox {
case 'search2':
return $this->getSearchForm2();
default:
$key = $this->mType === '' ? 'inputbox-error-no-type' : 'inputbox-error-bad-type';
return Xml::tags( 'div', null,
Xml::element( 'strong',
[ 'class' => 'error' ],
strlen( $this->mType ) > 0
? wfMessage( 'inputbox-error-bad-type', $this->mType )->text()
: wfMessage( 'inputbox-error-no-type' )->text()
wfMessage( $key, $this->mType )->text()
)
);
}