Google\Cloud\RequestWrapper::__construct PHP Method

__construct() public method

public __construct ( array $config = [] )
$config array [optional] { Configuration options. Please see {@see \Google\Cloud\RequestWrapperTrait::setCommonDefaults()} for the other available options. @type string $accessToken Access token used to sign requests. @type callable $authHttpHandler A handler used to deliver Psr7 requests specifically for authentication. @type callable $httpHandler A handler used to deliver Psr7 requests. @type array $httpOptions HTTP client specific configuration options. @type bool $shouldSignRequest Whether to enable request signing. }
    public function __construct(array $config = [])
    {
        $this->setCommonDefaults($config);
        $config += ['accessToken' => null, 'authHttpHandler' => null, 'httpHandler' => null, 'httpOptions' => [], 'shouldSignRequest' => true];
        $this->accessToken = $config['accessToken'];
        $this->httpHandler = $config['httpHandler'] ?: HttpHandlerFactory::build();
        $this->authHttpHandler = $config['authHttpHandler'] ?: $this->httpHandler;
        $this->httpOptions = $config['httpOptions'];
        $this->shouldSignRequest = $config['shouldSignRequest'];
    }