/** * @param PHP_CodeCoverage_Report_Node $item * @param boolean $total * @return string */ protected function renderItem(Node $item, $total = false) { if ($total) { $data['name'] = 'Total'; } else { if ($item instanceof \DavM85\BusFactor\Node\Directory) { $data['name'] = sprintf('<a href="%s/index.html">%s</a>', $item->getName(), $item->getName()); $data['icon'] = '<span class="glyphicon glyphicon-folder-open"></span> '; } else { // Files got no name $data['name'] = $item->getName(); $data['icon'] = '<span class="glyphicon glyphicon-file"></span> '; } $data = array_merge($data, $item->getValue()->getData()); } return $data; }
/** * @param PHP_CodeCoverage_Report_Node $node * @return string */ protected function getPathToRoot(Node $node) { $id = $node->getId(); $depth = substr_count($id, '/'); if ($id != 'index' && $node instanceof Node\Directory) { $depth++; } return str_repeat('../', $depth); }
/** * Constructor. * * @param string $name * @param PHP_CodeCoverage_Report_Node $parent * @param array $coverageData * @param array $testData * @param boolean $cacheTokens * @throws PHP_CodeCoverage_Exception */ public function __construct($name, $value, Node $parent) { $this->value = $value; parent::__construct($name, $parent); }