/**
  * @param Tombstone $tombstone
  */
 public function printTombstone($tombstone, $prefix)
 {
     $this->output->writeln(sprintf('  [%s] <info>%s</info>', $prefix, (string) $tombstone));
     $this->output->writeln(sprintf('    in <comment>line %s</comment>', $tombstone->getLine()));
     if ($tombstone->getMethod()) {
         $this->output->writeln(sprintf('    in method <comment>%s</comment>', $tombstone->getMethod()));
     } else {
         $this->output->writeln(sprintf('    in global scope'));
     }
 }
 /**
  * @param Tombstone $tombstone
  */
 public function addTombstone(Tombstone $tombstone)
 {
     $this->tombstones[] = $tombstone;
     $position = FilePosition::createPosition($tombstone->getFile(), $tombstone->getLine());
     $this->fileLineIndex[$position] = $tombstone;
     $relativePosition = FilePosition::createPosition($this->normalizeAndRelativePath($tombstone->getFile()), $tombstone->getLine());
     $this->relativeFileLineIndex[$relativePosition] = $tombstone;
     $methodName = $tombstone->getMethod();
     if (!isset($this->methodIndex[$methodName])) {
         $this->methodIndex[$methodName] = array();
     }
     $this->methodIndex[$methodName][] = $tombstone;
 }
Esempio n. 3
0
 /**
  * @param Tombstone $tombstone
  * @param string $class
  *
  * @return string
  */
 private function renderTombstoneItem(Tombstone $tombstone, $class)
 {
     $this->tombstoneTemplate->setVar(array('tombstone' => (string) $tombstone, 'line' => $tombstone->getLine(), 'method' => $tombstone->getMethod(), 'level' => $class));
     return $this->tombstoneTemplate->render();
 }