Skip to content

Commit

Permalink
:octocat: switch phan for phpstan (see chillerlan/php-qrcode#277)
Browse files Browse the repository at this point in the history
  • Loading branch information
codemasher committed Jul 17, 2024
1 parent 3e6f15b commit 0f69428
Show file tree
Hide file tree
Showing 8 changed files with 50 additions and 92 deletions.
36 changes: 19 additions & 17 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
/.build export-ignore
/.github export-ignore
/.idea export-ignore
/.phan export-ignore
/.phpdoc export-ignore
/docs export-ignore
/examples export-ignore
/tests export-ignore
/.editorconfig export-ignore
/.gitattributes export-ignore
/.gitignore export-ignore
/.readthedocs.yml export-ignore
/composer.lock export-ignore
/phpcs.xml.dist export-ignore
/phpdoc.xml.dist export-ignore
/phpmd.xml.dist export-ignore
/phpunit.xml.dist export-ignore
/.build export-ignore
/.github export-ignore
/.idea export-ignore
/.phan export-ignore
/.phpdoc export-ignore
/docs export-ignore
/examples export-ignore
/tests export-ignore
/.editorconfig export-ignore
/.gitattributes export-ignore
/.gitignore export-ignore
/.readthedocs.yml export-ignore
/composer.lock export-ignore
/phpcs.xml.dist export-ignore
/phpdoc.xml.dist export-ignore
/phpmd.xml.dist export-ignore
/phpunit.xml.dist export-ignore
/phpstan.dist.neon export-ignore
/phpstan-baseline.neon export-ignore

*.php diff=php
10 changes: 3 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,6 @@ jobs:
- "8.2"
- "8.3"

env:
PHAN_ALLOW_XDEBUG: 0
PHAN_DISABLE_XDEBUG_WARN: 1

steps:
- name: "Checkout"
uses: actions/checkout@v4
Expand All @@ -50,7 +46,7 @@ jobs:
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
extensions: ast, ${{ env.PHP_EXTENSIONS }}
extensions: ${{ env.PHP_EXTENSIONS }}
ini-values: ${{ env.PHP_INI_VALUES }}
coverage: none

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

- name: "Run phan"
run: php vendor/bin/phan --target-php-version=${{ matrix.php-version }}
- name: "Run PHPStan"
run: php vendor/bin/phpstan


tests:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,4 @@ phpcs.xml
phpdoc.xml
phpmd.xml
phpunit.xml
phpstan.neon
61 changes: 0 additions & 61 deletions .phan/config.php

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ A template/boilerplate for PHP libraries.
- [GitHub Actions](https://github.com/chillerlan/php-library-template/actions) runner
- [Composer](https://getcomposer.org) dependency management
- [PHPUnit](https://phpunit.de) unit tests
- [PHAN](https://github.com/phan/phan) static analysis
- [PHPStan](https://github.com/phpstan/phpstan) static analysis
- [PHPCS](https://github.com/PHPCSStandards/PHP_CodeSniffer) coding standard analyzer
- [PHPMD](https://phpmd.org) mess detector
- [Codecov](https://codecov.io) code coverage analysis
Expand Down
13 changes: 7 additions & 6 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,27 +34,28 @@
"php": "^8.1"
},
"require-dev": {
"phan/phan": "^5.4",
"phpunit/phpunit": "^10.5",
"phpmd/phpmd": "^2.15",
"squizlabs/php_codesniffer": "^3.9"
"phpstan/phpstan": "^1.11",
"phpstan/phpstan-deprecation-rules": "^1.2",
"squizlabs/php_codesniffer": "^3.10"
},
"suggest": {
},
"autoload": {
"psr-4": {
"chillerlan\\LibraryTemplate\\": "src/"
"chillerlan\\LibraryTemplate\\": "src"
}
},
"autoload-dev": {
"psr-4": {
"chillerlan\\LibraryTemplateTest\\": "tests/"
"chillerlan\\LibraryTemplateTest\\": "tests"
}
},
"scripts": {
"phan": "@php vendor/bin/phan",
"phpcs": "@php vendor/bin/phpcs",
"phpunit": "@php vendor/bin/phpunit"
"phpunit": "@php vendor/bin/phpunit",
"phpstan": "@php vendor/bin/phpstan"
},
"config": {
"lock": false,
Expand Down
2 changes: 2 additions & 0 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
parameters:
ignoreErrors: []
17 changes: 17 additions & 0 deletions phpstan.dist.neon
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# https://phpstan.org/config-reference

parameters:
level: 9
tmpDir: .build/phpstan-cache
paths:
- examples
- src
- tests

treatPhpDocTypesAsCertain: false

includes:
- phpstan-baseline.neon
- vendor/phpstan/phpstan/conf/bleedingEdge.neon
- vendor/phpstan/phpstan-deprecation-rules/rules.neon
# - vendor/chillerlan/php-settings-container/rules-magic-access.neon

0 comments on commit 0f69428

Please sign in to comment.