@param \Spryker\Style\StyleInterface $output

@return int
340885
public function execute(StyleInterface $output): int
    {
        $process = $this->buildProcess();
        $process->inheritEnvironmentVariables(true);
        $process->start();

        foreach ($process as $buffer) {
            $output->innerCommand($buffer);
        }

        if (!$process->isSuccessful()) {
            $this->abortInstallIfNotAllowedToContinue($output);
        }

        return ($process->getExitCode() === null) ? static::CODE_SUCCESS : $process->getExitCode();
    }
711482
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $output->writeln(sprintf('Magallanes v%s [%s]', Mage::VERSION, Mage::CODENAME));

        return 0;
    }
749191
protected function execute(InputInterface $input, OutputInterface $output)
    {
        /** @var int|null $page */
        $page = $input->getArgument('page');

        if ($page < 1) {
            $page = 1;
        }

        $output->writeln(sprintf(
            'Current page: <comment>%d</comment>',
            $page
        ));

        // Get the tweets
        $tweets = $this->em
            ->getRepository('AsyncTweetsBundle:Tweet')
            ->getWithUsers($page);

        if (!$tweets) {
            $output->writeln('<info>No tweet to display.</info>');

            return 0;
        }

        $this->displayTweets($output, $tweets);
    }
193480
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $this->injectOutputIntoLogger($output, $this->logger);
        $this->logger->info('Getting database metadata.');
        $databaseAdapter = $this->databaseAdapterManager->getAdapter($input->getOption('adapter'));
        $databases = $databaseAdapter->getDatabaseMetadata();
        $databases = $this->sort($databases, $input->getOption('sort'), $input->getOption('reverse-sort'));
        $databases = $this->format(
            $databases,
            $input->getOption('unit'),
            $input->getOption('precision')
        );

        $outputTable = new Table($output);
        $outputTable
            ->setHeaders(array('Database', 'Size in ' . $input->getOption('unit')));
        foreach ($databases as $name => $database) {
            $outputTable->addRow([$name, $database['size']]);
        }
        $outputTable->render();
        return 0;
    }
1315617
protected function execute(InputInterface $input, OutputInterface $output): int
    {
        $output->writeln('Looking for updates...');

        $allowPreRelease = $input->getOption('pre');

        if (PHP_VERSION_ID < 50600) {
            $message = 'Self updating is not available in PHP versions under 5.6.' . "\n";
            $message .= 'The latest version can be found at ' . self::PHAR_URL;
            $output->writeln(sprintf('<error>%s</error>', $message));
            return 1;
        } elseif (Application::VERSION() === ('@package_version@')) {
            $output->writeln('<error>Self updating has been disabled in source version.</error>');
            return 1;
        }

        $exitCode = 1;

        $updater = new Updater();
        $updater->setStrategy(Updater::STRATEGY_GITHUB);
        $updater->getStrategy()->setPackageName('phpdocumentor/phpDocumentor2');
        $updater->getStrategy()->setPharName('phpDocumentor.phar');
        $updater->getStrategy()->getCurrentLocalVersion(Application::VERSION());

        if ($allowPreRelease) {
            $updater->getStrategy()->setStability(GithubStrategy::ANY);
        }

        try {
            if ($input->getOption('rollback')) {
                $output->writeln('Rolling back to previous version...');
                $result = $updater->rollback();
            } else {
                if (!$updater->hasUpdate()) {
                    $output->writeln('No new version available.');
                    return 0;
                }

                $output->writeln('Updating to newer version...');
                $result = $updater->update();
            }

            if ($result) {
                $new = $updater->getNewVersion();
                $old = $updater->getOldVersion();

                $output->writeln(sprintf('Updated from %s to %s', $old, $new));
                $exitCode = 0;
            }
        } catch (Exception $e) {
            $output->writeln(sprintf('<error>%s</error>', $e->getMessage()));
        }

        return $exitCode;
    }
321913
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $container  = $this->getContainer();
        $translator = $container->get('translator');
        if (!$this->checkRunStatus($input, $output)) {
            return 0;
        }

        /** @var Cache $cacheModel */
        $cacheModel = $container->get('mautic.contactclient.model.cache');
        $output->writeln(
            '<info>'.$translator->trans(
                'mautic.contactclient.maintenance.running'
            ).'</info>'
        );
        $cacheModel->getRepository()
            ->deleteExpired()
            ->reduceExclusivityIndex();
        $output->writeln(
            '<info>'.$translator->trans(
                'mautic.contactclient.maintenance.complete'
            ).'</info>'
        );

        $this->completeRun();

        return 0;
    }
180460
protected function clearSymfonyCache(OutputInterface $output)
    {
        $command   = $this->getApplication()->find('cache:clear');
        $arguments = [
            'command' => 'cache:clear',
        ];

        return $command->run(new ArrayInput($arguments), $output) === 0;
    }
