Method to set property transport

@param   TransportInterface $transport

@return  static  Return self to support chaining.
@throws \InvalidArgumentException
481419
public function setTransport(TransportInterface $transport)
    {
        if (!$transport instanceof CurlTransport) {
            throw new \InvalidArgumentException(
                sprintf(
                    '%s only supports %s',
                    get_called_class(),
                    CurlTransport::class
                )
            );
        }

        $this->transport = $transport;

        return $this;
    }
62230
public function transport($type = null)
    {

        // Act as setter
        if (!is_null($type)) {
            $this->transport = $type;
        }

        return $this->transport;
    }
1201968
public function setPort($port)
    {
        if (!is_int($port) || $port < 0 || $port > 65535) {
            throw new InvalidArgumentException(
                sprintf('%s only accepts a port between 0 and 65535 inclusive', __FUNCTION__)
            );
        }

        $this->port = $port;

        return $this;
    }
556355
public function set($transport, $ip, $port, $timeout = 3, $blocking = false)
    {

        $this->transport = $transport;

        $this->ip = $ip;

        $this->port = $port;

        $this->timeout = $timeout;

        $this->blocking = $blocking;
    }
341649
public static function getInstance(HttpClient $transport = null)
    {
        if (is_null(self::$client)) {
            self::$client = new self();
        
            if (! is_null($transport)) {
                self::$client->setTransport($transport);
            }
        }
        
        return self::$client;
    }
454544
public function setRoute(RouteInterface $route): RouterInterface
    {
        $regexp = $route->getRegexp();
        $this->_routes[$regexp] = $route;
        return $this;
    }
768079
public function setType($type) {
		if(!in_array($type, self::VALID_TYPES)) {
			throw new InvalidArgumentException('Invalid cause type.');
		}

		$this->type = $type;

		return $this;
	}
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;
    }
950441
public function setType($type)
    {
        if (!in_array($type, self::TYPES)) {
            throw new \InvalidArgumentException("bad type {$type}");
        }
        $this->type = $type;

        return $this;
    }
503849
public static function factory($type)
    {
        if (isset(self::$transports[$type])) {
            return self::$transports[$type];
        }

        self::$transports[$type] = new Transport($type);
        return self::$transports[$type];
    }
585140
public function setType($type)
    {
        if (! in_array($type, self::$types, true)) {
            throw new InvalidArgumentException(sprintf(
                '"%s" is not a valid type! Valid types: %s',
                $type,
                implode(', ', self::$types)
            ));
        }

        $this->type = $type;

        return $this;
    }
1357790
public static function getInstance($options = [], TransportInterface $transport = null)
    {
        if (!static::$instance) {
            static::$instance = static::create($options, $transport);
        }

        return static::$instance;
    }
498117
public function send() {
        if (is_null($this->Transport)) {
            throw new TransportException();
        }
        $this->Transport->setRequest($this);
        return $this->Transport->makeHttpRequest($this);
    }
545063
public function setTransport($transport)
    {
        if (!in_array($transport,stream_get_transports())) {
            throw new \DomainException(sprintf('Unsupported type of transport "%s"', $transport));
        }

        $this->transport = $transport;
        return $this;
    }
557728
private function initTransports()
    {
        $this->transports = array();

        foreach ($this->loadTransports() as $transport) {
            if (!$transport instanceof TransportInterface) {
                throw new \InvalidArgumentException(sprintf('Transport %s should implements TransportInterface', get_class($transport)));
            }

            $this->transports[$transport->getName()] = $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;
    }
422079
public function setPort($port)
    {
        if ( ! is_null($port)) $port = (int) $port;

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

        return $this;
    }