Closed andyexeter closed 2 years ago
Hi @andyexeter. Thank you for great bug report. I was able to reproduce your issue.
My first idea here is to wrap https://github.com/Haehnchen/idea-php-symfony2-plugin/blob/master/src/main/java/fr/adrienbrault/idea/symfony2plugin/util/PhpElementsUtil.java#L632-L651 with dumb mode check but I'm not sure if it's right direction.
fixed
PhpStorm Version: 2021.2.1 Plugin version: 0.23.212
When using a constant in the
methods
argument of aRoute
attribute, the following exception is thrown:Click to expand
This leads to a "Missing Route" warning on all route names in Twig templates and in arguments to the router.
Reproducible example code:
Using the fully-qualified class name instead of a
use
statement doesn't seem to help.Replacing the constant with string literals e.g
GET
resolves the issue, but I'd like to use constants if possible.I've set up a small reproducer here, if it helps: https://github.com/andyexeter/idea-symfony-plugin-routing-issue-demo