Skip to content

Commit

Permalink
Fix handling for non-lowercased enum keyword, fixes #10521
Browse files Browse the repository at this point in the history
  • Loading branch information
Seldaek committed Feb 15, 2022
1 parent eee8816 commit f808e49
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Composer/Autoload/ClassMapGenerator.php
Expand Up @@ -271,7 +271,7 @@ private static function findClasses($path)
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
Expand Down
@@ -1,6 +1,6 @@
<?php

enum RolesBackedEnum:string {
EnUm RolesBackedEnum:string {
case Admin = 'Administrator';
case Guest = 'Guest';
case Moderator = 'Moderator';
Expand Down

0 comments on commit f808e49

Please sign in to comment.