Moved finder depth filter to DirectoryController

This commit is contained in:
Chris Kankiewicz
2020-01-04 23:44:25 -07:00
parent f9710c9aa5
commit a2eed61de0
2 changed files with 2 additions and 2 deletions

View File

@@ -50,7 +50,7 @@ class FinderComposer
*/
public function __invoke(): void
{
$finder = Finder::create()->depth(0)->followLinks();
$finder = Finder::create()->followLinks();
$finder->ignoreVCS($this->config->get('app.hide_vcs_files', false));
$finder->filter(function (SplFileInfo $file) {
return ! $this->hiddenFiles()->contains($file->getRealPath());

View File

@@ -47,7 +47,7 @@ class DirectoryController
public function __invoke(Finder $files, Response $response, string $path = '.')
{
try {
$files = $files->in($path);
$files = $files->in($path)->depth(0);
} catch (DirectoryNotFoundException $exception) {
return $this->view->render($response->withStatus(404), '404.twig');
}