Exemplo n.º 1
0
 /**
  * @param MarkdownBuilder $markdown
  * @param Issue $issue
  */
 protected function renderIssue(MarkdownBuilder $markdown, Issue $issue)
 {
     $header = $issue->getTitle();
     if ($issue->getLine()) {
         $header .= ' on line ' . $issue->getLine();
     }
     $markdown->h3($header);
     $markdown->p($issue->getDescription());
 }
Exemplo n.º 2
0
 /**
  * @param string $path
  * @param Issue $issue
  * @param int $around
  * @param bool $attr
  * @return string
  */
 public static function createCodeSnippet($path, Issue $issue, $around = 5, $attr = false)
 {
     $snippet = SnippetHelper::createSnippetByFile(Path::join($path, $issue->getFile()), $issue->getLine(), $around);
     $extension = pathinfo($issue->getFile(), PATHINFO_EXTENSION);
     $offset = max($issue->getLine() - $around, 1);
     $options = [];
     if ($attr) {
         $options = ['file' => $issue->getFile(), 'line' => $issue->getLine(), 'offset' => $offset];
     }
     return (new MarkdownBuilder())->code($snippet, $extension, $options)->getMarkdown();
 }
Exemplo n.º 3
0
 /**
  * @param AnalyseIssue $issue
  * @return string
  */
 private function hash(AnalyseIssue $issue)
 {
     return md5($issue->getGadget() . $issue->getFile() . $issue->getLine() . $issue->getTitle());
 }