-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[HttpFoundation] [WIP] rename Request::$request
to $post
#47938
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
Request::$request
to $form
Request::$request
to $form
I could use some advise on how to create a deprecation layer for this. To avoid a BC break, Also, since $request/$form are public and writable, you can change one without the other... Could we use |
FYI, I chose |
* | ||
* @var InputBag | ||
*/ | ||
public $form; |
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 about naming it $postData
?
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.
the word data
is implicit via the $request object no?
a request (class) transferring a data via http (foundation)
to me $post is good candidate :)
To me, |
@kbond you can organize a pool on slack or here to get some community feedbacks on "proper" new naming |
@@ -89,10 +89,19 @@ class Request | |||
/** | |||
* Request body parameters ($_POST). | |||
* | |||
* @deprecated since Symfony 6.2 | |||
* | |||
* @var InputBag | |||
*/ | |||
public $request; |
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 should probably be implemented through __get
and __set
, to avoid issue where someone re-assign the property, where we would have different instances in the new property and the old one (breaking the BC layer)
Personally don't think its worth renaming this. This will be a hard break for a lot of Systems, which tries in the past supporting multiple Symfony versions. And if I would more go with something based on the http specification. I think there it is also sometimes represented as request, but also as Content / Message or Body. For me In PSR7 it is referenced as |
This is fair. Maybe we could have a longer deprecation cycle? Remove Seems like |
Request::$request
to $form
Request::$request
to $post
My 2-cents: What I liked about the original proposal in #47646 is the fact that we don't have to deprecate This means we don't deprecate Duplicating what I said on Slack: the HTTP spec calls this "request payload body", maybe |
Additionally, |
Ok, I'm going to update this PR to just add |
@kbond Thank you for the great work ! When do you think it would be available please ? |
I'm hoping to get rework this soon and try and get it into 6.3. |
closing in favor of #49614 |
This PR was merged into the 6.3 branch. Discussion ---------- [HttpFoundation] add `Request::getPayload()` | Q | A | ------------- | --- | Branch? | 6.3 | Bug fix? | no | New feature? | yes | Deprecations? | no | Tickets | Fix #47646 | License | MIT | Doc PR | todo Alternative for #47938 based on feedback there. ```php /** `@var` InputBag $input wrapping either Request::$request or Request::toArray() */ $input = $request->getPayload(); ``` Commits ------- 4a0a439 [HttpFoundation] add `Request::getPayload()`
This should alleviate the confusion of what
$request->request
is.TODO: