@param InputInterface  $input
@param OutputInterface $output

@return int
770107
private function interactive(InputInterface $input, OutputInterface $output)
    {
        $questionHelper = $this->getQuestionHelper();

        if ($this->getApplication()->has('doctrine:schema:update') && $input->isInteractive()) {
            $question = new ConfirmationQuestion($questionHelper->getQuestion('Do you want to update your database schemas', 'yes', '?'), true);

            if ($questionHelper->ask($input, $output, $question)) {
                $schemaUpdaterCommand = $this->getApplication()->find('doctrine:schema:update');
                $schemaUpdaterCommand->run(new ArrayInput(array('--force' => true)), $output);
            }
        }

        /*
         * Question helper
         */
        if ($input->isInteractive()) {
            $question = new ConfirmationQuestion($questionHelper->getQuestion('Do you confirm generation', 'yes', '?'), true);
            if (!$questionHelper->ask($input, $output, $question)) {
                $output->writeln('<error>Command aborted</error>');

                return 1;
            }
        }
    }
1367468
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $this->output = $output;
        $aliasName = $input->getArgument('aliasName');
        $aliasClass = $input->getArgument('aliasClass');
        $this->alias($aliasName, $aliasClass);
    }
1109049
public function getIO(InputInterface $input, OutputInterface $output) : IO
    {
        if (null === $this->io) {
            $this->io = new IO\DefaultIO($input, $output, $this->getHelperSet());
        }
        return $this->io;
    }
660892
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $this->injectOutputIntoLogger($output, $this->logger);
        $this->logger->info('Getting table metadata for database "' . $input->getArgument('database') . '".');
        $tables = $this->getTables($input);
        $outputTable = new Table($output);
        $outputTable
            ->setHeaders(array('Database', 'Rows', 'Size in ' . $input->getOption('unit')));
        foreach ($tables as $name => $table) {
            $outputTable->addRow([$name, $table['rows'], $table['size']]);
        }
        $outputTable->render();
        return 0;
    }
561848
protected function execute(InputInterface $input, OutputInterface $output)
    {
        if (!($this->lock())) {
            $output->writeln('The command is already running in another process.');

            return 0;
        }

        $producer = $this->getContainer()->get('enqueue.producer');

        // @todo iterate through all instead of limiting to 500
        $queueItems = $this->queueItemRepository->findBy([
            'status' => QueueItem::STATUS_PENDING,
        ], [], 500);

        foreach ($queueItems as $queueItem) {
            $queueItem->setStatus(QueueItem::STATUS_PROCESSING);
            $producer->sendEvent($queueItem->getType(), $queueItem->getIdentifier());

            $this->queueItemRepository->save($queueItem);
        }

        return 0;
    }
1201620
protected function execute(InputInterface $input, OutputInterface $output) : int
    {
        $body = $input->getArgument('body');
        $json = json_decode($input->getArgument('body'), true);
        if (json_last_error() !== 0) {
            $body = $json;
        }

        $queue = self::queue($input->getOption('queue'));
        $queue->publish($body);

        return 0;
    }
918941
private function runInternal(InputInterface $input, OutputInterface $output)
    {
        try {
            $this->exporter->execute();
        } catch (Exception $e) {
            $output->writeln("Aborting: " . $e->getMessage());

            return 1;
        }

        return 0;
    }
850737
protected function execute(InputInterface $input, OutputInterface $output)
    {
        return $this->getRunner($input, $output)->run() ? 0 : -1;
    }
910022
protected function execute(InputInterface $input, OutputInterface $output): ?int
    {
        $username = $this->getUsername($input, $output);
        $user = $this->findUser($output, $username);
        if (null === $user) {
            return 1;
        }

        $password = $this->getPassword($input, $output);
        if ($password) {
            $this->userManager->setPlainTextPassword($user, $password);
        } else {
            $this->userManager->requestNewPassword($user);
        }
        $this->userManager->save($user);

        if ($password) {
            $message = $this->translator->trans(
                'user.password_changed_success',
                ['%username%' => $username],
                'security'
            );
        } else {
            $message = $this->translator->trans(
                'user.password_request_sent',
                ['%username%' => $username],
                'security'
            );
        }
        $output->writeln("<info>{$message}</info>");

        return 0;
    }
