Avoid tokenizing files for nothing
parent
f1320bf7a1
commit
383c3f0153
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue