Skip to content

Change all occurrences of Controller to AbstractController #10172

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
Aug 10, 2018
Merged
Show file tree
Hide file tree
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
4 changes: 2 additions & 2 deletions best_practices/forms.rst
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,10 @@ some developers configure form buttons in the controller::
use App\Entity\Post;
use App\Form\PostType;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\Form\Extension\Core\Type\SubmitType;

class PostController extends Controller
class PostController extends AbstractController
{
// ...

Expand Down
20 changes: 10 additions & 10 deletions components/form.rst
Original file line number Diff line number Diff line change
Expand Up @@ -406,12 +406,12 @@ is created from the form factory.
// src/Controller/TaskController.php
namespace App\Controller;

use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Form\Extension\Core\Type\TextType;
use Symfony\Component\Form\Extension\Core\Type\DateType;

class TaskController extends Controller
class TaskController extends AbstractController
{
public function new(Request $request)
{
Expand Down Expand Up @@ -468,11 +468,11 @@ builder:
// src/Controller/DefaultController.php
namespace App\Controller;

use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\Form\Extension\Core\Type\TextType;
use Symfony\Component\Form\Extension\Core\Type\DateType;

class DefaultController extends Controller
class DefaultController extends AbstractController
{
public function new(Request $request)
{
Expand Down Expand Up @@ -550,10 +550,10 @@ by ``handleRequest()`` to determine whether a form has been submitted):
// src/Controller/DefaultController.php
namespace App\Controller;

use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\Form\Extension\Core\Type\FormType;

class DefaultController extends Controller
class DefaultController extends AbstractController
{
public function search()
{
Expand Down Expand Up @@ -612,11 +612,11 @@ method:
// src/Controller/TaskController.php
namespace App\Controller;

use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\Form\Extension\Core\Type\DateType;
use Symfony\Component\Form\Extension\Core\Type\TextType;

class TaskController extends Controller
class TaskController extends AbstractController
{
public function new(Request $request)
{
Expand Down Expand Up @@ -688,13 +688,13 @@ option when building each field:
// src/Controller/DefaultController.php
namespace App\Controller;

use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\Validator\Constraints\NotBlank;
use Symfony\Component\Validator\Constraints\Type;
use Symfony\Component\Form\Extension\Core\Type\DateType;
use Symfony\Component\Form\Extension\Core\Type\TextType;

class DefaultController extends Controller
class DefaultController extends AbstractController
{
public function new(Request $request)
{
Expand Down
8 changes: 4 additions & 4 deletions components/routing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -393,10 +393,10 @@ routes with UTF-8 characters:

namespace App\Controller;

use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\Routing\Annotation\Route;

class DefaultController extends Controller
class DefaultController extends AbstractController
{
/**
* @Route("/category/{name}", name="route1", options={"utf8": true})
Expand Down Expand Up @@ -462,10 +462,10 @@ You can also include UTF-8 strings as routing requirements:

namespace App\Controller;

use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\Routing\Annotation\Route;

class DefaultController extends Controller
class DefaultController extends AbstractController
{
/**
* @Route(
Expand Down
4 changes: 2 additions & 2 deletions configuration/micro_kernel_trait.rst
Original file line number Diff line number Diff line change
Expand Up @@ -249,10 +249,10 @@ has one file in it::
// src/Controller/MicroController.php
namespace App\Controller;

use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\Routing\Annotation\Route;

class MicroController extends Controller
class MicroController extends AbstractController
{
/**
* @Route("/random/{limit}")
Expand Down
6 changes: 3 additions & 3 deletions console/command_in_controller.rst
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@ Run this command from inside your controller via::
namespace App\Controller;

use Symfony\Bundle\FrameworkBundle\Console\Application;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\Console\Input\ArrayInput;
use Symfony\Component\Console\Output\BufferedOutput;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\KernelInterface;

class SpoolController extends Controller
class SpoolController extends AbstractController
{
public function sendSpool($messages = 10, KernelInterface $kernel)
{
Expand Down Expand Up @@ -85,7 +85,7 @@ Now, use it in your controller::
use Symfony\Component\HttpFoundation\Response;
// ...

class SpoolController extends Controller
class SpoolController extends AbstractController
{
public function sendSpool($messages = 10)
{
Expand Down
4 changes: 2 additions & 2 deletions controller/soap_web_service.rst
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,12 @@ can be retrieved via ``/soap?wsdl``::

namespace App\Controller;

use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
use App\Service\HelloService;

class HelloServiceController extends Controller
class HelloServiceController extends AbstractController
{
/**
* @Route("/soap")
Expand Down
4 changes: 2 additions & 2 deletions controller/upload_file.rst
Original file line number Diff line number Diff line change
Expand Up @@ -99,13 +99,13 @@ Finally, you need to update the code of the controller that handles the form::
// src/Controller/ProductController.php
namespace App\Controller;

use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Routing\Annotation\Route;
use App\Entity\Product;
use App\Form\ProductType;

class ProductController extends Controller
class ProductController extends AbstractController
{
/**
* @Route("/product/new", name="app_product_new")
Expand Down
2 changes: 1 addition & 1 deletion doctrine.rst
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ and save it!
// ...
use App\Entity\Product;

class ProductController extends Controller
class ProductController extends AbstractController
{
/**
* @Route("/product", name="product")
Expand Down
2 changes: 1 addition & 1 deletion doctrine/associations.rst
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ Now you can see this new code in action! Imagine you're inside a controller::
use App\Entity\Product;
use Symfony\Component\HttpFoundation\Response;

class ProductController extends Controller
class ProductController extends AbstractController
{
/**
* @Route("/product", name="product")
Expand Down
2 changes: 1 addition & 1 deletion doctrine/dbal.rst
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ object::

use Doctrine\DBAL\Driver\Connection;

class UserController extends Controller
class UserController extends AbstractController
{
public function index(Connection $connection)
{
Expand Down
4 changes: 2 additions & 2 deletions doctrine/multiple_entity_managers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ the default entity manager (i.e. ``default``) is returned::

use Doctrine\ORM\EntityManagerInterface;

class UserController extends Controller
class UserController extends AbstractController
{
public function index(EntityManagerInterface $entityManager)
{
Expand All @@ -247,7 +247,7 @@ The same applies to repository calls::
use AcmeStoreBundle\Entity\Product;
// ...

class UserController extends Controller
class UserController extends AbstractController
{
public function index()
{
Expand Down
4 changes: 2 additions & 2 deletions doctrine/registration_form.rst
Original file line number Diff line number Diff line change
Expand Up @@ -245,12 +245,12 @@ into the database::

use App\Form\UserType;
use App\Entity\User;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Component\Security\Core\Encoder\UserPasswordEncoderInterface;

class RegistrationController extends Controller
class RegistrationController extends AbstractController
{
/**
* @Route("/register", name="user_registration")
Expand Down
4 changes: 2 additions & 2 deletions event_dispatcher/before_after_filters.rst
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,9 @@ A controller that implements this interface simply looks like this::
namespace App\Controller;

use App\Controller\TokenAuthenticatedController;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;

class FooController extends Controller implements TokenAuthenticatedController
class FooController extends AbstractController implements TokenAuthenticatedController
{
// An action that needs authentication
public function bar()
Expand Down
8 changes: 4 additions & 4 deletions form/action_method.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ form, you can use ``setAction()`` and ``setMethod()``:
// src/Controller/DefaultController.php
namespace App\Controller;

use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\Form\Extension\Core\Type\DateType;
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
use Symfony\Component\Form\Extension\Core\Type\TextType;

class DefaultController extends Controller
class DefaultController extends AbstractController
{
public function new()
{
Expand Down Expand Up @@ -79,9 +79,9 @@ options:
namespace App\Controller;

use App\Form\TaskType;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;

class DefaultController extends Controller
class DefaultController extends AbstractController
{
public function new()
{
Expand Down
8 changes: 4 additions & 4 deletions form/dynamic_form_modification.rst
Original file line number Diff line number Diff line change
Expand Up @@ -329,9 +329,9 @@ type as a service.

In a controller, create the form like normal::

use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;

class FriendMessageController extends Controller
class FriendMessageController extends AbstractController
{
public function new(Request $request)
{
Expand Down Expand Up @@ -504,13 +504,13 @@ your application. Assume that you have a sport meetup creation controller::
// src/Controller/MeetupController.php
namespace App\Controller;

use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Request;
use App\Entity\SportMeetup;
use App\Form\Type\SportMeetupType;
// ...

class MeetupController extends Controller
class MeetupController extends AbstractController
{
public function create(Request $request)
{
Expand Down
4 changes: 2 additions & 2 deletions form/form_collections.rst
Original file line number Diff line number Diff line change
Expand Up @@ -152,9 +152,9 @@ In your controller, you'll create a new form from the ``TaskType``::
use App\Entity\Tag;
use App\Form\Type\TaskType;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;

class TaskController extends Controller
class TaskController extends AbstractController
{
public function new(Request $request)
{
Expand Down
4 changes: 2 additions & 2 deletions forms.rst
Original file line number Diff line number Diff line change
Expand Up @@ -92,13 +92,13 @@ from inside a controller::
namespace App\Controller;

use App\Entity\Task;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Form\Extension\Core\Type\TextType;
use Symfony\Component\Form\Extension\Core\Type\DateType;
use Symfony\Component\Form\Extension\Core\Type\SubmitType;

class DefaultController extends Controller
class DefaultController extends AbstractController
{
public function new(Request $request)
{
Expand Down
4 changes: 2 additions & 2 deletions http_cache/esi.rst
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ independent of the rest of the page::
// src/Controller/DefaultController.php

// ...
class DefaultController extends Controller
class DefaultController extends AbstractController
{
public function about()
{
Expand Down Expand Up @@ -165,7 +165,7 @@ of the master page::
namespace App\Controller;

// ...
class NewsController extends Controller
class NewsController extends AbstractController
{
public function latest($maxPerPage)
{
Expand Down
6 changes: 3 additions & 3 deletions http_cache/validation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ To see a simple implementation, generate the ETag as the md5 of the content::

use Symfony\Component\HttpFoundation\Request;

class DefaultController extends Controller
class DefaultController extends AbstractController
{
public function homepage(Request $request)
{
Expand Down Expand Up @@ -129,7 +129,7 @@ header value::
use Symfony\Component\HttpFoundation\Request;
use App\Entity\Article;

class ArticleController extends Controller
class ArticleController extends AbstractController
{
public function show(Article $article, Request $request)
{
Expand Down Expand Up @@ -188,7 +188,7 @@ exposing a simple and efficient pattern::
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpFoundation\Request;

class ArticleController extends Controller
class ArticleController extends AbstractController
{
public function show($articleSlug, Request $request)
{
Expand Down
4 changes: 2 additions & 2 deletions introduction/from_flat_php_to_symfony2.rst
Original file line number Diff line number Diff line change
Expand Up @@ -543,9 +543,9 @@ them for you. Here's the same sample application, now built in Symfony::
namespace App\Controller;

use App\Entity\Post;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;

class BlogController extends Controller
class BlogController extends AbstractController
{
public function list()
{
Expand Down
Loading