From e2ff6039d4e2f32753f55cac53482d889db9b0b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ronja=20St=C3=B6ppel?= Date: Tue, 13 Sep 2022 12:27:48 +0200 Subject: [PATCH] fix: Create default for uri parameter in send method A requiered parameter must not come after an optional parameter, since PHP 8.1. To work around this error, the parameter becomes an optional and is checked first. --- src/Snowcap/Emarsys/Client.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Snowcap/Emarsys/Client.php b/src/Snowcap/Emarsys/Client.php index 875be62..3f4bbea 100644 --- a/src/Snowcap/Emarsys/Client.php +++ b/src/Snowcap/Emarsys/Client.php @@ -893,8 +893,12 @@ public function addBlacklistEntries(array $emails = array(), array $domains = ar * @throws ClientException * @throws ServerException */ - protected function send($method = 'GET', $uri, array $body = array()) + protected function send($method = 'GET', $uri = '', array $body = array()) { + if (empty($uri)) { + throw new ServerException('The uri must not be empty.'); + } + $headers = array('Content-Type: application/json', 'X-WSSE: ' . $this->getAuthenticationSignature()); $uri = $this->baseUrl . $uri;