Skip to content
This repository has been archived by the owner on Jul 15, 2020. It is now read-only.

Commit

Permalink
Remove property progress in GenerateCommand
Browse files Browse the repository at this point in the history
  • Loading branch information
petk committed Sep 11, 2016
1 parent 8375250 commit 64e783f
Showing 1 changed file with 10 additions and 15 deletions.
25 changes: 10 additions & 15 deletions src/Command/GenerateCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,6 @@
*/
class GenerateCommand extends Command
{
/**
* @var ProgressBar
*/
private $progress;

/**
* @var Twig_Template
*/
Expand Down Expand Up @@ -104,10 +99,10 @@ protected function configure()
*/
protected function execute(InputInterface $input, OutputInterface $output)
{
$this->progress = new ProgressBar($output, 40);
$this->progress->setFormat(" %message%\n %current%/%max% [%bar%] %percent:3s%% %elapsed:6s%/%estimated:-6s% %memory:6s%\n\n");
$this->progress->setMessage('Starting...');
$this->progress->setProgressCharacter("\xF0\x9F\x8D\xBA");
$progress = new ProgressBar($output, 40);
$progress->setFormat(" %message%\n %current%/%max% [%bar%] %percent:3s%% %elapsed:6s%/%estimated:-6s% %memory:6s%\n\n");
$progress->setMessage('Starting...');
$progress->setProgressCharacter("\xF0\x9F\x8D\xBA");

if (!$this->auth->isValid()) {
$helper = $this->getHelper('question');
Expand Down Expand Up @@ -137,21 +132,21 @@ protected function execute(InputInterface $input, OutputInterface $output)
}

$output->writeln('Generating report from '.$this->config->getParameter('start_datetime')->format('Y-m-d H:i:s').' to '.$this->config->getParameter('end_datetime')->format('Y-m-d H:i:s')."\n");
$this->progress->start();
$this->progress->setMessage('Setting up Facebook service...');
$this->progress->advance();
$progress->start();
$progress->setMessage('Setting up Facebook service...');
$progress->advance();

try {
$fetcher = new Fetcher($this->config, $this->progress, $this->auth->fb, $this->log);
$fetcher = new Fetcher($this->config, $progress, $this->auth->fb, $this->log);
$mapper = new Mapper($this->config, $fetcher->getFeed(), $this->log);
$topics = $mapper->getTopics();
$comments = $mapper->getComments();
$replies = $mapper->getReplies();
$users = $mapper->getUsers();

$this->progress->advance();
$progress->advance();

$this->progress->finish();
$progress->finish();
$output->writeln("\n");

$output->writeln($this->template->render([
Expand Down

0 comments on commit 64e783f

Please sign in to comment.