1
0
Fork 0

Fix php_strip_whitespace bugginess, fixes #3030

pull/3137/head
Jordi Boggiano 2014-07-20 00:07:58 +02:00
parent e3f32a79f3
commit a227523c4f
1 changed files with 3 additions and 3 deletions

View File

@ -115,7 +115,7 @@ class ClassMapGenerator
$traits = version_compare(PHP_VERSION, '5.4', '<') ? '' : '|trait'; $traits = version_compare(PHP_VERSION, '5.4', '<') ? '' : '|trait';
try { try {
$contents = php_strip_whitespace($path); $contents = @php_strip_whitespace($path);
} catch (\Exception $e) { } catch (\Exception $e) {
throw new \RuntimeException('Could not scan for classes inside '.$path.": \n".$e->getMessage(), 0, $e); throw new \RuntimeException('Could not scan for classes inside '.$path.": \n".$e->getMessage(), 0, $e);
} }
@ -160,8 +160,8 @@ class ClassMapGenerator
} else { } else {
$name = $matches['name'][$i]; $name = $matches['name'][$i];
if ($name[0] === ':') { if ($name[0] === ':') {
// This is an XHP class, https://github.com/facebook/xhp // This is an XHP class, https://github.com/facebook/xhp
$name = 'xhp'.substr(str_replace(array('-', ':'), array('_', '__'), $name), 1); $name = 'xhp'.substr(str_replace(array('-', ':'), array('_', '__'), $name), 1);
} }
$classes[] = ltrim($namespace . $name, '\\'); $classes[] = ltrim($namespace . $name, '\\');
} }