-
Notifications
You must be signed in to change notification settings - Fork 26
PHPStan level 9 #125
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: main
Are you sure you want to change the base?
PHPStan level 9 #125
Conversation
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds PHPStan static analysis support at level 9 to the codebase. The changes focus on adding comprehensive type hints via PHPDoc annotations to enable strict type checking.
- Adds PHPDoc type annotations for class properties and method parameters across multiple classes
- Introduces
#[\ReturnTypeWillChange]attributes to Iterator interface methods for PHP 8.x compatibility - Fixes a bug where an undefined property was being assigned in
WP_Export_Returner
Reviewed Changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| phpstan.neon.dist | Adds PHPStan configuration file with level 9 analysis and selected error suppressions |
| src/WP_Post_IDs_Iterator.php | Adds type annotations for all properties and an @implements tag for the Iterator interface |
| src/WP_Map_Iterator.php | Adds type annotations for the callback property and constructor parameters |
| src/WP_Export_XML_Over_HTTP.php | Adds type annotations for private properties and constructor parameters |
| src/WP_Export_WXR_Formatter.php | Adds type annotations for properties and the before_posts method parameter |
| src/WP_Export_Returner.php | Removes assignment to undefined property $this->private |
| src/Export_Command.php | Adds PHPDoc blocks with type annotations and @phpstan-ignore directives for validation methods, plus adds type cast for getcwd() |
| functions.php | Adds type annotations for the wp_export() function's parameter and restructures formatting |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
|
@copilot Help me bring this over the finish line. These are the current PHPStan errors left: |
|
@swissspidy I've opened a new pull request, #126, to work on those changes. Once the pull request is ready, I'll request review from you. |
Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com>
Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com>
Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com>
Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com>
Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com>
Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com>
No description provided.