<exclude name="MediaWiki.Usage.SuperGlobalsUsage.SuperGlobals" />
<exclude name="MediaWiki.Files.ClassMatchesFilename.WrongCase" />
<exclude name="MediaWiki.Files.ClassMatchesFilename.NotMatch" />
- <exclude name="MediaWiki.Files.OneClassPerFile.MultipleFound" />
+ <exclude name="Generic.Files.OneObjectStructurePerFile.MultipleFound" />
<exclude name="MediaWiki.VariableAnalysis.ForbiddenGlobalVariables.ForbiddenGlobal$wgTitle" />
<exclude name="MediaWiki.Usage.DeprecatedConstantUsage.NS_IMAGE" />
<exclude name="MediaWiki.Usage.DeprecatedConstantUsage.NS_IMAGE_TALK" />
<exclude name="MediaWiki.Commenting.FunctionComment.SpacingDocStar" />
<exclude name="MediaWiki.Commenting.FunctionComment.SpacingDocTag" />
+ <exclude name="Squiz.Scope.MethodScope.Missing" />
+ <exclude name="Squiz.Scope.MemberVarScope.Missing" />
</rule>
<rule ref="MediaWiki.NamingConventions.PrefixedGlobalFunctions">
<properties>
<?php
// This file is generated by maintenance/generateLocalAutoload.php, do not adjust manually
-// @codingStandardsIgnoreFile
+// phpcs:ignoreFile Generic.Files.LineLength
global $wgAutoloadLocalClasses;
$wgAutoloadLocalClasses = [
'LanguageAr' => __DIR__ . '/languages/classes/LanguageAr.php',
'LanguageAz' => __DIR__ . '/languages/classes/LanguageAz.php',
'LanguageBe_tarask' => __DIR__ . '/languages/classes/LanguageBe_tarask.php',
- 'LanguageBg' => __DIR__ . '/languages/classes/LanguageBg.php',
'LanguageBs' => __DIR__ . '/languages/classes/LanguageBs.php',
'LanguageCode' => __DIR__ . '/languages/LanguageCode.php',
'LanguageConverter' => __DIR__ . '/languages/LanguageConverter.php',
'LanguageCu' => __DIR__ . '/languages/classes/LanguageCu.php',
'LanguageDsb' => __DIR__ . '/languages/classes/LanguageDsb.php',
'LanguageEn' => __DIR__ . '/languages/classes/LanguageEn.php',
- 'LanguageEs' => __DIR__ . '/languages/classes/LanguageEs.php',
- 'LanguageEt' => __DIR__ . '/languages/classes/LanguageEt.php',
'LanguageFi' => __DIR__ . '/languages/classes/LanguageFi.php',
'LanguageGa' => __DIR__ . '/languages/classes/LanguageGa.php',
'LanguageGan' => __DIR__ . '/languages/classes/LanguageGan.php',
'LanguageKm' => __DIR__ . '/languages/classes/LanguageKm.php',
'LanguageKsh' => __DIR__ . '/languages/classes/LanguageKsh.php',
'LanguageKu' => __DIR__ . '/languages/classes/LanguageKu.php',
- 'LanguageKu_ku' => __DIR__ . '/languages/classes/LanguageKu_ku.php',
'LanguageLa' => __DIR__ . '/languages/classes/LanguageLa.php',
'LanguageMl' => __DIR__ . '/languages/classes/LanguageMl.php',
'LanguageMy' => __DIR__ . '/languages/classes/LanguageMy.php',
'LanguageOs' => __DIR__ . '/languages/classes/LanguageOs.php',
- 'LanguagePl' => __DIR__ . '/languages/classes/LanguagePl.php',
'LanguageQqx' => __DIR__ . '/languages/classes/LanguageQqx.php',
- 'LanguageRu' => __DIR__ . '/languages/classes/LanguageRu.php',
'LanguageShi' => __DIR__ . '/languages/classes/LanguageShi.php',
'LanguageSl' => __DIR__ . '/languages/classes/LanguageSl.php',
'LanguageSr' => __DIR__ . '/languages/classes/LanguageSr.php',
'LanguageTg' => __DIR__ . '/languages/classes/LanguageTg.php',
'LanguageTr' => __DIR__ . '/languages/classes/LanguageTr.php',
'LanguageTyv' => __DIR__ . '/languages/classes/LanguageTyv.php',
- 'LanguageUk' => __DIR__ . '/languages/classes/LanguageUk.php',
'LanguageUz' => __DIR__ . '/languages/classes/LanguageUz.php',
'LanguageWa' => __DIR__ . '/languages/classes/LanguageWa.php',
'LanguageYue' => __DIR__ . '/languages/classes/LanguageYue.php',
"jakub-onderka/php-parallel-lint": "0.9.2",
"jetbrains/phpstorm-stubs": "dev-master#1b9906084d6635456fcf3f3a01f0d7d5b99a578a",
"justinrainbow/json-schema": "~5.2",
- "mediawiki/mediawiki-codesniffer": "14.1.0",
+ "mediawiki/mediawiki-codesniffer": "15.0.0",
"monolog/monolog": "~1.22.1",
"nikic/php-parser": "2.1.0",
"nmred/kafka-php": "0.1.5",
$this->version = $version;
}
- // @codingStandardsIgnoreStart
- // PSR2.Methods.MethodDeclaration.Underscore
- // PSR2.Classes.PropertyDeclaration.ScopeMissing
+ // phpcs:ignore PSR2.Methods.MethodDeclaration.Underscore,PSR2.Classes.PropertyDeclaration.ScopeMissing
function _newObject() {
/* Put the caller offset for wfDeprecated as 6, as
* that gives the function that uses this object, since:
wfDeprecated( '$' . $this->global, $this->version, false, 6 );
return parent::_newObject();
}
- // @codingStandardsIgnoreEnd
}
}
-// @codingStandardsIgnoreStart
+// phpcs:ignore Generic.CodeAnalysis.UnconditionalIfStatement.Found
if ( false ) {
// Blobs generated by MediaWiki < 1.5 on PHP 4 were serialized with the
// class name coerced to lowercase. We can improve efficiency by adding
class_alias( 'HistoryBlobCurStub', 'historyblobcurstub' );
class_alias( 'HistoryBlobStub', 'historyblobstub' );
}
-// @codingStandardsIgnoreEnd
<?php
-// @codingStandardsIgnoreFile Generic.Arrays.DisallowLongArraySyntax
-// @codingStandardsIgnoreFile Generic.Files.LineLength
-// @codingStandardsIgnoreFile MediaWiki.Usage.DirUsage.FunctionFound
+// phpcs:ignoreFile Generic.Arrays.DisallowLongArraySyntax,MediaWiki.Usage.DirUsage.FunctionFound
/**
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
. "{$otherInfo['minSupported']}.\n\nCheck if you have a"
. " newer php executable with a different name, such as php5.\n\n";
+ // phpcs:ignore Generic.Files.LineLength
$longHtml = <<<HTML
Please consider <a href="{$phpInfo['upgradeURL']}">upgrading your copy of
{$phpInfo['implementation']}</a>.
See our<a href="https://www.mediawiki.org/wiki/Compatibility#PHP">compatibility page</a>
for details of which versions are compatible with prior versions of {$phpInfo['implementation']}.
HTML;
+ // phpcs:enable
$this->triggerError(
"Supported {$phpInfo['implementation']} versions",
$shortText,
. "https://www.mediawiki.org/wiki/Download_from_Git#Fetch_external_libraries\n"
. "for help on installing the required components.";
+ // phpcs:ignore Generic.Files.LineLength
$longHtml = <<<HTML
MediaWiki now also has some external dependencies that need to be installed via
composer or from a separate git repo. Please see
<a href="https://www.mediawiki.org/wiki/Download_from_Git#Fetch_external_libraries">mediawiki.org</a>
for help on installing the required components.
HTML;
+ // phpcs:enable
$this->triggerError( 'External dependencies', $shortText, $longText, $longHtml );
}
// Note that we allow 1 link higher than the max for things like 56 days but a 60 day link.
sort( $wgRCLinkDays );
- // @codingStandardsIgnoreStart Generic.CodeAnalysis.ForLoopWithTestFunctionCall.NotAllowed
+ // phpcs:ignore Generic.CodeAnalysis.ForLoopWithTestFunctionCall
for ( $i = 0; $i < count( $wgRCLinkDays ); $i++ ) {
- // @codingStandardsIgnoreEnd
if ( $wgRCLinkDays[$i] >= $rcMaxAgeDays ) {
$wgRCLinkDays = array_slice( $wgRCLinkDays, 0, $i + 1, false );
break;
}
protected function getExamplesMessages() {
- // @codingStandardsIgnoreStart Generic.Files.LineLength
+ // phpcs:disable Generic.Files.LineLength
return [
'action=block&user=192.0.2.5&expiry=3%20days&reason=First%20strike&token=123ABC'
=> 'apihelp-block-example-ip-simple',
'action=block&user=Vandal&expiry=never&reason=Vandalism&nocreate=&autoblock=&noemail=&token=123ABC'
=> 'apihelp-block-example-user-complex',
];
- // @codingStandardsIgnoreEnd
+ // phpcs:enable
}
public function getHelpUrls() {
* @deprecated Only for backwards compatibility, do not use
* @ingroup API
*/
-// @codingStandardsIgnoreStart Squiz.Classes.ValidClassName.NotCamelCaps
+// phpcs:ignore Squiz.Classes.ValidClassName.NotCamelCaps
class ApiErrorFormatter_BackCompat extends ApiErrorFormatter {
- // @codingStandardsIgnoreEnd
/**
* @param ApiResult $result Into which data will be added
}
$list->reloadFromMaster();
- // @codingStandardsIgnoreStart Avoid function calls in a FOR loop test part
+ // phpcs:ignore Generic.CodeAnalysis.ForLoopWithTestFunctionCall
for ( $item = $list->reset(); $list->current(); $item = $list->next() ) {
$data['items'][$item->getId()] += $item->getApiData( $this->getResult() );
}
- // @codingStandardsIgnoreEnd
$data['items'] = array_values( $data['items'] );
ApiResult::setIndexedTagName( $data['items'], 'i' );
$itemKey = array_keys( array_slice( $this->cachedChunks, 0, 1 ) );
$itemKey = array_shift( $itemKey );
- if ( !is_integer( $itemKey ) ) {
+ if ( !is_int( $itemKey ) ) {
wfWarn( "Attempted to get item with non-numeric key while " .
"the next item in the queue has a key ($itemKey) in " . __METHOD__ );
} elseif ( is_null( $itemKey ) ) {
static public $allKeys = [
'fallback', 'namespaceNames', 'bookstoreList',
'magicWords', 'messages', 'rtl', 'capitalizeAllNouns', 'digitTransformTable',
- 'separatorTransformTable', 'fallback8bitEncoding', 'linkPrefixExtension',
+ 'separatorTransformTable', 'minimumGroupingDigits',
+ 'fallback8bitEncoding', 'linkPrefixExtension',
'linkTrail', 'linkPrefixCharset', 'namespaceAliases',
'dateFormats', 'datePreferences', 'datePreferenceMigrationMap',
'defaultDateFormat', 'extraUserToggles', 'specialPageAliases',
* @return Status
*/
public function updateChangeTagsOnAll( $tagsToAdd, $tagsToRemove, $params, $reason, $user ) {
- // @codingStandardsIgnoreStart Generic.CodeAnalysis.ForLoopWithTestFunctionCall.NotAllowed
+ // phpcs:ignore Generic.CodeAnalysis.ForLoopWithTestFunctionCall
for ( $this->reset(); $this->current(); $this->next() ) {
- // @codingStandardsIgnoreEnd
$item = $this->current();
$status = ChangeTags::updateTagsWithChecks( $tagsToAdd, $tagsToRemove,
null, null, $item->getId(), $params, $reason, $user );
* @return Status
*/
public function updateChangeTagsOnAll( $tagsToAdd, $tagsToRemove, $params, $reason, $user ) {
- // @codingStandardsIgnoreStart Generic.CodeAnalysis.ForLoopWithTestFunctionCall.NotAllowed
+ // phpcs:ignore Generic.CodeAnalysis.ForLoopWithTestFunctionCall
for ( $this->reset(); $this->current(); $this->next() ) {
- // @codingStandardsIgnoreEnd
$item = $this->current();
$status = ChangeTags::updateTagsWithChecks( $tagsToAdd, $tagsToRemove,
null, $item->getId(), null, $params, $reason, $user );
*/
class TextContentHandler extends ContentHandler {
- // @codingStandardsIgnoreStart T59585
public function __construct( $modelId = CONTENT_MODEL_TEXT, $formats = [ CONTENT_FORMAT_TEXT ] ) {
parent::__construct( $modelId, $formats );
}
- // @codingStandardsIgnoreEnd
/**
* Returns the content's text as-is.
// HHVM: Class undefined: foo
// PHP5: Class 'foo' not found
if ( preg_match( "/Class (undefined: \w+|'\w+' not found)/", $msg ) ) {
- // @codingStandardsIgnoreStart Generic.Files.LineLength.TooLong
+ // phpcs:disable Generic.Files.LineLength
$msg = <<<TXT
{$msg}
Please see <a href="https://www.mediawiki.org/wiki/Download_from_Git#Fetch_external_libraries">mediawiki.org</a> for help on installing the required components.
TXT;
- // @codingStandardsIgnoreEnd
+ // phpcs:enable
}
// We can't just create an exception and log it as it is likely that
public function getTableRow( $value ) {
$msg = $this->formatMsg();
- return
- '<tr><td></td><td class="mw-input">' .
+ return '<tr><td></td><td class="mw-input">' .
'<div class="mw-editTools">' .
$msg->parseAsBlock() .
"</div></td></tr>\n";
global $wgAutoloadClasses;
$wgAutoloadClasses = [];
- // @codingStandardsIgnoreStart
// LocalSettings.php should not call functions, except wfLoadSkin/wfLoadExtensions
// Define the required globals here, to ensure, the functions can do it work correctly.
+ // phpcs:ignore MediaWiki.VariableAnalysis.UnusedGlobalVariables
global $wgExtensionDirectory, $wgStyleDirectory;
- // @codingStandardsIgnoreEnd
MediaWiki\suppressWarnings();
$_lsExists = file_exists( "$IP/LocalSettings.php" );
* @return bool Whether the connection string is valid.
*/
public static function checkConnectStringFormat( $connect_string ) {
- // @@codingStandardsIgnoreStart Long lines with regular expressions.
+ // phpcs:disable Generic.Files.LineLength
// @todo Very long regular expression. Make more readable?
$isValid = preg_match( '/^[[:alpha:]][\w\-]*(?:\.[[:alpha:]][\w\-]*){0,2}$/', $connect_string ); // TNS name
$isValid |= preg_match( '/^(?:\/\/)?[\w\-\.]+(?::[\d]+)?(?:\/(?:[\w\-\.]+(?::(pooled|dedicated|shared))?)?(?:\/[\w\-\.]+)?)?$/', $connect_string ); // EZConnect
- // @@codingStandardsIgnoreEnd
+ // phpcs:enable
return (bool)$isValid;
}
}
// Try to insert the jobs and update $partitionsTry on any failures.
// Retry to insert any remaning jobs again, ignoring the bad partitions.
$jobsLeft = $jobs;
- // @codingStandardsIgnoreStart Generic.CodeAnalysis.ForLoopWithTestFunctionCall.NotAllowed
+ // phpcs:ignore Generic.CodeAnalysis.ForLoopWithTestFunctionCall
for ( $i = $this->maxPartitionsTry; $i > 0 && count( $jobsLeft ); --$i ) {
- // @codingStandardsIgnoreEnd
try {
$partitionRing->getLiveRing();
} catch ( UnexpectedValueException $e ) {
<?php
-// @codingStandardsIgnoreFile File external to MediaWiki. Ignore coding conventions checks.
+// phpcs:ignoreFile -- File external to MediaWiki. Ignore coding conventions checks.
/**
* JavaScript Minifier
*
<?php
-// @codingStandardsIgnoreFile File external to MediaWiki. Ignore coding conventions checks.
+// phpcs:ignoreFile -- File external to MediaWiki. Ignore coding conventions checks.
/**
* JSMinPlus version 1.4
*
public static function factory(
LockManager $manager, array $paths, $type, StatusValue $status, $timeout = 0
) {
- $pathsByType = is_integer( $type ) ? [ $type => $paths ] : $paths;
+ $pathsByType = is_int( $type ) ? [ $type => $paths ] : $paths;
$lockStatus = $manager->lockByType( $pathsByType, $timeout );
$status->merge( $lockStatus );
if ( $lockStatus->isOK() ) {
<?php
-// @codingStandardsIgnoreFile It's an external lib and it isn't. Let's not bother.
+// phpcs:ignoreFile -- It's an external lib and it isn't. Let's not bother.
/**
* Memcached client for PHP.
*
* @return bool
*/
private function isOpen( $index ) {
- if ( !is_integer( $index ) ) {
+ if ( !is_int( $index ) ) {
return false;
}
}
}
- // @codingStandardsIgnoreStart Generic.Files.LineLength
+ // phpcs:disable Generic.Files.LineLength
/**
* Process attributes.
* Simple values can be stored as either a tag or attribute
* @param array $attribs Array attribute=>value
* @throws RuntimeException
*/
- // @codingStandardsIgnoreEnd
+ // phpcs:enable
private function doAttribs( $attribs ) {
// first check for rdf:parseType attribute, as that can change
// how the attributes are interperted.
return;
}
$res = [];
- // @codingStandardsIgnoreStart Long line that cannot be broken
if ( !preg_match(
/* ahh! scary regex... */
+ // phpcs:ignore Generic.Files.LineLength
'/^([0-3]\d{3})(?:-([01]\d)(?:-([0-3]\d)(?:T([0-2]\d):([0-6]\d)(?::([0-6]\d)(?:\.\d+)?)?([-+]\d{2}:\d{2}|Z)?)?)?)?$/D',
$val, $res )
) {
- // @codingStandardsIgnoreEnd
-
$this->logger->info( __METHOD__ . " Expected date but got $val" );
$val = null;
} else {
*
* @ingroup Media
*/
-// @codingStandardsIgnoreStart Squiz.Classes.ValidClassName.NotCamelCaps
+// phpcs:ignore Squiz.Classes.ValidClassName.NotCamelCaps
class BitmapHandler_ClientOnly extends BitmapHandler {
- // @codingStandardsIgnoreEnd
/**
* @param File $image
// The dirmark, however, must not be immediately adjacent
// to the filename, because it can get copied with it.
// See T27277.
- // @codingStandardsIgnoreStart Ignore long line
+ // phpcs:disable Generic.Files.LineLength
$out->addWikiText( <<<EOT
<div class="fullMedia"><span class="dangerousLink">{$medialink}</span> $dirmark<span class="fileInfo">$longDesc</span></div>
<div class="mediaWarning">$warning</div>
EOT
);
- // @codingStandardsIgnoreEnd
+ // phpcs:enable
} else {
$out->addWikiText( <<<EOT
<div class="fullMedia">{$medialink} {$dirmark}<span class="fileInfo">$longDesc</span>
# at least one character of a host name (embeds EXT_LINK_URL_CLASS)
const EXT_LINK_ADDR = '(?:[0-9.]+|\\[(?i:[0-9a-f:.]+)\\]|[^][<>"\\x00-\\x20\\x7F\p{Zs}\x{FFFD}])';
# RegExp to make image URLs (embeds IPv6 part of EXT_LINK_ADDR)
- // @codingStandardsIgnoreStart Generic.Files.LineLength
+ // phpcs:ignore Generic.Files.LineLength
const EXT_IMAGE_REGEX = '/^(http:\/\/|https:\/\/)((?:\\[(?i:[0-9a-f:.]+)\\])?[^][<>"\\x00-\\x20\\x7F\p{Zs}\x{FFFD}]+)
\\/([A-Za-z0-9_.,~%\\-+&;#*?!=()@\\x80-\\xFF]+)\\.((?i)gif|png|jpg|jpeg)$/Sxu';
- // @codingStandardsIgnoreEnd
# Regular expression for a non-newline space
const SPACE_NOT_NL = '(?:\t| |&\#0*160;|&\#[Xx]0*[Aa]0;|\p{Zs})';
$useSubpages = $this->areSubpagesAllowed();
- // @codingStandardsIgnoreStart Squiz.WhiteSpace.SemicolonSpacing.Incorrect
# Loop for each link
for ( ; $line !== false && $line !== null; $a->next(), $line = $a->current() ) {
- // @codingStandardsIgnoreEnd
-
# Check for excessive memory usage
if ( $holders->isBig() ) {
# Too big
$deps = [];
# Loop to fetch the article, with up to 1 redirect
- // @codingStandardsIgnoreStart Generic.CodeAnalysis.ForLoopWithTestFunctionCall.NotAllowed
+ // phpcs:ignore Generic.CodeAnalysis.ForLoopWithTestFunctionCall
for ( $i = 0; $i < 2 && is_object( $title ); $i++ ) {
- // @codingStandardsIgnoreEnd
# Give extensions a chance to select the revision instead
$id = false; # Assume current
Hooks::run( 'BeforeParserFetchTemplateAndtitle',
$anchor = $safeHeadline;
$fallbackAnchor = $fallbackHeadline;
if ( isset( $refers[$arrayKey] ) ) {
- // @codingStandardsIgnoreStart
+ // phpcs:ignore Generic.CodeAnalysis.ForLoopWithTestFunctionCall,Generic.Formatting.DisallowMultipleStatements
for ( $i = 2; isset( $refers["${arrayKey}_$i"] ); ++$i );
- // @codingStandardsIgnoreEnd
$anchor .= "_$i";
$linkAnchor .= "_$i";
$refers["${arrayKey}_$i"] = true;
$refers[$arrayKey] = true;
}
if ( $fallbackHeadline !== false && isset( $refers[$fallbackArrayKey] ) ) {
- // @codingStandardsIgnoreStart
+ // phpcs:ignore Generic.CodeAnalysis.ForLoopWithTestFunctionCall,Generic.Formatting.DisallowMultipleStatements
for ( $i = 2; isset( $refers["${fallbackArrayKey}_$i"] ); ++$i );
- // @codingStandardsIgnoreEnd
$fallbackAnchor .= "_$i";
$refers["${fallbackArrayKey}_$i"] = true;
} else {
/**
* @ingroup Parser
*/
-// @codingStandardsIgnoreStart Squiz.Classes.ValidClassName.NotCamelCaps
+// phpcs:ignore Squiz.Classes.ValidClassName.NotCamelCaps
class Preprocessor_DOM extends Preprocessor {
- // @codingStandardsIgnoreEnd
/**
* @var Parser
* An expansion frame, used as a context to expand the result of preprocessToObj()
* @ingroup Parser
*/
-// @codingStandardsIgnoreStart Squiz.Classes.ValidClassName.NotCamelCaps
+// phpcs:ignore Squiz.Classes.ValidClassName.NotCamelCaps
class PPFrame_DOM implements PPFrame {
- // @codingStandardsIgnoreEnd
/**
* @var Preprocessor
* Expansion frame with template arguments
* @ingroup Parser
*/
-// @codingStandardsIgnoreStart Squiz.Classes.ValidClassName.NotCamelCaps
+// phpcs:ignore Squiz.Classes.ValidClassName.NotCamelCaps
class PPTemplateFrame_DOM extends PPFrame_DOM {
- // @codingStandardsIgnoreEnd
public $numberedArgs, $namedArgs;
* Expansion frame with custom arguments
* @ingroup Parser
*/
-// @codingStandardsIgnoreStart Squiz.Classes.ValidClassName.NotCamelCaps
+// phpcs:ignore Squiz.Classes.ValidClassName.NotCamelCaps
class PPCustomFrame_DOM extends PPFrame_DOM {
- // @codingStandardsIgnoreEnd
public $args;
/**
* @ingroup Parser
*/
-// @codingStandardsIgnoreStart Squiz.Classes.ValidClassName.NotCamelCaps
+// phpcs:ignore Squiz.Classes.ValidClassName.NotCamelCaps
class PPNode_DOM implements PPNode {
- // @codingStandardsIgnoreEnd
/**
* @var DOMElement
*
* @ingroup Parser
*/
-// @codingStandardsIgnoreStart Squiz.Classes.ValidClassName.NotCamelCaps
+// phpcs:ignore Squiz.Classes.ValidClassName.NotCamelCaps
class Preprocessor_Hash extends Preprocessor {
- // @codingStandardsIgnoreEnd
/**
* @var Parser
* Stack class to help Preprocessor::preprocessToObj()
* @ingroup Parser
*/
-// @codingStandardsIgnoreStart Squiz.Classes.ValidClassName.NotCamelCaps
+// phpcs:ignore Squiz.Classes.ValidClassName.NotCamelCaps
class PPDStack_Hash extends PPDStack {
- // @codingStandardsIgnoreEnd
public function __construct() {
$this->elementClass = 'PPDStackElement_Hash';
/**
* @ingroup Parser
*/
-// @codingStandardsIgnoreStart Squiz.Classes.ValidClassName.NotCamelCaps
+// phpcs:ignore Squiz.Classes.ValidClassName.NotCamelCaps
class PPDStackElement_Hash extends PPDStackElement {
- // @codingStandardsIgnoreEnd
public function __construct( $data = [] ) {
$this->partClass = 'PPDPart_Hash';
/**
* @ingroup Parser
*/
-// @codingStandardsIgnoreStart Squiz.Classes.ValidClassName.NotCamelCaps
+// phpcs:ignore Squiz.Classes.ValidClassName.NotCamelCaps
class PPDPart_Hash extends PPDPart {
- // @codingStandardsIgnoreEnd
public function __construct( $out = '' ) {
if ( $out !== '' ) {
* An expansion frame, used as a context to expand the result of preprocessToObj()
* @ingroup Parser
*/
-// @codingStandardsIgnoreStart Squiz.Classes.ValidClassName.NotCamelCaps
+// phpcs:ignore Squiz.Classes.ValidClassName.NotCamelCaps
class PPFrame_Hash implements PPFrame {
- // @codingStandardsIgnoreEnd
/**
* @var Parser
* Expansion frame with template arguments
* @ingroup Parser
*/
-// @codingStandardsIgnoreStart Squiz.Classes.ValidClassName.NotCamelCaps
+// phpcs:ignore Squiz.Classes.ValidClassName.NotCamelCaps
class PPTemplateFrame_Hash extends PPFrame_Hash {
- // @codingStandardsIgnoreEnd
public $numberedArgs, $namedArgs, $parent;
public $numberedExpansionCache, $namedExpansionCache;
* Expansion frame with custom arguments
* @ingroup Parser
*/
-// @codingStandardsIgnoreStart Squiz.Classes.ValidClassName.NotCamelCaps
+// phpcs:ignore Squiz.Classes.ValidClassName.NotCamelCaps
class PPCustomFrame_Hash extends PPFrame_Hash {
- // @codingStandardsIgnoreEnd
public $args;
/**
* @ingroup Parser
*/
-// @codingStandardsIgnoreStart Squiz.Classes.ValidClassName.NotCamelCaps
+// phpcs:ignore Squiz.Classes.ValidClassName.NotCamelCaps
class PPNode_Hash_Tree implements PPNode {
- // @codingStandardsIgnoreEnd
public $name;
/**
* @ingroup Parser
*/
-// @codingStandardsIgnoreStart Squiz.Classes.ValidClassName.NotCamelCaps
+// phpcs:ignore Squiz.Classes.ValidClassName.NotCamelCaps
class PPNode_Hash_Text implements PPNode {
- // @codingStandardsIgnoreEnd
public $value;
private $store, $index;
/**
* @ingroup Parser
*/
-// @codingStandardsIgnoreStart Squiz.Classes.ValidClassName.NotCamelCaps
+// phpcs:ignore Squiz.Classes.ValidClassName.NotCamelCaps
class PPNode_Hash_Array implements PPNode {
- // @codingStandardsIgnoreEnd
public $value;
/**
* @ingroup Parser
*/
-// @codingStandardsIgnoreStart Squiz.Classes.ValidClassName.NotCamelCaps
+// phpcs:ignore Squiz.Classes.ValidClassName.NotCamelCaps
class PPNode_Hash_Attr implements PPNode {
- // @codingStandardsIgnoreEnd
public $name, $value;
private $store, $index;
}
}
-// @codingStandardsIgnoreStart Squiz.Classes.ValidClassName.NotCamelCaps
+// phpcs:ignore Squiz.Classes.ValidClassName.NotCamelCaps
class PoolCounter_Stub extends PoolCounter {
- // @codingStandardsIgnoreEnd
public function __construct() {
/* No parameters needed */
}
$conn = $status->value;
- // @codingStandardsIgnoreStart Generic.Files.LineLength
+ // phpcs:disable Generic.Files.LineLength
static $script =
/** @lang Lua */
<<<LUA
end
return 1
LUA;
- // @codingStandardsIgnoreEnd
+ // phpcs:enable
try {
$conn->luaEval( $script,
// TODO replace with clear_last_error when requirements are bumped to PHP7
set_error_handler( function () {
}, 0 );
- // @codingStandardsIgnoreStart Generic.PHP.NoSilencedErrors.Discouraged
+ // phpcs:ignore Generic.PHP.NoSilencedErrors.Discouraged
@trigger_error( '' );
- // @codingStandardsIgnoreEnd
restore_error_handler();
- // @codingStandardsIgnoreStart Generic.PHP.NoSilencedErrors.Discouraged
+ // phpcs:ignore Generic.PHP.NoSilencedErrors.Discouraged
$numReadyPipes = @stream_select( $readyPipes, $emptyArray, $emptyArray, $timeout );
- // @codingStandardsIgnoreEnd
if ( $numReadyPipes === false ) {
$error = error_get_last();
if ( strncmp( $error['message'], $eintrMessage, strlen( $eintrMessage ) ) == 0 ) {
// Filter out skins that aren't installed
$possibleSkins = array_filter( $possibleSkins, function ( $skinDir ) use ( $styleDirectory ) {
- return
- is_file( "$styleDirectory/$skinDir/skin.json" )
+ return is_file( "$styleDirectory/$skinDir/skin.json" )
|| is_file( "$styleDirectory/$skinDir/$skinDir.php" );
} );
# $res might contain the whole 1,000 rows, so we read up to
# $num [should update this to use a Pager]
- // @codingStandardsIgnoreStart Generic.CodeAnalysis.ForLoopWithTestFunctionCall.NotAllowed
+ // phpcs:ignore Generic.CodeAnalysis.ForLoopWithTestFunctionCall
for ( $i = 0; $i < $num && $row = $res->fetchObject(); $i++ ) {
- // @codingStandardsIgnoreEnd
$line = $this->formatResult( $skin, $row );
if ( $line ) {
$html[] = $this->listoutput
$numRevisions = 0;
// Live revisions...
$list = $this->getList();
- // @codingStandardsIgnoreStart Generic.CodeAnalysis.ForLoopWithTestFunctionCall.NotAllowed
+ // phpcs:ignore Generic.CodeAnalysis.ForLoopWithTestFunctionCall
for ( $list->reset(); $list->current(); $list->next() ) {
- // @codingStandardsIgnoreEnd
$item = $list->current();
$numRevisions++;
$out->addHTML( $item->getHTML() );
// Otherwise, use a multi-select field for adding tags, and a list of
// checkboxes for removing them
- // @codingStandardsIgnoreStart Generic.CodeAnalysis.ForLoopWithTestFunctionCall.NotAllowed
+ // phpcs:ignore Generic.CodeAnalysis.ForLoopWithTestFunctionCall
for ( $list->reset(); $list->current(); $list->next() ) {
- // @codingStandardsIgnoreEnd
$currentTags = $list->current()->getTags();
if ( $currentTags ) {
$tags = array_merge( $tags, explode( ',', $currentTags ) );
* @return array
*/
private function getPageLinks( $inputPages, $pageSet, $depth ) {
- // @codingStandardsIgnoreStart Squiz.WhiteSpace.SemicolonSpacing.Incorrect
for ( ; $depth > 0; --$depth ) {
- // @codingStandardsIgnoreEnd
$pageSet = $this->getLinks(
$inputPages, $pageSet, 'pagelinks',
[ 'namespace' => 'pl_namespace', 'title' => 'pl_title' ],
private $watchlistFilterGroupDefinition;
- // @codingStandardsIgnoreStart Needed "useless" override to change parameters.
public function __construct( $name = 'Recentchanges', $restriction = '' ) {
parent::__construct( $name, $restriction );
}
];
}
- // @codingStandardsIgnoreEnd
/**
* Main execution point
$numRevisions = 0;
// Live revisions...
$list = $this->getList();
- // @codingStandardsIgnoreStart Generic.CodeAnalysis.ForLoopWithTestFunctionCall.NotAllowed
+ // phpcs:ignore Generic.CodeAnalysis.ForLoopWithTestFunctionCall
for ( $list->reset(); $list->current(); $list->next() ) {
- // @codingStandardsIgnoreEnd
$item = $list->current();
if ( !$item->canView() ) {
}
}
- // @codingStandardsIgnoreStart Squiz.WhiteSpace.SemicolonSpacing.Incorrect
for ( ; $i < $limit && $topRes1; $i++ ) {
- // @codingStandardsIgnoreEnd
$resultArray[] = $topRes1;
$topRes1 = $res1->next();
}
- // @codingStandardsIgnoreStart Squiz.WhiteSpace.SemicolonSpacing.Incorrect
for ( ; $i < $limit && $topRes2; $i++ ) {
- // @codingStandardsIgnoreEnd
$resultArray[] = $topRes2;
$topRes2 = $res2->next();
}
# image/svg, text/xml, application/xml, and text/html, which can contain scripts
if ( $stripped == 'href' && strncasecmp( 'data:', $value, 5 ) === 0 ) {
// rfc2397 parameters. This is only slightly slower than (;[\w;]+)*.
- // @codingStandardsIgnoreStart Generic.Files.LineLength
+ // phpcs:ignore Generic.Files.LineLength
$parameters = '(?>;[a-zA-Z0-9\!#$&\'*+.^_`{|}~-]+=(?>[a-zA-Z0-9\!#$&\'*+.^_`{|}~-]+|"(?>[\0-\x0c\x0e-\x21\x23-\x5b\x5d-\x7f]+|\\\\[\0-\x7f])*"))*(?:;base64)?';
- // @codingStandardsIgnoreEnd
if ( !preg_match( "!^data:\s*image/(gif|jpeg|jpg|png)$parameters,!i", $value ) ) {
wfDebug( __METHOD__ . ": Found href to unwhitelisted data: uri "
}
$output = implode( "\n\t", $content );
- return
- <<<EOD
+ return <<<EOD
<?php
// This file is generated by $commandName, do not adjust manually
-// @codingStandardsIgnoreFile
+// phpcs:ignoreFile Generic.Files.LineLength
global \${$this->variableName};
\${$this->variableName} {$op} [
* @return string HTML
*/
protected function header( Message $msg ) {
- return
- "<h2>" .
- "<span class='mw-headline'>" . $msg->escaped() . "</span>" .
- "</h2>";
+ return "<h2>" .
+ "<span class='mw-headline'>" . $msg->escaped() . "</span>" .
+ "</h2>";
}
/**
);
}
- return
- "<div class='search-types'>" .
- "<ul>" . implode( '', $items ) . "</ul>" .
- "</div>";
+ return "<div class='search-types'>" .
+ "<ul>" . implode( '', $items ) . "</ul>" .
+ "</div>";
}
/**
);
}
- return
- "<fieldset id='mw-searchoptions'>" .
- "<legend>" . $this->specialSearch->msg( 'powersearch-legend' )->escaped() . '</legend>' .
- "<h4>" . $this->specialSearch->msg( 'powersearch-ns' )->parse() . '</h4>' .
- // populated by js if available
- "<div id='mw-search-togglebox'></div>" .
- $divider .
- implode(
- $divider,
- $showSections
- ) .
- $hidden .
- $remember .
- "</fieldset>";
+ return "<fieldset id='mw-searchoptions'>" .
+ "<legend>" . $this->specialSearch->msg( 'powersearch-legend' )->escaped() . '</legend>' .
+ "<h4>" . $this->specialSearch->msg( 'powersearch-ns' )->parse() . '</h4>' .
+ // populated by js if available
+ "<div id='mw-search-togglebox'></div>" .
+ $divider .
+ implode(
+ $divider,
+ $showSections
+ ) .
+ $hidden .
+ $remember .
+ "</fieldset>";
}
}
$out .= "</ul>";
}
- return
- "<div id='mw-search-interwiki'>" .
- "<div id='mw-search-interwiki-caption'>" .
- $this->specialSearch->msg( 'search-interwiki-caption' )->parse() .
- '</div>' .
- $out .
- "</div>";
+ return "<div id='mw-search-interwiki'>" .
+ "<div id='mw-search-interwiki-caption'>" .
+ $this->specialSearch->msg( 'search-interwiki-caption' )->parse() .
+ '</div>' .
+ $out .
+ "</div>";
}
/**
$this->specialSearch->msg( 'search-interwiki-more' )->escaped()
);
- return
- "<div class='mw-search-interwiki-project'>" .
- "<span class='mw-search-interwiki-more'>{$searchLink}</span>" .
- $caption .
+ return "<div class='mw-search-interwiki-project'>" .
+ "<span class='mw-search-interwiki-more'>{$searchLink}</span>" .
+ $caption .
"</div>";
}
// Bail on old versions of PHP, or if composer has not been run yet to install
// dependencies. Using dirname( __FILE__ ) here because __DIR__ is PHP5.3+.
-// @codingStandardsIgnoreStart MediaWiki.Usage.DirUsage.FunctionFound
+// phpcs:ignore MediaWiki.Usage.DirUsage.FunctionFound
require_once dirname( __FILE__ ) . '/includes/PHPVersionCheck.php';
-// @codingStandardsIgnoreEnd
wfEntryPointCheck( 'index.php' );
require __DIR__ . '/includes/WebStart.php';
* Generated by UnicodeJS (see tools/strongDir) from the UCD; see
* https://phabricator.wikimedia.org/diffusion/GUJS/ .
*/
- // @codingStandardsIgnoreStart
// @codeCoverageIgnoreStart
+ // phpcs:ignore Generic.Files.LineLength
static private $strongDirRegex = '/(?:([\x{41}-\x{5a}\x{61}-\x{7a}\x{aa}\x{b5}\x{ba}\x{c0}-\x{d6}\x{d8}-\x{f6}\x{f8}-\x{2b8}\x{2bb}-\x{2c1}\x{2d0}\x{2d1}\x{2e0}-\x{2e4}\x{2ee}\x{370}-\x{373}\x{376}\x{377}\x{37a}-\x{37d}\x{37f}\x{386}\x{388}-\x{38a}\x{38c}\x{38e}-\x{3a1}\x{3a3}-\x{3f5}\x{3f7}-\x{482}\x{48a}-\x{52f}\x{531}-\x{556}\x{559}-\x{55f}\x{561}-\x{587}\x{589}\x{903}-\x{939}\x{93b}\x{93d}-\x{940}\x{949}-\x{94c}\x{94e}-\x{950}\x{958}-\x{961}\x{964}-\x{980}\x{982}\x{983}\x{985}-\x{98c}\x{98f}\x{990}\x{993}-\x{9a8}\x{9aa}-\x{9b0}\x{9b2}\x{9b6}-\x{9b9}\x{9bd}-\x{9c0}\x{9c7}\x{9c8}\x{9cb}\x{9cc}\x{9ce}\x{9d7}\x{9dc}\x{9dd}\x{9df}-\x{9e1}\x{9e6}-\x{9f1}\x{9f4}-\x{9fa}\x{a03}\x{a05}-\x{a0a}\x{a0f}\x{a10}\x{a13}-\x{a28}\x{a2a}-\x{a30}\x{a32}\x{a33}\x{a35}\x{a36}\x{a38}\x{a39}\x{a3e}-\x{a40}\x{a59}-\x{a5c}\x{a5e}\x{a66}-\x{a6f}\x{a72}-\x{a74}\x{a83}\x{a85}-\x{a8d}\x{a8f}-\x{a91}\x{a93}-\x{aa8}\x{aaa}-\x{ab0}\x{ab2}\x{ab3}\x{ab5}-\x{ab9}\x{abd}-\x{ac0}\x{ac9}\x{acb}\x{acc}\x{ad0}\x{ae0}\x{ae1}\x{ae6}-\x{af0}\x{af9}\x{b02}\x{b03}\x{b05}-\x{b0c}\x{b0f}\x{b10}\x{b13}-\x{b28}\x{b2a}-\x{b30}\x{b32}\x{b33}\x{b35}-\x{b39}\x{b3d}\x{b3e}\x{b40}\x{b47}\x{b48}\x{b4b}\x{b4c}\x{b57}\x{b5c}\x{b5d}\x{b5f}-\x{b61}\x{b66}-\x{b77}\x{b83}\x{b85}-\x{b8a}\x{b8e}-\x{b90}\x{b92}-\x{b95}\x{b99}\x{b9a}\x{b9c}\x{b9e}\x{b9f}\x{ba3}\x{ba4}\x{ba8}-\x{baa}\x{bae}-\x{bb9}\x{bbe}\x{bbf}\x{bc1}\x{bc2}\x{bc6}-\x{bc8}\x{bca}-\x{bcc}\x{bd0}\x{bd7}\x{be6}-\x{bf2}\x{c01}-\x{c03}\x{c05}-\x{c0c}\x{c0e}-\x{c10}\x{c12}-\x{c28}\x{c2a}-\x{c39}\x{c3d}\x{c41}-\x{c44}\x{c58}-\x{c5a}\x{c60}\x{c61}\x{c66}-\x{c6f}\x{c7f}\x{c82}\x{c83}\x{c85}-\x{c8c}\x{c8e}-\x{c90}\x{c92}-\x{ca8}\x{caa}-\x{cb3}\x{cb5}-\x{cb9}\x{cbd}-\x{cc4}\x{cc6}-\x{cc8}\x{cca}\x{ccb}\x{cd5}\x{cd6}\x{cde}\x{ce0}\x{ce1}\x{ce6}-\x{cef}\x{cf1}\x{cf2}\x{d02}\x{d03}\x{d05}-\x{d0c}\x{d0e}-\x{d10}\x{d12}-\x{d3a}\x{d3d}-\x{d40}\x{d46}-\x{d48}\x{d4a}-\x{d4c}\x{d4e}\x{d57}\x{d5f}-\x{d61}\x{d66}-\x{d75}\x{d79}-\x{d7f}\x{d82}\x{d83}\x{d85}-\x{d96}\x{d9a}-\x{db1}\x{db3}-\x{dbb}\x{dbd}\x{dc0}-\x{dc6}\x{dcf}-\x{dd1}\x{dd8}-\x{ddf}\x{de6}-\x{def}\x{df2}-\x{df4}\x{e01}-\x{e30}\x{e32}\x{e33}\x{e40}-\x{e46}\x{e4f}-\x{e5b}\x{e81}\x{e82}\x{e84}\x{e87}\x{e88}\x{e8a}\x{e8d}\x{e94}-\x{e97}\x{e99}-\x{e9f}\x{ea1}-\x{ea3}\x{ea5}\x{ea7}\x{eaa}\x{eab}\x{ead}-\x{eb0}\x{eb2}\x{eb3}\x{ebd}\x{ec0}-\x{ec4}\x{ec6}\x{ed0}-\x{ed9}\x{edc}-\x{edf}\x{f00}-\x{f17}\x{f1a}-\x{f34}\x{f36}\x{f38}\x{f3e}-\x{f47}\x{f49}-\x{f6c}\x{f7f}\x{f85}\x{f88}-\x{f8c}\x{fbe}-\x{fc5}\x{fc7}-\x{fcc}\x{fce}-\x{fda}\x{1000}-\x{102c}\x{1031}\x{1038}\x{103b}\x{103c}\x{103f}-\x{1057}\x{105a}-\x{105d}\x{1061}-\x{1070}\x{1075}-\x{1081}\x{1083}\x{1084}\x{1087}-\x{108c}\x{108e}-\x{109c}\x{109e}-\x{10c5}\x{10c7}\x{10cd}\x{10d0}-\x{1248}\x{124a}-\x{124d}\x{1250}-\x{1256}\x{1258}\x{125a}-\x{125d}\x{1260}-\x{1288}\x{128a}-\x{128d}\x{1290}-\x{12b0}\x{12b2}-\x{12b5}\x{12b8}-\x{12be}\x{12c0}\x{12c2}-\x{12c5}\x{12c8}-\x{12d6}\x{12d8}-\x{1310}\x{1312}-\x{1315}\x{1318}-\x{135a}\x{1360}-\x{137c}\x{1380}-\x{138f}\x{13a0}-\x{13f5}\x{13f8}-\x{13fd}\x{1401}-\x{167f}\x{1681}-\x{169a}\x{16a0}-\x{16f8}\x{1700}-\x{170c}\x{170e}-\x{1711}\x{1720}-\x{1731}\x{1735}\x{1736}\x{1740}-\x{1751}\x{1760}-\x{176c}\x{176e}-\x{1770}\x{1780}-\x{17b3}\x{17b6}\x{17be}-\x{17c5}\x{17c7}\x{17c8}\x{17d4}-\x{17da}\x{17dc}\x{17e0}-\x{17e9}\x{1810}-\x{1819}\x{1820}-\x{1877}\x{1880}-\x{18a8}\x{18aa}\x{18b0}-\x{18f5}\x{1900}-\x{191e}\x{1923}-\x{1926}\x{1929}-\x{192b}\x{1930}\x{1931}\x{1933}-\x{1938}\x{1946}-\x{196d}\x{1970}-\x{1974}\x{1980}-\x{19ab}\x{19b0}-\x{19c9}\x{19d0}-\x{19da}\x{1a00}-\x{1a16}\x{1a19}\x{1a1a}\x{1a1e}-\x{1a55}\x{1a57}\x{1a61}\x{1a63}\x{1a64}\x{1a6d}-\x{1a72}\x{1a80}-\x{1a89}\x{1a90}-\x{1a99}\x{1aa0}-\x{1aad}\x{1b04}-\x{1b33}\x{1b35}\x{1b3b}\x{1b3d}-\x{1b41}\x{1b43}-\x{1b4b}\x{1b50}-\x{1b6a}\x{1b74}-\x{1b7c}\x{1b82}-\x{1ba1}\x{1ba6}\x{1ba7}\x{1baa}\x{1bae}-\x{1be5}\x{1be7}\x{1bea}-\x{1bec}\x{1bee}\x{1bf2}\x{1bf3}\x{1bfc}-\x{1c2b}\x{1c34}\x{1c35}\x{1c3b}-\x{1c49}\x{1c4d}-\x{1c7f}\x{1cc0}-\x{1cc7}\x{1cd3}\x{1ce1}\x{1ce9}-\x{1cec}\x{1cee}-\x{1cf3}\x{1cf5}\x{1cf6}\x{1d00}-\x{1dbf}\x{1e00}-\x{1f15}\x{1f18}-\x{1f1d}\x{1f20}-\x{1f45}\x{1f48}-\x{1f4d}\x{1f50}-\x{1f57}\x{1f59}\x{1f5b}\x{1f5d}\x{1f5f}-\x{1f7d}\x{1f80}-\x{1fb4}\x{1fb6}-\x{1fbc}\x{1fbe}\x{1fc2}-\x{1fc4}\x{1fc6}-\x{1fcc}\x{1fd0}-\x{1fd3}\x{1fd6}-\x{1fdb}\x{1fe0}-\x{1fec}\x{1ff2}-\x{1ff4}\x{1ff6}-\x{1ffc}\x{200e}\x{2071}\x{207f}\x{2090}-\x{209c}\x{2102}\x{2107}\x{210a}-\x{2113}\x{2115}\x{2119}-\x{211d}\x{2124}\x{2126}\x{2128}\x{212a}-\x{212d}\x{212f}-\x{2139}\x{213c}-\x{213f}\x{2145}-\x{2149}\x{214e}\x{214f}\x{2160}-\x{2188}\x{2336}-\x{237a}\x{2395}\x{249c}-\x{24e9}\x{26ac}\x{2800}-\x{28ff}\x{2c00}-\x{2c2e}\x{2c30}-\x{2c5e}\x{2c60}-\x{2ce4}\x{2ceb}-\x{2cee}\x{2cf2}\x{2cf3}\x{2d00}-\x{2d25}\x{2d27}\x{2d2d}\x{2d30}-\x{2d67}\x{2d6f}\x{2d70}\x{2d80}-\x{2d96}\x{2da0}-\x{2da6}\x{2da8}-\x{2dae}\x{2db0}-\x{2db6}\x{2db8}-\x{2dbe}\x{2dc0}-\x{2dc6}\x{2dc8}-\x{2dce}\x{2dd0}-\x{2dd6}\x{2dd8}-\x{2dde}\x{3005}-\x{3007}\x{3021}-\x{3029}\x{302e}\x{302f}\x{3031}-\x{3035}\x{3038}-\x{303c}\x{3041}-\x{3096}\x{309d}-\x{309f}\x{30a1}-\x{30fa}\x{30fc}-\x{30ff}\x{3105}-\x{312d}\x{3131}-\x{318e}\x{3190}-\x{31ba}\x{31f0}-\x{321c}\x{3220}-\x{324f}\x{3260}-\x{327b}\x{327f}-\x{32b0}\x{32c0}-\x{32cb}\x{32d0}-\x{32fe}\x{3300}-\x{3376}\x{337b}-\x{33dd}\x{33e0}-\x{33fe}\x{3400}-\x{4db5}\x{4e00}-\x{9fd5}\x{a000}-\x{a48c}\x{a4d0}-\x{a60c}\x{a610}-\x{a62b}\x{a640}-\x{a66e}\x{a680}-\x{a69d}\x{a6a0}-\x{a6ef}\x{a6f2}-\x{a6f7}\x{a722}-\x{a787}\x{a789}-\x{a7ad}\x{a7b0}-\x{a7b7}\x{a7f7}-\x{a801}\x{a803}-\x{a805}\x{a807}-\x{a80a}\x{a80c}-\x{a824}\x{a827}\x{a830}-\x{a837}\x{a840}-\x{a873}\x{a880}-\x{a8c3}\x{a8ce}-\x{a8d9}\x{a8f2}-\x{a8fd}\x{a900}-\x{a925}\x{a92e}-\x{a946}\x{a952}\x{a953}\x{a95f}-\x{a97c}\x{a983}-\x{a9b2}\x{a9b4}\x{a9b5}\x{a9ba}\x{a9bb}\x{a9bd}-\x{a9cd}\x{a9cf}-\x{a9d9}\x{a9de}-\x{a9e4}\x{a9e6}-\x{a9fe}\x{aa00}-\x{aa28}\x{aa2f}\x{aa30}\x{aa33}\x{aa34}\x{aa40}-\x{aa42}\x{aa44}-\x{aa4b}\x{aa4d}\x{aa50}-\x{aa59}\x{aa5c}-\x{aa7b}\x{aa7d}-\x{aaaf}\x{aab1}\x{aab5}\x{aab6}\x{aab9}-\x{aabd}\x{aac0}\x{aac2}\x{aadb}-\x{aaeb}\x{aaee}-\x{aaf5}\x{ab01}-\x{ab06}\x{ab09}-\x{ab0e}\x{ab11}-\x{ab16}\x{ab20}-\x{ab26}\x{ab28}-\x{ab2e}\x{ab30}-\x{ab65}\x{ab70}-\x{abe4}\x{abe6}\x{abe7}\x{abe9}-\x{abec}\x{abf0}-\x{abf9}\x{ac00}-\x{d7a3}\x{d7b0}-\x{d7c6}\x{d7cb}-\x{d7fb}\x{e000}-\x{fa6d}\x{fa70}-\x{fad9}\x{fb00}-\x{fb06}\x{fb13}-\x{fb17}\x{ff21}-\x{ff3a}\x{ff41}-\x{ff5a}\x{ff66}-\x{ffbe}\x{ffc2}-\x{ffc7}\x{ffca}-\x{ffcf}\x{ffd2}-\x{ffd7}\x{ffda}-\x{ffdc}\x{10000}-\x{1000b}\x{1000d}-\x{10026}\x{10028}-\x{1003a}\x{1003c}\x{1003d}\x{1003f}-\x{1004d}\x{10050}-\x{1005d}\x{10080}-\x{100fa}\x{10100}\x{10102}\x{10107}-\x{10133}\x{10137}-\x{1013f}\x{101d0}-\x{101fc}\x{10280}-\x{1029c}\x{102a0}-\x{102d0}\x{10300}-\x{10323}\x{10330}-\x{1034a}\x{10350}-\x{10375}\x{10380}-\x{1039d}\x{1039f}-\x{103c3}\x{103c8}-\x{103d5}\x{10400}-\x{1049d}\x{104a0}-\x{104a9}\x{10500}-\x{10527}\x{10530}-\x{10563}\x{1056f}\x{10600}-\x{10736}\x{10740}-\x{10755}\x{10760}-\x{10767}\x{11000}\x{11002}-\x{11037}\x{11047}-\x{1104d}\x{11066}-\x{1106f}\x{11082}-\x{110b2}\x{110b7}\x{110b8}\x{110bb}-\x{110c1}\x{110d0}-\x{110e8}\x{110f0}-\x{110f9}\x{11103}-\x{11126}\x{1112c}\x{11136}-\x{11143}\x{11150}-\x{11172}\x{11174}-\x{11176}\x{11182}-\x{111b5}\x{111bf}-\x{111c9}\x{111cd}\x{111d0}-\x{111df}\x{111e1}-\x{111f4}\x{11200}-\x{11211}\x{11213}-\x{1122e}\x{11232}\x{11233}\x{11235}\x{11238}-\x{1123d}\x{11280}-\x{11286}\x{11288}\x{1128a}-\x{1128d}\x{1128f}-\x{1129d}\x{1129f}-\x{112a9}\x{112b0}-\x{112de}\x{112e0}-\x{112e2}\x{112f0}-\x{112f9}\x{11302}\x{11303}\x{11305}-\x{1130c}\x{1130f}\x{11310}\x{11313}-\x{11328}\x{1132a}-\x{11330}\x{11332}\x{11333}\x{11335}-\x{11339}\x{1133d}-\x{1133f}\x{11341}-\x{11344}\x{11347}\x{11348}\x{1134b}-\x{1134d}\x{11350}\x{11357}\x{1135d}-\x{11363}\x{11480}-\x{114b2}\x{114b9}\x{114bb}-\x{114be}\x{114c1}\x{114c4}-\x{114c7}\x{114d0}-\x{114d9}\x{11580}-\x{115b1}\x{115b8}-\x{115bb}\x{115be}\x{115c1}-\x{115db}\x{11600}-\x{11632}\x{1163b}\x{1163c}\x{1163e}\x{11641}-\x{11644}\x{11650}-\x{11659}\x{11680}-\x{116aa}\x{116ac}\x{116ae}\x{116af}\x{116b6}\x{116c0}-\x{116c9}\x{11700}-\x{11719}\x{11720}\x{11721}\x{11726}\x{11730}-\x{1173f}\x{118a0}-\x{118f2}\x{118ff}\x{11ac0}-\x{11af8}\x{12000}-\x{12399}\x{12400}-\x{1246e}\x{12470}-\x{12474}\x{12480}-\x{12543}\x{13000}-\x{1342e}\x{14400}-\x{14646}\x{16800}-\x{16a38}\x{16a40}-\x{16a5e}\x{16a60}-\x{16a69}\x{16a6e}\x{16a6f}\x{16ad0}-\x{16aed}\x{16af5}\x{16b00}-\x{16b2f}\x{16b37}-\x{16b45}\x{16b50}-\x{16b59}\x{16b5b}-\x{16b61}\x{16b63}-\x{16b77}\x{16b7d}-\x{16b8f}\x{16f00}-\x{16f44}\x{16f50}-\x{16f7e}\x{16f93}-\x{16f9f}\x{1b000}\x{1b001}\x{1bc00}-\x{1bc6a}\x{1bc70}-\x{1bc7c}\x{1bc80}-\x{1bc88}\x{1bc90}-\x{1bc99}\x{1bc9c}\x{1bc9f}\x{1d000}-\x{1d0f5}\x{1d100}-\x{1d126}\x{1d129}-\x{1d166}\x{1d16a}-\x{1d172}\x{1d183}\x{1d184}\x{1d18c}-\x{1d1a9}\x{1d1ae}-\x{1d1e8}\x{1d360}-\x{1d371}\x{1d400}-\x{1d454}\x{1d456}-\x{1d49c}\x{1d49e}\x{1d49f}\x{1d4a2}\x{1d4a5}\x{1d4a6}\x{1d4a9}-\x{1d4ac}\x{1d4ae}-\x{1d4b9}\x{1d4bb}\x{1d4bd}-\x{1d4c3}\x{1d4c5}-\x{1d505}\x{1d507}-\x{1d50a}\x{1d50d}-\x{1d514}\x{1d516}-\x{1d51c}\x{1d51e}-\x{1d539}\x{1d53b}-\x{1d53e}\x{1d540}-\x{1d544}\x{1d546}\x{1d54a}-\x{1d550}\x{1d552}-\x{1d6a5}\x{1d6a8}-\x{1d6da}\x{1d6dc}-\x{1d714}\x{1d716}-\x{1d74e}\x{1d750}-\x{1d788}\x{1d78a}-\x{1d7c2}\x{1d7c4}-\x{1d7cb}\x{1d800}-\x{1d9ff}\x{1da37}-\x{1da3a}\x{1da6d}-\x{1da74}\x{1da76}-\x{1da83}\x{1da85}-\x{1da8b}\x{1f110}-\x{1f12e}\x{1f130}-\x{1f169}\x{1f170}-\x{1f19a}\x{1f1e6}-\x{1f202}\x{1f210}-\x{1f23a}\x{1f240}-\x{1f248}\x{1f250}\x{1f251}\x{20000}-\x{2a6d6}\x{2a700}-\x{2b734}\x{2b740}-\x{2b81d}\x{2b820}-\x{2cea1}\x{2f800}-\x{2fa1d}\x{f0000}-\x{ffffd}\x{100000}-\x{10fffd}])|([\x{590}\x{5be}\x{5c0}\x{5c3}\x{5c6}\x{5c8}-\x{5ff}\x{7c0}-\x{7ea}\x{7f4}\x{7f5}\x{7fa}-\x{815}\x{81a}\x{824}\x{828}\x{82e}-\x{858}\x{85c}-\x{89f}\x{200f}\x{fb1d}\x{fb1f}-\x{fb28}\x{fb2a}-\x{fb4f}\x{10800}-\x{1091e}\x{10920}-\x{10a00}\x{10a04}\x{10a07}-\x{10a0b}\x{10a10}-\x{10a37}\x{10a3b}-\x{10a3e}\x{10a40}-\x{10ae4}\x{10ae7}-\x{10b38}\x{10b40}-\x{10e5f}\x{10e7f}-\x{10fff}\x{1e800}-\x{1e8cf}\x{1e8d7}-\x{1edff}\x{1ef00}-\x{1efff}\x{608}\x{60b}\x{60d}\x{61b}-\x{64a}\x{66d}-\x{66f}\x{671}-\x{6d5}\x{6e5}\x{6e6}\x{6ee}\x{6ef}\x{6fa}-\x{710}\x{712}-\x{72f}\x{74b}-\x{7a5}\x{7b1}-\x{7bf}\x{8a0}-\x{8e2}\x{fb50}-\x{fd3d}\x{fd40}-\x{fdcf}\x{fdf0}-\x{fdfc}\x{fdfe}\x{fdff}\x{fe70}-\x{fefe}\x{1ee00}-\x{1eeef}\x{1eef2}-\x{1eeff}]))/u';
// @codeCoverageIgnoreEnd
- // @codingStandardsIgnoreEnd
/**
* Get a cached or new language object for a given language code
*/
function commafy( $number ) {
$digitGroupingPattern = $this->digitGroupingPattern();
+ $minimumGroupingDigits = $this->minimumGroupingDigits();
if ( $number === null ) {
return '';
}
if ( !$digitGroupingPattern || $digitGroupingPattern === "###,###,###" ) {
- // default grouping is at thousands, use the same for ###,###,### pattern too.
+ // Default grouping is at thousands, use the same for ###,###,### pattern too.
+ // In some languages it's conventional not to insert a thousands separator
+ // in numbers that are four digits long (1000-9999).
+ if ( $minimumGroupingDigits ) {
+ // Number of '#' characters after last comma in the grouping pattern.
+ // The pattern is hardcoded here, but this would vary for different patterns.
+ $primaryGroupingSize = 3;
+ // Maximum length of a number to suppress digit grouping for.
+ $maximumLength = $minimumGroupingDigits + $primaryGroupingSize - 1;
+ if ( preg_match( '/^\-?\d{1,' . $maximumLength . '}(\.\d+)?$/', $number ) ) {
+ return $number;
+ }
+ }
return strrev( (string)preg_replace( '/(\d{3})(?=\d)(?!\d*\.)/', '$1,', strrev( $number ) ) );
} else {
// Ref: http://cldr.unicode.org/translation/number-patterns
return self::$dataCache->getItem( $this->mCode, 'separatorTransformTable' );
}
+ /**
+ * @return int|null
+ */
+ function minimumGroupingDigits() {
+ return self::$dataCache->getItem( $this->mCode, 'minimumGroupingDigits' );
+ }
+
/**
* Take a list of strings and build a locale-friendly comma-separated
* list, using the local comma-separator message.
}
$dirmark = ( $oppositedm ? $this->getDirMark( true ) : '' ) . $this->getDirMark();
- return
- $page .
+ return $page .
$dirmark .
$this->msg( 'word-separator' )->escaped() .
$this->msg( 'parentheses' )->rawParams( $details )->escaped();
$noScript = '<script.*?>.*?<\/script>(*SKIP)(*FAIL)';
$noStyle = '<style.*?>.*?<\/style>(*SKIP)(*FAIL)';
- // @codingStandardsIgnoreStart Generic.Files.LineLength.TooLong
+ // phpcs:ignore Generic.Files.LineLength
$noHtml = '<(?:[^>=]*+(?>[^>=]*+=\s*+(?:"[^"]*"|\'[^\']*\'|[^\'">\s]*+))*+[^>=]*+>|.*+)(*SKIP)(*FAIL)';
- // @codingStandardsIgnoreEnd
while ( $startPos < $length && $continue ) {
$continue = preg_match(
// Only match -{ outside of html.
* @ingroup Language
* @see http://be-x-old.wikipedia.org/wiki/Project_talk:LanguageBe_tarask.php
*/
-// @codingStandardsIgnoreStart Ignore class name is not in camel caps format error
+// phpcs:ignore Squiz.Classes.ValidClassName.NotCamelCaps
class LanguageBe_tarask extends Language {
- // @codingStandardsIgnoreEnd
/**
* The Belarusian language uses apostrophe sign,
* but the characters used for this could be both U+0027 and U+2019.
return $s;
}
-
- /**
- * Four-digit number should be without group commas (spaces)
- * So "1 234 567", "12 345" but "1234"
- *
- * @param string $_
- *
- * @return string
- */
- function commafy( $_ ) {
- if ( preg_match( '/^-?\d{1,4}(\.\d*)?$/', $_ ) ) {
- return $_;
- } else {
- return strrev( (string)preg_replace( '/(\d{3})(?=\d)(?!\d*\.)/', '$1,', strrev( $_ ) ) );
- }
- }
}
+++ /dev/null
-<?php
-/**
- * Bulgarian (Български) specific code.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- * http://www.gnu.org/copyleft/gpl.html
- *
- * @file
- * @ingroup Language
- */
-
-/**
- * Bulgarian (Български)
- *
- * @ingroup Language
- */
-class LanguageBg extends Language {
- /**
- * ISO number formatting: 123 456 789,99.
- * Avoid tripple grouping by numbers with whole part up to 4 digits.
- *
- * @param string $_
- *
- * @return string
- */
- function commafy( $_ ) {
- if ( !preg_match( '/^\d{1,4}$/', $_ ) ) {
- return strrev( (string)preg_replace( '/(\d{3})(?=\d)(?!\d*\.)/', '$1,', strrev( $_ ) ) );
- } else {
- return $_;
- }
- }
-}
+++ /dev/null
-<?php
-/**
- * Spanish (español) specific code.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- * http://www.gnu.org/copyleft/gpl.html
- *
- * @file
- * @ingroup Language
- */
-
-/**
- * Spanish (español)
- *
- * @ingroup Language
- */
-class LanguageEs extends Language {
-
- /**
- * @param string $_
- * @return string
- */
- function commafy( $_ ) {
- if ( !preg_match( '/^-?\d{1,4}(\.\d+)?$/', $_ ) ) {
- return strrev( (string)preg_replace( '/(\d{3})(?=\d)(?!\d*\.)/', '$1,', strrev( $_ ) ) );
- } else {
- return $_;
- }
- }
-}
+++ /dev/null
-<?php
-/**
- * Estonian (eesti) specific code.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- * http://www.gnu.org/copyleft/gpl.html
- *
- * @file
- * @ingroup Language
- */
-
-/**
- * Estonian (eesti)
- *
- * @ingroup Language
- */
-class LanguageEt extends Language {
- /**
- * Avoid grouping whole numbers between -9999 to 9999
- * @param string $_
- * @return string
- */
- function commafy( $_ ) {
- if ( !preg_match( '/^\-?\d{1,4}(\.\d+)?$/', $_ ) ) {
- return strrev( (string)preg_replace( '/(\d{3})(?=\d)(?!\d*\.)/', '$1,', strrev( $_ ) ) );
- } else {
- return $_;
- }
- }
-}
}
return $word;
}
-
- /**
- * Armenian numeric format is "12 345,67" but "1234,56"
- *
- * @param string $_
- *
- * @return string
- */
- function commafy( $_ ) {
- if ( !preg_match( '/^\d{1,4}$/', $_ ) ) {
- return strrev( (string)preg_replace( '/(\d{3})(?=\d)(?!\d*\.)/', '$1,', strrev( $_ ) ) );
- } else {
- return $_;
- }
- }
}
return parent::lcfirst( $string );
}
- /**
- * Avoid grouping whole numbers between 0 to 9999
- *
- * @param string $_
- *
- * @return string
- */
- function commafy( $_ ) {
- if ( !preg_match( '/^\d{1,4}$/', $_ ) ) {
- return strrev( (string)preg_replace( '/(\d{3})(?=\d)(?!\d*\.)/', '$1,', strrev( $_ ) ) );
- } else {
- return $_;
- }
- }
-
}
*
* @ingroup Language
*/
-// @codingStandardsIgnoreStart Ignore class name is not in camel caps format error
+// phpcs:ignore Squiz.Classes.ValidClassName.NotCamelCaps
class LanguageKk_cyrl extends Language {
- // @codingStandardsIgnoreEnd
# Convert from the nominative form of a noun to some other case
# Invoked with {{GRAMMAR:case|word}}
/**
return $lastLetter;
}
-
- /**
- * Avoid grouping whole numbers between 0 to 9999
- *
- * @param string $_
- *
- * @return string
- */
- function commafy( $_ ) {
- if ( !preg_match( '/^\d{1,4}$/', $_ ) ) {
- return strrev( (string)preg_replace( '/(\d{3})(?=\d)(?!\d*\.)/', '$1,', strrev( $_ ) ) );
- } else {
- return $_;
- }
- }
}
return $word;
}
- /**
- * Avoid grouping whole numbers between 0 to 9999
- *
- * @param string $_
- *
- * @return string
- */
- public function commafy( $_ ) {
- if ( !preg_match( '/^\d{1,4}$/', $_ ) ) {
- return strrev( (string)preg_replace( '/(\d{3})(?=\d)(?!\d*\.)/', '$1,', strrev( $_ ) ) );
- } else {
- return $_;
- }
- }
-
/**
* Handle cases of (1, other, 0) or (1, other)
*
*
* @ingroup Language
*/
-class LanguageKu extends LanguageKu_ku {
+class LanguageKu extends Language {
function __construct() {
parent::__construct();
+++ /dev/null
-<?php
-/**
- * Kurdish specific code.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- * http://www.gnu.org/copyleft/gpl.html
- *
- * @file
- * @ingroup Language
- */
-
-/**
- * Kurdish
- *
- * @ingroup Language
- */
-// @codingStandardsIgnoreStart Ignore class name is not in camel caps format error
-class LanguageKu_ku extends Language {
- // @codingStandardsIgnoreEnd
- /**
- * Avoid grouping whole numbers between 0 to 9999
- *
- * @param string $_
- *
- * @return string
- */
- function commafy( $_ ) {
- if ( !preg_match( '/^\d{1,4}$/', $_ ) ) {
- return strrev( (string)preg_replace( '/(\d{3})(?=\d)(?!\d*\.)/', '$1,', strrev( $_ ) ) );
- } else {
- return $_;
- }
- }
-}
+++ /dev/null
-<?php
-/**
- * Polish (polski) specific code.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- * http://www.gnu.org/copyleft/gpl.html
- *
- * @file
- * @ingroup Language
- */
-
-/**
- * Polish (polski)
- *
- * @ingroup Language
- */
-class LanguagePl extends Language {
- /**
- * @param string $_
- * @return string
- */
- function commafy( $_ ) {
- if ( !preg_match( '/^\-?\d{1,4}(\.\d+)?$/', $_ ) ) {
- return strrev( (string)preg_replace( '/(\d{3})(?=\d)(?!\d*\.)/', '$1,', strrev( $_ ) ) );
- } else {
- return $_;
- }
- }
-}
+++ /dev/null
-<?php
-/**
- * Russian (русский язык) specific code.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- * http://www.gnu.org/copyleft/gpl.html
- *
- * @file
- * @ingroup Language
- */
-
-/**
- * Russian (русский язык)
- *
- * You can contact:
- * Alexander Sigachov (alexander.sigachov at Googgle Mail)
- * Amir E. Aharoni (amir.aharoni@mail.huji.ac.il)
- *
- * @ingroup Language
- */
-class LanguageRu extends Language {
- /**
- * Four-digit number should be without group commas (spaces)
- * See manual of style at https://ru.wikipedia.org/wiki/Википедия:Оформление_статей
- * So "1 234 567", "12 345" but "1234"
- *
- * @param string $_
- *
- * @return string
- */
- function commafy( $_ ) {
- if ( preg_match( '/^-?\d{1,4}(\.\d*)?$/', $_ ) ) {
- return $_;
- } else {
- return strrev( (string)preg_replace( '/(\d{3})(?=\d)(?!\d*\.)/', '$1,', strrev( $_ ) ) );
- }
- }
-}
+++ /dev/null
-<?php
-/**
- * Ukrainian (українська мова) specific code.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- * http://www.gnu.org/copyleft/gpl.html
- *
- * @file
- * @ingroup Language
- */
-
-/**
- * Ukrainian (українська мова)
- *
- * @ingroup Language
- */
-class LanguageUk extends Language {
- /**
- * Ukrainian numeric format is "12 345,67" but "1234,56"
- *
- * @param string $_
- *
- * @return string
- */
- function commafy( $_ ) {
- if ( !preg_match( '/^\-?\d{1,4}(\.\d+)?$/', $_ ) ) {
- return strrev( (string)preg_replace(
- '/(\d{3})(?=\d)(?!\d*\.)/',
- '$1,',
- strrev( $_ )
- ) );
- } else {
- return $_;
- }
- }
-}
*
* @ingroup Language
*/
-// @codingStandardsIgnoreStart Ignore class name is not in camel caps format error
+// phpcs:ignore Squiz.Classes.ValidClassName.NotCamelCaps
class LanguageZh_hans extends Language {
- // @codingStandardsIgnoreEnd
/**
* @return bool
*/
"tag-mw-changed-redirect-target-description": "Праўкі, якія зьмяняюць мэту перанакіраваньня",
"tag-mw-blank": "Ачыстка",
"tag-mw-blank-description": "Праўкі, якія робяць старонку пустой",
+ "tag-mw-replace": "Заменена",
+ "tag-mw-replace-description": "Праўкі, якія выдаляюць больш за 90% зьместу старонкі",
"tags-title": "Меткі",
"tags-intro": "На гэтай старонцы знаходзіцца сьпіс метак, якімі праграмнае забесьпячэньне можа пазначыць рэдагаваньне, і іх значэньне.",
"tags-tag": "Назва меткі",
"tog-watchlisthideminor": "Kleine Bearbeitungen in der Beobachtungsliste ausblenden",
"tog-watchlisthideliu": "Bearbeitungen angemeldeter Benutzer in der Beobachtungsliste ausblenden",
"tog-watchlistreloadautomatically": "Sofern ein Filter geändert wurde, die Beobachtungsliste automatisch neu laden (erfordert JavaScript)",
- "tog-watchlistunwatchlinks": "Direkte Links zum (Ent-)Beobachten bei Einträgen in der Beobachtungsliste hinzufügen (für diese Funktion ist JavaScript erforderlich)",
+ "tog-watchlistunwatchlinks": "Direkte Links zum Beobachten/Nicht beobachten bei den Einträgen in der Beobachtungsliste hinzufügen (erfordert JavaScript)",
"tog-watchlisthideanons": "Bearbeitungen anonymer Benutzer (IP-Adressen) in der Beobachtungsliste ausblenden",
"tog-watchlisthidepatrolled": "Kontrollierte Änderungen in der Beobachtungsliste ausblenden",
"tog-watchlisthidecategorization": "Kategorisierungen von Seiten in der Beobachtungsliste ausblenden",
"tog-showhiddencats": "Versteckte Kategorien anzeigen",
"tog-norollbackdiff": "Unterschiede nach dem Zurücksetzen nicht anzeigen",
"tog-useeditwarning": "Warnen, sofern eine zur Bearbeitung geöffnete Seite verlassen wird, die nicht gespeicherte Änderungen enthält",
- "tog-prefershttps": "Während angemeldet, immer eine sichere Verbindung benutzen.",
+ "tog-prefershttps": "Stets eine sichere Verbindung benutzen, solange ich angemeldet bin",
"underline-always": "immer",
"underline-never": "nie",
"underline-default": "abhängig von der Benutzeroberfläche oder Browsereinstellung",
"newwindow": "(wird in einem neuen Fenster geöffnet)",
"cancel": "Abbrechen",
"moredotdotdot": "Mehr …",
- "morenotlisted": "Diese Liste könnte nicht vollständig sein.",
+ "morenotlisted": "Diese Liste könnte unvollständig sein.",
"mypage": "Eigene Seite",
"mytalk": "Diskussion",
"anontalk": "Diskussionsseite",
"tool-link-userrights-readonly": "{{GENDER:$1|Benutzergruppen}} ansehen",
"tool-link-emailuser": "E-Mail an {{GENDER:$1|diesen Benutzer|diese Benutzerin}} senden",
"imagepage": "Dateiseite anzeigen",
- "mediawikipage": "Meldungsseite anzeigen",
+ "mediawikipage": "Systemnachricht ansehen",
"templatepage": "Vorlagenseite anzeigen",
"viewhelppage": "Hilfeseite anzeigen",
"categorypage": "Kategorieseite anzeigen",
"jumpto": "Wechseln zu:",
"jumptonavigation": "Navigation",
"jumptosearch": "Suche",
- "view-pool-error": "Entschuldigung, die Server sind im Moment überlastet.\nZu viele Benutzer versuchen, diese Seite zu besuchen.\nBitte warte einige Minuten, bevor du es noch einmal versuchst.\n\n$1",
- "generic-pool-error": "Leider sind die Server derzeit überlastet.\nZu viele Benutzer wollen diese Ressource ansehen.\nBitte warte einen Moment, bevor du sie erneut aufrufst.",
+ "view-pool-error": "Entschuldige bitte, dass die Server im Moment überlastet sind.\nZu viele Benutzer versuchen, diese Seite zu besuchen.\nBitte warte einige Minuten, bevor du es noch einmal versuchst.\n\n$1",
+ "generic-pool-error": "Entschuldige bitte, dass die Server im Moment überlastet sind.\nZu viele Benutzer wollen diese Ressource ansehen.\nBitte warte einen Moment, bevor du sie erneut aufrufst.",
"pool-timeout": "Zeitablauf während des Wartens auf die Sperrung",
"pool-queuefull": "Poolwarteschlange ist voll",
"pool-errorunknown": "Unbekannter Fehler",
"pool-servererror": "Der Poolzählerdienst ist nicht verfügbar ($1).",
- "poolcounter-usage-error": "Verwendungsfehler: $1",
+ "poolcounter-usage-error": "Anwendungsfehler: $1",
"aboutsite": "Über {{SITENAME}}",
"aboutpage": "Project:Über_{{SITENAME}}",
"copyright": "Der Inhalt ist verfügbar unter der Lizenz $1, sofern nicht anders angegeben.",
"recentchangesdays-max": "Enintään $1 {{PLURAL:$1|päivä|päivää}}",
"recentchangescount": "Näytettävien muutoksien määrä oletuksena",
"prefs-help-recentchangescount": "Tämä sisältää tuoreet muutokset, muutoshistoriat ja lokit.",
- "prefs-help-watchlist-token2": "Tämä on salainen avain tarkkailulistasi verkkosyötteeseen.\nKuka tahansa, joka tietää sen voi lukea tarkkailulistaasi, joten älä paljasta sitä.\n[[Special:ResetTokens|Napsauta tästä, jos sinun pitää uudistaa se]].",
+ "prefs-help-watchlist-token2": "Tämä on salainen avain tarkkailulistasi verkkosyötteeseen.\nKuka tahansa, joka tietää sen voi lukea tarkkailulistaasi, joten älä paljasta sitä.\nJos sinun täytyy, [[Special:ResetTokens|voit uudistaa sen]].",
"savedprefs": "Asetuksesi on tallennettu.",
"savedrights": "Käyttäjän {{GENDER:$1|$1}} käyttäjäryhmät on tallennettu.",
"timezonelegend": "Aikavyöhyke",
"timezoneregion-indian": "Intian valtameri",
"timezoneregion-pacific": "Tyynimeri",
"allowemail": "Salli muiden käyttäjien lähettää minulle sähköpostia",
+ "email-allow-new-users-label": "Salli sähköpostit uusilta käyttäjiltä",
"email-blacklist-label": "Estä näitä käyttäjiä lähettämästä minulle sähköpostia:",
"prefs-searchoptions": "Haku",
"prefs-namespaces": "Nimiavaruudet",
"rcfilters-advancedfilters": "Kehittyneet suodattimet",
"rcfilters-limit-title": "Näytettävät tulokset",
"rcfilters-limit-and-date-label": "{{PLURAL:$1|muutos|$1 muutosta}}, $2",
+ "rcfilters-date-popup-title": "Aikajakso hakua varten",
"rcfilters-days-title": "Viimeisimmät päivät",
"rcfilters-hours-title": "Viimeisimmät tunnit",
"rcfilters-days-show-days": "$1 {{PLURAL:$1|päivä|päivää}}",
"rcfilters-filter-watchlist-notwatched-description": "Kaikki paitsi muutokset tarkkailulistallasi oleviin sivuihin.",
"rcfilters-filtergroup-watchlistactivity": "Tarkkailulistan aktiivisuus",
"rcfilters-filter-watchlistactivity-unseen-label": "Näkemättömät muutokset",
+ "rcfilters-filter-watchlistactivity-unseen-description": "Muutokset sivuihin, joilla et ole käynyt muutosten jälkeen.",
"rcfilters-filter-watchlistactivity-seen-label": "Nähdyt muutokset",
+ "rcfilters-filter-watchlistactivity-seen-description": "Muutokset sivuihin, joilla olet käynyt muutosten jälkeen.",
"rcfilters-filtergroup-changetype": "Muutoksen tyyppi",
"rcfilters-filter-pageedits-label": "Sivun muokkaukset",
"rcfilters-filter-pageedits-description": "Muokkaukset wikin sisältöön, keskusteluihin, luokkakuvauksiin…",
"uploadstash-errclear": "Tiedostojen tyhjentäminen epäonnistui.",
"uploadstash-refresh": "Päivitä tiedostoluettelo",
"uploadstash-thumbnail": "näytä pienoiskuva",
+ "uploadstash-bad-path": "\nPolkua ei ole.",
+ "uploadstash-bad-path-invalid": "Polku ei kelpaa.",
+ "uploadstash-not-logged-in": "Käyttäjää ei ole kirjautunut sisään, tiedostojen on kuuluttava käyttäjille.",
+ "uploadstash-no-extension": "Laajennus on tyhjä.",
"invalid-chunk-offset": "Kelpaamaton siirtymä lohkoissa",
"img-auth-accessdenied": "Pääsy estetty",
"img-auth-nopathinfo": "PATH_INFO puuttuu.\nPalvelintasi ei ole asetettu välittämään tätä tietoa.\nSe saattaa olla CGI-pohjainen eikä voi tukea img_authia.\nLisätietoja löytyy sivulta https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:Image_Authorization.",
"tag-list-wrapper": "([[Special:Tags|{{PLURAL:$1|Merkkaus|Merkkaukset}}]]: $2)",
"tag-mw-contentmodelchange": "sisältömallin muutos",
"tag-mw-contentmodelchange-description": "Muokkaukset, jotka [https://www.mediawiki.org/wiki/Special:MyLanguage/Help:ChangeContentModel muuttavat sivun sisältömallia]",
+ "tag-mw-new-redirect": "Uusi uudelleenohjaus",
+ "tag-mw-new-redirect-description": "Muokkaukset, jotka luovat uuden uudelleenohjauksen tai muuttavat sivun uudelleenohjaukseksi",
"tag-mw-removed-redirect": "Ohjaus on poistettu",
+ "tag-mw-removed-redirect-description": "Muokkaukset, jotka muuttavat olemassa olevan uudelleenohjauksen ei-uudelleenohjaukseksi",
+ "tag-mw-changed-redirect-target": "Uudelleenohjauksen kohde muutettu",
+ "tag-mw-changed-redirect-target-description": "Muokkaukset, jotka muuttavat uudelleenohjauksen kohdetta",
+ "tag-mw-blank-description": "Muokkaukset, jotka tyhjentävät sivun",
+ "tag-mw-replace": "Korvattu",
+ "tag-mw-replace-description": "Muokkaukset, jotka poistavat yli 90% sivun sisällöstä",
+ "tag-mw-rollback": "Palautus",
+ "tag-mw-rollback-description": "Muokkaukset, jotka palauttavat edelliset muokkaukset takaisinvetolinkillä",
"tag-mw-undo": "Kumoa",
+ "tag-mw-undo-description": "Muokkaukset, jotka kumoavat edelliset muokkaukset kumoamislinkillä",
"tags-title": "Merkkaukset",
"tags-intro": "Tämä sivu luetteloi ne merkkaukset (''engl.'' tags), joilla ohjelmisto voi merkitä muokkauksia, ja mitä ne tarkoittavat.",
"tags-tag": "Merkkauksen nimi",
"special-characters-group-thai": "Thai",
"special-characters-group-lao": "Lao",
"special-characters-group-khmer": "Khmer",
+ "special-characters-group-canadianaboriginal": "Kanadalainen aboriginaali",
"special-characters-title-endash": "ajatusviiva",
"special-characters-title-emdash": "pitkä ajatusviiva",
"special-characters-title-minus": "miinusmerkki",
"authmanager-userlogin-remembermypassword-help": "Tulisiko salasana muistaa istunnon kestoa pidempään.",
"authmanager-username-help": "Käyttäjänimi varmentamiseen.",
"authmanager-password-help": "Salasana varmentamiseen.",
+ "authmanager-domain-help": "Verkkonimi ulkoiselle todennukselle.",
"authmanager-retype-help": "Salasana uudelleen vahvistaaksesi.",
"authmanager-email-label": "Sähköposti",
"authmanager-email-help": "Sähköpostiosoite",
"authprovider-confirmlink-request-label": "Tunnukset, jotka tulisi yhdistää",
"authprovider-confirmlink-success-line": "$1: Linkitetty onnistuneesti.",
"authprovider-confirmlink-failed": "Tunnuksen linkitys ei onnistunut täysin: $1",
+ "authprovider-confirmlink-ok-help": "Jatka yhteydenottohäiriöilmoitusten näyttämisen jälkeen.",
"authprovider-resetpass-skip-label": "Ohita",
"authprovider-resetpass-skip-help": "Ohita salasanan palautus.",
"authform-nosession-login": "Varmennus onnistui, mutta selaimesi ei pysty \"muistamaan\" sisäänkirjautumista.\n\n$1",
"youremail": "Courriel :",
"username": "{{GENDER:$1|Nom d'utilisateur|Nom d'utilisatrice}} :",
"prefs-memberingroups": "{{GENDER:$2|Membre}} {{PLURAL:$1|du groupe|des groupes}} :",
+ "prefs-memberingroups-type": "$1",
"group-membership-link-with-expiry": "$1 (jusqu'à $2)",
"prefs-registration": "Date d'inscription :",
+ "prefs-registration-date-time": "$1",
"yourrealname": "Nom réel :",
"yourlanguage": "Langue :",
"yourvariant": "Variante de la langue du contenu :",
"apisandbox-request-selectformat-label": "Afficher les données de la requête comme :",
"apisandbox-request-format-url-label": "Chaîne de requête de l’URL",
"apisandbox-request-url-label": "Requête URL :",
+ "apisandbox-request-format-json-label": "JSON",
"apisandbox-request-json-label": "Demander du JSON :",
"apisandbox-request-time": "Durée de la demande: {{PLURAL:$1|$1 ms}}",
"apisandbox-results-fixtoken": "Corrigez le jeton et renvoyez",
"listgrants-summary": "Voici une liste des droits avec leur accès associé aux droits utilisateur. Les utilisateurs peuvent autoriser les applications à utiliser leur compte, mais avec des droits limités d’après les droits que l’utilisateur a donnés à l’application. Un application agissant au nom d’un utilisateur ne peut toutefois pas, de fait, utiliser des droits que l’utilisateur ne possède pas.\nIl peut y avoir [[{{MediaWiki:Listgrouprights-helppage}}|plus d’information]] sur les droits individuels.",
"listgrants-grant": "Accorder",
"listgrants-rights": "Droits",
+ "listgrants-grant-display": "$1 <code>($2)</code>",
"trackingcategories": "Catégories de suivi",
"trackingcategories-summary": "Cette page liste les catégories de suivi qui sont remplies automatiquement par [[MediaWiki]]. Leurs noms peuvent être changés en modifiant les messages systèmes correspondants dans l’espace de noms {{ns:8}}.",
"trackingcategories-msg": "Catégorie de suivi",
"userrights-viewusergroup": "{{GENDER:$1|利用者}}グループ",
"saveusergroups": "{{GENDER:$1|利用者}}グループを保存",
"userrights-groupsmember": "所属グループ:",
- "userrights-groupsmember-auto": "秘匿した所属グループ",
+ "userrights-groupsmember-auto": "自動的に所属するグループ:",
"userrights-groupsmember-type": "$1",
"userrights-groups-help": "この利用者が属するグループを変更できます。\n* チェックが入っているボックスは、この利用者がそのグループに属していることを意味します。\n* チェックが入っていないボックスは、この利用者がそのグループに属していないことを意味します。\n*「*」はグループに一旦追加した場合に除去 (あるいはその逆) ができないことを示しています。\n*「#」は有効期限の延長のみを行うことができるグループの参加資格を示します; 現在の期限よりも短縮することはできません。",
"userrights-reason": "理由:",
"recentchanges-submit": "表示",
"rcfilters-tag-remove": "「$1」を除去",
"rcfilters-legend-heading": "<strong>略語のリスト:</strong>",
+ "rcfilters-other-review-tools": "その他の監視ツール",
"rcfilters-group-results-by-page": "ページごとにまとめて表示",
"rcfilters-activefilters": "絞り込み",
"rcfilters-advancedfilters": "詳細フィルター",
"rcfilters-limit-title": "表示件数の変更",
+ "rcfilters-limit-and-date-label": "$1件の変更、$2",
"rcfilters-date-popup-title": "検索期間",
"rcfilters-days-title": "日数",
"rcfilters-hours-title": "時間",
"tag-mw-contentmodelchange-description": "ページの[https://www.mediawiki.org/wiki/Special:MyLanguage/Help:ChangeContentModel コンテンツモデルを変更]する",
"tag-mw-new-redirect": "新規リダイレクト",
"tag-mw-new-redirect-description": "新たな転送ページの作成または既存ページの転送化の編集",
+ "tag-mw-removed-redirect": "転送廃止",
"tag-mw-changed-redirect-target": "転送先変更",
"tag-mw-changed-redirect-target-description": "転送先を変更する編集",
"tag-mw-blank": "白紙化",
"subject-preview": "Sujet kucken ouni ze späicheren:",
"previewerrortext": "Beim Versuch fir Är Ännerungen ze weisen, ass e Feeler geschitt.",
"blockedtitle": "Benotzer ass gespaart",
- "blockedtext": "Äre Benotzernumm oder Är IP-Adress gouf gespaart.\n\nD'Spär gouf vum $1 gemaach. Als Grond gouf ''$2'' uginn.\n\n* Ufank vun der Spär: $8\n* Enn vun der Spär: $6\n* Spär betrëfft: $7\n\nDir kënnt den/d' $1 kontaktéieren oder ee vun den aneren [[{{MediaWiki:Grouppage-sysop}}|Administrateure]] fir iwwer d'Spär ze schwätzen.\n\nDëst sollt Dir besonnesch maachen, wann Dir d'Gefill hutt, datt de Grond fir d'Spären net bei Iech läit.\nD'Ursaach dofir ass an deem Fall, datt Dir eng dynamesch IP hutt, iwwer en Access-Provider, iwwer deen och aner Leit fueren.\nAus deem Grond ass et recommandéiert, sech e Benotzernumm zouzeleeën, fir all Mëssverständnes z'evitéieren.\n\nDir kënnt d'Funktioun \"Dësem Benotzer eng E-Mail schécken\" nëmme benotzen, wann Dir eng gëlteg E-Mail Adress bei Ären [[Special:Preferences|Astellungen]] aginn hutt.\nÄr aktuell IP-Adress ass $3 an d'Nummer vun der Spär ass #$5.\nSchreift all dës Informatioune w.e.g. bei all Ufro dobäi.",
+ "blockedtext": "Äre Benotzernumm oder Är IP-Adress gouf gespaart.\n\nD'Spär gouf vum $1 gemaach. Als Grond gouf ''$2'' uginn.\n\n* Ufank vun der Spär: $8\n* Enn vun der Spär: $6\n* Spär betrëfft: $7\n\nDir kënnt den/d' $1 kontaktéieren oder ee vun den aneren [[{{MediaWiki:Grouppage-sysop}}|Administrateure]] fir iwwer d'Spär ze schwätzen.\n\nDëst sollt Dir besonnesch maachen, wann Dir d'Gefill hutt, datt de Grond fir d'Spären net bei Iech läit.\nD'Ursaach dofir ass an deem Fall, datt Dir eng dynamesch IP hutt, iwwer en Access-Provider, iwwer deen och aner Leit fueren.\nAus deem Grond ass et recommandéiert, sech e Benotzernumm zouzeleeën, fir all Mëssverständnes z'evitéieren.\n\nDir kënnt d'Funktioun \"Dësem Benotzer eng E-Mail schécken\" nëmme benotzen, wann Dir eng gëlteg E-Mail Adress bei Ären [[Special:Preferences|Astellungen]] aginn hutt.\nÄr aktuell IP-Adress ass $3 an d'Nummer vun der Spär ass #$5.\nSchreift all dës Informatioune w.e.g. bei all Ufro derbäi.",
"autoblockedtext": "Är IP-Adress gouf automatesch gespaart, well se vun engem anere Benotzer gebraucht gouf, an dee vum $1 gespaart gouf.\nDe Grond dofir war:\n\n:''$2''\n\n* Ufank vun der Spär: $8\n* Dauer vun der Spär: $6\n* D'Spär leeft of: $7\n\nDir kënnt de(n) $1 oder soss een [[{{MediaWiki:Grouppage-sysop}}|Administrateur]] kontaktéieren, fir iwwer déi Spär ze diskutéieren.\n\nBedenkt datt Dir d'Funktioun \"Dësem Benotzer eng E-Mail schécken\" benotze kënnt wann Dir eng gëlteg E-Mail-Adress an Ären [[Special:Preferences|Astellungen]] uginn hutt a wann dat net fir Iech gespaart gouf.\n\nÄr aktuell IP-Adress ass $3 an d'Nummer vun Ärer Spär ass $5.\nGitt dës Donnéeë w.e.g bei allen Ufroen zu dëser Spär un.",
"blockednoreason": "Kee Grond uginn",
"whitelistedittext": "Dir musst Iech $1, fir Säiten änneren ze kënnen.",
',' => "\xc2\xa0", # nbsp
'.' => ','
];
+$minimumGroupingDigits = 2;
$linkTrail = '/^([абвгґджзеёжзійклмнопрстуўфхцчшыьэюяćčłńśšŭźža-z]+)(.*)$/sDu';
$linkTrail = '/^([a-zабвгдежзийклмнопрстуфхцчшщъыьэюя]+)(.*)$/sDu';
$separatorTransformTable = [ ',' => "\xc2\xa0", '.' => ',' ];
+$minimumGroupingDigits = 2;
];
$separatorTransformTable = [ ',' => "\xc2\xa0", '.' => ',' ];
+$minimumGroupingDigits = 2;
+
$linkTrail = '/^([a-záéíóúñ]+)(.*)$/sDu';
];
$separatorTransformTable = [ ',' => "\xc2\xa0", '.' => ',' ];
+$minimumGroupingDigits = 2;
+
$linkTrail = '/^([äöõšüža-z]+)(.*)$/sDu';
$datePreferences = [
',' => "\xc2\xa0", # nbsp
'.' => ','
];
+$minimumGroupingDigits = 2;
$fallback8bitEncoding = 'UTF-8';
',' => "\xc2\xa0",
'.' => ',',
];
+$minimumGroupingDigits = 2;
$fallback8bitEncoding = 'windows-1254';
',' => "\xc2\xa0",
'.' => ',',
];
+$minimumGroupingDigits = 2;
$fallback8bitEncoding = 'windows-1251';
];
$separatorTransformTable = [ ',' => "\xc2\xa0", '.' => ',' ];
+$minimumGroupingDigits = 2;
+
$linkTrail = '/^([äöüėëijßəğåůæœça-z]+)(.*)$/sDu';
// Remove German aliases
];
$separatorTransformTable = [ ',' => '.', '.' => ',' ];
+$minimumGroupingDigits = 2;
$specialPageAliases = [
'Allmessages' => [ 'Hemû_Peyam' ],
];
$fallback8bitEncoding = 'iso-8859-2';
+
$separatorTransformTable = [
',' => "\xc2\xa0", // T4749
'.' => ','
];
+$minimumGroupingDigits = 2;
$linkTrail = '/^([a-zęóąśłżźćńĘÓĄŚŁŻŹĆŃ]+)(.*)$/sDu';
',' => "\xc2\xa0", # nbsp
'.' => ','
];
+$minimumGroupingDigits = 2;
$fallback8bitEncoding = 'windows-1251';
$linkPrefixExtension = false;
',' => "\xc2\xa0", # nbsp
'.' => ','
];
+$minimumGroupingDigits = 2;
$fallback8bitEncoding = 'windows-1251';
$linkPrefixExtension = true;
public function __construct() {
parent::__construct();
- // @codingStandardsIgnoreStart Ignore long line warnings.
+ // phpcs:disable Generic.Files.LineLength
$this->data = [
"",
"United States of America", // 7bit ASCII
. "Sara%20Sidle%7CSofia%20Curtis%7CS%C3%A9rie%20t%C3%A9l%C3%A9vis%C3%A9e%7CWallace%20Langham%7C"
. "Warrick%20Brown%7CWendy%20Simms%7C%C3%89tats-Unis"
];
- // @codingStandardsIgnoreEnd
+ // phpcs:enable
$this->addDescription( "Benchmark for using a regexp vs. mb_check_encoding " .
"to check for UTF-8 encoding." );
require_once __DIR__ . '/Maintenance.php';
-// @codingStandardsIgnoreStart MediaWiki.NamingConventions.ValidGlobalName.wgPrefix
-global $optionsWithArgs;
-global $optionsWithoutArgs;
-// @codingStandardsIgnoreEnd
+// phpcs:ignore MediaWiki.NamingConventions.ValidGlobalName.wgPrefix
+global $optionsWithArgs, $optionsWithoutArgs;
+
if ( !isset( $optionsWithArgs ) ) {
$optionsWithArgs = [];
}
class CommandLineInc extends Maintenance {
public function __construct() {
- // @codingStandardsIgnoreStart MediaWiki.NamingConventions.ValidGlobalName.wgPrefix
+ // phpcs:ignore MediaWiki.NamingConventions.ValidGlobalName.wgPrefix
global $optionsWithArgs, $optionsWithoutArgs;
- // @codingStandardsIgnoreEnd
+
parent::__construct();
foreach ( $optionsWithArgs as $name ) {
$this->addOption( $name, '', false, true );
}
public function execute() {
- // @codingStandardsIgnoreStart MediaWiki.NamingConventions.ValidGlobalName.wgPrefix
+ // phpcs:ignore MediaWiki.NamingConventions.ValidGlobalName.wgPrefix
global $args, $options;
- // @codingStandardsIgnoreEnd
+
$args = $this->mArgs;
$options = $this->mOptions;
}
$dbw = $this->getDB( DB_MASTER );
# Handle each entry
- // @codingStandardsIgnoreStart Ignore Generic.CodeAnalysis.ForLoopWithTestFunctionCall.NotAllowed
+ // phpcs:ignore Generic.CodeAnalysis.ForLoopWithTestFunctionCall
for ( $linenum = 1; !feof( $file ); $linenum++ ) {
- // @codingStandardsIgnoreEnd
$line = trim( fgets( $file ) );
if ( $line == '' ) {
continue;
// Custom setup for Maintenance entry point
if ( !defined( 'MW_SETUP_CALLBACK' ) ) {
function wfMaintenanceSetup() {
- // @codingStandardsIgnoreLine MediaWiki.NamingConventions.ValidGlobalName.wgPrefix
+ // phpcs:ignore MediaWiki.NamingConventions.ValidGlobalName.wgPrefix
global $maintenance, $wgLocalisationCacheConf, $wgCacheDirectory;
if ( $maintenance->getDbType() === Maintenance::DB_NONE ) {
if ( $wgLocalisationCacheConf['storeClass'] === false
* @return string
*/
function indexEntry( $filename ) {
- return
- "\t<sitemap>\n" .
+ return "\t<sitemap>\n" .
"\t\t<loc>{$this->urlpath}$filename</loc>\n" .
"\t\t<lastmod>{$this->timestamp}</lastmod>\n" .
"\t</sitemap>\n";
* @return string
*/
function fileEntry( $url, $date, $priority ) {
- return
- "\t<url>\n" .
+ return "\t<url>\n" .
// T36666: $url may contain bad characters such as ampersands.
"\t\t<loc>" . htmlspecialchars( $url ) . "</loc>\n" .
"\t\t<lastmod>$date</lastmod>\n" .
return $blacklist;
}
- // @codingStandardsIgnoreStart Ignore that globals should have a "wg" prefix.
+ // phpcs:ignore MediaWiki.NamingConventions.ValidGlobalName.wgPrefix
global $checkBlacklist;
- // @codingStandardsIgnoreEnd
$blacklist = $checkBlacklist;
$tableRows = implode( "\n|-\n", $rows );
$version = SpecialVersion::getVersion( 'nodb' );
- // @codingStandardsIgnoreStart Long line.
+ // phpcs:disable Generic.Files.LineLength
echo <<<EOL
'''Check results are for:''' <code>$version</code>
$detailText
EOL;
- // @codingStandardsIgnoreEnd
+ // phpcs:enable
}
/**
}
public function execute() {
- // @codingStandardsIgnoreStart Ignore error: Global variable "$mmfl" is lacking 'wg' prefix
+ // phpcs:ignore MediaWiki.NamingConventions.ValidGlobalName.wgPrefix
global $mmfl;
- // @codingStandardsIgnoreEnd
global $wgExtensionEntryPointListFiles;
if ( !count( $wgExtensionEntryPointListFiles )
# Setup complete, now start
$dbw = $this->getDB( DB_MASTER );
- // @codingStandardsIgnoreStart Ignore avoid function calls in a FOR loop test part warning
+ // phpcs:ignore Generic.CodeAnalysis.ForLoopWithTestFunctionCall
for ( $linenum = 1; !feof( $file ); $linenum++ ) {
- // @codingStandardsIgnoreEnd
$line = fgets( $file );
if ( $line === false ) {
break;
$usedChunk = false;
$primaryOldid = $revs[$i]->rev_text_id;
- // @codingStandardsIgnoreStart Ignore avoid function calls in a FOR loop test part warning
# Get the text of each revision and add it to the object
+ // phpcs:ignore Generic.CodeAnalysis.ForLoopWithTestFunctionCall
for ( $j = 0; $j < $thisChunkSize && $chunk->isHappy(); $j++ ) {
- // @codingStandardsIgnoreEnd
$oldid = $revs[$i + $j]->rev_text_id;
# Get text
$badPhpUnit = dirname( __DIR__ ) . '/vendor/phpunit/phpunit/src/Util/PHP/eval-stdin.php';
if ( file_exists( $badPhpUnit ) ) {
- // @codingStandardsIgnoreStart Generic.Files.LineLength.TooLong
// Bad versions of the file are:
// https://raw.githubusercontent.com/sebastianbergmann/phpunit/c820f915bfae34e5a836f94967a2a5ea5ef34f21/src/Util/PHP/eval-stdin.php
// https://raw.githubusercontent.com/sebastianbergmann/phpunit/3aaddb1c5bd9b9b8d070b4cf120e71c36fd08412/src/Util/PHP/eval-stdin.php
- // @codingStandardsIgnoreEnd
$md5 = md5_file( $badPhpUnit );
if ( $md5 === '120ac49800671dc383b6f3709c25c099'
|| $md5 === '28af792cb38fc9a1b236b91c1aad2876'
$userValue = $user->getOption( $option );
if ( $userValue <> $defaultOptions[$option] ) {
- // @codingStandardsIgnoreStart Ignore silencing errors is discouraged warning
+ // phpcs:ignore Generic.PHP.NoSilencedErrors.Discouraged
@$ret[$option][$userValue]++;
- // @codingStandardsIgnoreEnd
}
} else {
foreach ( $defaultOptions as $name => $defaultValue ) {
$userValue = $user->getOption( $name );
if ( $userValue != $defaultValue ) {
- // @codingStandardsIgnoreStart Ignore silencing errors is discouraged warning
+ // phpcs:ignore Generic.PHP.NoSilencedErrors.Discouraged
@$ret[$name][$userValue]++;
- // @codingStandardsIgnoreEnd
}
}
}
<?php
-// @codingStandardsIgnoreFile Generic.Arrays.DisallowLongArraySyntax
+// phpcs:ignoreFile Generic.Arrays.DisallowLongArraySyntax
/**
* New version of MediaWiki web-based config/installation
*
// Bail on old versions of PHP, or if composer has not been run yet to install
// dependencies. Using dirname( __FILE__ ) here because __DIR__ is PHP5.3+.
-// @codingStandardsIgnoreStart MediaWiki.Usage.DirUsage.FunctionFound
+// phpcs:ignore MediaWiki.Usage.DirUsage.FunctionFound
require_once dirname( __FILE__ ) . '/../includes/PHPVersionCheck.php';
-// @codingStandardsIgnoreEnd
wfEntryPointCheck( 'mw-config/index.php' );
define( 'MW_CONFIG_CALLBACK', 'Installer::overrideConfig' );
}
}
-// @codingStandardsIgnoreStart
+// phpcs:ignore Squiz.Classes.ValidClassName.NotCamelCaps
class profile_point {
- // @codingStandardsIgnoreEnd
public $name;
public $count;
<?php echo htmlspecialchars( str_replace( ',', ', ', $this->name() ) ) . $extet ?>
</div>
</th>
- <?php //@codingStandardsIgnoreStart ?>
+ <?php // phpcs:disable Generic.Files.LineLength,Generic.PHP.NoSilencedErrors ?>
<td class="mw-profileinfo-timep"><?php echo @wfPercent( $this->time() / self::$totaltime * 100 ); ?></td>
<td class="mw-profileinfo-memoryp"><?php echo @wfPercent( $this->memory() / self::$totalmemory * 100 ); ?></td>
<td class="mw-profileinfo-count"><?php echo $this->count(); ?></td>
<td class="mw-profileinfo-mpc"><?php echo round( sprintf( '%.2f', $this->memoryPerCall() / 1024 ), 2 ); ?></td>
<td class="mw-profileinfo-tpr"><?php echo @round( sprintf( '%.2f', $this->time() / self::$totalcount ), 2 ); ?></td>
<td class="mw-profileinfo-mpr"><?php echo @round( sprintf( '%.2f', $this->memory() / self::$totalcount / 1024 ), 2 ); ?></td>
- <?php //@codingStandardsIgnoreEnd ?>
+ <?php // phpcs:enable ?>
</tr>
<?php
if ( $ex ) {
}
public function timePerCall() {
- // @codingStandardsIgnoreStart
+ // phpcs:ignore Generic.PHP.NoSilencedErrors.Discouraged
return @( $this->time / $this->count );
- // @codingStandardsIgnoreEnd
}
public function memoryPerCall() {
- // @codingStandardsIgnoreStart
+ // phpcs:ignore Generic.PHP.NoSilencedErrors.Discouraged
return @( $this->memory / $this->count );
- // @codingStandardsIgnoreEnd
}
public function callsPerRequest() {
- // @codingStandardsIgnoreStart
+ // phpcs:ignore Generic.PHP.NoSilencedErrors.Discouraged
return @( $this->count / self::$totalcount );
- // @codingStandardsIgnoreEnd
}
public function timePerRequest() {
- // @codingStandardsIgnoreStart
+ // phpcs:ignore Generic.PHP.NoSilencedErrors.Discouraged
return @( $this->time / self::$totalcount );
- // @codingStandardsIgnoreEnd
}
public function memoryPerRequest() {
- // @codingStandardsIgnoreStart
+ // phpcs:ignore Generic.PHP.NoSilencedErrors.Discouraged
return @( $this->memory / self::$totalcount );
- // @codingStandardsIgnoreEnd
}
public function fmttime() {
};
function compare_point( profile_point $a, profile_point $b ) {
- // @codingStandardsIgnoreStart
+ // phpcs:ignore MediaWiki.NamingConventions.ValidGlobalName.wgPrefix
global $sort;
- // @codingStandardsIgnoreEnd
+
switch ( $sort ) {
case 'name':
return strcmp( $a->name(), $b->name() );
profile_point::$totalmemory = 0.0;
function getEscapedProfileUrl( $_filter = false, $_sort = false, $_expand = false ) {
- // @codingStandardsIgnoreStart
+ // phpcs:ignore MediaWiki.NamingConventions.ValidGlobalName.wgPrefix
global $filter, $sort, $expand;
- // @codingStandardsIgnoreEnd
if ( $_expand === false ) {
$_expand = $expand;
}
$points[] = $s;
- // @codingStandardsIgnoreStart
+ // phpcs:ignore Generic.PHP.NoSilencedErrors.Discouraged
@usort( $points, 'compare_point' );
- // @codingStandardsIgnoreEnd
foreach ( $points as $point ) {
if ( strlen( $filter ) && !strstr( $point->name(), $filter ) ) {
global $wgAutoloadClasses;
$testDir = __DIR__ . "/..";
-// @codingStandardsIgnoreStart Generic.Files.LineLength.TooLong
+// phpcs:disable Generic.Files.LineLength
$wgAutoloadClasses += [
# tests/common
'ParserTestFileSuite' => "$testDir/phpunit/suites/ParserTestFileSuite.php",
'ParserTestTopLevelSuite' => "$testDir/phpunit/suites/ParserTestTopLevelSuite.php",
];
-// @codingStandardsIgnoreEnd
+// phpcs:enable
$parser->static_tag_buf = null;
return $tmp;
} else { // wtf?
- return
- "\nCall this extension as <statictag>string</statictag> or as" .
+ return "\nCall this extension as <statictag>string</statictag> or as" .
" <statictag action=flush/>, not in any other way.\n" .
"text: " . var_export( $in, true ) . "\n" .
"argv: " . var_export( $argv, true ) . "\n";
print "Wrote updated file\n";
} else {
print "Cannot write updated file, here is a patch you can paste:\n\n";
- print
- "--- {$fileName}\n" .
+ print "--- {$fileName}\n" .
"+++ {$fileName}~\n" .
$this->unifiedDiff( $text, $result ) .
"\n";
* http://www.gnu.org/copyleft/gpl.html
*/
-// @codingStandardsIgnoreFile
+// phpcs:ignoreFile
/**
* @param callable $callback
/**
* Minimal set of classes necessary for UserMailer to be happy. Types
* taken from documentation at pear.php.net.
- * @codingStandardsIgnoreFile
+ * phpcs:ignoreFile
*/
class PEAR {
* that they are optional. Phan can not detect this and thus throws an error for a usage with
* no params. So we have this small stub just for the constructor to allow no params.
* @see https://secure.php.net/manual/en/memcached.construct.php
- * @codingStandardsIgnoreFile
+ * phpcs:ignoreFile
*/
class Memcached {
/**
* Minimal set of classes necessary for Xhprof using tideways
- * @codingStandardsIgnoreFile
+ * phpcs:ignoreFile
*/
function tideways_enable(){
* http://www.gnu.org/copyleft/gpl.html
*/
-// @codingStandardsIgnoreFile
+// phpcs:ignoreFile
/**
* @param string $text1
public function provideCasesForFormatComment() {
$wikiId = 'enwiki'; // $wgConf has a fake entry for this
- // @codingStandardsIgnoreStart Generic.Files.LineLength
+ // phpcs:disable Generic.Files.LineLength
return [
// Linker::formatComment
[
false, false, $wikiId
],
];
- // @codingStandardsIgnoreEnd
+ // phpcs:enable
}
/**
}
public static function provideCasesForFormatLinksInComment() {
- // @codingStandardsIgnoreStart Generic.Files.LineLength
+ // phpcs:disable Generic.Files.LineLength
return [
[
'foo bar <a href="/wiki/Special:BlankPage" title="Special:BlankPage">Special:BlankPage</a>',
'enwiki',
],
];
- // @codingStandardsIgnoreEnd
+ // phpcs:enable
}
public static function provideLinkBeginHook() {
- // @codingStandardsIgnoreStart Generic.Files.LineLength
+ // phpcs:disable Generic.Files.LineLength
return [
// Modify $html
[
- function( $dummy, $title, &$html, &$attribs, &$query, &$options, &$ret ) {
+ function ( $dummy, $title, &$html, &$attribs, &$query, &$options, &$ret ) {
$html = 'foobar';
},
'<a href="/wiki/Special:BlankPage" title="Special:BlankPage">foobar</a>'
],
// Modify $attribs
[
- function( $dummy, $title, &$html, &$attribs, &$query, &$options, &$ret ) {
+ function ( $dummy, $title, &$html, &$attribs, &$query, &$options, &$ret ) {
$attribs['bar'] = 'baz';
},
'<a href="/wiki/Special:BlankPage" title="Special:BlankPage" bar="baz">Special:BlankPage</a>'
],
// Modify $query
[
- function( $dummy, $title, &$html, &$attribs, &$query, &$options, &$ret ) {
+ function ( $dummy, $title, &$html, &$attribs, &$query, &$options, &$ret ) {
$query['bar'] = 'baz';
},
'<a href="/w/index.php?title=Special:BlankPage&bar=baz" title="Special:BlankPage">Special:BlankPage</a>'
],
// Force HTTP $options
[
- function( $dummy, $title, &$html, &$attribs, &$query, &$options, &$ret ) {
+ function ( $dummy, $title, &$html, &$attribs, &$query, &$options, &$ret ) {
$options = [ 'http' ];
},
'<a href="http://example.org/wiki/Special:BlankPage" title="Special:BlankPage">Special:BlankPage</a>'
],
// Force 'forcearticlepath' in $options
[
- function( $dummy, $title, &$html, &$attribs, &$query, &$options, &$ret ) {
+ function ( $dummy, $title, &$html, &$attribs, &$query, &$options, &$ret ) {
$options = [ 'forcearticlepath' ];
$query['foo'] = 'bar';
},
],
// Abort early
[
- function( $dummy, $title, &$html, &$attribs, &$query, &$options, &$ret ) {
+ function ( $dummy, $title, &$html, &$attribs, &$query, &$options, &$ret ) {
$ret = 'foobar';
return false;
},
'foobar'
],
];
- // @codingStandardsIgnoreEnd
+ // phpcs:enable
}
/**
}
public static function provideMakeResourceLoaderLink() {
- // @codingStandardsIgnoreStart Generic.Files.LineLength
+ // phpcs:disable Generic.Files.LineLength
return [
// Single only=scripts load
[
. "});</script>"
],
];
- // @codingStandardsIgnoreEnd
+ // phpcs:enable
}
/**
}
public static function provideBuildExemptModules() {
+ // phpcs:disable Generic.Files.LineLength
return [
'empty' => [
'exemptStyleModules' => [],
'exemptStyleModules' => [ 'site' => [], 'noscript' => [], 'private' => [], 'user' => [] ],
'<meta name="ResourceLoaderDynamicStyles" content=""/>',
],
- // @codingStandardsIgnoreStart Generic.Files.LineLength
'default logged-out' => [
'exemptStyleModules' => [ 'site' => [ 'site.styles' ] ],
'<meta name="ResourceLoaderDynamicStyles" content=""/>' . "\n" .
'<link rel="stylesheet" href="/w/load.php?debug=false&lang=en&modules=example.user&only=styles&skin=fallback&version=0a56zyi"/>' . "\n" .
'<link rel="stylesheet" href="/w/load.php?debug=false&lang=en&modules=user.styles&only=styles&skin=fallback&version=1e9z0ox"/>',
],
- // @codingStandardsIgnoreEnd Generic.Files.LineLength
];
+ // phpcs:enable
}
/**
* Ensure the router doesn't choke on long paths.
*/
public function testLength() {
- // @codingStandardsIgnoreStart Ignore long line warnings
+ // phpcs:disable Generic.Files.LineLength
$matches = $this->basicRouter->parse(
"/wiki/Lorem_ipsum_dolor_sit_amet,_consectetur_adipisicing_elit,_sed_do_eiusmod_tempor_incididunt_ut_labore_et_dolore_magna_aliqua._Ut_enim_ad_minim_veniam,_quis_nostrud_exercitation_ullamco_laboris_nisi_ut_aliquip_ex_ea_commodo_consequat._Duis_aute_irure_dolor_in_reprehenderit_in_voluptate_velit_esse_cillum_dolore_eu_fugiat_nulla_pariatur._Excepteur_sint_occaecat_cupidatat_non_proident,_sunt_in_culpa_qui_officia_deserunt_mollit_anim_id_est_laborum."
);
$matches,
[ 'title' => "Lorem_ipsum_dolor_sit_amet,_consectetur_adipisicing_elit,_sed_do_eiusmod_tempor_incididunt_ut_labore_et_dolore_magna_aliqua._Ut_enim_ad_minim_veniam,_quis_nostrud_exercitation_ullamco_laboris_nisi_ut_aliquip_ex_ea_commodo_consequat._Duis_aute_irure_dolor_in_reprehenderit_in_voluptate_velit_esse_cillum_dolore_eu_fugiat_nulla_pariatur._Excepteur_sint_occaecat_cupidatat_non_proident,_sunt_in_culpa_qui_officia_deserunt_mollit_anim_id_est_laborum." ]
);
- // @codingStandardsIgnoreEnd
+ // phpcs:enable
}
/**
];
}
- // @codingStandardsIgnoreStart Generic.Files.LineLength
/**
+ * phpcs:disable Generic.Files.LineLength
* @dataProvider provideTitles
* See https://phpunit.de/manual/3.7/en/appendixes.annotations.html#appendixes.annotations.dataProvider
+ * phpcs:enable
*/
- // @codingStandardsIgnoreEnd
public function testCreateBasicListOfTitles( $titleName, $ns, $text ) {
$title = Title::newFromText( $titleName, $ns );
$this->assertEquals( $text, "$title", "see if '$titleName' matches '$text'" );
$this->assertTrue( $title->isLocal() );
}
- // @codingStandardsIgnoreStart Generic.Files.LineLength
/**
* @expectedException InvalidArgumentException
* See https://phpunit.de/manual/3.7/en/appendixes.annotations.html#appendixes.annotations.expectedException
*/
- // @codingStandardsIgnoreEnd
public function testTitleObjectFromObject() {
$title = Title::newFromText( Title::newFromText( "test" ) );
$this->assertEquals( "Test", $title->isLocal() );
}
public static function provideDiff() {
+ // phpcs:disable Generic.Files.LineLength.TooLong
return [
- // @codingStandardsIgnoreStart Ignore Generic.Files.LineLength.TooLong
'Basic diff, titles' => [
[
'fromtitle' => 'ApiComparePagesTest A',
[],
'missingcontent'
],
-
- // @codingStandardsIgnoreEnd
];
+ // phpcs:enable
}
}
}
public static function provideGeneralEncoding() {
- // @codingStandardsIgnoreStart Generic.Files.LineLength
+ // phpcs:disable Generic.Files.LineLength
return array_merge(
self::addFormatVersion( 1, [
// Basic types
'a:1:{s:3:"foo";s:3:"foo";}' ],
] )
);
- // @codingStandardsIgnoreEnd
+ // phpcs:enable
}
public function testCrossDomainMangling() {
public static function setUpBeforeClass() {
parent::setUpBeforeClass();
$page = WikiPage::factory( Title::newFromText( 'MediaWiki:ApiFormatXmlTest.xsl' ) );
- // @codingStandardsIgnoreStart Generic.Files.LineLength
+ // phpcs:disable Generic.Files.LineLength
$page->doEditContent( new WikitextContent(
'<?xml version="1.0"?><xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" />'
), 'Summary' );
- // @codingStandardsIgnoreEnd
+ // phpcs:enable
$page = WikiPage::factory( Title::newFromText( 'MediaWiki:ApiFormatXmlTest' ) );
$page->doEditContent( new WikitextContent( 'Bogus' ), 'Summary' );
$page = WikiPage::factory( Title::newFromText( 'ApiFormatXmlTest' ) );
}
public static function provideGeneralEncoding() {
- // @codingStandardsIgnoreStart Generic.Files.LineLength
+ // phpcs:disable Generic.Files.LineLength
return [
// Basic types
[ [ null, 'a' => null ], '<?xml version="1.0"?><api><_v _idx="0" /></api>' ],
'" type="text/xsl" ?><api />',
[ 'xslt' => 'MediaWiki:ApiFormatXmlTest.xsl' ] ],
];
- // @codingStandardsIgnoreEnd
+ // phpcs:enable
}
}
* @covers ChangesListFilterGroup
*/
class ChangesListFilterGroupTest extends MediaWikiTestCase {
- // @codingStandardsIgnoreStart
/**
+ * phpcs:disable Generic.Files.LineLength
* @expectedException MWException
* @expectedExceptionMessage Group names may not contain '_'. Use the naming convention: 'camelCase'
+ * phpcs:enable
*/
- // @codingStandardsIgnoreEnd
public function testReservedCharacter() {
new MockChangesListFilterGroup(
[
);
}
- // @codingStandardsIgnoreStart
/**
+ * phpcs:disable Generic.Files.LineLength
* @expectedException MWException
* @expectedExceptionMessage Filter names may not contain '_'. Use the naming convention: 'lowercase'
+ * phpcs:enable
*/
- // @codingStandardsIgnoreEnd
public function testReservedCharacter() {
$filter = new MockChangesListFilter(
[
);
}
- // @codingStandardsIgnoreStart
/**
* @expectedException MWException
* @expectedExceptionMessage Two filters in a group cannot have the same name: 'somename'
*/
- // @codingStandardsIgnoreEnd
public function testDuplicateName() {
new MockChangesListFilter(
[
* Keep this in sync with CssContentTest::provideGetRedirectTarget()
*/
public static function provideMakeRedirectContent() {
- // @codingStandardsIgnoreStart Generic.Files.LineLength
+ // phpcs:disable Generic.Files.LineLength
return [
[
'MediaWiki:MonoBook.css',
"/* #REDIRECT */@import url(//example.org/w/index.php?title=Gadget:FooBaz.css&action=raw&ctype=text/css);"
],
];
- // @codingStandardsIgnoreEnd
+ // phpcs:enable
}
}
* Keep this in sync with CssContentHandlerTest::provideMakeRedirectContent()
*/
public static function provideGetRedirectTarget() {
- // @codingStandardsIgnoreStart Generic.Files.LineLength
+ // phpcs:disable Generic.Files.LineLength
return [
[ 'MediaWiki:MonoBook.css', "/* #REDIRECT */@import url(//example.org/w/index.php?title=MediaWiki:MonoBook.css&action=raw&ctype=text/css);" ],
[ 'User:FooBar/common.css', "/* #REDIRECT */@import url(//example.org/w/index.php?title=User:FooBar/common.css&action=raw&ctype=text/css);" ],
# Wrong domain
[ null, "/* #REDIRECT */@import url(//example.com/w/index.php?title=Gadget:FooBaz.css&action=raw&ctype=text/css);" ],
];
- // @codingStandardsIgnoreEnd
+ // phpcs:enable
}
public static function dataEquals() {
* Keep this in sync with JavaScriptContentTest::provideGetRedirectTarget()
*/
public static function provideMakeRedirectContent() {
- // @codingStandardsIgnoreStart Generic.Files.LineLength
+ // phpcs:disable Generic.Files.LineLength
return [
[
'MediaWiki:MonoBook.js',
'/* #REDIRECT */mw.loader.load("//example.org/w/index.php?title=Gadget:FooBaz.js\u0026action=raw\u0026ctype=text/javascript");'
],
];
- // @codingStandardsIgnoreEnd
+ // phpcs:enable
}
}
}
public static function provideUpdateRedirect() {
+ // phpcs:disable Generic.Files.LineLength
return [
[
'#REDIRECT [[Someplace]]',
'#REDIRECT [[Someplace]]',
],
-
- // @codingStandardsIgnoreStart Generic.Files.LineLength
[
'/* #REDIRECT */mw.loader.load("//example.org/w/index.php?title=MediaWiki:MonoBook.js\u0026action=raw\u0026ctype=text/javascript");',
'/* #REDIRECT */mw.loader.load("//example.org/w/index.php?title=TestUpdateRedirect_target\u0026action=raw\u0026ctype=text/javascript");'
]
- // @codingStandardsIgnoreEnd
];
+ // phpcs:enable
}
/**
* Keep this in sync with JavaScriptContentHandlerTest::provideMakeRedirectContent()
*/
public static function provideGetRedirectTarget() {
- // @codingStandardsIgnoreStart Generic.Files.LineLength
+ // phpcs:disable Generic.Files.LineLength
return [
[
'MediaWiki:MonoBook.js',
'/* #REDIRECT */mw.loader.load("//example.com/w/index.php?title=MediaWiki:OtherWiki.js\u0026action=raw\u0026ctype=text/javascript");'
],
];
- // @codingStandardsIgnoreEnd
+ // phpcs:enable
}
}
}
public function getUnknownTagsXML() {
- // @codingStandardsIgnoreStart Generic.Files.LineLength
+ // phpcs:disable Generic.Files.LineLength
return [
[
<<< EOF
'TestImportPage'
]
];
- // @codingStandardsIgnoreEnd
+ // phpcs:enable
}
/**
}
public function getRedirectXML() {
- // @codingStandardsIgnoreStart Generic.Files.LineLength
+ // phpcs:disable Generic.Files.LineLength
return [
[
<<< EOF
null
],
];
- // @codingStandardsIgnoreEnd
+ // phpcs:enable
}
/**
}
public function getSiteInfoXML() {
- // @codingStandardsIgnoreStart Generic.Files.LineLength
+ // phpcs:disable Generic.Files.LineLength
return [
[
<<< EOF
]
],
];
- // @codingStandardsIgnoreEnd
+ // phpcs:enable
}
/**
$n = ( $assign ? 1 : 0 ) + ( $create ? 2 : 0 );
- // @codingStandardsIgnoreStart Generic.Files.LineLength
+ // phpcs:disable Generic.Files.LineLength
$source = $this->getDataSource( <<<EOF
<mediawiki xmlns="http://www.mediawiki.org/xml/export-0.10/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.mediawiki.org/xml/export-0.10/ http://www.mediawiki.org/xml/export-0.10.xsd" version="0.10" xml:lang="en">
<page>
</mediawiki>
EOF
);
- // @codingStandardsIgnoreEnd
+ // phpcs:enable
$importer = new WikiImporter( $source, MediaWikiServices::getInstance()->getMainConfig() );
$importer->setUsernamePrefix( 'Xxx', $assign );
. '%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 width=%228%22 height='
. '%228%22%3E%0A%09%3Ccircle cx=%224%22 cy=%224%22 r=%222%22/%3E%0A%3C/svg%3E%0A';
- // @codingStandardsIgnoreStart Generic.Files.LineLength
+ // phpcs:disable Generic.Files.LineLength
return [
[
'Regular file',
'.ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default { border: 1px solid #d3d3d3/*{borderColorDefault}*/; background: #e6e6e6/*{bgColorDefault}*/ url(http://localhost/w/images/ui-bg_glass_75_e6e6e6_1x400.png)/*{bgImgUrlDefault}*/ 50%/*{bgDefaultXPos}*/ 50%/*{bgDefaultYPos}*/ repeat-x/*{bgDefaultRepeat}*/; font-weight: normal/*{fwDefault}*/; color: #555555/*{fcDefault}*/; }',
],
];
- // @codingStandardsIgnoreEnd
+ // phpcs:enable
}
/**
const WELL_FORMED_XML = "<root><child /></root>";
const MAL_FORMED_XML = "<root><child /></error>";
- // @codingStandardsIgnoreStart Generic.Files.LineLength
+ // phpcs:ignore Generic.Files.LineLength
const XML_WITH_PIH = '<?xml version="1.0"?><?xml-stylesheet type="text/xsl" href="/w/index.php"?><svg><child /></svg>';
- // @codingStandardsIgnoreEnd
/**
* @covers XMLTypeCheck::newFromString
}
public static function provideUnionConditionPermutations() {
+ // phpcs:disable Generic.Files.LineLength
return [
- // @codingStandardsIgnoreStart Generic.Files.LineLength.TooLong
[
[
'table' => [ 'table1', 'table2' ],
],
"SELECT foo_id FROM foo WHERE baz IS NULL ORDER BY foo_id LIMIT 150,25"
],
- // @codingStandardsIgnoreEnd
];
+ // phpcs:enable
}
/**
* @covers ExifBitmapHandler::isMetadataValid
*/
public function testGoodMetadata() {
- // @codingStandardsIgnoreStart Ignore Generic.Files.LineLength.TooLong
+ // phpcs:ignore Generic.Files.LineLength
$meta = 'a:16:{s:10:"ImageWidth";i:20;s:11:"ImageLength";i:20;s:13:"BitsPerSample";a:3:{i:0;i:8;i:1;i:8;i:2;i:8;}s:11:"Compression";i:5;s:25:"PhotometricInterpretation";i:2;s:16:"ImageDescription";s:17:"Created with GIMP";s:12:"StripOffsets";i:8;s:11:"Orientation";i:1;s:15:"SamplesPerPixel";i:3;s:12:"RowsPerStrip";i:64;s:15:"StripByteCounts";i:238;s:11:"XResolution";s:19:"1207959552/16777216";s:11:"YResolution";s:19:"1207959552/16777216";s:19:"PlanarConfiguration";i:1;s:14:"ResolutionUnit";i:2;s:22:"MEDIAWIKI_EXIF_VERSION";i:2;}';
- // @codingStandardsIgnoreEnd
$res = $this->handler->isMetadataValid( null, $meta );
$this->assertEquals( ExifBitmapHandler::METADATA_GOOD, $res );
}
* @covers ExifBitmapHandler::isMetadataValid
*/
public function testIsOldGood() {
- // @codingStandardsIgnoreStart Ignore Generic.Files.LineLength.TooLong
+ // phpcs:ignore Generic.Files.LineLength
$meta = 'a:16:{s:10:"ImageWidth";i:20;s:11:"ImageLength";i:20;s:13:"BitsPerSample";a:3:{i:0;i:8;i:1;i:8;i:2;i:8;}s:11:"Compression";i:5;s:25:"PhotometricInterpretation";i:2;s:16:"ImageDescription";s:17:"Created with GIMP";s:12:"StripOffsets";i:8;s:11:"Orientation";i:1;s:15:"SamplesPerPixel";i:3;s:12:"RowsPerStrip";i:64;s:15:"StripByteCounts";i:238;s:11:"XResolution";s:19:"1207959552/16777216";s:11:"YResolution";s:19:"1207959552/16777216";s:19:"PlanarConfiguration";i:1;s:14:"ResolutionUnit";i:2;s:22:"MEDIAWIKI_EXIF_VERSION";i:1;}';
- // @codingStandardsIgnoreEnd
$res = $this->handler->isMetadataValid( null, $meta );
$this->assertEquals( ExifBitmapHandler::METADATA_COMPATIBLE, $res );
}
* @covers ExifBitmapHandler::isMetadataValid
*/
public function testPagedTiffHandledGracefully() {
- // @codingStandardsIgnoreStart Ignore Generic.Files.LineLength.TooLong
+ // phpcs:ignore Generic.Files.LineLength
$meta = 'a:6:{s:9:"page_data";a:1:{i:1;a:5:{s:5:"width";i:643;s:6:"height";i:448;s:5:"alpha";s:4:"true";s:4:"page";i:1;s:6:"pixels";i:288064;}}s:10:"page_count";i:1;s:10:"first_page";i:1;s:9:"last_page";i:1;s:4:"exif";a:9:{s:10:"ImageWidth";i:643;s:11:"ImageLength";i:448;s:11:"Compression";i:5;s:25:"PhotometricInterpretation";i:2;s:11:"Orientation";i:1;s:15:"SamplesPerPixel";i:4;s:12:"RowsPerStrip";i:50;s:19:"PlanarConfiguration";i:1;s:22:"MEDIAWIKI_EXIF_VERSION";i:1;}s:21:"TIFF_METADATA_VERSION";s:3:"1.4";}';
- // @codingStandardsIgnoreEnd
$res = $this->handler->isMetadataValid( null, $meta );
$this->assertEquals( ExifBitmapHandler::METADATA_BAD, $res );
}
}
public static function provideIsMetadataValid() {
+ // phpcs:disable Generic.Files.LineLength
return [
[ GIFHandler::BROKEN_FILE, GIFHandler::METADATA_GOOD ],
[ '', GIFHandler::METADATA_BAD ],
[ null, GIFHandler::METADATA_BAD ],
[ 'Something invalid!', GIFHandler::METADATA_BAD ],
- // @codingStandardsIgnoreStart Ignore Generic.Files.LineLength.TooLong
[
'a:4:{s:10:"frameCount";i:1;s:6:"looped";b:0;s:8:"duration";d:0.1000000000000000055511151231257827021181583404541015625;s:8:"metadata";a:2:{s:14:"GIFFileComment";a:1:{i:0;s:35:"GIF test file ⁕ Created with GIMP";}s:15:"_MW_GIF_VERSION";i:1;}}',
GIFHandler::METADATA_GOOD
],
- // @codingStandardsIgnoreEnd
];
+ // phpcs:enable
}
/**
}
public static function provideGetMetadata() {
+ // phpcs:disable Generic.Files.LineLength
return [
- // @codingStandardsIgnoreStart Ignore Generic.Files.LineLength.TooLong
[
'nonanimated.gif',
'a:4:{s:10:"frameCount";i:1;s:6:"looped";b:0;s:8:"duration";d:0.1000000000000000055511151231257827021181583404541015625;s:8:"metadata";a:2:{s:14:"GIFFileComment";a:1:{i:0;s:35:"GIF test file ⁕ Created with GIMP";}s:15:"_MW_GIF_VERSION";i:1;}}'
'animated-xmp.gif',
'a:4:{s:10:"frameCount";i:4;s:6:"looped";b:1;s:8:"duration";d:2.399999999999999911182158029987476766109466552734375;s:8:"metadata";a:5:{s:6:"Artist";s:7:"Bawolff";s:16:"ImageDescription";a:2:{s:9:"x-default";s:18:"A file to test GIF";s:5:"_type";s:4:"lang";}s:15:"SublocationDest";s:13:"The interwebs";s:14:"GIFFileComment";a:1:{i:0;s:16:"GIƒ·test·file";}s:15:"_MW_GIF_VERSION";i:1;}}'
],
- // @codingStandardsIgnoreEnd
];
+ // phpcs:enable
}
/**
public function testJpegMetadataExtraction() {
$file = $this->dataFile( 'test.jpg', 'image/jpeg' );
$res = $this->handler->getMetadata( $file, $this->filePath . 'test.jpg' );
- // @codingStandardsIgnoreStart Ignore Generic.Files.LineLength.TooLong
+ // phpcs:ignore Generic.Files.LineLength
$expected = 'a:7:{s:16:"ImageDescription";s:9:"Test file";s:11:"XResolution";s:4:"72/1";s:11:"YResolution";s:4:"72/1";s:14:"ResolutionUnit";i:2;s:16:"YCbCrPositioning";i:1;s:15:"JPEGFileComment";a:1:{i:0;s:17:"Created with GIMP";}s:22:"MEDIAWIKI_EXIF_VERSION";i:2;}';
- // @codingStandardsIgnoreEnd
// Unserialize in case serialization format ever changes.
$this->assertEquals( unserialize( $expected ), unserialize( $res ) );
}
public static function provideIsMetadataValid() {
+ // phpcs:disable Generic.Files.LineLength
return [
[ PNGHandler::BROKEN_FILE, PNGHandler::METADATA_GOOD ],
[ '', PNGHandler::METADATA_BAD ],
[ null, PNGHandler::METADATA_BAD ],
[ 'Something invalid!', PNGHandler::METADATA_BAD ],
- // @codingStandardsIgnoreStart Ignore Generic.Files.LineLength.TooLong
[
'a:6:{s:10:"frameCount";i:0;s:9:"loopCount";i:1;s:8:"duration";d:0;s:8:"bitDepth";i:8;s:9:"colorType";s:10:"truecolour";s:8:"metadata";a:1:{s:15:"_MW_PNG_VERSION";i:1;}}',
PNGHandler::METADATA_GOOD
],
- // @codingStandardsIgnoreEnd
];
+ // phpcs:enable
}
/**
}
public static function provideGetMetadata() {
+ // phpcs:disable Generic.Files.LineLength
return [
- // @codingStandardsIgnoreStart Ignore Generic.Files.LineLength.TooLong
[
'rgb-na-png.png',
'a:6:{s:10:"frameCount";i:0;s:9:"loopCount";i:1;s:8:"duration";d:0;s:8:"bitDepth";i:8;s:9:"colorType";s:10:"truecolour";s:8:"metadata";a:1:{s:15:"_MW_PNG_VERSION";i:1;}}'
'xmp.png',
'a:6:{s:10:"frameCount";i:0;s:9:"loopCount";i:1;s:8:"duration";d:0;s:8:"bitDepth";i:1;s:9:"colorType";s:14:"index-coloured";s:8:"metadata";a:2:{s:12:"SerialNumber";s:9:"123456789";s:15:"_MW_PNG_VERSION";i:1;}}'
],
- // @codingStandardsIgnoreEnd
];
+ // phpcs:enable
}
/**
public static function provideSvgFilesWithXMLMetadata() {
$base = __DIR__ . '/../../data/media';
- // @codingStandardsIgnoreStart Ignore Generic.Files.LineLength.TooLong
+ // phpcs:disable Generic.Files.LineLength
$metadata = '<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<ns4:Work xmlns:ns4="http://creativecommons.org/ns#" rdf:about="">
<ns5:format xmlns:ns5="http://purl.org/dc/elements/1.1/">image/svg+xml</ns5:format>
<ns5:type xmlns:ns5="http://purl.org/dc/elements/1.1/" rdf:resource="http://purl.org/dc/dcmitype/StillImage"/>
</ns4:Work>
</rdf:RDF>';
- // @codingStandardsIgnoreEnd
+ // phpcs:enable
$metadata = str_replace( "\r", '', $metadata ); // Windows compat
return [
public function testTiffMetadataExtraction() {
$res = $this->handler->getMetadata( null, $this->filePath . 'test.tiff' );
- // @codingStandardsIgnoreStart Ignore Generic.Files.LineLength.TooLong
+ // phpcs:ignore Generic.Files.LineLength
$expected = 'a:16:{s:10:"ImageWidth";i:20;s:11:"ImageLength";i:20;s:13:"BitsPerSample";a:3:{i:0;i:8;i:1;i:8;i:2;i:8;}s:11:"Compression";i:5;s:25:"PhotometricInterpretation";i:2;s:16:"ImageDescription";s:17:"Created with GIMP";s:12:"StripOffsets";i:8;s:11:"Orientation";i:1;s:15:"SamplesPerPixel";i:3;s:12:"RowsPerStrip";i:64;s:15:"StripByteCounts";i:238;s:11:"XResolution";s:19:"1207959552/16777216";s:11:"YResolution";s:19:"1207959552/16777216";s:19:"PlanarConfiguration";i:1;s:14:"ResolutionUnit";i:2;s:22:"MEDIAWIKI_EXIF_VERSION";i:2;}';
- // @codingStandardsIgnoreEnd
// Re-unserialize in case there are subtle differences between how versions
// of php serialize stuff.
$this->assertEquals( $expectedResult, WebPHandler::extractMetadata( $this->tempFileName ) );
}
public function provideTestExtractMetaData() {
- // @codingStandardsIgnoreStart Generic.Files.LineLength
+ // phpcs:disable Generic.Files.LineLength
return [
// Files from https://developers.google.com/speed/webp/gallery2
[ "\x52\x49\x46\x46\x90\x68\x01\x00\x57\x45\x42\x50\x56\x50\x38\x4C\x83\x68\x01\x00\x2F\x8F\x01\x4B\x10\x8D\x38\x6C\xDB\x46\x92\xE0\xE0\x82\x7B\x6C",
[ 'RIFF1234WEBPVP8 ', false ],
[ 'RIFF1234WEBPVP8L ', false ],
];
- // @codingStandardsIgnoreEnd
+ // phpcs:enable
}
/**
}
public function provideTestInsertProtectNullRevision() {
- // @codingStandardsIgnoreStart Generic.Files.LineLength
+ // phpcs:disable Generic.Files.LineLength
yield [
'goat-message-key',
[ 'edit' => 'sysop' ],
true,
'(goat-key: WikiPageDbTestBase::testInsertProtectNullRevision, UTSysop)(colon-separator)Goat Goat(word-separator)(parentheses: (protect-summary-desc: (restriction-edit), (protect-level-sysop), (protect-expiring: 04:04, 1 (january) 2020, 1 (january) 2020, 04:04))(word-separator)(protect-summary-desc: (restriction-move), (protect-level-something), (protect-expiring: 05:05, 1 (january) 2021, 1 (january) 2021, 05:05)))'
];
- // @codingStandardsIgnoreEnd Generic.Files.LineLength
+ // phpcs:enable
}
/**
}
public static function provideGetText() {
- // @codingStandardsIgnoreStart Generic.Files.LineLength
+ // phpcs:disable Generic.Files.LineLength
$text = <<<EOF
<p>Test document.
</p>
EOF
],
];
- // @codingStandardsIgnoreEnd
+ // phpcs:enable
}
}
}
public static function provideCases() {
- // @codingStandardsIgnoreStart Ignore Generic.Files.LineLength.TooLong
+ // phpcs:disable Generic.Files.LineLength
return self::addClassArg( [
[ "Foo", "<root>Foo</root>" ],
[ "<!-- Foo -->", "<root><comment><!-- Foo --></comment></root>" ],
[ "{{Foo|} Bar=}}", "<root><template><title>Foo</title><part><name>} Bar</name>=<value></value></part></template></root>" ],
/* [ file_get_contents( __DIR__ . '/QuoteQuran.txt' ], file_get_contents( __DIR__ . '/QuoteQuranExpanded.txt' ) ], */
] );
- // @codingStandardsIgnoreEnd
+ // phpcs:enable
}
/**
* These are more complex test cases taken out of wiki articles.
*/
public static function provideFiles() {
- // @codingStandardsIgnoreStart Ignore Generic.Files.LineLength.TooLong
+ // phpcs:disable Generic.Files.LineLength
return self::addClassArg( [
[ "QuoteQuran" ], # https://en.wikipedia.org/w/index.php?title=Template:QuoteQuran/sandbox&oldid=237348988 GFDL + CC BY-SA by Striver
[ "Factorial" ], # https://en.wikipedia.org/w/index.php?title=Template:Factorial&oldid=98548758 GFDL + CC BY-SA by Polonium
[ "Fundraising" ], # https://tl.wiktionary.org/w/index.php?title=MediaWiki:Sitenotice&oldid=5716 GFDL + CC BY-SA, copied there by Sky Harbor.
[ "NestedTemplates" ], # T29936
] );
- // @codingStandardsIgnoreEnd
+ // phpcs:enable
}
/**
* Tests from T30642 · https://phabricator.wikimedia.org/T30642
*/
public static function provideHeadings() {
- // @codingStandardsIgnoreStart Ignore Generic.Files.LineLength.TooLong
+ // phpcs:disable Generic.Files.LineLength
return self::addClassArg( [
/* These should become headings: */
[ "== h ==<!--c1-->", "<root><h level=\"2\" i=\"1\">== h ==<comment><!--c1--></comment></h></root>" ],
[ "== h ==<!--c1--> x <!--c2--><!--c3--> ", "<root>== h ==<comment><!--c1--></comment> x <comment><!--c2--></comment><comment><!--c3--></comment> </root>" ],
[ "== h ==<!--c1--><!--c2--><!--c3--> x ", "<root>== h ==<comment><!--c1--></comment><comment><!--c2--></comment><comment><!--c3--></comment> x </root>" ],
] );
- // @codingStandardsIgnoreEnd
+ // phpcs:enable
}
/**
}
public static function providePasswordTests() {
- // @codingStandardsIgnoreStart Generic.Files.LineLength
+ // phpcs:disable Generic.Files.LineLength
return [
// Tests from glibc bcrypt implementation
[ true, ':bcrypt:5$CCCCCCCCCCCCCCCCCCCCC.$E5YPO9kmyuRGyh0XouQYb4YMJKvyOeW', "U*U" ],
[ false, ':bcrypt:5$CCCCCCCCCCCCCCCCCCCCC.$E5YPO9kmyuRGyh0XouQYb4YMJKvyOeW', "UXU" ],
[ false, ':bcrypt:5$CCCCCCCCCCCCCCCCCCCCC.$E5YPO9kmyuRGyh0XouQYb4YMJKvyOeW', "" ],
];
- // @codingStandardsIgnoreEnd
+ // phpcs:enable
}
}
* @covers EncryptedPassword
* @covers ParameterizedPassword
* @covers Password
- * @codingStandardsIgnoreStart Generic.Files.LineLength
*/
class EncryptedPasswordTest extends PasswordTestCase {
protected function getTypeConfigs() {
}
public static function providePasswordTests() {
+ // phpcs:disable Generic.Files.LineLength
return [
// Encrypted with secret1
[ true, ':both:aes-256-cbc:0:izBpxujqC1YbzpCB3qAzgg==:ZqHnitT1pL4YJqKqFES2KEevZYSy2LtlibW5+IMi4XKOGKGy6sE638BXyBbLQQsBtTSrt+JyzwOayKtwIfRbaQsBridx/O1JwBSai1TkGkOsYMBXnlu2Bu/EquCBj5QpjYh7p3Uq4rpiop1KQlin1BJMwnAa1PovhxjpxnYhlhkM4X5ALoGi3XM0bapN48vt', 'password' ],
[ true, ':both:aes-256-cbc:1:m1LCnQVIakfYBNlr9KEgQg==:5yPTctqrzsybdgaMEag18AZYbnL37pAtXVBqmWxkjXbnNmiDH+1bHoL8lsEVTH/sJntC82kNVgE7zeiD8xUVLYF2VUnvB5+sU+aysE45/zwsCu7a22TaischMAOWrsHZ/tIgS/TnZY2d+HNyxgsEeeYf/QoL+FhmqHquK02+4SRbA5lLuj9niYy1r5CoM9cQ', 'password' ],
[ true, ':secret2:aes-256-cbc:0:m1LCnQVIakfYBNlr9KEgQg==:5yPTctqrzsybdgaMEag18AZYbnL37pAtXVBqmWxkjXbnNmiDH+1bHoL8lsEVTH/sJntC82kNVgE7zeiD8xUVLYF2VUnvB5+sU+aysE45/zwsCu7a22TaischMAOWrsHZ/tIgS/TnZY2d+HNyxgsEeeYf/QoL+FhmqHquK02+4SRbA5lLuj9niYy1r5CoM9cQ', 'password' ],
];
+ // phpcs:enable
}
/**
* @expectedException PasswordError
*/
public function testDecryptionError() {
+ // phpcs:ignore Generic.Files.LineLength
$hash = ':secret1:aes-256-cbc:0:m1LCnQVIakfYBNlr9KEgQg==:5yPTctqrzsybdgaMEag18AZYbnL37pAtXVBqmWxkjXbnNmiDH+1bHoL8lsEVTH/sJntC82kNVgE7zeiD8xUVLYF2VUnvB5+sU+aysE45/zwsCu7a22TaischMAOWrsHZ/tIgS/TnZY2d+HNyxgsEeeYf/QoL+FhmqHquK02+4SRbA5lLuj9niYy1r5CoM9cQ';
$password = $this->passwordFactory->newFromCiphertext( $hash );
$password->crypt( 'password' );
}
public function testUpdate() {
+ // phpcs:ignore Generic.Files.LineLength
$hash = ':both:aes-256-cbc:0:izBpxujqC1YbzpCB3qAzgg==:ZqHnitT1pL4YJqKqFES2KEevZYSy2LtlibW5+IMi4XKOGKGy6sE638BXyBbLQQsBtTSrt+JyzwOayKtwIfRbaQsBridx/O1JwBSai1TkGkOsYMBXnlu2Bu/EquCBj5QpjYh7p3Uq4rpiop1KQlin1BJMwnAa1PovhxjpxnYhlhkM4X5ALoGi3XM0bapN48vt';
$fromHash = $this->passwordFactory->newFromCiphertext( $hash );
$fromPlaintext = $this->passwordFactory->newFromPlaintext( 'password', $fromHash );
}
public static function providePasswordTests() {
- // @codingStandardsIgnoreStart Generic.Files.LineLength.TooLong
+ // phpcs:disable Generic.Files.LineLength
return [
[
true,
':testLargeLayeredTop:sha512:1024:512!sha512:1024:512!sha512:1024:512!sha512:1024:512!5!vnRy+2SrSA0fHt3dwhTP5g==!AVnwfZsAQjn+gULv7FSGjA==!xvHUX3WcpkeSn1lvjWcvBg==!It+OC/N9tu+d3ByHhuB0BQ==!Tb.gqUOiD.aWktVwHM.Q/O!7CcyMfXUPky5ptyATJsR2nq3vUqtnBC',
- 'testPassword123'
+ 'testPassword123'
],
];
- // @codingStandardsIgnoreEnd
+ // phpcs:enable
}
/**
'test.exempt' => 'ready',
] );
- // @codingStandardsIgnoreStart Generic.Files.LineLength
+ // phpcs:disable Generic.Files.LineLength
$expected = '<script>document.documentElement.className = document.documentElement.className.replace( /(^|\s)client-nojs(\s|$)/, "$1client-js$2" );</script>' . "\n"
. '<script>(window.RLQ=window.RLQ||[]).push(function(){'
. 'mw.config.set({"key":"value"});'
. '<link rel="stylesheet" href="/w/load.php?debug=false&lang=nl&modules=test.styles.pure&only=styles&skin=fallback"/>' . "\n"
. '<style>.private{}</style>' . "\n"
. '<script async="" src="/w/load.php?debug=false&lang=nl&modules=startup&only=scripts&skin=fallback"></script>';
- // @codingStandardsIgnoreEnd
+ // phpcs:enable
$expected = self::expandVariables( $expected );
$this->assertEquals( $expected, $client->getHeadHtml() );
}
public static function provideMakeLoad() {
+ // phpcs:disable Generic.Files.LineLength
return [
- // @codingStandardsIgnoreStart Generic.Files.LineLength
[
'context' => [],
'modules' => [ 'test.unknown' ],
. '<style>.orderingC{}.orderingD{}</style>' . "\n"
. '<link rel="stylesheet" href="/w/load.php?debug=false&lang=nl&modules=test.ordering.e&only=styles&skin=fallback"/>'
],
- // @codingStandardsIgnoreEnd
];
+ // phpcs:enable
}
/**
use MediaWikiCoversValidator;
- // @codingStandardsIgnoreStart Ignore Generic.Files.LineLength.TooLong
public static function provideGetStyles() {
+ // phpcs:disable Generic.Files.LineLength
return [
[
'parent' => [],
],
],
];
+ // phpcs:enable
}
- // @codingStandardsIgnoreEnd
/**
* @dataProvider provideGetStyles
public function provideBuildFinalCommand() {
global $IP;
- // @codingStandardsIgnoreStart
+ // phpcs:ignore Generic.Files.LineLength
$env = "'MW_INCLUDE_STDERR=;MW_CPU_LIMIT=180; MW_CGROUP='\'''\''; MW_MEM_LIMIT=307200; MW_FILE_SIZE_LIMIT=102400; MW_WALL_CLOCK_LIMIT=180; MW_USE_LOG_PIPE=yes'";
- // @codingStandardsIgnoreEnd
$limit = "/bin/bash '$IP/includes/shell/limit.sh'";
$profile = "--profile=$IP/includes/shell/firejail.profile";
$blacklist = '--blacklist=' . realpath( MW_CONFIG_FILE );
$site = $store->getSite( 'ertrywuutr' );
$this->assertInstanceOf( 'Site', $site );
$this->assertEquals( 'en', $site->getLanguageCode() );
- $this->assertTrue( is_integer( $site->getInternalId() ) );
+ $this->assertTrue( is_int( $site->getInternalId() ) );
$this->assertTrue( $site->getInternalId() >= 0 );
$site = $store->getSite( 'sdfhxujgkfpth' );
$this->assertInstanceOf( 'Site', $site );
$this->assertEquals( 'nl', $site->getLanguageCode() );
- $this->assertTrue( is_integer( $site->getInternalId() ) );
+ $this->assertTrue( is_int( $site->getInternalId() ) );
$this->assertTrue( $site->getInternalId() >= 0 );
}
* @var Site $site
*/
foreach ( $sites as $site ) {
- if ( is_integer( $site->getInternalId() ) ) {
+ if ( is_int( $site->getInternalId() ) ) {
$this->assertEquals( $site, $sites->getSiteByInternalId( $site->getInternalId() ) );
}
}
* @var Site $site
*/
foreach ( $sites as $site ) {
- if ( is_integer( $site->getInternalId() ) ) {
+ if ( is_int( $site->getInternalId() ) ) {
$this->assertTrue( $site, $sites->hasInternalId( $site->getInternalId() ) );
}
}
'a<small><i><div>d</div></i>e</small>',
'<p>a</p><small><i><div>d</div></i></small><p><small>e</small></p>'
],
+ // phpcs:disable Generic.Files.LineLength
[
'Complex pwrap test 6',
'<i>a<div>b</div>c<b>d<div>e</div>f</b>g</i>',
- // @codingStandardsIgnoreStart Generic.Files.LineLength.TooLong
// PHP 5 does not allow concatenation in initialisation of a class static variable
'<p><i>a</i></p><i><div>b</div></i><p><i>c<b>d</b></i></p><i><b><div>e</div></b></i><p><i><b>f</b>g</i></p>'
- // @codingStandardsIgnoreEnd
],
+ // phpcs:enable
/* FIXME the second <b> causes a stack split which clones the <i> even
* though no <p> is actually generated
[
}
public static function provideCheckSvgScriptCallback() {
- // @codingStandardsIgnoreStart Generic.Files.LineLength
+ // phpcs:disable Generic.Files.LineLength
return [
// html5sec SVG vectors
[
'DTD with aliased entities apos (Should be allowed)'
]
];
- // @codingStandardsIgnoreEnd
+ // phpcs:enable
}
/**
* Test vectors from Appendix A on https://tools.ietf.org/html/rfc5869
*/
public static function providerRfc5869() {
- // @codingStandardsIgnoreStart Generic.Files.LineLength
+ // phpcs:disable Generic.Files.LineLength
return [
// A.1
[
'0bd770a74d1160f7c9f12cd5912a06ebff6adcae899d92191fe4305673ba2ffe8fa3f1a4e5ad79f3f334b3b202b2173c486ea37ce3d397ed034c7f9dfeb15c5e927336d0441f4c4300e2cff0d0900b52d3b4' // okm
],
];
- // @codingStandardsIgnoreEnd
+ // phpcs:enable
}
}
}
$data = 'foobar';
- // @codingStandardsIgnoreStart Generic.Files.LineLength
+ // phpcs:ignore Generic.Files.LineLength
$hash = '9923afaec3a86f865bb231a588f453f84e8151a2deb4109aebc6de4284be5bebcff4fab82a7e51d920237340a043736e9d13bab196006dcca0fe65314d68eab9';
- // @codingStandardsIgnoreEnd
$this->assertEquals(
hex2bin( $hash ),
$data = 'foobar';
$key = 'secret';
- // @codingStandardsIgnoreStart Generic.Files.LineLength
+ // phpcs:ignore Generic.Files.LineLength
$hash = 'ddc94177b2020e55ce2049199fd9cc6327f416ff6dc621cc34cb43d9bec61d73372b4790c0e24957f565ecaf2d42821e6303619093e99cbe14a3b9250bda5f81';
- // @codingStandardsIgnoreEnd
$this->assertEquals(
hex2bin( $hash ),
}
public static function provideCheckTitleEncodingData() {
- // @codingStandardsIgnoreStart Ignore Generic.Files.LineLength.TooLong
+ // phpcs:disable Generic.Files.LineLength
return [
[ "" ],
[ "United States of America" ], // 7bit ASCII
)
]
];
- // @codingStandardsIgnoreEnd
+ // phpcs:enable
}
/**
<?php
-// @codingStandardsIgnoreStart Ignore Squiz.Classes.ValidClassName.NotCamelCaps
+// phpcs:disable Squiz.Classes.ValidClassName.NotCamelCaps
/**
* @covers LanguageBe_tarask
*/
class LanguageBe_taraskTest extends LanguageClassesTestCase {
- // @codingStandardsIgnoreEnd
+ // phpcs:enable
/**
* Make sure the language code we are given is indeed
* be-tarask. This is to ensure LanguageClassesTestCase
}
/**
- * @covers LanguagePl::commafy()
+ * @covers Language::commafy()
* @dataProvider provideCommafyData
*/
public function testCommafy( $number, $numbersWithCommas ) {
* @file
*/
-/**
- * @covers LanguageRu
- */
class LanguageRuTest extends LanguageClassesTestCase {
/**
* @dataProvider providePlural
* @file
*/
-/**
- * @covers LanguageUk
- */
class LanguageUkTest extends LanguageClassesTestCase {
/**
* @dataProvider providePlural
$fname = $this->getNewTempFile();
// The header of every prefetch file
- // @codingStandardsIgnoreStart Ignore Generic.Files.LineLength.TooLong
+ // phpcs:ignore Generic.Files.LineLength
$header = '<mediawiki xmlns="http://www.mediawiki.org/xml/export-0.7/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.mediawiki.org/xml/export-0.7/ http://www.mediawiki.org/xml/export-0.7.xsd" version="0.7" xml:lang="en">
<siteinfo>
<sitename>wikisvn</sitename>
</namespaces>
</siteinfo>
';
- // @codingStandardsIgnoreEnd
// An array holding the pages that are available for prefetch
$available_pages = [];