fix exclude_paths in FilesFinder

This commit is contained in:
Tomas Votruba 2018-09-14 17:27:26 +02:00
parent 6adf8d4405
commit 5978bbbace

View File

@ -105,15 +105,18 @@ final class FilesFinder
}
$finder->filter(function (NativeSplFileInfo $splFileInfo) {
// return false to remove file
foreach ($this->excludePaths as $excludePath) {
if (Strings::match($splFileInfo->getRealPath(), $excludePath)) {
return true;
return false;
}
return fnmatch($splFileInfo->getRealPath(), $excludePath);
if (fnmatch($splFileInfo->getRealPath(), $excludePath)) {
return false;
}
}
return false;
return true;
});
}
}