Esempio n. 1
0
 /**
  * @param  PHP_CodeCoverage_Report_Node $node
  * @return string
  */
 protected function getBreadcrumbs(Node $node)
 {
     $breadcrumbs = '';
     $path = $node->getPathAsArray();
     $pathToRoot = array();
     $max = count($path);
     if ($node instanceof 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;
 }