You are here

public static function Uri::isDefaultPort in Lockr 7.3

Whether the URI has the default port of the current scheme.

`Psr\Http\Message\UriInterface::getPort` may return null or the standard port. This method can be used independently of the implementation.

Parameters

UriInterface $uri:

Return value

bool

2 calls to Uri::isDefaultPort()
Uri::removeDefaultPort in vendor/guzzlehttp/psr7/src/Uri.php
UriNormalizer::normalize in vendor/guzzlehttp/psr7/src/UriNormalizer.php
Returns a normalized URI.

File

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

Class

Uri
PSR-7 URI implementation.

Namespace

GuzzleHttp\Psr7

Code

public static function isDefaultPort(UriInterface $uri) {
  return $uri
    ->getPort() === null || isset(self::$defaultPorts[$uri
    ->getScheme()]) && $uri
    ->getPort() === self::$defaultPorts[$uri
    ->getScheme()];
}