function Facade::documentAsString
Throws
See also
https://bugs.php.net/bug.php?id=79191
1 call to Facade::documentAsString()
- Facade::saveDocument in vendor/
phpunit/ php-code-coverage/ src/ Report/ Xml/ Facade.php
File
-
vendor/
phpunit/ php-code-coverage/ src/ Report/ Xml/ Facade.php, line 284
Class
Namespace
SebastianBergmann\CodeCoverage\Report\XmlCode
private function documentAsString(DOMDocument $document) : string {
$xmlErrorHandling = libxml_use_internal_errors(true);
$xml = $document->saveXML();
if ($xml === false) {
$message = 'Unable to generate the XML';
foreach (libxml_get_errors() as $error) {
$message .= PHP_EOL . $error->message;
}
throw new XmlException($message);
}
libxml_clear_errors();
libxml_use_internal_errors($xmlErrorHandling);
return $xml;
}