Merge pull request #829 from mozex/allow-pattern-in-uses

Update directory targeting logic to support glob patterns
This commit is contained in:
Nuno Maduro
2023-06-17 16:28:39 +01:00
committed by GitHub
4 changed files with 21 additions and 2 deletions

View File

@ -84,8 +84,10 @@ final class UsesCall
}, $targets);
$this->targets = array_reduce($targets, function (array $accumulator, string $target): array {
if (is_dir($target) || file_exists($target)) {
$accumulator[] = (string) realpath($target);
if (($matches = glob($target)) !== false) {
foreach ($matches as $file) {
$accumulator[] = (string) realpath($file);
}
}
return $accumulator;