minor #13445 [2.7] Added deprecation warning for get request service in controller (WouterJ)

This PR was squashed before being merged into the 2.7 branch (closes #13445).

Discussion
----------

[2.7] Added deprecation warning for get request service in controller

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | yes (but well, it's 2.7)
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | -
| License       | MIT
| Doc PR        | -

Commits
-------

becd694 [2.7] Added deprecation warning for get request service in controller
This commit is contained in:
Fabien Potencier 2015-02-11 12:15:18 +01:00
commit 0d4ed2be28

View File

@ -342,6 +342,10 @@ class Controller extends ContainerAware
*/
public function get($id)
{
if ('request' === $id) {
trigger_error('The "request" service is deprecated and will be removed in 3.0. Add a typehint for Symfony\\Component\\HttpFoundation\\Request to your controller parameters to retrieve the request instead.', E_USER_DEPRECATED);
}
return $this->container->get($id);
}