You are here

private function Uri::filterPort in Lockr 7.3

Parameters

int|null $port:

Return value

int|null

Throws

\InvalidArgumentException If the port is invalid.

2 calls to Uri::filterPort()
Uri::applyParts in vendor/guzzlehttp/psr7/src/Uri.php
Apply parse_url parts to a URI.
Uri::withPort in vendor/guzzlehttp/psr7/src/Uri.php
Return an instance with the specified port.

File

vendor/guzzlehttp/psr7/src/Uri.php, line 602

Class

Uri
PSR-7 URI implementation.

Namespace

GuzzleHttp\Psr7

Code

private function filterPort($port) {
  if ($port === null) {
    return null;
  }
  $port = (int) $port;
  if (1 > $port || 0xffff < $port) {
    throw new \InvalidArgumentException(sprintf('Invalid port: %d. Must be between 1 and 65535', $port));
  }
  return $port;
}