Skip to content

Commit e173b71

Browse files
authored
Merge pull request #77 from reactphp-parallel/3.x-PHP-8.4PLUS
[3.x] Update to PHP 8.4+
2 parents 63b1fdc + 6c9561b commit e173b71

File tree

9 files changed

+1180
-1594
lines changed

9 files changed

+1180
-1594
lines changed

Makefile

Lines changed: 21 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,16 @@ SHELL=bash
33

44
.PHONY: *
55

6-
COMPOSER_SHOW_EXTENSION_LIST_PROD=$(shell composer show -t | grep -o "\-\-\(ext-\).\+" | sort | uniq | cut -d- -f4- | tr -d '\n' | grep . | sed '/^$$/d' | xargs | sed -e 's/ /, /g' | tr -cd '[:alnum:],' | sed 's/.$$//')
7-
COMPOSER_SHOW_EXTENSION_LIST_DEV=$(shell composer show -s | grep -o "\(ext-\).\+" | sort | uniq | cut -d- -f2- | cut -d" " -f1 | xargs | sed -e 's/ /, /g' | tr -cd '[:alnum:],')
6+
CONTAINER_REGISTRY_REPO="ghcr.io/wyrihaximusnet/php"
7+
COMPOSER_SHOW_EXTENSION_LIST_PROD=$(shell ((command -v docker >/dev/null 2>&1) && docker run --rm -v "`pwd`:`pwd`" -w `pwd` ${CONTAINER_REGISTRY_REPO}:8.4-nts-alpine-slim-dev composer show -t) | grep -o "\-\-\(ext-\).\+" | sort | uniq | cut -d- -f4- | tr -d '\n' | grep . | sed '/^$$/d' | xargs | sed -e 's/ /, /g' | tr -cd '[:alnum:],' | sed 's/.$$//')
8+
COMPOSER_SHOW_EXTENSION_LIST_DEV=$(shell ((command -v docker >/dev/null 2>&1) && docker run --rm -v "`pwd`:`pwd`" -w `pwd` ${CONTAINER_REGISTRY_REPO}:8.4-nts-alpine-slim-dev composer show -s) | grep -o "\(ext-\).\+" | sort | uniq | cut -d- -f2- | cut -d" " -f1 | xargs | sed -e 's/ /, /g' | tr -cd '[:alnum:],')
89
COMPOSER_SHOW_EXTENSION_LIST=$(shell echo "${COMPOSER_SHOW_EXTENSION_LIST_PROD},${COMPOSER_SHOW_EXTENSION_LIST_DEV}")
910
SLIM_DOCKER_IMAGE=$(shell php -r 'echo count(array_intersect(["gd", "vips"], explode(",", "${COMPOSER_SHOW_EXTENSION_LIST}"))) > 0 ? "" : "-slim";')
1011
NTS_OR_ZTS_DOCKER_IMAGE=$(shell php -r 'echo count(array_intersect(["parallel"], explode(",", "${COMPOSER_SHOW_EXTENSION_LIST}"))) > 0 ? "zts" : "nts";')
11-
PHP_VERSION:=$(shell docker run --rm -v "`pwd`:`pwd`" jess/jq jq -r -c '.config.platform.php' "`pwd`/composer.json" | php -r "echo str_replace('|', '.', explode('.', implode('|', explode('.', stream_get_contents(STDIN), 2)), 2)[0]);")
12-
CONTAINER_NAME=$(shell echo "ghcr.io/wyrihaximusnet/php:${PHP_VERSION}-${NTS_OR_ZTS_DOCKER_IMAGE}-alpine${SLIM_DOCKER_IMAGE}-dev")
13-
COMPOSER_CACHE_DIR=$(shell composer config --global cache-dir -q || echo ${HOME}/.composer-php/cache)
14-
COMPOSER_CONTAINER_CACHE_DIR=$(shell docker run --rm -it ${CONTAINER_NAME} composer config --global cache-dir -q || echo ${HOME}/.composer-php/cache)
12+
PHP_VERSION:=$(shell (((command -v docker >/dev/null 2>&1) && docker run --rm -v "`pwd`:`pwd`" ${CONTAINER_REGISTRY_REPO}:8.4-nts-alpine-slim php -r "echo json_decode(file_get_contents('`pwd`/composer.json'), true)['config']['platform']['php'];") || echo "8.3") | php -r "echo str_replace('|', '.', explode('.', implode('|', explode('.', stream_get_contents(STDIN), 2)), 2)[0]);")
13+
CONTAINER_NAME=$(shell echo "${CONTAINER_REGISTRY_REPO}:${PHP_VERSION}-${NTS_OR_ZTS_DOCKER_IMAGE}-alpine${SLIM_DOCKER_IMAGE}-dev")
14+
COMPOSER_CACHE_DIR=$(shell (command -v docker >/dev/null 2>&1) && docker run --rm -v "`pwd`:`pwd`" -w `pwd` ${CONTAINER_REGISTRY_REPO}:8.4-nts-alpine-slim-dev composer config --global cache-dir -q || echo ${HOME}/.composer-php/cache)
15+
COMPOSER_CONTAINER_CACHE_DIR=$(shell ((command -v docker >/dev/null 2>&1) && docker run --rm -it ${CONTAINER_NAME} composer config --global cache-dir -q) || echo ${HOME}/.composer-php/cache)
1516

