Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. Uri.php

function Uri::isDefaultPort

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.

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 203

Class

Uri
PSR-7 URI implementation.

Namespace

GuzzleHttp\Psr7

Code

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

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal