/** * Returns any extra information associated with the last tick * * @return array */ public function getExtraInfo() { return $this->tick->getExtraInfo(); }
/** * Abort callback * * @param Tick $tick */ public function abort(Tick $tick) { $this->progressBar->clear(); $this->output->writeln($tick->getMessage() ?: 'Aborted'); }
/** * @param Tick $tick */ public function writeAbortLine(Tick $tick) { $this->output->writeln('<error>' . ($tick->getMessage() ?: 'Aborted!') . '</error>'); }
/** * Abort callback * * @param Tick $tick */ public function abort(Tick $tick) { $this->logger->warning($tick->getMessage() ?: 'Aborted', $tick->getReport()->toArray()); }
/** * Indicate progress to the tracker * * Builds a report and send it to the tick method in the output handlers * * @param int $status SUCCESS (default), SKIP, or FAIL * @param string $msg Message to include for this report * @param array $extraInfo * @param int $incrementBy * @return Report */ public function tick($status = Tick::SUCCESS, $msg = null, array $extraInfo = [], $incrementBy = 1) { if (!$this->isRunning()) { $this->start(); } $tick = new Tick($this, $status, $msg, $extraInfo, $incrementBy); // Increment the counter if (array_key_exists($tick->getStatus(), $this->numProcessedItems)) { $this->numProcessedItems[$tick->getStatus()] += $tick->getIncrementBy(); } else { $this->numProcessedItems[$tick->getStatus()] = $tick->getIncrementBy(); } $this->dispatcher->dispatch(Events::TRACKER_TICK, $tick); $this->lastTick = $tick; return $tick->getReport(); }