public Object produceResult() {
return result;
}
public IGoal[] subGoalDone(IGoal subgoal, Object result, GoalState state) {
IModelAccessCache cache = null;
if (goal.getContext() instanceof IModelCacheContext) {
cache = (IModelAccessCache) ((IModelCacheContext) goal.getContext())
.getCache();
}
if (state != GoalState.RECURSIVE) {
if (result instanceof GeneratorClassType) {
MultiTypeType type = new MultiTypeType();
type.getTypes()
.addAll(((GeneratorClassType) result).getTypes());
this.result = type;
return IGoal.NO_GOALS;
} else if (result instanceof PHPClassType) {
if (subgoal instanceof ExpressionTypeGoal) {
ISourceModule sourceModule = ((ISourceModuleContext) subgoal
.getContext()).getSourceModule();
PHPClassType classType = (PHPClassType) result;
List<IGoal> subGoals = new LinkedList<IGoal>();
try {
IType[] types = PHPModelUtils.getTypes(
classType.getTypeName(), sourceModule, 0,
cache, null);
for (IType type : types) {
IType[] superTypes = PHPModelUtils.getSuperClasses(
type,
cache == null ? null : cache
.getSuperTypeHierarchy(type, null));
if (subgoal.getContext() instanceof MethodContext) {
MethodContext methodContext = (MethodContext) subgoal