2222{
2323 private DOMElement $ contextNode ;
2424
25- public function __construct (DOMElement $ contextNode )
26- {
25+ public function __construct (
26+ DOMElement $ contextNode ,
27+ Runtime $ runtime ,
28+ DateTimeImmutable $ buildDate ,
29+ string $ phpUnitVersion ,
30+ string $ coverageVersion
31+ ) {
2732 $ this ->contextNode = $ contextNode ;
28- }
2933
30- public function setRuntimeInformation (Runtime $ runtime ): void
31- {
3234 $ runtimeNode = $ this ->nodeByName ('runtime ' );
3335
3436 $ runtimeNode ->setAttribute ('name ' , $ runtime ->getName ());
@@ -46,15 +48,9 @@ public function setRuntimeInformation(Runtime $runtime): void
4648 $ driverNode ->setAttribute ('name ' , 'pcov ' );
4749 $ driverNode ->setAttribute ('version ' , phpversion ('pcov ' ));
4850 }
49- }
5051
51- public function setBuildTime (DateTimeImmutable $ date ): void
52- {
53- $ this ->contextNode ->setAttribute ('time ' , $ date ->format ('D M j G:i:s T Y ' ));
54- }
52+ $ this ->contextNode ->setAttribute ('time ' , $ buildDate ->format ('D M j G:i:s T Y ' ));
5553
56- public function setGeneratorVersions (string $ phpUnitVersion , string $ coverageVersion ): void
57- {
5854 $ this ->contextNode ->setAttribute ('phpunit ' , $ phpUnitVersion );
5955 $ this ->contextNode ->setAttribute ('coverage ' , $ coverageVersion );
6056 }
0 commit comments