From 394f7b14c788ab36a46ea91f656df51ba569f3d0 Mon Sep 17 00:00:00 2001 From: Maciej Lew Date: Fri, 27 Mar 2026 15:00:14 +0100 Subject: [PATCH 1/7] Remove xdebug from test images. Mitigate pecl installation issues. --- build/php-7.1/Dockerfile | 9 +-------- build/php-7.2/Dockerfile | 9 +-------- build/php-7.3/Dockerfile | 9 +-------- build/php-7.4/Dockerfile | 9 +-------- build/php-8.0/Dockerfile | 9 +-------- build/php-8.1/Dockerfile | 9 +-------- build/php-8.2/Dockerfile | 10 +--------- build/php-8.3/Dockerfile | 10 +--------- build/php-8.4/Dockerfile | 10 +--------- 9 files changed, 9 insertions(+), 75 deletions(-) diff --git a/build/php-7.1/Dockerfile b/build/php-7.1/Dockerfile index 690c835..2a0487e 100644 --- a/build/php-7.1/Dockerfile +++ b/build/php-7.1/Dockerfile @@ -3,14 +3,7 @@ FROM php:7.1-cli-alpine RUN apk update && \ apk upgrade && \ - apk add --no-cache \ - autoconf \ - g++ \ - make - -RUN pecl install xdebug-2.9.8 && \ - pecl clear-cache && \ - docker-php-ext-enable xdebug + apk add --no-cache make COPY --from=composer /usr/bin/composer /usr/bin/composer diff --git a/build/php-7.2/Dockerfile b/build/php-7.2/Dockerfile index 0876175..bd7b230 100644 --- a/build/php-7.2/Dockerfile +++ b/build/php-7.2/Dockerfile @@ -3,14 +3,7 @@ FROM php:7.2-cli-alpine RUN apk update && \ apk upgrade && \ - apk add --no-cache \ - autoconf \ - g++ \ - make - -RUN pecl install xdebug-2.9.8 && \ - pecl clear-cache && \ - docker-php-ext-enable xdebug + apk add --no-cache make COPY --from=composer /usr/bin/composer /usr/bin/composer diff --git a/build/php-7.3/Dockerfile b/build/php-7.3/Dockerfile index e2dee2e..28ef4fc 100644 --- a/build/php-7.3/Dockerfile +++ b/build/php-7.3/Dockerfile @@ -3,14 +3,7 @@ FROM php:7.3-cli-alpine RUN apk update && \ apk upgrade && \ - apk add --no-cache \ - autoconf \ - g++ \ - make - -RUN pecl install xdebug-2.9.8 && \ - pecl clear-cache && \ - docker-php-ext-enable xdebug + apk add --no-cache make COPY --from=composer /usr/bin/composer /usr/bin/composer diff --git a/build/php-7.4/Dockerfile b/build/php-7.4/Dockerfile index 24a17d3..d810922 100644 --- a/build/php-7.4/Dockerfile +++ b/build/php-7.4/Dockerfile @@ -3,14 +3,7 @@ FROM php:7.4-cli-alpine RUN apk update && \ apk upgrade && \ - apk add --no-cache \ - autoconf \ - g++ \ - make - -RUN pecl install xdebug-2.9.8 && \ - pecl clear-cache && \ - docker-php-ext-enable xdebug + apk add --no-cache make COPY --from=composer /usr/bin/composer /usr/bin/composer diff --git a/build/php-8.0/Dockerfile b/build/php-8.0/Dockerfile index b75744e..04a6435 100644 --- a/build/php-8.0/Dockerfile +++ b/build/php-8.0/Dockerfile @@ -3,14 +3,7 @@ FROM php:8.0-cli-alpine RUN apk update && \ apk upgrade && \ - apk add --no-cache \ - autoconf \ - g++ \ - make - -RUN pecl install xdebug-3.1.6 && \ - pecl clear-cache && \ - docker-php-ext-enable xdebug + apk add --no-cache make COPY --from=composer /usr/bin/composer /usr/bin/composer diff --git a/build/php-8.1/Dockerfile b/build/php-8.1/Dockerfile index a68b5e2..70aea88 100644 --- a/build/php-8.1/Dockerfile +++ b/build/php-8.1/Dockerfile @@ -3,14 +3,7 @@ FROM php:8.1-cli-alpine RUN apk update && \ apk upgrade && \ - apk add --no-cache \ - autoconf \ - g++ \ - make - -RUN pecl install xdebug-3.1.6 && \ - pecl clear-cache && \ - docker-php-ext-enable xdebug + apk add --no-cache make COPY --from=composer /usr/bin/composer /usr/bin/composer diff --git a/build/php-8.2/Dockerfile b/build/php-8.2/Dockerfile index 9092d51..677d0ad 100644 --- a/build/php-8.2/Dockerfile +++ b/build/php-8.2/Dockerfile @@ -3,15 +3,7 @@ FROM php:8.2-cli-alpine RUN apk update && \ apk upgrade && \ - apk add --no-cache \ - autoconf \ - g++ \ - make \ - linux-headers - -RUN pecl install xdebug-3.2.2 && \ - pecl clear-cache && \ - docker-php-ext-enable xdebug + apk add --no-cache make COPY --from=composer /usr/bin/composer /usr/bin/composer diff --git a/build/php-8.3/Dockerfile b/build/php-8.3/Dockerfile index 97fdde4..94ac096 100644 --- a/build/php-8.3/Dockerfile +++ b/build/php-8.3/Dockerfile @@ -3,15 +3,7 @@ FROM php:8.3-cli-alpine RUN apk update && \ apk upgrade && \ - apk add --no-cache \ - autoconf \ - g++ \ - make \ - linux-headers - -RUN pecl install xdebug-3.3.1 && \ - pecl clear-cache && \ - docker-php-ext-enable xdebug + apk add --no-cache make COPY --from=composer /usr/bin/composer /usr/bin/composer diff --git a/build/php-8.4/Dockerfile b/build/php-8.4/Dockerfile index 30effb1..ba691e0 100644 --- a/build/php-8.4/Dockerfile +++ b/build/php-8.4/Dockerfile @@ -3,15 +3,7 @@ FROM php:8.4-cli-alpine RUN apk update && \ apk upgrade && \ - apk add --no-cache \ - autoconf \ - g++ \ - make \ - linux-headers - -RUN pecl install xdebug-3.4.4 && \ - pecl clear-cache && \ - docker-php-ext-enable xdebug + apk add --no-cache make COPY --from=composer /usr/bin/composer /usr/bin/composer From 740353da4bd89d26adeaca0e7621d688bec073b5 Mon Sep 17 00:00:00 2001 From: Maciej Lew Date: Fri, 27 Mar 2026 15:03:32 +0100 Subject: [PATCH 2/7] Switch to non-blocking dependencies audit. --- .github/workflows/tests.yml | 3 +++ composer.json | 3 +-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 1657a68..9385edd 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -49,5 +49,8 @@ jobs: - name: Install dependencies run: composer update --prefer-dist --no-interaction + - name: Audit dependencies + run: composer audit || true + - name: Running unit tests run: php vendor/bin/phpunit --configuration tests-resources/phpunit.dist.xml --testsuite unit diff --git a/composer.json b/composer.json index dd8d42e..8c5dad5 100644 --- a/composer.json +++ b/composer.json @@ -32,8 +32,7 @@ "phpdocumentor/reflection-docblock": "^4.3 || ^5.2.0", "phpdocumentor/type-resolver": "^0.5 || ^1.3.0", "guzzlehttp/psr7": "^1 || ^2", - "ext-curl": "*", - "roave/security-advisories": "dev-latest" + "ext-curl": "*" }, "suggest": { "ext-curl": "To use Curl HttpClient", From 586a8f3630749a68b3d58ba05c9f55a96343ebd0 Mon Sep 17 00:00:00 2001 From: aaapl Date: Wed, 18 Mar 2026 21:21:33 +0100 Subject: [PATCH 3/7] fix: remove implicit nullable types for PHP 8.4 compatibility Replace `bool $param = null` with `$param = null` (untyped) to avoid E_DEPRECATED in PHP 8.4 while maintaining backward compatibility with PHP 7.0+ as declared in composer.json. Type information preserved in @param docblocks for IDE/static analysis. --- src/Feature/Contacts/ContactsFeature.php | 4 ++-- src/Feature/Contacts/ContactsHttpFeature.php | 4 ++-- src/Feature/Sms/Bag/ScheduleSmsBag.php | 9 ++++++--- src/Feature/Sms/Bag/ScheduleSmsToGroupBag.php | 9 ++++++--- src/Feature/Sms/Bag/ScheduleSmssBag.php | 4 ++-- src/Feature/Sms/Bag/SendSmsBag.php | 4 ++-- src/Feature/Sms/Bag/SendSmsToGroupBag.php | 9 ++++++--- src/Feature/Sms/Bag/SendSmssBag.php | 4 ++-- 8 files changed, 28 insertions(+), 19 deletions(-) diff --git a/src/Feature/Contacts/ContactsFeature.php b/src/Feature/Contacts/ContactsFeature.php index df9de39..b15d7bf 100644 --- a/src/Feature/Contacts/ContactsFeature.php +++ b/src/Feature/Contacts/ContactsFeature.php @@ -18,10 +18,10 @@ interface ContactsFeature { /** + * @param FindContactsBag|null $findContactsBag * @return Contact[] - * @todo method signature to be changed in next major release as implicitly marking parameter as nullable is deprecated since PHP 8.4 */ - public function findContacts(FindContactsBag $findContactsBag = null): array; + public function findContacts($findContactsBag = null): array; public function findContact(FindContactBag $findContactBag): Contact; diff --git a/src/Feature/Contacts/ContactsHttpFeature.php b/src/Feature/Contacts/ContactsHttpFeature.php index 7c73a56..4f58f9d 100644 --- a/src/Feature/Contacts/ContactsHttpFeature.php +++ b/src/Feature/Contacts/ContactsHttpFeature.php @@ -32,9 +32,9 @@ public function __construct(RestRequestExecutor $restRequestExecutor, DataFactor } /** - * @todo method signature to be changed in next major release as implicitly marking parameter as nullable is deprecated since PHP 8.4 + * @param FindContactsBag|null $findContactsBag */ - public function findContacts(FindContactsBag $findContactsBag = null): array + public function findContacts($findContactsBag = null): array { $result = $this->restRequestExecutor->read('contacts', (array)$findContactsBag); diff --git a/src/Feature/Sms/Bag/ScheduleSmsBag.php b/src/Feature/Sms/Bag/ScheduleSmsBag.php index 2ce4b52..28a1576 100644 --- a/src/Feature/Sms/Bag/ScheduleSmsBag.php +++ b/src/Feature/Sms/Bag/ScheduleSmsBag.php @@ -68,9 +68,9 @@ public function setParams(array $params): self } /** - * @todo method signature to be changed in next major release as implicitly marking parameter as nullable is deprecated since PHP 8.4 + * @param bool|null $checkIdx */ - public function setExternalId(string $idx, bool $checkIdx = null): self + public function setExternalId(string $idx, $checkIdx = null): self { $this->idx = [$idx]; $this->checkIdx = $checkIdx; @@ -82,7 +82,10 @@ public function setExternalId(string $idx, bool $checkIdx = null): self * @deprecated * @see ScheduleSmsBag::setExternalId() */ - public function setIdx(array $idx, bool $checkIdx = null): self + /** + * @param bool|null $checkIdx + */ + public function setIdx(array $idx, $checkIdx = null): self { $this->idx = $idx; $this->checkIdx = $checkIdx; diff --git a/src/Feature/Sms/Bag/ScheduleSmsToGroupBag.php b/src/Feature/Sms/Bag/ScheduleSmsToGroupBag.php index 0981fd2..d10e61f 100644 --- a/src/Feature/Sms/Bag/ScheduleSmsToGroupBag.php +++ b/src/Feature/Sms/Bag/ScheduleSmsToGroupBag.php @@ -56,9 +56,9 @@ public static function withTemplateName(DateTimeInterface $scheduleAt, string $g } /** - * @todo method signature to be changed in next major release as implicitly marking parameter as nullable is deprecated since PHP 8.4 + * @param bool|null $checkIdx */ - public function setExternalId(string $idx, bool $checkIdx = null): self + public function setExternalId(string $idx, $checkIdx = null): self { $this->idx = [$idx]; $this->checkIdx = $checkIdx; @@ -70,7 +70,10 @@ public function setExternalId(string $idx, bool $checkIdx = null): self * @deprecated * @see ScheduleSmsToGroupBag::setExternalId() */ - public function setIdx(array $idx, bool $checkIdx = null): self + /** + * @param bool|null $checkIdx + */ + public function setIdx(array $idx, $checkIdx = null): self { $this->idx = $idx; $this->checkIdx = $checkIdx; diff --git a/src/Feature/Sms/Bag/ScheduleSmssBag.php b/src/Feature/Sms/Bag/ScheduleSmssBag.php index b214567..82330ec 100644 --- a/src/Feature/Sms/Bag/ScheduleSmssBag.php +++ b/src/Feature/Sms/Bag/ScheduleSmssBag.php @@ -69,9 +69,9 @@ public function setParams(array $params): self } /** - * @todo method signature to be changed in next major release as implicitly marking parameter as nullable is deprecated since PHP 8.4 + * @param bool|null $checkIdx */ - public function setExternalId(array $idx, bool $checkIdx = null): self + public function setExternalId(array $idx, $checkIdx = null): self { $this->idx = $idx; $this->checkIdx = $checkIdx; diff --git a/src/Feature/Sms/Bag/SendSmsBag.php b/src/Feature/Sms/Bag/SendSmsBag.php index 9ac48b5..7db1b52 100644 --- a/src/Feature/Sms/Bag/SendSmsBag.php +++ b/src/Feature/Sms/Bag/SendSmsBag.php @@ -63,9 +63,9 @@ public function setParams(array $params): self } /** - * @todo method signature to be changed in next major release as implicitly marking parameter as nullable is deprecated since PHP 8.4 + * @param bool|null $checkIdx */ - public function setExternalId(string $idx, bool $checkIdx = null): self + public function setExternalId(string $idx, $checkIdx = null): self { $this->idx = [$idx]; $this->checkIdx = $checkIdx; diff --git a/src/Feature/Sms/Bag/SendSmsToGroupBag.php b/src/Feature/Sms/Bag/SendSmsToGroupBag.php index a6da846..fadfbc7 100644 --- a/src/Feature/Sms/Bag/SendSmsToGroupBag.php +++ b/src/Feature/Sms/Bag/SendSmsToGroupBag.php @@ -49,9 +49,9 @@ public static function withTemplateName(string $group, string $templateName): se } /** - * @todo method signature to be changed in next major release as implicitly marking parameter as nullable is deprecated since PHP 8.4 + * @param bool|null $checkIdx */ - public function setExternalId(string $idx, bool $checkIdx = null): self + public function setExternalId(string $idx, $checkIdx = null): self { $this->idx = [$idx]; $this->checkIdx = $checkIdx; @@ -63,7 +63,10 @@ public function setExternalId(string $idx, bool $checkIdx = null): self * @deprecated * @see SendSmsToGroupBag::setExternalId() */ - public function setIdx(array $idx, bool $checkIdx = null): self + /** + * @param bool|null $checkIdx + */ + public function setIdx(array $idx, $checkIdx = null): self { $this->idx = $idx; $this->checkIdx = $checkIdx; diff --git a/src/Feature/Sms/Bag/SendSmssBag.php b/src/Feature/Sms/Bag/SendSmssBag.php index 279bc53..ae4b067 100644 --- a/src/Feature/Sms/Bag/SendSmssBag.php +++ b/src/Feature/Sms/Bag/SendSmssBag.php @@ -64,9 +64,9 @@ public function setParams(array $params): self } /** - * @todo method signature to be changed in next major release as implicitly marking parameter as nullable is deprecated since PHP 8.4 + * @param bool|null $checkIdx */ - public function setExternalId(array $idx, bool $checkIdx = null): self + public function setExternalId(array $idx, $checkIdx = null): self { $this->idx = $idx; $this->checkIdx = $checkIdx; From 3710555910ac40d09682033e6ce2566dbdf67bd7 Mon Sep 17 00:00:00 2001 From: Maciej Lew Date: Thu, 9 Apr 2026 11:19:15 +0200 Subject: [PATCH 4/7] Remove deprecated features - request DTOs setters and HTTP client related exceptions. Preparation for next major release. --- CHANGELOG.md | 10 ++++++++++ src/Curl/Exception/ClientException.php | 17 ----------------- src/Curl/Exception/NetworkException.php | 17 ----------------- src/Curl/Exception/RequestException.php | 17 ----------------- src/Feature/Contacts/Bag/CreateContactBag.php | 9 --------- src/Feature/Sms/Bag/ScheduleSmsBag.php | 15 --------------- src/Feature/Sms/Bag/ScheduleSmsToGroupBag.php | 15 --------------- src/Feature/Sms/Bag/SendSmsToGroupBag.php | 15 --------------- src/SmsapiClient.php | 2 +- 9 files changed, 11 insertions(+), 106 deletions(-) delete mode 100644 src/Curl/Exception/ClientException.php delete mode 100644 src/Curl/Exception/NetworkException.php delete mode 100644 src/Curl/Exception/RequestException.php diff --git a/CHANGELOG.md b/CHANGELOG.md index 190eb08..098fa47 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,16 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). +## [Unreleased] +### Removed +- deprecated `\Smsapi\Client\Feature\Contacts\Bag\CreateContactBag::withPhone` +- deprecated `\Smsapi\Client\Feature\Sms\Bag\ScheduleSmsBag::setIdx` +- deprecated `\Smsapi\Client\Feature\Sms\Bag\SendSmsToGroupBag::setIdx` +- deprecated `\Smsapi\Client\Feature\Sms\Bag\ScheduleSmsToGroupBag::setIdx` +- deprecated `\Smsapi\Client\Curl\Exception\RequestException` +- deprecated `\Smsapi\Client\Curl\Exception\NetworkException` +- deprecated `\Smsapi\Client\Curl\Exception\ClientException` + ## [3.0.13] - 2026-01-12 ### Added - PHP-8.5 support diff --git a/src/Curl/Exception/ClientException.php b/src/Curl/Exception/ClientException.php deleted file mode 100644 index 0d2726a..0000000 --- a/src/Curl/Exception/ClientException.php +++ /dev/null @@ -1,17 +0,0 @@ -idx = $idx; - $this->checkIdx = $checkIdx; - - return $this; - } } diff --git a/src/Feature/Sms/Bag/ScheduleSmsToGroupBag.php b/src/Feature/Sms/Bag/ScheduleSmsToGroupBag.php index d10e61f..ec69498 100644 --- a/src/Feature/Sms/Bag/ScheduleSmsToGroupBag.php +++ b/src/Feature/Sms/Bag/ScheduleSmsToGroupBag.php @@ -65,19 +65,4 @@ public function setExternalId(string $idx, $checkIdx = null): self return $this; } - - /** - * @deprecated - * @see ScheduleSmsToGroupBag::setExternalId() - */ - /** - * @param bool|null $checkIdx - */ - public function setIdx(array $idx, $checkIdx = null): self - { - $this->idx = $idx; - $this->checkIdx = $checkIdx; - - return $this; - } } diff --git a/src/Feature/Sms/Bag/SendSmsToGroupBag.php b/src/Feature/Sms/Bag/SendSmsToGroupBag.php index fadfbc7..e89f254 100644 --- a/src/Feature/Sms/Bag/SendSmsToGroupBag.php +++ b/src/Feature/Sms/Bag/SendSmsToGroupBag.php @@ -58,19 +58,4 @@ public function setExternalId(string $idx, $checkIdx = null): self return $this; } - - /** - * @deprecated - * @see SendSmsToGroupBag::setExternalId() - */ - /** - * @param bool|null $checkIdx - */ - public function setIdx(array $idx, $checkIdx = null): self - { - $this->idx = $idx; - $this->checkIdx = $checkIdx; - - return $this; - } } diff --git a/src/SmsapiClient.php b/src/SmsapiClient.php index 1c2bc2b..564843f 100644 --- a/src/SmsapiClient.php +++ b/src/SmsapiClient.php @@ -12,7 +12,7 @@ */ interface SmsapiClient extends LoggerAwareInterface { - const VERSION = '3.0.13'; + const VERSION = 'Unreleased'; public function smsapiPlService(string $apiToken): SmsapiPlService; From 82599bf8dd9c340a9b29c78860f727d7921b3da2 Mon Sep 17 00:00:00 2001 From: Maciej Lew Date: Thu, 9 Apr 2026 11:28:46 +0200 Subject: [PATCH 5/7] Add method signature info to CHANGELOG (#139, #141). --- CHANGELOG.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 098fa47..146538e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,15 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a - deprecated `\Smsapi\Client\Curl\Exception\NetworkException` - deprecated `\Smsapi\Client\Curl\Exception\ClientException` +## Changed +- method signature `\Smsapi\Client\Feature\Contacts\ContactsFeature::findContacts` +- method signature `\Smsapi\Client\Feature\Sms\Bag\ScheduleSmsBag::setExternalId` +- method signature `\Smsapi\Client\Feature\Sms\Bag\ScheduleSmssBag::setExternalId` +- method signature `\Smsapi\Client\Feature\Sms\Bag\ScheduleSmsToGroupBag::setExternalId` +- method signature `\Smsapi\Client\Feature\Sms\Bag\SendSmsBag::setExternalId` +- method signature `\Smsapi\Client\Feature\Sms\Bag\SendSmssBag::setExternalId` +- method signature `\Smsapi\Client\Feature\Sms\Bag\SendSmsToGroupBag::setExternalId` + ## [3.0.13] - 2026-01-12 ### Added - PHP-8.5 support From 1f539225cdbeb71845441d1407d9b210dd9eafe2 Mon Sep 17 00:00:00 2001 From: Maciej Lew Date: Thu, 9 Apr 2026 11:38:39 +0200 Subject: [PATCH 6/7] Release version 4.0.0 --- CHANGELOG.md | 2 +- src/SmsapiClient.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 146538e..0ced20b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,7 +3,7 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). -## [Unreleased] +## [4.0.0] - 2026-04-09 ### Removed - deprecated `\Smsapi\Client\Feature\Contacts\Bag\CreateContactBag::withPhone` - deprecated `\Smsapi\Client\Feature\Sms\Bag\ScheduleSmsBag::setIdx` diff --git a/src/SmsapiClient.php b/src/SmsapiClient.php index 564843f..8ef1412 100644 --- a/src/SmsapiClient.php +++ b/src/SmsapiClient.php @@ -12,7 +12,7 @@ */ interface SmsapiClient extends LoggerAwareInterface { - const VERSION = 'Unreleased'; + const VERSION = '4.0.0'; public function smsapiPlService(string $apiToken): SmsapiPlService; From 5bde9d6332b151abf8282c0488a055331c2ead1d Mon Sep 17 00:00:00 2001 From: Maciej Lew Date: Wed, 20 May 2026 11:43:59 +0200 Subject: [PATCH 7/7] Add explicit read-only permissions to CI workflow to mitigate GITHUB_TOKEN exposure risk identified in CVE-2026-45793. --- .github/workflows/tests.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 9385edd..e5ea526 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -10,6 +10,9 @@ on: - main - master +permissions: + contents: read + jobs: tests: name: PHP ${{ matrix.php }}