Skip to content

PHPStan level 9#125

Merged
swissspidy merged 13 commits intomainfrom
add/phpstan
Feb 16, 2026
Merged

PHPStan level 9#125
swissspidy merged 13 commits intomainfrom
add/phpstan

Conversation

@swissspidy
Copy link
Member

No description provided.

@codecov
Copy link

codecov bot commented Jul 3, 2025

Codecov Report

❌ Patch coverage is 92.85714% with 2 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/WP_Export_XML_Over_HTTP.php 0.00% 2 Missing ⚠️

📢 Thoughts on this report? Let us know!

@swissspidy swissspidy requested a review from Copilot November 3, 2025 08:50
Copy link
Contributor

Copilot AI left a 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.

swissspidy and others added 2 commits November 3, 2025 10:10
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@swissspidy

This comment was marked as resolved.

Copilot AI mentioned this pull request Nov 4, 2025
16 tasks

This comment was marked as resolved.

Copilot AI and others added 9 commits November 4, 2025 14:36
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>
@swissspidy swissspidy marked this pull request as ready for review February 16, 2026 15:53
@swissspidy swissspidy requested a review from a team as a code owner February 16, 2026 15:53
@swissspidy swissspidy added this to the 2.1.16 milestone Feb 16, 2026
@swissspidy swissspidy merged commit 46639c3 into main Feb 16, 2026
61 checks passed
@swissspidy swissspidy deleted the add/phpstan branch February 16, 2026 15:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants