.peek();
PHPClassType instanceType;
if (parentContext instanceof INamespaceContext
&& ((INamespaceContext) parentContext).getNamespace() != null) {
if (node instanceof TraitDeclaration) {
instanceType = new PHPTraitType(
((INamespaceContext) parentContext).getNamespace(),
node.getName());
} else {
instanceType = new PHPClassType(
((INamespaceContext) parentContext).getNamespace(),
node.getName());
}
} else {
if (node instanceof TraitDeclaration) {
if (declaringType != null
&& realType != null
&& declaringType.getElementName().equals(
node.getName())) {
if (realType.getParent() instanceof IType) {
IType ns = (IType) realType.getParent();
instanceType = new PHPThisClassType(
ns.getElementName(),
realType.getElementName(), realType);
} else {
instanceType = new PHPThisClassType(
realType.getElementName(), realType);
}
} else {
instanceType = new PHPTraitType(node.getName());
}
} else {
instanceType = new PHPClassType(node.getName());
}
}