Skip to content

Commit ca181ae

Browse files
authored
Merge pull request #135 from maciejlew/php-8.4
PHP 8.4 support
2 parents 8536bbd + e551d3a commit ca181ae

File tree

17 files changed

+71
-3
lines changed

17 files changed

+71
-3
lines changed

.github/workflows/tests.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ on:
66
- main
77
- master
88
pull_request:
9+
branches:
10+
- main
11+
- master
912

1013
jobs:
1114
tests:
@@ -23,6 +26,7 @@ jobs:
2326
- 8.1
2427
- 8.2
2528
- 8.3
29+
- 8.4
2630
steps:
2731
- name: Checkout
2832
uses: actions/checkout@v3

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ All notable changes to this project will be documented in this file.
33

44
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).
55

6+
## [Unreleased]
7+
### Added
8+
- PHP-8.4 support
9+
610
## [3.0.11] - 2024-03-27
711
### Added
812
- service url scheme and host validation

build/Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ include $(CURDIR)/php-8.0/Makefile
99
include $(CURDIR)/php-8.1/Makefile
1010
include $(CURDIR)/php-8.2/Makefile
1111
include $(CURDIR)/php-8.3/Makefile
12+
include $(CURDIR)/php-8.4/Makefile
1213

1314
help:
1415
@grep -hE '^[a-zA-Z0-9_.-]+:.*?## .*$$' $(MAKEFILE_LIST) \
@@ -28,6 +29,7 @@ test: ## test all against all php images
2829
$(MAKE) test-php-8.1
2930
$(MAKE) test-php-8.2
3031
$(MAKE) test-php-8.3
32+
$(MAKE) test-php-8.4
3133

3234
test-unit: ## test unit suite against all php images
3335
$(MAKE) test-suite-php-7.0 SUITE=unit
@@ -39,5 +41,6 @@ test-unit: ## test unit suite against all php images
3941
$(MAKE) test-suite-php-8.1 SUITE=unit
4042
$(MAKE) test-suite-php-8.2 SUITE=unit
4143
$(MAKE) test-suite-php-8.3 SUITE=unit
44+
$(MAKE) test-suite-php-8.4 SUITE=unit
4245

4346
.DEFAULT_GOAL := help

build/docker-compose.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,4 +63,11 @@ services:
6363
context: php-8.3
6464
volumes:
6565
- ..:/app
66+
network_mode: host
67+
68+
php-8.4:
69+
build:
70+
context: php-8.4
71+
volumes:
72+
- ..:/app
6673
network_mode: host

build/php-8.3/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
.PHONY: prepare-php-8.3 test-php-8.3 test-suite-php-8.3
22

33
prepare-php-8.3: ## load dependencies with php 8.3
4-
docker-compose run -T php-8.3 /usr/bin/composer update --ignore-platform-req=PHP
4+
docker-compose run -T php-8.3 /usr/bin/composer update
55

66
test-php-8.3: prepare-php-8.3 ## run tests against php 8.3
77
docker-compose run -T php-8.3 php vendor/bin/phpunit --configuration tests-resources/phpunit.xml

build/php-8.4/Dockerfile

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
FROM composer:latest AS composer
2+
FROM php:8.4-cli-alpine
3+
4+
RUN apk update && \
5+
apk upgrade && \
6+
apk add --no-cache \
7+
autoconf \
8+
g++ \
9+
make \
10+
linux-headers
11+
12+
RUN pecl install xdebug-3.4.4 && \
13+
pecl clear-cache && \
14+
docker-php-ext-enable xdebug
15+
16+
COPY --from=composer /usr/bin/composer /usr/bin/composer
17+
18+
WORKDIR /app/

build/php-8.4/Makefile

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
.PHONY: prepare-php-8.4 test-php-8.4 test-suite-php-8.4
2+
3+
prepare-php-8.4: ## load dependencies with php 8.4
4+
docker-compose run -T php-8.4 /usr/bin/composer update
5+
6+
test-php-8.4: prepare-php-8.4 ## run tests against php 8.4
7+
docker-compose run -T php-8.4 php vendor/bin/phpunit --configuration tests-resources/phpunit.xml
8+
9+
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"
10+
docker-compose run -T php-8.4 php vendor/bin/phpunit --configuration tests-resources/phpunit.xml --testsuite $(SUITE)

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
}
1717
},
1818
"require": {
19-
"php": "^7 || ~8.0 || ~8.1 || ~8.2 || ~8.3",
19+
"php": "^7 || ~8.0 || ~8.1 || ~8.2 || ~8.3 || ~8.4",
2020
"ext-json": "*",
2121
"psr/log": "^1 || ^2 || ^3",
2222
"psr/http-message": "~1.0 || ~1.1 || ~2.0",

src/Feature/Contacts/ContactsFeature.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ interface ContactsFeature
1919
{
2020
/**
2121
* @return Contact[]
22+
* @todo method signature to be changed in next major release as implicitly marking parameter as nullable is deprecated since PHP 8.4
2223
*/
2324
public function findContacts(FindContactsBag $findContactsBag = null): array;
2425

src/Feature/Contacts/ContactsHttpFeature.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ public function __construct(RestRequestExecutor $restRequestExecutor, DataFactor
3131
$this->dataFactoryProvider = $dataFactoryProvider;
3232
}
3333

34+
/**
35+
* @todo method signature to be changed in next major release as implicitly marking parameter as nullable is deprecated since PHP 8.4
36+
*/
3437
public function findContacts(FindContactsBag $findContactsBag = null): array
3538
{
3639
$result = $this->restRequestExecutor->read('contacts', (array)$findContactsBag);

0 commit comments

Comments
 (0)