-
-
Notifications
You must be signed in to change notification settings - Fork 24
Method failure handler (alternative) #270
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
base: master
Are you sure you want to change the base?
Conversation
| $this->methodFailureHandler = $methodFailureHandler === false | ||
| ? null | ||
| : $methodFailureHandler ?? new StandardMethodFailureHandler($responseFactory); |
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.
- What's the goal of not having any handler?
- Ternary condition here is hardly readable. Better to split it.
| use Yiisoft\Http\Method; | ||
| use Yiisoft\Http\Status; | ||
|
|
||
| final class StandardMethodFailureHandler implements MethodFailureHandlerInterface |
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 StandardMethodFailureHandler implements MethodFailureHandlerInterface | |
| final class DefaultMethodFailureHandler implements MethodFailureHandlerInterface |
It's optional behavior, 405 is neither required, nor recommended, it depends on application.
According to rfc code can be 404
|
Uh oh!
There was an error while loading. Please reload this page.