Skip to content

Commit 2db9f83

Browse files
committed
Add Phan and fix errors
1 parent 7c21b12 commit 2db9f83

13 files changed

+1284
-945
lines changed

.github/workflows/ci.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
uses: shivammathur/setup-php@v2
2222
with:
2323
php-version: ${{matrix.php}}
24-
extensions: fileinfo, json, pdo, mbstring, gd
24+
extensions: fileinfo, json, pdo, mbstring, gd, ast
2525

2626
- name: Install
2727
run: |

.phan/config.php

+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
<?php
2+
3+
/**
4+
* This configuration will be read and overlaid on top of the
5+
* default configuration. Command-line arguments will be applied
6+
* after this file is read.
7+
*
8+
* @file
9+
*/
10+
11+
declare(strict_types=1);
12+
13+
return [
14+
'target_php_version' => null,
15+
16+
// A list of directories that should be parsed for class and
17+
// method information. After excluding the directories
18+
// defined in exclude_analysis_directory_list, the remaining
19+
// files will be statically analyzed for errors.
20+
//
21+
// Thus, both first-party and third-party code being used by
22+
// your application should be included in this list.
23+
'directory_list' => [
24+
'src/',
25+
'vendor/',
26+
],
27+
28+
// A regex used to match every file name that you want to
29+
// exclude from parsing. Actual value will exclude every
30+
// "test", "tests", "Test" and "Tests" folders found in
31+
// "vendor/" directory.
32+
'exclude_file_regex' => '@^vendor/.*/(tests?|Tests?)/@',
33+
34+
// A directory list that defines files that will be excluded
35+
// from static analysis, but whose class and method
36+
// information should be included.
37+
//
38+
// Generally, you'll want to include the directories for
39+
// third-party code (such as "vendor/") in this list.
40+
//
41+
// n.b.: If you'd like to parse but not analyze 3rd
42+
// party code, directories containing that code
43+
// should be added to both the `directory_list`
44+
// and `exclude_analysis_directory_list` arrays.
45+
'exclude_analysis_directory_list' => [
46+
'vendor/',
47+
],
48+
];

composer.json

+6-2
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,13 @@
55
"require": {
66
"ext-json": "*",
77
"ext-pdo": "*",
8-
"addwiki/mediawiki-api-base": "^2.5",
8+
"addwiki/mediawiki-api-base": "2.7.*",
99
"cebe/markdown-latex": "^1.1",
1010
"endroid/qr-code": "^3.7",
1111
"getdkan/lunr.php": "^1.0",
1212
"kevinrob/guzzle-cache-middleware": "^3.3",
1313
"league/flysystem": "^1.0",
14+
"myclabs/php-enum": "1.5.*",
1415
"samwilson/phpflickr": "^4.13",
1516
"symfony/console": "^5.0",
1617
"symfony/finder": "^5.0",
@@ -21,8 +22,10 @@
2122
},
2223
"require-dev": {
2324
"ergebnis/composer-normalize": "^2.7",
25+
"phan/phan": "^4.0",
2426
"php-parallel-lint/php-console-highlighter": "^0.5",
2527
"php-parallel-lint/php-parallel-lint": "1.2.0",
28+
"phpunit/php-token-stream": "^3.0",
2629
"phpunit/phpunit": "^8.5",
2730
"roslov/psr12ext": "^3.0",
2831
"symfony/var-dumper": "^5.0"
@@ -46,7 +49,8 @@
4649
"composer normalize --dry-run",
4750
"parallel-lint . --exclude node_modules --exclude vendor",
4851
"phpcs -s",
49-
"phpunit"
52+
"phpunit",
53+
"phan --allow-polyfill-parser"
5054
]
5155
}
5256
}

0 commit comments

Comments
 (0)