Skip to content

Fix @var annotation for Response::$statusCode and @return annotation for Response::getStatusCode()#258

Merged
mspirkov merged 2 commits intomasterfrom
fix-status-code-type
Feb 26, 2026
Merged

Fix @var annotation for Response::$statusCode and @return annotation for Response::getStatusCode()#258
mspirkov merged 2 commits intomasterfrom
fix-status-code-type

Conversation

@mspirkov
Copy link
Copy Markdown
Contributor

Q A
Is bugfix? ✔️
New feature?
Breaks BC?
Tests pass? ✔️
Fixed issues comma-separated list of tickets # fixed by the PR, if any

@codecov
Copy link
Copy Markdown

codecov bot commented Feb 26, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.17%. Comparing base (3e8bc25) to head (f6b7dcc).
⚠️ Report is 1 commits behind head on master.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff            @@
##             master     #258   +/-   ##
=========================================
  Coverage     98.17%   98.17%           
  Complexity      269      269           
=========================================
  Files            16       16           
  Lines           769      769           
=========================================
  Hits            755      755           
  Misses           14       14           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@mspirkov mspirkov marked this pull request as ready for review February 26, 2026 10:27
@mspirkov mspirkov requested a review from a team February 26, 2026 10:27
Copy link
Copy Markdown

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 aligns yii\httpclient\Response::getStatusCode() (and the virtual $statusCode property) with its actual behavior by updating PHPDoc to allow null, and updates tests/baseline accordingly to satisfy static analysis.

Changes:

  • Update Response PHPDoc annotations to string|null for $statusCode and getStatusCode().
  • Tighten ResponseTest expectations and types around status codes (use strings and strict assertions).
  • Remove now-obsolete PHPStan baseline entries tied to these annotation/type issues.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
src/Response.php PHPDoc updated to reflect possible null status code return/value.
tests/ResponseTest.php Tests updated to use string status codes and stricter assertions/type hints.
phpstan-baseline.neon Removes baseline suppressions that should no longer be needed after the annotation/test updates.
CHANGELOG.md Documents the bugfix entry for the annotation corrections.

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

@mspirkov mspirkov requested review from s1lver and samdark February 26, 2026 11:20
@mspirkov mspirkov merged commit 82023cf into master Feb 26, 2026
24 checks passed
@mspirkov mspirkov deleted the fix-status-code-type branch February 26, 2026 11:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants