Skip to content

Commit 5a24c0c

Browse files
authored
refactor: simplify FileLocator::listFiles() (#10142)
1 parent aa0d83e commit 5a24c0c

1 file changed

Lines changed: 1 addition & 13 deletions

File tree

system/Autoloader/FileLocator.php

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -330,19 +330,7 @@ public function listFiles(string $path): array
330330
helper('filesystem');
331331

332332
foreach ($this->getNamespaces() as $namespace) {
333-
$fullPath = $namespace['path'] . $path;
334-
$resolvedPath = realpath($fullPath);
335-
$fullPath = $resolvedPath !== false ? $resolvedPath : $fullPath;
336-
337-
if (! is_dir($fullPath)) {
338-
continue;
339-
}
340-
341-
$tempFiles = get_filenames($fullPath, true, false, false);
342-
343-
if ($tempFiles !== []) {
344-
$files = array_merge($files, $tempFiles);
345-
}
333+
$files = array_merge($files, get_filenames($namespace['path'] . $path, true, false, false));
346334
}
347335

348336
return $files;

0 commit comments

Comments
 (0)