Skip to content

Commit

Permalink
IssueXML.php: skip DOCTYPE (fixes cobertura)
Browse files Browse the repository at this point in the history
skips '<!DOCTYPE coverage SYSTEM ...' (cobertura) and uses the following element instead
  • Loading branch information
croensch authored and mmoll committed Mar 11, 2024
1 parent 3824d02 commit 8803324
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
5 changes: 0 additions & 5 deletions phpstan_baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,6 @@ parameters:
count: 1
path: src/PHPCodeBrowser/IssueXML.php

-
message: "#^Only booleans are allowed in an if condition, mixed given\\.$#"
count: 1
path: src/PHPCodeBrowser/IssueXML.php

-
message: "#^Only booleans are allowed in a negated boolean, string given\\.$#"
count: 1
Expand Down
5 changes: 5 additions & 0 deletions src/PHPCodeBrowser/IssueXML.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
namespace PHPCodeBrowser;

use DOMDocument;
use DOMDocumentType;
use DOMNode;
use DOMNodeList;
use DOMXPath;
Expand Down Expand Up @@ -155,6 +156,10 @@ public function addDirectory(string $directory): IssueXML
public function addXMLFile(DOMDocument $domDocument): void
{
foreach ($domDocument->childNodes as $node) {
if ($node instanceof DOMDocumentType) {
continue;
}

$this->documentElement->appendChild($this->importNode($node, true));
}
}
Expand Down

0 comments on commit 8803324

Please sign in to comment.