Skip to content

Fix newly reported PHPStan errors - #341

Merged
swissspidy merged 1 commit into
mainfrom
fix/phpstan
Aug 6, 2026
Merged

Fix newly reported PHPStan errors#341
swissspidy merged 1 commit into
mainfrom
fix/phpstan

Conversation

@swissspidy

@swissspidy swissspidy commented Aug 6, 2026

Copy link
Copy Markdown
Member

Summary by CodeRabbit

  • Bug Fixes
    • Improved download handling when version information or download URLs are provided in different formats.
    • Improved cleanup reliability when source or target version details are unavailable.
    • Reduced the likelihood of download and cleanup errors in edge cases.

@swissspidy
swissspidy requested a review from a team as a code owner August 6, 2026 09:01
Copilot AI lite review requested due to automatic review settings August 6, 2026 09:01
@swissspidy swissspidy added the scope:testing Related to testing label Aug 6, 2026
@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: ce540c22-5bdc-424d-8dde-22c86d5d70f4

📥 Commits

Reviewing files that changed from the base of the PR and between fe10efb and 5780138.

📒 Files selected for processing (1)
  • src/Core_Command.php

📝 Walkthrough

Walkthrough

Changes

Download type handling

Layer / File(s) Summary
Download and cleanup type contracts
src/Core_Command.php
The download flow casts the URL and requested version to strings. A static annotation documents download offer fields. cleanup_extra_files() documents nullable source and target versions.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Suggested reviewers: copilot

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the changes, which add type casts and documentation updates to resolve PHPStan errors.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/phpstan

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 updates the Core_Command implementation to resolve newly reported PHPStan type issues, primarily by making variable types explicit where WP-CLI input parsing and API responses can be nullable or mixed.

Changes:

  • Casts array_shift( $args ) and $assoc_args['version'] to string to satisfy static analysis expectations.
  • Adds an explicit array-shape assertion for the $offer returned from WordPress.org APIs before indexing.
  • Updates cleanup_extra_files() PHPDoc to reflect that version parameters may be null.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@codecov

codecov Bot commented Aug 6, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@swissspidy swissspidy added this to the 3.0.2 milestone Aug 6, 2026
@swissspidy
swissspidy merged commit 946c2e2 into main Aug 6, 2026
67 of 68 checks passed
@swissspidy
swissspidy deleted the fix/phpstan branch August 6, 2026 09:31
@swissspidy
swissspidy restored the fix/phpstan branch August 6, 2026 09:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scope:testing Related to testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants