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