Run the command.

@param \Symfony\Component\Console\Input\InputInterface $input
@param \Symfony\Component\Console\Output\OutputInterface $output
@return int
356952
public function run(InputInterface $input, OutputInterface $output)
    {
        $this->isFinishedCleanly = false;
        if ($mutexFile = $this->getMutexFile()) {
            $self = $this;
            $result = null;

            $mutex = new Mutex($mutexFile, false);
            $isLockAcquired = false;
            $mutex->run(
                function () use ($self, $input, $output, &$result) {
                    return $self->doParentRun($input, $output);
                },
                $isLockAcquired
            );
            if (!$isLockAcquired && $this->logger) {
                $this->logger->addWarning("Mutex failed in " . get_class($this) . ", job was not run");
            }
        } else {
            $result = $this->doParentRun($input, $output);
        }
        $this->cleanup();
        return $result;
    }
967208
public function doRun(InputInterface $input, OutputInterface $output)
	{
		$this->io = new ConsoleIO($input, $output, $this->getHelperSet());
		ErrorHandler::register($this->io);

		return parent::doRun($input, $output);
	}
1367468
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $this->output = $output;
        $aliasName = $input->getArgument('aliasName');
        $aliasClass = $input->getArgument('aliasClass');
        $this->alias($aliasName, $aliasClass);
    }
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;
    }
102157
public function run(InputInterface $input, OutputInterface $output): ?int
    {
        $return = $this->execute($input, $output);
        if (null === $return) {
            $return = EdgarCronRepository::STATUS_OK;
        }

        return $return;
    }
465431
public function doRun(InputInterface $input, OutputInterface $output)
    {
        if (true === $input->hasParameterOption(['--version', '-V'], true)) {
            $output->writeln($this->getLongVersion());

            return 0;
        }

        try {
            // Makes ArgvInput::getFirstArgument() able to distinguish an option from an argument.
            $input->bind($this->getDefinition());
        } catch (ExceptionInterface $e) {
            // Errors must be ignored, full binding/validation happens later when the command is known.
        }

        $name = $this->getCommandName($input);
        if (true === $input->hasParameterOption(['--help', '-h'], true)) {
            if (!$name) {
                $name = 'help';
                $input = new ArrayInput(['command_name' => $this->defaultCommand]);
            } else {
                $this->wantHelps = true;
            }
        }

        if (!$name) {
            $name = $this->defaultCommand;
            $definition = $this->getDefinition();
            $definition->setArguments(array_merge(
                $definition->getArguments(),
                [
                    'command' => new InputArgument('command', InputArgument::OPTIONAL, $definition->getArgument('command')->getDescription(), $name),
                ]
            ));
        }

        try {
            $this->runningCommand = null;
            // the command name MUST be the first element of the input
            $command = $this->find($name);
        } catch (\Throwable $e) {
            if (!($e instanceof CommandNotFoundException && !$e instanceof NamespaceNotFoundException) || 1 !== \count($alternatives = $e->getAlternatives()) || !$input->isInteractive()) {
                if (null !== $this->dispatcher) {
                    $event = new ConsoleErrorEvent($input, $output, $e);
                    $this->dispatcher->dispatch($event, ConsoleEvents::ERROR);

                    if (0 === $event->getExitCode()) {
                        return 0;
                    }

                    $e = $event->getError();
                }

                throw $e;
            }

            $alternative = $alternatives[0];

            $style = new SymfonyStyle($input, $output);
            $style->block(sprintf("\nCommand \"%s\" is not defined.\n", $name), null, 'error');
            if (!$style->confirm(sprintf('Do you want to run "%s" instead? ', $alternative), false)) {
                if (null !== $this->dispatcher) {
                    $event = new ConsoleErrorEvent($input, $output, $e);
                    $this->dispatcher->dispatch($event, ConsoleEvents::ERROR);

                    return $event->getExitCode();
                }

                return 1;
            }

            $command = $this->find($alternative);
        }

        $this->runningCommand = $command;
        $exitCode = $this->doRunCommand($command, $input, $output);
        $this->runningCommand = null;

        return $exitCode;
    }
1225427
protected function execute(InputInterface $input, OutputInterface $output) : int
    {
        return !is_null($this->exitCode) ? $this->exitCode : 0;
    }
218661
public function execute(InputInterface $input): OutputInterface
    {
        $this->validator->validateInput($this, $input);
        $output = $this->generateOutput($input);
        $this->validator->validateOutput($this, $output);
        return $output;
    }
850737
protected function execute(InputInterface $input, OutputInterface $output)
    {
        return $this->getRunner($input, $output)->run() ? 0 : -1;
    }
347975
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $this->setInputAndOutput($input, $output);

        return $this->doExecute();
    }
