WordPress\AiClientDependencies\Nyholm\Psr7
Uri::withScheme
Method of the class: Uri{}
No Hooks.
Returns
static.
Usage
$Uri = new Uri(); $Uri->withScheme( $scheme ): UriInterface;
- $scheme(required)
- .
Uri::withScheme() Uri::withScheme code WP 7.0
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;
}