Skip to content

Commit 3e88f85

Browse files
authored
Merge pull request #9075 from paulbalandan/phpstan-scripts
chore: add composer scripts for phpstan
2 parents fbcc43a + cbd5024 commit 3e88f85

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

.github/workflows/test-phpstan.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,4 +85,4 @@ jobs:
8585
run: composer update --ansi --no-interaction
8686

8787
- name: Run static analysis
88-
run: vendor/bin/phpstan analyse
88+
run: composer phpstan:check

composer.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@
9292
],
9393
"analyze": [
9494
"Composer\\Config::disableProcessTimeout",
95-
"bash -c \"XDEBUG_MODE=off vendor/bin/phpstan analyse\"",
95+
"@phpstan:check",
9696
"vendor/bin/rector process --dry-run"
9797
],
9898
"cs": [
@@ -110,6 +110,8 @@
110110
"utils/vendor/bin/php-cs-fixer fix --ansi --verbose --diff"
111111
],
112112
"metrics": "utils/vendor/bin/phpmetrics --config=phpmetrics.json",
113+
"phpstan:baseline": "vendor/bin/phpstan analyse --ansi --generate-baseline=phpstan-baseline.php",
114+
"phpstan:check": "vendor/bin/phpstan analyse --verbose --ansi",
113115
"sa": "@analyze",
114116
"style": "@cs-fix",
115117
"test": "phpunit"
@@ -119,6 +121,8 @@
119121
"cs": "Check the coding style",
120122
"cs-fix": "Fix the coding style",
121123
"metrics": "Run PhpMetrics",
124+
"phpstan:baseline": "Run PHPStan then dump all errors to baseline",
125+
"phpstan:check": "Run PHPStan with support for identifiers",
122126
"test": "Run unit tests"
123127
}
124128
}

0 commit comments

Comments
 (0)