1617
ifneq ("$(wildcard /.you-are-in-a-wyrihaximus.net-php-docker-image)","")
1718
IN_DOCKER=TRUE
@@ -26,6 +27,7 @@ else
2627
-v "`pwd`:`pwd`" \
2728
-v "${COMPOSER_CACHE_DIR}:${COMPOSER_CONTAINER_CACHE_DIR}" \
2829
-w "`pwd`" \
30+
-e OTEL_PHP_FIBERS_ENABLED="true" \
2931
"${CONTAINER_NAME}"
3032
endif
3133

@@ -36,30 +38,35 @@ else
3638
endif
3739

3840
all: ## Runs everything ####
39-
@grep -E '^[a-zA-Z0-9_-]+:.*?## .*$$' $(MAKEFILE_LIST) | grep -v "####" | awk 'BEGIN {FS = ":.*?## "}; {printf "%s\n", $$1}' | xargs --open-tty $(MAKE)
41+
@grep -E '^[a-zA-Z0-9_-]+:.*?## .*$$' $(MAKEFILE_LIST) | grep -v "####" | awk 'BEGIN {FS = ":.*?## "}; {printf "%s\n", $$1}' | xargs -o $(MAKE)
4042

41-
syntax-php: ## Lint PHP syntax ##*LH*##
43+
on-install-or-update: ## Runs everything ####
44+
@grep -E '^[a-zA-Z0-9_-]+:.*?## .*$$' $(MAKEFILE_LIST) | grep -E "##\*(I|ILH)\*##" | awk 'BEGIN {FS = ":.*?## "}; {printf "%s\n", $$1}' | xargs -o $(MAKE)
45+
46+
syntax-php: ## Lint PHP syntax ##*ILH*##
4247
$(DOCKER_RUN) vendor/bin/parallel-lint --exclude vendor .
4348

44-
rector-upgrade: ## Upgrade any automatically upgradable old code ###
49+
composer-normalize: ### Normalize composer.json ##*I*##
50+
$(DOCKER_RUN) composer normalize
51+
$(DOCKER_RUN) composer update --lock --no-scripts
52+
53+
rector-upgrade: ## Upgrade any automatically upgradable old code ##*I*##
4554
$(DOCKER_RUN) vendor/bin/rector -c ./etc/qa/rector.php
4655

47-
cs-fix: ## Fix any automatically fixable code style issues ###
48-
$(DOCKER_RUN) vendor/bin/phpcbf --parallel=$(THREADS) --cache=./var/.phpcs.cache.json --standard=./etc/qa/phpcs.xml || $(DOCKER_RUN) vendor/bin/phpcbf --parallel=$(THREADS) --cache=./var/.phpcs.cache.json --standard=./etc/qa/phpcs.xml || $(DOCKER_RUN) vendor/bin/phpcbf --parallel=$(THREADS) --cache=./var/.phpcs.cache.json --standard=./etc/qa/phpcs.xml -vvvv
56+
cs-fix: ## Fix any automatically fixable code style issues ##*I*##
57+
$(DOCKER_RUN) vendor/bin/phpcbf --parallel=1 --cache=./var/.phpcs.cache.json --standard=./etc/qa/phpcs.xml || $(DOCKER_RUN) vendor/bin/phpcbf --parallel=1 --cache=./var/.phpcs.cache.json --standard=./etc/qa/phpcs.xml || $(DOCKER_RUN) vendor/bin/phpcbf --parallel=1 --cache=./var/.phpcs.cache.json --standard=./etc/qa/phpcs.xml -vvvv
4958

