Skip to content

Commit 6991959

Browse files
committed
refactoring: short int cast
1 parent 115d481 commit 6991959

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

pkg/ast/visitor/formatter.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1878,7 +1878,7 @@ func (f *formatter) ExprCastDouble(n *ast.ExprCastDouble) {
18781878
}
18791879

18801880
func (f *formatter) ExprCastInt(n *ast.ExprCastInt) {
1881-
n.CastTkn = f.newToken(token.T_INT_CAST, []byte("(integer)"))
1881+
n.CastTkn = f.newToken(token.T_INT_CAST, []byte("(int)"))
18821882
n.Expr.Accept(f)
18831883
}
18841884

pkg/ast/visitor/formatter_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6309,7 +6309,7 @@ func TestFormatter_ExprCastInt(t *testing.T) {
63096309
p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP)
63106310
n.Accept(p)
63116311

6312-
expected := `(integer)$foo`
6312+
expected := `(int)$foo`
63136313
actual := o.String()
63146314

63156315
if expected != actual {

pkg/ast/visitor/printer.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1152,7 +1152,7 @@ func (p *printer) ExprCastDouble(n *ast.ExprCastDouble) {
11521152
}
11531153

11541154
func (p *printer) ExprCastInt(n *ast.ExprCastInt) {
1155-
p.printToken(n.CastTkn, []byte("(integer)"))
1155+
p.printToken(n.CastTkn, []byte("(int)"))
11561156
p.printNode(n.Expr)
11571157
}
11581158

pkg/ast/visitor/printer_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1447,7 +1447,7 @@ func TestPrinterPrintInt(t *testing.T) {
14471447
}
14481448
n.Accept(p)
14491449

1450-
expected := `(integer)$var`
1450+
expected := `(int)$var`
14511451
actual := o.String()
14521452

14531453
if expected != actual {

0 commit comments

Comments
 (0)