Exemplo n.º 1
0
        // Public Methods 


        public void Emit(PhpSourceCodeEmiter emiter, PhpSourceCodeWriter writer, PhpEmitStyle style)
        {
            if (IsConst)
            {
                //  const CONSTANT = 'constant value';
                writer.WriteLnF("const {0} = {1};", Name, ConstValue.GetPhpCode(style));
                return;
            }

            var a = string.Format("{0}{1} ${2}",
                                  Visibility.ToString().ToLower(),
                                  IsStatic ? " static" : "",
                                  Name
                                  );

            if (ConstValue != null)
            {
                a += " = " + ConstValue.GetPhpCode(style);
            }
            writer.WriteLn(a + ";");
        }