isDecorated() public method

public isDecorated ( ) : boolean
return boolean
示例#1
0
 public function displayFatal(CurrentExampleTracker $currentExample, $error)
 {
     if (null !== $error && ($currentExample->getCurrentExample() || $error['type'] == E_ERROR) || is_null($currentExample->getCurrentExample()) && defined('HHVM_VERSION')) {
         ini_set('display_errors', "stderr");
         $failedOpen = $this->io->isDecorated() ? '<failed>' : '';
         $failedClosed = $this->io->isDecorated() ? '</failed>' : '';
         $failedCross = $this->io->isDecorated() ? '✘' : '';
         $this->io->writeln("{$failedOpen}{$failedCross} Fatal error happened while executing the following {$failedClosed}");
         $this->io->writeln("{$failedOpen}    {$currentExample->getCurrentExample()} {$failedClosed}");
         $this->io->writeln("{$failedOpen}    {$error['message']} in {$error['file']} on line {$error['line']} {$failedClosed}");
     }
 }
示例#2
0
 /**
  * @param ConsoleIO $io
  * @param array     $progress
  * @param int       $total
  */
 private function updateProgressBar(ConsoleIO $io, array $progress, $total)
 {
     if ($io->isDecorated()) {
         $progressBar = implode('', $progress);
         $pad = $this->getIO()->getBlockWidth() - strlen(strip_tags($progressBar));
         $io->writeTemp($progressBar . str_repeat(' ', $pad + 1) . $total);
     } else {
         $io->writeTemp('/' . implode('/', $progress) . '/  ' . $total . ' examples');
     }
 }