/** * Constructor. * * @param $name string * @param $parent PHPCoverage_Util_Report_Node * @param $executedLines array * @param $yui boolean * @param $highlight boolean * @throws RuntimeException */ public function __construct($name, PHPCoverage_Util_Report_Node $parent = NULL, array $executedLines, $yui = TRUE, $highlight = FALSE) { parent::__construct($name, $parent); $path = $this->getPath(); if (!file_exists($path)) { throw new Exception(sprintf('Path "%s" does not exist.', $path)); } $this->executedLines = $executedLines; $this->highlight = $highlight; $this->yui = $yui; $this->codeLines = $this->loadFile($path); $this->branchInformation = PHPCoverage_Util_CodeCoverage::getBranchInformation($path); $this->calculateStatistics(); }
protected function doRenderItemObject(PHPCoverage_Util_Report_Node $item, $lowUpperBound, $highLowerBound, $link = NULL, $itemClass = 'coverItem') { return $this->doRenderItem(array('name' => $link != NULL ? $link : $item->getLink(FALSE), 'itemClass' => $itemClass, 'numClasses' => $item->getNumClasses(), 'numTestedClasses' => $item->getNumTestedClasses(), 'testedClassesPercent' => $item->getTestedClassesPercent(), 'numMethods' => $item->getNumMethods(), 'numTestedMethods' => $item->getNumTestedMethods(), 'testedMethodsPercent' => $item->getTestedMethodsPercent(), 'numBranches' => $item->getNumBranches(), 'numTestedBranches' => $item->getNumTestedBranches(), 'testedBranchesPercent' => $item->getTestedBranchesPercent(), 'numExecutableLines' => $item->getNumExecutableLines(), 'numExecutedLines' => $item->getNumExecutedLines(), 'executedLinesPercent' => $item->getLineExecutedPercent()), $lowUpperBound, $highLowerBound); }