Skip to content

Fix newly reported PHPStan errors - #501

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

Fix newly reported PHPStan errors#501
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 JSON request handling by providing the content type in the expected format.
    • Ensured JSON payloads are correctly identified by the receiving service.

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

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

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: 5684f898-eb32-431f-a5a7-e2f0a60d6078

📥 Commits

Reviewing files that changed from the base of the PR and between d9d5b36 and 002707b.

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

📝 Walkthrough

Walkthrough

The change updates remote_get to pass the JSON content type as an associative Content-Type header.

Changes

JSON request header

Layer / File(s) Summary
Request header format
src/JsonSchemaExtractor.php
remote_get now maps Content-Type to application/json in the request header.

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

Suggested reviewers: copilot, brianhenryie

🚥 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 change as a fix for newly reported 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.

@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!

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 addresses a newly reported PHPStan type issue in the JSON schema downloader by adjusting how HTTP headers are passed to WP-CLI’s HTTP utility.

Changes:

  • Pass request headers as an associative array (array<string,string>) instead of a numeric list of header strings.
  • Normalize the Content-Type header name casing while doing so.

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

@swissspidy swissspidy added this to the 3.0.1 milestone Aug 6, 2026
@swissspidy
swissspidy merged commit 53ca3f5 into main Aug 6, 2026
78 of 79 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