diff --git a/src/Composer/Autoload/ClassMapGenerator.php b/src/Composer/Autoload/ClassMapGenerator.php index f79c23526..bebf7c7e3 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+ (?[^\s\{]+) - | \b(?])(?namespace) (?\s+[^\s;{}\\\\]+(?:\s*\\\\\s*[^\s;{}\\\\]+)*)? \s*[\{;] + \b(?])(?class|interface'.$traits.') \s+ (?[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*) + | \b(?])(?namespace) (?\s+[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*(?:\s*\\\\\s*[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*)*)? \s*[\{;] ) - }iux', $contents, $matches); + }ix', $contents, $matches); $classes = array(); $namespace = ''; diff --git a/tests/Composer/Test/Autoload/ClassMapGeneratorTest.php b/tests/Composer/Test/Autoload/ClassMapGeneratorTest.php index 3aea3a730..2f05e60b6 100644 --- a/tests/Composer/Test/Autoload/ClassMapGeneratorTest.php +++ b/tests/Composer/Test/Autoload/ClassMapGeneratorTest.php @@ -54,7 +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', + '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 index ddd9359cf..5f96dec59 100644 --- a/tests/Composer/Test/Autoload/Fixtures/classmap/Unicode.php +++ b/tests/Composer/Test/Autoload/Fixtures/classmap/Unicode.php @@ -1,6 +1,6 @@