1515use App \Form \PostType ;
1616use App \Repository \PostRepository ;
1717use App \Utils \Slugger ;
18- use Sensio \Bundle \FrameworkExtraBundle \Configuration \Method ;
1918use Sensio \Bundle \FrameworkExtraBundle \Configuration \Security ;
2019use Symfony \Bundle \FrameworkBundle \Controller \AbstractController ;
2120use Symfony \Component \Form \Extension \Core \Type \SubmitType ;
@@ -51,9 +50,8 @@ class BlogController extends AbstractController
5150 * could move this annotation to any other controller while maintaining
5251 * the route name and therefore, without breaking any existing link.
5352 *
54- * @Route("/", name="admin_index")
55- * @Route("/", name="admin_post_index")
56- * @Method("GET")
53+ * @Route("/", methods={"GET"}, name="admin_index")
54+ * @Route("/", methods={"GET"}, name="admin_post_index")
5755 */
5856 public function index (PostRepository $ posts ): Response
5957 {
@@ -65,8 +63,7 @@ public function index(PostRepository $posts): Response
6563 /**
6664 * Creates a new Post entity.
6765 *
68- * @Route("/new", name="admin_post_new")
69- * @Method({"GET", "POST"})
66+ * @Route("/new", methods={"GET", "POST"}, name="admin_post_new")
7067 *
7168 * NOTE: the Method annotation is optional, but it's a recommended practice
7269 * to constraint the HTTP methods each controller responds to (by default
@@ -116,8 +113,7 @@ public function new(Request $request): Response
116113 /**
117114 * Finds and displays a Post entity.
118115 *
119- * @Route("/{id}", requirements={"id": "\d+"}, name="admin_post_show")
120- * @Method("GET")
116+ * @Route("/{id}", requirements={"id": "\d+"}, methods={"GET"}, name="admin_post_show")
121117 */
122118 public function show (Post $ post ): Response
123119 {
@@ -133,8 +129,7 @@ public function show(Post $post): Response
133129 /**
134130 * Displays a form to edit an existing Post entity.
135131 *
136- * @Route("/{id}/edit", requirements={"id": "\d+"}, name="admin_post_edit")
137- * @Method({"GET", "POST"})
132+ * @Route("/{id}/edit", requirements={"id": "\d+"}, methods={"GET", "POST"}, name="admin_post_edit")
138133 */
139134 public function edit (Request $ request , Post $ post ): Response
140135 {
@@ -161,8 +156,7 @@ public function edit(Request $request, Post $post): Response
161156 /**
162157 * Deletes a Post entity.
163158 *
164- * @Route("/{id}/delete", name="admin_post_delete")
165- * @Method("POST")
159+ * @Route("/{id}/delete", methods={"POST"}, name="admin_post_delete")
166160 * @Security("is_granted('delete', post)")
167161 *
168162 * The Security annotation value is an expression (if it evaluates to false,
0 commit comments