Skip to content

Commit 04bb876

Browse files
committed
[2.x] Drop PHP 8.1 support
1 parent 8bd9ec8 commit 04bb876

File tree

9 files changed

+2400
-3350
lines changed

9 files changed

+2400
-3350
lines changed

Makefile

Lines changed: 55 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,11 @@ SHELL=bash
55

66
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/.$$//')
77
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)
8+
NTS_OR_ZTS_DOCKER_IMAGE=$(shell php -r 'echo count(array_intersect(["parallel"], explode(",", "${COMPOSER_SHOW_EXTENSION_LIST}"))) > 0 ? "zts" : "nts";')
99
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)
10+
CONTAINER_NAME=$(shell echo "ghcr.io/wyrihaximusnet/php:${PHP_VERSION}-${NTS_OR_ZTS_DOCKER_IMAGE}-alpine${SLIM_DOCKER_IMAGE}-dev")
11+
COMPOSER_CACHE_DIR=$(shell composer config --global cache-dir -q || echo ${HOME}/.composer-php/cache)
12+
COMPOSER_CONTAINER_CACHE_DIR=$(shell docker run --rm -it ${CONTAINER_NAME} composer config --global cache-dir -q || echo ${HOME}/.composer-php/cache)
1113

1214
ifneq ("$(wildcard /.you-are-in-a-wyrihaximus.net-php-docker-image)","")
1315
IN_DOCKER=TRUE
@@ -22,7 +24,7 @@ else
2224
-v "`pwd`:`pwd`" \
2325
-v "${COMPOSER_CACHE_DIR}:${COMPOSER_CONTAINER_CACHE_DIR}" \
2426
-w "`pwd`" \
25-
"ghcr.io/wyrihaximusnet/php:${PHP_VERSION}-zts-alpine${SLIM_DOCKER_IMAGE}-dev"
27+
"${CONTAINER_NAME}"
2628
endif
2729

2830
ifneq (,$(findstring icrosoft,$(shell cat /proc/version)))
@@ -31,59 +33,82 @@ else
3133
THREADS=$(shell nproc)
3234
endif
3335

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)
36+
php-extension-list:
37+
echo "${COMPOSER_SHOW_EXTENSION_LIST}"
3638

37-
syntax-php: ## Lint PHP syntax
39+
all: ## Runs everything ####
40+
@grep -E '^[a-zA-Z0-9_-]+:.*?## .*$$' $(MAKEFILE_LIST) | grep -v "####" | awk 'BEGIN {FS = ":.*?## "}; {printf "%s\n", $$1}' | xargs --open-tty $(MAKE)
41+
42+
syntax-php: ## Lint PHP syntax ##*LH*##
3843
$(DOCKER_RUN) vendor/bin/parallel-lint --exclude vendor .
3944

