From c9e58762335b5ef17c147e3af143abf20a40ac25 Mon Sep 17 00:00:00 2001 From: Sukhwinder Dhillon Date: Wed, 23 Aug 2023 13:02:15 +0200 Subject: [PATCH] Pdfexport: Add variable type hint --- library/Pdfexport/ProvidedHook/Pdfexport.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/library/Pdfexport/ProvidedHook/Pdfexport.php b/library/Pdfexport/ProvidedHook/Pdfexport.php index 113eff0..c5f8342 100644 --- a/library/Pdfexport/ProvidedHook/Pdfexport.php +++ b/library/Pdfexport/ProvidedHook/Pdfexport.php @@ -9,6 +9,7 @@ use Icinga\Application\Hook; use Icinga\Application\Hook\PdfexportHook; use Icinga\Application\Icinga; +use Icinga\Application\Web; use Icinga\Module\Pdfexport\HeadlessChrome; use Icinga\Module\Pdfexport\PrintableHtmlDocument; use iio\libmergepdf\Driver\TcpdiDriver; @@ -123,7 +124,9 @@ public function streamPdfFromHtml($html, $filename) $pdf = $merger->merge(); } - Icinga::app()->getResponse() + /** @var Web $app */ + $app = Icinga::app(); + $app->getResponse() ->setHeader('Content-Type', 'application/pdf', true) ->setHeader('Content-Disposition', "inline; filename=\"$filename\"", true) ->setBody($pdf)