-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
Proposal for the creation of interfaces for the Symfony HttpFoundation component #50018
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
Comments
Which interface would you like ? HttpKernel depends on Request and Response which are value objects. Creating interfaces for them does not really make sense (not counting the fact that Request exposes public properties, which cannot be described in an interface and so this would not be possible without first changing the API) |
My idea is precisely for use in HttpKernel. It would be to create a RequestInterface that would remove the requirement of using the Request class in the execution of the kernel. And why not change the API to retain these values? |
Changing the API is a BC break (and changing the Request class is a huge one for the ecosystem). And I don't see the benefit of this RequestInterface: what is the benefit of re-implementing the whole API of the Request each time instead of using the value object provided in Symfony ? |
We've discussed the topic of refactoring request/response and adding (or supporting) interfaces multiple times in the past in this issue tracker (e.g. #6406, #15414 and #17392). The conclusion has always been the same as @stof shared in his previous message (note that the BC layer for changing function parameters from an object to interface is also not trivial and probably requires duplicating all methods that have Unless something is changed since these previous issues that reduces the impact on the ecosystem or maintainers, or there is a real benefit of not using HttpKernel together with HttpFoundation, I'm -1 for this. |
I fail to see how this solves any problem, tbh. An interface would make backwards-compatible changes to our request and response objects a PITA, as would the migration towards those interfaces. Not worth it imho, sorry. |
Closing for the given reasons. |
Description
I believe that to make the code decoupled, it would be interesting to create these interfaces to use, for example, in the httpkernel that forces me to use the http-foundation!
Example
No response
The text was updated successfully, but these errors were encountered: