-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
[Discussion] Status Code as Constants #2310
Comments
We already have this baked in. https://github.com/slimphp/Slim/blob/3.x/Slim/Http/Response.php#L48-L118 I don't see the problem it solves. If you don't know the status code you wish to use then you need to know the name it uses... which often times is not really a name that you think of... example |
To me, error codes are more clear than the titles of the errors. So no, it will only make things worse. |
I'm not against it. I would use |
@akrabat Nothing can really be done on 3.x... but this should be raised on slimphp/http |
Going to close this here, it's open on Http and we can change the constants in 4.x |
Hey,
I just wanted to bring up a discussion for later releases on adding the status codes as constants to the Response class. Similarly to http://api.symfony.com/3.4/Symfony/Component/HttpFoundation/Response.html
I feel like it is much more beneficial coding using constants instead of status code of say
422
or400
. For example, users can now use the constants in their code like Response::HTTP_UNPROCESSABLE_ENTITY or Response::HTTP_BAD_REQUEST.Thoughts?
Thanks for your time and consideration.
The text was updated successfully, but these errors were encountered: