Skip to content

Commit f9fe450

Browse files
committed
Merge branch '7.0' into 7.1
* 7.0: Replace Annotation\Route with Attribute\Route
2 parents ff67a39 + 3b3ff02 commit f9fe450

19 files changed

+59
-59
lines changed

cache.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -885,7 +885,7 @@ In the following example, the value is requested from a controller::
885885

886886
use App\Cache\CacheComputation;
887887
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
888-
use Symfony\Component\Routing\Annotation\Route;
888+
use Symfony\Component\Routing\Attribute\Route;
889889
use Symfony\Contracts\Cache\CacheInterface;
890890
use Symfony\Contracts\Cache\ItemInterface;
891891

configuration/micro_kernel_trait.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ Next, create an ``index.php`` file that defines the kernel class and runs it:
3232
use Symfony\Component\HttpFoundation\JsonResponse;
3333
use Symfony\Component\HttpFoundation\Request;
3434
use Symfony\Component\HttpKernel\Kernel as BaseKernel;
35-
use Symfony\Component\Routing\Annotation\Route;
35+
use Symfony\Component\Routing\Attribute\Route;
3636
3737
require __DIR__.'/vendor/autoload.php';
3838
@@ -382,7 +382,7 @@ has one file in it::
382382

383383
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
384384
use Symfony\Component\HttpFoundation\Response;
385-
use Symfony\Component\Routing\Annotation\Route;
385+
use Symfony\Component\Routing\Attribute\Route;
386386

