Sets the port in the URI

@param string $port The port number
@return void
@throws \InvalidArgumentException
@deprecated Since Flow 5.1, use withPort instead
@see withPort()
193765
public function setPort($port)
    {
        if (preg_match(self::PATTERN_MATCH_PORT, $port) !== 1) {
            throw new \InvalidArgumentException('"' . $port . '" is not valid port number as part of a URI.', 1184071241);
        }

        $this->port = (integer)$port;
    }
629021
public static function filterPort(?int $port, string $scheme = ''): ?int
    {
        if (null === $port) {
            return null;
        }

        $port = (int) $port;

        if (self::MIN_PORT > $port || self::MAX_PORT < $port) {
            throw new \InvalidArgumentException(
                sprintf('Invalid port: %d. Must be between %d and %d', $port, self::MIN_PORT, self::MAX_PORT)
            );
        }

        if (DefaultPortIdentifier::isDefaultPort($scheme, $port)) {
            $port = null;
        }

        return $port;
    }
880028
function SetServer ( $host, $port = 0 )
    {
        assert ( is_string($host) );
        if ( $host[0] == '/')
        {
            $this->_path = 'unix://' . $host;
            return;
        }
        if ( substr ( $host, 0, 7 )=="unix://" )
        {
            $this->_path = $host;
            return;
        }

        $this->_host = $host;
        $port = intval($port);
        assert ( 0<=$port && $port<65536 );
        $this->_port = ( $port==0 ) ? 9312 : $port;
        $this->_path = '';
    }
189689
public function setDefaultHost($host, $port = null) {
		$this->defaultHost = (string) $host;
		
		if ($port !== null) {
			$this->setDefaultPort($port);
		}
		
		return $this;
	}
257901
public void setPort( int port )
    {
        assert ( port >= 0 && port <= 65535 ) || ( port == UNDEFINED_PORT )
                 : "Invalid port" ;

        if ( ( port > 65535 ) || ( port < 0 && port != UNDEFINED_PORT ) )
        {
             throw new IllegalArgumentException( "A port must be between 0 and 65535 or equal to "
                                                 + UNDEFINED_PORT + ".");
        }

        _port = port;
    }
129579
public function setNasPort($port = 0)
    {
        $this->nasPort = intval($port);
        $this->setAttribute(5, $this->nasPort);

        return $this;
    }
69132
public function setPort($port)
    {
        if ($this->validatePort($port) === false) {
            include_once 'Zend/Uri/Exception.php';
            throw new Zend_Uri_Exception("Port \"$port\" is not a valid HTTP port.");
        }

        $oldPort     = $this->_port;
        $this->_port = $port;

        return $oldPort;
    }
484516
public function port($port) {

		if(false === ('-' . intval($port) == '-' . $port)) {
			return trigger_error(sprintf('Argument 1 passed to %s() must be of the type integer, "%s" given', __METHOD__, gettype($port)), E_USER_ERROR);
		}

		if($port < 1 || $port > 65535) {
			return trigger_error(sprintf('Argument 1 passed to %s() must be between 1 and 65535, "%s" given', __METHOD__, $port), E_USER_ERROR);
		}

		$this -> options[CURLOPT_PORT] = intval($port);

		return $this;
	}
264587
public function setPort($port)
	{
		//Use the provided port or use the default
		$port = (int) $port;

		if ($port <= 0)
		{
			throw new Apache_Solr_InvalidArgumentException('Port is not a valid port number');
		}
		else
		{
			$this->_port = $port;
		}

		if ($this->_urlsInited)
		{
			$this->_initUrls();
		}
	}
422079
public function setPort($port)
    {
        if ( ! is_null($port)) $port = (int) $port;

        $this->setAttribute('port', $port);

        return $this;
    }
1032318
public function setPort($adPort)
    {
        if (!is_numeric($adPort)) {
            if ($adPort === null) {
                $adPort = 'null';
            }

            throw new AdldapException("The Port: $adPort is not numeric and cannot be used.");
        }

        $this->adPort = (string) $adPort;
    }
588058
protected function filterPort($port)
    {
        if (is_null($port) || (is_integer($port) && ($port >= 1 && $port <= 65535))) {
            return $port;
        }

        throw new InvalidArgumentException('Uri port must be null or an integer between 1 and 65535 (inclusive)');
    }
632169
public function setPort($port)
        {
            if ($this->validatePort($port) === false) {
                throw new Exception("Port \"$port\" is not a valid HTTP port.");
            }

            $oldPort     = $this->_port;
            $this->_port = $port;

            return $oldPort;
        }
787274
function setPort($port)
    {
        if ($port !== null) {
            if (empty($port) && $port !== 0)
                $port = null;
            elseif ($port < 1 || $port > 65535)
                throw new \InvalidArgumentException(sprintf(
                    'Invalid port "%d" specified; must be a valid TCP/UDP port',
                    $port
                ));
        }

        $this->port = $port;
        return $this;
    }
1178696
public function setServer($host, $port = 0)
    {
        assert(is_string($host));
        if ($host[0] == '/') {
            $this->_path = 'unix://'.$host;

            return;
        }
        if (substr($host, 0, 7) == 'unix://') {
            $this->_path = $host;

            return;
        }

        $this->_host = $host;
        if (is_int($port)) {
            if ($port) {
                $this->_port = $port;
            }
        }
        $this->_path = '';

        return $this;
    }
743787
protected function filterPort($port)
    {
        if (empty($port)) {
            return null;
        }

        if (!self::validePort($port)) {
            throw new \InvalidArgumentException('The port is not in the TCP/UDP port.');
        }

        return $this->scheme !== '' && !$this->validPortStandard($port)
            ? (int) $port
            : null;
    }
1164620
protected function setHost($host, $port = null)
    {
        $this->host = $host;
        if ($port !== null) {
            if (is_numeric($port)) {
                $this->port = (int) $port;
            } else {
                throw new ConfigurationException("Port '{$port}' is not numeric");
            }
        }
    }