1
0
Fork 0
mirror of https://github.com/composer/composer synced 2025-05-09 08:32:56 +00:00

Tweak #1361 to re-enable support for unicode classnames

This commit is contained in:
Jordi Boggiano 2012-11-25 13:52:42 +01:00
parent d3b830efc3
commit 2d7c3c9d27
3 changed files with 9 additions and 2 deletions

View file

@ -125,10 +125,10 @@ class ClassMapGenerator
preg_match_all('{
(?:
\b(?<![\$:>])(?<type>class|interface'.$traits.') \s+ (?<name>\w+)
\b(?<![\$:>])(?<type>class|interface'.$traits.') \s+ (?<name>[^\s\{]+)
| \b(?<![\$:>])(?<ns>namespace) (?<nsname>\s+[^\s;{}\\\\]+(?:\s*\\\\\s*[^\s;{}\\\\]+)*)? \s*[\{;]
)
}ix', $contents, $matches);
}iux', $contents, $matches);
$classes = array();
$namespace = '';

View file

@ -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()),
);

View file

@ -0,0 +1,6 @@
<?php
namespace Unicode;
class {
}