Skip to content

Commit a1b0ae5

Browse files
staabmsebastianbergmann
authored andcommitted
Project: Make parent::__construct() call explicit
1 parent 6cda094 commit a1b0ae5

File tree

1 file changed

+10
-14
lines changed

1 file changed

+10
-14
lines changed

src/Report/Xml/Project.php

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,16 @@ final class Project extends Node
2323
*/
2424
public function __construct(string $directory)
2525
{
26-
$this->init();
26+
$dom = new DOMDocument;
27+
$dom->loadXML('<?xml version="1.0" ?><phpunit xmlns="https://schema.phpunit.de/coverage/1.0"><build/><project/></phpunit>');
28+
29+
parent::__construct(
30+
$dom->getElementsByTagNameNS(
31+
Facade::XML_NAMESPACE,
32+
'project',
33+
)->item(0),
34+
);
35+
2736
$this->setProjectSourceDirectory($directory);
2837
}
2938

@@ -79,19 +88,6 @@ public function asDom(): DOMDocument
7988
return $this->dom();
8089
}
8190

82-
private function init(): void
83-
{
84-
$dom = new DOMDocument;
85-
$dom->loadXML('<?xml version="1.0" ?><phpunit xmlns="https://schema.phpunit.de/coverage/1.0"><build/><project/></phpunit>');
86-
87-
$this->setContextNode(
88-
$dom->getElementsByTagNameNS(
89-
Facade::XML_NAMESPACE,
90-
'project',
91-
)->item(0),
92-
);
93-
}
94-
9591
private function setProjectSourceDirectory(string $name): void
9692
{
9793
$this->contextNode()->setAttribute('source', $name);

0 commit comments

Comments
 (0)