Skip to content

Commit a2eeae6

Browse files
committed
Fix issue with reading into sources containing subdirectories
1 parent f314990 commit a2eeae6

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

src/FileListing/FileListing.php

+8-3
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,15 @@ public function __construct(Filesystem $filesystem)
1717
$filesystem->addPlugin(new ListWith());
1818
$listing = $filesystem->listWith(['timestamp'], null, true);
1919

20-
$this->files = array_map(function($object) {
21-
return new File($object['path'], $object['timestamp']);
22-
}, $listing);
20+
$this->files = [];
2321

22+
foreach ($listing as $object) {
23+
if ($object['type'] !== 'file') {
24+
continue;
25+
}
26+
27+
$this->files[] = new File($object['path'], $object['timestamp']);
28+
}
2429
}
2530

2631
public function getFileByPath(string $path)

0 commit comments

Comments
 (0)