use of com.jetbrains.php.lang.psi.elements.PhpReference in project idea-php-typo3-plugin by cedricziel.
the class ObjectManagerTypeProvider method getType.
@Nullable
@Override
public PhpType getType(PsiElement psiElement) {
if (DumbService.getInstance(psiElement.getProject()).isDumb()) {
return null;
}
if (!(psiElement instanceof MethodReference) || !PhpElementsUtil.isMethodWithFirstStringOrFieldReference(psiElement, "get")) {
return null;
}
MethodReference methodReference = (MethodReference) psiElement;
if (methodReference.getParameters().length == 0) {
return null;
}
PsiElement firstParam = methodReference.getParameters()[0];
if (firstParam instanceof PhpReference) {
PhpReference ref = (PhpReference) firstParam;
if (ref.getText().toLowerCase().contains("::class")) {
return new PhpType().add("#" + this.getKey() + ref.getSignature());
}
}
return null;
}
use of com.jetbrains.php.lang.psi.elements.PhpReference in project idea-php-typo3-plugin by cedricziel.
the class GeneralUtilityTypeProvider method getType.
@Nullable
@Override
public PhpType getType(PsiElement psiElement) {
if (DumbService.getInstance(psiElement.getProject()).isDumb()) {
return null;
}
if (!(psiElement instanceof MethodReference) || !PhpElementsUtil.isMethodWithFirstStringOrFieldReference(psiElement, "makeInstance")) {
return null;
}
MethodReference methodReference = (MethodReference) psiElement;
if (methodReference.getParameters().length == 0) {
return null;
}
PsiElement firstParam = methodReference.getParameters()[0];
if (firstParam instanceof PhpReference) {
PhpReference ref = (PhpReference) firstParam;
if (ref.getText().toLowerCase().contains("::class")) {
return new PhpType().add("#" + this.getKey() + ref.getSignature());
}
}
return null;
}
Aggregations