1
0
Fork 0

Tweak #1361 to re-enable support for unicode classnames

pull/1366/head
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 {
}