AcmePhp\Cli\Command\RegisterCommand::execute PHP Метод

execute() защищенный метод

protected execute ( Symfony\Component\Console\Input\InputInterface $input, Symfony\Component\Console\Output\OutputInterface $output )
$input Symfony\Component\Console\Input\InputInterface
$output Symfony\Component\Console\Output\OutputInterface
    protected function execute(InputInterface $input, OutputInterface $output)
    {
        $repository = $this->getRepository();
        /*
         * Generate account key pair if needed
         */
        if (!$repository->hasAccountKeyPair()) {
            $output->writeln('<info>No account key pair was found, generating one...</info>');
            /** @var KeyPair $accountKeyPair */
            $accountKeyPair = $this->getContainer()->get('ssl.key_pair_generator')->generateKeyPair();
            $repository->storeAccountKeyPair($accountKeyPair);
        }
        /*
         * Register on server
         */
        $client = $this->getClient();
        $email = $input->getArgument('email') ?: null;
        $agreement = $input->getOption('agreement') ?: null;
        $output->writeln('<info>Registering on the ACME server...</info>');
        $client->registerAccount($agreement, $email);
        $output->writeln('<info>Account registered successfully!</info>');
    }
RegisterCommand