public function PHP_CodeCoverage_Report_Node_Directory::getLinesOfCode in Zircon Profile 8
Same name and namespace in other branches
- 8.0 vendor/phpunit/php-code-coverage/src/CodeCoverage/Report/Node/Directory.php \PHP_CodeCoverage_Report_Node_Directory::getLinesOfCode()
Returns the LOC/CLOC/NCLOC of this node.
Return value
array
Overrides PHP_CodeCoverage_Report_Node::getLinesOfCode
File
- vendor/
phpunit/ php-code-coverage/ src/ CodeCoverage/ Report/ Node/ Directory.php, line 282
Class
- PHP_CodeCoverage_Report_Node_Directory
- Represents a directory in the code coverage information tree.
Code
public function getLinesOfCode() {
if ($this->linesOfCode === null) {
$this->linesOfCode = array(
'loc' => 0,
'cloc' => 0,
'ncloc' => 0,
);
foreach ($this->children as $child) {
$linesOfCode = $child
->getLinesOfCode();
$this->linesOfCode['loc'] += $linesOfCode['loc'];
$this->linesOfCode['cloc'] += $linesOfCode['cloc'];
$this->linesOfCode['ncloc'] += $linesOfCode['ncloc'];
}
}
return $this->linesOfCode;
}