src/URI.php
private function setPort($port = null)
	{
		if ($port !== null && (1 > $port || 0xffff < $port)) {
			throw new \InvalidArgumentException('Invalid port');
		}

		$this->port = $port;

		return $this;
	}
private function setPort($port = null)
	{
		if ($port !== null && (1 > $port || 0xffff < $port)) {
			throw new \InvalidArgumentException('Invalid port');
		}

		$this->port = $port;

		return $this;
	}
Set the port.

@param int|null $port
@return $this
@throws \InvalidArgumentException