count() public method

public count ( )
Esempio n. 1
0
 /**
  * {@inheritdoc}
  */
 public function variantEnd(Variant $variant)
 {
     if ($variant->getRejectCount() > 0) {
         return;
     }
     $subject = $variant->getSubject();
     if ($variant->hasErrorStack()) {
         $this->output->writeln(sprintf('    t%-30s <error>ERROR</error>', $subject->getName()));
         return;
     }
     $this->output->writeln(sprintf("    %-30s I%s P%s\t%s", $subject->getName(), $variant->count(), $variant->getParameterSet()->getIndex(), $this->formatIterationsFullSummary($variant)));
 }
Esempio n. 2
0
 private function drawIterations(Variant $variant, array $specials, $tag)
 {
     $this->output->write("");
     // clear line
     $timeUnit = $variant->getSubject()->getOutputTimeUnit();
     $outputMode = $variant->getSubject()->getOutputMode();
     $lines = [];
     $line = sprintf('%-' . self::INDENT . 's', '#' . $variant->getSubject()->getIndex());
     $nbIterations = $variant->count();
     for ($index = 0; $index < $nbIterations; $index++) {
         $iteration = $variant->getIteration($index);
         $displayTime = $this->formatIterationTime($iteration);
         if (isset($specials[$iteration->getIndex()])) {
             $displayTime = sprintf('<%s>%' . $this->colWidth . 's</%s>', $tag, $displayTime, $tag);
         }
         $line .= $displayTime;
         if ($index > 0 && $index < $nbIterations - 1 && ($index + 1) % self::NUMBER_COLS == 0) {
             $lines[] = $line;
             $line = str_repeat(' ', self::INDENT);
         }
     }
     $lines[] = $line;
     $this->currentLine = count($lines) - 1;
     $output = trim(implode(PHP_EOL, $lines));
     $output .= sprintf(' (%s)', $this->timeUnit->getDestSuffix($this->timeUnit->resolveDestUnit($timeUnit), $this->timeUnit->resolveMode($outputMode)));
     $this->output->write(sprintf("%s", $output));
     // clear rest of the line
 }