/**
  * @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'));
     }
 }
Ejemplo n.º 2
0
 /**
  * @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;
 }
Ejemplo n.º 3
0
 /**
  * @param Tombstone $tombstone
  */
 public function addUndead(Tombstone $tombstone)
 {
     $this->undead[] = $tombstone;
     $this->initFileIndex($tombstone->getFile());
     $this->perFile[$tombstone->getFile()]->addUndead($tombstone);
 }
Ejemplo n.º 4
0
 /**
  * @param Tombstone $tombstone
  *
  * @return string
  */
 private function renderInvokers(Tombstone $tombstone)
 {
     $invokers = array();
     foreach ($tombstone->getVampires() as $vampire) {
         $invokers[] = $vampire->getInvoker();
     }
     $invokers = array_unique($invokers);
     $invokersString = '';
     foreach ($invokers as $invoker) {
         $this->invokerTemplate->setVar(array('invoker' => $invoker ?: 'global scope'));
         $invokersString .= $this->invokerTemplate->render();
     }
     return $invokersString;
 }
Ejemplo n.º 5
0
 /**
  * @test
  * @dataProvider getTombstonesToCompare
  *
  * @param Tombstone $tombstone1
  * @param Tombstone $tombstone2
  */
 public function inscriptionEquals_differentInscription_returnFalse($tombstone1, $tombstone2)
 {
     $result = $tombstone1->inscriptionEquals($tombstone2);
     $this->assertFalse($result);
 }
Ejemplo n.º 6
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();
 }