function File::renderItems
1 call to File::renderItems()
- File::render in vendor/
phpunit/ php-code-coverage/ src/ Report/ Html/ Renderer/ File.php
File
-
vendor/
phpunit/ php-code-coverage/ src/ Report/ Html/ Renderer/ File.php, line 253
Class
- File
- @internal This class is not covered by the backward compatibility promise for phpunit/php-code-coverage
Namespace
SebastianBergmann\CodeCoverage\Report\HtmlCode
private function renderItems(FileNode $node) : string {
$templateName = $this->templatePath . ($this->hasBranchCoverage ? 'file_item_branch.html' : 'file_item.html');
$template = new Template($templateName, '{{', '}}');
$methodTemplateName = $this->templatePath . ($this->hasBranchCoverage ? 'method_item_branch.html' : 'method_item.html');
$methodItemTemplate = new Template($methodTemplateName, '{{', '}}');
$items = $this->renderItemTemplate($template, [
'name' => 'Total',
'numClasses' => $node->numberOfClassesAndTraits(),
'numTestedClasses' => $node->numberOfTestedClassesAndTraits(),
'numMethods' => $node->numberOfFunctionsAndMethods(),
'numTestedMethods' => $node->numberOfTestedFunctionsAndMethods(),
'linesExecutedPercent' => $node->percentageOfExecutedLines()
->asFloat(),
'linesExecutedPercentAsString' => $node->percentageOfExecutedLines()
->asString(),
'numExecutedLines' => $node->numberOfExecutedLines(),
'numExecutableLines' => $node->numberOfExecutableLines(),
'branchesExecutedPercent' => $node->percentageOfExecutedBranches()
->asFloat(),
'branchesExecutedPercentAsString' => $node->percentageOfExecutedBranches()
->asString(),
'numExecutedBranches' => $node->numberOfExecutedBranches(),
'numExecutableBranches' => $node->numberOfExecutableBranches(),
'pathsExecutedPercent' => $node->percentageOfExecutedPaths()
->asFloat(),
'pathsExecutedPercentAsString' => $node->percentageOfExecutedPaths()
->asString(),
'numExecutedPaths' => $node->numberOfExecutedPaths(),
'numExecutablePaths' => $node->numberOfExecutablePaths(),
'testedMethodsPercent' => $node->percentageOfTestedFunctionsAndMethods()
->asFloat(),
'testedMethodsPercentAsString' => $node->percentageOfTestedFunctionsAndMethods()
->asString(),
'testedClassesPercent' => $node->percentageOfTestedClassesAndTraits()
->asFloat(),
'testedClassesPercentAsString' => $node->percentageOfTestedClassesAndTraits()
->asString(),
'crap' => '<abbr title="Change Risk Anti-Patterns (CRAP) Index">CRAP</abbr>',
]);
$items .= $this->renderFunctionItems($node->functions(), $methodItemTemplate);
$items .= $this->renderTraitOrClassItems($node->traits(), $template, $methodItemTemplate);
$items .= $this->renderTraitOrClassItems($node->classes(), $template, $methodItemTemplate);
return $items;
}