Execution.

@param InputInterface  $input  Input console
@param OutputInterface $output Output console

@return int Exit code
437225
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $start = microtime(true);
        $style = new SymfonyStyle($input, $output);
        $style->setDecorated(true);
        $style->title($this->description);

        $util = new Util();
        $phpmd = $util->checkBinary('phpmd');
        $output->writeln($util->checkVersion($phpmd));
        $source = $util->checkSource($input, ',');
        if ($input->getOption('diff')) {
            $source = $util->getDiffSource(',');
        }

        $cmd = $phpmd.' '.$source.' text phpmd.xml';
        $output->writeln('<info>Command: '.$cmd.'</>');
        $style->newLine();
        $process = new Process($cmd);
        $exitCode = $process->setTimeout(3600)->run();
        $output->writeln($this->format($process->getOutput()));
        $end = microtime(true);
        $time = round($end - $start);

        $style->section('Results');
        $output->writeln('<info>Time: '.$time.' seconds</>');
        $style->newLine();

        return $exitCode;
    }
1133146
public function run(InputInterface $input, OutputInterface $output)
    {
        return parent::run(
            $this->input = $input, $this->output = new OutputStyle($input, $output)
        );
    }
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;
    }
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;
    }
1084666
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $this->input  = $input;
        $this->output = $output;
        $composerJson = $this->readComposerJson();
        $travisYml    = $this->readTravisYml();
        $exitCode     = 0;

        if (!($this->validatePhpVersionComposerJson($composerJson) && $this->validatePhpVersionTravisYml($travisYml))) {
            return false;
        }

        if ($this->input->hasOption('unmaintained-version-error')) {
            if (!$this->validateNoUnmaintainedPhpVersions(
                $composerJson,
                $travisYml,
                explode(',', TravisEnvironmentInformation::PHP_VERSIONS)
            )) {
                $exitCode = 1;
            }
        }

        if (!$this->validatePhpVersionAgainstTravis($composerJson, $travisYml)) {
            $exitCode = 1;
        }

        if (!$this->validateTravisContainsAllSupportedPhpVersions(
            $composerJson,
            $travisYml,
            explode(',', TravisEnvironmentInformation::PHP_VERSIONS)
        )) {
            $exitCode = 1;
        }

        return $exitCode;
    }
543964
public function doRun(InputInterface $input, OutputInterface $output) : int
    {
        $output->setDecorated(false);
        $input->setInteractive(false);

        $command = $this->createCommand();
        return $command->run($input, $output);
    }
546576
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $output->writeln(GeneralUtility::makeInstance(KauderwelschService::class)->getLoremIpsum());
        return 0;
    }
32411
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $this->init($input, $output);

        $this->force_prompt();
                
        $this->publish_packages($this->get_packages());
        
        // Feedback how many files were copied.
        if (\count($this->copied)) {
            $this->output->writeln(
                \sprintf(
                    "\n<info>Published %d %s successfully:\n%s</info>",
                    \count($this->copied),
                    _n('file', 'files', \count($this->copied)),
                    \implode($this->copied, "\n")
                )
            );
            exit;
        }
        
        $this->output->writeln("\n<info>Nothing needed to be published</info>");
    }
323992
protected function execute(InputInterface $input, OutputInterface $output)
	{
		$this->setupEnvironment('site', $input, $output);

		$version = new \JVersion;

		if ($input->getOption('short'))
		{
			$result = $version->getShortVersion();
		}
		elseif ($input->getOption('release'))
		{
			$result = $version->RELEASE;
		}
		else
		{
			$result = $version->getLongVersion();
		}
		$output->writeln($result);
	}
1328464
protected function execute(
        InputInterface $input,
        OutputInterface $output
    ): int {
        $composer   = $this->getComposer(true);
        $guard      = $this->guardFactory->create();
        $violations = $guard->determineViolations($composer);
        $exporter   = $this->exporterFactory->create($input, $output);

        $exporter->export($violations);

        return count($violations) > 0
            ? static::EXIT_VIOLATIONS
            : static::EXIT_NO_VIOLATIONS;
    }
