IType[] superTypes = superHierarchy.getAllTypes();
for (IType superType : superTypes) {
IField[] typeField = PHPModelUtils.getTypeField(
superType, variableName, true);
if (typeField.length > 0) {
PHPDocBlock docBlock = PHPModelUtils
.getDocBlock(typeField[0]);
if (docBlock != null) {
docs.put(docBlock, typeField[0]);
}
}
}
} catch (ModelException e) {
if (DLTKCore.DEBUG) {
e.printStackTrace();
}
}
}
}
for (Entry<PHPDocBlock, IField> entry : docs.entrySet()) {
PHPDocBlock doc = entry.getKey();
IField typeField = entry.getValue();
IType currentNamespace = PHPModelUtils
.getCurrentNamespace(typeField);
for (PHPDocTag tag : doc.getTags()) {
if (tag.getTagKind() == PHPDocTag.VAR) {
SimpleReference[] references = tag.getReferences();
for (SimpleReference ref : references) {
String typeName = ref.getName();
Matcher m = ARRAY_TYPE_PATTERN.matcher(typeName);
if (m.find()) {
evaluated.add(getArrayType(m.group(),
currentNamespace, doc.sourceStart()));
} else if (typeName.endsWith(BRACKETS)
&& typeName.length() > 2) {
offset = 0;
try {
offset = typeField.getSourceRange().getOffset();
} catch (ModelException e) {
}
evaluated.add(getArrayType(typeName.substring(0,
typeName.length() - 2), currentNamespace,
offset));
} else {
if (currentNamespace != null) {
ModuleDeclaration moduleDeclaration = SourceParserUtil
.getModuleDeclaration(currentNamespace
.getSourceModule());
if (typeName.indexOf(SPLASH) > 0) {
// check if the first part is an
// alias,then get the full name
String prefix = typeName.substring(0,
typeName.indexOf(SPLASH));
final Map<String, UsePart> result = PHPModelUtils
.getAliasToNSMap(prefix,
moduleDeclaration,
doc.sourceStart(),
currentNamespace, true);
if (result.containsKey(prefix)) {
String fullName = result.get(prefix)
.getNamespace()
.getFullyQualifiedName();
typeName = typeName.replace(prefix,
fullName);
if (typeName.charAt(0) != NamespaceReference.NAMESPACE_SEPARATOR) {
typeName = NamespaceReference.NAMESPACE_SEPARATOR
+ typeName;
}
}
} else if (typeName.indexOf(SPLASH) < 0) {
String prefix = typeName;
final Map<String, UsePart> result = PHPModelUtils
.getAliasToNSMap(prefix,
moduleDeclaration,
doc.sourceStart(),
currentNamespace, true);
if (result.containsKey(prefix)) {
String fullName = result.get(prefix)
.getNamespace()
.getFullyQualifiedName();