X-Git-Url: http://secure.phpeclipse.com diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/compiler/parser/PHPVarDeclaration.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/compiler/parser/PHPVarDeclaration.java index ac22f1b..03a9955 100644 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/compiler/parser/PHPVarDeclaration.java +++ b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/compiler/parser/PHPVarDeclaration.java @@ -3,6 +3,7 @@ package net.sourceforge.phpdt.internal.compiler.parser; import net.sourceforge.phpdt.internal.ui.PHPUiImages; import org.eclipse.jface.resource.ImageDescriptor; +import test.PHPVar; /** * A php variable declaration strongly inspired by the PHPFunctionDeclaration of Khartlage (:. @@ -10,8 +11,8 @@ import org.eclipse.jface.resource.ImageDescriptor; */ public class PHPVarDeclaration extends PHPSegment { - /** The value of the variable. */ - private String value; + /** A PHPVar. */ + private final PHPVar variable; /** * Create a php variable declaration. * @param parent the parent object (it should be a php class) @@ -21,7 +22,7 @@ public class PHPVarDeclaration extends PHPSegment { */ public PHPVarDeclaration(Object parent, String name, int index, String value) { super(parent, name, index); - this.value = value; + variable = new PHPVar(name,value); } /** @@ -42,11 +43,15 @@ public class PHPVarDeclaration extends PHPSegment { return PHPUiImages.DESC_VAR; } + /** + * Get the PHPVar + * @return a phpvar object + */ + public PHPVar getVariable() { + return variable; + } + public String toString() { - if (value == null || value.equals("")) { - return super.toString(); - } else { - return name + " = " + value; - } + return variable.toString(); } }