mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Linter
synced 2024-11-27 17:20:12 +00:00
build: Updating mediawiki/mediawiki-codesniffer to 0.9.0
The following sniffs are failing and were disabled: * MediaWiki.FunctionComment.Missing.Protected * MediaWiki.FunctionComment.Missing.Public Change-Id: I96e32df48d13040893bfd1be6d90d0db4f7c7d0a
This commit is contained in:
parent
71c1d15860
commit
f2a516582d
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"require-dev": {
|
||||
"jakub-onderka/php-parallel-lint": "0.9",
|
||||
"mediawiki/mediawiki-codesniffer": "0.8.0-alpha.1",
|
||||
"mediawiki/mediawiki-codesniffer": "0.9.0",
|
||||
"jakub-onderka/php-console-highlighter": "0.3.2"
|
||||
},
|
||||
"scripts": {
|
||||
|
|
|
@ -82,7 +82,7 @@ class Hooks {
|
|||
Content $content, array &$updates
|
||||
) {
|
||||
$id = $wikiPage->getId();
|
||||
$updates[] = new MWCallableUpdate( function() use ( $id ) {
|
||||
$updates[] = new MWCallableUpdate( function () use ( $id ) {
|
||||
$database = new Database( $id );
|
||||
$database->setForPage( [] );
|
||||
}, __METHOD__ );
|
||||
|
|
|
@ -130,7 +130,7 @@ class LintErrorsPager extends TablePager {
|
|||
if ( in_array( $this->category, $hasNameCats ) && isset( $lintError->params['name'] ) ) {
|
||||
return Html::element( 'code', [], $lintError->params['name'] );
|
||||
} elseif ( $this->category === 'bogus-image-options' && isset( $lintError->params['items'] ) ) {
|
||||
$list = array_map( function( $in ) {
|
||||
$list = array_map( function ( $in ) {
|
||||
return Html::element( 'code', [], $in );
|
||||
}, $lintError->params['items'] );
|
||||
return $this->getLanguage()->commaList( $list );
|
||||
|
|
|
@ -65,7 +65,7 @@ class TotalsLookup {
|
|||
$totals[$cat] = $this->cache->getWithSetCallback(
|
||||
$this->makeKey( $cat ),
|
||||
WANObjectCache::TTL_INDEFINITE,
|
||||
function( $oldValue, &$ttl, &$setOpts, $oldAsOf ) use ( $cat, &$fetchedTotals ) {
|
||||
function ( $oldValue, &$ttl, &$setOpts, $oldAsOf ) use ( $cat, &$fetchedTotals ) {
|
||||
$setOpts += MWDatabase::getCacheSetOptions( wfGetDB( DB_REPLICA ) );
|
||||
if ( $fetchedTotals === false ) {
|
||||
$fetchedTotals = ( new Database( 0 ) )->getTotals();
|
||||
|
|
|
@ -1,6 +1,9 @@
|
|||
<?xml version="1.0"?>
|
||||
<ruleset>
|
||||
<rule ref="vendor/mediawiki/mediawiki-codesniffer/MediaWiki"/>
|
||||
<rule ref="vendor/mediawiki/mediawiki-codesniffer/MediaWiki">
|
||||
<exclude name="MediaWiki.FunctionComment.Missing.Protected" />
|
||||
<exclude name="MediaWiki.FunctionComment.Missing.Public" />
|
||||
</rule>
|
||||
<file>.</file>
|
||||
<rule ref="MediaWiki.Commenting.FunctionComment.Missing">
|
||||
<severity>0</severity>
|
||||
|
@ -11,7 +14,7 @@
|
|||
<rule ref="MediaWiki.Commenting.FunctionComment.MissingReturn">
|
||||
<severity>0</severity>
|
||||
</rule>
|
||||
<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>
|
||||
</ruleset>
|
||||
|
|
|
@ -53,10 +53,10 @@ class DatabaseTest extends MediaWikiTestCase {
|
|||
}
|
||||
|
||||
private function assertLintErrorsEqual( $expected, $actual ) {
|
||||
$expectedIds = array_map( function( LintError $error ) {
|
||||
$expectedIds = array_map( function ( LintError $error ) {
|
||||
return $error->id();
|
||||
}, $expected );
|
||||
$actualIds = array_map( function( LintError $error ) {
|
||||
$actualIds = array_map( function ( LintError $error ) {
|
||||
return $error->id();
|
||||
}, $actual );
|
||||
$this->assertArrayEquals( $expectedIds, $actualIds );
|
||||
|
|
Loading…
Reference in a new issue