/**
  * @param AnalyzerFileResult $fileResult
  *
  * @return string
  */
 private function renderDeadTombstones(AnalyzerFileResult $fileResult)
 {
     $itemList = '';
     foreach ($fileResult->getDead() as $tombstone) {
         $date = $tombstone->getTombstoneDate();
         if ($age = TimePeriodFormatter::formatAge($date)) {
             $deadSince = 'for ' . $age;
         } else {
             $deadSince = 'since ' . $date;
         }
         $this->deadTemplate->setVar(array('path_to_root' => './', 'tombstone' => $this->linkTombstoneSource((string) $tombstone, $fileResult->getFile(), $tombstone->getLine()), 'line' => $tombstone->getLine(), 'method' => $tombstone->getMethod(), 'dead_since' => $deadSince));
         $itemList .= $this->deadTemplate->render();
     }
     return $itemList;
 }
 /**
  * @param AnalyzerFileResult $fileResult
  *
  * @return string
  */
 private function formatSourceCode(AnalyzerFileResult $fileResult)
 {
     $deadLines = array();
     $undeadLines = array();
     foreach ($fileResult->getDead() as $tombstone) {
         $deadLines[] = $tombstone->getLine();
     }
     foreach ($fileResult->getUndead() as $tombstone) {
         $undeadLines[] = $tombstone->getLine();
     }
     $formattedCode = '';
     $i = 0;
     $code = PhpFileFormatter::loadFile($fileResult->getFile());
     $lineTemplate = '<tr class="%s"><td class="number"><div align="right"><a name="%d"></a><a href="#%d">%d</a></div></td><td class="codeLine">%s</td></tr>';
     foreach ($code as $codeLine) {
         ++$i;
         $class = 'default';
         if (in_array($i, $undeadLines)) {
             $class = 'danger icon-vampire';
         } else {
             if (in_array($i, $deadLines)) {
                 $class = 'success icon-cross';
             }
         }
         $formattedCode .= sprintf($lineTemplate, $class, $i, $i, $i, $codeLine);
     }
     return $formattedCode;
 }