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

Method generateReturnCode

internal/extgen/phpfunc.go:74–97  ·  view source on GitHub ↗
(returnType phpType)

Source from the content-addressed store, hash-verified

72}
73
74func (pfg *PHPFuncGenerator) generateReturnCode(returnType phpType) string {
75 switch returnType {
76 case phpString:
77 return ` if (result) {
78 RETURN_STR(result);
79 }
80
81 RETURN_EMPTY_STRING();`
82 case phpInt:
83 return ` RETURN_LONG(result);`
84 case phpFloat:
85 return ` RETURN_DOUBLE(result);`
86 case phpBool:
87 return ` RETURN_BOOL(result);`
88 case phpArray:
89 return ` if (result) {
90 RETURN_ARR(result);
91 }
92
93 RETURN_EMPTY_ARRAY();`
94 default:
95 return ""
96 }
97}

Callers 2

generateMethod · 0.95

Calls

no outgoing calls