1 package net.sourceforge.phpeclipse.phpeditor.phpparser;
3 import net.sourceforge.phpdt.internal.ui.PHPUiImages;
4 import org.eclipse.jface.resource.ImageDescriptor;
7 * A php variable declaration strongly inspired by the PHPFunctionDeclaration of Khartlage (:.
8 * @author khartlage, Matthieu Casanova
10 public class PHPVarDeclaration extends PHPSegment {
14 * Create a php variable declaration.
15 * @param parent the parent object (it should be a php class)
16 * @param name the name of the variable
17 * @param index where the variable is in the file
18 * @param value la valeur
20 public PHPVarDeclaration(Object parent, String name, int index, String value) {
21 super(parent, name, index);
26 * Create a php variable declaration.
27 * @param parent the parent object (it should be a php class)
28 * @param name the name of the variable
29 * @param index where the variable is in the file
30 * @param value la valeur
32 public PHPVarDeclaration(Object parent, String name, int index) {
33 this(parent, name, index,null);
37 * Get the image of a variable.
38 * @return the image that represents a php variable
40 public ImageDescriptor getImage() {
41 return PHPUiImages.DESC_VAR;
44 public String toString() {
46 return super.toString();
48 return name + " = " + value;