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
This commit is contained in:
libraryupgrader 2017-09-01 04:55:27 +00:00
parent 9b75c345e1
commit 5df0f098a1
3 changed files with 20 additions and 21 deletions

View file

@ -281,24 +281,22 @@ class ExprParser {
} }
// Next the two-character operators // Next the two-character operators
elseif ( $char2 === '<=' ) {
elseif ( $char2 === '<=' ) {
$name = $char2; $name = $char2;
$op = EXPR_LESSEQ; $op = EXPR_LESSEQ;
$p += 2; $p += 2;
} elseif ( $char2 === '>=' ) { } elseif ( $char2 === '>=' ) {
$name = $char2; $name = $char2;
$op = EXPR_GREATEREQ; $op = EXPR_GREATEREQ;
$p += 2; $p += 2;
} elseif ( $char2 === '<>' || $char2 === '!=' ) { } elseif ( $char2 === '<>' || $char2 === '!=' ) {
$name = $char2; $name = $char2;
$op = EXPR_NOTEQ; $op = EXPR_NOTEQ;
$p += 2; $p += 2;
} }
// Finally the single-character operators // Finally the single-character operators
elseif ( $char === '+' ) {
elseif ( $char === '+' ) {
++$p; ++$p;
if ( $expecting === 'expression' ) { if ( $expecting === 'expression' ) {
// Unary plus // Unary plus
@ -308,7 +306,7 @@ class ExprParser {
// Binary plus // Binary plus
$op = EXPR_PLUS; $op = EXPR_PLUS;
} }
} elseif ( $char === '-' ) { } elseif ( $char === '-' ) {
++$p; ++$p;
if ( $expecting === 'expression' ) { if ( $expecting === 'expression' ) {
// Unary minus // Unary minus
@ -318,26 +316,26 @@ class ExprParser {
// Binary minus // Binary minus
$op = EXPR_MINUS; $op = EXPR_MINUS;
} }
} elseif ( $char === '*' ) { } elseif ( $char === '*' ) {
$name = $char; $name = $char;
$op = EXPR_TIMES; $op = EXPR_TIMES;
++$p; ++$p;
} elseif ( $char === '/' ) { } elseif ( $char === '/' ) {
$name = $char; $name = $char;
$op = EXPR_DIVIDE; $op = EXPR_DIVIDE;
++$p; ++$p;
} elseif ( $char === '^' ) { } elseif ( $char === '^' ) {
$name = $char; $name = $char;
$op = EXPR_POW; $op = EXPR_POW;
++$p; ++$p;
} elseif ( $char === '(' ) { } elseif ( $char === '(' ) {
if ( $expecting === 'operator' ) { if ( $expecting === 'operator' ) {
throw new ExprError( 'unexpected_operator', '(' ); throw new ExprError( 'unexpected_operator', '(' );
} }
$operators[] = EXPR_OPEN; $operators[] = EXPR_OPEN;
++$p; ++$p;
continue; continue;
} elseif ( $char === ')' ) { } elseif ( $char === ')' ) {
$lastOp = end( $operators ); $lastOp = end( $operators );
while ( $lastOp && $lastOp != EXPR_OPEN ) { while ( $lastOp && $lastOp != EXPR_OPEN ) {
$this->doOperation( $lastOp, $operands ); $this->doOperation( $lastOp, $operands );
@ -352,21 +350,21 @@ class ExprParser {
$expecting = 'operator'; $expecting = 'operator';
++$p; ++$p;
continue; continue;
} elseif ( $char === '=' ) { } elseif ( $char === '=' ) {
$name = $char; $name = $char;
$op = EXPR_EQUALITY; $op = EXPR_EQUALITY;
++$p; ++$p;
} elseif ( $char === '<' ) { } elseif ( $char === '<' ) {
$name = $char; $name = $char;
$op = EXPR_LESS; $op = EXPR_LESS;
++$p; ++$p;
} elseif ( $char === '>' ) { } elseif ( $char === '>' ) {
$name = $char; $name = $char;
$op = EXPR_GREATER; $op = EXPR_GREATER;
++$p; ++$p;
} else { } else {
throw new ExprError( 'unrecognised_punctuation', Validator::cleanUp( $char ) ); throw new ExprError( 'unrecognised_punctuation', Validator::cleanUp( $char ) );
} }
// Binary operator processing // Binary operator processing
if ( $expecting === 'expression' ) { if ( $expecting === 'expression' ) {

View file

@ -2,7 +2,7 @@
"require-dev": { "require-dev": {
"jakub-onderka/php-parallel-lint": "0.9.2", "jakub-onderka/php-parallel-lint": "0.9.2",
"jakub-onderka/php-console-highlighter": "0.3.2", "jakub-onderka/php-console-highlighter": "0.3.2",
"mediawiki/mediawiki-codesniffer": "0.10.1" "mediawiki/mediawiki-codesniffer": "0.12.0"
}, },
"scripts": { "scripts": {
"fix": "phpcbf", "fix": "phpcbf",

View file

@ -1,10 +1,11 @@
<?xml version="1.0"?> <?xml version="1.0"?>
<ruleset> <ruleset>
<rule ref="vendor/mediawiki/mediawiki-codesniffer/MediaWiki"> <rule ref="./vendor/mediawiki/mediawiki-codesniffer/MediaWiki">
<exclude name="Squiz.Classes.ValidClassName.NotCamelCaps" /> <exclude name="Squiz.Classes.ValidClassName.NotCamelCaps" />
<exclude name="MediaWiki.ControlStructures.IfElseStructure" />
<exclude name="MediaWiki.Commenting.FunctionComment.MissingParamName" /> <exclude name="MediaWiki.Commenting.FunctionComment.MissingParamName" />
<exclude name="MediaWiki.Commenting.FunctionComment.MissingParamTag" /> <exclude name="MediaWiki.Commenting.FunctionComment.MissingParamTag" />
<exclude name="MediaWiki.Files.ClassMatchesFilename.NotMatch" />
<exclude name="MediaWiki.Files.OneClassPerFile.MultipleFound" />
<exclude name="MediaWiki.Commenting.FunctionComment.MissingDocumentationPublic" /> <exclude name="MediaWiki.Commenting.FunctionComment.MissingDocumentationPublic" />
<exclude name="MediaWiki.WhiteSpace.SpaceBeforeSingleLineComment.NewLineComment" /> <exclude name="MediaWiki.WhiteSpace.SpaceBeforeSingleLineComment.NewLineComment" />
</rule> </rule>