From b0001c6010840362355c181b831b4517ac19b8fc Mon Sep 17 00:00:00 2001 From: jld3103 Date: Wed, 14 Jun 2023 08:56:42 +0200 Subject: Add template types to responses Signed-off-by: jld3103 --- lib/public/AppFramework/Http/ZipResponse.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'lib/public/AppFramework/Http/ZipResponse.php') diff --git a/lib/public/AppFramework/Http/ZipResponse.php b/lib/public/AppFramework/Http/ZipResponse.php index 23e9f1f7a94..cd7f71f858d 100644 --- a/lib/public/AppFramework/Http/ZipResponse.php +++ b/lib/public/AppFramework/Http/ZipResponse.php @@ -9,6 +9,7 @@ declare(strict_types=1); * @author Jakob Sack * @author Morris Jobke * @author Roeland Jago Douma + * @author Kate Döen * * @license GNU AGPL version 3 or any later version * @@ -29,12 +30,16 @@ declare(strict_types=1); namespace OCP\AppFramework\Http; use OC\Streamer; +use OCP\AppFramework\Http; use OCP\IRequest; /** * Public library to send several files in one zip archive. * * @since 15.0.0 + * @template S of int + * @template H of array + * @template-extends Response> */ class ZipResponse extends Response implements ICallbackResponse { /** @var array{internalName: string, resource: resource, size: int, time: int}[] Files to be added to the zip response */ @@ -44,10 +49,12 @@ class ZipResponse extends Response implements ICallbackResponse { private IRequest $request; /** + * @param S $status + * @param H $headers * @since 15.0.0 */ - public function __construct(IRequest $request, string $name = 'output') { - parent::__construct(); + public function __construct(IRequest $request, string $name = 'output', int $status = Http::STATUS_OK, array $headers = []) { + parent::__construct($status, $headers); $this->name = $name; $this->request = $request; -- cgit v1.2.3