Skip to content

Commit

Permalink
Set up and configure PHPStan
Browse files Browse the repository at this point in the history
  • Loading branch information
renatonascalves committed Oct 14, 2024
1 parent 04b60d1 commit 927e64e
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 6 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/phpcs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ on:

jobs:
phpcs:
strategy:
matrix:
php: [ '8.3' ]
if: github.event.pull_request.draft == false
uses: alleyinteractive/.github/.github/workflows/php-coding-standards.yml@main
uses: alleyinteractive/.github/.github/workflows/php-composer-command.yml@main
with:
php: ${{ matrix.php }}
php: '8.3'
command: |
phpcs
# phpstan
5 changes: 4 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,17 @@
"alleyinteractive/alley-coding-standards": "^2.0.1",
"mantle-framework/testkit": "^0.12.7",
"phpspec/prophecy": "^1.17.0",
"yoast/phpunit-polyfills": "^2.0"
"yoast/phpunit-polyfills": "^2.0",
"szepeviktor/phpstan-wordpress": "^1.3"
},
"scripts": {
"phpcbf" : "phpcbf .",
"phpcs" : "phpcs .",
"phpunit" : "phpunit",
"phpstan": "phpstan --memory-limit=1024M",
"test": [
"@phpcs",
"@phpstan",
"@phpunit"
],
"test-release": "rsync -rc --exclude-from=.distignore ./ ~/Desktop/publish-to-apple-news/ --delete --delete-excluded"
Expand Down
10 changes: 10 additions & 0 deletions phpstan.neon
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
includes:
- vendor/szepeviktor/phpstan-wordpress/extension.neon

parameters:
# Level 9 is the highest level
level: max

paths:
# - admin
- includes

0 comments on commit 927e64e

Please sign in to comment.