Uri::withScheme( $scheme ): static

In this article

Return

static

Source

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;
}

User Contributed Notes

You must log in before being able to contribute a note or feedback.