-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[HttpFoundation] add @throws to getPayload #50492
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
Thank you @wiseguy1394. |
@@ -1508,6 +1508,8 @@ public function getContent(bool $asResource = false) | |||
|
|||
/** | |||
* Gets the decoded form or json request body. | |||
* | |||
* @throws JsonException When the body cannot be decoded to an array |
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.
should be RequestExceptionInterface
IMHO
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.
Why not exact JsonException?
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.
@wiseguy1394 catching the general case seems more future proof
but no strong opionion, i dont believe in @throws
bookkeeping anyway :)
Behavior changed in #50730 for empty contents. |
Fixes #50490