pdfService = $pdfService; $this->maintenanceManager = $maintenanceManagerService; } /** * @param ServerRequestInterface $request * @return ResponseInterface */ public function get(ServerRequestInterface $request): ResponseInterface { $id = $request->getAttribute('id', false); try { return (new TextResponse($this->pdfService->getMaintenanceSheet($id))) ->withHeader('Content-type', 'application/pdf'); } catch (\Exception $e) { return new TextResponse($e->getMessage(), 500); } } }