コード例 #1
0
 /**
  * Adds the transformer.transformation.post event to advance the progressbar.
  *
  * @param InputInterface $input
  *
  * @return HelperInterface|null
  */
 protected function getProgressBar(InputInterface $input)
 {
     $progress = parent::getProgressBar($input);
     if (!$progress) {
         return null;
     }
     /** @var Dispatcher $eventDispatcher */
     $eventDispatcher = $this->getService('event_dispatcher');
     $eventDispatcher->addListener('transformer.transformation.post', function () use($progress) {
         $progress->advance();
     });
     return $progress;
 }
コード例 #2
0
ファイル: ParseCommand.php プロジェクト: kminh/phpDocumentor2
 /**
  * Adds the parser.file.pre event to the advance the progressbar.
  *
  * @param InputInterface $input
  *
  * @return \Symfony\Component\Console\Helper\HelperInterface|null
  */
 protected function getProgressBar(InputInterface $input)
 {
     $progress = parent::getProgressBar($input);
     if (!$progress) {
         return null;
     }
     $this->getService('event_dispatcher')->addListener('parser.file.pre', function (PreFileEvent $event) use($progress) {
         $progress->advance();
     });
     return $progress;
 }