Skip to content

Removed all occurences of $this->getRequest() #3273

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

Closed
wants to merge 1 commit into from

Conversation

lyrixx
Copy link
Member

@lyrixx lyrixx commented Dec 3, 2013

Q A
Doc fix? no
New docs? no
Applies to 2.1
Fixed tickets -

Hello.

The request is a data object, and so the request should not be
inside the container. That's why the request will be removed
from the container in Symfony 3.0

So it is better to let the HttpKernel injects the request when
the user want to use the request.

More over, it is faster. The HttpKernel will always check if the
request should be injected. So injecting the request is time constant.
However, retrieve the request from the container will execute more
calls.

Note: I don't know how to deal with all branches. I did (only on my laptop, not pushed yet) the patch for all branches. This patch is not mergeable without conflicts in 2.2. And it is the same for next branches (because of form chapter). What do you want I do ? Should I open a PR per branches ?

Note2: I just realized I started by the branch 2.1. If you want can I can push all my code, and then you can easily cherry-pick my commits.

The request is a data object, and so the request should not be
inside the container. That's why the request will be removed
from the container in Symfony 3.0

So it is better to let the HttpKernel injects the request when
the user want to use the request.

More over, it is faster. The HttpKernel will always check if the
request should be injected. So injecting the request is time constant.
However, retrieve the request from the container will execute more
calls.

Conflicts:
	book/controller.rst
	cookbook/doctrine/file_uploads.rst
	cookbook/doctrine/registration_form.rst
	cookbook/form/form_collections.rst
	quick_tour/the_controller.rst
@fabpot
Copy link
Member

fabpot commented Dec 3, 2013

👍

@wouterj
Copy link
Member

wouterj commented Dec 3, 2013

👍 (except that you forgot the PR template)

@lyrixx
Copy link
Member Author

lyrixx commented Dec 3, 2013

@wouterj fixed.

@wouterj
Copy link
Member

wouterj commented Dec 3, 2013

btw, to answer your questions:

2.0, 2.1 and (as of today) 2.2 are deprecated, those branches shouldn't be updated anymore. So this PR should be cherry-picked into 2.3. So if you can rebase this to 2.3 (you don't have to create a new PR), it'll be fine.

@weaverryan is fixing the conflicts when merging the 2.3 branch up, you don't have to worry about that :)

@lyrixx
Copy link
Member Author

lyrixx commented Dec 3, 2013

@wouterj I know theses branches are deprecated, but I also now @weaverryan likes patching every branches.

Anyway, The patch are very different for 2.0, 2.1 (2.2 == 2.1) and 2.3
because:

$form->bindRequest() // 2.0
$form->bind() // 2.1
$form->submit() // 2.3

I did not check for 2.4, but I think 2.3 == 2.4.

More over, as I submit this PR againt 2.1, The diff will be very messy if I rebase 2.3

So, for now, I'm waiting @weaverryan wish.

@lyrixx
Copy link
Member Author

lyrixx commented Dec 14, 2013

Closing in favor of #3330

@lyrixx lyrixx closed this Dec 14, 2013
@lyrixx lyrixx deleted the request-2.1 branch December 14, 2013 13:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants