Get the port part of the URl. Will return the default port for a given scheme if no port has been set.
int|null
public function getPort() {
if ($this->port) {
return $this->port;
}
elseif ($this->scheme == 'http') {
return 80;
}
elseif ($this->scheme == 'https') {
return 443;
}
return null;
}