Merge "build: Update mediawiki-codesniffer to 0.6.0, add "composer fix""
This commit is contained in:
commit
a592a76edf
25 changed files with 18 additions and 40 deletions
|
|
@ -41,7 +41,7 @@
|
|||
"require-dev": {
|
||||
"jakub-onderka/php-parallel-lint": "0.9.2",
|
||||
"justinrainbow/json-schema": "~1.3",
|
||||
"mediawiki/mediawiki-codesniffer": "0.5.1",
|
||||
"mediawiki/mediawiki-codesniffer": "0.6.0",
|
||||
"monolog/monolog": "~1.17.2",
|
||||
"nikic/php-parser": "1.4.1",
|
||||
"nmred/kafka-php": "0.1.5",
|
||||
|
|
@ -68,7 +68,8 @@
|
|||
},
|
||||
"scripts": {
|
||||
"lint": "parallel-lint --exclude vendor",
|
||||
"phpcs": "phpcs -p $PHPCS_ARGS",
|
||||
"phpcs": "phpcs -p -s",
|
||||
"fix": "phpcbf",
|
||||
"pre-install-cmd": "ComposerHookHandler::onPreInstall",
|
||||
"pre-update-cmd": "ComposerHookHandler::onPreUpdate",
|
||||
"test": [
|
||||
|
|
|
|||
|
|
@ -26,7 +26,6 @@
|
|||
* @file
|
||||
*/
|
||||
|
||||
|
||||
# bug 15461: Make IE8 turn off content sniffing. Everybody else should ignore this
|
||||
# We're adding it here so that it's *always* set, even for alternate entry
|
||||
# points and when $wgOut gets disabled or overridden.
|
||||
|
|
|
|||
|
|
@ -102,7 +102,7 @@ class MemoizedCallable {
|
|||
* @param array $args Parameters for memoized function or method.
|
||||
* @return mixed The memoized callable's return value.
|
||||
*/
|
||||
public function invokeArgs( Array $args = [] ) {
|
||||
public function invokeArgs( array $args = [] ) {
|
||||
foreach ( $args as $arg ) {
|
||||
if ( $arg !== null && !is_scalar( $arg ) ) {
|
||||
throw new InvalidArgumentException(
|
||||
|
|
@ -144,7 +144,7 @@ class MemoizedCallable {
|
|||
* @param array $args
|
||||
* @param int $ttl
|
||||
*/
|
||||
public static function call( $callable, Array $args = [], $ttl = 3600 ) {
|
||||
public static function call( $callable, array $args = [], $ttl = 3600 ) {
|
||||
$instance = new self( $callable, $ttl );
|
||||
return $instance->invokeArgs( $args );
|
||||
}
|
||||
|
|
|
|||
|
|
@ -132,7 +132,6 @@ class XmlTypeCheck {
|
|||
return $this->rootElement;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $fname the filename
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -2653,7 +2653,6 @@ class Article implements Page {
|
|||
);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param array $limit
|
||||
* @param array $expiry
|
||||
|
|
|
|||
|
|
@ -172,7 +172,7 @@ class ResourceLoader implements LoggerAwareInterface {
|
|||
* - (bool) cache: Whether to allow caching this data. Default: true.
|
||||
* @return string Filtered data, or a comment containing an error message
|
||||
*/
|
||||
public static function filter( $filter, $data, Array $options = [] ) {
|
||||
public static function filter( $filter, $data, array $options = [] ) {
|
||||
if ( strpos( $data, ResourceLoader::FILTER_NOMIN ) !== false ) {
|
||||
return $data;
|
||||
}
|
||||
|
|
@ -614,7 +614,7 @@ class ResourceLoader implements LoggerAwareInterface {
|
|||
* @param array $modules List of ResourceLoaderModule objects
|
||||
* @return string Hash
|
||||
*/
|
||||
public function getCombinedVersion( ResourceLoaderContext $context, Array $modules ) {
|
||||
public function getCombinedVersion( ResourceLoaderContext $context, array $modules ) {
|
||||
if ( !$modules ) {
|
||||
return '';
|
||||
}
|
||||
|
|
@ -1241,7 +1241,7 @@ MESSAGE;
|
|||
*
|
||||
* @param Array $array
|
||||
*/
|
||||
private static function trimArray( Array &$array ) {
|
||||
private static function trimArray( array &$array ) {
|
||||
$i = count( $array );
|
||||
while ( $i-- ) {
|
||||
if ( $array[$i] === null
|
||||
|
|
|
|||
|
|
@ -472,7 +472,7 @@ abstract class ResourceLoaderModule implements LoggerAwareInterface {
|
|||
* @param array $filePaths
|
||||
* @return array
|
||||
*/
|
||||
public static function getRelativePaths( Array $filePaths ) {
|
||||
public static function getRelativePaths( array $filePaths ) {
|
||||
global $IP;
|
||||
return array_map( function ( $path ) use ( $IP ) {
|
||||
return RelPath\getRelativePath( $path, $IP );
|
||||
|
|
@ -486,7 +486,7 @@ abstract class ResourceLoaderModule implements LoggerAwareInterface {
|
|||
* @param array $filePaths
|
||||
* @return array
|
||||
*/
|
||||
public static function expandRelativePaths( Array $filePaths ) {
|
||||
public static function expandRelativePaths( array $filePaths ) {
|
||||
global $IP;
|
||||
return array_map( function ( $path ) use ( $IP ) {
|
||||
return RelPath\joinPath( $IP, $path );
|
||||
|
|
|
|||
|
|
@ -203,7 +203,6 @@ class SearchSuggestionSet {
|
|||
return new SearchSuggestionSet( $suggestions );
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return SearchSuggestionSet an empty suggestion set
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -10,7 +10,6 @@
|
|||
|
||||
$fallback = 'it';
|
||||
|
||||
|
||||
$namespaceNames = [
|
||||
NS_MEDIA => 'Media',
|
||||
NS_SPECIAL => 'Speciâl',
|
||||
|
|
|
|||
|
|
@ -40,7 +40,6 @@ $namespaceAliases = [
|
|||
'Սպասարկող' => NS_SPECIAL,
|
||||
];
|
||||
|
||||
|
||||
$datePreferences = [
|
||||
'default',
|
||||
'mdy',
|
||||
|
|
|
|||
|
|
@ -112,7 +112,6 @@ $namespaceAliases = [
|
|||
'ٴۇلگٴى_تالقىلاۋى' => NS_TEMPLATE_TALK,
|
||||
];
|
||||
|
||||
|
||||
$datePreferences = [
|
||||
'default',
|
||||
'mdy',
|
||||
|
|
|
|||
|
|
@ -98,7 +98,6 @@ $namespaceAliases = [
|
|||
'سانات_تالقىلاۋى' => NS_CATEGORY_TALK,
|
||||
];
|
||||
|
||||
|
||||
$datePreferences = [
|
||||
'default',
|
||||
'mdy',
|
||||
|
|
|
|||
|
|
@ -93,7 +93,6 @@ $namespaceAliases = [
|
|||
'سانات_تالقىلاۋى' => NS_CATEGORY_TALK,
|
||||
];
|
||||
|
||||
|
||||
$datePreferences = [
|
||||
'default',
|
||||
'mdy',
|
||||
|
|
|
|||
|
|
@ -60,7 +60,6 @@ $namespaceAliases = [
|
|||
'ការពិភាក្សាអំពីចំនាត់ថ្នាក់ក្រុម' => NS_CATEGORY_TALK,
|
||||
];
|
||||
|
||||
|
||||
$digitTransformTable = [
|
||||
'0' => '០', # ០
|
||||
'1' => '១', # ១
|
||||
|
|
|
|||
|
|
@ -23,7 +23,6 @@
|
|||
|
||||
$fallback = 'nl';
|
||||
|
||||
|
||||
$namespaceNames = [
|
||||
NS_MEDIA => 'Media',
|
||||
NS_SPECIAL => 'Speciaal',
|
||||
|
|
|
|||
|
|
@ -47,7 +47,6 @@ $namespaceAliases = [
|
|||
'Разговор_за_слика' => NS_FILE_TALK,
|
||||
];
|
||||
|
||||
|
||||
$datePreferences = [
|
||||
'default',
|
||||
'dmy mk',
|
||||
|
|
|
|||
|
|
@ -85,7 +85,6 @@ $magicWords = [
|
|||
'grammar' => [ '0', 'GRAMMATIK:', 'GRAMMAR:' ],
|
||||
];
|
||||
|
||||
|
||||
$bookstoreList = [
|
||||
'Verteken vun leverbore Böker' => 'http://www.buchhandel.de/sixcms/list.php?page=buchhandel_profisuche_frameset&suchfeld=isbn&suchwert=$1=0&y=0',
|
||||
'abebooks.de' => 'http://www.abebooks.de/servlet/BookSearchPL?ph=2&isbn=$1',
|
||||
|
|
|
|||
|
|
@ -42,7 +42,6 @@
|
|||
* @see http://nn.wikipedia.org/w/index.php?title=Brukar:Dittaeva/LanguageNn.php&action=history
|
||||
*/
|
||||
|
||||
|
||||
$datePreferences = [
|
||||
'default',
|
||||
'dmyt',
|
||||
|
|
|
|||
|
|
@ -148,7 +148,6 @@ $specialPageAliases = [
|
|||
'Withoutinterwiki' => [ 'ÆнæИнтервики' ],
|
||||
];
|
||||
|
||||
|
||||
$magicWords = [
|
||||
'redirect' => [ '0', '#ÆРВИТÆН', '#ÆРВЫСТ', '#РАРВЫСТ', '#перенаправление', '#перенапр', '#REDIRECT' ],
|
||||
'notoc' => [ '0', '__ÆНÆСÆР__', '__БЕЗ_ОГЛАВЛЕНИЯ__', '__БЕЗ_ОГЛ__', '__NOTOC__' ],
|
||||
|
|
|
|||
|
|
@ -388,7 +388,6 @@ $magicWords = [
|
|||
'pagesincategory_files' => [ '0', 'файлы', 'files' ],
|
||||
];
|
||||
|
||||
|
||||
$dateFormats = [
|
||||
'mdy time' => 'H:i',
|
||||
'mdy date' => 'xg j, Y',
|
||||
|
|
|
|||
|
|
@ -157,7 +157,6 @@ $dateFormats = [
|
|||
'h:mm d mon y both' => 'G:i, j M Y',
|
||||
];
|
||||
|
||||
|
||||
/* NOT USED IN STABLE VERSION */
|
||||
$magicWords = [
|
||||
'redirect' => [ '0', '#Preusmeri', '#preusmeri', '#PREUSMERI', '#Preusmjeri', '#preusmjeri', '#PREUSMJERI', '#redirect', '#REDIRECT' ],
|
||||
|
|
|
|||
|
|
@ -349,7 +349,6 @@ $datePreferenceMigrationMap = [
|
|||
'vi normal',
|
||||
];
|
||||
|
||||
|
||||
$linkTrail = "/^([a-zàâçéèêîôûäëïöüùÇÉÂÊÎÔÛÄËÏÖÜÀÈÙ]+)(.*)$/sDu";
|
||||
$separatorTransformTable = [ ',' => '.', '.' => ',' ];
|
||||
|
||||
|
|
|
|||
|
|
@ -1,11 +1,6 @@
|
|||
<?xml version="1.0"?>
|
||||
<ruleset name="MediaWiki">
|
||||
<rule ref="vendor/mediawiki/mediawiki-codesniffer/MediaWiki" />
|
||||
<rule ref="Generic.Arrays.DisallowLongArraySyntax" />
|
||||
<rule ref="Generic.Functions.CallTimePassByReference.NotAllowed">
|
||||
<!-- too many false positives, see T127163 -->
|
||||
<severity>0</severity>
|
||||
</rule>
|
||||
<rule ref="MediaWiki.NamingConventions.PrefixedGlobalFunctions">
|
||||
<properties>
|
||||
<property name="ignoreList" type="array" value="bfNormalizeTitleStrReplace,bfNormalizeTitleStrTr,cdbShowHelp,codepointToUtf8,compare_point,cssfilter,escapeSingleString,findAuxFile,findFiles,getEscapedProfileUrl,getFileCommentFromSourceWiki,getFileUserFromSourceWiki,hexSequenceToUtf8,mccGetHelp,mccShowUsage,mimeTypeMatch,moveToExternal,NothingFunction,NothingFunctionData,resolveStub,resolveStubs,showUsage,splitFilename,utf8ToCodepoint,utf8ToHexSequence" />
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ class PrefixSearchTest extends MediaWikiLangTestCase {
|
|||
$this->setMwGlobals( 'wgSpecialPages', [] );
|
||||
}
|
||||
|
||||
protected function searchProvision( Array $results = null ) {
|
||||
protected function searchProvision( array $results = null ) {
|
||||
if ( $results === null ) {
|
||||
$this->setMwGlobals( 'wgHooks', [] );
|
||||
} else {
|
||||
|
|
@ -149,7 +149,7 @@ class PrefixSearchTest extends MediaWikiLangTestCase {
|
|||
* @covers PrefixSearch::search
|
||||
* @covers PrefixSearch::searchBackend
|
||||
*/
|
||||
public function testSearch( Array $case ) {
|
||||
public function testSearch( array $case ) {
|
||||
$this->searchProvision( null );
|
||||
$searcher = new StringPrefixSearch;
|
||||
$results = $searcher->search( $case['query'], 3 );
|
||||
|
|
@ -165,7 +165,7 @@ class PrefixSearchTest extends MediaWikiLangTestCase {
|
|||
* @covers PrefixSearch::search
|
||||
* @covers PrefixSearch::searchBackend
|
||||
*/
|
||||
public function testSearchWithOffset( Array $case ) {
|
||||
public function testSearchWithOffset( array $case ) {
|
||||
$this->searchProvision( null );
|
||||
$searcher = new StringPrefixSearch;
|
||||
$results = $searcher->search( $case['query'], 3, [], 1 );
|
||||
|
|
@ -298,7 +298,7 @@ class PrefixSearchTest extends MediaWikiLangTestCase {
|
|||
* @dataProvider provideSearchBackend
|
||||
* @covers PrefixSearch::searchBackend
|
||||
*/
|
||||
public function testSearchBackend( Array $case ) {
|
||||
public function testSearchBackend( array $case ) {
|
||||
$this->searchProvision( $case['provision'] );
|
||||
$searcher = new StringPrefixSearch;
|
||||
$results = $searcher->search( $case['query'], 3 );
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@ class SearchEnginePrefixTest extends MediaWikiLangTestCase {
|
|||
$this->search->setNamespaces( [] );
|
||||
}
|
||||
|
||||
protected function searchProvision( Array $results = null ) {
|
||||
protected function searchProvision( array $results = null ) {
|
||||
if ( $results === null ) {
|
||||
$this->setMwGlobals( 'wgHooks', [] );
|
||||
} else {
|
||||
|
|
@ -155,7 +155,7 @@ class SearchEnginePrefixTest extends MediaWikiLangTestCase {
|
|||
* @dataProvider provideSearch
|
||||
* @covers SearchEngine::defaultPrefixSearch
|
||||
*/
|
||||
public function testSearch( Array $case ) {
|
||||
public function testSearch( array $case ) {
|
||||
$this->search->setLimitOffset( 3 );
|
||||
$results = $this->search->defaultPrefixSearch( $case['query'] );
|
||||
$results = array_map( function( Title $t ) {
|
||||
|
|
@ -172,7 +172,7 @@ class SearchEnginePrefixTest extends MediaWikiLangTestCase {
|
|||
* @dataProvider provideSearch
|
||||
* @covers SearchEngine::defaultPrefixSearch
|
||||
*/
|
||||
public function testSearchWithOffset( Array $case ) {
|
||||
public function testSearchWithOffset( array $case ) {
|
||||
$this->search->setLimitOffset( 3, 1 );
|
||||
$results = $this->search->defaultPrefixSearch( $case['query'] );
|
||||
$results = array_map( function( Title $t ) {
|
||||
|
|
@ -308,7 +308,7 @@ class SearchEnginePrefixTest extends MediaWikiLangTestCase {
|
|||
* @dataProvider provideSearchBackend
|
||||
* @covers PrefixSearch::searchBackend
|
||||
*/
|
||||
public function testSearchBackend( Array $case ) {
|
||||
public function testSearchBackend( array $case ) {
|
||||
$search = $stub = $this->getMockBuilder( 'SearchEngine' )
|
||||
->setMethods( [ 'completionSearchBackend' ] )->getMock();
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue