'.+'], defaults: ['dirs' => ''], methods: [Request::METHOD_GET] )] public function __invoke(FileSystemService $fileSystemService, string $dirs): Response { if ($fileSystemService->isFile(substr_replace($dirs, '', -1))) { return $this->render('file.html.twig', [ 'file' => $fileSystemService->getFile((string) substr_replace($dirs, '', -1)), ]); } return $this->render('home.html.twig', [ 'content' => $fileSystemService->getDirs($dirs), 'fileForm' => $this->createForm(UploadFileForm::class), ]); } }