From 5df0f098a1dd5bd5492fe48d1c9d22281d6ca5f0 Mon Sep 17 00:00:00 2001 From: libraryupgrader Date: Fri, 1 Sep 2017 04:55:27 +0000 Subject: [PATCH] build: Updating mediawiki/mediawiki-codesniffer to 0.12.0 The following sniffs are failing and were disabled: * MediaWiki.Files.ClassMatchesFilename.NotMatch * MediaWiki.Files.OneClassPerFile.MultipleFound The following sniffs now pass and were enabled: * MediaWiki.ControlStructures.IfElseStructure Change-Id: Ia10258008fc28be6adbbea15f162bffa2be18880 --- Expr.php | 34 ++++++++++++++++------------------ composer.json | 2 +- phpcs.xml | 5 +++-- 3 files changed, 20 insertions(+), 21 deletions(-) diff --git a/Expr.php b/Expr.php index 96c45e56..e305b59d 100644 --- a/Expr.php +++ b/Expr.php @@ -281,24 +281,22 @@ class ExprParser { } // Next the two-character operators - - elseif ( $char2 === '<=' ) { + elseif ( $char2 === '<=' ) { $name = $char2; $op = EXPR_LESSEQ; $p += 2; - } elseif ( $char2 === '>=' ) { + } elseif ( $char2 === '>=' ) { $name = $char2; $op = EXPR_GREATEREQ; $p += 2; - } elseif ( $char2 === '<>' || $char2 === '!=' ) { + } elseif ( $char2 === '<>' || $char2 === '!=' ) { $name = $char2; $op = EXPR_NOTEQ; $p += 2; - } + } // Finally the single-character operators - - elseif ( $char === '+' ) { + elseif ( $char === '+' ) { ++$p; if ( $expecting === 'expression' ) { // Unary plus @@ -308,7 +306,7 @@ class ExprParser { // Binary plus $op = EXPR_PLUS; } - } elseif ( $char === '-' ) { + } elseif ( $char === '-' ) { ++$p; if ( $expecting === 'expression' ) { // Unary minus @@ -318,26 +316,26 @@ class ExprParser { // Binary minus $op = EXPR_MINUS; } - } elseif ( $char === '*' ) { + } elseif ( $char === '*' ) { $name = $char; $op = EXPR_TIMES; ++$p; - } elseif ( $char === '/' ) { + } elseif ( $char === '/' ) { $name = $char; $op = EXPR_DIVIDE; ++$p; - } elseif ( $char === '^' ) { + } elseif ( $char === '^' ) { $name = $char; $op = EXPR_POW; ++$p; - } elseif ( $char === '(' ) { + } elseif ( $char === '(' ) { if ( $expecting === 'operator' ) { throw new ExprError( 'unexpected_operator', '(' ); } $operators[] = EXPR_OPEN; ++$p; continue; - } elseif ( $char === ')' ) { + } elseif ( $char === ')' ) { $lastOp = end( $operators ); while ( $lastOp && $lastOp != EXPR_OPEN ) { $this->doOperation( $lastOp, $operands ); @@ -352,21 +350,21 @@ class ExprParser { $expecting = 'operator'; ++$p; continue; - } elseif ( $char === '=' ) { + } elseif ( $char === '=' ) { $name = $char; $op = EXPR_EQUALITY; ++$p; - } elseif ( $char === '<' ) { + } elseif ( $char === '<' ) { $name = $char; $op = EXPR_LESS; ++$p; - } elseif ( $char === '>' ) { + } elseif ( $char === '>' ) { $name = $char; $op = EXPR_GREATER; ++$p; - } else { + } else { throw new ExprError( 'unrecognised_punctuation', Validator::cleanUp( $char ) ); - } + } // Binary operator processing if ( $expecting === 'expression' ) { diff --git a/composer.json b/composer.json index 1c2721a8..021a14cb 100644 --- a/composer.json +++ b/composer.json @@ -2,7 +2,7 @@ "require-dev": { "jakub-onderka/php-parallel-lint": "0.9.2", "jakub-onderka/php-console-highlighter": "0.3.2", - "mediawiki/mediawiki-codesniffer": "0.10.1" + "mediawiki/mediawiki-codesniffer": "0.12.0" }, "scripts": { "fix": "phpcbf", diff --git a/phpcs.xml b/phpcs.xml index ec9798b3..403afb8d 100644 --- a/phpcs.xml +++ b/phpcs.xml @@ -1,10 +1,11 @@ - + - + +