fingerprintId = (int)$this->getUrlParamInt('fingerprintId'); } public function handle(): void { $filename = Setting::PATH_QR_CODES . (string)$this->fingerprintId . '.svg'; if (!is_file($filename)) { $this->response = new ApiJsonResponse(); $this->response->setParameter('success', false); $this->response->setMessage('No QR code for fingerprint id %d found!'); $this->response->setMimeType(ApiResponse::MIME_TYPE_JSON); } $this->response = new ApiSvgResponse(); $file = fopen($filename, 'r'); $this->response->setContent(fread($file, filesize($filename))); fclose($file); } }