Skip to content

Commit 63b1fdc

Browse files
authored
Merge pull request #65 from reactphp-parallel/3.x-drop-PHP-8.1
[3.x] Drop PHP 8.1
2 parents 9558b87 + 8d7890b commit 63b1fdc

16 files changed

+2546
-3538
lines changed

Makefile

Lines changed: 52 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,15 @@ SHELL=bash
33

44
.PHONY: *
55

6-
COMPOSER_SHOW_EXTENSION_LIST=$(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/.$$//')
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:],')
8+
COMPOSER_SHOW_EXTENSION_LIST=$(shell echo "${COMPOSER_SHOW_EXTENSION_LIST_PROD},${COMPOSER_SHOW_EXTENSION_LIST_DEV}")
79
SLIM_DOCKER_IMAGE=$(shell php -r 'echo count(array_intersect(["gd", "vips"], explode(",", "${COMPOSER_SHOW_EXTENSION_LIST}"))) > 0 ? "" : "-slim";')
8-
COMPOSER_CACHE_DIR=$(shell composer config --global cache-dir -q || echo ${HOME}/.composer-php/cache)
10+
NTS_OR_ZTS_DOCKER_IMAGE=$(shell php -r 'echo count(array_intersect(["parallel"], explode(",", "${COMPOSER_SHOW_EXTENSION_LIST}"))) > 0 ? "zts" : "nts";')
911
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]);")
10-
COMPOSER_CONTAINER_CACHE_DIR=$(shell docker run --rm -it "ghcr.io/wyrihaximusnet/php:${PHP_VERSION}-nts-alpine${SLIM_DOCKER_IMAGE}-dev" composer config --global cache-dir -q || echo ${HOME}/.composer-php/cache)
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)
1115

1216
ifneq ("$(wildcard /.you-are-in-a-wyrihaximus.net-php-docker-image)","")
1317
IN_DOCKER=TRUE
@@ -22,7 +26,7 @@ else
2226
-v "`pwd`:`pwd`" \
2327
-v "${COMPOSER_CACHE_DIR}:${COMPOSER_CONTAINER_CACHE_DIR}" \
2428
-w "`pwd`" \
25-
"ghcr.io/wyrihaximusnet/php:${PHP_VERSION}-zts-alpine${SLIM_DOCKER_IMAGE}-dev"
29+
"${CONTAINER_NAME}"
2630
endif
2731

2832
ifneq (,$(findstring icrosoft,$(shell cat /proc/version)))
@@ -31,65 +35,82 @@ else
3135
THREADS=$(shell nproc)
3236
endif
3337

34-
all: ## Runs everything ###
35-
@grep -E '^[a-zA-Z0-9_-]+:.*?## .*$$' $(MAKEFILE_LIST) | grep -v "###" | awk 'BEGIN {FS = ":.*?## "}; {printf "%s\n", $$1}' | xargs --open-tty $(MAKE)
38+
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)
3640

37-
syntax-php: ## Lint PHP syntax
41+
syntax-php: ## Lint PHP syntax ##*LH*##
3842
$(DOCKER_RUN) vendor/bin/parallel-lint --exclude vendor .
3943

