Skip to content

Commit 9f0218e

Browse files
authored
Merge pull request #2101 from Haehnchen/feature/EventSubscriberInterface-imple
ImplicitUsage usage must not check for "EventSubscriberInterface" instance
2 parents 02fd44c + e9f26d1 commit 9f0218e

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/main/java/fr/adrienbrault/idea/symfony2plugin/codeInsight/SymfonyImplicitUsageProvider.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ private boolean isSubscribedEvent(@NotNull Method method) {
185185

186186
private boolean isAsEventListenerMethodPhpAttribute(@NotNull Method method) {
187187
PhpClass containingClass = method.getContainingClass();
188-
if (containingClass == null || !PhpElementsUtil.isInstanceOf(containingClass, "\\Symfony\\Component\\EventDispatcher\\EventSubscriberInterface")) {
188+
if (containingClass == null) {
189189
return false;
190190
}
191191

src/test/java/fr/adrienbrault/idea/symfony2plugin/tests/codeInsight/SymfonyImplicitUsageProviderTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ public void testEventSubscriberGetAsEventListener() {
229229
"use Symfony\\Component\\EventDispatcher\\Attribute\\AsEventListener;\n" +
230230
"\n" +
231231
"#[AsEventListener(event: 'bar', method: 'onFoo')]\n" +
232-
"final class MyMultiListener implements \\Symfony\\Component\\EventDispatcher\\EventSubscriberInterface\n" +
232+
"final class MyMultiListener\n" +
233233
"{\n" +
234234
" public function onFoo(): void\n" +
235235
" {\n" +

0 commit comments

Comments
 (0)