WordPress\AiClientDependencies\Nyholm\Psr7

Uri::withHostpublicWP 1.0

Method of the class: Uri{}

No Hooks.

Returns

static.

Usage

$Uri = new Uri();
$Uri->withHost( $host ): UriInterface;
$host(required)
.

Uri::withHost() code WP 7.0

public function withHost($host): UriInterface
{
    if (!\is_string($host)) {
        throw new \InvalidArgumentException('Host must be a string');
    }
    if ($this->host === $host = \strtr($host, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz')) {
        return $this;
    }
    $new = clone $this;
    $new->host = $host;
    return $new;
}