Skip to content

Commit d90c746

Browse files
Abijeetjdforrester
authored andcommitted
Enable and configure Phan
Fixes #459
1 parent 77fae1c commit d90c746

6 files changed

Lines changed: 1077 additions & 71 deletions

File tree

.github/workflows/php.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@ jobs:
77
runs-on: ubuntu-latest
88
strategy:
99
matrix:
10-
php: [8.1, 8.2, 8.3, 8.4, 8.5]
10+
# PHP v8.5 has issues with Phan 5.5.1
11+
# Method SplObjectStorage::attach() is deprecated since 8.5, use method SplObjectStorage::offsetSet() instead
12+
php: [8.1, 8.2, 8.3, 8.4]
1113
steps:
1214
- name: Checkout
1315
uses: actions/checkout@v2
@@ -28,3 +30,6 @@ jobs:
2830

2931
- name: Run tests
3032
run: php ./vendor/bin/phpunit
33+
34+
- name: Running phan
35+
run: composer run-script phan

.phan/config.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
<?php
2+
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
@@ -37,6 +37,7 @@
3737
"ext-curl": "*",
3838
"phpunit/phpunit": "9.6.20",
3939
"mediawiki/mediawiki-codesniffer": "48.0.0",
40+
"mediawiki/mediawiki-phan-config": "0.17.0",
4041
"mustangostang/spyc": "0.6.3",
4142
"mhujer/yaml-sort-checker": "^1.5"
4243
},
@@ -55,11 +56,13 @@
5556
"fix": "phpcbf",
5657
"cs": "phpcs -sp",
5758
"yaml-sort-check": "yaml-sort-checker",
59+
"phan": "phan -d . --long-progress-bar",
5860
"test": [
5961
"@composer validate --no-interaction",
6062
"phpunit",
6163
"@cs",
62-
"@yaml-sort-check"
64+
"@yaml-sort-check",
65+
"@phan"
6366
]
6467
},
6568
"config": {

0 commit comments

Comments
 (0)