40-
cs-fix: ## Fix any automatically fixable code style issues
44+
rector-upgrade: ## Upgrade any automatically upgradable old code ###
45+
$(DOCKER_RUN) vendor/bin/rector -c ./etc/qa/rector.php
46+
47+
cs-fix: ## Fix any automatically fixable code style issues ###
4148
$(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
4249

43-
cs: ## Check the code for code style issues
50+
cs: ## Check the code for code style issues ##*LCH*##
4451
$(DOCKER_RUN) vendor/bin/phpcs --parallel=$(THREADS) --cache=./var/.phpcs.cache.json --standard=./etc/qa/phpcs.xml
4552

46-
stan: ## Run static analysis (PHPStan)
47-
$(DOCKER_RUN) vendor/bin/phpstan analyse src tests --ansi -c ./etc/qa/phpstan.neon
53+
stan: ## Run static analysis (PHPStan) ##*LCH*##
54+
$(DOCKER_RUN) vendor/bin/phpstan analyse etc src tests --level max --ansi -c ./etc/qa/phpstan.neon
4855

49-
unit-testing: ## Run tests
56+
unit-testing: ## Run tests ##*A*##
5057
$(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
5158
$(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
5259

53-
unit-testing-raw: ## Run tests ###
60+
unit-testing-raw: ## Run tests ##*D*## ####
5461
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
5562
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
5663

57-
mutation-testing: ## Run mutation testing
58-
$(DOCKER_RUN) vendor/bin/roave-infection-static-analysis-plugin --ansi --log-verbosity=all --threads=$(THREADS) --psalm-config etc/qa/psalm.xml || (cat ./var/infection.log && false)
64+
mutation-testing: ## Run mutation testing ##*LCH*##
65+
$(DOCKER_RUN) vendor/bin/infection --ansi --log-verbosity=all --ignore-msi-with-no-mutations --threads=$(THREADS) || (cat ./var/infection.log && false)
5966

60-
mutation-testing-raw: ## Run mutation testing ###
61-
php vendor/roave/infection-static-analysis-plugin/bin/roave-infection-static-analysis-plugin --ansi --log-verbosity=all --threads=$(THREADS) --psalm-config etc/qa/psalm.xml || (cat ./var/infection.log && false)
67+
mutation-testing-raw: ## Run mutation testing ####
68+
vendor/bin/infection --ansi --log-verbosity=all --ignore-msi-with-no-mutations --threads=$(THREADS) || (cat ./var/infection.log && false)
6269

63-
composer-require-checker: ## Ensure we require every package used in this package directly
70+
composer-require-checker: ## Ensure we require every package used in this package directly ##*C*##
6471
$(DOCKER_RUN) vendor/bin/composer-require-checker --ignore-parse-errors --ansi -vvv --config-file=./etc/qa/composer-require-checker.json
6572

66-
composer-unused: ## Ensure we don't require any package we don't use in this package directly
67-
$(DOCKER_RUN) vendor/bin/composer-unused --ansi
73+
composer-unused: ## Ensure we don't require any package we don't use in this package directly ##*C*##
74+
$(DOCKER_RUN) vendor/bin/composer-unused --ansi --configuration=./etc/qa/composer-unused.php
6875

69-
composer-install: ## Install dependencies
70-
$(DOCKER_RUN) composer install --no-progress --ansi --no-interaction --prefer-dist -o
76+
libyear: ### Calculate how many libyear this package is behind with dependencies
77+
$(DOCKER_RUN) vendor/bin/libyear
7178

72-
backward-compatibility-check: ## Check code for backwards incompatible changes
79+
backward-compatibility-check: ## Check code for backwards incompatible changes ##*C*##
7380
$(MAKE) backward-compatibility-check-raw || true
7481

7582
backward-compatibility-check-raw: ## Check code for backwards incompatible changes, doesn't ignore the failure ###
7683
$(DOCKER_RUN) vendor/bin/roave-backward-compatibility-check
7784

78-
shell: ## Provides Shell access in the expected environment ####
79-
$(DOCKER_RUN) bash
80-
81-
install: ## Install dependencies ####
85+
install: ### Install dependencies ####
8286
$(DOCKER_RUN) composer install
8387

84-
update: ## Update dependencies ####
88+
update: ### Update dependencies ####
8589
$(DOCKER_RUN) composer update -W
8690

87-
outdated: ## Show outdated dependencies ####
91+
outdated: ### Show outdated dependencies ####
8892
$(DOCKER_RUN) composer outdated
8993

90-
task-list-ci: ## CI: Generate a JSON array of jobs to run, matches the commands run when running `make (|all)` ###
91-
@grep -E '^[a-zA-Z0-9_-]+:.*?## .*$$' $(MAKEFILE_LIST) | grep -v "###" | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "%s\n", $$1}' | jq --raw-input --slurp -c 'split("\n")| .[0:-1]'
94+
shell: ## Provides Shell access in the expected environment ####
95+
$(DOCKER_RUN) bash
96+
9297

9398
help: ## Show this help ####
9499
@printf "\033[33mUsage:\033[0m\n make [target]\n\n\033[33mTargets:\033[0m\n"
95100
@grep -E '^[a-zA-Z0-9_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf " \033[32m%-32s\033[0m %s\n", $$1, $$2}' | tr -d '#'
101+
102+
task-list-ci-all: ## CI: Generate a JSON array of jobs to run on all variations
103+
@grep -E '^[a-zA-Z0-9_-]+:.*?## .*$$' $(MAKEFILE_LIST) | grep -E "##\*A\*##" | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "%s\n", $$1}' | jq --raw-input --slurp -c 'split("\n")| .[0:-1]'
104+
105+
task-list-ci-dos: ## CI: Generate a JSON array of jobs to run Directly on the OS variations
106+
@grep -E '^[a-zA-Z0-9_-]+:.*?## .*$$' $(MAKEFILE_LIST) | grep -E "##\*D\*##" | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "%s\n", $$1}' | jq --raw-input --slurp -c 'split("\n")| .[0:-1]'
107+
108+
task-list-ci-low: ## CI: Generate a JSON array of jobs to run against the lowest dependencies on the primary threading target
109+
@grep -E '^[a-zA-Z0-9_-]+:.*?## .*$$' $(MAKEFILE_LIST) | grep -E "##\*(L|LC|LCH|LH)\*##" | grep -v "###" | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "%s\n", $$1}' | jq --raw-input --slurp -c 'split("\n")| .[0:-1]'
110+
111+
task-list-ci-locked: ## CI: Generate a JSON array of jobs to run against the locked dependencies on the primary threading target
112+
@grep -E '^[a-zA-Z0-9_-]+:.*?## .*$$' $(MAKEFILE_LIST) | grep -E "##\*(C|LC|LCH|CH)\*##" | grep -v "###" | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "%s\n", $$1}' | jq --raw-input --slurp -c 'split("\n")| .[0:-1]'
113+
114+
task-list-ci-high: ## CI: Generate a JSON array of jobs to run against the highest dependencies on the primary threading target
115+
@grep -E '^[a-zA-Z0-9_-]+:.*?## .*$$' $(MAKEFILE_LIST) | grep -E "##\*(H|LH|LCH|LC)\*##" | grep -v "###" | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "%s\n", $$1}' | jq --raw-input --slurp -c 'split("\n")| .[0:-1]'
116+

