You are here

private function PHP_CodeCoverage_Driver_Xdebug::getNumberOfLinesInFile in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/phpunit/php-code-coverage/src/CodeCoverage/Driver/Xdebug.php \PHP_CodeCoverage_Driver_Xdebug::getNumberOfLinesInFile()

@since Method available since Release 2.0.0

Parameters

string $file:

Return value

int

1 call to PHP_CodeCoverage_Driver_Xdebug::getNumberOfLinesInFile()
PHP_CodeCoverage_Driver_Xdebug::cleanup in vendor/phpunit/php-code-coverage/src/CodeCoverage/Driver/Xdebug.php
@since Method available since Release 2.0.0

File

vendor/phpunit/php-code-coverage/src/CodeCoverage/Driver/Xdebug.php, line 86

Class

PHP_CodeCoverage_Driver_Xdebug
Driver for Xdebug's code coverage functionality.

Code

private function getNumberOfLinesInFile($file) {
  $buffer = file_get_contents($file);
  $lines = substr_count($buffer, "\n");
  if (substr($buffer, -1) !== "\n") {
    $lines++;
  }
  return $lines;
}