Skip to content

Commit d70e43d

Browse files
committed
Enable and configure Phan
Fixes #459
1 parent 262e0ee commit d70e43d

File tree

6 files changed

+2027
-208
lines changed

6 files changed

+2027
-208
lines changed

.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
},
4243

@@ -53,11 +54,13 @@
5354
"scripts": {
5455
"fix": "phpcbf",
5556
"cs": "phpcs -sp",
57+
"phan": "phan -d . --long-progress-bar",
5658
"yaml-sort-check": "composer require mhujer/yaml-sort-checker; yaml-sort-checker",
5759
"test": [
5860
"@composer validate --no-interaction",
5961
"phpunit",
60-
"@cs"
62+
"@cs",
63+
"@phan"
6164
]
6265
},
6366
"config": {

0 commit comments

Comments
 (0)