build: Swap deprecated @codingStandardsIgnore to phpcs:ignore

Bug: T278594
Change-Id: I09a6175917090593e6e0055203a890c32bea03a5
This commit is contained in:
Umherirrender 2021-04-04 21:18:22 +02:00
parent 12a4e3f7c1
commit 78cc6d77ff
20 changed files with 23 additions and 50 deletions

View file

@ -167,9 +167,8 @@ class DerivedPageDataUpdater implements IDBAccessObject, LoggerAwareInterface {
* Stores (most of) the $options parameter of prepareUpdate().
* @see prepareUpdate()
*
* @codingStandardsIgnoreStart
* @phpcs:ignore Generic.Files.LineLength
* @phan-var array{changed:bool,created:bool,moved:bool,restored:bool,oldrevision:null|RevisionRecord,triggeringUser:null|UserIdentity,oldredirect:bool|null|string,oldcountable:bool|null|string,causeAction:null|string,causeAgent:null|string,editResult:null|EditResult,approved:bool}
* @codingStandardsIgnoreEnd
*/
private $options = [
'changed' => true,

View file

@ -117,9 +117,8 @@ class EditResult implements JsonSerializable {
* @see EditResult::jsonSerialize()
*
* @param array $a
* @codingStandardsIgnoreStart
* @phpcs:ignore Generic.Files.LineLength
* @phan-param array{isNew:bool,originalRevisionId:bool|int,revertMethod:int|null,newestRevertedRevId:int|null,oldestRevertedRevId:int|null,isExactRevert:bool,isNullEdit:bool,revertTags:string[],version:string} $a
* @codingStandardsIgnoreEnd
*
* @return EditResult
*
@ -271,9 +270,8 @@ class EditResult implements JsonSerializable {
* @see EditResult::newFromArray()
*
* @return array
* @codingStandardsIgnoreStart
* @phpcs:ignore Generic.Files.LineLength
* @phan-return array{isNew:bool,originalRevisionId:bool|int,revertMethod:int|null,newestRevertedRevId:int|null,oldestRevertedRevId:int|null,isExactRevert:bool,isNullEdit:bool,revertTags:string[],version:string}
* @codingStandardsIgnoreEnd
*
* @since 1.36
*/

View file

@ -317,9 +317,8 @@ class ApiAuthManagerHelper {
/**
* Clean up a field array for output
* @param array $fields
* @codingStandardsIgnoreStart
* @phpcs:ignore Generic.Files.LineLength
* @phan-param array{type:string,options:array,value:string,label:Message,help:Message,optional:bool,sensitive:bool,skippable:bool} $fields
* @codingStandardsIgnoreEnd
* @return array
*/
private function formatFields( array $fields ) {

View file

@ -259,9 +259,7 @@ abstract class AuthenticationRequest {
/**
* Select a request by class name.
*
* @codingStandardsIgnoreStart
* @phan-template T
* @codingStandardsIgnoreEnd
* @param AuthenticationRequest[] $reqs
* @param string $class Class name
* @phan-param class-string<T> $class

View file

@ -137,9 +137,8 @@ abstract class ChangesListFilter {
* UI.
* * $filterDefinition['priority'] int Priority integer. Higher value means higher
* up in the group's filter list.
* @codingStandardsIgnoreStart
* @phpcs:ignore Generic.Files.LineLength
* @phan-param array{name:string,cssClassSuffix?:string,isRowApplicableCallable?:callable,group:ChangesListFilterGroup,label:string,description:string,priority:int} $filterDefinition
* @codingStandardsIgnoreEnd
*/
public function __construct( array $filterDefinition ) {
if ( isset( $filterDefinition['group'] ) ) {

View file

@ -1006,9 +1006,8 @@ class HTMLForm extends ContextSource {
* - attribs: (array, optional) Additional HTML attributes.
* - flags: (string|string[], optional) OOUI flags.
* - framed: (boolean=true, optional) OOUI framed attribute.
* @codingStandardsIgnoreStart
* @phpcs:ignore Generic.Files.LineLength
* @phan-param array{name:string,value:string,label-message?:string|string[]|MessageSpecifier,label?:string,label-raw?:string,id?:string,attribs?:array,flags?:string|string[],framed?:bool} $data
* @codingStandardsIgnoreEnd
* @return HTMLForm $this for chaining calls (since 1.20)
*/
public function addButton( $data ) {

View file

@ -87,9 +87,8 @@ class HttpRequestFactory {
* - password Password for HTTP Basic Authentication
* - originalRequest Information about the original request (as a WebRequest object or
* an associative array with 'ip' and 'userAgent').
* @codingStandardsIgnoreStart
* @phpcs:ignore Generic.Files.LineLength
* @phan-param array{timeout?:int|string,connectTimeout?:int|string,postData?:string|array,proxy?:?string,noProxy?:bool,sslVerifyHost?:bool,sslVerifyCert?:bool,caInfo?:?string,maxRedirects?:int,followRedirects?:bool,userAgent?:string,method?:string,logger?:\Psr\Log\LoggerInterface,username?:string,password?:string,originalRequest?:\WebRequest|array{ip:string,userAgent:string}} $options
* @codingStandardsIgnoreEnd
* @param string $caller The method making this request, for profiling
* @throws RuntimeException
* @return MWHttpRequest

View file

@ -89,9 +89,8 @@ abstract class MWHttpRequest implements LoggerAwareInterface {
/**
* @param string $url Url to use. If protocol-relative, will be expanded to an http:// URL
* @param array $options (optional) extra params to pass (see HttpRequestFactory::create())
* @codingStandardsIgnoreStart
* @phpcs:ignore Generic.Files.LineLength
* @phan-param array{timeout?:int|string,connectTimeout?:int|string,postData?:array,proxy?:string,noProxy?:bool,sslVerifyHost?:bool,sslVerifyCert?:bool,caInfo?:string,maxRedirects?:int,followRedirects?:bool,userAgent?:string,logger?:LoggerInterface,username?:string,password?:string,originalRequest?:WebRequest|array{ip:string,userAgent:string},method?:string} $options
* @codingStandardsIgnoreEnd
* @param string $caller The method making this request, for profiling
* @param Profiler|null $profiler An instance of the profiler for profiling, or null
* @throws Exception

View file

@ -458,11 +458,10 @@ abstract class FileBackend implements LoggerAwareInterface {
* - b) predicted operation errors occurred and 'force' was not set
*
* @param array[] $ops List of operations to execute in order
* @codingStandardsIgnoreStart
* @phan-param array<int,array{ignoreMissingSource?:bool,overwrite?:bool,overwriteSame?:bool,headers?:bool}> $ops
* @param array $opts Batch operation options
* @phpcs:ignore Generic.Files.LineLength
* @phan-param array{force?:bool,nonLocking?:bool,nonJournaled?:bool,parallelize?:bool,bypassReadOnly?:bool,preserveCache?:bool} $opts
* @codingStandardsIgnoreEnd
* @return StatusValue
*/
final public function doOperations( array $ops, array $opts = [] ) {
@ -700,9 +699,7 @@ abstract class FileBackend implements LoggerAwareInterface {
* considered "OK" as long as no fatal errors occurred.
*
* @param array $ops Set of operations to execute
* @codingStandardsIgnoreStart
* @phan-param list<array{op:?string,src?:string,dst?:string,ignoreMissingSource?:bool,headers?:array}> $ops
* @codingStandardsIgnoreEnd
* @param array $opts Batch operation options
* @phan-param array{bypassReadOnly?:bool} $opts
* @return StatusValue

View file

@ -214,9 +214,7 @@ class MultiHttpClient implements LoggerAwareInterface {
* - reqTimeout : post-connection timeout per request (seconds)
* - usePipelining : whether to use HTTP pipelining if possible
* - maxConnsPerHost : maximum number of concurrent connections (per host)
* @codingStandardsIgnoreStart
* @phan-param array{connTimeout?:int,reqTimeout?:int,usePipelining?:bool,maxConnsPerHost?:int} $opts
* @codingStandardsIgnoreEnd
* @return array $reqs With response array populated for each
* @throws Exception
* @suppress PhanTypeInvalidDimOffset
@ -310,9 +308,8 @@ class MultiHttpClient implements LoggerAwareInterface {
/**
* @param array &$req HTTP request map
* @codingStandardsIgnoreStart
* @phpcs:ignore Generic.Files.LineLength
* @phan-param array{url:string,proxy?:?string,query:mixed,method:string,body:string|resource,headers:string[],stream?:resource,flags:array} $req
* @codingStandardsIgnoreEnd
* @param array $opts
* - connTimeout : default connection timeout
* - reqTimeout : default request timeout
@ -494,9 +491,8 @@ class MultiHttpClient implements LoggerAwareInterface {
* @todo Remove dependency on MediaWikiServices: use a separate HTTP client
* library or copy code from PhpHttpRequest
* @param array $reqs Map of HTTP request arrays
* @codingStandardsIgnoreStart
* @phpcs:ignore Generic.Files.LineLength
* @phan-param array<int,array{url:string,query:array,method:string,body:string,proxy?:?string,headers?:string[]}> $reqs
* @codingStandardsIgnoreEnd
* @param array $opts
* - connTimeout : connection timeout per request (seconds)
* - reqTimeout : post-connection timeout per request (seconds)

View file

@ -155,9 +155,7 @@ abstract class BagOStuff implements
* - stats: IStatsdDataFactory instance. [optional]
* - logger: Psr\Log\LoggerInterface instance. [optional]
* @param array $params
* @codingStandardsIgnoreStart
* @phan-param array{keyspace?:string,logger?:Psr\Log\LoggerInterface,asyncHandler?:callable} $params
* @codingStandardsIgnoreEnd
*/
public function __construct( array $params = [] ) {
$this->keyspace = $params['keyspace'] ?? 'local';

View file

@ -49,9 +49,8 @@ class HashBagOStuff extends MediumSpecificBagOStuff {
* @stable to call
* @param array $params Additional parameters include:
* - maxKeys : only allow this many keys (using oldest-first eviction)
* @codingStandardsIgnoreStart
* @phpcs:ignore Generic.Files.LineLength
* @phan-param array{logger?:Psr\Log\LoggerInterface,asyncHandler?:callable,keyspace?:string,reportDupes?:bool,syncTimeout?:int,segmentationSize?:int,segmentedValueMaxSize?:int,maxKeys?:int} $params
* @codingStandardsIgnoreEnd
*/
public function __construct( $params = [] ) {
$params['segmentationSize'] = $params['segmentationSize'] ?? INF;

View file

@ -85,9 +85,8 @@ abstract class MediumSpecificBagOStuff extends BagOStuff {
* This should be configured to a reasonable size give the site traffic and the
* amount of I/O between application and cache servers that the network can handle.
* @param array $params
* @codingStandardsIgnoreStart
* @phpcs:ignore Generic.Files.LineLength
* @phan-param array{logger?:Psr\Log\LoggerInterface,asyncHandler?:callable,reportDupes?:bool,syncTimeout?:int,segmentationSize?:int,segmentedValueMaxSize?:int} $params
* @codingStandardsIgnoreEnd
*/
public function __construct( array $params = [] ) {
parent::__construct( $params );

View file

@ -696,9 +696,8 @@ class WANObjectCache implements
* - version: Integer version number signifiying the format of the value.
* Default: null
* - walltime: How long the value took to generate in seconds. Default: null
* @codingStandardsIgnoreStart
* @phpcs:ignore Generic.Files.LineLength
* @phan-param array{lag?:int,since?:int,pending?:bool,lockTSE?:int,staleTTL?:int,creating?:bool,version?:int,walltime?:int|float} $opts
* @codingStandardsIgnoreEnd
* @note Options added in 1.28: staleTTL
* @note Options added in 1.33: creating
* @note Options added in 1.34: version, walltime
@ -1397,9 +1396,8 @@ class WANObjectCache implements
* to query for dependency timestamps. The use of "pcTTL" reduces timestamp queries.
* Default: null.
* @param array $cbParams Custom field/value map to pass to the callback (since 1.35)
* @codingStandardsIgnoreStart
* @phpcs:ignore Generic.Files.LineLength
* @phan-param array{checkKeys?:string[],graceTTL?:int,lockTSE?:int,busyValue?:mixed,pcTTL?:int,pcGroup?:string,version?:int,minAsOf?:float|int,hotTTR?:int,lowTTL?:int,ageNew?:int,staleTTL?:int,touchedCallback?:callable} $opts
* @codingStandardsIgnoreEnd
* @return mixed Value found or written to the key
* @note Options added in 1.28: version, busyValue, hotTTR, ageNew, pcGroup, minAsOf
* @note Options added in 1.31: staleTTL, graceTTL

View file

@ -48,9 +48,7 @@ interface IEmailer {
* 'contentType' string default 'text/plain; charset=UTF-8'
* 'headers' array Extra headers to set
*
* @codingStandardsIgnoreStart
* @phan-param array{replyTo?:MailAddress,contentType?:string,headers?:array<string,string>} $options
* @codingStandardsIgnoreEnd
*
* @throws MWException
* @throws Exception

View file

@ -1545,9 +1545,7 @@ MESSAGE;
* - string|null: Module group (optional)
* - string|null: Name of foreign module source, or 'local' (optional)
* - string|null: Script body of a skip function (optional)
* @codingStandardsIgnoreStart
* @phan-param array<int,array{0:string,1:string,2?:?array,3?:?string,4?:?string,5?:?string}> $modules
* @codingStandardsIgnoreEnd
* @return string JavaScript code
*/
public static function makeLoaderRegisterScript(

View file

@ -123,9 +123,7 @@ class ResourceLoaderStartUpModule extends ResourceLoaderModule {
* - array 'dependencies'
* - string|null 'group'
* - string 'source'
* @codingStandardsIgnoreStart
* @phan-param array<string,array{version:string,dependencies:array,group:?string,source:string}> &$registryData
* @codingStandardsIgnoreEnd
*/
public static function compileUnresolvedDependencies( array &$registryData ) : void {
foreach ( $registryData as $name => &$data ) {

View file

@ -162,7 +162,7 @@ class ContentSecurityPolicyTest extends MediaWikiIntegrationTestCase {
}
public function providerMakeCSPDirectives() {
// @codingStandardsIgnoreStart Generic.Files.LineLength
// phpcs:disable Generic.Files.LineLength
return [
[ false, '', '' ],
[
@ -262,6 +262,7 @@ class ContentSecurityPolicyTest extends MediaWikiIntegrationTestCase {
"script-src 'unsafe-eval' blob: 'self' 'nonce-secret' 'unsafe-inline' sister-site.somewhere.com *.wikipedia.org; default-src * data: blob:; style-src * data: blob: 'unsafe-inline'; object-src 'self' https://example.com/f%3Bd; report-uri /w/api.php?action=cspreport&format=json&reportonly=1",
],
];
// phpcs:enable
}
/**
@ -275,6 +276,7 @@ class ContentSecurityPolicyTest extends MediaWikiIntegrationTestCase {
$wgAllowImageTag = $origImg;
// phpcs:ignore Generic.Files.LineLength
$expected = "script-src 'unsafe-eval' blob: 'self' 'nonce-secret' 'unsafe-inline' sister-site.somewhere.com *.wikipedia.org; default-src * data: blob:; style-src * data: blob: 'unsafe-inline'; object-src 'none'; report-uri /w/api.php?action=cspreport&format=json";
$this->assertSame( $expected, $actual );
}
@ -287,9 +289,9 @@ class ContentSecurityPolicyTest extends MediaWikiIntegrationTestCase {
true,
ContentSecurityPolicy::REPORT_ONLY_MODE
);
// phpcs:ignore Generic.Files.LineLength
$expected = "script-src 'unsafe-eval' blob: 'self' 'nonce-secret' 'unsafe-inline' sister-site.somewhere.com *.wikipedia.org; default-src * data: blob:; style-src * data: blob: 'unsafe-inline'; object-src 'none'; report-uri /w/api.php?action=cspreport&format=json&reportonly=1";
$this->assertSame( $expected, $actual );
// @codingStandardsIgnoreEnd Generic.Files.LineLength
}
/**

View file

@ -21,13 +21,13 @@ class OutputPageTest extends MediaWikiIntegrationTestCase {
private const SCREEN_MEDIA_QUERY = 'screen and (min-width: 982px)';
private const SCREEN_ONLY_MEDIA_QUERY = 'only screen and (min-width: 982px)';
// @codingStandardsIgnoreStart Generic.Files.LineLength
// phpcs:disable Generic.Files.LineLength
private const RSS_RC_LINK = '<link rel="alternate" type="application/rss+xml" title=" RSS feed" href="/w/index.php?title=Special:RecentChanges&amp;feed=rss"/>';
private const ATOM_RC_LINK = '<link rel="alternate" type="application/atom+xml" title=" Atom feed" href="/w/index.php?title=Special:RecentChanges&amp;feed=atom"/>';
private const RSS_TEST_LINK = '<link rel="alternate" type="application/rss+xml" title="&quot;Test&quot; RSS feed" href="fake-link"/>';
private const ATOM_TEST_LINK = '<link rel="alternate" type="application/atom+xml" title="&quot;Test&quot; Atom feed" href="fake-link"/>';
// @codingStandardsIgnoreEnd
// phpcs:enable
// Ensure that we don't affect the global ResourceLoader state.
protected function setUp() : void {

View file

@ -18,7 +18,7 @@ class VueComponentParserTest extends PHPUnit\Framework\TestCase {
}
public static function provideTestParse() {
// @codingStandardsIgnoreStart Generic.Files.LineLength
// phpcs:disable Generic.Files.LineLength
return [
[
'<template><p>{{foo}}</p></template><script>bar</script><style>baz</style>',
@ -328,6 +328,6 @@ class VueComponentParserTest extends PHPUnit\Framework\TestCase {
'Template with self-closing tag (broken)'
],
];
// @codingStandardsIgnoreEnd Generic.Files.LineLength
// phpcs:enable
}
}