AcmePhp\Cli\Command\RequestCommand::getOrCreateDistinguishedName PHP Метод

getOrCreateDistinguishedName() приватный метод

Retrieve the stored distinguishedName or create a new one if needed.
private getOrCreateDistinguishedName ( string $domain, array $alternativeNames ) : DistinguishedName
$domain string
$alternativeNames array
Результат AcmePhp\Ssl\DistinguishedName
    private function getOrCreateDistinguishedName($domain, array $alternativeNames)
    {
        if ($this->repository->hasDomainDistinguishedName($domain)) {
            $original = $this->repository->loadDomainDistinguishedName($domain);
            $distinguishedName = new DistinguishedName($domain, $this->input->getOption('country') ?: $original->getCountryName(), $this->input->getOption('province') ?: $original->getStateOrProvinceName(), $this->input->getOption('locality') ?: $original->getLocalityName(), $this->input->getOption('organization') ?: $original->getOrganizationName(), $this->input->getOption('unit') ?: $original->getOrganizationalUnitName(), $this->input->getOption('email') ?: $original->getEmailAddress(), $alternativeNames);
        } else {
            // Ask DistinguishedName
            $distinguishedName = new DistinguishedName($domain, $this->input->getOption('country'), $this->input->getOption('province'), $this->input->getOption('locality'), $this->input->getOption('organization'), $this->input->getOption('unit'), $this->input->getOption('email'), $alternativeNames);
            /** @var DistinguishedNameHelper $helper */
            $helper = $this->getHelper('distinguished_name');
            if (!$helper->isReadyForRequest($distinguishedName)) {
                $asked = true;
                $this->output->writeln("\n\nSome informations about you or your company are required for the certificate:\n");
                $distinguishedName = $helper->ask($this->getHelper('question'), $this->input, $this->output, $distinguishedName);
            }
        }
        $this->repository->storeDomainDistinguishedName($domain, $distinguishedName);
        return $distinguishedName;
    }