diff --git a/src/Composer/Autoload/ClassMapGenerator.php b/src/Composer/Autoload/ClassMapGenerator.php index cc2598596..4b38565eb 100644 --- a/src/Composer/Autoload/ClassMapGenerator.php +++ b/src/Composer/Autoload/ClassMapGenerator.php @@ -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 diff --git a/tests/Composer/Test/Autoload/Fixtures/php8.1/enum_backed.php b/tests/Composer/Test/Autoload/Fixtures/php8.1/enum_backed.php index bab09e31b..3954c43e8 100644 --- a/tests/Composer/Test/Autoload/Fixtures/php8.1/enum_backed.php +++ b/tests/Composer/Test/Autoload/Fixtures/php8.1/enum_backed.php @@ -1,6 +1,6 @@