204910
protected function execute(InputInterface $input, OutputInterface $output) : int
    {
        $logger = LoggerHelper::createDefaultLogger($output);

        /** @var string $cacheOption */
        $cacheOption = $input->getOption('cache');
        $fileCache = new FilesystemCache($cacheOption);
        $cache = new SimpleCacheAdapter($fileCache);

        $browscap = new Browscap($cache, $logger);

        /** @var string $uaArgument */
        $uaArgument = $input->getArgument('user-agent');

        try {
            $result = $browscap->getBrowser($uaArgument);
        } catch (Exception $e) {
            $logger->debug($e);

            return 11;
        }

        try {
            $output->writeln(\ExceptionalJSON\encode($result, JSON_PRETTY_PRINT));
        } catch (EncodeErrorException $e) {
            $logger->error($e);

            return 11;
        }

        return 0;
    }
454987
protected function execute(
        InputInterface $input,
        OutputInterface $output
    ): int {
        $this->define();

        $patterns = array_keys($this->methods);

        if ($this->shuffleQueues()) {
            shuffle($patterns);
        }

        $this
            ->redis
            ->psubscribe($patterns,
                function ($redis, $pattern, $channel, $payloadSerialized) use ($input, $output) {
                    $payload = $this->serializer->revert($payloadSerialized);
                    $method = $this->methods[$pattern];

                    /*
                     * All custom methods must have these parameters
                     *
                     * InputInterface  $input   An InputInterface instance
                     * OutputInterface $output  An OutputInterface instance
                     * Mixed           $payload Payload
                     */
                    $this->$method($input, $output, $payload);
                });

        $this->beforeDie();

        return 0;
    }
1186797
public function initialize(InputInterface $input, OutputInterface $output)
    {
        $this->in  = $input;
        $this->out = $output;
    }
922936
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $inputFile = $input->getArgument('input-file');
        $outputFile = $input->getArgument('output-file');

        if ($outputFile === null) {
            $outputFile = preg_replace('/\\.[^.]*$/', '.php', $inputFile);
        }

        $parserGenerator = new ParserGenerator(new PegFile());

        $output = "<?php\n\n" . $parserGenerator->createClass($inputFile);

        file_put_contents($outputFile, $output);
    }
623294
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $this->output = $output;
        $outputFile = null;
        if ($file = $input->getOption('output-file')) {
            $outputFile = $file;
        }
        $this->service($input->getArgument($this->argument), $outputFile);
    }
1090741
protected function execute(InputInterface $input, OutputInterface $output)
    {
        parent::execute($input, $output);
        $info = $this
            ->getSession()
            ->getInspector()
            ->getSchemas()
            ;
        $this->formatOutput($output, $info);
    }
594086
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $this->input = $input;
        $this->output = $output;

        try {
            return $this->fire();
        } catch (DomainException $e) {
            return 1;
        } catch (Exception $e) {
            $this->error($e->getMessage());
            $this->error('Abort!');
        }

        return;
    }
260941
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $errOutput = $output instanceof ConsoleOutputInterface ? $output->getErrorOutput() : $output;
        $output->setVerbosity(OutputInterface::VERBOSITY_QUIET);
        $errOutput->setVerbosity(OutputInterface::VERBOSITY_NORMAL);

        $batchSize = NumberUtils::bound($input->getOption('batch-size'), 1, 1000);
        $batchDelay = NumberUtils::bound($input->getOption('batch-delay'), 100, 600000);
        $since = $input->getOption('since');
        $until = $input->getOption('until');
        $context = json_decode($input->getOption('context') ?: '{}', true);
        $context['tenant_id'] = (string)$input->getOption('tenant-id');
        $streamId = $input->getArgument('stream-id') ? StreamId::fromString($input->getArgument('stream-id')) : null;

        if (!empty($since)) {
            $since = Microtime::fromString(str_pad($since, 16, '0'));
        }

        if (!empty($until)) {
            $until = Microtime::fromString(str_pad($until, 16, '0'));
        }

        $i = 0;
        $receiver = function (Event $event, StreamId $streamId) use ($errOutput, $batchSize, $batchDelay, &$i) {
            ++$i;

            try {
                echo json_encode($event) . PHP_EOL;
            } catch (\Throwable $e) {
                $errOutput->writeln($e->getMessage());
            }

            if (0 === $i % $batchSize) {
                if ($batchDelay > 0) {
                    usleep($batchDelay * 1000);
                }
            }
        };

        if ($streamId) {
            $this->getPbjx()->getEventStore()->pipeEvents($streamId, $receiver, $since, $until, $context);
        } else {
            $this->getPbjx()->getEventStore()->pipeAllEvents($receiver, $since, $until, $context);
        }
    }