Set the port

@param int|null $port
489701
protected function setPort($port)
    {
        if ((string)$port !== '' && !$this->isValidPort($port)) {
            throw new \InvalidArgumentException("Invalid port '$port'");
        }
        
        $this->port = $port ? (int)$port : null;
    }
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;
	}
946279
protected function filterPort(int $port = null): int
    {
        $port = (int) $port; // Cast null to 0.

        if (0 > $port || 0xffff < $port) {
            throw new InvalidValueException(
                sprintf('Invalid port: %d. Must be 0 or an integer between 1 and 65535.', $port)
            );
        }

        return $port;
    }
140001
protected static function filterPort($port)
    {
        if ($port !== null) {
            if (! is_integer($port)) {
                throw new InvalidArgumentException(sprintf(
                    'Invalid port provided; must be an integer or null argument; received %s',
                    (is_object($port) ? get_class($port) : gettype($port))
                ));
            }

            if ($port < 1 || $port > 65535) {
                throw new InvalidArgumentException(sprintf(
                    'Invalid port "%d" specified; must be a valid TCP/UDP port',
                    $port
                ));
            }

            if (in_array($port, static::$standardSchemes)) {
                $port = null;
            }
        }

        return $port;
    }
658912
public function setPort(int $port = 80) : CNabuDataObject
    {
        if ($port === null) {
            throw new ENabuCoreException(
                    ENabuCoreException::ERROR_NULL_VALUE_NOT_ALLOWED_IN,
                    array("\$port")
            );
        }
        $this->setValue('nb_server_host_port', $port);
        
        return $this;
    }
631701
public function setPort($port)
    {
        if ($port != $this->_port) {
            $this->_port = (int)$port;
            $this->_hostInfo = null;
        }
        return $this;
    }
817671
public function setLocalPort($port)
    {
        if ($port < 0 || $port > 65535 || !is_integer($port)) {
            throw new \InvalidArgumentException('Invalid port');
        }

        $this->networkLocalPort = $port;
    }
1080888
public function & SetPort ($rawPort) {
		/** @var $this \MvcCore\Request */
		$this->port = $rawPort;
		$this->domainUrl = NULL;
		$this->baseUrl = NULL;
		$this->requestUrl = NULL;
		$this->fullUrl = NULL;
		if (strlen($rawPort) > 0) {
			$this->host = $this->hostName . ':' . $rawPort;
			$this->portDefined = TRUE;
		} else {
			$this->host = $this->hostName;
			$this->portDefined = FALSE;
		}
		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;
    }
1363925
public function toHttp(int $port = null): self
    {
        if ($this->isHttp()) {
            if (null !== $port && !$this->parsedUri->portEquals($port)) {
                return new ConstructedHttpUri($this->parsedUri->transpose(['port' => $port]));
            }

            return $this;
        }

        $changes = ['scheme' => Http::SCHEME];
        if ($this->parsedUri->hasPort()) {
            $changes['port'] = $port;
        }

        return new ConstructedHttpUri($this->parsedUri->transpose($changes));
    }
446331
public function connect($host = null, $port = null)
    {
        return $this->driver->connect(
            $host ? $host : $this->host,
            $port ? $port : $this->port
        );
    }
189689
public function setDefaultHost($host, $port = null) {
		$this->defaultHost = (string) $host;
		
		if ($port !== null) {
			$this->setDefaultPort($port);
		}
		
		return $this;
	}
1338935
public function setHost($host, $port = null) {
		$this->host = (string) $host;
		
		if ($port !== null) {
			$this->setPort($port);
		}
		
		return $this;
	}
785095
protected function setTransport(TransportInterface $transport = null)
    {
        if (is_null($transport)) {
            $this->transport = $this->createTransport();
        } else {
            $this->transport = $transport;
        }
    }
616690
public function setTargetPort($targetPort)
    {
        if (
               $this->getAddressType() != AF_UNIX
            && !is_integer($targetPort)
        ) {
            throw new \InvalidArgumentException('Target port parameter must be an integer');
        }
        $this->targetPort = $targetPort;

        return $this;
    }
1228320
public function setIp($ip, $port = null)
    {
        $this->login = null;
        $this->ip    = (string)$ip;
        if ($port) {
            $this->setPort($port);
        }
        return $this;
    }
488053
function setProxy($proxyHost, $proxyPort) {
      $this->useProxy = true;
      $this->proxyHost = $proxyHost;
      $this->proxyPort = $proxyPort;
    }