From d46563f9947c5a242950d950aa5d6fb10e305443 Mon Sep 17 00:00:00 2001 From: Pierre Rudloff Date: Thu, 3 Feb 2022 20:21:04 +0100 Subject: [PATCH] Simplify code --- classes/Controller/DownloadController.php | 5 ++--- classes/Robo/Plugin/Commands/ReleaseCommand.php | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/classes/Controller/DownloadController.php b/classes/Controller/DownloadController.php index 78e8b77..50a1110 100644 --- a/classes/Controller/DownloadController.php +++ b/classes/Controller/DownloadController.php @@ -222,13 +222,12 @@ class DownloadController extends BaseController if ($request->isGet()) { $response = $response->withBody($body); } - $response = $response->withHeader( + + return $response->withHeader( 'Content-Disposition', 'attachment; filename="' . $this->video->getFilename() . '"' ); - - return $response; } /** diff --git a/classes/Robo/Plugin/Commands/ReleaseCommand.php b/classes/Robo/Plugin/Commands/ReleaseCommand.php index 0edd71d..52f2b6d 100644 --- a/classes/Robo/Plugin/Commands/ReleaseCommand.php +++ b/classes/Robo/Plugin/Commands/ReleaseCommand.php @@ -31,7 +31,7 @@ class ReleaseCommand extends Tasks $tmpDir = $this->_tmpDir(); - $filename = 'alltube-' . trim((string)$result->getMessage()) . '.zip'; + $filename = 'alltube-' . trim($result->getMessage()) . '.zip'; /** @var FilesystemStack $rmTask */ $rmTask = $this->taskFilesystemStack();