Skip to content

Commit eb3689a

Browse files
committed
"declaredRoutes" should only check its own implementation to fix possible "Caching disabled due to recursion prevention, please get rid of cyclic dependencies"
1 parent 1ab55d8 commit eb3689a

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

src/main/java/fr/adrienbrault/idea/symfony2plugin/routing/RouteHelper.java

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -393,12 +393,9 @@ public static Map<String, Route> getRoutesInsideUrlGeneratorFile(@NotNull PsiFil
393393

394394
// Symfony < 2.8
395395
// static private $declaredRoutes = array(...)
396-
for(Field field: phpClass.getFields()) {
397-
if(!field.getName().equals("declaredRoutes")) {
398-
continue;
399-
}
400-
401-
PsiElement defaultValue = field.getDefaultValue();
396+
Field declaredRoutes = phpClass.findOwnFieldByName("declaredRoutes", true);
397+
if (declaredRoutes != null) {
398+
PsiElement defaultValue = declaredRoutes.getDefaultValue();
402399
if(!(defaultValue instanceof ArrayCreationExpression)) {
403400
continue;
404401
}

0 commit comments

Comments
 (0)