-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[HttpFoundation] [Response] replaced hard coded http status by constants #11401
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
[HttpFoundation] [Response] replaced hard coded http status by constants #11401
Conversation
…constant Http status constants were present but not used everywhere in class
@@ -80,6 +80,7 @@ class Response | |||
const HTTP_LOOP_DETECTED = 508; // RFC5842 | |||
const HTTP_NOT_EXTENDED = 510; // RFC2774 | |||
const HTTP_NETWORK_AUTHENTICATION_REQUIRED = 511; // RFC6585 | |||
const HTTP_MAX_LIMIT = 600; |
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.
This is not an HTTP status code, it should not be publicly set as a constant like others.
👎 I don't see any value and I find it way less readable. |
I'm also -1 on this for readability |
👎 constants are useful for the application, but here it does not add anything. Yep. Fount it #9808 |
not at the core no 👎 |
Hi guys, thanks for your replies! @fabpot, @stof, I'm not agree with you. If you think @sstok thanks for the reference, I didn't find it. I see other people think the same as me :) @GromNaN thanks for your note, we could use a private/protected variable for this limit. |
@fmagnan like an accountant need to learn the chart of accounts, web developers need to know HTTP status codes. The wording |
@GromNaN code must give as much information as it can and from that perspective, But decision is yours, not mine, and if you prefer deal with integers instead of labels, as you wish. |
Http status were defined via constants but constants were not used in class so I replaced all calls to hard coded status by corresponding constant.