Added deprecation warning on the base controller getRequest method.

This commit is contained in:
Balazs Csaba 2014-11-29 12:29:53 +02:00
parent d277c16a27
commit 64a9701b1b

View File

@ -272,6 +272,8 @@ class Controller extends ContainerAware
*/ */
public function getRequest() public function getRequest()
{ {
trigger_error('The "getRequest" method of the base "Controller" class has been deprecated since Symfony 2.4 and will be removed in 3.0. The only reliable way to get the "Request" object is to inject it in the action method.', E_USER_DEPRECATED);
return $this->container->get('request_stack')->getCurrentRequest(); return $this->container->get('request_stack')->getCurrentRequest();
} }