Repository navigation
Fix Age header value type to string for PSR compliance - #218
Conversation
There was a problem hiding this comment.
Code Review
This pull request casts the 'Age' header value to a string in CacheEntry.php and adds a test to verify this behavior. The review feedback points out a PSR-12 formatting issue regarding the space after the casting operator, and notes that the test assertion is redundant because getHeaderLine() always returns a string; it suggests asserting on the array returned by getHeader() instead.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
|
Available in 8.0.0-RC2 |
Problem
guzzlehttp/psr72.11.0 deprecated passing non-string values toMessageInterface::withHeader(),emitting
E_USER_DEPRECATEDviatrigger_deprecation().Stacktrace:
MessageTrait.php: trigger_deprecation('guzzlehttp/psr7', '2.11', 'Passing %s to M...', 'int')
CacheEntry.php: Response->withHeader('Age', 0) ← int, not string
Fix
Cast
getAge()return value tostringbefore passing towithHeader().Compatibility