From 0775f0a6eb0778b9fa4a96d8da06ce2baaa70c97 Mon Sep 17 00:00:00 2001 From: Roy Klutman Date: Fri, 10 Aug 2018 15:48:30 +0200 Subject: [PATCH] Change all occurrences of Controller to AbstractController Since AbstractController is now the default, changed all occurrences of Controller to AbstractController. --- best_practices/forms.rst | 4 ++-- components/form.rst | 20 ++++++++++---------- components/routing.rst | 8 ++++---- configuration/micro_kernel_trait.rst | 4 ++-- console/command_in_controller.rst | 6 +++--- controller/soap_web_service.rst | 4 ++-- controller/upload_file.rst | 4 ++-- doctrine.rst | 2 +- doctrine/associations.rst | 2 +- doctrine/dbal.rst | 2 +- doctrine/multiple_entity_managers.rst | 4 ++-- doctrine/registration_form.rst | 4 ++-- event_dispatcher/before_after_filters.rst | 4 ++-- form/action_method.rst | 8 ++++---- form/dynamic_form_modification.rst | 8 ++++---- form/form_collections.rst | 4 ++-- forms.rst | 4 ++-- http_cache/esi.rst | 4 ++-- http_cache/validation.rst | 6 +++--- introduction/from_flat_php_to_symfony2.rst | 4 ++-- messenger.rst | 4 ++-- routing/custom_route_loader.rst | 4 ++-- routing/external_resources.rst | 2 +- routing/hostname_pattern.rst | 20 ++++++++++---------- routing/optional_placeholders.rst | 2 +- routing/requirements.rst | 8 ++++---- routing/scheme.rst | 4 ++-- security.rst | 4 ++-- security/form_login_setup.rst | 6 +++--- security/json_login_setup.rst | 4 ++-- security/voters.rst | 2 +- serializer.rst | 4 ++-- service_container/3.3-di-changes.rst | 2 +- service_container/autowiring.rst | 4 ++-- templating.rst | 4 ++-- templating/debug.rst | 2 +- templating/embedding_controllers.rst | 2 +- templating/formats.rst | 2 +- workflow/usage.rst | 4 ++-- 39 files changed, 95 insertions(+), 95 deletions(-) diff --git a/best_practices/forms.rst b/best_practices/forms.rst index 35be1f894e7..b2c6c9d64cb 100644 --- a/best_practices/forms.rst +++ b/best_practices/forms.rst @@ -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 { // ... diff --git a/components/form.rst b/components/form.rst index 3c61ade8273..a02d67491b2 100644 --- a/components/form.rst +++ b/components/form.rst @@ -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) { @@ -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) { @@ -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() { @@ -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) { @@ -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) { diff --git a/components/routing.rst b/components/routing.rst index e8657cd9bb7..79e1bcc41c1 100644 --- a/components/routing.rst +++ b/components/routing.rst @@ -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}) @@ -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( diff --git a/configuration/micro_kernel_trait.rst b/configuration/micro_kernel_trait.rst index a4b6d162b6f..c4577f8d179 100644 --- a/configuration/micro_kernel_trait.rst +++ b/configuration/micro_kernel_trait.rst @@ -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}") diff --git a/console/command_in_controller.rst b/console/command_in_controller.rst index 101806c60cf..803a456649e 100644 --- a/console/command_in_controller.rst +++ b/console/command_in_controller.rst @@ -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) { @@ -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) { diff --git a/controller/soap_web_service.rst b/controller/soap_web_service.rst index d41576cb414..85e2dfa4ef2 100644 --- a/controller/soap_web_service.rst +++ b/controller/soap_web_service.rst @@ -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") diff --git a/controller/upload_file.rst b/controller/upload_file.rst index 66b6f9bd33d..8ff80e7debd 100644 --- a/controller/upload_file.rst +++ b/controller/upload_file.rst @@ -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") diff --git a/doctrine.rst b/doctrine.rst index 74009d7d0fa..f7e8a310a6d 100644 --- a/doctrine.rst +++ b/doctrine.rst @@ -336,7 +336,7 @@ and save it! // ... use App\Entity\Product; - class ProductController extends Controller + class ProductController extends AbstractController { /** * @Route("/product", name="product") diff --git a/doctrine/associations.rst b/doctrine/associations.rst index c798beb6cc1..48673288e8e 100644 --- a/doctrine/associations.rst +++ b/doctrine/associations.rst @@ -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") diff --git a/doctrine/dbal.rst b/doctrine/dbal.rst index ba0c8327657..27e87401fe4 100644 --- a/doctrine/dbal.rst +++ b/doctrine/dbal.rst @@ -45,7 +45,7 @@ object:: use Doctrine\DBAL\Driver\Connection; - class UserController extends Controller + class UserController extends AbstractController { public function index(Connection $connection) { diff --git a/doctrine/multiple_entity_managers.rst b/doctrine/multiple_entity_managers.rst index ba14d896be1..db57d81461c 100644 --- a/doctrine/multiple_entity_managers.rst +++ b/doctrine/multiple_entity_managers.rst @@ -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) { @@ -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() { diff --git a/doctrine/registration_form.rst b/doctrine/registration_form.rst index 3f799c12e54..2c615e96afe 100644 --- a/doctrine/registration_form.rst +++ b/doctrine/registration_form.rst @@ -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") diff --git a/event_dispatcher/before_after_filters.rst b/event_dispatcher/before_after_filters.rst index 066b495e79c..abe5fd6a56d 100644 --- a/event_dispatcher/before_after_filters.rst +++ b/event_dispatcher/before_after_filters.rst @@ -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() diff --git a/form/action_method.rst b/form/action_method.rst index cb1867f0f7d..d97b5edd6be 100644 --- a/form/action_method.rst +++ b/form/action_method.rst @@ -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() { @@ -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() { diff --git a/form/dynamic_form_modification.rst b/form/dynamic_form_modification.rst index c22b5891320..629ed0e73b8 100644 --- a/form/dynamic_form_modification.rst +++ b/form/dynamic_form_modification.rst @@ -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) { @@ -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) { diff --git a/form/form_collections.rst b/form/form_collections.rst index 046ac131827..04ac922e044 100644 --- a/form/form_collections.rst +++ b/form/form_collections.rst @@ -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) { diff --git a/forms.rst b/forms.rst index c11b508269a..10b274ab935 100644 --- a/forms.rst +++ b/forms.rst @@ -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) { diff --git a/http_cache/esi.rst b/http_cache/esi.rst index 76a5f26f4eb..ac190bf386d 100644 --- a/http_cache/esi.rst +++ b/http_cache/esi.rst @@ -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() { @@ -165,7 +165,7 @@ of the master page:: namespace App\Controller; // ... - class NewsController extends Controller + class NewsController extends AbstractController { public function latest($maxPerPage) { diff --git a/http_cache/validation.rst b/http_cache/validation.rst index c4ea6b5dffc..c39fb838547 100644 --- a/http_cache/validation.rst +++ b/http_cache/validation.rst @@ -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) { @@ -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) { @@ -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) { diff --git a/introduction/from_flat_php_to_symfony2.rst b/introduction/from_flat_php_to_symfony2.rst index 70231e880d2..eea447a847c 100644 --- a/introduction/from_flat_php_to_symfony2.rst +++ b/introduction/from_flat_php_to_symfony2.rst @@ -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() { diff --git a/messenger.rst b/messenger.rst index 61c7f4cf4ec..1da719ff442 100644 --- a/messenger.rst +++ b/messenger.rst @@ -29,10 +29,10 @@ you need it, like in a controller:: namespace App\Controller; use App\Message\SendNotification; - use Symfony\Bundle\FrameworkBundle\Controller\Controller; + use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\Messenger\MessageBusInterface; - class DefaultController extends Controller + class DefaultController extends AbstractController { public function index(MessageBusInterface $bus) { diff --git a/routing/custom_route_loader.rst b/routing/custom_route_loader.rst index 0c819ed6c87..ae727f9af33 100644 --- a/routing/custom_route_loader.rst +++ b/routing/custom_route_loader.rst @@ -174,9 +174,9 @@ have to create an ``extra()`` method in the ``ExtraController``:: namespace App\Controller; use Symfony\Component\HttpFoundation\Response; - use Symfony\Bundle\FrameworkBundle\Controller\Controller; + use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; - class ExtraController extends Controller + class ExtraController extends AbstractController { public function extra($parameter) { diff --git a/routing/external_resources.rst b/routing/external_resources.rst index 4135bd295f9..75c5185771b 100644 --- a/routing/external_resources.rst +++ b/routing/external_resources.rst @@ -209,7 +209,7 @@ a controller class or imported from a configuration file: /** * @Route(name="blog_") */ - class BlogController extends Controller + class BlogController extends AbstractController { /** * @Route("/blog", name="index") diff --git a/routing/hostname_pattern.rst b/routing/hostname_pattern.rst index f45dac1b337..98fc2c7cde0 100644 --- a/routing/hostname_pattern.rst +++ b/routing/hostname_pattern.rst @@ -13,10 +13,10 @@ You can also match on the HTTP *host* of the incoming request. // src/Controller/MainController.php namespace App\Controller; - use Symfony\Bundle\FrameworkBundle\Controller\Controller; + use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\Routing\Annotation\Route; - class MainController extends Controller + class MainController extends AbstractController { /** * @Route("/", name="mobile_homepage", host="m.example.com") @@ -98,10 +98,10 @@ you can use placeholders in your hostname: // src/Controller/MainController.php namespace App\Controller; - use Symfony\Bundle\FrameworkBundle\Controller\Controller; + use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\Routing\Annotation\Route; - class MainController extends Controller + class MainController extends AbstractController { /** * @Route("/", name="projects_homepage", host="{project_name}.example.com") @@ -178,10 +178,10 @@ instance, if you want to match both ``m.example.com`` and // src/Controller/MainController.php namespace App\Controller; - use Symfony\Bundle\FrameworkBundle\Controller\Controller; + use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\Routing\Annotation\Route; - class MainController extends Controller + class MainController extends AbstractController { /** * @Route( @@ -274,10 +274,10 @@ instance, if you want to match both ``m.example.com`` and // src/Controller/MainController.php namespace App\Controller; - use Symfony\Bundle\FrameworkBundle\Controller\Controller; + use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\Routing\Annotation\Route; - class MainController extends Controller + class MainController extends AbstractController { /** * @Route( @@ -378,13 +378,13 @@ You can also set the host option on imported routes: // src/Controller/MainController.php namespace App\Controller; - use Symfony\Bundle\FrameworkBundle\Controller\Controller; + use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\Routing\Annotation\Route; /** * @Route(host="hello.example.com") */ - class MainController extends Controller + class MainController extends AbstractController { // ... } diff --git a/routing/optional_placeholders.rst b/routing/optional_placeholders.rst index 273e3512d4b..e6cb60689ab 100644 --- a/routing/optional_placeholders.rst +++ b/routing/optional_placeholders.rst @@ -14,7 +14,7 @@ the available blog posts for this imaginary blog application: // src/Controller/BlogController.php // ... - class BlogController extends Controller + class BlogController extends AbstractController { // ... diff --git a/routing/requirements.rst b/routing/requirements.rst index 3218b530cf7..e26ff90fed6 100644 --- a/routing/requirements.rst +++ b/routing/requirements.rst @@ -15,10 +15,10 @@ a routing ``{wildcard}`` to only match some regular expression: // src/Controller/BlogController.php namespace App\Controller; - use Symfony\Bundle\FrameworkBundle\Controller\Controller; + use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\Routing\Annotation\Route; - class BlogController extends Controller + class BlogController extends AbstractController { /** * @Route("/blog/{page}", name="blog_list", requirements={"page"="\d+"}) @@ -94,7 +94,7 @@ URL: // src/Controller/MainController.php // ... - class MainController extends Controller + class MainController extends AbstractController { /** * @Route("/{_locale}", defaults={"_locale"="en"}, requirements={ @@ -196,7 +196,7 @@ accomplished with the following route configuration: // ... - class BlogApiController extends Controller + class BlogApiController extends AbstractController { /** * @Route("/api/posts/{id}", methods={"GET","HEAD"}) diff --git a/routing/scheme.rst b/routing/scheme.rst index d44f573764c..25ed64cded2 100644 --- a/routing/scheme.rst +++ b/routing/scheme.rst @@ -15,10 +15,10 @@ the URI scheme via schemes: // src/Controller/MainController.php namespace App\Controller; - use Symfony\Bundle\FrameworkBundle\Controller\Controller; + use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\Routing\Annotation\Route; - class MainController extends Controller + class MainController extends AbstractController { /** * @Route("/secure", name="secure", schemes={"https"}) diff --git a/security.rst b/security.rst index f55efd0c4bd..4715279c444 100644 --- a/security.rst +++ b/security.rst @@ -216,11 +216,11 @@ example, if you use annotations, create something like this:: // src/Controller/DefaultController.php // ... - use Symfony\Bundle\FrameworkBundle\Controller\Controller; + use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\Routing\Annotation\Route; - class DefaultController extends Controller + class DefaultController extends AbstractController { /** * @Route("/admin") diff --git a/security/form_login_setup.rst b/security/form_login_setup.rst index a42df170fcb..adcd3582872 100644 --- a/security/form_login_setup.rst +++ b/security/form_login_setup.rst @@ -75,9 +75,9 @@ is your job. First, create a new ``SecurityController`` inside a bundle:: // src/Controller/SecurityController.php namespace App\Controller; - use Symfony\Bundle\FrameworkBundle\Controller\Controller; + use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; - class SecurityController extends Controller + class SecurityController extends AbstractController { } @@ -93,7 +93,7 @@ configuration (``login``): // ... use Symfony\Component\Routing\Annotation\Route; - class SecurityController extends Controller + class SecurityController extends AbstractController { /** * @Route("/login", name="login") diff --git a/security/json_login_setup.rst b/security/json_login_setup.rst index ee2ebad7a46..3310155227d 100644 --- a/security/json_login_setup.rst +++ b/security/json_login_setup.rst @@ -69,11 +69,11 @@ path: // src/Controller/SecurityController.php // ... - use Symfony\Bundle\FrameworkBundle\Controller\Controller; + use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\Routing\Annotation\Route; - class SecurityController extends Controller + class SecurityController extends AbstractController { /** * @Route("/login", name="login") diff --git a/security/voters.rst b/security/voters.rst index ec817f5b6c2..5fc6022d9f0 100644 --- a/security/voters.rst +++ b/security/voters.rst @@ -54,7 +54,7 @@ code like this:: // src/Controller/PostController.php // ... - class PostController extends Controller + class PostController extends AbstractController { /** * @Route("/posts/{id}", name="post_show") diff --git a/serializer.rst b/serializer.rst index 79e9497e264..f8d96782487 100644 --- a/serializer.rst +++ b/serializer.rst @@ -30,10 +30,10 @@ you need it or it can be used in a controller:: // src/Controller/DefaultController.php namespace App\Controller; - use Symfony\Bundle\FrameworkBundle\Controller\Controller; + use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\Serializer\SerializerInterface; - class DefaultController extends Controller + class DefaultController extends AbstractController { public function index(SerializerInterface $serializer) { diff --git a/service_container/3.3-di-changes.rst b/service_container/3.3-di-changes.rst index fdd827b61c6..33a036413dc 100644 --- a/service_container/3.3-di-changes.rst +++ b/service_container/3.3-di-changes.rst @@ -343,7 +343,7 @@ action methods, just like you can with the constructor of services. For example: use Psr\Log\LoggerInterface; - class InvoiceController extends Controller + class InvoiceController extends AbstractController { public function listInvoices(LoggerInterface $logger) { diff --git a/service_container/autowiring.rst b/service_container/autowiring.rst index ddd6a4618e1..621a2171c32 100644 --- a/service_container/autowiring.rst +++ b/service_container/autowiring.rst @@ -125,10 +125,10 @@ Now, you can use the ``TwitterClient`` service immediately in a controller:: namespace App\Controller; use App\Service\TwitterClient; - 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("/tweet") diff --git a/templating.rst b/templating.rst index 48833c62aee..a4c7ed236c8 100644 --- a/templating.rst +++ b/templating.rst @@ -493,7 +493,7 @@ configuration: // ... use Symfony\Component\Routing\Annotation\Route; - class WelcomeController extends Controller + class WelcomeController extends AbstractController { /** * @Route("/", name="welcome") @@ -556,7 +556,7 @@ route: // ... use Symfony\Component\Routing\Annotation\Route; - class ArticleController extends Controller + class ArticleController extends AbstractController { /** * @Route("/article/{slug}", name="article_show") diff --git a/templating/debug.rst b/templating/debug.rst index cba8b0538fc..d270151fade 100644 --- a/templating/debug.rst +++ b/templating/debug.rst @@ -23,7 +23,7 @@ This is useful, for example, inside your controller:: // ... - class ArticleController extends Controller + class ArticleController extends AbstractController { public function recentList() { diff --git a/templating/embedding_controllers.rst b/templating/embedding_controllers.rst index f3fb8706826..6611492dc85 100644 --- a/templating/embedding_controllers.rst +++ b/templating/embedding_controllers.rst @@ -31,7 +31,7 @@ First, create a controller that renders a certain number of recent articles:: // ... - class ArticleController extends Controller + class ArticleController extends AbstractController { public function recentArticles($max = 3) { diff --git a/templating/formats.rst b/templating/formats.rst index bf2e3630d70..66677a26e81 100644 --- a/templating/formats.rst +++ b/templating/formats.rst @@ -25,7 +25,7 @@ pattern is to do the following:: // ... use Symfony\Component\Routing\Annotation\Route; - class ArticleController extends Controller + class ArticleController extends AbstractController { /** * @Route("/{slug}") diff --git a/workflow/usage.rst b/workflow/usage.rst index 90b4c91efbb..22c0ecff5da 100644 --- a/workflow/usage.rst +++ b/workflow/usage.rst @@ -193,10 +193,10 @@ you can get the workflow by injecting the Workflow registry service:: // ... use Symfony\Component\Workflow\Registry; use App\Entity\BlogPost; - use Symfony\Bundle\FrameworkBundle\Controller\Controller; + use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\Workflow\Exception\TransitionException; - class BlogController extends Controller + class BlogController extends AbstractController { public function edit(Registry $workflows) {