@Override
  protected void modifyMethodInfo(
      MethodDeclaration methodDeclaration, ISourceElementRequestor.MethodInfo mi) {
    Declaration parentDeclaration = null;

    // find declaration that was before this method:
    declarations.pop();
    if (!declarations.empty()) {
      parentDeclaration = declarations.peek();
    }
    declarations.push(methodDeclaration);

    mi.isConstructor =
        mi.name.equalsIgnoreCase(CONSTRUCTOR_NAME)
            || (parentDeclaration instanceof ClassDeclaration
                && mi.name.equalsIgnoreCase(((ClassDeclaration) parentDeclaration).getName()));

    if (fCurrentClass == null || fCurrentClass == fLastNamespace) {
      mi.modifiers |= Modifiers.AccGlobal;
    }

    mi.parameterTypes = processParamterTypes(methodDeclaration);
    mi.returnType = processReturnType(methodDeclaration);

    // modify method info if needed by extensions
    for (final PHPSourceElementRequestorExtension extension : extensions) {
      extension.modifyMethodInfo(methodDeclaration, mi);
    }
  }