Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. File.php

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\Html

Code

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;
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal