Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 10 additions & 14 deletions src/Report/Xml/Project.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,18 @@
/**
* @phpstan-ignore constructor.missingParentCall
*/
public function __construct(string $directory)

Check failure on line 24 in src/Report/Xml/Project.php

View workflow job for this annotation

GitHub Actions / Static Analysis

No error with identifier constructor.missingParentCall is reported on line 24.
{
$this->init();
$dom = new DOMDocument;
$dom->loadXML('<?xml version="1.0" ?><phpunit xmlns="https://schema.phpunit.de/coverage/1.0"><build/><project/></phpunit>');

parent::__construct(
$dom->getElementsByTagNameNS(
Facade::XML_NAMESPACE,
'project',
)->item(0),
);

$this->setProjectSourceDirectory($directory);
}

Expand Down Expand Up @@ -79,19 +88,6 @@
return $this->dom();
}

private function init(): void
{
$dom = new DOMDocument;
$dom->loadXML('<?xml version="1.0" ?><phpunit xmlns="https://schema.phpunit.de/coverage/1.0"><build/><project/></phpunit>');

$this->setContextNode(
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this call was equivalent to the baseclass __construct() implementation.. but we shouldn't rely on implementation knowledge across classes, when not necessary

$dom->getElementsByTagNameNS(
Facade::XML_NAMESPACE,
'project',
)->item(0),
);
}

private function setProjectSourceDirectory(string $name): void
{
$this->contextNode()->setAttribute('source', $name);
Expand Down
Loading