diff --git a/composer.json b/composer.json index 6d9299258..ead101d2c 100644 --- a/composer.json +++ b/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": { diff --git a/src/Composer/Autoload/ClassMapGenerator.php b/src/Composer/Autoload/ClassMapGenerator.php index f9268bc32..e408eea75 100644 --- a/src/Composer/Autoload/ClassMapGenerator.php +++ b/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); }