File tree Expand file tree Collapse file tree 4 files changed +56
-0
lines changed
Expand file tree Collapse file tree 4 files changed +56
-0
lines changed Original file line number Diff line number Diff line change 99/.codecov.yml export-ignore
1010/.phpcs.xml.dist export-ignore
1111/CODE_OF_CONDUCT.md export-ignore
12+ /phpstan.neon.dist export-ignore
1213/phpunit.xml.dist export-ignore
1314/.github export-ignore
1415/Tests export-ignore
Original file line number Diff line number Diff line change @@ -160,3 +160,31 @@ jobs:
160160 - name : Fail the build on fixer conflicts and other errors
161161 if : ${{ steps.phpcbf.outputs.EXITCODE != 0 && steps.phpcbf.outputs.EXITCODE != 1 }}
162162 run : exit ${{ steps.phpcbf.outputs.EXITCODE }}
163+
164+ phpstan :
165+ name : " PHPStan"
166+
167+ runs-on : " ubuntu-latest"
168+
169+ steps :
170+ - name : Checkout code
171+ uses : actions/checkout@v3
172+
173+ - name : Install PHP
174+ uses : shivammathur/setup-php@v2
175+ with :
176+ php-version : ' 7.4'
177+ coverage : none
178+ tools : phpstan
179+
180+ # Install dependencies and handle caching in one go.
181+ # Dependencies need to be installed to make sure the PHPCS and PHPUnit classes are recognized.
182+ # @link https://github.com/marketplace/actions/install-composer-dependencies
183+ - name : Install Composer dependencies
184+ uses : " ramsey/composer-install@v2"
185+ with :
186+ # Bust the cache at least once a month - output format: YYYY-MM.
187+ custom-cache-suffix : $(date -u "+%Y-%m")
188+
189+ - name : Run PHPStan
190+ run : phpstan analyse
Original file line number Diff line number Diff line change 44phpunit.xml
55phpcs.xml
66.phpcs.xml
7+ phpstan.neon
Original file line number Diff line number Diff line change 1+ parameters:
2+ #phpVersion: 50400 # Needs to be 70100 or higher... sigh...
3+ level: 5
4+ paths:
5+ - WordPress
6+ bootstrapFiles:
7+ - Tests/bootstrap.php
8+ treatPhpDocTypesAsCertain: false
9+
10+ ignoreErrors:
11+ # Level 0
12+ - '#^Result of method \S+ \(void\) is used\.$#'
13+
14+ # Level 4
15+ - '#^Property \S+::\$\S+ \([^)]+\) in isset\(\) is not nullable\.$#'
16+ -
17+ count: 1
18+ message: '#^Result of && is always true\.$#'
19+ path: WordPress/Sniffs/Security/EscapeOutputSniff.php
20+ -
21+ count: 1
22+ message: '#^Strict comparison using === between true and false will always evaluate to false\.$#'
23+ path: WordPress/Sniffs/Utils/I18nTextDomainFixerSniff.php
24+
25+ # Level 5
26+ - '#^Parameter \#3 \$value of method \S+File::recordMetric\(\) expects string, \(?(float|int|bool)(\|(float|int|bool))*\)? given\.$#'
You can’t perform that action at this time.
0 commit comments