<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 = [
"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 ) ) {
* @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
}
$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.
*
* @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}}
/**
*
* @ingroup Language
*/
-// @codingStandardsIgnoreStart Ignore class name is not in camel caps format error
+// phpcs:ignore Squiz.Classes.ValidClassName.NotCamelCaps
class LanguageKu_ku extends Language {
- // @codingStandardsIgnoreEnd
/**
* Avoid grouping whole numbers between 0 to 9999
*
*
* @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
*/
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
$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 = [];