From 4b99f03e0d80662c2a4cb9ba8500ef90026db1eb Mon Sep 17 00:00:00 2001 From: Pierre Rudloff Date: Sun, 11 Sep 2016 19:03:51 +0200 Subject: [PATCH] Lint --- controllers/FrontController.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/controllers/FrontController.php b/controllers/FrontController.php index dbfab37..d11baf2 100644 --- a/controllers/FrontController.php +++ b/controllers/FrontController.php @@ -107,7 +107,7 @@ class FrontController if (isset($params['url'])) { if (isset($params['audio'])) { try { - return $this->getStream($params["url"], 'mp3[protocol^=http]', $response, $request); + return $this->getStream($params['url'], 'mp3[protocol^=http]', $response, $request); } catch (\Exception $e) { $response = $response->withHeader( 'Content-Disposition', @@ -172,13 +172,14 @@ class FrontController } $video = $this->download->getJSON($url, $format); $client = new \GuzzleHttp\Client(); - $stream = $client->request('GET', $video->url, array('stream'=>true)); + $stream = $client->request('GET', $video->url, ['stream' => true]); $response = $response->withHeader('Content-Disposition', 'attachment; filename="'.$video->_filename.'"'); $response = $response->withHeader('Content-Type', $stream->getHeader('Content-Type')); $response = $response->withHeader('Content-Length', $stream->getHeader('Content-Length')); if ($request->isGet()) { $response = $response->withBody($stream->getBody()); } + return $response; } @@ -195,7 +196,7 @@ class FrontController $params = $request->getQueryParams(); if (isset($params['url'])) { try { - return $this->getStream($params["url"], $params["format"], $response, $request); + return $this->getStream($params['url'], $params['format'], $response, $request); } catch (\Exception $e) { $response->getBody()->write($e->getMessage());