"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",
},
"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": [
* @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.
* @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(
* @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 );
}
return $this->rootElement;
}
-
/**
* @param string $fname the filename
*/
);
}
-
/**
* @param array $limit
* @param array $expiry
* - (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;
}
* @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 '';
}
*
* @param Array $array
*/
- private static function trimArray( Array &$array ) {
+ private static function trimArray( array &$array ) {
$i = count( $array );
while ( $i-- ) {
if ( $array[$i] === null
* @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 );
* @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 );
return new SearchSuggestionSet( $suggestions );
}
-
/**
* @return SearchSuggestionSet an empty suggestion set
*/
$fallback = 'it';
-
$namespaceNames = [
NS_MEDIA => 'Media',
NS_SPECIAL => 'Speciâl',
'Սպասարկող' => NS_SPECIAL,
];
-
$datePreferences = [
'default',
'mdy',
'ٴۇلگٴى_تالقىلاۋى' => NS_TEMPLATE_TALK,
];
-
$datePreferences = [
'default',
'mdy',
'سانات_تالقىلاۋى' => NS_CATEGORY_TALK,
];
-
$datePreferences = [
'default',
'mdy',
'سانات_تالقىلاۋى' => NS_CATEGORY_TALK,
];
-
$datePreferences = [
'default',
'mdy',
'ការពិភាក្សាអំពីចំនាត់ថ្នាក់ក្រុម' => NS_CATEGORY_TALK,
];
-
$digitTransformTable = [
'0' => '០', # ០
'1' => '១', # ១
$fallback = 'nl';
-
$namespaceNames = [
NS_MEDIA => 'Media',
NS_SPECIAL => 'Speciaal',
'Разговор_за_слика' => NS_FILE_TALK,
];
-
$datePreferences = [
'default',
'dmy mk',
'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',
* @see http://nn.wikipedia.org/w/index.php?title=Brukar:Dittaeva/LanguageNn.php&action=history
*/
-
$datePreferences = [
'default',
'dmyt',
'Withoutinterwiki' => [ 'ÆнæИнтервики' ],
];
-
$magicWords = [
'redirect' => [ '0', '#ÆРВИТÆН', '#ÆРВЫСТ', '#РАРВЫСТ', '#перенаправление', '#перенапр', '#REDIRECT' ],
'notoc' => [ '0', '__ÆНÆСÆР__', '__БЕЗ_ОГЛАВЛЕНИЯ__', '__БЕЗ_ОГЛ__', '__NOTOC__' ],
'pagesincategory_files' => [ '0', 'файлы', 'files' ],
];
-
$dateFormats = [
'mdy time' => 'H:i',
'mdy date' => 'xg j, Y',
'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' ],
'vi normal',
];
-
$linkTrail = "/^([a-zàâçéèêîôûäëïöüùÇÉÂÊÎÔÛÄËÏÖÜÀÈÙ]+)(.*)$/sDu";
$separatorTransformTable = [ ',' => '.', '.' => ',' ];
<?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" />
$this->setMwGlobals( 'wgSpecialPages', [] );
}
- protected function searchProvision( Array $results = null ) {
+ protected function searchProvision( array $results = null ) {
if ( $results === null ) {
$this->setMwGlobals( 'wgHooks', [] );
} else {
* @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 );
* @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 );
* @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 );
$this->search->setNamespaces( [] );
}
- protected function searchProvision( Array $results = null ) {
+ protected function searchProvision( array $results = null ) {
if ( $results === null ) {
$this->setMwGlobals( 'wgHooks', [] );
} else {
* @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 ) {
* @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 ) {
* @dataProvider provideSearchBackend
* @covers PrefixSearch::searchBackend
*/
- public function testSearchBackend( Array $case ) {
+ public function testSearchBackend( array $case ) {
$search = $stub = $this->getMockBuilder( 'SearchEngine' )
->setMethods( [ 'completionSearchBackend' ] )->getMock();