Change null to [] for html attributes on call of Html functions

Change-Id: Ia84f5b1f210396cba5daa7b9e8bb8c4069e0171d
This commit is contained in:
Umherirrender 2021-09-22 22:47:28 +02:00
parent 7a545309c7
commit 362a48e316
9 changed files with 22 additions and 22 deletions

View file

@ -3843,8 +3843,8 @@ class EditPage implements IEditObject {
}
if ( !$keyMsg->isDisabled() && !$valueMsg->isDisabled() ) {
$limitReport .= Html::openElement( 'tr' ) .
Html::rawElement( 'th', null, $keyMsg->parse() ) .
Html::rawElement( 'td', null, $valueMsg->parse() ) .
Html::rawElement( 'th', [], $keyMsg->parse() ) .
Html::rawElement( 'td', [], $valueMsg->parse() ) .
Html::closeElement( 'tr' );
}
}

View file

@ -3116,7 +3116,7 @@ class OutputPage extends ContextSource {
$pieces[] = Html::element( 'meta', [ 'charset' => 'UTF-8' ] );
}
$pieces[] = Html::element( 'title', null, $this->getHTMLTitle() );
$pieces[] = Html::element( 'title', [], $this->getHTMLTitle() );
$pieces[] = $this->getRlClient()->getHeadHtml( $htmlAttribs['class'] ?? null );
$pieces[] = $this->buildExemptModules();
$pieces = array_merge( $pieces, array_values( $this->getHeadLinksArray() ) );

View file

