@@ -48,19 +48,19 @@ func phpEnumName(schemaName, propertyName string) string {
4848 propertyName = strings .TrimSpace (propertyName )
4949 propertyName = strings .ReplaceAll (propertyName , "-" , "_" )
5050 propertyName = strings .ReplaceAll (propertyName , "." , "_" )
51-
51+
5252 baseName := strcase .ToCamel (propertyName )
5353 return schemaName + baseName
5454}
5555
5656func phpEnumCaseName (value string ) string {
5757 value = strings .TrimSpace (value )
58-
58+
5959 // Handle numeric values or values that start with numbers
6060 if len (value ) > 0 && value [0 ] >= '0' && value [0 ] <= '9' {
6161 value = "VALUE_" + value
6262 }
63-
63+
6464 // Replace common separators and special characters
6565 value = strings .ReplaceAll (value , "+" , "_PLUS_" )
6666 value = strings .ReplaceAll (value , "-" , "_" )
@@ -80,21 +80,21 @@ func phpEnumCaseName(value string) string {
8080 value = strings .ReplaceAll (value , "," , "_" )
8181 value = strings .ReplaceAll (value , "'" , "_" )
8282 value = strings .ReplaceAll (value , "\" " , "_" )
83-
83+
8484 // Convert to screaming snake case
8585 value = strcase .ToScreamingSnake (value )
86-
86+
8787 // Clean up multiple underscores
8888 for strings .Contains (value , "__" ) {
8989 value = strings .ReplaceAll (value , "__" , "_" )
9090 }
91-
91+
9292 // Ensure it doesn't start with underscore (unless it's a special value)
9393 value = strings .TrimLeft (value , "_" )
94-
94+
9595 if value == "" {
9696 return "EMPTY"
9797 }
98-
98+
9999 return value
100100}
0 commit comments