浏览代码

Abort quickly if the only match is class= in a file

Jordi Boggiano 11 年之前
父节点
当前提交
e3a10b31ab
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      src/Composer/Autoload/ClassMapGenerator.php

+ 1 - 1
src/Composer/Autoload/ClassMapGenerator.php

@@ -104,7 +104,7 @@ class ClassMapGenerator
         }
 
         // return early if there is no chance of matching anything in this file
-        if (!preg_match('{\b(?:class|interface'.$traits.')\b}i', $contents)) {
+        if (!preg_match('{\b(?:class|interface'.$traits.')\s}i', $contents)) {
             return array();
         }