From 54d1b77401a250d24a6923193c5c73459a10c2c2 Mon Sep 17 00:00:00 2001 From: libraryupgrader Date: Wed, 6 Feb 2019 23:08:22 +0000 Subject: [PATCH] build: Updating mediawiki/mediawiki-codesniffer to 24.0.0 Change-Id: I30daab715920757ec96350c9933fc18c887972c4 --- MathLaTeXML.php | 2 +- composer.json | 2 +- src/MathHooks.php | 4 ++-- src/MathMathML.php | 4 ++-- src/MathRenderer.php | 10 +++++----- src/MathRestbaseInterface.php | 10 +++++----- src/SpecialMathStatus.php | 4 ++-- tests/wfTest.php | 2 +- 8 files changed, 19 insertions(+), 19 deletions(-) diff --git a/MathLaTeXML.php b/MathLaTeXML.php index 33af959..a08f65f 100644 --- a/MathLaTeXML.php +++ b/MathLaTeXML.php @@ -106,7 +106,7 @@ class MathLaTeXML extends MathMathML { $post = $this->getLaTeXMLPostData(); // There is an API-inconsistency between different versions of the LaTeXML daemon // some versions require the literal prefix other don't allow it. - if ( ! strpos( $host, '/convert' ) ) { + if ( !strpos( $host, '/convert' ) ) { $post = preg_replace( '/&tex=/', '&tex=literal:', $post, 1 ); } $this->lastError = ''; diff --git a/composer.json b/composer.json index edad2b4..8d83960 100644 --- a/composer.json +++ b/composer.json @@ -1,7 +1,7 @@ { "require-dev": { "jakub-onderka/php-parallel-lint": "1.0.0", - "mediawiki/mediawiki-codesniffer": "23.0.0", + "mediawiki/mediawiki-codesniffer": "24.0.0", "jakub-onderka/php-console-highlighter": "0.3.2", "mediawiki/minus-x": "0.3.1" }, diff --git a/src/MathHooks.php b/src/MathHooks.php index d020e45..82911a8 100644 --- a/src/MathHooks.php +++ b/src/MathHooks.php @@ -203,7 +203,7 @@ class MathHooks { if ( $mode == 'mathml' ) { $parser->getOutput()->addModules( [ 'ext.math.scripts' ] ); $marker = Parser::MARKER_PREFIX . - '-postMath-' . sprintf( '%08X', $n ++ ) . + '-postMath-' . sprintf( '%08X', $n++ ) . Parser::MARKER_SUFFIX; self::$tags[$marker] = [ $renderer, $parser ]; return $marker; @@ -268,7 +268,7 @@ class MathHooks { // If the default option is not in the valid options the // user interface throws an exception (BUG 64844) $mode = self::mathModeToString( $wgDefaultUserOptions['math'] ); - if ( ! in_array( $mode, MathRenderer::getValidModes() ) ) { + if ( !in_array( $mode, MathRenderer::getValidModes() ) ) { LoggerFactory::getInstance( 'Math' )->error( 'Misconfiguration: ' . "\$wgDefaultUserOptions['math'] is not in " . MathRenderer::getValidModes() . ".\n" . "Please check your LocalSetting.php file." ); diff --git a/src/MathMathML.php b/src/MathMathML.php index 5b343a0..408623a 100644 --- a/src/MathMathML.php +++ b/src/MathMathML.php @@ -426,7 +426,7 @@ class MathMathML extends MathRenderer { } else { $class = $classOverride; } - if ( ! $this->mathoidStyle ) { + if ( !$this->mathoidStyle ) { $this->correctSvgStyle( $this->mathoidStyle ); } if ( $class ) { @@ -522,7 +522,7 @@ class MathMathML extends MathRenderer { protected function initializeFromDatabaseRow( $rpage ) { // mathoid allows different input formats // therefore the column name math_inputtex was changed to math_input - if ( $this->getMathTableName() == 'mathoid' && ! empty( $rpage->math_input ) ) { + if ( $this->getMathTableName() == 'mathoid' && !empty( $rpage->math_input ) ) { $this->userInputTex = $rpage->math_input; } parent::initializeFromDatabaseRow( $rpage ); diff --git a/src/MathRenderer.php b/src/MathRenderer.php index cb35d80..16a068f 100644 --- a/src/MathRenderer.php +++ b/src/MathRenderer.php @@ -225,7 +225,7 @@ abstract class MathRenderer { * @return string hash */ public function getMd5() { - if ( ! $this->md5 ) { + if ( !$this->md5 ) { $this->md5 = md5( $this->userInputTex ); } return $this->md5; @@ -306,17 +306,17 @@ abstract class MathRenderer { protected function initializeFromDatabaseRow( $rpage ) { $this->inputHash = $rpage->math_inputhash; // MUST NOT BE NULL $this->md5 = self::dbHash2md5( $this->inputHash ); - if ( ! empty( $rpage->math_mathml ) ) { + if ( !empty( $rpage->math_mathml ) ) { $this->mathml = utf8_decode( $rpage->math_mathml ); } - if ( ! empty( $rpage->math_inputtex ) ) { + if ( !empty( $rpage->math_inputtex ) ) { // in the current database the field is probably not set. $this->userInputTex = $rpage->math_inputtex; } - if ( ! empty( $rpage->math_tex ) ) { + if ( !empty( $rpage->math_tex ) ) { $this->tex = $rpage->math_tex; } - if ( ! empty( $rpage->math_svg ) ) { + if ( !empty( $rpage->math_svg ) ) { $this->svg = $rpage->math_svg; } $this->changed = false; diff --git a/src/MathRestbaseInterface.php b/src/MathRestbaseInterface.php index 22b2ceb..8d190fa 100644 --- a/src/MathRestbaseInterface.php +++ b/src/MathRestbaseInterface.php @@ -48,12 +48,12 @@ class MathRestbaseInterface { } else { $skips[] = $i; } - $i ++; + $i++; } $results = $serviceClient->runMulti( $requests ); $lenRbis = count( $rbis ); $j = 0; - for ( $i = 0; $i < $lenRbis; $i ++ ) { + for ( $i = 0; $i < $lenRbis; $i++ ) { if ( !in_array( $i, $skips ) ) { /** @var MathRestbaseInterface $rbi */ $rbi = $rbis[$i]; @@ -63,7 +63,7 @@ class MathRestbaseInterface { } catch ( Exception $e ) { } - $j ++; + $j++; } } } @@ -153,7 +153,7 @@ class MathRestbaseInterface { $i = 0; foreach ( $results as $response ) { /** @var MathRestbaseInterface $rbi */ - $rbi = $rbis[$i ++]; + $rbi = $rbis[$i++]; try { $rbi->evaluateRestbaseCheckResponse( $response ); } catch ( Exception $e ) { @@ -261,7 +261,7 @@ class MathRestbaseInterface { // Generates a TeX string that probably has not been generated before $uniqueTeX = uniqid( 't=', true ); $testInterface = new MathRestbaseInterface( $uniqueTeX ); - if ( ! $testInterface->checkTeX() ) { + if ( !$testInterface->checkTeX() ) { $this->log()->warning( 'Config check failed, since test expression was considered as invalid.', [ 'uniqueTeX' => $uniqueTeX ] ); return false; diff --git a/src/SpecialMathStatus.php b/src/SpecialMathStatus.php index 13c085c..ed66edf 100644 --- a/src/SpecialMathStatus.php +++ b/src/SpecialMathStatus.php @@ -24,7 +24,7 @@ class SpecialMathStatus extends SpecialPage { */ public function execute( $query ) { $this->setHeaders(); - if ( ! ( $this->getUser()->isAllowed( 'purge' ) ) ) { + if ( !( $this->getUser()->isAllowed( 'purge' ) ) ) { // The effect of loading this page is comparable to purge a page. // If desired a dedicated right e.g. "viewmathstatus" could be used instead. throw new PermissionsError( 'purge' ); @@ -153,7 +153,7 @@ class SpecialMathStatus extends SpecialPage { } private function assertContains( $expected, $real, $message = '' ) { - if ( ! $this->assertTrue( strpos( $real, $expected ) !== false, $message ) ) { + if ( !$this->assertTrue( strpos( $real, $expected ) !== false, $message ) ) { $this->printDiff( $expected, $real, 'math-test-contains-diff' ); } } diff --git a/tests/wfTest.php b/tests/wfTest.php index 0f5c682..33f08a3 100644 --- a/tests/wfTest.php +++ b/tests/wfTest.php @@ -69,7 +69,7 @@ class DummyTest extends Maintenance { $rend[] = [ MathRenderer::getRenderer( $input[1], $input[2], 'mathml' ), $input ]; $output = preg_replace( '#src="(.*?)/(([a-f]|\d)*).png"#', 'src="\2.png"', $output ); $parserTests[] = [ (string)$input[1], $output ]; - $i ++; + $i++; echo '.'; } echo "Generated $i tests\n";