Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[FrameworkBundle] REFS #11294 Controller class become abstract #12457

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 3, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Publics methods are protected, class become abstract
  • Loading branch information
mickaelandrieu committed Nov 11, 2014
commit 0ab13b9d8eb162fba86eb7035ca75031ac82b51b
32 changes: 16 additions & 16 deletions src/Symfony/Bundle/FrameworkBundle/Controller/Controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
*
* @author Fabien Potencier <[email protected]>
*/
class Controller extends ContainerAware
abstract class Controller extends ContainerAware
{
/**
* Generates a URL from the given parameters.
Expand All @@ -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);
}
Expand All @@ -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);
Expand All @@ -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);
}
Expand Down Expand Up @@ -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);
}
Expand All @@ -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);
}
Expand All @@ -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');

Expand Down Expand Up @@ -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);
}
Expand All @@ -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);
}
Expand All @@ -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);
}
Expand All @@ -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);
}
Expand All @@ -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();
}
Expand All @@ -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.');
Expand All @@ -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.');
Expand All @@ -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);
}
Expand All @@ -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);
}
Expand Down