build: Upgrade mediawiki-codesniffer from 26.0.0 to 28.0.0
authorJames D. Forrester <jforrester@wikimedia.org>
Fri, 11 Oct 2019 16:30:40 +0000 (09:30 -0700)
committerReedy <reedy@wikimedia.org>
Fri, 18 Oct 2019 20:37:55 +0000 (20:37 +0000)
Newly-disabled general rules:
* MediaWiki.Commenting.FunctionComment.MissingSplatVariadicArg
* MediaWiki.Commenting.FunctionComment.SuperfluousVariadicArgComment
* MediaWiki.Commenting.PhpunitAnnotations.ForbiddenExpectedException
* MediaWiki.Commenting.PhpunitAnnotations.ForbiddenExpectedExceptionMessage
* MediaWiki.Commenting.PhpunitAnnotations.ForbiddenExpectedExceptionMessageRegExp
* MediaWiki.Usage.NullableType.PHP71NullableStyle
* MediaWiki.Usage.PHPUnitTypeHints.MissingTypehint
* PSR12.Files.ImportStatement.LeadingSlash
* PSR12.Properties.ConstantVisibility.NotFound

Change-Id: Ifcf8c6d5fecc47a32741114b5a5b746a41510045

.phpcs.xml
composer.json
includes/api/ApiParse.php
includes/specialpage/ChangesListSpecialPage.php
tests/phpunit/includes/api/ApiUploadTestCase.php

index f971881..c18063d 100644 (file)
@@ -2,22 +2,32 @@
 <ruleset name="MediaWiki">
        <rule ref="./vendor/mediawiki/mediawiki-codesniffer/MediaWiki">
                <exclude name="Generic.ControlStructures.InlineControlStructure" />
+               <exclude name="MediaWiki.Commenting.FunctionComment.ExtraParamComment" />
                <exclude name="MediaWiki.Commenting.FunctionComment.MissingDocumentationProtected" />
                <exclude name="MediaWiki.Commenting.FunctionComment.MissingDocumentationPublic" />
                <exclude name="MediaWiki.Commenting.FunctionComment.MissingParamTag" />
                <exclude name="MediaWiki.Commenting.FunctionComment.MissingReturn" />
-               <exclude name="MediaWiki.Commenting.FunctionComment.ExtraParamComment" />
+               <exclude name="MediaWiki.Commenting.FunctionComment.MissingSplatVariadicArg" />
+               <exclude name="MediaWiki.Commenting.FunctionComment.SuperfluousVariadicArgComment" />
                <exclude name="MediaWiki.Commenting.FunctionComment.WrongStyle" />
-               <exclude name="MediaWiki.Commenting.IllegalSingleLineComment.IllegalSingleLineCommentStart" />
                <exclude name="MediaWiki.Commenting.IllegalSingleLineComment.IllegalSingleLineCommentEnd" />
+               <exclude name="MediaWiki.Commenting.IllegalSingleLineComment.IllegalSingleLineCommentStart" />
+               <exclude name="MediaWiki.Commenting.PhpunitAnnotations.ForbiddenExpectedException" />
+               <exclude name="MediaWiki.Commenting.PhpunitAnnotations.ForbiddenExpectedExceptionMessage" />
+               <exclude name="MediaWiki.Commenting.PhpunitAnnotations.ForbiddenExpectedExceptionMessageRegExp" />
                <exclude name="MediaWiki.ControlStructures.AssignmentInControlStructures.AssignmentInControlStructures" />
                <exclude name="MediaWiki.NamingConventions.LowerCamelFunctionsName.FunctionName" />
+               <exclude name="MediaWiki.PHP71Features.NullableType.NotAllowed" />
                <exclude name="MediaWiki.Usage.DbrQueryUsage.DbrQueryFound" />
                <exclude name="MediaWiki.Usage.DeprecatedGlobalVariables.Deprecated$wgContLang" />
                <exclude name="MediaWiki.Usage.DeprecatedGlobalVariables.Deprecated$wgTitle" />
                <exclude name="MediaWiki.Usage.ForbiddenFunctions.passthru" />
+               <exclude name="MediaWiki.Usage.NullableType.PHP71NullableStyle" />
+               <exclude name="MediaWiki.Usage.PHPUnitTypeHints.MissingTypehint" />
                <exclude name="MediaWiki.WhiteSpace.SpaceBeforeSingleLineComment.NewLineComment" />
                <exclude name="MediaWiki.WhiteSpace.SpaceBeforeSingleLineComment.SingleSpaceBeforeSingleLineComment" />
+               <exclude name="PSR12.Files.ImportStatement.LeadingSlash" />
+               <exclude name="PSR12.Properties.ConstantVisibility.NotFound" />
                <exclude name="Squiz.Scope.MethodScope.Missing" />
        </rule>
        <rule ref="MediaWiki.NamingConventions.PrefixedGlobalFunctions">
index 1597a41..22a8277 100644 (file)
@@ -67,7 +67,7 @@
                "jakub-onderka/php-console-highlighter": "0.3.2",
                "jakub-onderka/php-parallel-lint": "0.9.2",
                "justinrainbow/json-schema": "~5.2",
-               "mediawiki/mediawiki-codesniffer": "26.0.0",
+               "mediawiki/mediawiki-codesniffer": "28.0.0",
                "monolog/monolog": "~1.24.0",
                "nikic/php-parser": "3.1.5",
                "seld/jsonlint": "1.7.1",
index 2e7db78..7ec0e2e 100644 (file)
@@ -599,7 +599,9 @@ class ApiParse extends ApiBase {
                        $pout = $page->getParserOutput( $popts, $revId, $suppressCache );
                }
                if ( !$pout ) {
-                       $this->dieWithError( [ 'apierror-nosuchrevid', $revId ?: $page->getLatest() ] ); // @codeCoverageIgnore
+                       // @codeCoverageIgnoreStart
+                       $this->dieWithError( [ 'apierror-nosuchrevid', $revId ?: $page->getLatest() ] );
+                       // @codeCoverageIgnoreEnd
                }
 
                return $pout;
index bf5734a..dc6e2e5 100644 (file)
@@ -1162,7 +1162,7 @@ abstract class ChangesListSpecialPage extends SpecialPage {
        protected function getLegacyShowHideFilters() {
                $filters = [];
                foreach ( $this->filterGroups as $group ) {
-                       if ( $group instanceof  ChangesListBooleanFilterGroup ) {
+                       if ( $group instanceof ChangesListBooleanFilterGroup ) {
                                foreach ( $group->getFilters() as $key => $filter ) {
                                        if ( $filter->displaysOnUnstructuredUi( $this ) ) {
                                                $filters[ $key ] = $filter;
index cf56052..9d3e502 100644 (file)
@@ -121,7 +121,7 @@ abstract class ApiUploadTestCase extends ApiTestCase {
                return true;
        }
 
-       function fakeUploadChunk( $fieldName, $fileName, $type, & $chunkData ) {
+       public function fakeUploadChunk( $fieldName, $fileName, $type, &$chunkData ) {
                $tmpName = $this->getNewTempFile();
                // copy the chunk data to temp location:
                if ( !file_put_contents( $tmpName, $chunkData ) ) {