-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[HttpFoundation] Make some Request methods static #17379
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
Conversation
Request::getMimeType(), Request::getMimeTypes(), Request::getFormat(), Request::setFormat() are now static
Isn't this a BC break (for people extending the |
@xabbuh needs to be tested but when extending a class we can change it's signature, right? |
Tested this on 5.6:
|
Arf, do you see any solutions? |
The only BC-compatible solution I see is to introduce new static method and deprecate the old ones which then could be removed in 4.0. |
I'm in favor of refactoring the request in general... This class has far too much responsibility and mixed state/stateless. |
Actually, I've been thinking of converting the current Request/Response objects to builders. Parameter converters etc are all working by setting values and the same goes for response listeners. By converting the |
I'm wondering if this functions should really be a part of |
And as you said @iltar, using standard http interfaces from |
See #17392 |
@Ener-Getick we already discussed this in the past, and this would require to change the architecture of the whole framework due to the immutability of the Request (the Response impacts less places, but still breaks BC). This is precisely why we already rejected it in the past |
@stof understood let's just focus on the first goal of this PR ;-) |
Well as @iltar already showed, this is a BC break. So not viable as-is. |
Yeah I'm trying to find a viable solution :-/ |
I close this PR for now as I don't see any clean solution... |
This PR makes
Request::getMimeType()
,Request::getFormat()
andRequest::setFormat()
static.I'll check if this methods are in the docs and if yes, I'll create a pull request for the docs.