Umherirrender has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/357032 )

Change subject: Add phpcs and make pass
......................................................................

Add phpcs and make pass

Change-Id: I660206e99e40a8d3d7cf19bd78b79a1f2b9afd39
---
M Kartographer.alias.php
M composer.json
A phpcs.xml
M tests/phpunit/KartographerTest.php
M tests/phpunit/ValidationTest.php
5 files changed, 23 insertions(+), 12 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Kartographer 
refs/changes/32/357032/1

diff --git a/Kartographer.alias.php b/Kartographer.alias.php
index c788e1a..3340c7c 100644
--- a/Kartographer.alias.php
+++ b/Kartographer.alias.php
@@ -1,13 +1,12 @@
 <?php
 /**
- * Aliases for special pages for extension Echo
+ * Aliases for special pages for extension Kartographer
  *
  * @file
  * @ingroup Extensions
  */
-// @codingStandardsIgnoreFile
 
-$specialPageAliases = array();
+$specialPageAliases = [];
 
 /** English (English) */
 $specialPageAliases['en'] = [
diff --git a/composer.json b/composer.json
index 93eeff9..b43ef09 100644
--- a/composer.json
+++ b/composer.json
@@ -4,11 +4,14 @@
        },
        "require-dev": {
                "jakub-onderka/php-parallel-lint": "0.9.2",
-               "jakub-onderka/php-console-highlighter": "0.3.2"
+               "jakub-onderka/php-console-highlighter": "0.3.2",
+               "mediawiki/mediawiki-codesniffer": "0.7.2"
        },
        "scripts": {
+               "fix": "phpcbf",
                "test": [
-                       "parallel-lint . --exclude vendor"
+                       "parallel-lint . --exclude vendor",
+                       "phpcs -p -s"
                ]
        }
 }
diff --git a/phpcs.xml b/phpcs.xml
new file mode 100644
index 0000000..4ffde0b
--- /dev/null
+++ b/phpcs.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ruleset>
+       <rule ref="vendor/mediawiki/mediawiki-codesniffer/MediaWiki"/>
+       <file>.</file>
+       <arg name="extensions" value="php,php5,inc"/>
+       <arg name="encoding" value="UTF-8"/>
+       <exclude-pattern>vendor</exclude-pattern>
+       <exclude-pattern>node_modules</exclude-pattern>
+</ruleset>
diff --git a/tests/phpunit/KartographerTest.php 
b/tests/phpunit/KartographerTest.php
index 7926c0b..6af2195 100644
--- a/tests/phpunit/KartographerTest.php
+++ b/tests/phpunit/KartographerTest.php
@@ -174,11 +174,11 @@
 
                // @todo @fixme These are incorrect, but match existing code
                // When the code is fixed, they should be changed
-               $frameMod = [ 'ext.kartographer.frame' => ''];
-               $frameStyle = [ 'ext.kartographer.style' => ''];
+               $frameMod = [ 'ext.kartographer.frame' => '' ];
+               $frameStyle = [ 'ext.kartographer.style' => '' ];
 
-               $linkMod = [ 'ext.kartographer.link' => ''];
-               $linkStyle = [ 'ext.kartographer.style' => ''];
+               $linkMod = [ 'ext.kartographer.link' => '' ];
+               $linkStyle = [ 'ext.kartographer.style' => '' ];
 
                return [
                        [ '', [], [] ],
diff --git a/tests/phpunit/ValidationTest.php b/tests/phpunit/ValidationTest.php
index 391fcbc..6153994 100644
--- a/tests/phpunit/ValidationTest.php
+++ b/tests/phpunit/ValidationTest.php
@@ -46,15 +46,15 @@
        }
 
        public function provideTestCases() {
-               $result = array();
+               $result = [];
 
                foreach ( glob( "{$this->basePath}/good-schemas/*.json" ) as 
$file ) {
                        $file = substr( $file, strlen( $this->basePath ) + 1 );
-                       $result[] = array( $file, false );
+                       $result[] = [ $file, false ];
                }
                foreach ( glob( "{$this->basePath}/bad-schemas/*.json" ) as 
$file ) {
                        $file = substr( $file, strlen( $this->basePath ) + 1 );
-                       $result[] = array( $file, true );
+                       $result[] = [ $file, true ];
                }
 
                return $result;

-- 
To view, visit https://gerrit.wikimedia.org/r/357032
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I660206e99e40a8d3d7cf19bd78b79a1f2b9afd39
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Kartographer
Gerrit-Branch: master
Gerrit-Owner: Umherirrender <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to