int i = fqn.lastIndexOf('\\');
String name = i >= 0 ? fqn.substring(i + 1) : fqn;
String namespace = i >= 0 ? fqn.substring(0, i + 1) : "\\";
Collection functions = index.getFunctionsByName(name);
List filteredFunctions = new SmartList(index.filterNamedByNamespace(functions, PhpLangUtil.toFQN(namespace), true));
if (filteredFunctions.size() > 0) {
return (PhpNamedElement) filteredFunctions.get(0);
}
}