Skip to content

Commit 3b3ff02

Browse files
committed
Merge branch '6.4' into 7.0
* 6.4: Replace Annotation\Route with Attribute\Route
2 parents 2aaf3ef + b8f6679 commit 3b3ff02

19 files changed

+59
-59
lines changed

cache.rst

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

899899
use App\Cache\CacheComputation;
900900
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
901-
use Symfony\Component\Routing\Annotation\Route;
901+
use Symfony\Component\Routing\Attribute\Route;
902902
use Symfony\Contracts\Cache\CacheInterface;
903903
use Symfony\Contracts\Cache\ItemInterface;
904904

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
@@ -356,7 +356,7 @@ and save it::
356356
use App\Entity\Product;
357357
use Doctrine\ORM\EntityManagerInterface;
358358
use Symfony\Component\HttpFoundation\Response;
359-
use Symfony\Component\Routing\Annotation\Route;
359+
use Symfony\Component\Routing\Attribute\Route;
360360

361361
class ProductController extends AbstractController
362362
{
@@ -438,7 +438,7 @@ Consider the following controller code::
438438

439439
use App\Entity\Product;
440440
use Symfony\Component\HttpFoundation\Response;
441-
use Symfony\Component\Routing\Annotation\Route;
441+
use Symfony\Component\Routing\Attribute\Route;
442442
use Symfony\Component\Validator\Validator\ValidatorInterface;
443443
// ...
444444

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

508508
class ProductController extends AbstractController
@@ -535,7 +535,7 @@ and injected by the dependency injection container::
535535
use App\Entity\Product;
536536
use App\Repository\ProductRepository;
537537
use Symfony\Component\HttpFoundation\Response;
538-
use Symfony\Component\Routing\Annotation\Route;
538+
use Symfony\Component\Routing\Attribute\Route;
539539
// ...
540540

541541
class ProductController extends AbstractController
@@ -620,7 +620,7 @@ automatically! You can simplify the controller to::
620620
use App\Entity\Product;
621621
use App\Repository\ProductRepository;
622622
use Symfony\Component\HttpFoundation\Response;
623-
use Symfony\Component\Routing\Annotation\Route;
623+
use Symfony\Component\Routing\Attribute\Route;
624624
// ...
625625

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

702702
class ProductController extends AbstractController
@@ -832,7 +832,7 @@ with any PHP model::
832832
use App\Repository\ProductRepository;
833833
use Doctrine\ORM\EntityManagerInterface;
834834
use Symfony\Component\HttpFoundation\Response;
835-
use Symfony\Component\Routing\Annotation\Route;
835+
use Symfony\Component\Routing\Attribute\Route;
836836
// ...
837837

838838
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
@@ -438,7 +438,7 @@ and create an :class:`Symfony\\Component\\Mime\\Email` object::
438438
use Symfony\Component\HttpFoundation\Response;
439439
use Symfony\Component\Mailer\MailerInterface;
440440
use Symfony\Component\Mime\Email;
441-
use Symfony\Component\Routing\Annotation\Route;
441+
use Symfony\Component\Routing\Attribute\Route;
442442

443443
class MailerController extends AbstractController
444444
{
@@ -1555,7 +1555,7 @@ Here's an example of making one available to download::
15551555
use Symfony\Component\HttpFoundation\Response;
15561556
use Symfony\Component\HttpFoundation\ResponseHeaderBag;
15571557
use Symfony\Component\Mime\DraftEmail;
1558-
use Symfony\Component\Routing\Annotation\Route;
1558+
use Symfony\Component\Routing\Attribute\Route;
15591559

15601560
class DownloadEmailController extends AbstractController
15611561
{

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
{

quick_tour/flex_recipes.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ Thanks to Flex, after one command, you can start using Twig immediately:
7979
// src/Controller/DefaultController.php
8080
namespace App\Controller;
8181
82-
use Symfony\Component\Routing\Annotation\Route;
82+
use Symfony\Component\Routing\Attribute\Route;
8383
- use Symfony\Component\HttpFoundation\Response;
8484
+ use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
8585
@@ -157,7 +157,7 @@ Are you building an API? You can already return JSON from any controller::
157157

158158
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
159159
use Symfony\Component\HttpFoundation\JsonResponse;
160-
use Symfony\Component\Routing\Annotation\Route;
160+
use Symfony\Component\Routing\Attribute\Route;
161161

162162
class DefaultController extends AbstractController
163163
{

quick_tour/the_architecture.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ use the logger in a controller, add a new argument type-hinted with ``LoggerInte
2727
use Psr\Log\LoggerInterface;
2828
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
2929
use Symfony\Component\HttpFoundation\Response;
30-
use Symfony\Component\Routing\Annotation\Route;
30+
use Symfony\Component\Routing\Attribute\Route;
3131

3232
class DefaultController extends AbstractController
3333
{
@@ -108,7 +108,7 @@ Great! You can use it immediately in your controller::
108108
use Psr\Log\LoggerInterface;
109109
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
110110
use Symfony\Component\HttpFoundation\Response;
111-
use Symfony\Component\Routing\Annotation\Route;
111+
use Symfony\Component\Routing\Attribute\Route;
112112

113113
class DefaultController extends AbstractController
114114
{

quick_tour/the_big_picture.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ Instead, add the route *right above* the controller method:
154154
namespace App\Controller;
155155
156156
use Symfony\Component\HttpFoundation\Response;
157-
+ use Symfony\Component\Routing\Annotation\Route;
157+
+ use Symfony\Component\Routing\Attribute\Route;
158158
159159
class DefaultController
160160
{
@@ -173,7 +173,7 @@ in ``DefaultController``::
173173
namespace App\Controller;
174174

175175
use Symfony\Component\HttpFoundation\Response;
176-
use Symfony\Component\Routing\Annotation\Route;
176+
use Symfony\Component\Routing\Attribute\Route;
177177

178178
class DefaultController
179179
{

0 commit comments

Comments
 (0)