1302368
protected function execute(InputInterface $oInput, OutputInterface $oOutput): int
    {
        parent::execute($oInput, $oOutput);

        $oOutput->writeln('');
        $oOutput->writeln('<info>-----------------------------</info>');
        $oOutput->writeln('<info>Nails Database Migration Tool</info>');
        $oOutput->writeln('<info>-----------------------------</info>');

        // --------------------------------------------------------------------------

        //  Check environment
        if (Environment::is(Environment::ENV_PROD)) {

            $oOutput->writeln('');
            $oOutput->writeln('--------------------------------------');
            $oOutput->writeln('| <info>WARNING: The app is in PRODUCTION.</info> |');
            $oOutput->writeln('--------------------------------------');
            $oOutput->writeln('');

            if (!$this->confirm('Continue with migration?', true)) {
                return $this->abort();
            }
        }

        // --------------------------------------------------------------------------

        //  Work out the DB credentials to use
        $sDbHost = $oInput->getOption('dbHost') ?: (defined('DEPLOY_DB_HOST') ? DEPLOY_DB_HOST : '');
        $sDbUser = $oInput->getOption('dbUser') ?: (defined('DEPLOY_DB_USERNAME') ? DEPLOY_DB_USERNAME : '');
        $sDbPass = $oInput->getOption('dbPass') ?: (defined('DEPLOY_DB_PASSWORD') ? DEPLOY_DB_PASSWORD : '');
        $sDbName = $oInput->getOption('dbName') ?: (defined('DEPLOY_DB_DATABASE') ? DEPLOY_DB_DATABASE : '');

        //  Check we have a database to connect to
        if (empty($sDbName)) {
            return $this->abort(static::EXIT_CODE_NO_DB);
        }

        //  Get the DB object
        $this->oDb = Factory::service('PDODatabase');
        $this->oDb->connect($sDbHost, $sDbUser, $sDbPass, $sDbName);

        if (!defined('NAILS_DB_PREFIX')) {
            define('NAILS_DB_PREFIX', 'nails_');
        }

        //  Test the db
        $iResult = $this->oDb->query('SHOW Tables LIKE \'' . NAILS_DB_PREFIX . 'migration\'')->rowCount();
        if (!$iResult) {

            //  Create the migrations table
            $sSql = "CREATE TABLE `" . NAILS_DB_PREFIX . "migration` (
              `module` VARCHAR(100) NOT NULL DEFAULT '',
              `version` INT(11) UNSIGNED DEFAULT NULL,
              PRIMARY KEY (`module`)
            ) ENGINE=InnoDB DEFAULT CHARSET=utf8;";

            if (!(bool) $this->oDb->query($sSql)) {

                $oOutput->writeln('');
                $oOutput->writeln('Database isn\'t ready for migrations.');

                return $this->abort(static::EXIT_CODE_DB_NOT_READY);
            }
        }

        // --------------------------------------------------------------------------

        //  Backwards compatability - ensure that the vendor prefix is correct
        $this->oDb->query(
            'UPDATE `' . NAILS_DB_PREFIX . 'migration` SET `module` = REPLACE(`module`, "nailsapp/", "nails/");'
        );

        // --------------------------------------------------------------------------

        $oOutput->writeln('');

        // --------------------------------------------------------------------------

        $aEnabledModules = $this->findEnabledModules();
        $oApp            = $this->determineModuleState('APP', 'application/migrations/');

        // --------------------------------------------------------------------------

        //  Anything to migrate?
        if (!$aEnabledModules && !$oApp) {
            $oOutput->writeln('');
            $oOutput->writeln('Nothing to migrate');
            $oOutput->writeln('');

            return self::EXIT_CODE_SUCCESS;
        }

        // --------------------------------------------------------------------------

        //  Confirm what's going to happen
        $oOutput->writeln('');
        $oOutput->writeln('OK, here\'s what\'s going to happen:');

        if ($aEnabledModules || $oApp) {

            $oOutput->writeln('');

            foreach ($aEnabledModules as $oModule) {

                $sStart = is_null($oModule->start) ? 'The beginning of time' : $oModule->start;
                $sLine  = ' - <comment>' . $oModule->name . '</comment> from ';
                $sLine  .= '<info>#' . $sStart . '</info> to <info>#' . $oModule->end . '</info>';

                $oOutput->writeln($sLine);
            }

            if ($oApp) {
                $sStart = is_null($oApp->start) ? 'The beginning of time' : $oApp->start;
                $sLine  = ' - <comment>app</comment> from ';
                $sLine  .= '<info>#' . $sStart . '</info> to <info>#' . $oApp->end . '</info>';
                $oOutput->writeln($sLine);
            }
        }

        $oOutput->writeln('');
        $oOutput->writeln('Routes will be rewritten');
        $oOutput->writeln('');

        if (!$this->confirm('Continue?', true)) {
            return $this->abort(static::EXIT_CODE_SUCCESS);
        }

        // --------------------------------------------------------------------------

        $oOutput->writeln('');
        $oOutput->writeln('<comment>Starting migration...</comment>');

        // --------------------------------------------------------------------------

        //  Start migrating
        $iCurStep       = 1;
        $iNumMigrations = 0;
        $iNumMigrations += !empty($aEnabledModules) ? count($aEnabledModules) : 0;
        $iNumMigrations += !empty($oApp) ? 1 : 0;

        //  Disable foreign key checks
        $oResult              = $this->oDb->query('SHOW Variables WHERE Variable_name=\'FOREIGN_KEY_CHECKS\'')->fetch(\PDO::FETCH_OBJ);
        $sOldForeignKeyChecks = $oResult->Value;

        $this->oDb->query('SET FOREIGN_KEY_CHECKS = 0;');

        //  Migrate the modules
        if (!empty($aEnabledModules)) {
            foreach ($aEnabledModules as $oModule) {

                $oOutput->write('[' . $iCurStep . '/' . $iNumMigrations . '] Migrating <info>' . $oModule->name . '</info>... ');
                if ($this->doMigration($oModule)) {
                    $oOutput->writeln('done!');
                } else {
                    return $this->abort(static::EXIT_CODE_MODULE_MIGRATION_FAILED);
                }

                $iCurStep++;
            }
        }

        //  Migrate the app
        if (!empty($oApp)) {
            $oOutput->write('[' . $iCurStep . '/' . $iNumMigrations . '] Migrating <info>app</info>... ');
            if ($this->doMigration($oApp)) {
                $oOutput->writeln('done!');
            } else {
                return $this->abort(static::EXIT_CODE_APP_MIGRATION_FAILED);
            }
        }

        // --------------------------------------------------------------------------

        //  Rewrite Routes
        $oOutput->writeln('<comment>Rewriting routes...</comment>');
        $this->callCommand('routes:rewrite', [], false, true);

        // --------------------------------------------------------------------------

        //  Cleaning up
        $oOutput->writeln('<comment>Cleaning up...</comment>');

        //  Restore previous foreign key checks
        $this->oDb->query('SET FOREIGN_KEY_CHECKS = \'' . $sOldForeignKeyChecks . '\';');

        // --------------------------------------------------------------------------

        //  And we're done
        $oOutput->writeln('');
        $oOutput->writeln('Complete!');

        return self::EXIT_CODE_SUCCESS;
    }
