diff --git a/src/Report/Xml/Project.php b/src/Report/Xml/Project.php index 160170320..8b9e031c9 100644 --- a/src/Report/Xml/Project.php +++ b/src/Report/Xml/Project.php @@ -63,19 +63,12 @@ public function buildInformation(): BuildInformation public function tests(): Tests { - $testsNode = $this->contextNode()->getElementsByTagNameNS( - Facade::XML_NAMESPACE, - 'tests', - )->item(0); - - if ($testsNode === null) { - $testsNode = $this->contextNode()->appendChild( - $this->dom()->createElementNS( - Facade::XML_NAMESPACE, - 'tests', - ), - ); - } + $testsNode = $this->contextNode()->appendChild( + $this->dom()->createElementNS( + Facade::XML_NAMESPACE, + 'tests', + ), + ); assert($testsNode instanceof DOMElement); diff --git a/src/Report/Xml/Report.php b/src/Report/Xml/Report.php index 14d2d5a06..6f4400a02 100644 --- a/src/Report/Xml/Report.php +++ b/src/Report/Xml/Report.php @@ -119,19 +119,12 @@ public function traitObject( public function source(): Source { - $source = $this->contextNode()->getElementsByTagNameNS( - Facade::XML_NAMESPACE, - 'source', - )->item(0); - - if ($source === null) { - $source = $this->contextNode()->appendChild( - $this->dom()->createElementNS( - Facade::XML_NAMESPACE, - 'source', - ), - ); - } + $source = $this->contextNode()->appendChild( + $this->dom()->createElementNS( + Facade::XML_NAMESPACE, + 'source', + ), + ); assert($source instanceof DOMElement);