From f226c9ba3b4ee00247ee7bb561cafe198dc6421f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mr=C2=B7x?= Date: Thu, 12 Aug 2021 15:24:30 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- HttpServer/Http/Response.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/HttpServer/Http/Response.php b/HttpServer/Http/Response.php index 11dba853..6662c568 100644 --- a/HttpServer/Http/Response.php +++ b/HttpServer/Http/Response.php @@ -166,17 +166,17 @@ class Response extends HttpService implements ResponseInterface * @param bool $isChunk * @param int $offset * @param int $limit - * @return FileResponse + * @return static * @throws Exception */ - public function sendFile(string $path, bool $isChunk = false, int $offset = 0, int $limit = 10240): FileResponse + public function sendFile(string $path, bool $isChunk = false, int $offset = 0, int $limit = 10240): static { $this->format = self::FILE; if (!file_exists($path)) { throw new Exception('File `' . $path . '` not exists.'); } $this->endData = ['path' => $path, 'isChunk' => $isChunk, 'limit' => $limit, 'offset' => $offset]; - return new FileResponse($this); + return $this; }