composer.json

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -10,23 +10,24 @@
1010
}
1111
],
1212
"require": {
13-
"php": "^8.1",
13+
"php": "^8.3",
1414
"ext-parallel": "*",
15-
"react-parallel/contracts": "^2.0.0",
16-
"react-parallel/event-loop": "^2.0.0",
17-
"react-parallel/runtime": "^3.0.0",
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",
1819
"react/event-loop": "^1.5",
19-
"react/promise": "^2.9 || ^3.2",
20-
"thecodingmachine/safe": "^2.5",
20+
"react/promise": "^3.2",
2121
"wyrihaximus/constants": "^1.6",
22-
"wyrihaximus/metrics": "^2.1",
23-
"wyrihaximus/pool-info": "^1.1 || ^2.0"
22+
"wyrihaximus/metrics": "^2.1 || ^3",
23+
"wyrihaximus/pool-info": "^2.0"
2424
},
2525
"require-dev": {
26-
"moneyphp/money": "^3.2",
27-
"react-parallel/pool-tests": "^4.0.0",
26+
"moneyphp/money": "^4.7.0",
27+
"react-parallel/pool-tests": "^5.0.0",
2828
"react-parallel/stubs": "^1.2",
29-
"wyrihaximus/async-test-utilities": "^5 || ^7.3"
29+
"wyrihaximus/async-test-utilities": "^9.3.0",
30+
"wyrihaximus/makefiles": "^0.4.2"
3031
},
3132
"suggest": {
3233
"ext-random": "More secure group names"
@@ -46,10 +47,12 @@
4647
"dealerdirect/phpcodesniffer-composer-installer": true,
4748
"ergebnis/composer-normalize": true,
4849
"icanhazstring/composer-unused": true,
49-
"infection/extension-installer": true
50+
"infection/extension-installer": true,
51+
"phpstan/extension-installer": true,
52+
"wyrihaximus/makefiles": true
5053
},
5154
"platform": {
52-
"php": "8.1.13"
55+
"php": "8.3.13"
5356
},
5457
"sort-packages": true
5558
},

0 commit comments

Comments
 (0)