yii\httpclient\Client::setTransport PHP Method

setTransport() public method

- an instance of Transport: actual transport object to be used - a string: representing the class name of the object to be created - a configuration array: the array must contain a class element which is treated as the object class, and the rest of the name-value pairs will be used to initialize the corresponding object properties - a PHP callable: either an anonymous function or an array representing a class method ([$class or $object, $method]). The callable should return a new instance of the object being created.
public setTransport ( Transport | array | string $transport )
$transport Transport | array | string HTTP message transport
    public function setTransport($transport)
    {
        $this->_transport = $transport;
    }