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

Breadcrumb

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

function Totals::setNumLines

File

vendor/phpunit/php-code-coverage/src/Report/Xml/Totals.php, line 71

Class

Totals
@internal This class is not covered by the backward compatibility promise for phpunit/php-code-coverage

Namespace

SebastianBergmann\CodeCoverage\Report\Xml

Code

public function setNumLines(int $loc, int $cloc, int $ncloc, int $executable, int $executed) : void {
    $this->linesNode
        ->setAttribute('total', (string) $loc);
    $this->linesNode
        ->setAttribute('comments', (string) $cloc);
    $this->linesNode
        ->setAttribute('code', (string) $ncloc);
    $this->linesNode
        ->setAttribute('executable', (string) $executable);
    $this->linesNode
        ->setAttribute('executed', (string) $executed);
    $this->linesNode
        ->setAttribute('percent', $executable === 0 ? '0' : sprintf('%01.2F', Percentage::fromFractionAndTotal($executed, $executable)->asFloat()));
}

API Navigation

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