MCPcopy Create free account
hub / github.com/z7zmey/php-parser / printStmtInterface

Method printStmtInterface

printer/printer.go:2802–2833  ·  view source on GitHub ↗
(n node.Node)

Source from the content-addressed store, hash-verified

2800}
2801
2802func (p *Printer) printStmtInterface(n node.Node) {
2803 nn := n.(*stmt.Interface)
2804 p.printFreeFloating(nn, freefloating.Start)
2805
2806 io.WriteString(p.w, "interface")
2807
2808 if nn.InterfaceName.GetFreeFloating().IsEmpty() {
2809 io.WriteString(p.w, " ")
2810 }
2811
2812 p.Print(nn.InterfaceName)
2813
2814 if nn.Extends != nil {
2815 p.printFreeFloating(nn.Extends, freefloating.Start)
2816 if nn.Extends.GetFreeFloating().IsEmpty() {
2817 io.WriteString(p.w, " ")
2818 }
2819 io.WriteString(p.w, "extends")
2820 if nn.Extends.InterfaceNames[0].GetFreeFloating().IsEmpty() {
2821 io.WriteString(p.w, " ")
2822 }
2823 p.joinPrint(",", nn.Extends.InterfaceNames)
2824 }
2825
2826 p.printFreeFloating(nn, freefloating.Name)
2827 io.WriteString(p.w, "{")
2828 p.printNodes(nn.Stmts)
2829 p.printFreeFloating(nn, freefloating.Stmts)
2830 io.WriteString(p.w, "}")
2831
2832 p.printFreeFloating(nn, freefloating.End)
2833}
2834
2835func (p *Printer) printStmtLabel(n node.Node) {
2836 nn := n.(*stmt.Label)

Callers 1

printNodeMethod · 0.95

Calls 6

printFreeFloatingMethod · 0.95
PrintMethod · 0.95
joinPrintMethod · 0.95
printNodesMethod · 0.95
IsEmptyMethod · 0.80
GetFreeFloatingMethod · 0.65

Tested by

no test coverage detected