@@ -52,8 +52,8 @@ class BlogController extends AbstractController
5252 * could move this annotation to any other controller while maintaining
5353 * the route name and therefore, without breaking any existing link.
5454 */
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 ' ] )]
5757 public function index (
5858 #[CurrentUser] User $ user ,
5959 PostRepository $ posts ,
@@ -70,7 +70,7 @@ public function index(
7070 * to constraint the HTTP methods each controller responds to (by default
7171 * it responds to all methods).
7272 */
73- #[Route('/new ' , methods: ['GET ' , 'POST ' ], name: ' admin_post_new ' )]
73+ #[Route('/new ' , name: ' admin_post_new ' , methods: ['GET ' , 'POST ' ])]
7474 public function new (
7575 #[CurrentUser] User $ user ,
7676 Request $ request ,
@@ -119,7 +119,7 @@ public function new(
119119 /**
120120 * Finds and displays a Post entity.
121121 */
122- #[Route('/{id<\d+>} ' , methods: [ ' GET ' ], name: ' admin_post_show ' )]
122+ #[Route('/{id<\d+>} ' , name: ' admin_post_show ' , methods: [ ' GET ' ] )]
123123 public function show (Post $ post ): Response
124124 {
125125 // This security check can also be performed
@@ -134,7 +134,7 @@ public function show(Post $post): Response
134134 /**
135135 * Displays a form to edit an existing Post entity.
136136 */
137- #[Route('/{id<\d+>}/edit ' , methods: ['GET ' , 'POST ' ], name: ' admin_post_edit ' )]
137+ #[Route('/{id<\d+>}/edit ' , name: ' admin_post_edit ' , methods: ['GET ' , 'POST ' ])]
138138 #[IsGranted('edit ' , subject: 'post ' , message: 'Posts can only be edited by their authors. ' )]
139139 public function edit (Request $ request , Post $ post , EntityManagerInterface $ entityManager ): Response
140140 {
@@ -157,7 +157,7 @@ public function edit(Request $request, Post $post, EntityManagerInterface $entit
157157 /**
158158 * Deletes a Post entity.
159159 */
160- #[Route('/{id}/delete ' , methods: [ ' POST ' ], name: ' admin_post_delete ' )]
160+ #[Route('/{id}/delete ' , name: ' admin_post_delete ' , methods: [ ' POST ' ] )]
161161 #[IsGranted('delete ' , subject: 'post ' )]
162162 public function delete (Request $ request , Post $ post , EntityManagerInterface $ entityManager ): Response
163163 {
0 commit comments