Skip to content

Commit 269f67a

Browse files
committed
Add mediawiki/mediawiki-phan-config
Change-Id: Ie744ba8c755c1f7e58de43dd0bf5e9668546ba91
1 parent 5d7cc3b commit 269f67a

File tree

4 files changed

+11
-2
lines changed

4 files changed

+11
-2
lines changed

.phan/config.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<?php
2+
3+
return require __DIR__ . '/../vendor/mediawiki/mediawiki-phan-config/src/config.php';

composer.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
},
2929
"require-dev": {
3030
"mediawiki/mediawiki-codesniffer": "35.0.0",
31+
"mediawiki/mediawiki-phan-config": "0.10.6",
3132
"mediawiki/minus-x": "1.1.1",
3233
"ockcyp/covers-validator": "1.3.3",
3334
"php-parallel-lint/php-console-highlighter": "0.5.0",
@@ -40,12 +41,14 @@
4041
"phpunit",
4142
"covers-validator",
4243
"phpcs -sp",
44+
"phan --allow-polyfill-parser --long-progress-bar",
4345
"minus-x check ."
4446
],
4547
"cover": "phpunit --coverage-html coverage",
4648
"fix": [
4749
"minus-x fix .",
4850
"phpcbf"
49-
]
51+
],
52+
"phan": "phan -d . --long-progress-bar"
5053
}
5154
}

src/Converter.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,9 @@ protected function doConvert() {
144144
$token->error( 'unexpected operator' );
145145
}
146146
// Resolve higher precedence levels
147+
/** @var Operator $lastOp */
147148
$lastOp = end( $this->operators );
149+
// @phan-suppress-next-line PhanUndeclaredProperty
148150
while ( $lastOp && self::$precedence[$token->name] <= self::$precedence[$lastOp->name] ) {
149151
$this->doOperation( $lastOp );
150152
array_pop( $this->operators );
@@ -260,6 +262,7 @@ protected function nextToken() {
260262
}
261263

262264
// The single-character operand symbols
265+
// @phan-suppress-next-line PhanParamSuspiciousOrder
263266
if ( strpos( self::OPERAND_SYMBOLS, $word1 ) !== false ) {
264267
$token = $this->newNumber( $word1, $this->pos );
265268
$this->pos++;

src/Evaluator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public static function compile( array $rules ) {
5050
* Evaluate a compiled set of rules returned by compile(). Do not allow
5151
* the user to edit the compiled form, or else PHP errors may result.
5252
*
53-
* @param string $number The number to be evaluated against the rules, in English, or it
53+
* @param string|int $number The number to be evaluated against the rules, in English, or it
5454
* may be a type convertible to string.
5555
* @param array $rules The associative array of plural rules in pluralform => rule format.
5656
* @return int The index of the plural form which passed the evaluation

0 commit comments

Comments
 (0)