section(); $section2 = $output->section(); $io1 = new SymfonyStyle($input, $section1); $io2 = new SymfonyStyle($input, $section2); $io1->title('Checking for New Messages'); $mailboxes = $this->service->getAll(); $notice = 'Found ' . count($mailboxes) . ' mailboxes'; $io1->text($notice); if (count($mailboxes) > 0) { $io1->section('Checking for new messages'); $io1->progressStart(count($mailboxes)); foreach ($mailboxes as $mailbox) { $section2->clear(); $io2->text("Checking {$mailbox->name}"); if ($this->service->check($mailbox)) { $io2->success("Found new emails in {$mailbox->name}"); } else { $io2->info("No new emails in {$mailbox->name}"); } $io1->progressAdvance(); } $io1->progressFinish(); } $section2->clear(); $io2->success('Done'); return Command::SUCCESS; } }