(expr ast.Expr)
| 164 | } |
| 165 | |
| 166 | func (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 | |
| 181 | var goToPhpTypeMap = map[string]phpType{ |
| 182 | "string": phpString, |