Skip to content

Commit 1d10f6a

Browse files
author
Caitlin Bales (MSFT)
committed
Update enum type to use strings
1 parent 3a61632 commit 1d10f6a

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Templates/PHP/Model/EnumType.php.tt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class <#=enumT.Name.ToUpperFirstChar()#> extends Enum
2323
int count = 0;
2424
foreach(var value in enumT.Members)
2525
{
26-
count++;
26+
2727
var needsPrefix = TypeHelperPHP.ReservedNames.Contains(value.Name.ToUnderscore());
2828

2929
if (needsPrefix)
@@ -33,8 +33,9 @@ class <#=enumT.Name.ToUpperFirstChar()#> extends Enum
3333
<#
3434
} else {
3535
#>
36-
const <#= value.Name.ToUnderscore().ToUpper()#> = <#= count#>;
36+
const <#= value.Name.ToUnderscore().ToUpper()#> = "<#= count#>";
3737
<# }
38+
count++;
3839
}
3940
#>
4041
}

0 commit comments

Comments
 (0)