public function setPort(int $port = null)
	{
		if (is_null($port))
		{
			return $this;
		}

		if ($port <= 0 || $port > 65535)
		{
			throw HTTPException::forInvalidPort($port);
		}

		$this->port = $port;

		return $this;
	}
public function setPort(int $port = null)
	{
		if (is_null($port))
		{
			return $this;
		}

		if ($port <= 0 || $port > 65535)
		{
			throw HTTPException::forInvalidPort($port);
		}

		$this->port = $port;

		return $this;
	}
public function setPort ( int $ port = null ) { if ( is_null ( $ port ) ) { return $ this ; } if ( $ port <= 0 || $ port > 65535 ) { throw HTTPException :: forInvalidPort ( $ port ) ; } $ this -> port = $ port ; return $ this ; }
Sets the port portion of the URI.

@param integer $port

@return $this
Sets the port portion of the URI .