diff --git a/src/Repository/InvoiceDocumentRepository.php b/src/Repository/InvoiceDocumentRepository.php index 14580b309..897277a6a 100644 --- a/src/Repository/InvoiceDocumentRepository.php +++ b/src/Repository/InvoiceDocumentRepository.php @@ -161,7 +161,7 @@ final class InvoiceDocumentRepository continue; } - $finder = Finder::create()->ignoreDotFiles(true)->files()->in($searchDir)->name('*.*'); + $finder = Finder::create()->ignoreDotFiles(true)->files()->in($searchDir)->depth(0)->name('*.*'); foreach ($finder->getIterator() as $file) { $doc = new InvoiceDocument($file); // the first found invoice document wins