diff --git a/src/Composer/Autoload/ClassMapGenerator.php b/src/Composer/Autoload/ClassMapGenerator.php index 427d3342e..f79c23526 100644 --- a/src/Composer/Autoload/ClassMapGenerator.php +++ b/src/Composer/Autoload/ClassMapGenerator.php @@ -125,10 +125,10 @@ class ClassMapGenerator preg_match_all('{ (?: - \b(?])(?class|interface'.$traits.') \s+ (?\w+) + \b(?])(?class|interface'.$traits.') \s+ (?[^\s\{]+) | \b(?])(?namespace) (?\s+[^\s;{}\\\\]+(?:\s*\\\\\s*[^\s;{}\\\\]+)*)? \s*[\{;] ) - }ix', $contents, $matches); + }iux', $contents, $matches); $classes = array(); $namespace = ''; diff --git a/tests/Composer/Test/Autoload/ClassMapGeneratorTest.php b/tests/Composer/Test/Autoload/ClassMapGeneratorTest.php index 3856247de..3aea3a730 100644 --- a/tests/Composer/Test/Autoload/ClassMapGeneratorTest.php +++ b/tests/Composer/Test/Autoload/ClassMapGeneratorTest.php @@ -54,6 +54,7 @@ class ClassMapGeneratorTest extends \PHPUnit_Framework_TestCase 'Foo\\LargeClass' => realpath(__DIR__).'/Fixtures/classmap/LargeClass.php', 'Foo\\LargeGap' => realpath(__DIR__).'/Fixtures/classmap/LargeGap.php', 'Foo\\MissingSpace' => realpath(__DIR__).'/Fixtures/classmap/MissingSpace.php', + 'Unicode\\↑' => realpath(__DIR__).'/Fixtures/classmap/Unicode.php', )), array(__DIR__.'/Fixtures/template', array()), ); diff --git a/tests/Composer/Test/Autoload/Fixtures/classmap/Unicode.php b/tests/Composer/Test/Autoload/Fixtures/classmap/Unicode.php new file mode 100644 index 000000000..ddd9359cf --- /dev/null +++ b/tests/Composer/Test/Autoload/Fixtures/classmap/Unicode.php @@ -0,0 +1,6 @@ +