/** * @return array */ public function getPathAsArray() { if ($this->pathArray === NULL) { if ($this->parent === NULL) { $this->pathArray = array(); } else { $this->pathArray = $this->parent->getPathAsArray(); } $this->pathArray[] = $this; } return $this->pathArray; }
protected function getBreadcrumbs(PHP_CodeCoverage_Report_Node $node) { $breadcrumbs = ''; $path = $node->getPathAsArray(); $pathToRoot = array(); $max = count($path); if ($node instanceof PHP_CodeCoverage_Report_Node_File) { $max--; } for ($i = 0; $i < $max; $i++) { $pathToRoot[] = str_repeat('../', $i); } foreach ($path as $step) { if ($step !== $node) { $breadcrumbs .= $this->getInactiveBreadcrumb($step, array_pop($pathToRoot)); } else { $breadcrumbs .= $this->getActiveBreadcrumb($step); } } return $breadcrumbs; }
protected function getBreadcrumbs(PHP_CodeCoverage_Report_Node $node) { $breadcrumbs = ''; $path = $node->getPathAsArray(); foreach ($path as $step) { if ($step !== $node) { $breadcrumbs .= sprintf(' <li><a href="%s.html">%s</a> <span class="divider">/</span></li>' . "\n", $step->getId(), $step->getName()); } else { $breadcrumbs .= sprintf(' <li class="active">%s</li>' . "\n", $step->getName()); if ($node instanceof PHP_CodeCoverage_Report_Node_Directory) { $breadcrumbs .= sprintf(' <li>(<a href="%s.dashboard.html">Dashboard</a>)</li>' . "\n", $step->getId()); } } } return $breadcrumbs; }
/** * @param Text_Template $template * @param string $title * @param PHP_CodeCoverage_Report_Node $node */ protected function setCommonTemplateVariables(Text_Template $template, $title, PHP_CodeCoverage_Report_Node $node = NULL) { $link = ''; if ($node !== NULL) { $path = $node->getPathAsArray(); foreach ($path as $step) { $link .= sprintf('%s<a href="%s.html">%s</a>', !empty($link) ? '/' : '', $step->getId(), $step->getName()); } } $template->setVar(array('title' => $title, 'link' => $link, 'charset' => $this->charset, 'date' => $this->date, 'version' => '1.1.2', 'php_version' => PHP_VERSION, 'generator' => $this->generator, 'low_upper_bound' => $this->lowUpperBound, 'high_lower_bound' => $this->highLowerBound)); }
protected function getBreadcrumbs(PHP_CodeCoverage_Report_Node $node) { $breadcrumbs = ''; $path = $node->getPathAsArray(); foreach ($path as $step) { if ($step !== $node) { $breadcrumbs .= $this->getInactiveBreadcrumb($step); } else { $breadcrumbs .= $this->getActiveBreadcrumb($step, $node instanceof PHP_CodeCoverage_Report_Node_Directory); } } return $breadcrumbs; }