Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#[Route] attribute on method cannot be found if preceded by another attribute #2381

Open
alcohol opened this issue May 28, 2024 · 2 comments

Comments

@alcohol
Copy link

alcohol commented May 28, 2024

May or may not be related to #2176 ?

This does not work:

#[IsGranted('ROLE_ADMIN')]
#[Route(path: '/admin', name: 'admin', methods: ['GET', 'POST'])]
public function admin(Request $request): Response

This works:

#[Route(path: '/admin', name: 'admin', methods: ['GET', 'POST'])]
#[IsGranted('ROLE_ADMIN')]
public function admin(Request $request): Response
@iquito
Copy link

iquito commented Jun 3, 2024

I am having the same issue (with PhpStorm 2024.1.2 and Symfony Support Plugin 2024.1.274), routes seem to be ignored/not found if the Route attribute is preceded by another attribute.

@reddingwebpro
Copy link

Excellent isolation of the problem. I have been trying to figure this out myself as well why some of my routes throw a "Symfony: Missing Routes" error when I check the code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants