Skip to content

Commit 5d9eb14

Browse files
committed
:octocat: switch phan for phpstan (see chillerlan/php-qrcode#277)
1 parent edbccaa commit 5d9eb14

8 files changed

+48
-90
lines changed

.gitattributes

+19-17
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,21 @@
1-
/.build export-ignore
2-
/.github export-ignore
3-
/.idea export-ignore
4-
/.phan export-ignore
5-
/.phpdoc export-ignore
6-
/docs export-ignore
7-
/examples export-ignore
8-
/tests export-ignore
9-
/.editorconfig export-ignore
10-
/.gitattributes export-ignore
11-
/.gitignore export-ignore
12-
/.readthedocs.yml export-ignore
13-
/composer.lock export-ignore
14-
/phpcs.xml.dist export-ignore
15-
/phpdoc.xml.dist export-ignore
16-
/phpmd.xml.dist export-ignore
17-
/phpunit.xml.dist export-ignore
1+
/.build export-ignore
2+
/.github export-ignore
3+
/.idea export-ignore
4+
/.phan export-ignore
5+
/.phpdoc export-ignore
6+
/docs export-ignore
7+
/examples export-ignore
8+
/tests export-ignore
9+
/.editorconfig export-ignore
10+
/.gitattributes export-ignore
11+
/.gitignore export-ignore
12+
/.readthedocs.yml export-ignore
13+
/composer.lock export-ignore
14+
/phpcs.xml.dist export-ignore
15+
/phpdoc.xml.dist export-ignore
16+
/phpmd.xml.dist export-ignore
17+
/phpunit.xml.dist export-ignore
18+
/phpstan.dist.neon export-ignore
19+
/phpstan-baseline.neon export-ignore
1820

1921
*.php diff=php

.github/workflows/ci.yml

+3-7
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,6 @@ jobs:
3838
- "8.2"
3939
- "8.3"
4040

41-
env:
42-
PHAN_ALLOW_XDEBUG: 0
43-
PHAN_DISABLE_XDEBUG_WARN: 1
44-
4541
steps:
4642
- name: "Checkout"
4743
uses: actions/checkout@v4
@@ -50,7 +46,7 @@ jobs:
5046
uses: shivammathur/setup-php@v2
5147
with:
5248
php-version: ${{ matrix.php-version }}
53-
extensions: ast, ${{ env.PHP_EXTENSIONS }}
49+
extensions: ${{ env.PHP_EXTENSIONS }}
5450
ini-values: ${{ env.PHP_INI_VALUES }}
5551
coverage: none
5652

@@ -60,8 +56,8 @@ jobs:
6056
- name: "Install dependencies with composer"
6157
uses: ramsey/composer-install@v3
6258

63-
- name: "Run phan"
64-
run: php vendor/bin/phan --target-php-version=${{ matrix.php-version }}
59+
- name: "Run PHPStan"
60+
run: php vendor/bin/phpstan
6561

6662

6763
tests:

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,4 @@ phpcs.xml
1818
phpdoc.xml
1919
phpmd.xml
2020
phpunit.xml
21+
phpstan.neon

.phan/config.php

-61
This file was deleted.

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ A template/boilerplate for PHP libraries (similar to [chillerlan/php-library-tem
2929
- [GitHub Actions](https://github.com/chillerlan/php-library-template-nodocs/actions) runner
3030
- [Composer](https://getcomposer.org) dependency management
3131
- [PHPUnit](https://phpunit.de) unit tests
32-
- [PHAN](https://github.com/phan/phan) static analysis
32+
- [PHPStan](https://github.com/phpstan/phpstan) static analysis
3333
- [PHPCS](https://github.com/PHPCSStandards/PHP_CodeSniffer) coding standard analyzer
3434
- [PHPMD](https://phpmd.org) mess detector
3535
- [Codecov](https://codecov.io) code coverage analysis

composer.json

+5-4
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,11 @@
3333
"php": "^8.1"
3434
},
3535
"require-dev": {
36-
"phan/phan": "^5.4",
3736
"phpunit/phpunit": "^10.5",
3837
"phpmd/phpmd": "^2.15",
39-
"squizlabs/php_codesniffer": "^3.9"
38+
"phpstan/phpstan": "^1.11",
39+
"phpstan/phpstan-deprecation-rules": "^1.2",
40+
"squizlabs/php_codesniffer": "^3.10"
4041
},
4142
"suggest": {
4243
},
@@ -51,9 +52,9 @@
5152
}
5253
},
5354
"scripts": {
54-
"phan": "@php vendor/bin/phan",
5555
"phpcs": "@php vendor/bin/phpcs",
56-
"phpunit": "@php vendor/bin/phpunit"
56+
"phpunit": "@php vendor/bin/phpunit",
57+
"phpstan": "@php vendor/bin/phpstan"
5758
},
5859
"config": {
5960
"lock": false,

phpstan-baseline.neon

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
parameters:
2+
ignoreErrors: []

phpstan.dist.neon

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# https://phpstan.org/config-reference
2+
3+
parameters:
4+
level: 9
5+
tmpDir: .build/phpstan-cache
6+
paths:
7+
- examples
8+
- src
9+
- tests
10+
11+
treatPhpDocTypesAsCertain: false
12+
13+
includes:
14+
- phpstan-baseline.neon
15+
- vendor/phpstan/phpstan/conf/bleedingEdge.neon
16+
- vendor/phpstan/phpstan-deprecation-rules/rules.neon
17+
# - vendor/chillerlan/php-settings-container/rules-magic-access.neon

0 commit comments

Comments
 (0)