symfony/symfony-docs — pull request #3330 by lyrixx (2013-12-14 13:52:55+00:00)
Title: Removed all occurences of $this->getRequest()

| Q | A
| ------------- | ---
| Doc fix? | no
| New docs? | no
| Applies to | 2.3
| 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.