Publics methods are protected, class become abstract

This commit is contained in:
Mickaël Andrieu 2014-11-11 19:15:15 +01:00
parent d8f839d7a1
commit 0ab13b9d8e

View File

@ -33,7 +33,7 @@ use Doctrine\Bundle\DoctrineBundle\Registry;
*
* @author Fabien Potencier <fabien@symfony.com>
*/
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 @@ class Controller extends ContainerAware
*
* @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 @@ class Controller extends ContainerAware
*
* @return RedirectResponse
*/
public function redirect($url, $status = 302)
protected function redirect($url, $status = 302)
{
return new RedirectResponse($url, $status);
}
@ -155,7 +155,7 @@ class Controller extends ContainerAware
*
* @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 @@ class Controller extends ContainerAware
*
* @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 @@ class Controller extends ContainerAware
*
* @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 @@ class Controller extends ContainerAware
*
* @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 @@ class Controller extends ContainerAware
*
* @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 @@ class Controller extends ContainerAware
*
* @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 @@ class Controller extends ContainerAware
*
* @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 @@ class Controller extends ContainerAware
* 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 @@ class Controller extends ContainerAware
*
* @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 @@ class Controller extends ContainerAware
*
* @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 @@ class Controller extends ContainerAware
*
* @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 @@ class Controller extends ContainerAware
*
* @return object The service
*/
public function get($id)
protected function get($id)
{
return $this->container->get($id);
}