mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/ParserFunctions
synced 2024-11-15 03:35:52 +00:00
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:
parent
9b75c345e1
commit
5df0f098a1
34
Expr.php
34
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' ) {
|
||||
|
|
|
@ -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",
|
||||
|
|
|
@ -1,10 +1,11 @@
|
|||
<?xml version="1.0"?>
|
||||
<ruleset>
|
||||
<rule ref="vendor/mediawiki/mediawiki-codesniffer/MediaWiki">
|
||||
<rule ref="./vendor/mediawiki/mediawiki-codesniffer/MediaWiki">
|
||||
<exclude name="Squiz.Classes.ValidClassName.NotCamelCaps" />
|
||||
<exclude name="MediaWiki.ControlStructures.IfElseStructure" />
|
||||
<exclude name="MediaWiki.Commenting.FunctionComment.MissingParamName" />
|
||||
<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.WhiteSpace.SpaceBeforeSingleLineComment.NewLineComment" />
|
||||
</rule>
|
||||
|
|
Loading…
Reference in a new issue