Amp\Artax\Client::setAllOptions PHP Method

setAllOptions() public method

Set multiple Client options at once
public setAllOptions ( array $options ) : self
$options array An array of the form [OP_CONSTANT => $value]
return self
    public function setAllOptions(array $options)
    {
        foreach ($options as $option => $value) {
            $this->setOption($option, $value);
        }
        return $this;
    }

Usage Example

Example #1
0
function httpClient() : HttpClient
{
    static $client;
    if (!isset($client)) {
        $client = new HttpClient();
        $client->setAllOptions([HttpClient::OP_DEFAULT_USER_AGENT => Application::USER_AGENT, HttpClient::OP_VERBOSITY => HttpClient::VERBOSE_NONE, HttpClient::OP_AUTO_ENCODING => false]);
    }
    return $client;
}
All Usage Examples Of Amp\Artax\Client::setAllOptions