Thiemo Mättig (WMDE) has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/360359 )

Change subject: Update MediaWiki CodeSniffer to version 0.9.0 and fix violations
......................................................................

Update MediaWiki CodeSniffer to version 0.9.0 and fix violations

This also removes a not needed "return true" from the only hook in
this code base.

Change-Id: Iae7c2ee8afe55bda85cf69f1f086df28bb3f58c8
---
M WikibaseJavaScriptApi.php
M composer.json
M resources.php
M resources.test.php
M src/resources.php
M tests/resources.php
6 files changed, 12 insertions(+), 17 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/WikibaseJavaScriptApi 
refs/changes/59/360359/1

diff --git a/WikibaseJavaScriptApi.php b/WikibaseJavaScriptApi.php
index 702a6a6..1465af1 100644
--- a/WikibaseJavaScriptApi.php
+++ b/WikibaseJavaScriptApi.php
@@ -13,7 +13,7 @@
 }
 
 if ( defined( 'MEDIAWIKI' ) ) {
-       call_user_func( function() {
+       call_user_func( function () {
                require_once __DIR__ . '/init.mw.php';
        } );
 }
diff --git a/composer.json b/composer.json
index a23026b..ab7b0b0 100644
--- a/composer.json
+++ b/composer.json
@@ -20,9 +20,9 @@
                "data-values/javascript": "~0.8.0|~0.7.0|~0.6.0"
        },
        "require-dev": {
+               "jakub-onderka/php-console-highlighter": "0.3.2",
                "jakub-onderka/php-parallel-lint": ">=0.3 <0.10",
-               "mediawiki/mediawiki-codesniffer": ">=0.4 <0.8",
-               "jakub-onderka/php-console-highlighter": "0.3.2"
+               "mediawiki/mediawiki-codesniffer": "0.9.0"
        },
        "autoload": {
                "files": [
diff --git a/resources.php b/resources.php
index bcecd2c..e2e29ac 100644
--- a/resources.php
+++ b/resources.php
@@ -7,7 +7,7 @@
  *
  * @codeCoverageIgnoreStart
  */
-return call_user_func( function() {
+return call_user_func( function () {
        global $wgResourceModules;
 
        $wgResourceModules = array_merge(
diff --git a/resources.test.php b/resources.test.php
index 528d59a..2d528bc 100644
--- a/resources.test.php
+++ b/resources.test.php
@@ -6,14 +6,13 @@
  * @author H. Snater < [email protected] >
  */
 global $wgHooks;
-$wgHooks['ResourceLoaderTestModules'][] = function(
-               array &$testModules,
-               ResourceLoader &$resourceLoader
-       ) {
+
+$wgHooks['ResourceLoaderTestModules'][] = function (
+       array &$testModules,
+       ResourceLoader &$resourceLoader
+) {
        $testModules['qunit'] = array_merge(
                $testModules['qunit'],
-               include 'tests/resources.php'
+               include __DIR__ . '/tests/resources.php'
        );
-
-       return true;
 };
diff --git a/src/resources.php b/src/resources.php
index 207b0eb..70d514a 100644
--- a/src/resources.php
+++ b/src/resources.php
@@ -4,7 +4,7 @@
  * @license GPL-2.0+
  * @author Adrian Lang <[email protected]>
  */
-return call_user_func( function() {
+return call_user_func( function () {
        preg_match( '+' . preg_quote( DIRECTORY_SEPARATOR ) . 
'(?:vendor|extensions)'
                . preg_quote( DIRECTORY_SEPARATOR ) . '.*+', __DIR__, 
$remoteExtPath );
 
@@ -14,7 +14,6 @@
        ];
 
        return [
-
                'wikibase.api.__namespace' => $moduleTemplate + [
                        'scripts' => [
                                'namespace.js'
@@ -80,7 +79,5 @@
                                'wikibase.api.__namespace',
                        ],
                ],
-
        ];
-
 } );
diff --git a/tests/resources.php b/tests/resources.php
index 1da3c97..ec320de 100644
--- a/tests/resources.php
+++ b/tests/resources.php
@@ -6,7 +6,7 @@
  *
  * @codeCoverageIgnoreStart
  */
-return call_user_func( function() {
+return call_user_func( function () {
        preg_match( '+' . preg_quote( DIRECTORY_SEPARATOR ) . 
'(?:vendor|extensions)'
                . preg_quote( DIRECTORY_SEPARATOR ) . '.*+', __DIR__, 
$remoteExtPath );
 
@@ -39,5 +39,4 @@
                        ],
                ],
        ];
-
 } );

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iae7c2ee8afe55bda85cf69f1f086df28bb3f58c8
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/WikibaseJavaScriptApi
Gerrit-Branch: master
Gerrit-Owner: Thiemo Mättig (WMDE) <[email protected]>

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

Reply via email to