File tree Expand file tree Collapse file tree 4 files changed +8
-17
lines changed Expand file tree Collapse file tree 4 files changed +8
-17
lines changed Original file line number Diff line number Diff line change 11package com .phpuaca .completion ;
22
33import com .intellij .openapi .project .DumbService ;
4- import com .intellij .openapi .project .Project ;
54import com .intellij .psi .PsiElement ;
6- import com .jetbrains .php .PhpIndex ;
75import com .jetbrains .php .lang .psi .elements .Method ;
86import com .jetbrains .php .lang .psi .elements .MethodReference ;
97import com .jetbrains .php .lang .psi .elements .PhpClass ;
1210import org .jetbrains .annotations .NotNull ;
1311import org .jetbrains .annotations .Nullable ;
1412
15- import java .util .Collection ;
16-
1713abstract public class BaseTypeProvider implements PhpTypeProvider2 {
1814
1915 protected boolean isAvailable (@ NotNull PsiElement psiElement ) {
2016 return (psiElement instanceof MethodReference ) && !DumbService .getInstance (psiElement .getProject ()).isDumb ();
2117 }
2218
23- protected Collection <PhpClass > getPhpInterfaceCollection (@ NotNull Project project , String FQN ) {
24- return PhpIndex .getInstance (project ).getInterfacesByFQN (FQN );
25- }
26-
27- @ NotNull
28- protected Collection <PhpClass > getPhpClassCollection (@ NotNull Project project , String FQN ) {
29- return PhpIndex .getInstance (project ).getClassesByFQN (FQN );
30- }
31-
3219 @ Nullable
3320 protected PhpClassAdapter getPhpClassAdapterForMethod (@ NotNull Method method ) {
3421 PhpClass phpClass = method .getContainingClass ();
Original file line number Diff line number Diff line change 22
33import com .intellij .openapi .project .Project ;
44import com .intellij .psi .PsiElement ;
5+ import com .jetbrains .php .PhpIndex ;
56import com .jetbrains .php .lang .psi .elements .Method ;
67import com .jetbrains .php .lang .psi .elements .MethodReference ;
78import com .jetbrains .php .lang .psi .elements .PhpClass ;
@@ -67,9 +68,10 @@ public String getType(PsiElement psiElement) {
6768
6869 @ Override
6970 public Collection <? extends PhpNamedElement > getBySignature (String s , Project project ) {
71+ PhpIndex phpIndex = PhpIndex .getInstance (project );
7072 Collection <PhpClass > collection = new ArrayList <PhpClass >();
71- collection .addAll (getPhpInterfaceCollection ( project , CLASS_PHP_UNIT_MOCK_OBJECT ));
72- collection .addAll (getPhpClassCollection ( project , s ));
73+ collection .addAll (phpIndex . getInterfacesByFQN ( CLASS_PHP_UNIT_MOCK_OBJECT ));
74+ collection .addAll (phpIndex . getAnyByFQN ( s ));
7375 return collection ;
7476 }
7577
Original file line number Diff line number Diff line change 22
33import com .intellij .openapi .project .Project ;
44import com .intellij .psi .PsiElement ;
5+ import com .jetbrains .php .PhpIndex ;
56import com .jetbrains .php .lang .psi .elements .*;
67import com .phpuaca .util .PhpClassAdapter ;
78import com .phpuaca .util .PhpClassResolver ;
@@ -66,9 +67,10 @@ public String getType(PsiElement psiElement) {
6667
6768 @ Override
6869 public Collection <? extends PhpNamedElement > getBySignature (String s , Project project ) {
70+ PhpIndex phpIndex = PhpIndex .getInstance (project );
6971 Collection <PhpClass > collection = new ArrayList <PhpClass >();
7072 for (String FQN : s .split (TYPE_SEPARATOR )) {
71- collection .addAll (getPhpClassCollection ( project , FQN ));
73+ collection .addAll (phpIndex . getAnyByFQN ( FQN ));
7274 }
7375 return collection ;
7476 }
Original file line number Diff line number Diff line change @@ -33,7 +33,7 @@ public PhpClass resolveByClassStringLiteralExpression(@NotNull StringLiteralExpr
3333 if (!className .isEmpty ()) {
3434 className = className .replace ("\\ \\ " , "\\ " );
3535 Project project = stringLiteralExpression .getProject ();
36- Collection <PhpClass > phpClasses = PhpIndex .getInstance (project ).getClassesByFQN (className );
36+ Collection <PhpClass > phpClasses = PhpIndex .getInstance (project ).getAnyByFQN (className );
3737 if (!phpClasses .isEmpty ()) {
3838 return phpClasses .iterator ().next ();
3939 }
You can’t perform that action at this time.
0 commit comments