@ -377,7 +377,7 @@ class ApiHelp extends ApiBase {
}
$help['flags'] .= Html::openElement( 'ul' );
foreach ( $flags as $flag ) {
$help['flags'] .= Html::rawElement( 'li', null,
$help['flags'] .= Html::rawElement( 'li', [],
self::wrap( $context->msg( "api-help-flag-$flag" ), "apihelp-flag-$flag" )
);
}
@ -389,7 +389,7 @@ class ApiHelp extends ApiBase {
// Probably English, so wrap it.
$extname = Html::element( 'span', [ 'dir' => 'ltr', 'lang' => 'en' ], $sourceInfo['name'] );
}
$help['flags'] .= Html::rawElement( 'li', null,
$help['flags'] .= Html::rawElement( 'li', [],
self::wrap(
$context->msg( 'api-help-source', $extname, $sourceInfo['name'] ),
'apihelp-source'
@ -406,14 +406,14 @@ class ApiHelp extends ApiBase {
} else {
$msg = $context->msg( 'api-help-license-unknown' );
}
$help['flags'] .= Html::rawElement( 'li', null,
$help['flags'] .= Html::rawElement( 'li', [],
self::wrap( $msg, 'apihelp-license' )
);
} else {
$help['flags'] .= Html::rawElement( 'li', null,
$help['flags'] .= Html::rawElement( 'li', [],
self::wrap( $context->msg( 'api-help-source-unknown' ), 'apihelp-source' )
);
$help['flags'] .= Html::rawElement( 'li', null,
$help['flags'] .= Html::rawElement( 'li', [],
self::wrap( $context->msg( 'api-help-license-unknown' ), 'apihelp-license' )
);
}
@ -441,7 +441,7 @@ class ApiHelp extends ApiBase {
}
$help['help-urls'] .= Html::openElement( 'ul' );
foreach ( $urls as $url ) {
$help['help-urls'] .= Html::rawElement( 'li', null,
$help['help-urls'] .= Html::rawElement( 'li', [],
Html::element( 'a', [ 'href' => $url, 'dir' => 'ltr' ], $url )
);
}
@ -473,7 +473,7 @@ class ApiHelp extends ApiBase {
$groups[] = $name;
}
$help['parameters'] .= Html::rawElement( 'dt', null,
$help['parameters'] .= Html::rawElement( 'dt', [],
Html::element( 'span', [ 'dir' => 'ltr', 'lang' => 'en' ], $module->encodeParamName( $name ) )
);
@ -565,7 +565,7 @@ class ApiHelp extends ApiBase {
$module->getModuleName(),
$module->getModulePath()
] );
$help['parameters'] .= Html::element( 'dt', null, '*' );
$help['parameters'] .= Html::element( 'dt', [], '*' );
$help['parameters'] .= Html::rawElement( 'dd',
[ 'class' => 'description' ], $dynamicParams->parse() );
}
@ -595,8 +595,8 @@ class ApiHelp extends ApiBase {
$link = wfAppendQuery( wfScript( 'api' ), $qs );
$sandbox = SpecialPage::getTitleFor( 'ApiSandbox' )->getLocalURL() . '#' . $qs;
$help['examples'] .= Html::rawElement( 'dt', null, $msg->parse() );
$help['examples'] .= Html::rawElement( 'dd', null,
$help['examples'] .= Html::rawElement( 'dt', [], $msg->parse() );
$help['examples'] .= Html::rawElement( 'dd', [],
Html::element( 'a', [ 'href' => $link, 'dir' => 'ltr' ], "api.php?$qs" ) . ' ' .
Html::rawElement( 'a', [ 'href' => $sandbox ],
$context->msg( 'api-help-open-in-apisandbox' )->parse() )

View file

@ -2239,16 +2239,16 @@ class ApiMain extends ApiBase {
// TODO inject stuff, see T265644
$groupPermissionsLookup = MediaWikiServices::getInstance()->getGroupPermissionsLookup();
foreach ( self::RIGHTS_MAP as $right => $rightMsg ) {
$help['permissions'] .= Html::element( 'dt', null, $right );
$help['permissions'] .= Html::element( 'dt', [], $right );
$rightMsg = $this->msg( $rightMsg['msg'], $rightMsg['params'] )->parse();
$help['permissions'] .= Html::rawElement( 'dd', null, $rightMsg );
$help['permissions'] .= Html::rawElement( 'dd', [], $rightMsg );
$groups = array_map( static function ( $group ) {
return $group == '*' ? 'all' : $group;
}, $groupPermissionsLookup->getGroupsWithPermission( $right ) );
$help['permissions'] .= Html::rawElement( 'dd', null,
$help['permissions'] .= Html::rawElement( 'dd', [],
$this->msg( 'api-help-permissions-granted-to' )
->numParams( count( $groups ) )
->params( Message::listParam( $groups ) )

View file

@ -180,7 +180,7 @@ class LogEventsList extends ContextSource {
if ( isset( $extraInputsString ) ) {
$htmlForm->addFooterText( Html::rawElement(
'div',
null,
[],
$extraInputsString
) );
}

View file

@ -132,7 +132,7 @@ class InterwikiSearchResultSetWidget implements SearchResultSetWidget {
$caption = $this->customCaptions[$iwPrefix] ??
$this->specialSearch->msg( 'search-interwiki-default', $parsed['host'] )->escaped();
$searchLink = Html::rawElement( 'em', null,
$searchLink = Html::rawElement( 'em', [],
Html::rawElement( 'a', [ 'href' => $href, 'target' => '_blank' ], $caption )
);

View file

@ -47,8 +47,8 @@ class SpecialListGrants extends SpecialPage {
\Html::openElement( 'table',
[ 'class' => 'wikitable mw-listgrouprights-table' ] ) .
'<tr>' .
\Html::element( 'th', null, $this->msg( 'listgrants-grant' )->text() ) .
\Html::element( 'th', null, $this->msg( 'listgrants-rights' )->text() ) .
\Html::element( 'th', [], $this->msg( 'listgrants-grant' )->text() ) .
\Html::element( 'th', [], $this->msg( 'listgrants-rights' )->text() ) .
'</tr>'
);

View file

@ -380,7 +380,7 @@ class SpecialNewpages extends IncludableSpecialPage {
->setWrapperLegendMsg( 'newpages' )
->addFooterText( Html::rawElement(
'div',
null,
[],
$this->filterLinks()
) )
->show();

View file

@ -97,7 +97,7 @@ class CategoryPager extends AlphabeticPager {
$link = $this->getLinkRenderer()->makeLink( $title, $text );
$count = $this->msg( 'nmembers' )->numParams( $result->cat_pages )->escaped();
return Html::rawElement( 'li', null, $this->getLanguage()->specialList( $link, $count ) ) . "\n";
return Html::rawElement( 'li', [], $this->getLanguage()->specialList( $link, $count ) ) . "\n";
}
public function getStartForm( $from ) {