Fix remaining phpcs exclusion

Change-Id: I78ac050a998f62f8b0258f0549b9e4f13cc95f0b
This commit is contained in:
Reedy 2022-11-10 16:42:01 -07:00
parent 542b92e2db
commit acecfc462d
3 changed files with 7 additions and 6 deletions

View file

@ -1,8 +1,6 @@
<?xml version="1.0"?>
<ruleset>
<rule ref="./vendor/mediawiki/mediawiki-codesniffer/MediaWiki">
<exclude name="MediaWiki.WhiteSpace.SpaceBeforeSingleLineComment.NewLineComment" />
</rule>
<rule ref="./vendor/mediawiki/mediawiki-codesniffer/MediaWiki" />
<file>.</file>
<arg name="extensions" value="php" />
<arg name="encoding" value="UTF-8" />

View file

@ -204,7 +204,8 @@ class Hooks {
*/
public static function onParserFirstCallInit( Parser $parser ) {
$parser->setHook( 'templatestyles', [ __CLASS__, 'handleTag' ] );
$parser->extTemplateStylesCache = new MapCacheLRU( 100 ); // 100 is arbitrary
// 100 is arbitrary
$parser->extTemplateStylesCache = new MapCacheLRU( 100 );
}
/**
@ -331,7 +332,8 @@ class Hooks {
// Include any non-default wrapper class in the cache key too
$wrapClass = $parser->getOptions()->getWrapOutputClass();
if ( $wrapClass === false ) { // deprecated
if ( $wrapClass === false ) {
// deprecated
$wrapClass = 'mw-parser-output';
}
if ( $wrapClass !== 'mw-parser-output' || $extraWrapper !== null ) {

View file

@ -158,7 +158,8 @@ class TemplateStylesContentHandler extends CodeContentHandler {
$sanitizer = Hooks::getSanitizer(
$options['class'] ?: 'mw-parser-output', $options['extraWrapper']
);
$sanitizer->clearSanitizationErrors(); // Just in case
// Just in case
$sanitizer->clearSanitizationErrors();
$stylesheet = $sanitizer->sanitize( $stylesheet );
self::processErrors( $status, $sanitizer->getSanitizationErrors(), $options['severity'] );
$sanitizer->clearSanitizationErrors();