[#82] property type
This commit is contained in:
@@ -2888,6 +2888,12 @@ func (p *Printer) printStmtPropertyList(n node.Node) {
|
||||
p.Print(m)
|
||||
}
|
||||
|
||||
if nn.Type != nil && nn.Type.GetFreeFloating().IsEmpty() {
|
||||
io.WriteString(p.w, " ")
|
||||
}
|
||||
|
||||
p.Print(nn.Type)
|
||||
|
||||
if nn.Properties[0].GetFreeFloating().IsEmpty() {
|
||||
io.WriteString(p.w, " ")
|
||||
}
|
||||
|
||||
@@ -1256,7 +1256,7 @@ func TestParseAndPrintPropertyList(t *testing.T) {
|
||||
class Foo {
|
||||
var $a = '' , $b = null ;
|
||||
private $c ;
|
||||
public static $d ;
|
||||
public static Bar $d ;
|
||||
|
||||
}`
|
||||
|
||||
|
||||
@@ -3928,6 +3928,13 @@ func TestPrinterPrintPropertyList(t *testing.T) {
|
||||
&node.Identifier{Value: "public"},
|
||||
&node.Identifier{Value: "static"},
|
||||
},
|
||||
Type: &name.Name{
|
||||
Parts: []node.Node{
|
||||
&name.NamePart{
|
||||
Value: "Foo",
|
||||
},
|
||||
},
|
||||
},
|
||||
Properties: []node.Node{
|
||||
&stmt.Property{
|
||||
Variable: &expr.Variable{
|
||||
@@ -3943,7 +3950,7 @@ func TestPrinterPrintPropertyList(t *testing.T) {
|
||||
},
|
||||
})
|
||||
|
||||
expected := `public static $a='a',$b;`
|
||||
expected := `public static Foo $a='a',$b;`
|
||||
actual := o.String()
|
||||
|
||||
if expected != actual {
|
||||
|
||||
Reference in New Issue
Block a user