public function Url::getPort

Get the port part of the URl. Will return the default port for a given scheme if no port has been set.

Return value

int|null

File

drupal/core/vendor/guzzle/http/Guzzle/Http/Url.php, line 247

Class

Url
Parses and generates URLs based on URL parts. In favor of performance, URL parts are not validated.

Namespace

Guzzle\Http

Code

public function getPort() {
  if ($this->port) {
    return $this->port;
  }
  elseif ($this->scheme == 'http') {
    return 80;
  }
  elseif ($this->scheme == 'https') {
    return 443;
  }
  return null;
}