Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. Facade.php

function Facade::documentAsString

Throws

XmlException

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

Facade

Namespace

SebastianBergmann\CodeCoverage\Report\Xml

Code

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;
}
RSS feed
Powered by Drupal