Collection<TypeReference> interfaces = getClassDeclaration().getInterfaceList();
List<IMethod> unimplemented = new ArrayList<IMethod>();
IDLTKSearchScope scope = SearchEngine.createSearchScope(project);
PhpModelAccess model = PhpModelAccess.getDefault();
IType nss = PHPModelUtils.getCurrentNamespace(sourceModule, getClassDeclaration().getNameStart());
String search = nss != null ? nss.getElementName() + BACK_SLASH + getClassDeclaration().getName() : getClassDeclaration().getName();
IType classType = context != null ? PDTModelUtils.findType(sourceModule, search) : null;
if (classType == null) {
for (IType t : PDTModelUtils.findTypes(project, search)) {
classType = t;
break;
}
if (classType == null) {
return false;
}
}
Map<String, IMethod> listImported = PDTModelUtils.getImportedMethods(classType);
// iterate over all interfaces and check if the current class
// or any of the superclasses implements the method
if (listImported == null) {
return true;
}
for (TypeReference interf : interfaces) {
if (interf instanceof FullyQualifiedReference) {
FullyQualifiedReference fqr = (FullyQualifiedReference) interf;
String name = null;
// we have a namespace
if (fqr.getNamespace() != null) {
name = fqr.getNamespace().getName() + BACK_SLASH + fqr.getName();
} else {
IEvaluatedType eval = PHPTypeInferenceUtils.resolveExpression(sourceModule, fqr);
name = eval.getTypeName();
if (eval.getTypeName().startsWith(BACK_SLASH)) {
name = eval.getTypeName().replaceFirst("\\\\", "");
}
}
if (name == null) {
continue;
}
IType[] types;
if (PDTModelUtils.findType(sourceModule, name) != null) {
types = new IType[] {PDTModelUtils.findType(sourceModule, name)};
} else {
types = model.findTypes(name, MatchRule.EXACT, 0, 0, scope, new NullProgressMonitor());
}
if (types.length != 1) {
continue;
}