class Report
@internal This class is not covered by the backward compatibility promise for phpunit/php-code-coverage
Hierarchy
- class \SebastianBergmann\CodeCoverage\Report\Xml\File
- class \SebastianBergmann\CodeCoverage\Report\Xml\Report extends \SebastianBergmann\CodeCoverage\Report\Xml\File
Expanded class hierarchy of Report
4 string references to 'Report'
- Config::printPHPCSUsage in vendor/
squizlabs/ php_codesniffer/ src/ Config.php - Prints out the usage information for PHPCS.
- hook_comment_links_alter in core/
modules/ comment/ comment.api.php - Alter the links of a comment.
- hook_node_links_alter in core/
modules/ node/ node.api.php - Alter the links of a node.
- LogToReportMigration::migrate in vendor/
phpunit/ phpunit/ src/ TextUI/ Configuration/ Xml/ Migration/ Migrations/ LogToReportMigration.php
File
-
vendor/
phpunit/ php-code-coverage/ src/ Report/ Xml/ Report.php, line 19
Namespace
SebastianBergmann\CodeCoverage\Report\XmlView source
final class Report extends File {
public function __construct(string $name) {
$dom = new DOMDocument();
$dom->loadXML('<?xml version="1.0" ?><phpunit xmlns="https://schema.phpunit.de/coverage/1.0"><file /></phpunit>');
$contextNode = $dom->getElementsByTagNameNS('https://schema.phpunit.de/coverage/1.0', 'file')
->item(0);
parent::__construct($contextNode);
$this->setName($name);
}
public function asDom() : DOMDocument {
return $this->dom();
}
public function functionObject($name) : Method {
$node = $this->contextNode()
->appendChild($this->dom()
->createElementNS('https://schema.phpunit.de/coverage/1.0', 'function'));
return new Method($node, $name);
}
public function classObject($name) : Unit {
return $this->unitObject('class', $name);
}
public function traitObject($name) : Unit {
return $this->unitObject('trait', $name);
}
public function source() : Source {
$source = $this->contextNode()
->getElementsByTagNameNS('https://schema.phpunit.de/coverage/1.0', 'source')
->item(0);
if (!$source) {
$source = $this->contextNode()
->appendChild($this->dom()
->createElementNS('https://schema.phpunit.de/coverage/1.0', 'source'));
}
return new Source($source);
}
private function setName(string $name) : void {
$this->contextNode()
->setAttribute('name', basename($name));
$this->contextNode()
->setAttribute('path', dirname($name));
}
private function unitObject(string $tagName, $name) : Unit {
$node = $this->contextNode()
->appendChild($this->dom()
->createElementNS('https://schema.phpunit.de/coverage/1.0', $tagName));
return new Unit($node, $name);
}
}
Members
Title Sort descending | Modifiers | Object type | Summary | Overriden Title |
---|---|---|---|---|
File::$contextNode | private | property | ||
File::$dom | private | property | ||
File::contextNode | protected | function | ||
File::dom | protected | function | ||
File::lineCoverage | public | function | ||
File::totals | public | function | ||
Report::asDom | public | function | ||
Report::classObject | public | function | ||
Report::functionObject | public | function | ||
Report::setName | private | function | ||
Report::source | public | function | ||
Report::traitObject | public | function | ||
Report::unitObject | private | function | ||
Report::__construct | public | function | Overrides File::__construct |