build: Update mediawiki/mediawiki-codesniffer to 0.5.1
authorPaladox <thomasmulhall410@yahoo.com>
Tue, 29 Dec 2015 10:30:42 +0000 (10:30 +0000)
committerLegoktm <legoktm.wikipedia@gmail.com>
Sat, 2 Jan 2016 09:50:09 +0000 (09:50 +0000)
Two rules are ignored for now to allow us to upgrade:
* MediaWiki.ControlStructures.AssignmentInControlStructures.AssignmentInControlStructures
* Generic.ControlStructures.InlineControlStructure.NotAllowed

Also ignore the .git folder.

Change-Id: I1b149c72b27be54e22e369999ad0c41c2d1fc2b4

composer.json
includes/site/MediaWikiSite.php
languages/classes/LanguageOs.php
phpcs.xml

index 9775823..210c23e 100644 (file)
@@ -40,7 +40,7 @@
        "require-dev": {
                "jakub-onderka/php-parallel-lint": "0.9",
                "justinrainbow/json-schema": "~1.3",
-               "mediawiki/mediawiki-codesniffer": "0.4.0",
+               "mediawiki/mediawiki-codesniffer": "0.5.1",
                "monolog/monolog": "~1.17.2",
                "nikic/php-parser": "1.4.1",
                "nmred/kafka-php": "0.1.4",
index 029919c..9fec1f4 100644 (file)
@@ -231,9 +231,8 @@ class MediaWikiSite extends Site {
                                        default:
                                                return false;
                                }
-                       }
-                       // If on the pages structure we should prepare for returning.
-                       elseif ( $fieldId === 'title' && is_array( $collectedHits ) ) {
+                       } elseif ( $fieldId === 'title' && is_array( $collectedHits ) ) {
+                               // If on the pages structure we should prepare for returning.
                                switch ( count( $collectedHits ) ) {
                                        case 0:
                                                return false;
index dbf4cce..d374c85 100644 (file)
@@ -71,15 +71,14 @@ class LanguageOs extends Language {
                if ( preg_match( '/тæ$/u', $word ) ) {
                        $word = mb_substr( $word, 0, -1 );
                        $end_allative = 'æм';
-               }
-               # Works if $word is in singular form.
-               # Checking if $word ends on one of the vowels: е, ё, и, о, ы, э, ю, я.
-               elseif ( preg_match( "/[аæеёиоыэюя]$/u", $word ) ) {
+               } elseif ( preg_match( "/[аæеёиоыэюя]$/u", $word ) ) {
+                       # Works if $word is in singular form.
+                       # Checking if $word ends on one of the vowels: е, ё, и, о, ы, э, ю, я.
                        $jot = 'й';
-               }
-               # Checking if $word ends on 'у'. 'У' can be either consonant 'W' or vowel 'U' in cyrillic Ossetic.
-               # Examples: {{grammar:genitive|аунеу}} = аунеуы, {{grammar:genitive|лæппу}} = лæппуйы.
-               elseif ( preg_match( "/у$/u", $word ) ) {
+               } elseif ( preg_match( "/у$/u", $word ) ) {
+                       # Checking if $word ends on 'у'. 'У'
+                       # can be either consonant 'W' or vowel 'U' in cyrillic Ossetic.
+                       # Examples: {{grammar:genitive|аунеу}} = аунеуы, {{grammar:genitive|лæппу}} = лæппуйы.
                        if ( !preg_match( "/[аæеёиоыэюя]$/u", mb_substr( $word, -2, 1 ) ) ) {
                                $jot = 'й';
                        }
index 376e582..38c7aaa 100644 (file)
--- a/phpcs.xml
+++ b/phpcs.xml
        <rule ref="PSR2.Methods.MethodDeclaration.Underscore">
                <exclude-pattern>*/includes/StubObject.php</exclude-pattern>
        </rule>
+       <rule ref="MediaWiki.ControlStructures.AssignmentInControlStructures.AssignmentInControlStructures">
+               <severity>0</severity>
+       </rule>
+       <rule ref="Generic.ControlStructures.InlineControlStructure.NotAllowed">
+               <severity>0</severity>
+       </rule>
        <exclude-pattern>node_modules</exclude-pattern>
        <exclude-pattern>vendor</exclude-pattern>
        <exclude-pattern>extensions</exclude-pattern>
        <exclude-pattern>skins</exclude-pattern>
+       <exclude-pattern>.git</exclude-pattern>
 </ruleset>