1
0
Fork 0

Avoid tokenizing files for nothing

pull/824/head
Jordi Boggiano 2012-06-22 18:59:15 +02:00
parent f1320bf7a1
commit 383c3f0153
1 changed files with 3 additions and 0 deletions

View File

@ -89,6 +89,9 @@ class ClassMapGenerator
{
$contents = file_get_contents($path);
try {
if (!preg_match('{\b(?:class|interface|trait)\b}i', $contents)) {
return array();
}
$tokens = token_get_all($contents);
} catch (\Exception $e) {
throw new \RuntimeException('Could not scan for classes inside '.$path.": \n".$e->getMessage(), 0, $e);