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

Breadcrumb

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

function UriInterface::getPort

Retrieve the port component of the URI.

If a port is present, and it is non-standard for the current scheme, this method MUST return it as an integer. If the port is the standard port used with the current scheme, this method SHOULD return null.

If no port is present, and no scheme is present, this method MUST return a null value.

If no port is present, but a scheme is present, this method MAY return the standard port for that scheme, but SHOULD return null.

Return value

null|int The URI port.

1 method overrides UriInterface::getPort()
Uri::getPort in vendor/guzzlehttp/psr7/src/Uri.php
Retrieve the port component of the URI.

File

vendor/psr/http-message/src/UriInterface.php, line 108

Class

UriInterface
Value object representing a URI.

Namespace

Psr\Http\Message

Code

public function getPort() : ?int;

API Navigation

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