From 903242afa9748819b2561b4528d3259373755868 Mon Sep 17 00:00:00 2001 From: Jhonatan Jacinto Date: Mon, 22 Sep 2025 07:41:09 -0300 Subject: [PATCH 1/2] Mark TokenStorageInterface as explicitly nullable in the ApiClient constructor --- src/ApiClient.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ApiClient.php b/src/ApiClient.php index 66210f5..f7f18ae 100755 --- a/src/ApiClient.php +++ b/src/ApiClient.php @@ -57,7 +57,7 @@ class ApiClient implements ApiInterface * @param TokenStorageInterface|null $tokenStorage * @throws ApiClientException */ - public function __construct(string $userId, string $secret, TokenStorageInterface $tokenStorage = null) + public function __construct(string $userId, string $secret, ?TokenStorageInterface $tokenStorage = null) { if ($tokenStorage === null) { $tokenStorage = new FileStorage(); From 65526002ecfc4a7eef78560a4f41481393d76ee1 Mon Sep 17 00:00:00 2001 From: Jhonatan Jacinto Date: Mon, 22 Sep 2025 08:00:03 -0300 Subject: [PATCH 2/2] Add explicit nullable type to nullable params to fix php 8.4 error --- src/ApiClient.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/ApiClient.php b/src/ApiClient.php index f7f18ae..b806fde 100755 --- a/src/ApiClient.php +++ b/src/ApiClient.php @@ -307,7 +307,7 @@ public function removeAddressBook(int $id): ?array * @deprecated * @see ApiClient::get() */ - public function listAddressBooks(int $limit = null, int $offset = null): ?array + public function listAddressBooks(?int $limit = null, ?int $offset = null): ?array { $data = array(); if (null !== $limit) { @@ -380,7 +380,7 @@ public function updateEmailVariables(int $bookID, string $email, array $vars): ? * @deprecated * @see ApiClient::get() */ - public function getEmailsFromBook(int $id, int $limit = null, int $offset = null): ?array + public function getEmailsFromBook(int $id, ?int $limit = null, ?int $offset = null): ?array { $data = []; if (null !== $limit) { @@ -477,7 +477,7 @@ public function campaignCost(int $bookID): ?array * @deprecated * @see ApiClient::get() */ - public function listCampaigns(int $limit = null, int $offset = null): ?array + public function listCampaigns(?int $limit = null, ?int $offset = null): ?array { $data = []; if (!empty($limit)) { @@ -563,7 +563,7 @@ public function createCampaign( string $type = '', bool $useTemplateId = false, string $sendDate = '', - int $segmentId = null, + ?int $segmentId = null, array $attachmentsBinary = [] ): ?array { @@ -884,7 +884,7 @@ public function smtpGetEmailInfoById($id): ?array * @deprecated * @see ApiClient::get() */ - public function smtpListUnsubscribed(int $limit = null, int $offset = null): ?array + public function smtpListUnsubscribed(?int $limit = null, ?int $offset = null): ?array { $data = array(); if (null !== $limit) { @@ -974,7 +974,7 @@ public function smtpSendMail(array $email): ?array * @deprecated * @see ApiClient::get() */ - public function pushListCampaigns(int $limit = null, int $offset = null): ?array + public function pushListCampaigns(?int $limit = null, ?int $offset = null): ?array { $data = []; if (null !== $limit) { @@ -997,7 +997,7 @@ public function pushListCampaigns(int $limit = null, int $offset = null): ?array * @deprecated * @see ApiClient::get() */ - public function pushListWebsites(int $limit = null, int $offset = null): ?array + public function pushListWebsites(?int $limit = null, ?int $offset = null): ?array { $data = array(); if (null !== $limit) { @@ -1048,7 +1048,7 @@ public function pushListWebsiteVariables(int $websiteId): ?array * @deprecated * @see ApiClient::get() */ - public function pushListWebsiteSubscriptions(int $websiteID, int $limit = null, int $offset = null): ?array + public function pushListWebsiteSubscriptions(int $websiteID, ?int $limit = null, ?int $offset = null): ?array { $data = []; if (null !== $limit) {