build: Updating mediawiki/mediawiki-codesniffer to 0.9.0

The following sniffs are failing and were disabled:
* MediaWiki.Commenting.FunctionComment.MissingParamComment
* MediaWiki.Commenting.FunctionComment.MissingParamName
* MediaWiki.Commenting.FunctionComment.MissingParamTag
* MediaWiki.Commenting.FunctionComment.MissingReturn
* MediaWiki.FunctionComment.Missing.Public
* MediaWiki.NamingConventions.LowerCamelFunctionsName.FunctionName
* MediaWiki.WhiteSpace.SpaceBeforeSingleLineComment.NewLineComment

Change-Id: I2f8e57c10e62a2aed4fe50c3844022283e56b009
This commit is contained in:
Kunal Mehta 2017-06-20 00:20:13 -07:00
parent 2f986eae49
commit e6f36ecb6a
6 changed files with 17 additions and 19 deletions

1
.gitignore vendored
View file

@ -4,3 +4,4 @@
.*.swp
node_modules/
/vendor
composer.lock

View file

@ -59,7 +59,6 @@ class RSSData {
* @return String Name to map it to
*/
protected function rssTokenToName( $name ) {
$tokenNames = [
'dc:date' => 'date',
'pubDate' => 'date',
@ -82,7 +81,6 @@ class RSSData {
}
return $name;
}
}

View file

@ -27,7 +27,6 @@ class RSSHooks {
$wgRSSUrlWhitelist,$wgRSSAllowedFeeds;
if ( is_array( $wgRSSNamespaces ) && count( $wgRSSNamespaces ) ) {
$ns = $parser->getTitle()->getNamespace();
$checkNS = array_flip( $wgRSSNamespaces );
@ -45,7 +44,6 @@ class RSSHooks {
if ( !isset( $wgRSSUrlWhitelist )
|| !is_array( $wgRSSUrlWhitelist )
|| ( count( $wgRSSUrlWhitelist ) === 0 ) ) {
return RSSUtils::RSSError( 'rss-empty-whitelist',
$input
);
@ -58,7 +56,6 @@ class RSSHooks {
if ( !( in_array( $input, $wgRSSUrlWhitelist ) )
&& !( in_array( "*", $wgRSSUrlWhitelist ) ) ) {
$listOfAllowed = $parser->getFunctionLang()->listToText( $wgRSSUrlWhitelist );
$numberAllowed = $parser->getFunctionLang()->formatNum( count( $wgRSSUrlWhitelist ) );

View file

@ -131,9 +131,9 @@ class RSSParser {
// if the attribute parameter templatename= is not present
// then it defaults to
// {{ Template:RSSPost | title = {{{title}}} | ... }}
// - if Template:RSSPost exists from pre-1.9 versions
// - if Template:RSSPost exists from pre-1.9 versions
// {{ MediaWiki:Rss-feed | title = {{{title}}} | ... }}
// - otherwise
// - otherwise
$this->itemTemplate = wfMessage( 'rss-item', $feedTemplatePagename )->plain();
}
@ -327,7 +327,7 @@ class RSSParser {
$text = preg_replace_callback(
"/{$this->markerString}-(\d+)-{$this->markerString}/",
function ( array $matches ) use ( $stripItems ) {
$markerIndex = (int) $matches[1];
$markerIndex = (int)$matches[1];
return $stripItems[$markerIndex];
},
$result->getText()
@ -344,11 +344,9 @@ class RSSParser {
* @return string
*/
function renderFeed( $parser, $frame ) {
$renderedFeed = '';
if ( isset( $this->itemTemplate ) && isset( $parser ) && isset( $frame ) ) {
$headcnt = 0;
if ( $this->reversed ) {
$this->rss->items = array_reverse( $this->rss->items );
@ -381,7 +379,6 @@ class RSSParser {
* @return mixed
*/
protected function renderItem( $item, $parser ) {
$renderedItem = $this->itemTemplate;
// $info will only be an XML element name, so we're safe using it.
@ -487,7 +484,6 @@ class RSSParser {
if ( ( isset( $wgRSSAllowLinkTag ) && $wgRSSAllowLinkTag )
|| ( isset( $wgRSSAllowImageTag ) && $wgRSSAllowImageTag ) ) {
$ret = Sanitizer::removeHTMLtags( $text, null, [], $extraInclude, $extraExclude );
} else { // use the old escape method for a while
@ -671,7 +667,6 @@ class RSSUtils {
* @return String Html that is the error.
*/
public static function RSSError( $errorMessageName, $param = false ) {
// Anything from a parser tag should use Content lang for message,
// since the cache doesn't vary by user language: use ->inContentLanguage()
// The ->parse() part makes everything safe from an escaping standpoint.
@ -680,7 +675,6 @@ class RSSUtils {
"Extension:RSS -- Error: " . wfMessage( $errorMessageName )
->inContentLanguage()->params( $param )->parse()
);
}
}

View file

@ -2,7 +2,7 @@
"require-dev": {
"jakub-onderka/php-parallel-lint": "0.9.2",
"jakub-onderka/php-console-highlighter": "0.3.2",
"mediawiki/mediawiki-codesniffer": "0.7.2"
"mediawiki/mediawiki-codesniffer": "0.9.0"
},
"scripts": {
"fix": "phpcbf",

View file

@ -1,9 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.0"?>
<ruleset>
<rule ref="vendor/mediawiki/mediawiki-codesniffer/MediaWiki"/>
<rule ref="vendor/mediawiki/mediawiki-codesniffer/MediaWiki">
<exclude name="MediaWiki.Commenting.FunctionComment.MissingParamComment" />
<exclude name="MediaWiki.Commenting.FunctionComment.MissingParamName" />
<exclude name="MediaWiki.Commenting.FunctionComment.MissingParamTag" />
<exclude name="MediaWiki.Commenting.FunctionComment.MissingReturn" />
<exclude name="MediaWiki.FunctionComment.Missing.Public" />
<exclude name="MediaWiki.NamingConventions.LowerCamelFunctionsName.FunctionName" />
<exclude name="MediaWiki.WhiteSpace.SpaceBeforeSingleLineComment.NewLineComment" />
</rule>
<file>.</file>
<arg name="extensions" value="php,php5,inc"/>
<arg name="encoding" value="utf8"/>
<arg name="extensions" value="php,php5,inc" />
<arg name="encoding" value="utf8" />
<exclude-pattern>vendor</exclude-pattern>
<exclude-pattern>node_modules</exclude-pattern>
</ruleset>