Skip to content

Commit f0b16b3

Browse files
staabmsebastianbergmann
authored andcommitted
totals-element cannot already exist at this point in time
1 parent 480ab39 commit f0b16b3

File tree

1 file changed

+6
-10
lines changed

1 file changed

+6
-10
lines changed

src/Report/Xml/File.php

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -31,16 +31,12 @@ public function __construct(DOMElement $context)
3131

3232
public function totals(): Totals
3333
{
34-
$totalsContainer = $this->contextNode->firstChild;
35-
36-
if ($totalsContainer === null) {
37-
$totalsContainer = $this->contextNode->appendChild(
38-
$this->dom->createElementNS(
39-
Facade::XML_NAMESPACE,
40-
'totals',
41-
),
42-
);
43-
}
34+
$totalsContainer = $this->contextNode->appendChild(
35+
$this->dom->createElementNS(
36+
Facade::XML_NAMESPACE,
37+
'totals',
38+
),
39+
);
4440

4541
assert($totalsContainer instanceof DOMElement);
4642

0 commit comments

Comments
 (0)