Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .distignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,5 @@
/package.json
/package-lock.json
/phpcs.xml
/phpstan.neon
/phpunit.xml
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@ composer.lock export-ignore
CONTRIBUTING.md export-ignore
package.json export-ignore
phpcs.xml export-ignore
phpstan.neon export-ignore
phpunit.xml export-ignore
Empty file added .github/workflows/phpstan.yml
Empty file.
17 changes: 17 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,20 @@ jobs:
run: composer install --no-interaction
- name: Code style checks for PHP
run: composer test-cs

phpstan:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v5
with:
fetch-depth: 0
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.4
tools: composer
- name: Install PHP dependencies
run: composer install --no-interaction --prefer-dist --no-scripts
- name: PHPStan
run: composer phpstan
9 changes: 8 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@
"phpunit/phpunit": "^8|^9",
"slowprog/composer-copy-file": "~0.3",
"squizlabs/php_codesniffer": "^3.13",
"szepeviktor/phpstan-wordpress": "^v2.0",
"phpstan/extension-installer": "^1.4",
"phpstan/phpstan": "^2.1",
"phpcompatibility/phpcompatibility-wp": "^2.1",
"wp-coding-standards/wpcs": "^3.2"
},
Expand All @@ -42,12 +45,16 @@
],
"fix-cs": [
"phpcbf --standard=phpcs.xml"
],
"phpstan": [
"phpstan analyse --memory-limit=1G"
]
},
"config": {
"allow-plugins": {
"composer/installers": true,
"dealerdirect/phpcodesniffer-composer-installer": true
"dealerdirect/phpcodesniffer-composer-installer": true,
"phpstan/extension-installer": true
}
}
}
8 changes: 8 additions & 0 deletions phpstan.neon
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
parameters:
level: 3
paths:
- inc/
- statify-blacklist.php
ignoreErrors:
- message: '/^Constant STATIFYBLACKLIST_BASE not found\.$/'
path: inc/