530868
public static function outputStyles($output = '')
    {
        self::lookIfProcessFiles('style', 'header');

        $template = self::$templates['style'];
        $styles = self::$data['style']['header'];

        foreach ($styles as $value) {
            $output .= sprintf(
                $template,
                $value['url']
            );
        }

        self::$data['style']['header'] = [];

        return ! empty($output) ? $output : false;
    }
740715
protected function _outputHandle($output=null)
    {
        if ($output === null) {
            // do nothing
        } elseif ($output instanceof ResponseInterface) {
            $this->response = $output;
        } elseif ($output) {
            if (is_scalar($output)) {
                $this->response = $this->renderText($output);
            } elseif (is_array($output)) {
                $this->response = $this->renderJson($output);
            } elseif ($output instanceof Collection) {
                $this->response = $this->renderJson($output->all());
            }
        }
        
        if ($data = $this->getRenderBuffer()) {
            $this->response->write($data);
        }
        
        return $this->response;
    }
806196
private function validateComposerFile(Console\Output\OutputInterface $output): int
    {
        return $this->getApplication()->run(
            new Console\Input\ArrayInput([
                'command' => 'validate',
                '--no-check-all' => true,
                '--no-check-lock' => true,
                '--no-check-publish' => true,
                '--strict' => true,
            ]),
            $output
        );
    }
37911
public function update(OutputStyle $output): void
    {
        $result = $this->updater->update();

        if ($result) {
            $output->success(sprintf('Updated from version %s to %s.', $this->updater->getOldVersion(),
                $this->updater->getNewVersion()));
            exit(0);
        } elseif (! $this->updater->getNewVersion()) {
            $output->success('There are no stable versions available.');
        } else {
            $output->success('You have the latest version installed.');
        }
    }
65352
public function output( $output ) {
		$response = $this->response();
		$response = $response->withBody( Psr7\stream_for( $output ) );
		return $response;
	}
818425
protected function execute(InputInterface $input, OutputInterface $output): int
    {
        if (null === $path = $input->getOption('path')) {
            $config = $this->getConfig()->jsonSerialize();
        } else {
            $config = $this->getConfig($path);
        }
        $output->writeln(Yaml::dump($config));
        return 0;
    }
1369937
public function getCredentials(OutputInterface $output)
    {
        $credentials = $this->parser->getCredentials();
        if ( is_null($credentials)) {
            $this->showErrorRunLlumInitFirst($output,"Credentials");
        };
        return $credentials;
    }
380888
protected function execute(InputInterface $input, OutputInterface $output)
  {
    $this->io = new StratumStyle($input, $output);

    $sourceFilename = $input->getArgument('source');
    $targetFilename = dirname($sourceFilename).'/'.basename($input->getArgument('target'));

    if (basename($sourceFilename)===basename($targetFilename))
    {
      throw new RuntimeException('Source and target files is the same file');
    }

    self::staticToStatic($sourceFilename, $targetFilename);

    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;
    }