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

Method printNodeParameter

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

Source from the content-addressed store, hash-verified

454}
455
456func (p *Printer) printNodeParameter(n node.Node) {
457 nn := n.(*node.Parameter)
458 p.printFreeFloating(nn, freefloating.Start)
459
460 if nn.VariableType != nil {
461 p.Print(nn.VariableType)
462 }
463 p.printFreeFloating(nn, freefloating.OptionalType)
464
465 if nn.ByRef {
466 io.WriteString(p.w, "&")
467 }
468 p.printFreeFloating(nn, freefloating.Ampersand)
469
470 if nn.Variadic {
471 io.WriteString(p.w, "...")
472 }
473 p.printFreeFloating(nn, freefloating.Variadic)
474
475 p.Print(nn.Variable)
476
477 if nn.DefaultValue != nil {
478 p.printFreeFloating(nn, freefloating.Var)
479 io.WriteString(p.w, "=")
480 p.Print(nn.DefaultValue)
481 }
482
483 p.printFreeFloating(nn, freefloating.End)
484}
485
486func (p *Printer) printNodeNullable(n node.Node) {
487 nn := n.(*node.Nullable)

Callers 1

printNodeMethod · 0.95

Calls 2

printFreeFloatingMethod · 0.95
PrintMethod · 0.95

Tested by

no test coverage detected