phasync
Uri / withUserInfo

Method

Uri::withUserInfo

Returns a copy of the URI with the user and password replaced.

Description#

public Uri::withUserInfo(
    $user,
    $password = null
): UriInterface

Parameters#

$user
$password = null

Return values#

UriInterface

Errors / Exceptions#

ExceptionWhen
InvalidArgumentExceptionWhen the URI has no host and $user is not ''

See also#

  • Psr\Http\Message\UriInterface::withUserInfo