1
0
Fork 0

Wrap token_get_all for better debuggability

pull/721/head
Jordi Boggiano 2012-05-21 12:51:21 +02:00
parent 794b51fcdd
commit 5c0c101327
1 changed files with 5 additions and 1 deletions

View File

@ -88,7 +88,11 @@ class ClassMapGenerator
static private function findClasses($path)
{
$contents = file_get_contents($path);
try {
$tokens = token_get_all($contents);
} catch (\Exception $e) {
throw new RuntimeException('Could not scan for classes inside '.$path.": \n".$e->getMessage(), 0, $e);
}
$T_TRAIT = version_compare(PHP_VERSION, '5.4', '<') ? -1 : T_TRAIT;
$classes = array();