From af77f52bedd4f66616ed6d63bb753708554104bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Munsch?= Date: Fri, 13 Aug 2021 11:12:21 +0200 Subject: [PATCH] Add missing endpoint on api Interface contructor --- src/CrmApiV2.php | 3 ++- src/Transport/ApiInterface.php | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/CrmApiV2.php b/src/CrmApiV2.php index 6377d03..a46352f 100644 --- a/src/CrmApiV2.php +++ b/src/CrmApiV2.php @@ -22,9 +22,10 @@ class CrmApiV2 */ private static $apiInterface; - public function __construct(string $bearerToken = null, string $bearerPwd = null) + public function __construct(string $endpoint = null, string $bearerToken = null, string $bearerPwd = null) { self::$apiInterface = self::$apiInterface ?: new ApiInterface( + $endpoint, $bearerToken, $bearerPwd ); diff --git a/src/Transport/ApiInterface.php b/src/Transport/ApiInterface.php index 93fbd5e..645831c 100644 --- a/src/Transport/ApiInterface.php +++ b/src/Transport/ApiInterface.php @@ -58,8 +58,9 @@ class ApiInterface */ protected static $apiToken; - public function __construct(string $bearerToken = null, string $bearerPwd = null) + public function __construct(string $endpoint = null, string $bearerToken = null, string $bearerPwd = null) { + static::$endpoint = static::$endpoint ?: $endpoint; static::$bearerToken = static::$bearerToken ?: $bearerToken; static::$bearerPwd = static::$bearerPwd ?: $bearerPwd; static::$bearerToken = static::$bearerToken ?: Utils::getConfig('crm.token');