Update directory targeting logic to support glob patterns

This commit is contained in:
Mohammad Zahed
2023-06-07 14:56:19 +03:00
parent 4196579a3d
commit c9180e590e

View File

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