@param string $name
@param string $ipAddress

@throws HttpException

@return DomainEntity
336930
public function create($name, $ipAddress)
    {
        $content = ['name' => $name, 'ip_address' => $ipAddress];

        $domain = $this->adapter->post(sprintf('%s/domains', $this->endpoint), $content);

        $domain = json_decode($domain);

        return new DomainEntity($domain->domain);
    }
739105
protected function getDomain($domainName)
    {
        $entityManager = $this->getEntityManager();

        /** @var \Rcm\Repository\Domain $domainRepo */
        $domainRepo = $entityManager->getRepository(
            \Rcm\Entity\Domain::class
        );

        $domain = $domainRepo->getDomainByName($domainName);

        if (!$domain instanceof Domain) {
            throw new \Exception("Domain {$domainName} could not be found.");
        }

        return $domain;
    }
311944
public function resolve($name)
    {
        if (class_exists($name)) {
            return $name;
        }

        $name = static::normalise($name);

        $namespaces = clone $this->namespaces;

        $this->registerDefaultNamespace($namespaces);

        foreach (clone $namespaces as $ns) {
            $class = $ns . '\\' . $name;

            if (class_exists($class = $this->resolveClassAlias($class))) {
                if ($this->baseClass && !is_subclass_of($class, $this->baseClass)) {
                    throw new \DomainException(sprintf(
                        'Class: "%s" should be sub class of %s',
                        $class,
                        $this->baseClass
                    ));
                }

                return $class;
            }
        }

        throw new \DomainException(sprintf(
            'Can not find any classes with name: "%s" in package: "%s", namespaces: ( %s ).',
            $name,
            $this->package->getName(),
            implode(" |\n ", $namespaces->toArray())
        ));
    }
675052
public function &__get($name)
    {
        list($result, $found) = $this->peridotScanChildren($this, function ($childScope, &$accumulator) use ($name) {
            if (property_exists($childScope, $name)) {
                $accumulator = [$childScope->$name, true, $childScope];
            }
        });
        if (!$found) {
            throw new DomainException("Scope property $name not found");
        }
        return $result;
    }
373285
private function getPlan(string $name): Plan
    {
        if (empty($this->plans[$name])) {
            throw new Exception\DomainException(
                sprintf(
                    'Invalid plan "%s" specified.',
                    $name
                )
            );
        }

        return new Plan($name, $this->plans[$name], $this->stepInterface);
    }
1334547
public function cc($address, $name = null)
    {
        if ($this->arrayOfAddresses($address)) {
            $this->cc += $this->parseAddresses($address);
        } else {
            $this->cc[] = [$address, $name];
        }

        return $this;
    }
258551
protected function makeFinalResult($ipAddress)
    {
        return $this->target->setResult(
            $this->makeResult(
                false,
                sprintf(
                    $this->target->getErrorMessage(),
                    $this->hosnameAndIp($this->target->hostname, $ipAddress),
                    $this->target->port
                )
            )
        )->getResult();
    }
456128
public static function toHeader($name, array $properties)
    {
        $result = rawurlencode($name) . '=' . rawurlencode($properties['value']);
        if (isset($properties['domain'])) {
            $result .= '; domain=' . $properties['domain'];
        }
        if (isset($properties['path'])) {
            $result .= '; path=' . $properties['path'];
        }
        if (isset($properties['expires'])) {
            if (is_string($properties['expires'])) {
                $timestamp = strtotime($properties['expires']);
            } else {
                $timestamp = (int) $properties['expires'];
            }
            if ($timestamp !== 0) {
                $result .= '; expires=' . gmdate('D, d-M-Y H:i:s e', $timestamp);
            }
        }
        if (isset($properties['secure']) && $properties['secure']) {
            $result .= '; secure';
        }
        if (isset($properties['hostonly']) && $properties['hostonly']) {
            $result .= '; HostOnly';
        }
        if (isset($properties['httponly']) && $properties['httponly']) {
            $result .= '; HttpOnly';
        }
        if (isset($properties['samesite']) && in_array(strtolower($properties['samesite']), ['lax', 'strict'], true)) {
            // While strtolower is needed for correct comparison, the RFC doesn't care about case
            $result .= '; SameSite=' . $properties['samesite'];
        }

        return $result;
    }
806863
public function bcc($address, $name = null)
    {
        if (is_array($address)) {
            $this->addAddressArray($address, 'bcc');
        } else {
            $this->bcc[$address] = $name;
        }

        return $this;
    }
348170
public function getFormat($name)
    {
        if (empty($this->formats[$name]) || !($this->formats[$name] instanceof FormatInterface)) {
            $class = sprintf('Windwalker\\Language\\Format\\%sFormat', $name);

            if (!class_exists($class)) {
                throw new \DomainException('Format ' . $name . ' not support. Class: ' . $class . ' not found');
            }

            $this->formats[$name] = new $class();
        }

        return $this->formats[$name];
    }
716875
public function createCustomAPI($url, $name)
    {
        $api = new Custom($url, $name);
        if (!$this->getHttpClient()) {
            $this->setHttpClient();
        }
        if (!$this->getEntityFactory()) {
            $this->setEntityFactory();
        }
        return $api->registerDiffbot($this);
    }
289818
public static dnsaddrec get(nitro_service service, String hostname) throws Exception{
		dnsaddrec obj = new dnsaddrec();
		obj.set_hostname(hostname);
		dnsaddrec response = (dnsaddrec) obj.get_resource(service);
		return response;
	}
1128600
public function get($name, array $params = array())
    {
        if (null === $this->serviceLocator) {
            throw new DomainException('No ServiceLocator defined, use `createServiceWithName` instead of `get`');
        }

        if (self::USE_SL_BEFORE_DI === $this->useServiceLocator && $this->serviceLocator->has($name)) {
            return $this->serviceLocator->get($name);
        }

        try {
            return parent::get($name, $params);
        } catch (ClassNotFoundException $e) {
            if (self::USE_SL_AFTER_DI === $this->useServiceLocator && $this->serviceLocator->has($name)) {
                return $this->serviceLocator->get($name);
            }

            throw new Exception\ServiceNotFoundException(
                sprintf('Service %s was not found in this DI instance', $name),
                null,
                $e
            );
        }
    }
194977
public function bcc($address, $name = null, $override = false)
    {
        if ($override) {
            $this->swift->setBcc($address, $name);

            return $this;
        }

        return $this->addAddresses($address, $name, 'Bcc');
    }
313244
public function addDomain($name, array $ssl = [])
    {
        $body = ['name' => $name];
        if (!empty($ssl)) {
            $body['ssl'] = $ssl;
        }

        return Domain::create($body, $this->getLink('domains'), $this->client);
    }
666699
public function api($name, PagerInterface $pager = null)
    {
        if (!$this->getAccessToken()) {
            $this->sign();
        }

        $apiClass = 'Imgur\\Api\\' . ucfirst($name);
        if (class_exists($apiClass)) {
            return new $apiClass($this, $pager);
        }

        throw new InvalidArgumentException('API Method not supported: "' . $name . '" (apiClass: "' . $apiClass . '")');
    }
446369
public function make(string $name, int $expireTime = 604800, string $path = "/", string $domain = "", bool $secure = false, bool $httpOnly = true)
  {
    return new PHPCookie($name, $expireTime, $path, $domain, $secure, $httpOnly);
  }