From 8b489ca160163c506e92fbf902d4af181b01a7a3 Mon Sep 17 00:00:00 2001 From: libraryupgrader Date: Mon, 3 Sep 2018 18:08:53 +0000 Subject: [PATCH] build: Updating mediawiki/mediawiki-codesniffer to 22.0.0 And updating CoC link to use Special:MyLanguage (T202047). Change-Id: I091003f69b82c7cacc4cda320a38b1b07f3cdb6b --- CODE_OF_CONDUCT.md | 2 +- composer.json | 2 +- includes/common/Hooks.php | 2 +- .../engines/LuaCommon/LanguageLibrary.php | 2 +- includes/engines/LuaCommon/UstringLibrary.php | 2 +- .../LuaStandalone/LuaStandaloneEngine.php | 24 +++++++++---------- .../engines/LuaCommon/LuaEngineTestBase.php | 2 +- 7 files changed, 18 insertions(+), 18 deletions(-) diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md index d8e5d087..498acf76 100644 --- a/CODE_OF_CONDUCT.md +++ b/CODE_OF_CONDUCT.md @@ -1 +1 @@ -The development of this software is covered by a [Code of Conduct](https://www.mediawiki.org/wiki/Code_of_Conduct). +The development of this software is covered by a [Code of Conduct](https://www.mediawiki.org/wiki/Special:MyLanguage/Code_of_Conduct). diff --git a/composer.json b/composer.json index 2cbff43e..2f2d201d 100644 --- a/composer.json +++ b/composer.json @@ -1,7 +1,7 @@ { "require-dev": { "jakub-onderka/php-parallel-lint": "1.0.0", - "mediawiki/mediawiki-codesniffer": "21.0.0", + "mediawiki/mediawiki-codesniffer": "22.0.0", "mediawiki/lua-sandbox": "3.0.1", "mediawiki/minus-x": "0.3.1", "jakub-onderka/php-console-highlighter": "0.3.2", diff --git a/includes/common/Hooks.php b/includes/common/Hooks.php index 9ad63731..d06821d0 100644 --- a/includes/common/Hooks.php +++ b/includes/common/Hooks.php @@ -171,7 +171,7 @@ class ScribuntoHooks { // #iferror-compatible error element return "" . - $parserError. ""; + $parserError . ""; } } diff --git a/includes/engines/LuaCommon/LanguageLibrary.php b/includes/engines/LuaCommon/LanguageLibrary.php index c4d75671..cf45bd73 100644 --- a/includes/engines/LuaCommon/LanguageLibrary.php +++ b/includes/engines/LuaCommon/LanguageLibrary.php @@ -272,7 +272,7 @@ class Scribunto_LuaLanguageLibrary extends Scribunto_LuaLibraryBase { } else { # Correct for DateTime interpreting 'XXXX' as XX:XX o'clock if ( preg_match( '/^[0-9]{4}$/', $date ) ) { - $date = '00:00 '.$date; + $date = '00:00 ' . $date; } $cacheKey = $date; diff --git a/includes/engines/LuaCommon/UstringLibrary.php b/includes/engines/LuaCommon/UstringLibrary.php index 7497c4c0..6426b779 100644 --- a/includes/engines/LuaCommon/UstringLibrary.php +++ b/includes/engines/LuaCommon/UstringLibrary.php @@ -222,7 +222,7 @@ class Scribunto_LuaUstringLibrary extends Scribunto_LuaLibraryBase { return [ mb_strlen( $s, 'UTF-8' ) ]; } - public function ustringSub( $s, $i=1, $j=-1 ) { + public function ustringSub( $s, $i = 1, $j = -1 ) { $this->checkString( 'sub', $s ); $this->checkTypeOptional( 'sub', 2, $i, 'number', 1 ); $this->checkTypeOptional( 'sub', 3, $j, 'number', -1 ); diff --git a/includes/engines/LuaStandalone/LuaStandaloneEngine.php b/includes/engines/LuaStandalone/LuaStandaloneEngine.php index 25e7a7d5..50e9f06b 100644 --- a/includes/engines/LuaStandalone/LuaStandaloneEngine.php +++ b/includes/engines/LuaStandalone/LuaStandaloneEngine.php @@ -245,7 +245,7 @@ class Scribunto_LuaStandaloneInterpreter extends Scribunto_LuaInterpreter { $cmd = '"' . $cmd . '"'; } - $this->logger->debug( __METHOD__.": creating interpreter: $cmd\n" ); + $this->logger->debug( __METHOD__ . ": creating interpreter: $cmd\n" ); // Check whether proc_open is available before trying to call it (e.g. // PHP's disable_functions may have removed it) @@ -316,7 +316,7 @@ class Scribunto_LuaStandaloneInterpreter extends Scribunto_LuaInterpreter { public function terminate() { if ( $this->proc ) { - $this->logger->debug( __METHOD__.": terminating\n" ); + $this->logger->debug( __METHOD__ . ": terminating\n" ); proc_terminate( $this->proc ); proc_close( $this->proc ); $this->proc = false; @@ -357,10 +357,10 @@ class Scribunto_LuaStandaloneInterpreter extends Scribunto_LuaInterpreter { public function callFunction( $func /* ... */ ) { if ( !( $func instanceof Scribunto_LuaStandaloneInterpreterFunction ) ) { - throw new MWException( __METHOD__.': invalid function type' ); + throw new MWException( __METHOD__ . ': invalid function type' ); } if ( $func->interpreterId !== $this->id ) { - throw new MWException( __METHOD__.': function belongs to a different interpreter' ); + throw new MWException( __METHOD__ . ': function belongs to a different interpreter' ); } $args = func_get_args(); unset( $args[0] ); @@ -503,7 +503,7 @@ class Scribunto_LuaStandaloneInterpreter extends Scribunto_LuaInterpreter { $this->handleError( $msgFromLua ); return; // not reached default: - $this->logger->error( __METHOD__ .": invalid response op \"{$msgFromLua['op']}\"\n" ); + $this->logger->error( __METHOD__ . ": invalid response op \"{$msgFromLua['op']}\"\n" ); throw $this->engine->newException( 'scribunto-luastandalone-decode-error' ); } } @@ -571,7 +571,7 @@ class Scribunto_LuaStandaloneInterpreter extends Scribunto_LuaInterpreter { */ protected function encodeLuaVar( $var, $level = 0 ) { if ( $level > 100 ) { - throw new MWException( __METHOD__.': recursion depth limit exceeded' ); + throw new MWException( __METHOD__ . ': recursion depth limit exceeded' ); } $type = gettype( $var ); switch ( $type ) { @@ -590,7 +590,7 @@ class Scribunto_LuaStandaloneInterpreter extends Scribunto_LuaInterpreter { if ( $var === -INF ) { return '(-1/0)'; } - throw new MWException( __METHOD__.': cannot convert non-finite number' ); + throw new MWException( __METHOD__ . ': cannot convert non-finite number' ); } return sprintf( '%.17g', $var ); case 'string': @@ -622,21 +622,21 @@ class Scribunto_LuaStandaloneInterpreter extends Scribunto_LuaInterpreter { return $s; case 'object': if ( !( $var instanceof Scribunto_LuaStandaloneInterpreterFunction ) ) { - throw new MWException( __METHOD__.': unable to convert object of type ' . + throw new MWException( __METHOD__ . ': unable to convert object of type ' . get_class( $var ) ); } elseif ( $var->interpreterId !== $this->id ) { throw new MWException( - __METHOD__.': unable to convert function belonging to a different interpreter' + __METHOD__ . ': unable to convert function belonging to a different interpreter' ); } else { - return 'chunks[' . intval( $var->id ) . ']'; + return 'chunks[' . intval( $var->id ) . ']'; } case 'resource': - throw new MWException( __METHOD__.': unable to convert resource' ); + throw new MWException( __METHOD__ . ': unable to convert resource' ); case 'NULL': return 'nil'; default: - throw new MWException( __METHOD__.': unable to convert variable of unknown type' ); + throw new MWException( __METHOD__ . ': unable to convert variable of unknown type' ); } } diff --git a/tests/phpunit/engines/LuaCommon/LuaEngineTestBase.php b/tests/phpunit/engines/LuaCommon/LuaEngineTestBase.php index 72ad1162..7668bec8 100644 --- a/tests/phpunit/engines/LuaCommon/LuaEngineTestBase.php +++ b/tests/phpunit/engines/LuaCommon/LuaEngineTestBase.php @@ -245,7 +245,7 @@ abstract class Scribunto_LuaEngineTestBase extends MediaWikiLangTestCase { * @param mixed $expected */ public function testLua( $key, $testName, $expected ) { - $this->luaTestName = static::$moduleName."[$key]: $testName"; + $this->luaTestName = static::$moduleName . "[$key]: $testName"; if ( isset( $this->skipTests[$testName] ) ) { $this->markTestSkipped( $this->skipTests[$testName] ); } else {