5059
cs: ## Check the code for code style issues ##*LCH*##
51-
$(DOCKER_RUN) vendor/bin/phpcs --parallel=$(THREADS) --cache=./var/.phpcs.cache.json --standard=./etc/qa/phpcs.xml
60+
$(DOCKER_RUN) vendor/bin/phpcs --parallel=1 --cache=./var/.phpcs.cache.json --standard=./etc/qa/phpcs.xml
5261

5362
stan: ## Run static analysis (PHPStan) ##*LCH*##
5463
$(DOCKER_RUN) vendor/bin/phpstan analyse etc src tests --level max --ansi -c ./etc/qa/phpstan.neon
5564

5665
unit-testing: ## Run tests ##*A*##
5766
$(DOCKER_RUN) vendor/bin/phpunit --colors=always -c ./etc/qa/phpunit.xml --coverage-text --coverage-html ./var/tests-unit-coverage-html --coverage-clover ./var/tests-unit-clover-coverage.xml
58-
$(DOCKER_RUN) test -n "$(COVERALLS_REPO_TOKEN)" && test -n "$(COVERALLS_RUN_LOCALLY)" && test -f ./var/tests-unit-clover-coverage.xml && vendor/bin/php-coveralls -v --coverage_clover ./build/logs/clover.xml --json_path ./var/tests-unit-clover-coverage-upload.json || true
5967

6068
unit-testing-raw: ## Run tests ##*D*## ####
6169
php vendor/phpunit/phpunit/phpunit --colors=always -c ./etc/qa/phpunit.xml --coverage-text --coverage-html ./var/tests-unit-coverage-html --coverage-clover ./var/tests-unit-clover-coverage.xml
62-
test -n "$(COVERALLS_REPO_TOKEN)" && test -n "$(COVERALLS_RUN_LOCALLY)" && test -f ./var/tests-unit-clover-coverage.xml && ./vendor/bin/php-coveralls -v --coverage_clover ./build/logs/clover.xml --json_path ./var/tests-unit-clover-coverage-upload.json || true
6370

6471
mutation-testing: ## Run mutation testing ##*LCH*##
6572
$(DOCKER_RUN) vendor/bin/infection --ansi --log-verbosity=all --ignore-msi-with-no-mutations --threads=$(THREADS) || (cat ./var/infection.log && false)
@@ -73,9 +80,6 @@ composer-require-checker: ## Ensure we require every package used in this packag
7380
composer-unused: ## Ensure we don't require any package we don't use in this package directly ##*C*##
7481
$(DOCKER_RUN) vendor/bin/composer-unused --ansi --configuration=./etc/qa/composer-unused.php
7582

76-
libyear: ### Calculate how many libyear this package is behind with dependencies
77-
$(DOCKER_RUN) vendor/bin/libyear
78-
7983
backward-compatibility-check: ## Check code for backwards incompatible changes ##*C*##
8084
$(MAKE) backward-compatibility-check-raw || true
8185

composer.json

