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

Skip to content

Commit 92a7416

Browse files
committed
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
2 parents 929f1d9 + 0ab13b9 commit 92a7416

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

src/Symfony/Bundle/FrameworkBundle/Controller/Controller.php

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
*
3535
* @author Fabien Potencier <[email protected]>
3636
*/
37-
class Controller extends ContainerAware
37+
abstract class Controller extends ContainerAware
3838
{
3939
/**
4040
* Generates a URL from the given parameters.
@@ -47,7 +47,7 @@ class Controller extends ContainerAware
4747
*
4848
* @see UrlGeneratorInterface
4949
*/
50-
public function generateUrl($route, $parameters = array(), $referenceType = UrlGeneratorInterface::ABSOLUTE_PATH)
50+
protected function generateUrl($route, $parameters = array(), $referenceType = UrlGeneratorInterface::ABSOLUTE_PATH)
5151
{
5252
return $this->container->get('router')->generate($route, $parameters, $referenceType);
5353
}
@@ -61,7 +61,7 @@ public function generateUrl($route, $parameters = array(), $referenceType = UrlG
6161
*
6262
* @return Response A Response instance
6363
*/
64-
public function forward($controller, array $path = array(), array $query = array())
64+
protected function forward($controller, array $path = array(), array $query = array())
6565
{
6666
$path['_controller'] = $controller;
6767
$subRequest = $this->container->get('request_stack')->getCurrentRequest()->duplicate($query, null, $path);
@@ -77,7 +77,7 @@ public function forward($controller, array $path = array(), array $query = array
7777
*
7878
* @return RedirectResponse
7979
*/
80-
public function redirect($url, $status = 302)
80+
protected function redirect($url, $status = 302)
8181
{
8282
return new RedirectResponse($url, $status);
8383
}
@@ -156,7 +156,7 @@ protected function denyAccessUnlessGranted($attributes, $object = null, $message
156156
*
157157
* @return string The rendered view
158158
*/
159-
public function renderView($view, array $parameters = array())
159+
protected function renderView($view, array $parameters = array())
160160
{
161161
return $this->container->get('templating')->render($view, $parameters);
162162
}
@@ -170,7 +170,7 @@ public function renderView($view, array $parameters = array())
170170
*
171171
* @return Response A Response instance
172172
*/
173-
public function render($view, array $parameters = array(), Response $response = null)
173+
protected function render($view, array $parameters = array(), Response $response = null)
174174
{
175175
return $this->container->get('templating')->renderResponse($view, $parameters, $response);
176176
}
@@ -184,7 +184,7 @@ public function render($view, array $parameters = array(), Response $response =
184184
*
185185
* @return StreamedResponse A StreamedResponse instance
186186
*/
187-
public function stream($view, array $parameters = array(), StreamedResponse $response = null)
187+
protected function stream($view, array $parameters = array(), StreamedResponse $response = null)
188188
{
189189
$templating = $this->container->get('templating');
190190

@@ -213,7 +213,7 @@ public function stream($view, array $parameters = array(), StreamedResponse $res
213213
*
214214
* @return NotFoundHttpException
215215
*/
216-
public function createNotFoundException($message = 'Not Found', \Exception $previous = null)
216+
protected function createNotFoundException($message = 'Not Found', \Exception $previous = null)
217217
{
218218
return new NotFoundHttpException($message, $previous);
219219
}
@@ -230,7 +230,7 @@ public function createNotFoundException($message = 'Not Found', \Exception $prev
230230
*
231231
* @return AccessDeniedException
232232
*/
233-
public function createAccessDeniedException($message = 'Access Denied', \Exception $previous = null)
233+
protected function createAccessDeniedException($message = 'Access Denied', \Exception $previous = null)
234234
{
235235
return new AccessDeniedException($message, $previous);
236236
}
@@ -244,7 +244,7 @@ public function createAccessDeniedException($message = 'Access Denied', \Excepti
244244
*
245245
* @return Form
246246
*/
247-
public function createForm($type, $data = null, array $options = array())
247+
protected function createForm($type, $data = null, array $options = array())
248248
{
249249
return $this->container->get('form.factory')->create($type, $data, $options);
250250
}
@@ -257,7 +257,7 @@ public function createForm($type, $data = null, array $options = array())
257257
*
258258
* @return FormBuilder
259259
*/
260-
public function createFormBuilder($data = null, array $options = array())
260+
protected function createFormBuilder($data = null, array $options = array())
261261
{
262262
return $this->container->get('form.factory')->createBuilder('form', $data, $options);
263263
}
@@ -269,7 +269,7 @@ public function createFormBuilder($data = null, array $options = array())
269269
*
270270
* @throws \LogicException If DoctrineBundle is not available
271271
*/
272-
public function getDoctrine()
272+
protected function getDoctrine()
273273
{
274274
if (!$this->container->has('doctrine')) {
275275
throw new \LogicException('The DoctrineBundle is not registered in your application.');
@@ -287,7 +287,7 @@ public function getDoctrine()
287287
*
288288
* @see TokenInterface::getUser()
289289
*/
290-
public function getUser()
290+
protected function getUser()
291291
{
292292
if (!$this->container->has('security.context')) {
293293
throw new \LogicException('The SecurityBundle is not registered in your application.');
@@ -311,7 +311,7 @@ public function getUser()
311311
*
312312
* @return bool true if the service id is defined, false otherwise
313313
*/
314-
public function has($id)
314+
protected function has($id)
315315
{
316316
return $this->container->has($id);
317317
}
@@ -323,7 +323,7 @@ public function has($id)
323323
*
324324
* @return object The service
325325
*/
326-
public function get($id)
326+
protected function get($id)
327327
{
328328
return $this->container->get($id);
329329
}

0 commit comments

Comments
 (0)