From 56045c9af458a51e19802e2c8e79872b807ce988 Mon Sep 17 00:00:00 2001 From: Maxime Date: Wed, 9 Nov 2022 09:34:41 +0100 Subject: [PATCH] Add Guzzle option parameter into Api contructor --- src/Api.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/Api.php b/src/Api.php index dd7ea45..872f61c 100644 --- a/src/Api.php +++ b/src/Api.php @@ -183,18 +183,20 @@ class Api * @api * @param string $apiKey * @param string $domain + * @param array $options * @throws Exceptions\InvalidConfigurationException */ - public function __construct($apiKey, $domain) + public function __construct($apiKey, $domain, $options = array()) { $this->validateConstructorArgs($apiKey, $domain); $this->baseUrl = sprintf('https://%s.freshdesk.com/api/v2', $domain); - $this->client = new Client([ + $auth_array = [ 'auth' => [$apiKey, 'X'] - ] - ); + ]; + + $this->client = new Client(array_merge($auth_array, $options)); $this->setupResources(); }