-
-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add new class RequestHeaders #14
base: master
Are you sure you want to change the base?
Conversation
DikoIbragimov
commented
Dec 11, 2024
Q | A |
---|---|
Is bugfix? | ❌ |
New feature? | ✔️ |
Breaks BC? | ❌ |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #14 +/- ##
===========================================
Coverage 100.00% 100.00%
- Complexity 6 16 +10
===========================================
Files 3 5 +2
Lines 13 32 +19
===========================================
+ Hits 13 32 +19 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's good idea for me 👍
Also need methods to get all headers ($request->getHeaders()
) and get header values as array ($request->getHeader()
).
…ding new methods for getting request headers in different formats and corresponding tests
I'd recommended to think about providing (setting) custom headers like error-handler does. |
|
||
namespace Yiisoft\RequestProvider; | ||
|
||
final class RequestHeaders { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
final class RequestHeaders { | |
final class RequestHeaderProvider { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggested name is not consistent with RequestCookies
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
RequestCookies
is inconsistent with the rest Yii3 packages as well
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree. RequestHeaderProvider
is better name.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe a RequestHeaderCollection?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also good, but it's not a classic collection. Very custom implementation that depends on another class. It's more proxy than collection.
ProxyCollection? 😁
use Yiisoft\RequestProvider\RequestHeaders; | ||
use Yiisoft\RequestProvider\RequestProviderInterface; | ||
|
||
final class RequestHeadersTest extends TestCase { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
final class RequestHeadersTest extends TestCase { | |
final class RequestHeaderProviderTest extends TestCase { |
Co-authored-by: Rustam Mamadaminov <[email protected]>