Browse Source

bumped finder version, reverted warning suppression

Robert Schönthal 12 năm trước cách đây
mục cha
commit
963f189fb2
2 tập tin đã thay đổi với 3 bổ sung7 xóa
  1. 1 1
      composer.json
  2. 2 6
      src/Composer/Autoload/ClassMapGenerator.php

+ 1 - 1
composer.json

@@ -26,7 +26,7 @@
         "justinrainbow/json-schema": "1.1.*",
         "seld/jsonlint": "1.*",
         "symfony/console": "~2.3@dev",
-        "symfony/finder": "~2.1",
+        "symfony/finder": "~2.2",
         "symfony/process": "~2.1@dev"
     },
     "require-dev": {

+ 2 - 6
src/Composer/Autoload/ClassMapGenerator.php

@@ -54,7 +54,7 @@ class ClassMapGenerator
             if (is_file($path)) {
                 $path = array(new \SplFileInfo($path));
             } elseif (is_dir($path)) {
-                $path = Finder::create()->useBestAdapter()->files()->followLinks()->name('/.*[php|inc]/')->in($path);
+                $path = Finder::create()->useBestAdapter()->files()->followLinks()->name('/\.(php|inc)$/')->in($path);
             } else {
                 throw new \RuntimeException(
                     'Could not scan for classes inside "'.$path.
@@ -98,11 +98,7 @@ class ClassMapGenerator
         $traits = version_compare(PHP_VERSION, '5.4', '<') ? '' : '|trait';
 
         try {
-            if (!is_readable($path)) {
-                throw new \RuntimeException('file not found');
-            }
-            //suppress warnings on unclosed comments
-            $contents = @php_strip_whitespace($path);
+            $contents = php_strip_whitespace($path);
         } catch (\Exception $e) {
             throw new \RuntimeException('Could not scan for classes inside '.$path.": \n".$e->getMessage(), 0, $e);
         }