-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #931 from carstingaxion/try/phpstan-for-wp
NEW action PHPStan & 36 little 🐛 fixes
- Loading branch information
Showing
28 changed files
with
479 additions
and
68 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
name: PHPStan Tests | ||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
paths: | ||
- '.github/workflows/phpstan-tests.yml' | ||
- 'includes/**' | ||
# - 'test/unit/php**' | ||
# - '*.php' | ||
- 'phpstan.neon.dist' | ||
- 'composer.*' | ||
jobs: | ||
test-phpstan: | ||
name: PHPStan for WordPress | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
# phpstan requires PHP 7.1+. | ||
php-version: 7.4 | ||
extensions: dom, iconv, json, libxml, zip | ||
coverage: none | ||
tools: cs2pr | ||
|
||
- name: Composer Install | ||
run: composer install --optimize-autoloader --prefer-dist | ||
|
||
- name: Log debug information | ||
run: | | ||
git --version | ||
php --version | ||
composer --version | ||
- name: Running PHPStan Analyze | ||
if: ${{ success() || failure() }} | ||
run: | | ||
vendor/bin/phpstan --version | ||
vendor/bin/phpstan analyze -vv --memory-limit=2G --error-format=checkstyle | cs2pr |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,6 +32,7 @@ typings | |
# Composer # | ||
########## | ||
vendor | ||
phpstan.neon | ||
|
||
# .wp-env # | ||
########## | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.