idea-php-symfony2-plugin icon indicating copy to clipboard operation
idea-php-symfony2-plugin copied to clipboard

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

Open alcohol opened this issue 1 year ago • 2 comments

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

alcohol avatar May 28 '24 07:05 alcohol

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.

iquito avatar Jun 03 '24 17:06 iquito

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.

reddingwebpro avatar Jul 19 '24 05:07 reddingwebpro