diff --git a/.github/workflows/phpcs.yml b/.github/workflows/phpcs.yml index 8e988688..20dfd6d2 100644 --- a/.github/workflows/phpcs.yml +++ b/.github/workflows/phpcs.yml @@ -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 diff --git a/composer.json b/composer.json index 1c586170..f218f5fe 100644 --- a/composer.json +++ b/composer.json @@ -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" diff --git a/phpstan.neon b/phpstan.neon new file mode 100644 index 00000000..a5380a48 --- /dev/null +++ b/phpstan.neon @@ -0,0 +1,10 @@ +includes: + - vendor/szepeviktor/phpstan-wordpress/extension.neon + +parameters: + # Level 9 is the highest level + level: max + + paths: + # - admin + - includes