@@ -52,8 +52,8 @@ class BlogController extends AbstractController
52
52
* could move this annotation to any other controller while maintaining
53
53
* the route name and therefore, without breaking any existing link.
54
54
*/
55
- #[Route('/ ' , methods: [ ' GET ' ], name: ' admin_index ' )]
56
- #[Route('/ ' , methods: [ ' GET ' ], name: ' admin_post_index ' )]
55
+ #[Route('/ ' , name: ' admin_index ' , methods: [ ' GET ' ] )]
56
+ #[Route('/ ' , name: ' admin_post_index ' , methods: [ ' GET ' ] )]
57
57
public function index (
58
58
#[CurrentUser] User $ user ,
59
59
PostRepository $ posts ,
@@ -70,7 +70,7 @@ public function index(
70
70
* to constraint the HTTP methods each controller responds to (by default
71
71
* it responds to all methods).
72
72
*/
73
- #[Route('/new ' , methods: ['GET ' , 'POST ' ], name: ' admin_post_new ' )]
73
+ #[Route('/new ' , name: ' admin_post_new ' , methods: ['GET ' , 'POST ' ])]
74
74
public function new (
75
75
#[CurrentUser] User $ user ,
76
76
Request $ request ,
@@ -119,7 +119,7 @@ public function new(
119
119
/**
120
120
* Finds and displays a Post entity.
121
121
*/
122
- #[Route('/{id<\d+>} ' , methods: [ ' GET ' ], name: ' admin_post_show ' )]
122
+ #[Route('/{id<\d+>} ' , name: ' admin_post_show ' , methods: [ ' GET ' ] )]
123
123
public function show (Post $ post ): Response
124
124
{
125
125
// This security check can also be performed
@@ -134,7 +134,7 @@ public function show(Post $post): Response
134
134
/**
135
135
* Displays a form to edit an existing Post entity.
136
136
*/
137
- #[Route('/{id<\d+>}/edit ' , methods: ['GET ' , 'POST ' ], name: ' admin_post_edit ' )]
137
+ #[Route('/{id<\d+>}/edit ' , name: ' admin_post_edit ' , methods: ['GET ' , 'POST ' ])]
138
138
#[IsGranted('edit ' , subject: 'post ' , message: 'Posts can only be edited by their authors. ' )]
139
139
public function edit (Request $ request , Post $ post , EntityManagerInterface $ entityManager ): Response
140
140
{
@@ -157,7 +157,7 @@ public function edit(Request $request, Post $post, EntityManagerInterface $entit
157
157
/**
158
158
* Deletes a Post entity.
159
159
*/
160
- #[Route('/{id}/delete ' , methods: [ ' POST ' ], name: ' admin_post_delete ' )]
160
+ #[Route('/{id}/delete ' , name: ' admin_post_delete ' , methods: [ ' POST ' ] )]
161
161
#[IsGranted('delete ' , subject: 'post ' )]
162
162
public function delete (Request $ request , Post $ post , EntityManagerInterface $ entityManager ): Response
163
163
{
0 commit comments