Conversation
mspirkov
commented
Feb 26, 2026
| Q | A |
|---|---|
| Is bugfix? | ✔️ |
| New feature? | ❌ |
| Breaks BC? | ❌ |
| Tests pass? | ✔️ |
| Fixed issues | comma-separated list of tickets # fixed by the PR, if any |
…ation for `Response::getStatusCode()`
Codecov Report✅ All modified and coverable lines are covered by tests. 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. |
There was a problem hiding this comment.
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
ResponsePHPDoc annotations tostring|nullfor$statusCodeandgetStatusCode(). - Tighten
ResponseTestexpectations 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.