1295577
protected function execute(InputInterface $input, OutputInterface $output): ?int
    {
        $username = $this->getUsername($input, $output);
        $user = $this->findUser($output, $username);
        if (null === $user) {
            return 1;
        }

        $user->setSuperAdmin(!$input->getOption('demote'));
        $this->userManager->save($user);

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

        return 0;
    }
311377
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $filename = $input->getArgument('filename');
        $key = $input->getArgument('key');
        $yaml_parsed = $this->loadYamlFile($filename);
        if (!$yaml_parsed) {
            // Exit with a status of 1.
            return 1;
        }

        $data = new Data($yaml_parsed);
        if (!$this->checkKeyExists($data, $key)) {
            return 1;
        }

        $value = $data->get($key);
        $output->writeln(trim(Yaml::dump($value)));
    }
306081
protected function execute(InputInterface $input, OutputInterface $output)
  {
    $hash = $input->getOption('hash');
    $length = $input->getOption('length');
    $key = $this->newKey($hash, $length);

    if ($this->setKey($key)) return $output->writeln("<info>Application key [{$key}] set successfully.</info>");

    $output->writeln("Can't set application key. Please check if .env file exists");
  }
1365760
protected function execute(InputInterface $input, OutputInterface $output)
    {
        foreach ($this->getFacade()->migrate() as $line) {
            $output->write($line);
        }
    }
385215
protected function execute(InputInterface $input, OutputInterface $output) : int
    {
        $io         = $this->getIO($input, $output);
        $config     = $this->getConfig($this->configFile, true);
        $repository = new Repository($this->repositoryPath);
        $arguments  = new Config\Options($input->getArguments());

        /** @var \CaptainHook\App\Runner\Hook $hook */
        $class = '\\CaptainHook\\App\\Runner\\Hook\\' . Util::getHookCommand($this->name);
        $hook  = new $class($io, $config, $repository, $arguments);


        $hook->run();
        return 0;
    }
739175
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $this->validateCommand($input);

        $output->writeln('> Loading configuration file');
        $config = $input->getOption('config');
        $files = (new ConfigResolver())->getFileList($config);
        $output->writeLn('- Found '.count($files).' files');

        $preloader = (new Factory())->create($this->getOptions($input));

        $outputFile = $input->getOption('output');
        $handle = $preloader->prepareOutput($outputFile, $input->getOption('strict_types'));

        $output->writeln('> Compiling classes');

        $count = 0;
        $countSkipped = 0;
        $comments = !$input->getOption('strip_comments');

        foreach ($files as $file) {
            $count++;

            try {
                $code = $preloader->getCode($file, $comments);
                $output->writeln('- Writing '.$file);
                fwrite($handle, $code."\n");
            } catch (VisitorExceptionInterface $e) {
                $countSkipped++;
                $output->writeln('- Skipping '.$file);
            }
        }

        fclose($handle);

        $output->writeln("> Compiled loader written to $outputFile");
        $output->writeln('- Files: '.($count - $countSkipped).'/'.$count.' (skipped: '.$countSkipped.')');
        $output->writeln('- Filesize: '.(round(filesize($outputFile) / 1024)).' kb');
    }
55634
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $start = microtime(true);
        $commands = array('qa:cbf', 'qa:csf');
        $style = new SymfonyStyle($input, $output);
        $style->setDecorated(true);
        $output->write(sprintf("\033\143"));

        foreach ($commands as $command) {
            $returnCode = $this->getApplication()->find($command)->run($input, $output);
            if ($returnCode) {
                $output->writeln('<error>Exit code '.$returnCode.'</>');
            }
        }

        $end = microtime(true);
        $time = round($end - $start);
        $style->newLine();
        $style->section('Results');
        $output->writeln('<info>Time: '.$time.' seconds</>');
    }