SpecialGadgets: Remove incorrect comment and test for $requiredSkins being true

$requiredSkins is always an array

Change-Id: I91bade025a9581c33b99f986e9497299483b8b59
This commit is contained in:
Ed Sanders 2023-07-24 13:36:59 +01:00
parent 31eef4328d
commit 9b6cfa97a0

View file

@ -227,27 +227,24 @@ class SpecialGadgets extends SpecialPage {
// Portion: Show required skins (optional)
$requiredSkins = $gadget->getRequiredSkins();
// $requiredSkins can be an array, or true (if all skins are supported)
if ( is_array( $requiredSkins ) ) {
$skins = [];
$validskins = $skinFactory->getSkinNames();
foreach ( $requiredSkins as $skinid ) {
if ( isset( $validskins[$skinid] ) ) {
$skins[] = $this->msg( "skinname-$skinid" )->plain();
} else {
$skins[] = $skinid;
}
$skins = [];
$validskins = $skinFactory->getSkinNames();
foreach ( $requiredSkins as $skinid ) {
if ( isset( $validskins[$skinid] ) ) {
$skins[] = $this->msg( "skinname-$skinid" )->plain();
} else {
$skins[] = $skinid;
}
if ( $skins ) {
if ( $needLineBreakAfter ) {
$output->addHTML( '<br />' );
}
$output->addHTML(
$this->msg( 'gadgets-required-skins', $lang->commaList( $skins ) )
->numParams( count( $skins ) )->parse()
);
$needLineBreakAfter = true;
}
if ( $skins ) {
if ( $needLineBreakAfter ) {
$output->addHTML( '<br />' );
}
$output->addHTML(
$this->msg( 'gadgets-required-skins', $lang->commaList( $skins ) )
->numParams( count( $skins ) )->parse()
);
$needLineBreakAfter = true;
}
// Portion: Show required actions (optional)