@@ -28,22 +28,22 @@ public class PhpJobMethodReferenceProvider extends PsiReferenceProvider {
28
28
29
29
@ NotNull
30
30
@ Override
31
- public PsiReference [] getReferencesByElement (@ NotNull PsiElement element , @ NotNull ProcessingContext context ) {
32
- if (!(element instanceof XmlElement )) {
33
- return PsiReference .EMPTY_ARRAY ;
34
- }
35
-
36
- List <PsiReference > psiReferences = new ArrayList <>();
37
-
38
- String methodName = StringUtil .unquoteString (element .getText ());
31
+ public PsiReference [] getReferencesByElement (
32
+ @ NotNull final PsiElement element ,
33
+ @ NotNull final ProcessingContext context
34
+ ) {
35
+ final List <PsiReference > psiReferences = new ArrayList <>();
36
+ final String methodName = StringUtil .unquoteString (element .getText ());
37
+ final PhpClass phpClass = DiIndex .getPhpClassOfJobMethod ((XmlElement ) element );
39
38
40
- PhpClass phpClass = DiIndex .getPhpClassOfJobMethod ((XmlElement ) element );
41
39
if (phpClass != null ) {
42
- Collection <Method > methods = phpClass .getMethods ();
43
- methods .removeIf (method -> !method .getName ().contains (methodName ));
44
- psiReferences .add (new PolyVariantReferenceBase (element , methods ));
40
+ final Collection <Method > methods = phpClass .getMethods ();
41
+ methods .removeIf (method -> !method .getName ().matches (methodName ));
42
+ if (!methods .isEmpty ()) {
43
+ psiReferences .add (new PolyVariantReferenceBase (element , methods ));
44
+ }
45
45
}
46
46
47
- return psiReferences .toArray (new PsiReference [psiReferences . size () ]);
47
+ return psiReferences .toArray (new PsiReference [0 ]);
48
48
}
49
49
}
0 commit comments