468924
protected function execute(InputInterface $input, OutputInterface $output) : ?int
    {
        $loggerHelper = new LoggerHelper();
        $logger       = $loggerHelper->create($output);

        /** @var string $resources */
        $resources = $input->getOption('resources');

        $failed  = false;
        $command = $this->getApplication()->find('validate-browsers');

        $input = new ArrayInput(
            [
                'command' => 'validate-browsers',
                '--resources' => $resources,
            ]
        );

        $returnCode = $command->run($input, $output);

        if (0 < $returnCode) {
            $logger->error('There was an error executing the "validate-browsers" command, cannot continue.');

            $failed = true;
        }
        $command = $this->getApplication()->find('validate-devices');

        $input = new ArrayInput(
            [
                'command' => 'validate-devices',
                '--resources' => $resources,
            ]
        );

        $returnCode = $command->run($input, $output);

        if (0 < $returnCode) {
            $logger->error('There was an error executing the "validate-devices" command, cannot continue.');

            $failed = true;
        }

        $command = $this->getApplication()->find('validate-engines');

        $input = new ArrayInput(
            [
                'command' => 'validate-engines',
                '--resources' => $resources,
            ]
        );

        $returnCode = $command->run($input, $output);

        if (0 < $returnCode) {
            $logger->error('There was an error executing the "validate-engines" command, cannot continue.');

            $failed = true;
        }

        $command = $this->getApplication()->find('validate-platforms');

        $input = new ArrayInput(
            [
                'command' => 'validate-platforms',
                '--resources' => $resources,
            ]
        );

        $returnCode = $command->run($input, $output);

        if (0 < $returnCode) {
            $logger->error('There was an error executing the "validate-platforms" command, cannot continue.');

            $failed = true;
        }

        $command = $this->getApplication()->find('validate-core-divisions');

        $input = new ArrayInput(
            [
                'command' => 'validate-core-divisions',
                '--resources' => $resources,
            ]
        );

        $returnCode = $command->run($input, $output);

        if (0 < $returnCode) {
            $logger->error('There was an error executing the "validate-core-divisions" command, cannot continue.');

            $failed = true;
        }

        $command = $this->getApplication()->find('validate-divisions');

        $input = new ArrayInput(
            [
                'command' => 'validate-divisions',
                '--resources' => $resources,
            ]
        );

        $returnCode = $command->run($input, $output);

        if (0 < $returnCode) {
            $logger->error('There was an error executing the "validate-divisions" command, cannot continue.');

            $failed = true;
        }

        if (!$failed) {
            $output->writeln('the files are valid');
        }

        return (int) $failed;
    }
459494
public function run(Input $input, Output $output) {
        $this->input = $input;
        $this->output = $output;

        $this->getSynopsis(true);
        $this->getSynopsis(false);

        $this->mergeConsoleDefinition();

        try {
            $input->bind($this->definition);
        }
        catch (\Exception $e) {
            if (!$this->ignoreValidationErrors) {
                throw $e;
            }
        }

        $this->initialize($input, $output, $this);

        if ($input->isInteractive()) {
            $this->interact($input, $output, $this);
        }

        $input->validate();

        if ($this->code) {
            $statusCode = call_user_func($this->code, $input, $output);
        }
        else {
            $statusCode = $this->execute($input, $output, $this);
        }

        return is_numeric($statusCode) ? (int)$statusCode : 0;
    }
451456
public function doRun(InputInterface $input, OutputInterface $output)
    {
        if (true === $input->hasParameterOption(array('--version', '-V'), true)) {
            $output->writeln($this->getLongVersion());

            return 0;
        }

        $name = $this->getCommandName($input);
        if (true === $input->hasParameterOption(array('--help', '-h'), true)) {
            if (!$name) {
                $name = 'help';
                $input = new ArrayInput(array('command_name' => $this->defaultCommand));
            } else {
                $this->wantHelps = true;
            }
        }

        if (!$name) {
            $name = $this->defaultCommand;
            $input = new ArrayInput(array('command' => $this->defaultCommand));
        }

        try {
            $e = $this->runningCommand = null;
            // the command name MUST be the first element of the input
            $command = $this->find($name);
        } catch (\Exception $e) {
        } catch (\Throwable $e) {
        }
        if (null !== $e) {
            if (null !== $this->dispatcher) {
                $event = new ConsoleErrorEvent($input, $output, $e);
                $this->dispatcher->dispatch(ConsoleEvents::ERROR, $event);
                $e = $event->getError();

                if (0 === $event->getExitCode()) {
                    return 0;
                }
            }

            throw $e;
        }

        $this->runningCommand = $command;
        $exitCode = $this->doRunCommand($command, $input, $output);
        $this->runningCommand = null;

        return $exitCode;
    }
1335069
public function execute(InputInterface $input, OutputInterface $output)
    {
        $fixCommand = new FixCommand();
        $formatCommand = new FormatCommand();

        $fixInput = [];
        $formatInput = [];

        if ($input->getOption('dry-run')) {
            $fixInput['--dry-run'] = true;
            $formatInput['--dry-run'] = true;
        }

        if ($input->getOption('diff')) {
            $fixInput['--diff'] = true;
        }

        $output->writeln('<info>Running style:fix...</info>');
        $fixCommand->run(new ArrayInput($fixInput), $output);

        $output->writeln('<info>Running style:format...</info>');
        $formatCommand->run(new ArrayInput($formatInput), $output);

        return 0;
    }
1068332
public function execute(InputInterface $input = null, OutputInterface $output = null)
    {
        $this->application->addCommands($this->servicesCommandsProvider->getCommands());
        $this->application->run($input, $output);
    }
1363883
public function doRun(InputInterface $input, OutputInterface $output)
  {
    $this->input = $input;
    $this->output = $output;
    $this->committedFiles = $this->extractCommittedFiles();
    $this->allFiles = $this->extractTopLevelFiles();
    $this->intersectFiles = array_intersect($this->allFiles, $this->committedFiles);
    if ($this->getConfiguration()->execute()) {
      $this->parseFiles();
    }
    else {
      $this->destroy();
    }
  }
976113
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $this->bootstrap($input, $output);

        $environment = $input->getOption('environment');
        $format = $input->getOption('format');

        if ($environment === null) {
            $environment = $this->getConfig()->getDefaultEnvironment();
            $output->writeln('<comment>warning</comment> no environment specified, defaulting to: ' . $environment);
        } else {
            $output->writeln('<info>using environment</info> ' . $environment);
        }
        if ($format !== null) {
            $output->writeln('<info>using format</info> ' . $format);
        }

        $output->writeln('<info>ordering by </info>' . $this->getConfig()->getVersionOrder() . " time");

        // print the status
        return $this->getManager()->printStatus($environment, $format);
    }