phasync
Uri / withScheme

Method

Uri::withScheme

Returns a copy of the URI with the scheme replaced.

Description#

public Uri::withScheme(
    $scheme
): UriInterface

Parameters#

$scheme

Return values#

UriInterface

Errors / Exceptions#

ExceptionWhen
InvalidArgumentExceptionWhen the scheme does not start with a letter or has characters other than letters, digits, '+', '-' and '.'

See also#

  • Psr\Http\Message\UriInterface::withScheme