/** * @inheritdoc */ protected function execute(InputInterface $input, OutputInterface $output) { $minutes = (int) $input->getOption('minutes'); if ($minutes < 1) { throw new \InvalidArgumentException('Minutes has to be a positive number'); } if ($ids = $input->getArgument('feed')) { $feeds = $this->importScheduler->findByIds($ids); } elseif ($input->getOption('all')) { $feeds = $this->importScheduler->findAll(); } else { $feeds = $this->importScheduler->findByTime($minutes); } if ($output->getVerbosity() >= OutputInterface::VERBOSITY_NORMAL) { $dispatcher = $this->importFactory->getEventDispatcher(); $dispatcher->addSubscriber(new ImportOutputSubscriber($output)); } $force = $input->getOption('force'); return $this->scheduleImports($input, $output, $feeds, $minutes, $force); }