diff --git a/src/Composer/Autoload/ClassMapGenerator.php b/src/Composer/Autoload/ClassMapGenerator.php index cc25985960f7..4b38565eb5af 100644 --- a/src/Composer/Autoload/ClassMapGenerator.php +++ b/src/Composer/Autoload/ClassMapGenerator.php @@ -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 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 bab09e31bb64..3954c43e8e2f 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 @@