Icicle\Http\Message\Uri::getPort PHP Метод

getPort() публичный Метод

Returns the port or 0 if no port is set and no scheme is set.
public getPort ( ) : integer
Результат integer
    public function getPort() : int;

Usage Example

Пример #1
0
 /**
  * Sets the host based on the current URI.
  */
 private function setHostFromUri()
 {
     $this->hostFromUri = true;
     $host = $this->uri->getHost();
     if (!empty($host)) {
         // Do not set Host header if URI has no host.
         $port = $this->uri->getPort();
         if (null !== $port) {
             $host = sprintf('%s:%d', $host, $port);
         }
         parent::setHeader('Host', $host);
     }
 }