Repository navigation
Allow nested cookie values in the CookieProvider type - #21
Conversation
PHP parses cookie names with brackets, such as cookie[foo]=bar, into nested arrays, so $_COOKIE values are strings or arrays.
|
@coderabbitai review |
Action performed
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## 1.x #21 +/- ##
===========================================
Coverage 100.00% 100.00%
Complexity 5 5
===========================================
Files 5 5
Lines 24 24
===========================================
Hits 24 24 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
Follow-up to #15 (CodeRabbit comment #15 (comment)).
PHP parses cookie names with brackets into nested arrays:
Cookie: cookie[foo]=bar; cookie[x][y]=zgives$_COOKIE['cookie'] = ['foo' => 'bar', 'x' => ['y' => 'z']](checked withphp -Sand curl), andSessionFactory::newInstance()accepts that array.CookieProvidertemplate type fromarray<array-key, string>toarray<array-key, string|array<array-key, mixed>>, the same shape Psalm uses for$_GET/$_POST.is_array()guard on a cookie value aDocblockTypeContradictionand let a possibly-array value reachstrlen(); with the new type it reportsPossiblyInvalidArgumentthere.SessionProviderstaysProviderInterface<Session>;newInstance()returnsSession.Summary by CodeRabbit