387387
class MicroController extends AbstractController
388388
{

controller.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class::
2323
namespace App\Controller;
2424

2525
use Symfony\Component\HttpFoundation\Response;
26-
use Symfony\Component\Routing\Annotation\Route;
26+
use Symfony\Component\Routing\Attribute\Route;
2727

2828
class LuckyController
2929
{
@@ -731,7 +731,7 @@ method::
731731

732732
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
733733
use Symfony\Component\HttpFoundation\Response;
734-
use Symfony\Component\Routing\Annotation\Route;
734+
use Symfony\Component\Routing\Attribute\Route;
735735
use Symfony\Component\WebLink\Link;
736736

737737
class HomepageController extends AbstractController

controller/service.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ apply the ``controller.service_arguments`` tag to your controller services::
6666

6767
use Symfony\Component\HttpFoundation\Response;
6868
use Symfony\Component\HttpKernel\Attribute\AsController;
69-
use Symfony\Component\Routing\Annotation\Route;
69+
use Symfony\Component\Routing\Attribute\Route;
7070

7171
#[AsController]
7272
class HelloController
@@ -95,7 +95,7 @@ a service like: ``App\Controller\HelloController::index``:
9595
namespace App\Controller;
9696
9797
use Symfony\Component\HttpFoundation\Response;
98-
use Symfony\Component\Routing\Annotation\Route;
98+
use Symfony\Component\Routing\Attribute\Route;
9999
100100
class HelloController
101101
{
@@ -157,7 +157,7 @@ which is a common practice when following the `ADR pattern`_
157157
namespace App\Controller;
158158
159159
use Symfony\Component\HttpFoundation\Response;
160-
use Symfony\Component\Routing\Annotation\Route;
160+
use Symfony\Component\Routing\Attribute\Route;
161161
162162
#[Route('/hello/{name}', name: 'hello')]
163163
class Hello

controller/upload_file.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ Finally, you need to update the code of the controller that handles the form::
124124
use Symfony\Component\HttpFoundation\File\UploadedFile;
125125
use Symfony\Component\HttpFoundation\Request;
126126
use Symfony\Component\HttpFoundation\Response;
127-
use Symfony\Component\Routing\Annotation\Route;
127+
use Symfony\Component\Routing\Attribute\Route;
128128
use Symfony\Component\String\Slugger\SluggerInterface;
129129

130130
class ProductController extends AbstractController

controller/value_resolver.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ Symfony ships with the following value resolvers in the
129129
namespace App\Controller;
130130

131131
use Symfony\Component\HttpFoundation\Response;
132-
use Symfony\Component\Routing\Annotation\Route;
132+
use Symfony\Component\Routing\Attribute\Route;
133133
use Symfony\Component\Uid\UuidV4;
134134

135135
class DefaultController
@@ -175,7 +175,7 @@ In addition, some components, bridges and official bundles provide other value r
175175
namespace App\Controller;
176176

177177
use Symfony\Component\HttpFoundation\Response;
178-
use Symfony\Component\Routing\Annotation\Route;
178+
use Symfony\Component\Routing\Attribute\Route;
179179

180180
class DefaultController
181181
{
@@ -220,7 +220,7 @@ lets you do this by "targeting" the resolver you want::
220220
use Symfony\Component\HttpFoundation\Session\SessionInterface;
221221
use Symfony\Component\HttpKernel\Attribute\ValueResolver;
222222
use Symfony\Component\HttpKernel\Controller\ArgumentResolver\SessionValueResolver;
223-
use Symfony\Component\Routing\Annotation\Route;
223+
use Symfony\Component\Routing\Attribute\Route;
224224

225225
class SessionController
226226
{

doctrine.rst

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,7 @@ and save it::
357357
use App\Entity\Product;
358358
use Doctrine\ORM\EntityManagerInterface;
359359
use Symfony\Component\HttpFoundation\Response;
360-
use Symfony\Component\Routing\Annotation\Route;
360+
use Symfony\Component\Routing\Attribute\Route;
361361

362362
class ProductController extends AbstractController
363363
{
@@ -439,7 +439,7 @@ Consider the following controller code::
439439

440440
use App\Entity\Product;
441441
use Symfony\Component\HttpFoundation\Response;
442-
use Symfony\Component\Routing\Annotation\Route;
442+
use Symfony\Component\Routing\Attribute\Route;
443443
use Symfony\Component\Validator\Validator\ValidatorInterface;
444444
// ...
445445

@@ -503,7 +503,7 @@ be able to go to ``/product/1`` to see your new product::
503503
use App\Entity\Product;
504504
use Doctrine\ORM\EntityManagerInterface;
505505
use Symfony\Component\HttpFoundation\Response;
506-
use Symfony\Component\Routing\Annotation\Route;
506+
use Symfony\Component\Routing\Attribute\Route;
507507
// ...
508508

509509
class ProductController extends AbstractController
@@ -536,7 +536,7 @@ and injected by the dependency injection container::
536536
use App\Entity\Product;
537537
use App\Repository\ProductRepository;
538538
use Symfony\Component\HttpFoundation\Response;
539-
use Symfony\Component\Routing\Annotation\Route;
539+
use Symfony\Component\Routing\Attribute\Route;
540540
// ...
541541

542542
class ProductController extends AbstractController
@@ -621,7 +621,7 @@ automatically! You can simplify the controller to::
621621
use App\Entity\Product;
622622
use App\Repository\ProductRepository;
623623
use Symfony\Component\HttpFoundation\Response;
624-
use Symfony\Component\Routing\Annotation\Route;
624+
use Symfony\Component\Routing\Attribute\Route;
625625
// ...
626626

627627
class ProductController extends AbstractController
@@ -697,7 +697,7 @@ the ``EntityValueResolver`` behavior by using the `MapEntity options`_ ::
697697
use App\Entity\Product;
698698
use Symfony\Bridge\Doctrine\Attribute\MapEntity;
699699
use Symfony\Component\HttpFoundation\Response;
700-
use Symfony\Component\Routing\Annotation\Route;
700+
use Symfony\Component\Routing\Attribute\Route;
701701
// ...
702702

703703
class ProductController extends AbstractController
@@ -848,7 +848,7 @@ with any PHP model::
848848
use App\Repository\ProductRepository;
849849
use Doctrine\ORM\EntityManagerInterface;
850850
use Symfony\Component\HttpFoundation\Response;
851-
use Symfony\Component\Routing\Annotation\Route;
851+
use Symfony\Component\Routing\Attribute\Route;
852852
// ...
853853

854854
class ProductController extends AbstractController

doctrine/associations.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ Now you can see this new code in action! Imagine you're inside a controller::
312312
use App\Entity\Product;
313313
use Doctrine\ORM\EntityManagerInterface;
314314
use Symfony\Component\HttpFoundation\Response;
315-
use Symfony\Component\Routing\Annotation\Route;
315+
use Symfony\Component\Routing\Attribute\Route;
316316

317317
class ProductController extends AbstractController
318318
{

mailer.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -474,7 +474,7 @@ and create an :class:`Symfony\\Component\\Mime\\Email` object::
474474
use Symfony\Component\HttpFoundation\Response;
475475
use Symfony\Component\Mailer\MailerInterface;
476476
use Symfony\Component\Mime\Email;
477-
use Symfony\Component\Routing\Annotation\Route;
477+
use Symfony\Component\Routing\Attribute\Route;
478478

479479
class MailerController extends AbstractController
480480
{
@@ -1592,7 +1592,7 @@ Here's an example of making one available to download::
15921592
use Symfony\Component\HttpFoundation\Response;
15931593
use Symfony\Component\HttpFoundation\ResponseHeaderBag;
15941594
use Symfony\Component\Mime\DraftEmail;
1595-
use Symfony\Component\Routing\Annotation\Route;
1595+
use Symfony\Component\Routing\Attribute\Route;
15961596

15971597
class DownloadEmailController extends AbstractController
15981598
{

page_creation.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ metadata to code):
6969
// src/Controller/LuckyController.php
7070
7171
// ...
72-
+ use Symfony\Component\Routing\Annotation\Route;
72+
+ use Symfony\Component\Routing\Attribute\Route;
7373
7474
class LuckyController
7575
{

0 commit comments

Comments
 (0)