40-
cs-fix: ## Fix any automatically fixable code style issues
45+
cs-fix: ## Fix any automatically fixable code style issues ###
4146
$(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
4247

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

46-
stan: ## Run static analysis (PHPStan)
47-
$(DOCKER_RUN) vendor/bin/phpstan analyse src tests --ansi -c ./etc/qa/phpstan.neon
48-
49-
psalm: ## Run static analysis (Psalm)
50-
$(DOCKER_RUN) vendor/bin/psalm --threads=$(THREADS) --shepherd --stats --config=./etc/qa/psalm.xml
51+
stan: ## Run static analysis (PHPStan) ##*LCH*##
52+
$(DOCKER_RUN) vendor/bin/phpstan analyse src tests --level max --ansi -c ./etc/qa/phpstan.neon
5153

52-
unit-testing: ## Run tests
54+
unit-testing: ## Run tests ##*A*##
5355
$(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
5456
$(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
5557

56-
unit-testing-raw: ## Run tests ###
58+
unit-testing-raw: ## Run tests ##*D*## ####
5759
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
5860
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
5961

60-
mutation-testing: ## Run mutation testing
61-
$(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)
62+
mutation-testing: ## Run mutation testing ##*LCH*##
63+
$(DOCKER_RUN) vendor/bin/infection --ansi --log-verbosity=all --threads=$(THREADS) || (cat ./var/infection.log && false)
6264

63-
mutation-testing-raw: ## Run mutation testing ###
64-
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)
65+
mutation-testing-raw: ## Run mutation testing ####
66+
vendor/bin/infection --ansi --log-verbosity=all --threads=$(THREADS) || (cat ./var/infection.log && false)
6567

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

69-
composer-unused: ## Ensure we don't require any package we don't use in this package directly
70-
$(DOCKER_RUN) vendor/bin/composer-unused --ansi
71+
composer-unused: ## Ensure we don't require any package we don't use in this package directly ##*C*##
72+
$(DOCKER_RUN) vendor/bin/composer-unused --ansi --configuration=./etc/qa/composer-unused.php
7173

72-
composer-install: ## Install dependencies
73-
$(DOCKER_RUN) composer install --no-progress --ansi --no-interaction --prefer-dist -o
74+
libyear: ### Calculate how many libyear this package is behind with dependencies
75+
$(DOCKER_RUN) vendor/bin/libyear
7476

75-
backward-compatibility-check: ## Check code for backwards incompatible changes
77+
backward-compatibility-check: ## Check code for backwards incompatible changes ##*C*##
7678
$(MAKE) backward-compatibility-check-raw || true
7779

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

81-
shell: ## Provides Shell access in the expected environment ###
82-
$(DOCKER_RUN) ash
83+
install: ### Install dependencies ####
84+
$(DOCKER_RUN) composer install
85+
86+
update: ### Update dependencies ####
87+
$(DOCKER_RUN) composer update -W
88+
89+
outdated: ### Show outdated dependencies ####
90+
$(DOCKER_RUN) composer outdated
91+
92+
shell: ## Provides Shell access in the expected environment ####
93+
$(DOCKER_RUN) bash
8394

84-
task-list-ci: ## CI: Generate a JSON array of jobs to run, matches the commands run when running `make (|all)` ###
85-
@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]'
8695

87-
help: ## Show this help ###
96+
help: ## Show this help ####
8897
@printf "\033[33mUsage:\033[0m\n make [target]\n\n\033[33mTargets:\033[0m\n"
8998
@grep -E '^[a-zA-Z0-9_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf " \033[32m%-32s\033[0m %s\n", $$1, $$2}' | tr -d '#'
99+
100+
task-list-ci-all: ## CI: Generate a JSON array of jobs to run on all variations
101+
@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]'
102+
103+
task-list-ci-dos: ## CI: Generate a JSON array of jobs to run Directly on the OS variations
104+
@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]'
105+
106+
task-list-ci-low: ## CI: Generate a JSON array of jobs to run against the lowest dependencies on the primary threading target
107+
@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]'
108+
109+
task-list-ci-locked: ## CI: Generate a JSON array of jobs to run against the locked dependencies on the primary threading target
110+
@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]'
111+
112+
task-list-ci-high: ## CI: Generate a JSON array of jobs to run against the highest dependencies on the primary threading target
113+
@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]'
114+

composer.json

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,19 @@
1010
}
1111
],
1212
"require": {
13-
"php": "^8.1",
13+
"php": "^8.3",
1414
"ext-parallel": "*",
15-
"react/async": "^4.2",
15+
"react/async": "^4.3",
1616
"react/event-loop": "^1.5",
17-
"react/promise": "^2.11 || ^3.2",
17+
"react/promise": "^3.2",
1818
"wyrihaximus/constants": "^1.6.0",
19-
"wyrihaximus/metrics": "^2.1"
19+
"wyrihaximus/metrics": "^3"
2020
},
2121
"require-dev": {
22-
"react-parallel/stubs": "^1.1",
23-
"wyrihaximus/async-test-utilities": "^5.0.25 || ^8.0.5"
22+
"react-parallel/stubs": "^1.2",
23+
"react/promise-timer": "^1.11",
24+
"wyrihaximus/async-test-utilities": "^9.0.0",
25+
"wyrihaximus/makefiles": "dev-fix-extension-detection as 0.3.2"
2426
},
2527
"autoload": {
2628
"psr-4": {
@@ -37,10 +39,12 @@
3739
"dealerdirect/phpcodesniffer-composer-installer": true,
3840
"ergebnis/composer-normalize": true,
3941
"icanhazstring/composer-unused": true,
40-
"infection/extension-installer": true
42+
"infection/extension-installer": true,
43+
"phpstan/extension-installer": true,
44+
"wyrihaximus/makefiles": true
4145
},
4246
"platform": {
43-
"php": "8.1.13"
47+
"php": "8.3.13"
4448
},
4549
"sort-packages": true
4650
},

0 commit comments

Comments
 (0)