refactoring: short int cast

This commit is contained in:
Vadym Slizov 2020-12-26 22:48:02 +02:00
parent 115d481a57
commit 69919594fd
No known key found for this signature in database
GPG Key ID: AEA2A9388EF42A4A
4 changed files with 4 additions and 4 deletions

View File

@ -1878,7 +1878,7 @@ func (f *formatter) ExprCastDouble(n *ast.ExprCastDouble) {
} }
func (f *formatter) ExprCastInt(n *ast.ExprCastInt) { func (f *formatter) ExprCastInt(n *ast.ExprCastInt) {
n.CastTkn = f.newToken(token.T_INT_CAST, []byte("(integer)")) n.CastTkn = f.newToken(token.T_INT_CAST, []byte("(int)"))
n.Expr.Accept(f) n.Expr.Accept(f)
} }

View File

@ -6309,7 +6309,7 @@ func TestFormatter_ExprCastInt(t *testing.T) {
p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP)
n.Accept(p) n.Accept(p)
expected := `(integer)$foo` expected := `(int)$foo`
actual := o.String() actual := o.String()
if expected != actual { if expected != actual {

View File

@ -1152,7 +1152,7 @@ func (p *printer) ExprCastDouble(n *ast.ExprCastDouble) {
} }
func (p *printer) ExprCastInt(n *ast.ExprCastInt) { func (p *printer) ExprCastInt(n *ast.ExprCastInt) {
p.printToken(n.CastTkn, []byte("(integer)")) p.printToken(n.CastTkn, []byte("(int)"))
p.printNode(n.Expr) p.printNode(n.Expr)
} }

View File

@ -1447,7 +1447,7 @@ func TestPrinterPrintInt(t *testing.T) {
} }
n.Accept(p) n.Accept(p)
expected := `(integer)$var` expected := `(int)$var`
actual := o.String() actual := o.String()
if expected != actual { if expected != actual {