-
Notifications
You must be signed in to change notification settings - Fork 59
Replace Psalm with PHPstan #4069
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev/develop
Are you sure you want to change the base?
Conversation
For PHPStan and inpsyde/wp-stubs
Test using WordPress PlaygroundThe changes in this pull request can be previewed and tested using a WordPress Playground instance. 🔗 Test this pull request with WordPress Playground What's included:
Login credentials:
Plugin Details:
🤖 Auto-generated for commit 0672f29 • Last updated: 2026-02-12T14:24:02.087Z |
Use inpsyde/reusable-workflows for lint and phpunit GHA
Replaced Psalm with PHPstan.
This PR includes many PHPStan error fixes, but most of them are quite simple, such as adding missing type checks, updating phpDocs, or skipping errors when makes sense (e.g. was skipped before with Psalm). I think many of them are in the old code (before Psalm baseline) that was not touched often, so hopefully it will not result in many merge conflicts.
Notable changes:
wp_send_*(it callsdie/wp_die)is_awithinstanceof(is_ais supposed to accept only objects)( )for??, like'value: ' . $a[123] ?? 'none'For reviewing, it's probably easier to go commit by commit, since they are somewhat grouped by fix type.
PHPStan level is set to 8, and generated baseline, which mainly consists of things like missing array type phpDoc, missing return types.
The
inpsyde/wp-stubspackage requires PHP 8 to avoid parsing error, so I updated the default version in DDEV.The GHA workflow was updated in #4070