コード例 #1
0
 /**
  * @param Tombstone[] $result
  */
 private function displayTombstones($result)
 {
     foreach ($result as $tombstone) {
         $this->output->newLine();
         $this->output->printTombstone($tombstone, 'RIP');
         $date = $tombstone->getTombstoneDate();
         if ($age = TimePeriodFormatter::formatAge($date)) {
             $this->output->writeln(sprintf('    was not called for %s', $age));
         } else {
             $this->output->writeln(sprintf('    was not called since %s', $date));
         }
     }
 }
コード例 #2
0
 /**
  * @param AnalyzerFileResult $fileResult
  *
  * @return string
  */
 private function renderDeletedTombstones(AnalyzerFileResult $fileResult)
 {
     $itemList = '';
     foreach ($fileResult->getDeleted() as $vampire) {
         $this->deletedTemplate->setVar(array('path_to_root' => './', 'tombstone' => (string) $vampire->getTombstone(), 'line' => $vampire->getLine(), 'method' => $vampire->getMethod(), 'last_call' => TimePeriodFormatter::formatAge($vampire->getInvocationDate())));
         $itemList .= $this->deletedTemplate->render();
     }
     return $itemList;
 }