Skip to content

Commit dfdfb1c

Browse files
committed
Add phan
Bug: T303786 Change-Id: I8a8bfdf5bb0c116db3817bdd1aea442f0080ff93
1 parent 093f1ff commit dfdfb1c

File tree

4 files changed

+12
-0
lines changed

4 files changed

+12
-0
lines changed

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,6 @@ Doxyfile export-ignore
77
composer.json export-ignore
88
.phpcs.xml export-ignore
99
phpunit.xml.dist export-ignore
10+
.phan/ export-ignore
1011
build/ export-ignore
1112
tests/ export-ignore

.phan/config.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?php
2+
3+
$cfg = require __DIR__ . '/../vendor/mediawiki/mediawiki-phan-config/src/config.php';
4+
5+
$cfg['suppress_issue_types'][] = 'PhanTypeInvalidDimOffset';
6+
7+
return $cfg;

composer.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
},
2424
"require-dev": {
2525
"mediawiki/mediawiki-codesniffer": "38.0.0",
26+
"mediawiki/mediawiki-phan-config": "0.11.1",
2627
"mediawiki/minus-x": "1.1.1",
2728
"ockcyp/covers-validator": "1.3.3",
2829
"php-parallel-lint/php-console-highlighter": "0.5.0",
@@ -35,13 +36,15 @@
3536
"phpunit",
3637
"covers-validator",
3738
"@phpcs",
39+
"phan --allow-polyfill-parser --long-progress-bar",
3840
"minus-x check ."
3941
],
4042
"cover": "phpunit --coverage-html coverage",
4143
"fix": [
4244
"minus-x fix .",
4345
"phpcbf"
4446
],
47+
"phan": "phan --allow-polyfill-parser --long-progress-bar",
4548
"phpcs": "phpcs -sp"
4649
}
4750
}

src/TextCat.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,7 @@ public function createLM( $text, $maxNgrams ) {
239239
*/
240240
public function loadLanguageFile( $langFile ) {
241241
include $langFile;
242+
// @phan-suppress-next-line PhanTypeMismatchArgumentInternal $ranks is brought in by the include
242243
array_splice( $ranks, $this->maxNgrams );
243244
return $ranks;
244245
}

0 commit comments

Comments
 (0)