function Facade::processFile
Throws
1 call to Facade::processFile()
- Facade::processDirectory in vendor/
phpunit/ php-code-coverage/ src/ Report/ Xml/ Facade.php
File
-
vendor/
phpunit/ php-code-coverage/ src/ Report/ Xml/ Facade.php, line 131
Class
Namespace
SebastianBergmann\CodeCoverage\Report\XmlCode
private function processFile(FileNode $file, Directory $context) : void {
$fileObject = $context->addFile($file->name(), $file->id() . '.xml');
$this->setTotals($file, $fileObject->totals());
$path = substr($file->pathAsString(), strlen($this->project
->projectSourceDirectory()));
$fileReport = new Report($path);
$this->setTotals($file, $fileReport->totals());
foreach ($file->classesAndTraits() as $unit) {
$this->processUnit($unit, $fileReport);
}
foreach ($file->functions() as $function) {
$this->processFunction($function, $fileReport);
}
foreach ($file->lineCoverageData() as $line => $tests) {
if (!is_array($tests) || count($tests) === 0) {
continue;
}
$coverage = $fileReport->lineCoverage((string) $line);
foreach ($tests as $test) {
$coverage->addTest($test);
}
$coverage->finalize();
}
$fileReport->source()
->setSourceCode(file_get_contents($file->pathAsString()));
$this->saveDocument($fileReport->asDom(), $file->id());
}