src/AppBundle/ShowUnusedPublicAssets/Task.php 1 location
|
@@ 39-48 (lines=10) @@
|
36 |
|
|
37 |
|
/** @var \Iterator $foundFilesInfos */ |
38 |
|
$foundFilesInfos = (new Finder())->in($pathToPublic)->files()->getIterator(); |
39 |
|
foreach ($foundFilesInfos as $foundFileInfo) { |
40 |
|
/** @var $foundFileInfo \Symfony\Component\Finder\SplFileInfo */ |
41 |
|
foreach ($blacklistRegExps as $blacklistRegExp) { |
42 |
|
if (preg_match($blacklistRegExp, $foundFileInfo->getRealPath()) === 1) { |
43 |
|
continue 2; |
44 |
|
} |
45 |
|
} |
46 |
|
|
47 |
|
$existingAssets[] = $foundFileInfo->getRealPath(); |
48 |
|
} |
49 |
|
|
50 |
|
return $existingAssets; |
51 |
|
} |
src/Helper/FileSystem.php 1 location
|
@@ 72-81 (lines=10) @@
|
69 |
|
$filteredFiles = []; |
70 |
|
|
71 |
|
/** @var \Iterator $foundFilesInfos */ |
72 |
|
foreach ($foundFilesInfos as $foundFileInfo) { |
73 |
|
/** @var $foundFileInfo \SplFileInfo */ |
74 |
|
foreach ($blacklistRegExps as $blacklistRegExp) { |
75 |
|
if (preg_match($blacklistRegExp, $foundFileInfo->getRealPath()) === 1) { |
76 |
|
continue 2; |
77 |
|
} |
78 |
|
} |
79 |
|
|
80 |
|
$filteredFiles[] = $foundFileInfo->getRealPath(); |
81 |
|
} |
82 |
|
|
83 |
|
return $filteredFiles; |
84 |
|
} |