本文整理匯總了PHP中PHP_CodeCoverage_Report_Node::getNumClassesAndTraits方法的典型用法代碼示例。如果您正苦於以下問題:PHP PHP_CodeCoverage_Report_Node::getNumClassesAndTraits方法的具體用法?PHP PHP_CodeCoverage_Report_Node::getNumClassesAndTraits怎麽用?PHP PHP_CodeCoverage_Report_Node::getNumClassesAndTraits使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類PHP_CodeCoverage_Report_Node
的用法示例。
在下文中一共展示了PHP_CodeCoverage_Report_Node::getNumClassesAndTraits方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: renderItem
/**
* @param PHP_CodeCoverage_Report_Node $item
* @param boolean $total
* @return string
*/
protected function renderItem(PHP_CodeCoverage_Report_Node $item, $total = FALSE)
{
$data = array('numClasses' => $item->getNumClassesAndTraits(), 'numTestedClasses' => $item->getNumTestedClassesAndTraits(), 'numMethods' => $item->getNumMethods(), 'numTestedMethods' => $item->getNumTestedMethods(), 'linesExecutedPercent' => $item->getLineExecutedPercent(FALSE), 'linesExecutedPercentAsString' => $item->getLineExecutedPercent(), 'numExecutedLines' => $item->getNumExecutedLines(), 'numExecutableLines' => $item->getNumExecutableLines(), 'testedMethodsPercent' => $item->getTestedMethodsPercent(FALSE), 'testedMethodsPercentAsString' => $item->getTestedMethodsPercent(), 'testedClassesPercent' => $item->getTestedClassesAndTraitsPercent(FALSE), 'testedClassesPercentAsString' => $item->getTestedClassesAndTraitsPercent());
if ($total) {
$data['name'] = 'Total';
} else {
$data['name'] = sprintf('<a href="%s.html">%s</a>', $item->getId(), $item->getName());
if ($item instanceof PHP_CodeCoverage_Report_Node_Directory) {
$data['icon'] = '<i class="icon-folder-open"></i> ';
} else {
$data['icon'] = '<i class="icon-file"></i> ';
}
}
return $this->renderItemTemplate(new Text_Template($this->templatePath . 'directory_item.html'), $data);
}