From 23469da106cc04ceee08c744c7555c1a6da92b3b Mon Sep 17 00:00:00 2001 From: Maciej Lew Date: Tue, 1 Jul 2025 12:14:15 +0000 Subject: [PATCH 1/5] Run tests against PHP 8.4 --- .github/workflows/tests.yml | 1 + build/Makefile | 3 +++ build/docker-compose.yml | 7 +++++++ build/php-8.4/Dockerfile | 18 ++++++++++++++++++ build/php-8.4/Makefile | 10 ++++++++++ 5 files changed, 39 insertions(+) create mode 100644 build/php-8.4/Dockerfile create mode 100644 build/php-8.4/Makefile diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index ab815b5..e1fed77 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -23,6 +23,7 @@ jobs: - 8.1 - 8.2 - 8.3 + - 8.4 steps: - name: Checkout uses: actions/checkout@v3 diff --git a/build/Makefile b/build/Makefile index 21b9005..9c90389 100644 --- a/build/Makefile +++ b/build/Makefile @@ -9,6 +9,7 @@ include $(CURDIR)/php-8.0/Makefile include $(CURDIR)/php-8.1/Makefile include $(CURDIR)/php-8.2/Makefile include $(CURDIR)/php-8.3/Makefile +include $(CURDIR)/php-8.4/Makefile help: @grep -hE '^[a-zA-Z0-9_.-]+:.*?## .*$$' $(MAKEFILE_LIST) \ @@ -28,6 +29,7 @@ test: ## test all against all php images $(MAKE) test-php-8.1 $(MAKE) test-php-8.2 $(MAKE) test-php-8.3 + $(MAKE) test-php-8.4 test-unit: ## test unit suite against all php images $(MAKE) test-suite-php-7.0 SUITE=unit @@ -39,5 +41,6 @@ test-unit: ## test unit suite against all php images $(MAKE) test-suite-php-8.1 SUITE=unit $(MAKE) test-suite-php-8.2 SUITE=unit $(MAKE) test-suite-php-8.3 SUITE=unit + $(MAKE) test-suite-php-8.4 SUITE=unit .DEFAULT_GOAL := help diff --git a/build/docker-compose.yml b/build/docker-compose.yml index af9fe64..d3205f2 100644 --- a/build/docker-compose.yml +++ b/build/docker-compose.yml @@ -63,4 +63,11 @@ services: context: php-8.3 volumes: - ..:/app + network_mode: host + + php-8.4: + build: + context: php-8.4 + volumes: + - ..:/app network_mode: host \ No newline at end of file diff --git a/build/php-8.4/Dockerfile b/build/php-8.4/Dockerfile new file mode 100644 index 0000000..30effb1 --- /dev/null +++ b/build/php-8.4/Dockerfile @@ -0,0 +1,18 @@ +FROM composer:latest AS composer +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 + +COPY --from=composer /usr/bin/composer /usr/bin/composer + +WORKDIR /app/ \ No newline at end of file diff --git a/build/php-8.4/Makefile b/build/php-8.4/Makefile new file mode 100644 index 0000000..326100b --- /dev/null +++ b/build/php-8.4/Makefile @@ -0,0 +1,10 @@ +.PHONY: prepare-php-8.4 test-php-8.4 test-suite-php-8.4 + +prepare-php-8.4: ## load dependencies with php 8.4 + docker-compose run -T php-8.4 /usr/bin/composer update --ignore-platform-req=PHP + +test-php-8.4: prepare-php-8.4 ## run tests against php 8.4 + docker-compose run -T php-8.4 php vendor/bin/phpunit --configuration tests-resources/phpunit.xml + +test-suite-php-8.4: prepare-php-8.4 ## run suite tests against php 8.4, ex: make test-suite-php-8.4 SUITE="unit" + docker-compose run -T php-8.4 php vendor/bin/phpunit --configuration tests-resources/phpunit.xml --testsuite $(SUITE) \ No newline at end of file From 2f021ba2a0a3bb4329f80f1b4305ad81d4931992 Mon Sep 17 00:00:00 2001 From: Maciej Lew Date: Tue, 1 Jul 2025 12:29:44 +0000 Subject: [PATCH 2/5] Run test workflow on pull request to master branch --- .github/workflows/tests.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index e1fed77..8abd84f 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -6,6 +6,9 @@ on: - main - master pull_request: + branches: + - main + - master jobs: tests: From 22e79d6ff72447ab20167cb81c4596c23594e07d Mon Sep 17 00:00:00 2001 From: Maciej Lew Date: Tue, 1 Jul 2025 13:21:08 +0000 Subject: [PATCH 3/5] Mark methods that are to be changed in next major release. Implicitly marking parameter as nullable is deprecated since PHP 8.4. --- src/Feature/Contacts/ContactsFeature.php | 1 + src/Feature/Contacts/ContactsHttpFeature.php | 3 +++ src/Feature/Sms/Bag/ScheduleSmsBag.php | 3 +++ src/Feature/Sms/Bag/ScheduleSmsToGroupBag.php | 3 +++ src/Feature/Sms/Bag/ScheduleSmssBag.php | 3 +++ src/Feature/Sms/Bag/SendSmsBag.php | 3 +++ src/Feature/Sms/Bag/SendSmsToGroupBag.php | 3 +++ src/Feature/Sms/Bag/SendSmssBag.php | 3 +++ 8 files changed, 22 insertions(+) diff --git a/src/Feature/Contacts/ContactsFeature.php b/src/Feature/Contacts/ContactsFeature.php index a1f2bfd..ed17b33 100644 --- a/src/Feature/Contacts/ContactsFeature.php +++ b/src/Feature/Contacts/ContactsFeature.php @@ -19,6 +19,7 @@ interface ContactsFeature { /** * @return Contact[] + * @todo method signature to be changed in next major release as implicitly marking parameters as nullable is deprecated since PHP 8.4 */ public function findContacts(FindContactsBag $findContactsBag = null): array; diff --git a/src/Feature/Contacts/ContactsHttpFeature.php b/src/Feature/Contacts/ContactsHttpFeature.php index 7d2f38c..86360bb 100644 --- a/src/Feature/Contacts/ContactsHttpFeature.php +++ b/src/Feature/Contacts/ContactsHttpFeature.php @@ -31,6 +31,9 @@ public function __construct(RestRequestExecutor $restRequestExecutor, DataFactor $this->dataFactoryProvider = $dataFactoryProvider; } + /** + * @todo method signature to be changed in next major release as implicitly marking parameters as nullable is deprecated since PHP 8.4 + */ public function findContacts(FindContactsBag $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 69257d4..3512917 100644 --- a/src/Feature/Sms/Bag/ScheduleSmsBag.php +++ b/src/Feature/Sms/Bag/ScheduleSmsBag.php @@ -67,6 +67,9 @@ public function setParams(array $params): self return $this; } + /** + * @todo method signature to be changed in next major release as implicitly marking parameters as nullable is deprecated since PHP 8.4 + */ public function setExternalId(string $idx, bool $checkIdx = null): self { $this->idx = [$idx]; diff --git a/src/Feature/Sms/Bag/ScheduleSmsToGroupBag.php b/src/Feature/Sms/Bag/ScheduleSmsToGroupBag.php index 3412f21..536ec8a 100644 --- a/src/Feature/Sms/Bag/ScheduleSmsToGroupBag.php +++ b/src/Feature/Sms/Bag/ScheduleSmsToGroupBag.php @@ -55,6 +55,9 @@ public static function withTemplateName(DateTimeInterface $scheduleAt, string $g return $bag; } + /** + * @todo method signature to be changed in next major release as implicitly marking parameters as nullable is deprecated since PHP 8.4 + */ public function setExternalId(string $idx, bool $checkIdx = null): self { $this->idx = [$idx]; diff --git a/src/Feature/Sms/Bag/ScheduleSmssBag.php b/src/Feature/Sms/Bag/ScheduleSmssBag.php index 3a1220d..d274e49 100644 --- a/src/Feature/Sms/Bag/ScheduleSmssBag.php +++ b/src/Feature/Sms/Bag/ScheduleSmssBag.php @@ -68,6 +68,9 @@ public function setParams(array $params): self return $this; } + /** + * @todo method signature to be changed in next major release as implicitly marking parameters as nullable is deprecated since PHP 8.4 + */ public function setExternalId(array $idx, bool $checkIdx = null): self { $this->idx = $idx; diff --git a/src/Feature/Sms/Bag/SendSmsBag.php b/src/Feature/Sms/Bag/SendSmsBag.php index 1391c37..eb4cef2 100644 --- a/src/Feature/Sms/Bag/SendSmsBag.php +++ b/src/Feature/Sms/Bag/SendSmsBag.php @@ -62,6 +62,9 @@ public function setParams(array $params): self return $this; } + /** + * @todo method signature to be changed in next major release as implicitly marking parameters as nullable is deprecated since PHP 8.4 + */ public function setExternalId(string $idx, bool $checkIdx = null): self { $this->idx = [$idx]; diff --git a/src/Feature/Sms/Bag/SendSmsToGroupBag.php b/src/Feature/Sms/Bag/SendSmsToGroupBag.php index 98b944e..b41768d 100644 --- a/src/Feature/Sms/Bag/SendSmsToGroupBag.php +++ b/src/Feature/Sms/Bag/SendSmsToGroupBag.php @@ -48,6 +48,9 @@ public static function withTemplateName(string $group, string $templateName): se return $bag; } + /** + * @todo method signature to be changed in next major release as implicitly marking parameters as nullable is deprecated since PHP 8.4 + */ public function setExternalId(string $idx, bool $checkIdx = null): self { $this->idx = [$idx]; diff --git a/src/Feature/Sms/Bag/SendSmssBag.php b/src/Feature/Sms/Bag/SendSmssBag.php index 383d6c0..d3cb370 100644 --- a/src/Feature/Sms/Bag/SendSmssBag.php +++ b/src/Feature/Sms/Bag/SendSmssBag.php @@ -63,6 +63,9 @@ public function setParams(array $params): self return $this; } + /** + * @todo method signature to be changed in next major release as implicitly marking parameters as nullable is deprecated since PHP 8.4 + */ public function setExternalId(array $idx, bool $checkIdx = null): self { $this->idx = $idx; From 7d1510fe2bc004cea12c8756fd6c3da42a843f90 Mon Sep 17 00:00:00 2001 From: Maciej Lew Date: Tue, 1 Jul 2025 13:24:08 +0000 Subject: [PATCH 4/5] Fix typo --- src/Feature/Contacts/ContactsFeature.php | 2 +- src/Feature/Contacts/ContactsHttpFeature.php | 2 +- src/Feature/Sms/Bag/ScheduleSmsBag.php | 2 +- src/Feature/Sms/Bag/ScheduleSmsToGroupBag.php | 2 +- src/Feature/Sms/Bag/ScheduleSmssBag.php | 2 +- src/Feature/Sms/Bag/SendSmsBag.php | 2 +- src/Feature/Sms/Bag/SendSmsToGroupBag.php | 2 +- src/Feature/Sms/Bag/SendSmssBag.php | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/Feature/Contacts/ContactsFeature.php b/src/Feature/Contacts/ContactsFeature.php index ed17b33..df9de39 100644 --- a/src/Feature/Contacts/ContactsFeature.php +++ b/src/Feature/Contacts/ContactsFeature.php @@ -19,7 +19,7 @@ interface ContactsFeature { /** * @return Contact[] - * @todo method signature to be changed in next major release as implicitly marking parameters as nullable is deprecated since PHP 8.4 + * @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; diff --git a/src/Feature/Contacts/ContactsHttpFeature.php b/src/Feature/Contacts/ContactsHttpFeature.php index 86360bb..7c73a56 100644 --- a/src/Feature/Contacts/ContactsHttpFeature.php +++ b/src/Feature/Contacts/ContactsHttpFeature.php @@ -32,7 +32,7 @@ public function __construct(RestRequestExecutor $restRequestExecutor, DataFactor } /** - * @todo method signature to be changed in next major release as implicitly marking parameters as nullable is deprecated since PHP 8.4 + * @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 { diff --git a/src/Feature/Sms/Bag/ScheduleSmsBag.php b/src/Feature/Sms/Bag/ScheduleSmsBag.php index 3512917..2ce4b52 100644 --- a/src/Feature/Sms/Bag/ScheduleSmsBag.php +++ b/src/Feature/Sms/Bag/ScheduleSmsBag.php @@ -68,7 +68,7 @@ public function setParams(array $params): self } /** - * @todo method signature to be changed in next major release as implicitly marking parameters as nullable is deprecated since PHP 8.4 + * @todo method signature to be changed in next major release as implicitly marking parameter as nullable is deprecated since PHP 8.4 */ public function setExternalId(string $idx, bool $checkIdx = null): self { diff --git a/src/Feature/Sms/Bag/ScheduleSmsToGroupBag.php b/src/Feature/Sms/Bag/ScheduleSmsToGroupBag.php index 536ec8a..0981fd2 100644 --- a/src/Feature/Sms/Bag/ScheduleSmsToGroupBag.php +++ b/src/Feature/Sms/Bag/ScheduleSmsToGroupBag.php @@ -56,7 +56,7 @@ public static function withTemplateName(DateTimeInterface $scheduleAt, string $g } /** - * @todo method signature to be changed in next major release as implicitly marking parameters as nullable is deprecated since PHP 8.4 + * @todo method signature to be changed in next major release as implicitly marking parameter as nullable is deprecated since PHP 8.4 */ public function setExternalId(string $idx, bool $checkIdx = null): self { diff --git a/src/Feature/Sms/Bag/ScheduleSmssBag.php b/src/Feature/Sms/Bag/ScheduleSmssBag.php index d274e49..b214567 100644 --- a/src/Feature/Sms/Bag/ScheduleSmssBag.php +++ b/src/Feature/Sms/Bag/ScheduleSmssBag.php @@ -69,7 +69,7 @@ public function setParams(array $params): self } /** - * @todo method signature to be changed in next major release as implicitly marking parameters as nullable is deprecated since PHP 8.4 + * @todo method signature to be changed in next major release as implicitly marking parameter as nullable is deprecated since PHP 8.4 */ public function setExternalId(array $idx, bool $checkIdx = null): self { diff --git a/src/Feature/Sms/Bag/SendSmsBag.php b/src/Feature/Sms/Bag/SendSmsBag.php index eb4cef2..9ac48b5 100644 --- a/src/Feature/Sms/Bag/SendSmsBag.php +++ b/src/Feature/Sms/Bag/SendSmsBag.php @@ -63,7 +63,7 @@ public function setParams(array $params): self } /** - * @todo method signature to be changed in next major release as implicitly marking parameters as nullable is deprecated since PHP 8.4 + * @todo method signature to be changed in next major release as implicitly marking parameter as nullable is deprecated since PHP 8.4 */ public function setExternalId(string $idx, bool $checkIdx = null): self { diff --git a/src/Feature/Sms/Bag/SendSmsToGroupBag.php b/src/Feature/Sms/Bag/SendSmsToGroupBag.php index b41768d..a6da846 100644 --- a/src/Feature/Sms/Bag/SendSmsToGroupBag.php +++ b/src/Feature/Sms/Bag/SendSmsToGroupBag.php @@ -49,7 +49,7 @@ public static function withTemplateName(string $group, string $templateName): se } /** - * @todo method signature to be changed in next major release as implicitly marking parameters as nullable is deprecated since PHP 8.4 + * @todo method signature to be changed in next major release as implicitly marking parameter as nullable is deprecated since PHP 8.4 */ public function setExternalId(string $idx, bool $checkIdx = null): self { diff --git a/src/Feature/Sms/Bag/SendSmssBag.php b/src/Feature/Sms/Bag/SendSmssBag.php index d3cb370..279bc53 100644 --- a/src/Feature/Sms/Bag/SendSmssBag.php +++ b/src/Feature/Sms/Bag/SendSmssBag.php @@ -64,7 +64,7 @@ public function setParams(array $params): self } /** - * @todo method signature to be changed in next major release as implicitly marking parameters as nullable is deprecated since PHP 8.4 + * @todo method signature to be changed in next major release as implicitly marking parameter as nullable is deprecated since PHP 8.4 */ public function setExternalId(array $idx, bool $checkIdx = null): self { From e551d3af414a0f8c4f6deb22d9bba39937b8e8b3 Mon Sep 17 00:00:00 2001 From: Maciej Lew Date: Tue, 1 Jul 2025 14:06:53 +0000 Subject: [PATCH 5/5] Add PHP 8.4 support. --- CHANGELOG.md | 4 ++++ build/php-8.3/Makefile | 2 +- build/php-8.4/Makefile | 2 +- composer.json | 2 +- src/SmsapiClient.php | 2 +- 5 files changed, 8 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0e0c6f8..4231563 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,10 @@ 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] +### Added +- PHP-8.4 support + ## [3.0.11] - 2024-03-27 ### Added - service url scheme and host validation diff --git a/build/php-8.3/Makefile b/build/php-8.3/Makefile index edb5c99..3b913f1 100644 --- a/build/php-8.3/Makefile +++ b/build/php-8.3/Makefile @@ -1,7 +1,7 @@ .PHONY: prepare-php-8.3 test-php-8.3 test-suite-php-8.3 prepare-php-8.3: ## load dependencies with php 8.3 - docker-compose run -T php-8.3 /usr/bin/composer update --ignore-platform-req=PHP + docker-compose run -T php-8.3 /usr/bin/composer update test-php-8.3: prepare-php-8.3 ## run tests against php 8.3 docker-compose run -T php-8.3 php vendor/bin/phpunit --configuration tests-resources/phpunit.xml diff --git a/build/php-8.4/Makefile b/build/php-8.4/Makefile index 326100b..05d45e3 100644 --- a/build/php-8.4/Makefile +++ b/build/php-8.4/Makefile @@ -1,7 +1,7 @@ .PHONY: prepare-php-8.4 test-php-8.4 test-suite-php-8.4 prepare-php-8.4: ## load dependencies with php 8.4 - docker-compose run -T php-8.4 /usr/bin/composer update --ignore-platform-req=PHP + docker-compose run -T php-8.4 /usr/bin/composer update test-php-8.4: prepare-php-8.4 ## run tests against php 8.4 docker-compose run -T php-8.4 php vendor/bin/phpunit --configuration tests-resources/phpunit.xml diff --git a/composer.json b/composer.json index 31269cb..ee46693 100644 --- a/composer.json +++ b/composer.json @@ -16,7 +16,7 @@ } }, "require": { - "php": "^7 || ~8.0 || ~8.1 || ~8.2 || ~8.3", + "php": "^7 || ~8.0 || ~8.1 || ~8.2 || ~8.3 || ~8.4", "ext-json": "*", "psr/log": "^1 || ^2 || ^3", "psr/http-message": "~1.0 || ~1.1 || ~2.0", diff --git a/src/SmsapiClient.php b/src/SmsapiClient.php index e67e0c2..564843f 100644 --- a/src/SmsapiClient.php +++ b/src/SmsapiClient.php @@ -12,7 +12,7 @@ */ interface SmsapiClient extends LoggerAwareInterface { - const VERSION = '3.0.11'; + const VERSION = 'Unreleased'; public function smsapiPlService(string $apiToken): SmsapiPlService;