feature #12457 [FrameworkBundle] REFS #11294 Controller class become abstract (mickaelandrieu)

This PR was merged into the 3.0-dev branch.

Discussion
----------

[FrameworkBundle] REFS #11294 Controller class become abstract

| Q             | A
| ------------- | ---
| Bug fix?      | [no]
| New feature?  | [no]
| BC breaks?    | [yes]
| Deprecations? | [no]
| Tests pass?   | [no]
| Fixed tickets | [#11294]
| License       | MIT
| Doc PR        | []

Commits
-------

0ab13b9 Publics methods are protected, class become abstract
This commit is contained in:
Fabien Potencier 2015-01-03 11:31:18 +01:00
commit 92a741603c

View File

@ -34,7 +34,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.
@ -47,7 +47,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);
}
@ -61,7 +61,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);
@ -77,7 +77,7 @@ class Controller extends ContainerAware
*
* @return RedirectResponse
*/
public function redirect($url, $status = 302)
protected function redirect($url, $status = 302)
{
return new RedirectResponse($url, $status);
}
@ -156,7 +156,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);
}
@ -170,7 +170,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);
}
@ -184,7 +184,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');
@ -213,7 +213,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);
}
@ -230,7 +230,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);
}
@ -244,7 +244,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);
}
@ -257,7 +257,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);
}
@ -269,7 +269,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.');
@ -287,7 +287,7 @@ class Controller extends ContainerAware
*
* @see 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.');
@ -311,7 +311,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);
}
@ -323,7 +323,7 @@ class Controller extends ContainerAware
*
* @return object The service
*/
public function get($id)
protected function get($id)
{
return $this->container->get($id);
}