Lines changed: 64 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -1,67 +1,68 @@
11
{
2-
"name": "react-parallel/infinite-pool",
3-
"description": "♾️ Infinite pool for bridging ext-parallel and ReactPHP",
4-
"license": "MIT",
5-
"authors": [
6-
{
7-
"name": "Cees-Jan Kiewiet",
8-
"email": "ceesjank@gmail.com",
9-
"homepage": "http://wyrihaximus.net/"
10-
}
11-
],
12-
"require": {
13-
"php": "^8.3",
14-
"ext-parallel": "*",
15-
"ext-random": "*",
16-
"react-parallel/contracts": "^2.1.0",
17-
"react-parallel/event-loop": "^2.1.0",
18-
"react-parallel/runtime": "^3.1.0",
19-
"react/event-loop": "^1.5",
20-
"react/promise": "^3.2",
21-
"wyrihaximus/constants": "^1.6",
22-
"wyrihaximus/metrics": "^2.1 || ^3",
23-
"wyrihaximus/pool-info": "^2.0"
24-
},
25-
"require-dev": {
26-
"moneyphp/money": "^4.7.0",
27-
"react-parallel/pool-tests": "^5.0.0",
28-
"react-parallel/stubs": "^1.2",
29-
"wyrihaximus/async-test-utilities": "^9.3.0",
30-
"wyrihaximus/makefiles": "^0.4.2"
31-
},
32-
"suggest": {
33-
"ext-random": "More secure group names"
34-
},
35-
"autoload": {
36-
"psr-4": {
37-
"ReactParallel\\Pool\\Infinite\\": "src/"
38-
}
39-
},
40-
"autoload-dev": {
41-
"psr-4": {
42-
"ReactParallel\\Tests\\Pool\\Infinite\\": "tests/"
43-
}
2+
"name": "react-parallel/infinite-pool",
3+
"description": "\u267e\ufe0f Infinite pool for bridging ext-parallel and ReactPHP",
4+
"license": "MIT",
5+
"authors": [
6+
{
7+
"name": "Cees-Jan Kiewiet",
8+
"email": "ceesjank@gmail.com",
9+
"homepage": "http://wyrihaximus.net/"
10+
}
11+
],
12+
"require": {
13+
"php": "^8.4",
14+
"ext-parallel": "*",
15+
"ext-random": "*",
16+
"react-parallel/contracts": "^2.1.0",
17+
"react-parallel/event-loop": "^2.1.0",
18+
"react-parallel/runtime": "^3.1.0",
19+
"react/event-loop": "^1.5",
20+
"react/promise": "^3.2",
21+
"wyrihaximus/constants": "^1.6",
22+
"wyrihaximus/metrics": "^2.1 || ^3",
23+
"wyrihaximus/pool-info": "^2.0"
24+
},
25+
"require-dev": {
26+
"moneyphp/money": "^4.7.0",
27+
"react-parallel/pool-tests": "^5.1.0",
28+
"react-parallel/stubs": "^1.2",
29+
"wyrihaximus/async-test-utilities": "^10.1.0",
30+
"wyrihaximus/makefiles": "^0.6.0"
31+
},
32+
"suggest": {
33+
"ext-random": "More secure group names"
34+
},
35+
"autoload": {
36+
"psr-4": {
37+
"ReactParallel\\Pool\\Infinite\\": "src/"
38+
}
39+
},
40+
"autoload-dev": {
41+
"psr-4": {
42+
"ReactParallel\\Tests\\Pool\\Infinite\\": "tests/"
43+
}
44+
},
45+
"config": {
46+
"allow-plugins": {
47+
"dealerdirect/phpcodesniffer-composer-installer": true,
48+
"ergebnis/composer-normalize": true,
49+
"icanhazstring/composer-unused": true,
50+
"infection/extension-installer": true,
51+
"phpstan/extension-installer": true,
52+
"wyrihaximus/makefiles": true,
53+
"wyrihaximus/test-utilities": true
4454
},
45-
"config": {
46-
"allow-plugins": {
47-
"dealerdirect/phpcodesniffer-composer-installer": true,
48-
"ergebnis/composer-normalize": true,
49-
"icanhazstring/composer-unused": true,
50-
"infection/extension-installer": true,
51-
"phpstan/extension-installer": true,
52-
"wyrihaximus/makefiles": true
53-
},
54-
"platform": {
55-
"php": "8.3.13"
56-
},
57-
"sort-packages": true
55+
"platform": {
56+
"php": "8.4.13"
5857
},
59-
"scripts": {
60-
"post-install-cmd": [
61-
"composer normalize"
62-
],
63-
"post-update-cmd": [
64-
"composer normalize"
65-
]
66-
}
58+
"sort-packages": true
59+
},
60+
"scripts": {
61+
"post-install-cmd": [
62+
"make on-install-or-update || true"
63+
],
64+
"post-update-cmd": [
65+
"make on-install-or-update || true"
66+
]
67+
}
6768
}

0 commit comments

Comments
 (0)