1 | <?php |
||
2 | |||
3 | declare(strict_types=1); |
||
4 | |||
5 | namespace Gember\FileFinderSymfony; |
||
6 | |||
7 | use Gember\EventSourcing\Util\File\Finder\Finder; |
||
8 | use SplFileInfo; |
||
9 | use Override; |
||
10 | |||
11 | final readonly class SymfonyFinder implements Finder |
||
0 ignored issues
–
show
Bug
introduced
by
![]() |
|||
12 | { |
||
13 | 1 | public function __construct( |
|
14 | private SymfonyFinderFactory $factory, |
||
15 | 1 | ) {} |
|
16 | |||
17 | 1 | #[Override] |
|
18 | public function getFiles(string $path): array |
||
19 | { |
||
20 | 1 | $finder = $this->factory->createFinder(); |
|
21 | |||
22 | 1 | $finder->files()->in($path); |
|
23 | |||
24 | 1 | return array_values(array_map( |
|
25 | 1 | fn(SplFileInfo $file) => $file->getPathname(), |
|
26 | 1 | [...$finder], |
|
27 | 1 | )); |
|
28 | } |
||
29 | } |
||
30 |