18 public function scan($dir, array $patterns = [], array $excludePatterns = [])
20 $recursiveIterator = new \RecursiveIteratorIterator(
21 new \RecursiveDirectoryIterator($dir, \FilesystemIterator::FOLLOW_SYMLINKS)
24 foreach ($recursiveIterator as $file) {
30 $filePath = str_replace(
'\\',
'/', $file->getRealPath());
31 if (!empty($excludePatterns)) {
32 foreach ($excludePatterns as $excludePattern) {
33 if (preg_match($excludePattern, $filePath)) {
39 if (preg_match(
$pattern, $filePath)) {