@param InputInterface  $input
@param OutputInterface $output

@throws \RuntimeException
@throws \GuzzleHttp\Exception\GuzzleException

@return int
492864
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $organizationName = $input->getOption('organization');
        if (!$organizationName = $this->resolveOrganizationName($organizationName, $output)) {
            return -1;
        }

        $userid = $input->getArgument('user_id');

        $client = $this->clientProvider->getUserClient();
        $membership = $client->getMembership($userid, $organizationName);

        $output->writeln('Membership');
        $this->formatterHelper->outputOrganizationMembershipInfo($membership, $output);

        return 0;
    }
850737
protected function execute(InputInterface $input, OutputInterface $output)
    {
        return $this->getRunner($input, $output)->run() ? 0 : -1;
    }
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;
    }
174802
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $container = $this->getContainer();
        if (!$this->checkRunStatus($input, $output)) {
            return 0;
        }
        $limit = (int) $input->getOption('limit');

        /** @var SettingsHelper $settingsHelper */
        $settingsHelper = $container->get('mautic.dashboardwarm.helper.settings');
        $sharedCache    = (bool) $settingsHelper->getShareCaches();

        /** @var DashboardWarmModel $model */
        $model = $container->get('mautic.dashboardwarm.model.warm');
        $model->warm($output, $limit, $sharedCache);

        $this->completeRun();

        return 0;
    }
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;
    }
526874
protected function execute(InputInterface $input, OutputInterface $output) : int
    {
        $queue = self::queue($input->getOption('queue'));

        $json = json_decode($input->getArgument('args'), true);
        if (json_last_error() !== 0) {
            throw new UserException(sprintf("Invalid json for args with error '%s'", json_last_error_msg()));
        }

        if (stripos($input->getArgument('class'), '\\\\') !== false) {
            throw new UserException(sprintf("Invalid class name '%s'", $input->getArgument('class')));
        }

        $job = new Job($input->getArgument('class'), $json);

        $queue->publish($job->serialize());

        return 0;
    }
940065
public function run(InputInterface $input, OutputInterface $output)
    {
        $this->setInput($input);
        $this->setOutput($output);

        return parent::run($input, $output);
    }
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;
    }
868029
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $this->initializeLicenser($input, $output);

        $sources = $input->getArgument('sources');

        $this->licenser->process(
            $sources,
            (bool) $input->getOption('replace-existing'),
            (bool) $input->getOption('dry-run')
        );

        return 0;
    }
1112681
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $force = $input->getOption('force');

        if (!$force) {
            throw new \RuntimeException('Include --force option if you really want to proceed');
        }

        $container = $this->getContainer();
        $entityManager = $container->get('doctrine')->getManager();
        $encryptionService = $container->get('jagilpe_encryption.encryption.service');

        // Encrypt the entities in the database
        $encryptedEntityTypes = $encryptionService->getEncryptionEnabledEntitiesMetadata();
        foreach ($encryptedEntityTypes as $encryptedEntityType) {
            $entityClass = $encryptedEntityType->name;
            $repository = $entityManager->getRepository($entityClass);
            $entities = $repository->findBy(array('encrypted' => false));
            $total = count($entities);
            if ($total > 0){
                $message = "Encrypting $total entities of type $entityClass";
                $output->writeln($message);
                $progress = new ProgressBar($output, $total);
                foreach ($entities as $entity) {
                    if (!$entity->isEncrypted()) {
                        $encryptionService->processEntityMigration($entity);
                        $repository->save($entity);
                    }
                    $progress->advance();
                }

                $progress->finish();
                $output->writeln('');
            }
        }
    }
534591
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $container = $this->getApplication()->getContainer();
        $container->configure();

        $classname = $input->getArgument('class');
        $method = $input->getArgument('method');

        if (!$this->confirm($input, $classname, $method)) {
            return;
        }

        $resource = $container->get('locator.resource_manager')->createResource($classname);

        $container->get('code_generator')->generate($resource, 'specification_method', [
            'method' => $method,
            'type' => $this->confirmMethodType($input, $output),
        ]);
    }
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;
    }
1210690
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);

        /** @var string $file */
        $file = $input->getArgument('file');
        if (! $file) {
            $file = $this->defaultIniFile;
        }

        $output->writeln(sprintf('write fetched file to %s', $file));

        $logger->info('started fetching remote file');

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

        /** @var string $remoteFileOption */
        $remoteFileOption = $input->getOption('remote-file');

        try {
            $browscap->fetch($file, $remoteFileOption);
        } catch (ErrorCachedVersionException $e) {
            $logger->debug($e);

            return 3;
        } catch (FetcherException $e) {
            $logger->debug($e);

            return 9;
        } catch (Exception $e) {
            $logger->debug($e);

            return 10;
        }

        $logger->info('finished fetching remote file');

        return 0;
    }
1151786
protected function execute(InputInterface $input, OutputInterface $output)
    {
        try
        {
            if (method_exists($this, 'start'))
            {
                $this->start();
            }
            else
            {
                throw new \RuntimeException('Command is not set correctly.');
            }
        }
        catch (\Exception $e)
        {
            $this->error($e->getMessage());
        }
    }
912913
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $this->injectOutputIntoLogger($output, $this->logger);

        $tableOutput = new Table($output);
        $tableOutput->setHeaders(['Path', 'Type', 'Size', 'Last Updated']);

        $path = $input->getArgument('path');
        list($prefix,) = $this->mountManager->filterPrefix([$path]);
        $path = trim(substr($path, strlen($prefix) + 3), '/');
        $filesystem = $this->mountManager->getFilesystem($prefix);

        if (!$filesystem->has($path)) {
            throw new Exception\RuntimeException("Path \"$path\" does not exist.");
        }

        $metaData = $this->normalizeMetadata($filesystem->getMetadata($path), $path);
        $this->appendOutputRow($tableOutput, $metaData);

        if ('dir' == $metaData['type']) {
            $contents = $filesystem->listContents($path, $input->getOption('recursive'));
            if ($contents) {
                foreach ($contents as $file) {
                    $metaData = $this->normalizeMetadata($file, $path);
                    $this->appendOutputRow($tableOutput, $metaData);
                }
            }
        }

        $tableOutput->render();
        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');
    }
280584
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $verbosity = PhpVersions::VERBOSITY_NORMAL;
        $verbosity = $input->getOption('verbose') == 2 ? PhpVersions::VERBOSITY_VERBOSE : $verbosity;
        $verbosity = $input->getOption('verbose') == 3 ? PhpVersions::VERBOSITY_DEBUG : $verbosity;
        $verbosity = $input->getOption('quiet') ? PhpVersions::VERBOSITY_SILENT : $verbosity;
        $phpVersions = new PhpVersions(null, $verbosity);

        $versions = $input->getArgument('php');
        $version = array_shift($versions);
        if (empty($version)) {
            $version = 'latest';
        }

        $info = $phpVersions->getInfo($version);

        $format = $input->getOption('format');
        if (empty($format)) {
            $format = 'dump';
        }

        if ($format == 'json') {
            $result = json_encode($info);
        } elseif ($format == 'dump') {
            $result = print_r($info, true);
        } else {
            throw new \RuntimeException("Format '$format' is currently not supported.'");
        }

        $output->writeln($result);
    }