WordPress\AiClientDependencies\Nyholm\Psr7

Uri::withScheme │ public │ WP 1.0

Метод класса: Uri{}

Хуков нет.

Возвращает

static.

Использование

$Uri = new Uri();
$Uri->withScheme( $scheme ): UriInterface;
$scheme(обязательный)
.

Код Uri::withScheme() WP 7.1.4

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