Skip to content

Commit

Permalink
Merge pull request #730 from WordPress/add/phpstan
Browse files Browse the repository at this point in the history
  • Loading branch information
swissspidy authored Jun 13, 2023
2 parents 149d582 + 789f317 commit 92338e3
Show file tree
Hide file tree
Showing 11 changed files with 516 additions and 99 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/php-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ on:
- '.github/workflows/php-lint.yml'
- '**.php'
- 'phpcs.xml.dist'
- 'phpstan.neon.dist'
- 'composer.json'
- 'composer.lock'
pull_request:
Expand All @@ -22,6 +23,7 @@ on:
- '.github/workflows/php-lint.yml'
- '**.php'
- 'phpcs.xml.dist'
- 'phpstan.neon.dist'
- 'composer.json'
- 'composer.lock'
types:
Expand Down Expand Up @@ -56,3 +58,5 @@ jobs:
run: composer install --no-interaction --no-progress
- name: PHP Lint
run: composer lint
- name: PHPStan
run: composer phpstan
11 changes: 9 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,23 @@
"require-dev": {
"dealerdirect/phpcodesniffer-composer-installer": "^0.7",
"phpcompatibility/php-compatibility": "^9.3",
"phpstan/extension-installer": "^1.3.0",
"phpstan/phpstan": "^1.10",
"phpunit/phpunit": "^4|^5|^6|^7|^8|^9",
"squizlabs/php_codesniffer": "^3.5",
"szepeviktor/phpstan-wordpress": "^1.3.0",
"wp-coding-standards/wpcs": "^2.2",
"wp-phpunit/wp-phpunit": "^5.8",
"yoast/phpunit-polyfills": "^1.0"
"yoast/phpunit-polyfills": "^1.0",
"phpstan/phpstan-phpunit": "^1.3",
"phpstan/phpstan-deprecation-rules": "^1.1"
},
"require": {
"composer/installers": "~1.0",
"php": ">=5.6|^7|^8"
},
"scripts": {
"phpstan": "phpstan analyze --ansi",
"format": "phpcbf --standard=phpcs.xml.dist --report-summary --report-source",
"lint": "phpcs --standard=phpcs.xml.dist",
"test": "phpunit -c phpunit.xml.dist --verbose",
Expand All @@ -33,7 +39,8 @@
"config": {
"allow-plugins": {
"dealerdirect/phpcodesniffer-composer-installer": true,
"composer/installers": true
"composer/installers": true,
"phpstan/extension-installer": true
}
},
"autoload-dev": {
Expand Down
Loading

0 comments on commit 92338e3

Please sign in to comment.