Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[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

Merged
merged 1 commit into from
May 31, 2023
Merged

[HttpFoundation] add @throws to getPayload #50492

merged 1 commit into from
May 31, 2023

Conversation

wiseguy1394
Copy link
Contributor

Q A
Branch? 6.3
Bug fix? yes
New feature? no
Deprecations? no
Tickets Fix #50490
License MIT

Fixes #50490

@carsonbot carsonbot added this to the 6.4 milestone May 31, 2023
@wiseguy1394 wiseguy1394 changed the base branch from 6.4 to 6.3 May 31, 2023 08:26
@nicolas-grekas nicolas-grekas modified the milestones: 6.4, 6.3 May 31, 2023
@symfony symfony deleted a comment from carsonbot May 31, 2023
@nicolas-grekas
Copy link
Member

Thank you @wiseguy1394.

@nicolas-grekas nicolas-grekas merged commit 7e7adcc into symfony:6.3 May 31, 2023
@@ -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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be RequestExceptionInterface IMHO

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not exact JsonException?

Copy link
Contributor

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 :)

@nicolas-grekas
Copy link
Member

Behavior changed in #50730 for empty contents.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[HttpFoundation] getPayload throws JsonException if request body is empty.
4 participants