diff --git a/routing.rst b/routing.rst index afe5a5d790d..8f98f8a6e12 100644 --- a/routing.rst +++ b/routing.rst @@ -80,7 +80,7 @@ do so, create a :doc:`controller class ` like the following: /** * @Route("/blog", name="blog_list") */ - public function list() + public function list(): Response { // ... } @@ -97,7 +97,7 @@ do so, create a :doc:`controller class ` like the following: class BlogController extends AbstractController { #[Route('/blog', name: 'blog_list')] - public function list() + public function list(): Response { // ... } @@ -1045,7 +1045,7 @@ optional ``priority`` parameter in those routes to control their priority: * * @Route("/blog/{slug}", name="blog_show") */ - public function show(string $slug) + public function show(string $slug): Response { // ... } @@ -1055,7 +1055,7 @@ optional ``priority`` parameter in those routes to control their priority: * * @Route("/blog/list", name="blog_list", priority=2) */ - public function list() + public function list(): Response { // ... } @@ -1075,7 +1075,7 @@ optional ``priority`` parameter in those routes to control their priority: * This route has a greedy pattern and is defined first. */ #[Route('/blog/{slug}', name: 'blog_show')] - public function show(string $slug) + public function show(string $slug): Response { // ... } @@ -1084,7 +1084,7 @@ optional ``priority`` parameter in those routes to control their priority: * This route could not be matched without defining a higher priority than 0. */ #[Route('/blog/list', name: 'blog_list', priority: 2)] - public function list() + public function list(): Response { // ... } @@ -2493,7 +2493,7 @@ session shouldn't be used when matching a request: /** * @Route("/", name="homepage", stateless=true) */ - public function homepage() + public function homepage(): Response { // ... } @@ -2510,7 +2510,7 @@ session shouldn't be used when matching a request: class MainController extends AbstractController { #[Route('/', name: 'homepage', stateless: true)] - public function homepage() + public function homepage(): Response { // ... }