Skip to content

Commit

Permalink
Update finder to parse only *.php file
Browse files Browse the repository at this point in the history
We faced a issue where swagger-php trying to parse non-php files, that causes `Unexpected token error`. I added this patch to our version of swagger-php, to parse only files with .php extensions.

Is there any use case that swagger php needed to parse non-php files?
  • Loading branch information
marcoleong authored and bfanger committed Dec 5, 2016
1 parent bfb75b2 commit 2661386
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Util.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public static function finder($directory, $exclude = null)
$finder = new Finder();
$finder->sortByName();
}
$finder->files();
$finder->files()->name('*.php');
if (is_string($directory)) {
if (is_file($directory)) { // Scan a single file?
$finder->append([$directory]);
Expand Down

0 comments on commit 2661386

Please sign in to comment.