Method
Uri::withPort
Returns a copy of the URI with the port replaced; null removes it.
Description#
public Uri::withPort(
$port
): UriInterfaceParameters#
- $port
Return values#
UriInterface
Errors / Exceptions#
| Exception | When |
|---|---|
InvalidArgumentException | For a port outside 1-65535, or a port on a URI without a host |
See also#
Psr\Http\Message\UriInterface::withPort