xml; } public function getString(): string { $string = $this->xml->asXML(); if (!is_string($string)) { throw new \Exception('Could not save SVG XML to string'); } if ($this->excludeXmlDeclaration) { $string = str_replace("\n", '', $string); } return $string; } public function getMimeType(): string { return 'image/svg+xml'; } }