File tree Expand file tree Collapse file tree 1 file changed +10
-14
lines changed Expand file tree Collapse file tree 1 file changed +10
-14
lines changed Original file line number Diff line number Diff 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 );
You can’t perform that action at this time.
0 commit comments