build: Updating mediawiki/mediawiki-codesniffer to 24.0.0

Change-Id: I30daab715920757ec96350c9933fc18c887972c4
This commit is contained in:
libraryupgrader 2019-02-06 23:08:22 +00:00
parent c26ed13636
commit 54d1b77401
8 changed files with 19 additions and 19 deletions

View file

@ -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 = '';

View file

@ -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"
},

View file

@ -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." );

View file

@ -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 );

View file

@ -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;

View file

@ -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;

View file

@ -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' );
}
}

View file

@ -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";