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:
commit
0d4ed2be28
@ -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);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user