Fix handling for non-lowercased enum keyword, fixes #10521
parent
eee8816bc3
commit
f808e4907c
|
@ -271,7 +271,7 @@ class ClassMapGenerator
|
|||
if ($name[0] === ':') {
|
||||
// This is an XHP class, https://github.com/facebook/xhp
|
||||
$name = 'xhp'.substr(str_replace(array('-', ':'), array('_', '__'), $name), 1);
|
||||
} elseif ($matches['type'][$i] === 'enum') {
|
||||
} elseif (strtolower($matches['type'][$i]) === 'enum') {
|
||||
// something like:
|
||||
// enum Foo: int { HERP = '123'; }
|
||||
// The regex above captures the colon, which isn't part of
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
enum RolesBackedEnum:string {
|
||||
EnUm RolesBackedEnum:string {
|
||||
case Admin = 'Administrator';
|
||||
case Guest = 'Guest';
|
||||
case Moderator = 'Moderator';
|
||||
|
|
Loading…
Reference in New Issue