MCPcopy Index your code
hub / github.com/php/frankenphp / typeToString

Method typeToString

internal/extgen/classparser.go:166–179  ·  view source on GitHub ↗
(expr ast.Expr)

Source from the content-addressed store, hash-verified

164}
165
166func (cp *classParser) typeToString(expr ast.Expr) string {
167 switch t := expr.(type) {
168 case *ast.Ident:
169 return t.Name
170 case *ast.StarExpr:
171 return "*" + cp.typeToString(t.X)
172 case *ast.ArrayType:
173 return "[]" + cp.typeToString(t.Elt)
174 case *ast.MapType:
175 return "map[" + cp.typeToString(t.Key) + "]" + cp.typeToString(t.Value)
176 default:
177 return "any"
178 }
179}
180
181var goToPhpTypeMap = map[string]phpType{
182 "string": phpString,

Callers 1

parseStructFieldMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected