X-Git-Url: http://secure.phpeclipse.com diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/compiler/ast/MethodDeclaration.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/compiler/ast/MethodDeclaration.java index e08010d..5c3a64e 100644 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/compiler/ast/MethodDeclaration.java +++ b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/compiler/ast/MethodDeclaration.java @@ -9,6 +9,7 @@ import org.eclipse.jface.text.Position; import java.util.Hashtable; import java.util.Enumeration; import java.util.ArrayList; +import java.util.List; /** * A Method declaration. @@ -64,27 +65,7 @@ public class MethodDeclaration extends Statement implements OutlineableWithChild } public String toStringHeader() { - StringBuffer buff = new StringBuffer(); - buff.append("function ");//$NON-NLS-1$ - if (reference) { - buff.append('&');//$NON-NLS-1$ - } - buff.append(name).append("(");//$NON-NLS-1$ - - if (arguments != null) { - Enumeration values = arguments.elements(); - int i = 0; - while (values.hasMoreElements()) { - VariableDeclaration o = (VariableDeclaration) values.nextElement(); - buff.append(o.toStringExpression()); - if (i != (arguments.size() - 1)) { - buff.append(", "); //$NON-NLS-1$ - } - i++; - } - } - buff.append(")"); //$NON-NLS-1$ - return buff.toString(); + return "function " + toString(); } /** @@ -135,10 +116,33 @@ public class MethodDeclaration extends Statement implements OutlineableWithChild } public String toString() { - return toStringHeader(); + StringBuffer buff = new StringBuffer(); + if (reference) { + buff.append("&");//$NON-NLS-1$ + } + buff.append(name).append("(");//$NON-NLS-1$ + + if (arguments != null) { + Enumeration values = arguments.elements(); + int i = 0; + while (values.hasMoreElements()) { + VariableDeclaration o = (VariableDeclaration) values.nextElement(); + buff.append(o.toStringExpression()); + if (i != (arguments.size() - 1)) { + buff.append(", "); //$NON-NLS-1$ + } + i++; + } + } + buff.append(")"); //$NON-NLS-1$ + return buff.toString(); } public Position getPosition() { return position; } + + public List getList() { + return children; + } }