Skip to content

Commit

Permalink
Added deprecation warning on the base controller getRequest method.
Browse files Browse the repository at this point in the history
  • Loading branch information
Balazs Csaba committed Nov 29, 2014
1 parent d277c16 commit 64a9701
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/Symfony/Bundle/FrameworkBundle/Controller/Controller.php
Expand Up @@ -272,6 +272,8 @@ public function createFormBuilder($data = null, array $options = array())
*/
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();
}

Expand Down

0 comments on commit 64a9701

Please sign in to comment.