diff --git a/src/Symfony/Bundle/FrameworkBundle/Controller/Controller.php b/src/Symfony/Bundle/FrameworkBundle/Controller/Controller.php index b3c7f42c2ce27..156d7b4aab6c9 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Controller/Controller.php +++ b/src/Symfony/Bundle/FrameworkBundle/Controller/Controller.php @@ -33,7 +33,7 @@ * * @author Fabien Potencier */ -class Controller extends ContainerAware +abstract class Controller extends ContainerAware { /** * Generates a URL from the given parameters. @@ -46,7 +46,7 @@ class Controller extends ContainerAware * * @see UrlGeneratorInterface */ - public function generateUrl($route, $parameters = array(), $referenceType = UrlGeneratorInterface::ABSOLUTE_PATH) + protected function generateUrl($route, $parameters = array(), $referenceType = UrlGeneratorInterface::ABSOLUTE_PATH) { return $this->container->get('router')->generate($route, $parameters, $referenceType); } @@ -60,7 +60,7 @@ public function generateUrl($route, $parameters = array(), $referenceType = UrlG * * @return Response A Response instance */ - public function forward($controller, array $path = array(), array $query = array()) + protected function forward($controller, array $path = array(), array $query = array()) { $path['_controller'] = $controller; $subRequest = $this->container->get('request_stack')->getCurrentRequest()->duplicate($query, null, $path); @@ -76,7 +76,7 @@ public function forward($controller, array $path = array(), array $query = array * * @return RedirectResponse */ - public function redirect($url, $status = 302) + protected function redirect($url, $status = 302) { return new RedirectResponse($url, $status); } @@ -155,7 +155,7 @@ protected function denyAccessUnlessGranted($attributes, $object = null, $message * * @return string The rendered view */ - public function renderView($view, array $parameters = array()) + protected function renderView($view, array $parameters = array()) { return $this->container->get('templating')->render($view, $parameters); } @@ -169,7 +169,7 @@ public function renderView($view, array $parameters = array()) * * @return Response A Response instance */ - public function render($view, array $parameters = array(), Response $response = null) + protected function render($view, array $parameters = array(), Response $response = null) { return $this->container->get('templating')->renderResponse($view, $parameters, $response); } @@ -183,7 +183,7 @@ public function render($view, array $parameters = array(), Response $response = * * @return StreamedResponse A StreamedResponse instance */ - public function stream($view, array $parameters = array(), StreamedResponse $response = null) + protected function stream($view, array $parameters = array(), StreamedResponse $response = null) { $templating = $this->container->get('templating'); @@ -212,7 +212,7 @@ public function stream($view, array $parameters = array(), StreamedResponse $res * * @return NotFoundHttpException */ - public function createNotFoundException($message = 'Not Found', \Exception $previous = null) + protected function createNotFoundException($message = 'Not Found', \Exception $previous = null) { return new NotFoundHttpException($message, $previous); } @@ -229,7 +229,7 @@ public function createNotFoundException($message = 'Not Found', \Exception $prev * * @return AccessDeniedException */ - public function createAccessDeniedException($message = 'Access Denied', \Exception $previous = null) + protected function createAccessDeniedException($message = 'Access Denied', \Exception $previous = null) { return new AccessDeniedException($message, $previous); } @@ -243,7 +243,7 @@ public function createAccessDeniedException($message = 'Access Denied', \Excepti * * @return Form */ - public function createForm($type, $data = null, array $options = array()) + protected function createForm($type, $data = null, array $options = array()) { return $this->container->get('form.factory')->create($type, $data, $options); } @@ -256,7 +256,7 @@ public function createForm($type, $data = null, array $options = array()) * * @return FormBuilder */ - public function createFormBuilder($data = null, array $options = array()) + protected function createFormBuilder($data = null, array $options = array()) { return $this->container->get('form.factory')->createBuilder('form', $data, $options); } @@ -270,7 +270,7 @@ public function createFormBuilder($data = null, array $options = array()) * Symfony to inject the Request object into your controller * method instead by type hinting it in the method's signature. */ - public function getRequest() + protected function getRequest() { return $this->container->get('request_stack')->getCurrentRequest(); } @@ -282,7 +282,7 @@ public function getRequest() * * @throws \LogicException If DoctrineBundle is not available */ - public function getDoctrine() + protected function getDoctrine() { if (!$this->container->has('doctrine')) { throw new \LogicException('The DoctrineBundle is not registered in your application.'); @@ -300,7 +300,7 @@ public function getDoctrine() * * @see Symfony\Component\Security\Core\Authentication\Token\TokenInterface::getUser() */ - public function getUser() + protected function getUser() { if (!$this->container->has('security.context')) { throw new \LogicException('The SecurityBundle is not registered in your application.'); @@ -324,7 +324,7 @@ public function getUser() * * @return bool true if the service id is defined, false otherwise */ - public function has($id) + protected function has($id) { return $this->container->has($id); } @@ -336,7 +336,7 @@ public function has($id) * * @return object The service */ - public function get($id) + protected function get($id) { return $this->container->get($id); }