Skip to content

Commit 6a2772e

Browse files
committed
add support for Twig extension registered via Attributes
1 parent dd0f42b commit 6a2772e

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

src/main/java/fr/adrienbrault/idea/symfony2plugin/stubs/indexes/TwigAttributeIndex.java

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ public static class TwigAttributeIndexer implements DataIndexer<String, String,
7171
}
7272

7373
for (PhpClass phpClass : PhpPsiUtil.findAllClasses(phpFile)) {
74-
for (Method method : phpClass.getMethods()) {
74+
for (Method method : phpClass.getOwnMethods()) {
7575
processMethodAttributes(phpClass, method, result);
7676
}
7777
}
@@ -81,7 +81,7 @@ public static class TwigAttributeIndexer implements DataIndexer<String, String,
8181

8282
private void processMethodAttributes(@NotNull PhpClass phpClass, @NotNull Method method, @NotNull Map<String, String> result) {
8383
for (PhpAttribute attribute : method.getAttributes()) {
84-
String attributeFqn = getAttributeFqn(attribute);
84+
String attributeFqn = attribute.getFQN();
8585
if (attributeFqn == null) {
8686
continue;
8787
}
@@ -98,10 +98,5 @@ private void processMethodAttributes(@NotNull PhpClass phpClass, @NotNull Method
9898
}
9999
}
100100
}
101-
102-
private String getAttributeFqn(@NotNull PhpAttribute attribute) {
103-
ClassReference reference = attribute.getClassReference();
104-
return reference != null ? reference.getFQN() : null;
105-
}
106101
}
107102
}

0 commit comments

Comments
 (0)