requestQueueService = $requestQueueService; $this->configService = $configService; $this->miscService = $miscService; } /** * */ protected function configure() { parent::configure(); $this->setName('social:queue:status') ->addOption( 'token', 't', InputOption::VALUE_OPTIONAL, 'token of a request' ) ->setDescription('Return status on the request queue'); } /** * @param InputInterface $input * @param OutputInterface $output * * @throws Exception */ protected function execute(InputInterface $input, OutputInterface $output): int { $token = $input->getOption('token'); if ($token === null) { throw new Exception('As of today, --token is mandatory'); } $requests = $this->requestQueueService->getRequestFromToken($token); foreach ($requests as $request) { $output->writeLn(json_encode($request)); } return 0; } }